From 585fc0f9ead581a5dca3928e20f3c4334182ecd1 Mon Sep 17 00:00:00 2001 From: Rohit Saw Date: Thu, 4 Dec 2025 14:24:15 +0530 Subject: [PATCH] feat: add SUPPORTS_ERC20 feature in hbarevm ticket: win-8142 --- modules/sdk-coin-evm/src/lib/utils.ts | 4 ++-- modules/sdk-coin-evm/test/unit/utils.ts | 18 +++++++++--------- modules/statics/src/allCoinsAndTokens.ts | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/sdk-coin-evm/src/lib/utils.ts b/modules/sdk-coin-evm/src/lib/utils.ts index 849db8ca3a..7c29280e42 100644 --- a/modules/sdk-coin-evm/src/lib/utils.ts +++ b/modules/sdk-coin-evm/src/lib/utils.ts @@ -87,7 +87,7 @@ async function queryAddressBalanceHedera( baseUrl: string ): Promise> { const address = query.address; - const url = `${baseUrl}/accounts/${address}`; + const url = `${baseUrl}/accounts/${address}?transactions=false`; const response = await request.get(url).send(); if (!response.ok) { @@ -106,7 +106,7 @@ async function queryAddressBalanceHedera( */ async function getAddressNonceHedera(query: Record, baseUrl: string): Promise> { const address = query.address; - const accountUrl = `${baseUrl}/accounts/${address}`; + const accountUrl = `${baseUrl}/accounts/${address}?transactions=false`; const response = await request.get(accountUrl).send(); if (!response.ok) { diff --git a/modules/sdk-coin-evm/test/unit/utils.ts b/modules/sdk-coin-evm/test/unit/utils.ts index 7b2032bf0b..d64b7602df 100644 --- a/modules/sdk-coin-evm/test/unit/utils.ts +++ b/modules/sdk-coin-evm/test/unit/utils.ts @@ -32,7 +32,7 @@ describe('EVM Coin Utils', function () { }, }; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -49,7 +49,7 @@ describe('EVM Coin Utils', function () { const mockResponse = {}; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -64,7 +64,7 @@ describe('EVM Coin Utils', function () { address: mockAddress, }; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(500, 'Internal Server Error'); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(500, 'Internal Server Error'); try { await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -88,7 +88,7 @@ describe('EVM Coin Utils', function () { ethereum_nonce: 42, }; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -105,7 +105,7 @@ describe('EVM Coin Utils', function () { const mockResponse = {}; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -331,7 +331,7 @@ describe('EVM Coin Utils', function () { }; nock(mockExplorerUrl) // Note: nock should match without trailing slash - .get(`/accounts/${mockAddress}`) + .get(`/accounts/${mockAddress}?transactions=false`) .reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery( @@ -362,7 +362,7 @@ describe('EVM Coin Utils', function () { }, }; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -389,7 +389,7 @@ describe('EVM Coin Utils', function () { }, }; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); @@ -410,7 +410,7 @@ describe('EVM Coin Utils', function () { }, }; - nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse); + nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse); const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken); diff --git a/modules/statics/src/allCoinsAndTokens.ts b/modules/statics/src/allCoinsAndTokens.ts index e5176bdc97..354894bf91 100644 --- a/modules/statics/src/allCoinsAndTokens.ts +++ b/modules/statics/src/allCoinsAndTokens.ts @@ -2145,6 +2145,7 @@ export const allCoinsAndTokens = [ CoinFeature.EVM_COMPATIBLE_WP, CoinFeature.EVM_NON_BITGO_RECOVERY, CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY, + CoinFeature.SUPPORTS_ERC20, ] ), account(