Skip to content

Commit 1ecbc2b

Browse files
authored
[Breaking] Use queueId inside result for write endpoints (#177)
1 parent b3e5bbd commit 1ecbc2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+264
-149
lines changed

server/api/contract/extensions/account/write/grantAdmin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export const grantAdmin = async (fastify: FastifyInstance) => {
5757
const queueId = await queueTx({ tx, chainId, extension: "account" });
5858

5959
rep.status(StatusCodes.OK).send({
60-
result: queueId,
60+
result: {
61+
queueId,
62+
},
6163
});
6264
},
6365
});

server/api/contract/extensions/account/write/grantSession.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export const grantSession = async (fastify: FastifyInstance) => {
6161
const queueId = await queueTx({ tx, chainId, extension: "account" });
6262

6363
rep.status(StatusCodes.OK).send({
64-
result: queueId,
64+
result: {
65+
queueId,
66+
},
6567
});
6668
},
6769
});

server/api/contract/extensions/account/write/revokeAdmin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export const revokeAdmin = async (fastify: FastifyInstance) => {
5757
const queueId = await queueTx({ tx, chainId, extension: "account" });
5858

5959
rep.status(StatusCodes.OK).send({
60-
result: queueId,
60+
result: {
61+
queueId,
62+
},
6163
});
6264
},
6365
});

server/api/contract/extensions/account/write/revokeSession.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export const revokeSession = async (fastify: FastifyInstance) => {
5454
const queueId = await queueTx({ tx, chainId, extension: "account" });
5555

5656
rep.status(StatusCodes.OK).send({
57-
result: queueId,
57+
result: {
58+
queueId,
59+
},
5860
});
5961
},
6062
});

server/api/contract/extensions/account/write/updateSession.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ export const updateSession = async (fastify: FastifyInstance) => {
7070
const queueId = await queueTx({ tx, chainId, extension: "account" });
7171

7272
rep.status(StatusCodes.OK).send({
73-
result: queueId,
73+
result: {
74+
queueId,
75+
},
7476
});
7577
},
7678
});

server/api/contract/extensions/accountFactory/write/createAccount.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const createAccount = async (fastify: FastifyInstance) => {
6464
admin_address,
6565
extra_data,
6666
);
67-
const queuedId = await queueTx({
67+
const queueId = await queueTx({
6868
tx,
6969
chainId,
7070
extension: "account-factory",
@@ -74,7 +74,7 @@ export const createAccount = async (fastify: FastifyInstance) => {
7474

7575
rep.status(StatusCodes.OK).send({
7676
result: {
77-
queuedId,
77+
queueId,
7878
deployedAddress,
7979
},
8080
});

server/api/contract/extensions/erc1155/write/airdrop.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ export async function erc1155airdrop(fastify: FastifyInstance) {
8484
});
8585

8686
const tx = await contract.erc1155.airdrop.prepare(token_id, addresses);
87-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
87+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
8888
reply.status(StatusCodes.OK).send({
89-
result: queuedId,
89+
result: {
90+
queueId,
91+
},
9092
});
9193
},
9294
});

server/api/contract/extensions/erc1155/write/burn.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ export async function erc1155burn(fastify: FastifyInstance) {
6767
});
6868

6969
const tx = await contract.erc1155.burn.prepare(token_id, amount);
70-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
70+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
7171
reply.status(StatusCodes.OK).send({
72-
result: queuedId,
72+
result: {
73+
queueId,
74+
},
7375
});
7476
},
7577
});

server/api/contract/extensions/erc1155/write/burnBatch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ export async function erc1155burnBatch(fastify: FastifyInstance) {
7373
});
7474

7575
const tx = await contract.erc1155.burnBatch.prepare(token_ids, amounts);
76-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
76+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
7777
reply.status(StatusCodes.OK).send({
78-
result: queuedId,
78+
result: {
79+
queueId,
80+
},
7981
});
8082
},
8183
});

server/api/contract/extensions/erc1155/write/claimTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
7575
token_id,
7676
quantity,
7777
);
78-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
78+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
7979
reply.status(StatusCodes.OK).send({
80-
result: queuedId,
80+
result: {
81+
queueId,
82+
},
8183
});
8284
},
8385
});

server/api/contract/extensions/erc1155/write/lazyMint.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ export async function erc1155lazyMint(fastify: FastifyInstance) {
7474
});
7575

7676
const tx = await contract.erc1155.lazyMint.prepare(metadatas);
77-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
77+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
7878

7979
reply.status(StatusCodes.OK).send({
80-
result: queuedId,
80+
result: {
81+
queueId,
82+
},
8183
});
8284
},
8385
});

server/api/contract/extensions/erc1155/write/mintAdditionalSupplyTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ export async function erc1155mintAdditionalSupplyTo(fastify: FastifyInstance) {
7676
additional_supply,
7777
);
7878

79-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
79+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
8080
reply.status(StatusCodes.OK).send({
81-
result: queuedId,
81+
result: {
82+
queueId,
83+
},
8284
});
8385
},
8486
});

server/api/contract/extensions/erc1155/write/mintBatchTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ export async function erc1155mintBatchTo(fastify: FastifyInstance) {
9090
receiver,
9191
metadataWithSupply,
9292
);
93-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
93+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
9494

9595
reply.status(StatusCodes.OK).send({
96-
result: queuedId,
96+
result: {
97+
queueId,
98+
},
9799
});
98100
},
99101
});

server/api/contract/extensions/erc1155/write/mintTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ export async function erc1155mintTo(fastify: FastifyInstance) {
7979
metadataWithSupply,
8080
);
8181

82-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
82+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
8383
reply.status(StatusCodes.OK).send({
84-
result: queuedId,
84+
result: {
85+
queueId,
86+
},
8587
});
8688
},
8789
});

server/api/contract/extensions/erc1155/write/setApprovalForAll.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ export async function erc1155SetApprovalForAll(fastify: FastifyInstance) {
7474
approved,
7575
);
7676

77-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
77+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
7878
reply.status(StatusCodes.OK).send({
79-
result: queuedId,
79+
result: {
80+
queueId,
81+
},
8082
});
8183
},
8284
});

server/api/contract/extensions/erc1155/write/signatureMint.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ export async function erc1155SignatureMint(fastify: FastifyInstance) {
7777
signature,
7878
};
7979
const tx = await contract.erc1155.signature.mint.prepare(signedPayload);
80-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
80+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
8181
reply.status(StatusCodes.OK).send({
82-
result: queuedId,
82+
result: {
83+
queueId,
84+
},
8385
});
8486
},
8587
});

server/api/contract/extensions/erc1155/write/transfer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ export async function erc1155transfer(fastify: FastifyInstance) {
7272
});
7373

7474
const tx = await contract.erc1155.transfer.prepare(to, token_id, amount);
75-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
75+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
7676
reply.status(StatusCodes.OK).send({
77-
result: queuedId,
77+
result: {
78+
queueId,
79+
},
7880
});
7981
},
8082
});

server/api/contract/extensions/erc1155/write/transferFrom.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ export async function erc1155transferFrom(fastify: FastifyInstance) {
8282
token_id,
8383
amount,
8484
);
85-
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
85+
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
8686
reply.status(StatusCodes.OK).send({
87-
result: queuedId,
87+
result: {
88+
queueId,
89+
},
8890
});
8991
},
9092
});

server/api/contract/extensions/erc20/write/burn.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ export async function erc20burn(fastify: FastifyInstance) {
6464
});
6565

6666
const tx = await contract.erc20.burn.prepare(amount);
67-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
67+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
6868
reply.status(StatusCodes.OK).send({
69-
result: queuedId,
69+
result: {
70+
queueId,
71+
},
7072
});
7173
},
7274
});

server/api/contract/extensions/erc20/write/burnFrom.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ export async function erc20burnFrom(fastify: FastifyInstance) {
6969
});
7070

7171
const tx = await contract.erc20.burnFrom.prepare(holder_address, amount);
72-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
72+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
7373
reply.status(StatusCodes.OK).send({
74-
result: queuedId,
74+
result: {
75+
queueId,
76+
},
7577
});
7678
},
7779
});

server/api/contract/extensions/erc20/write/claimTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ export async function erc20claimTo(fastify: FastifyInstance) {
6868
});
6969

7070
const tx = await contract.erc20.claimTo.prepare(recipient, amount);
71-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
71+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
7272
reply.status(StatusCodes.OK).send({
73-
result: queuedId,
73+
result: {
74+
queueId,
75+
},
7476
});
7577
},
7678
});

server/api/contract/extensions/erc20/write/mintBatchTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ export async function erc20mintBatchTo(fastify: FastifyInstance) {
7979
});
8080

8181
const tx = await contract.erc20.mintBatchTo.prepare(data);
82-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
82+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
8383
reply.status(StatusCodes.OK).send({
84-
result: queuedId,
84+
result: {
85+
queueId,
86+
},
8587
});
8688
},
8789
});

server/api/contract/extensions/erc20/write/mintTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ export async function erc20mintTo(fastify: FastifyInstance) {
6868
});
6969

7070
const tx = await contract.erc20.mintTo.prepare(to_address, amount);
71-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
71+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
7272
reply.status(StatusCodes.OK).send({
73-
result: queuedId,
73+
result: {
74+
queueId,
75+
},
7476
});
7577
},
7678
});

server/api/contract/extensions/erc20/write/setAllowance.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ export async function erc20SetAlowance(fastify: FastifyInstance) {
7171
spender_address,
7272
amount,
7373
);
74-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
74+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
7575
reply.status(StatusCodes.OK).send({
76-
result: queuedId,
76+
result: {
77+
queueId,
78+
},
7779
});
7880
},
7981
});

server/api/contract/extensions/erc20/write/signatureMint.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ export async function erc20SignatureMint(fastify: FastifyInstance) {
7575
signature,
7676
};
7777
const tx = await contract.erc20.signature.mint.prepare(signedPayload);
78-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
78+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
7979
reply.status(StatusCodes.OK).send({
80-
result: queuedId,
80+
result: {
81+
queueId,
82+
},
8183
});
8284
},
8385
});

server/api/contract/extensions/erc20/write/transfer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ export async function erc20Transfer(fastify: FastifyInstance) {
7070
});
7171

7272
const tx = await contract.erc20.transfer.prepare(to_address, amount);
73-
74-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
75-
73+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
7674
reply.status(StatusCodes.OK).send({
77-
result: queuedId,
75+
result: {
76+
queueId,
77+
},
7878
});
7979
},
8080
});

server/api/contract/extensions/erc20/write/transferFrom.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ export async function erc20TransferFrom(fastify: FastifyInstance) {
8080
amount,
8181
);
8282

83-
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
83+
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
8484

8585
reply.status(StatusCodes.OK).send({
86-
result: queuedId,
86+
result: {
87+
queueId,
88+
},
8789
});
8890
},
8991
});

server/api/contract/extensions/erc721/write/burn.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ export async function erc721burn(fastify: FastifyInstance) {
6363
});
6464

6565
const tx = await contract.erc721.burn.prepare(token_id);
66-
const queuedId = await queueTx({ tx, chainId, extension: "erc721" });
66+
const queueId = await queueTx({ tx, chainId, extension: "erc721" });
6767
reply.status(StatusCodes.OK).send({
68-
result: queuedId,
68+
result: {
69+
queueId,
70+
},
6971
});
7072
},
7173
});

server/api/contract/extensions/erc721/write/claimTo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ export async function erc721claimTo(fastify: FastifyInstance) {
6767
});
6868

6969
const tx = await contract.erc721.claimTo.prepare(receiver, quantity);
70-
const queuedId = await queueTx({ tx, chainId, extension: "erc721" });
70+
const queueId = await queueTx({ tx, chainId, extension: "erc721" });
7171
reply.status(StatusCodes.OK).send({
72-
result: queuedId,
72+
result: {
73+
queueId,
74+
},
7375
});
7476
},
7577
});

0 commit comments

Comments
 (0)