From 18282c5d88650eebfcb2c0b5737e30e453074a11 Mon Sep 17 00:00:00 2001 From: roshan <19766713+rpalakkal@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:28:29 -0500 Subject: [PATCH 1/3] fix: fee data fetching --- client/src/sendQuery.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/sendQuery.ts b/client/src/sendQuery.ts index 9743653e..530c24d5 100644 --- a/client/src/sendQuery.ts +++ b/client/src/sendQuery.ts @@ -34,7 +34,7 @@ export const buildSendQuery = async (input: { sourceChainId: input.axiom.config.chainId.toString(), }); } - const { + let { sourceChainId, dataQueryHash, computeQuery, @@ -44,6 +44,10 @@ export const buildSendQuery = async (input: { refundee, dataQuery, } = await qb.build(true); + if (input.options.maxFeePerGas == undefined) { + const maxFeePerGas = await input.axiom.config.provider.getFeeData(); + feeData.maxFeePerGas = maxFeePerGas; + } const payment = await qb.calculateFee(); const id = await qb.getQueryId(input.caller); const abi = input.axiom.getAxiomQueryAbi(); From eaafccc3d208e2ab7ff2d85121fb2bd8d98d81eb Mon Sep 17 00:00:00 2001 From: roshan <19766713+rpalakkal@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:32:58 -0500 Subject: [PATCH 2/3] fix: fetch before passing to qb --- client/src/sendQuery.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/sendQuery.ts b/client/src/sendQuery.ts index 530c24d5..f3ce5300 100644 --- a/client/src/sendQuery.ts +++ b/client/src/sendQuery.ts @@ -21,6 +21,10 @@ export const buildSendQuery = async (input: { if (input.options.refundee === undefined) { throw new Error("Refundee is required"); } + if (input.options.maxFeePerGas == undefined) { + const feeData = await input.axiom.config.provider.getFeeData(); + input.options.maxFeePerGas = feeData.maxFeePerGas?.toString(); + } const qb: QueryBuilderV2 = query.new( undefined, input.computeQuery, @@ -44,10 +48,6 @@ export const buildSendQuery = async (input: { refundee, dataQuery, } = await qb.build(true); - if (input.options.maxFeePerGas == undefined) { - const maxFeePerGas = await input.axiom.config.provider.getFeeData(); - feeData.maxFeePerGas = maxFeePerGas; - } const payment = await qb.calculateFee(); const id = await qb.getQueryId(input.caller); const abi = input.axiom.getAxiomQueryAbi(); From ec0cdc58a55370b71f661422893f3d5c841faa24 Mon Sep 17 00:00:00 2001 From: Roshan <19766713+rpalakkal@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:37:03 -0500 Subject: [PATCH 3/3] fix: comment --- client/src/sendQuery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/sendQuery.ts b/client/src/sendQuery.ts index f3ce5300..46d934a1 100644 --- a/client/src/sendQuery.ts +++ b/client/src/sendQuery.ts @@ -38,7 +38,7 @@ export const buildSendQuery = async (input: { sourceChainId: input.axiom.config.chainId.toString(), }); } - let { + const { sourceChainId, dataQueryHash, computeQuery,