Skip to content

Commit 22827e3

Browse files
eabdelmoneimclaude
andcommitted
fix: include gas parameters in mined transaction webhooks
Previously gasLimit and gasPrice fields were null in mined transaction webhooks because the resolver functions only checked for "sent" status. Since MinedTransaction inherits gas fields from SentTransaction, these values should be available for mined transactions as well. Updates the resolver functions to include "mined" status: - resolveGas() - returns transaction.gas for sent/mined transactions - resolveGasPrice() - returns transaction.gasPrice for sent/mined transactions - resolveMaxFeePerGas() - returns transaction.maxFeePerGas for sent/mined transactions - resolveMaxPriorityFeePerGas() - returns transaction.maxPriorityFeePerGas for sent/mined transactions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 067d5da commit 22827e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/server/schemas/transaction/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,28 +277,28 @@ export const toTransactionSchema = (
277277
};
278278

279279
const resolveGas = (): string | null => {
280-
if (transaction.status === "sent") {
280+
if (transaction.status === "sent" || transaction.status === "mined") {
281281
return transaction.gas.toString();
282282
}
283283
return transaction.overrides?.gas?.toString() ?? null;
284284
};
285285

286286
const resolveGasPrice = (): string | null => {
287-
if (transaction.status === "sent") {
287+
if (transaction.status === "sent" || transaction.status === "mined") {
288288
return transaction.gasPrice?.toString() ?? null;
289289
}
290290
return transaction.overrides?.gasPrice?.toString() ?? null;
291291
};
292292

293293
const resolveMaxFeePerGas = (): string | null => {
294-
if (transaction.status === "sent") {
294+
if (transaction.status === "sent" || transaction.status === "mined") {
295295
return transaction.maxFeePerGas?.toString() ?? null;
296296
}
297297
return transaction.overrides?.maxFeePerGas?.toString() ?? null;
298298
};
299299

300300
const resolveMaxPriorityFeePerGas = (): string | null => {
301-
if (transaction.status === "sent") {
301+
if (transaction.status === "sent" || transaction.status === "mined") {
302302
return transaction.maxPriorityFeePerGas?.toString() ?? null;
303303
}
304304
return transaction.overrides?.maxPriorityFeePerGas?.toString() ?? null;

0 commit comments

Comments
 (0)