Skip to content

Commit 2fd09b6

Browse files
authored
feat: add transaction mode support to ERC20, ERC721, and ERC1155 v4 SDK routes (#832)
1 parent dd2d8e2 commit 2fd09b6

28 files changed

+59
-3
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export async function erc1155airdrop(fastify: FastifyInstance) {
8181
"x-backend-wallet-address": walletAddress,
8282
"x-account-address": accountAddress,
8383
"x-idempotency-key": idempotencyKey,
84+
"x-transaction-mode": transactionMode,
8485
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
8586
const chainId = await getChainIdFromChain(chain);
8687
const contract = await getContract({
@@ -98,6 +99,7 @@ export async function erc1155airdrop(fastify: FastifyInstance) {
9899
extension: "erc1155",
99100
idempotencyKey,
100101
txOverrides,
102+
transactionMode,
101103
});
102104
reply.status(StatusCodes.OK).send({
103105
result: {

src/server/routes/contract/extensions/erc1155/write/burn-batch.ts

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function erc1155burnBatch(fastify: FastifyInstance) {
6969
"x-backend-wallet-address": walletAddress,
7070
"x-account-address": accountAddress,
7171
"x-idempotency-key": idempotencyKey,
72+
"x-transaction-mode": transactionMode,
7273
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7374

7475
const chainId = await getChainIdFromChain(chain);
@@ -87,6 +88,7 @@ export async function erc1155burnBatch(fastify: FastifyInstance) {
8788
extension: "erc1155",
8889
idempotencyKey,
8990
txOverrides,
91+
transactionMode,
9092
});
9193

9294
reply.status(StatusCodes.OK).send({

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

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export async function erc1155burn(fastify: FastifyInstance) {
6363
"x-backend-wallet-address": walletAddress,
6464
"x-account-address": accountAddress,
6565
"x-idempotency-key": idempotencyKey,
66+
"x-transaction-mode": transactionMode,
6667
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6768

6869
const chainId = await getChainIdFromChain(chain);
@@ -81,6 +82,7 @@ export async function erc1155burn(fastify: FastifyInstance) {
8182
extension: "erc1155",
8283
idempotencyKey,
8384
txOverrides,
85+
transactionMode,
8486
});
8587

8688
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/lazy-mint.ts

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function erc1155lazyMint(fastify: FastifyInstance) {
6969
"x-backend-wallet-address": walletAddress,
7070
"x-account-address": accountAddress,
7171
"x-idempotency-key": idempotencyKey,
72+
"x-transaction-mode": transactionMode,
7273
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7374

7475
const chainId = await getChainIdFromChain(chain);
@@ -87,6 +88,7 @@ export async function erc1155lazyMint(fastify: FastifyInstance) {
8788
extension: "erc1155",
8889
idempotencyKey,
8990
txOverrides,
91+
transactionMode,
9092
});
9193

9294
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/mint-additional-supply-to.ts

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export async function erc1155mintAdditionalSupplyTo(fastify: FastifyInstance) {
7070
"x-backend-wallet-address": walletAddress,
7171
"x-account-address": accountAddress,
7272
"x-idempotency-key": idempotencyKey,
73+
"x-transaction-mode": transactionMode,
7374
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7475

7576
const chainId = await getChainIdFromChain(chain);
@@ -92,6 +93,7 @@ export async function erc1155mintAdditionalSupplyTo(fastify: FastifyInstance) {
9293
extension: "erc1155",
9394
idempotencyKey,
9495
txOverrides,
96+
transactionMode,
9597
});
9698

9799
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/mint-batch-to.ts

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export async function erc1155mintBatchTo(fastify: FastifyInstance) {
8686
"x-backend-wallet-address": walletAddress,
8787
"x-account-address": accountAddress,
8888
"x-idempotency-key": idempotencyKey,
89+
"x-transaction-mode": transactionMode,
8990
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
9091

9192
const chainId = await getChainIdFromChain(chain);
@@ -107,6 +108,7 @@ export async function erc1155mintBatchTo(fastify: FastifyInstance) {
107108
extension: "erc1155",
108109
idempotencyKey,
109110
txOverrides,
111+
transactionMode,
110112
});
111113

112114
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/set-approval-for-all.ts

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export async function erc1155SetApprovalForAll(fastify: FastifyInstance) {
6666
"x-backend-wallet-address": walletAddress,
6767
"x-account-address": accountAddress,
6868
"x-idempotency-key": idempotencyKey,
69+
"x-transaction-mode": transactionMode,
6970
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7071

7172
const chainId = await getChainIdFromChain(chain);
@@ -87,6 +88,7 @@ export async function erc1155SetApprovalForAll(fastify: FastifyInstance) {
8788
extension: "erc1155",
8889
idempotencyKey,
8990
txOverrides,
91+
transactionMode,
9092
});
9193

9294
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/set-batch-claim-conditions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export async function erc1155SetBatchClaimConditions(fastify: FastifyInstance) {
7070
"x-backend-wallet-address": walletAddress,
7171
"x-account-address": accountAddress,
7272
"x-idempotency-key": idempotencyKey,
73+
"x-transaction-mode": transactionMode,
7374
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7475

7576
const chainId = await getChainIdFromChain(chain);
@@ -118,6 +119,7 @@ export async function erc1155SetBatchClaimConditions(fastify: FastifyInstance) {
118119
extension: "erc1155",
119120
idempotencyKey,
120121
txOverrides,
122+
transactionMode,
121123
});
122124

123125
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/set-claim-conditions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export async function erc1155SetClaimCondition(fastify: FastifyInstance) {
6767
"x-backend-wallet-address": walletAddress,
6868
"x-account-address": accountAddress,
6969
"x-idempotency-key": idempotencyKey,
70+
"x-transaction-mode": transactionMode,
7071
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7172

7273
const chainId = await getChainIdFromChain(chain);
@@ -105,6 +106,7 @@ export async function erc1155SetClaimCondition(fastify: FastifyInstance) {
105106
extension: "erc1155",
106107
idempotencyKey,
107108
txOverrides,
109+
transactionMode,
108110
});
109111

110112
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/signature-mint.ts

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function erc1155SignatureMint(fastify: FastifyInstance) {
6262
"x-backend-wallet-address": walletAddress,
6363
"x-account-address": accountAddress,
6464
"x-idempotency-key": idempotencyKey,
65+
"x-transaction-mode": transactionMode,
6566
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6667

6768
const chainId = await getChainIdFromChain(chain);
@@ -91,6 +92,7 @@ export async function erc1155SignatureMint(fastify: FastifyInstance) {
9192
extension: "erc1155",
9293
idempotencyKey,
9394
txOverrides,
95+
transactionMode,
9496
});
9597

9698
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/update-claim-conditions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export async function erc1155UpdateClaimConditions(fastify: FastifyInstance) {
6565
"x-backend-wallet-address": walletAddress,
6666
"x-account-address": accountAddress,
6767
"x-idempotency-key": idempotencyKey,
68+
"x-transaction-mode": transactionMode,
6869
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6970

7071
const chainId = await getChainIdFromChain(chain);
@@ -105,6 +106,7 @@ export async function erc1155UpdateClaimConditions(fastify: FastifyInstance) {
105106
extension: "erc1155",
106107
idempotencyKey,
107108
txOverrides,
109+
transactionMode,
108110
});
109111

110112
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc1155/write/update-token-metadata.ts

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export async function erc1155UpdateTokenMetadata(fastify: FastifyInstance) {
5656
"x-backend-wallet-address": walletAddress,
5757
"x-account-address": accountAddress,
5858
"x-idempotency-key": idempotencyKey,
59+
"x-transaction-mode": transactionMode,
5960
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6061

6162
const chainId = await getChainIdFromChain(chain);
@@ -77,6 +78,7 @@ export async function erc1155UpdateTokenMetadata(fastify: FastifyInstance) {
7778
extension: "erc1155",
7879
idempotencyKey,
7980
txOverrides,
81+
transactionMode,
8082
});
8183

8284
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc20/write/burn-from.ts

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export async function erc20burnFrom(fastify: FastifyInstance) {
6767
"x-backend-wallet-address": walletAddress,
6868
"x-account-address": accountAddress,
6969
"x-idempotency-key": idempotencyKey,
70+
"x-transaction-mode": transactionMode,
7071
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7172

7273
const chainId = await getChainIdFromChain(chain);
@@ -85,6 +86,7 @@ export async function erc20burnFrom(fastify: FastifyInstance) {
8586
extension: "erc20",
8687
idempotencyKey,
8788
txOverrides,
89+
transactionMode,
8890
});
8991

9092
reply.status(StatusCodes.OK).send({

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

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export async function erc20burn(fastify: FastifyInstance) {
6060
"x-backend-wallet-address": walletAddress,
6161
"x-account-address": accountAddress,
6262
"x-idempotency-key": idempotencyKey,
63+
"x-transaction-mode": transactionMode,
6364
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6465

6566
const chainId = await getChainIdFromChain(chain);
@@ -78,6 +79,7 @@ export async function erc20burn(fastify: FastifyInstance) {
7879
extension: "erc20",
7980
idempotencyKey,
8081
txOverrides,
82+
transactionMode,
8183
});
8284

8385
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc20/write/mint-batch-to.ts

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export async function erc20mintBatchTo(fastify: FastifyInstance) {
7777
"x-backend-wallet-address": walletAddress,
7878
"x-account-address": accountAddress,
7979
"x-idempotency-key": idempotencyKey,
80+
"x-transaction-mode": transactionMode,
8081
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
8182

8283
const chainId = await getChainIdFromChain(chain);
@@ -95,6 +96,7 @@ export async function erc20mintBatchTo(fastify: FastifyInstance) {
9596
extension: "erc20",
9697
idempotencyKey,
9798
txOverrides,
99+
transactionMode,
98100
});
99101

100102
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc20/write/set-allowance.ts

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export async function erc20SetAlowance(fastify: FastifyInstance) {
6666
"x-backend-wallet-address": walletAddress,
6767
"x-account-address": accountAddress,
6868
"x-idempotency-key": idempotencyKey,
69+
"x-transaction-mode": transactionMode,
6970
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7071

7172
const chainId = await getChainIdFromChain(chain);
@@ -87,6 +88,7 @@ export async function erc20SetAlowance(fastify: FastifyInstance) {
8788
extension: "erc20",
8889
idempotencyKey,
8990
txOverrides,
91+
transactionMode,
9092
});
9193

9294
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc20/write/set-claim-conditions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export async function erc20SetClaimConditions(fastify: FastifyInstance) {
6060
"x-backend-wallet-address": walletAddress,
6161
"x-account-address": accountAddress,
6262
"x-idempotency-key": idempotencyKey,
63+
"x-transaction-mode": transactionMode,
6364
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6465

6566
const chainId = await getChainIdFromChain(chain);
@@ -96,6 +97,7 @@ export async function erc20SetClaimConditions(fastify: FastifyInstance) {
9697
extension: "erc20",
9798
idempotencyKey,
9899
txOverrides,
100+
transactionMode,
99101
});
100102

101103
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc20/write/signature-mint.ts

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function erc20SignatureMint(fastify: FastifyInstance) {
6262
"x-backend-wallet-address": walletAddress,
6363
"x-account-address": accountAddress,
6464
"x-idempotency-key": idempotencyKey,
65+
"x-transaction-mode": transactionMode,
6566
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6667

6768
const chainId = await getChainIdFromChain(chain);
@@ -90,6 +91,7 @@ export async function erc20SignatureMint(fastify: FastifyInstance) {
9091
extension: "erc20",
9192
idempotencyKey,
9293
txOverrides,
94+
transactionMode,
9395
});
9496

9597
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc20/write/update-claim-conditions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function erc20UpdateClaimConditions(fastify: FastifyInstance) {
6262
"x-backend-wallet-address": walletAddress,
6363
"x-account-address": accountAddress,
6464
"x-idempotency-key": idempotencyKey,
65+
"x-transaction-mode": transactionMode,
6566
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6667

6768
const chainId = await getChainIdFromChain(chain);
@@ -101,6 +102,7 @@ export async function erc20UpdateClaimConditions(fastify: FastifyInstance) {
101102
extension: "erc20",
102103
idempotencyKey,
103104
txOverrides,
105+
transactionMode,
104106
});
105107

106108
reply.status(StatusCodes.OK).send({

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

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export async function erc721burn(fastify: FastifyInstance) {
5959
"x-backend-wallet-address": walletAddress,
6060
"x-account-address": accountAddress,
6161
"x-idempotency-key": idempotencyKey,
62+
"x-transaction-mode": transactionMode,
6263
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6364

6465
const chainId = await getChainIdFromChain(chain);
@@ -77,6 +78,7 @@ export async function erc721burn(fastify: FastifyInstance) {
7778
extension: "erc721",
7879
idempotencyKey,
7980
txOverrides,
81+
transactionMode,
8082
});
8183

8284
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc721/write/lazy-mint.ts

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function erc721lazyMint(fastify: FastifyInstance) {
6969
"x-backend-wallet-address": walletAddress,
7070
"x-account-address": accountAddress,
7171
"x-idempotency-key": idempotencyKey,
72+
"x-transaction-mode": transactionMode,
7273
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
7374

7475
const chainId = await getChainIdFromChain(chain);
@@ -87,6 +88,7 @@ export async function erc721lazyMint(fastify: FastifyInstance) {
8788
extension: "erc721",
8889
idempotencyKey,
8990
txOverrides,
91+
transactionMode,
9092
});
9193

9294
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc721/write/mint-batch-to.ts

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export async function erc721mintBatchTo(fastify: FastifyInstance) {
7676
"x-backend-wallet-address": walletAddress,
7777
"x-account-address": accountAddress,
7878
"x-idempotency-key": idempotencyKey,
79+
"x-transaction-mode": transactionMode,
7980
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
8081

8182
const chainId = await getChainIdFromChain(chain);
@@ -93,6 +94,7 @@ export async function erc721mintBatchTo(fastify: FastifyInstance) {
9394
extension: "erc721",
9495
idempotencyKey,
9596
txOverrides,
97+
transactionMode,
9698
});
9799

98100
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc721/write/set-approval-for-all.ts

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export async function erc721SetApprovalForAll(fastify: FastifyInstance) {
6464
"x-backend-wallet-address": walletAddress,
6565
"x-account-address": accountAddress,
6666
"x-idempotency-key": idempotencyKey,
67+
"x-transaction-mode": transactionMode,
6768
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6869

6970
const chainId = await getChainIdFromChain(chain);
@@ -85,6 +86,7 @@ export async function erc721SetApprovalForAll(fastify: FastifyInstance) {
8586
extension: "erc721",
8687
idempotencyKey,
8788
txOverrides,
89+
transactionMode,
8890
});
8991

9092
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc721/write/set-approval-for-token.ts

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export async function erc721SetApprovalForToken(fastify: FastifyInstance) {
6464
"x-backend-wallet-address": walletAddress,
6565
"x-account-address": accountAddress,
6666
"x-idempotency-key": idempotencyKey,
67+
"x-transaction-mode": transactionMode,
6768
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6869

6970
const chainId = await getChainIdFromChain(chain);
@@ -85,6 +86,7 @@ export async function erc721SetApprovalForToken(fastify: FastifyInstance) {
8586
extension: "erc721",
8687
idempotencyKey,
8788
txOverrides,
89+
transactionMode,
8890
});
8991

9092
reply.status(StatusCodes.OK).send({

src/server/routes/contract/extensions/erc721/write/set-claim-conditions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export async function erc721SetClaimConditions(fastify: FastifyInstance) {
6060
"x-backend-wallet-address": walletAddress,
6161
"x-account-address": accountAddress,
6262
"x-idempotency-key": idempotencyKey,
63+
"x-transaction-mode": transactionMode,
6364
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6465

6566
const chainId = await getChainIdFromChain(chain);
@@ -96,6 +97,7 @@ export async function erc721SetClaimConditions(fastify: FastifyInstance) {
9697
extension: "erc721",
9798
idempotencyKey,
9899
txOverrides,
100+
transactionMode,
99101
});
100102

101103
reply.status(StatusCodes.OK).send({

0 commit comments

Comments
 (0)