Skip to content

Commit 9cc32d3

Browse files
authored
chore: Add support for singlePhaseDrop for claimTo calls (#782)
* chore: Add support for singlePhaseDrop for claimTo calls * remove comment
1 parent 77da8a4 commit 9cc32d3

File tree

5 files changed

+318
-164
lines changed

5 files changed

+318
-164
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"prisma": "^5.14.0",
6868
"prom-client": "^15.1.3",
6969
"superjson": "^2.2.1",
70-
"thirdweb": "5.61.3",
70+
"thirdweb": "^5.71.0",
7171
"uuid": "^9.0.1",
7272
"winston": "^3.14.1",
7373
"zod": "^3.23.8"

src/server/routes/contract/extensions/erc1155/write/claimTo.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Static, Type } from "@sinclair/typebox";
1+
import { Static, Type } from "@sinclair/typebox";
22
import type { FastifyInstance } from "fastify";
33
import { StatusCodes } from "http-status-codes";
44
import type { Address } from "thirdweb";
@@ -33,6 +33,11 @@ const requestBodySchema = Type.Object({
3333
quantity: Type.String({
3434
description: "Quantity of NFTs to mint",
3535
}),
36+
singlePhaseDrop: Type.Optional(
37+
Type.Boolean({
38+
description: "Whether the drop is a single phase drop",
39+
}),
40+
),
3641
...txOverridesWithValueSchema.properties,
3742
});
3843

@@ -70,7 +75,8 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
7075
handler: async (request, reply) => {
7176
const { chain, contractAddress } = request.params;
7277
const { simulateTx } = request.query;
73-
const { receiver, tokenId, quantity, txOverrides } = request.body;
78+
const { receiver, tokenId, quantity, singlePhaseDrop, txOverrides } =
79+
request.body;
7480
const {
7581
"x-backend-wallet-address": fromAddress,
7682
"x-account-address": accountAddress,
@@ -91,6 +97,7 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
9197
to: receiver,
9298
quantity: BigInt(quantity),
9399
tokenId: BigInt(tokenId),
100+
singlePhaseDrop,
94101
});
95102

96103
const queueId = await queueTransaction({

src/server/routes/contract/extensions/erc20/write/claimTo.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Static, Type } from "@sinclair/typebox";
1+
import { Static, Type } from "@sinclair/typebox";
22
import type { FastifyInstance } from "fastify";
33
import { StatusCodes } from "http-status-codes";
44
import type { Address } from "thirdweb";
@@ -28,6 +28,11 @@ const requestBodySchema = Type.Object({
2828
amount: Type.String({
2929
description: "The amount of tokens to claim.",
3030
}),
31+
singlePhaseDrop: Type.Optional(
32+
Type.Boolean({
33+
description: "Whether the drop is a single phase drop",
34+
}),
35+
),
3136
...txOverridesWithValueSchema.properties,
3237
});
3338

@@ -65,7 +70,7 @@ export async function erc20claimTo(fastify: FastifyInstance) {
6570
handler: async (request, reply) => {
6671
const { chain, contractAddress } = request.params;
6772
const { simulateTx } = request.query;
68-
const { recipient, amount, txOverrides } = request.body;
73+
const { recipient, amount, singlePhaseDrop, txOverrides } = request.body;
6974
const {
7075
"x-backend-wallet-address": fromAddress,
7176
"x-account-address": accountAddress,
@@ -84,6 +89,7 @@ export async function erc20claimTo(fastify: FastifyInstance) {
8489
from: fromAddress as Address,
8590
to: recipient,
8691
quantity: amount,
92+
singlePhaseDrop,
8793
});
8894

8995
const queueId = await queueTransaction({

src/server/routes/contract/extensions/erc721/write/claimTo.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Static, Type } from "@sinclair/typebox";
1+
import { Static, Type } from "@sinclair/typebox";
22
import type { FastifyInstance } from "fastify";
33
import { StatusCodes } from "http-status-codes";
44
import type { Address } from "thirdweb";
@@ -30,6 +30,11 @@ const requestBodySchema = Type.Object({
3030
quantity: Type.String({
3131
description: "Quantity of NFTs to mint",
3232
}),
33+
singlePhaseDrop: Type.Optional(
34+
Type.Boolean({
35+
description: "Whether the drop is a single phase drop",
36+
}),
37+
),
3338
...txOverridesWithValueSchema.properties,
3439
});
3540

@@ -66,7 +71,7 @@ export async function erc721claimTo(fastify: FastifyInstance) {
6671
handler: async (request, reply) => {
6772
const { chain, contractAddress } = request.params;
6873
const { simulateTx } = request.query;
69-
const { receiver, quantity, txOverrides } = request.body;
74+
const { receiver, quantity, singlePhaseDrop, txOverrides } = request.body;
7075
const {
7176
"x-backend-wallet-address": fromAddress,
7277
"x-account-address": accountAddress,
@@ -85,6 +90,7 @@ export async function erc721claimTo(fastify: FastifyInstance) {
8590
from: fromAddress as Address,
8691
to: receiver,
8792
quantity: BigInt(quantity),
93+
singlePhaseDrop,
8894
});
8995

9096
const queueId = await queueTransaction({

0 commit comments

Comments
 (0)