From ffd3cb004cf180ee4541b6fec001e8c18825e344 Mon Sep 17 00:00:00 2001 From: npty Date: Wed, 12 Jun 2024 15:07:08 +0700 Subject: [PATCH 1/4] chore: normalize case txhash for finding tx --- .../TransactionRecoveryApi/AxelarRecoveryApi.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts index 215731bf..7123d6bd 100644 --- a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts +++ b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts @@ -151,12 +151,13 @@ export class AxelarRecoveryApi { txHash, txLogIndex, }) - .then((data) => - data.find( + .then((data) => { + return data.find( (gmpTx: any) => - gmpTx.id.indexOf(txHash) > -1 || gmpTx.call.transactionHash.indexOf(txHash) > -1 // the source transaction hash will be stored at "tx.call.transactionHash", if it is sent from cosmos, otherwise it'll be stored at `tx.id` field. - ) - ) + gmpTx.id.toLowerCase().indexOf(txHash.toLowerCase()) > -1 || + gmpTx.call.transactionHash.toLowerCase().indexOf(txHash.toLowerCase()) > -1 // the source transaction hash will be stored at "tx.call.transactionHash", if it is sent from cosmos, otherwise it'll be stored at `tx.id` field. + ); + }) .catch(() => undefined); } @@ -228,6 +229,8 @@ export class AxelarRecoveryApi { ): Promise { const txDetails = await this.fetchGMPTransaction(txHash, txLogIndex); + console.log(txDetails); + if (!txDetails) return { status: GMPStatus.CANNOT_FETCH_STATUS }; const { call, gas_status, gas_paid, executed, express_executed, approved, callback } = From 7399a0def7b3cc6adfaf678e0ab0c7173caff35a Mon Sep 17 00:00:00 2001 From: npty Date: Wed, 12 Jun 2024 15:07:56 +0700 Subject: [PATCH 2/4] chore: remove console.log --- src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts index 7123d6bd..4f201035 100644 --- a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts +++ b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts @@ -229,8 +229,6 @@ export class AxelarRecoveryApi { ): Promise { const txDetails = await this.fetchGMPTransaction(txHash, txLogIndex); - console.log(txDetails); - if (!txDetails) return { status: GMPStatus.CANNOT_FETCH_STATUS }; const { call, gas_status, gas_paid, executed, express_executed, approved, callback } = From 1ebb1357f12685af9276be5f67a5ccc5a0997461 Mon Sep 17 00:00:00 2001 From: npty Date: Wed, 12 Jun 2024 15:08:49 +0700 Subject: [PATCH 3/4] chore: remove block --- src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts index 4f201035..693a0993 100644 --- a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts +++ b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts @@ -151,13 +151,13 @@ export class AxelarRecoveryApi { txHash, txLogIndex, }) - .then((data) => { - return data.find( + .then((data) => + data.find( (gmpTx: any) => gmpTx.id.toLowerCase().indexOf(txHash.toLowerCase()) > -1 || gmpTx.call.transactionHash.toLowerCase().indexOf(txHash.toLowerCase()) > -1 // the source transaction hash will be stored at "tx.call.transactionHash", if it is sent from cosmos, otherwise it'll be stored at `tx.id` field. - ); - }) + ) + ) .catch(() => undefined); } From 674abe2c0ef15e7778175be83ee9980ceb1c0aa9 Mon Sep 17 00:00:00 2001 From: npty Date: Mon, 17 Jun 2024 20:48:49 +0700 Subject: [PATCH 4/4] chore: bump patch version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5cbeb58..062888cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@axelar-network/axelarjs-sdk", - "version": "0.16.1", + "version": "0.16.2", "description": "The JavaScript SDK for Axelar Network", "repository": { "type": "git",