Skip to content

Commit 6d1b829

Browse files
add gas to txOverrides
1 parent 8a2558b commit 6d1b829

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/server/routes/contract/write/write.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export async function writeToContract(fastify: FastifyInstance) {
8585
walletAddress,
8686
accountAddress,
8787
});
88-
const tx = await contract.prepare(functionName, args, txOverrides);
88+
const tx = contract.prepare(functionName, args, {
89+
value: txOverrides?.value,
90+
gasLimit: txOverrides?.gas,
91+
});
8992

9093
const queueId = await queueTx({
9194
tx,

src/server/schemas/txOverrides.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ export const txOverrides = Type.Object({
55
Type.Object({
66
value: Type.Optional(
77
Type.String({
8-
examples: ["0"],
8+
examples: ["10000000000"],
99
description: "Amount of native currency to send",
1010
}),
1111
),
12+
gas: Type.Optional(
13+
Type.String({
14+
examples: ["530000"],
15+
description: "Gas limit for the transaction",
16+
}),
17+
),
1218
}),
1319
),
1420
});

0 commit comments

Comments
 (0)