Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"prisma": "^5.14.0",
"prom-client": "^15.1.3",
"superjson": "^2.2.1",
"thirdweb": "5.61.3",
"thirdweb": "^5.71.0",
"uuid": "^9.0.1",
"winston": "^3.14.1",
"zod": "^3.23.8"
Expand Down
11 changes: 9 additions & 2 deletions src/server/routes/contract/extensions/erc1155/write/claimTo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Static, Type } from "@sinclair/typebox";
import { Static, Type } from "@sinclair/typebox";
import type { FastifyInstance } from "fastify";
import { StatusCodes } from "http-status-codes";
import type { Address } from "thirdweb";
Expand Down Expand Up @@ -33,6 +33,11 @@ const requestBodySchema = Type.Object({
quantity: Type.String({
description: "Quantity of NFTs to mint",
}),
singlePhaseDrop: Type.Optional(
Type.Boolean({
description: "Whether the drop is a single phase drop",
}),
),
...txOverridesWithValueSchema.properties,
});

Expand Down Expand Up @@ -70,7 +75,8 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
handler: async (request, reply) => {
const { chain, contractAddress } = request.params;
const { simulateTx } = request.query;
const { receiver, tokenId, quantity, txOverrides } = request.body;
const { receiver, tokenId, quantity, singlePhaseDrop, txOverrides } =
request.body;
const {
"x-backend-wallet-address": fromAddress,
"x-account-address": accountAddress,
Expand All @@ -91,6 +97,7 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
to: receiver,
quantity: BigInt(quantity),
tokenId: BigInt(tokenId),
singlePhaseDrop,
});

const queueId = await queueTransaction({
Expand Down
10 changes: 8 additions & 2 deletions src/server/routes/contract/extensions/erc20/write/claimTo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Static, Type } from "@sinclair/typebox";
import { Static, Type } from "@sinclair/typebox";
import type { FastifyInstance } from "fastify";
import { StatusCodes } from "http-status-codes";
import type { Address } from "thirdweb";
Expand Down Expand Up @@ -28,6 +28,11 @@ const requestBodySchema = Type.Object({
amount: Type.String({
description: "The amount of tokens to claim.",
}),
singlePhaseDrop: Type.Optional(
Type.Boolean({
description: "Whether the drop is a single phase drop",
}),
),
...txOverridesWithValueSchema.properties,
});

Expand Down Expand Up @@ -65,7 +70,7 @@ export async function erc20claimTo(fastify: FastifyInstance) {
handler: async (request, reply) => {
const { chain, contractAddress } = request.params;
const { simulateTx } = request.query;
const { recipient, amount, txOverrides } = request.body;
const { recipient, amount, singlePhaseDrop, txOverrides } = request.body;
const {
"x-backend-wallet-address": fromAddress,
"x-account-address": accountAddress,
Expand All @@ -84,6 +89,7 @@ export async function erc20claimTo(fastify: FastifyInstance) {
from: fromAddress as Address,
to: recipient,
quantity: amount,
singlePhaseDrop,
});

const queueId = await queueTransaction({
Expand Down
10 changes: 8 additions & 2 deletions src/server/routes/contract/extensions/erc721/write/claimTo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Static, Type } from "@sinclair/typebox";
import { Static, Type } from "@sinclair/typebox";
import type { FastifyInstance } from "fastify";
import { StatusCodes } from "http-status-codes";
import type { Address } from "thirdweb";
Expand Down Expand Up @@ -30,6 +30,11 @@ const requestBodySchema = Type.Object({
quantity: Type.String({
description: "Quantity of NFTs to mint",
}),
singlePhaseDrop: Type.Optional(
Type.Boolean({
description: "Whether the drop is a single phase drop",
}),
),
...txOverridesWithValueSchema.properties,
});

Expand Down Expand Up @@ -66,7 +71,7 @@ export async function erc721claimTo(fastify: FastifyInstance) {
handler: async (request, reply) => {
const { chain, contractAddress } = request.params;
const { simulateTx } = request.query;
const { receiver, quantity, txOverrides } = request.body;
const { receiver, quantity, singlePhaseDrop, txOverrides } = request.body;
const {
"x-backend-wallet-address": fromAddress,
"x-account-address": accountAddress,
Expand All @@ -85,6 +90,7 @@ export async function erc721claimTo(fastify: FastifyInstance) {
from: fromAddress as Address,
to: receiver,
quantity: BigInt(quantity),
singlePhaseDrop,
});

const queueId = await queueTransaction({
Expand Down
Loading