Skip to content

Commit

Permalink
[Breaking] Use queueId inside result for write endpoints (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj authored Sep 28, 2023
1 parent b3e5bbd commit 1ecbc2b
Show file tree
Hide file tree
Showing 75 changed files with 264 additions and 149 deletions.
4 changes: 3 additions & 1 deletion server/api/contract/extensions/account/write/grantAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const grantAdmin = async (fastify: FastifyInstance) => {
const queueId = await queueTx({ tx, chainId, extension: "account" });

rep.status(StatusCodes.OK).send({
result: queueId,
result: {
queueId,
},
});
},
});
Expand Down
4 changes: 3 additions & 1 deletion server/api/contract/extensions/account/write/grantSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export const grantSession = async (fastify: FastifyInstance) => {
const queueId = await queueTx({ tx, chainId, extension: "account" });

rep.status(StatusCodes.OK).send({
result: queueId,
result: {
queueId,
},
});
},
});
Expand Down
4 changes: 3 additions & 1 deletion server/api/contract/extensions/account/write/revokeAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const revokeAdmin = async (fastify: FastifyInstance) => {
const queueId = await queueTx({ tx, chainId, extension: "account" });

rep.status(StatusCodes.OK).send({
result: queueId,
result: {
queueId,
},
});
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export const revokeSession = async (fastify: FastifyInstance) => {
const queueId = await queueTx({ tx, chainId, extension: "account" });

rep.status(StatusCodes.OK).send({
result: queueId,
result: {
queueId,
},
});
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export const updateSession = async (fastify: FastifyInstance) => {
const queueId = await queueTx({ tx, chainId, extension: "account" });

rep.status(StatusCodes.OK).send({
result: queueId,
result: {
queueId,
},
});
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const createAccount = async (fastify: FastifyInstance) => {
admin_address,
extra_data,
);
const queuedId = await queueTx({
const queueId = await queueTx({
tx,
chainId,
extension: "account-factory",
Expand All @@ -74,7 +74,7 @@ export const createAccount = async (fastify: FastifyInstance) => {

rep.status(StatusCodes.OK).send({
result: {
queuedId,
queueId,
deployedAddress,
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/airdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ export async function erc1155airdrop(fastify: FastifyInstance) {
});

const tx = await contract.erc1155.airdrop.prepare(token_id, addresses);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ export async function erc1155burn(fastify: FastifyInstance) {
});

const tx = await contract.erc1155.burn.prepare(token_id, amount);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/burnBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ export async function erc1155burnBatch(fastify: FastifyInstance) {
});

const tx = await contract.erc1155.burnBatch.prepare(token_ids, amounts);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/claimTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
token_id,
quantity,
);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/lazyMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ export async function erc1155lazyMint(fastify: FastifyInstance) {
});

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

reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ export async function erc1155mintAdditionalSupplyTo(fastify: FastifyInstance) {
additional_supply,
);

const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/mintBatchTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ export async function erc1155mintBatchTo(fastify: FastifyInstance) {
receiver,
metadataWithSupply,
);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });

reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/mintTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ export async function erc1155mintTo(fastify: FastifyInstance) {
metadataWithSupply,
);

const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ export async function erc1155SetApprovalForAll(fastify: FastifyInstance) {
approved,
);

const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/signatureMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ export async function erc1155SignatureMint(fastify: FastifyInstance) {
signature,
};
const tx = await contract.erc1155.signature.mint.prepare(signedPayload);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ export async function erc1155transfer(fastify: FastifyInstance) {
});

const tx = await contract.erc1155.transfer.prepare(to, token_id, amount);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc1155/write/transferFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ export async function erc1155transferFrom(fastify: FastifyInstance) {
token_id,
amount,
);
const queuedId = await queueTx({ tx, chainId, extension: "erc1155" });
const queueId = await queueTx({ tx, chainId, extension: "erc1155" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ export async function erc20burn(fastify: FastifyInstance) {
});

const tx = await contract.erc20.burn.prepare(amount);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/burnFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ export async function erc20burnFrom(fastify: FastifyInstance) {
});

const tx = await contract.erc20.burnFrom.prepare(holder_address, amount);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/claimTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ export async function erc20claimTo(fastify: FastifyInstance) {
});

const tx = await contract.erc20.claimTo.prepare(recipient, amount);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/mintBatchTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ export async function erc20mintBatchTo(fastify: FastifyInstance) {
});

const tx = await contract.erc20.mintBatchTo.prepare(data);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/mintTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ export async function erc20mintTo(fastify: FastifyInstance) {
});

const tx = await contract.erc20.mintTo.prepare(to_address, amount);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/setAllowance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ export async function erc20SetAlowance(fastify: FastifyInstance) {
spender_address,
amount,
);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/signatureMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export async function erc20SignatureMint(fastify: FastifyInstance) {
signature,
};
const tx = await contract.erc20.signature.mint.prepare(signedPayload);
const queuedId = await queueTx({ tx, chainId, extension: "erc20" });
const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
8 changes: 4 additions & 4 deletions server/api/contract/extensions/erc20/write/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ export async function erc20Transfer(fastify: FastifyInstance) {
});

const tx = await contract.erc20.transfer.prepare(to_address, amount);

const queuedId = await queueTx({ tx, chainId, extension: "erc20" });

const queueId = await queueTx({ tx, chainId, extension: "erc20" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc20/write/transferFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export async function erc20TransferFrom(fastify: FastifyInstance) {
amount,
);

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

reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc721/write/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ export async function erc721burn(fastify: FastifyInstance) {
});

const tx = await contract.erc721.burn.prepare(token_id);
const queuedId = await queueTx({ tx, chainId, extension: "erc721" });
const queueId = await queueTx({ tx, chainId, extension: "erc721" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
6 changes: 4 additions & 2 deletions server/api/contract/extensions/erc721/write/claimTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ export async function erc721claimTo(fastify: FastifyInstance) {
});

const tx = await contract.erc721.claimTo.prepare(receiver, quantity);
const queuedId = await queueTx({ tx, chainId, extension: "erc721" });
const queueId = await queueTx({ tx, chainId, extension: "erc721" });
reply.status(StatusCodes.OK).send({
result: queuedId,
result: {
queueId,
},
});
},
});
Expand Down
Loading

0 comments on commit 1ecbc2b

Please sign in to comment.