Skip to content

Commit 441a899

Browse files
authored
Merge pull request #7689 from BitGo/win-8142
feat: add SUPPORTS_ERC20 feature in hbarevm
2 parents 77ee197 + 585fc0f commit 441a899

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

modules/sdk-coin-evm/src/lib/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async function queryAddressBalanceHedera(
8787
baseUrl: string
8888
): Promise<Record<string, unknown>> {
8989
const address = query.address;
90-
const url = `${baseUrl}/accounts/${address}`;
90+
const url = `${baseUrl}/accounts/${address}?transactions=false`;
9191
const response = await request.get(url).send();
9292

9393
if (!response.ok) {
@@ -106,7 +106,7 @@ async function queryAddressBalanceHedera(
106106
*/
107107
async function getAddressNonceHedera(query: Record<string, string>, baseUrl: string): Promise<Record<string, unknown>> {
108108
const address = query.address;
109-
const accountUrl = `${baseUrl}/accounts/${address}`;
109+
const accountUrl = `${baseUrl}/accounts/${address}?transactions=false`;
110110
const response = await request.get(accountUrl).send();
111111

112112
if (!response.ok) {

modules/sdk-coin-evm/test/unit/utils.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('EVM Coin Utils', function () {
3232
},
3333
};
3434

35-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
35+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
3636

3737
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
3838

@@ -49,7 +49,7 @@ describe('EVM Coin Utils', function () {
4949

5050
const mockResponse = {};
5151

52-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
52+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
5353

5454
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
5555

@@ -64,7 +64,7 @@ describe('EVM Coin Utils', function () {
6464
address: mockAddress,
6565
};
6666

67-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(500, 'Internal Server Error');
67+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(500, 'Internal Server Error');
6868

6969
try {
7070
await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
@@ -88,7 +88,7 @@ describe('EVM Coin Utils', function () {
8888
ethereum_nonce: 42,
8989
};
9090

91-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
91+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
9292

9393
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
9494

@@ -105,7 +105,7 @@ describe('EVM Coin Utils', function () {
105105

106106
const mockResponse = {};
107107

108-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
108+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
109109

110110
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
111111

@@ -331,7 +331,7 @@ describe('EVM Coin Utils', function () {
331331
};
332332

333333
nock(mockExplorerUrl) // Note: nock should match without trailing slash
334-
.get(`/accounts/${mockAddress}`)
334+
.get(`/accounts/${mockAddress}?transactions=false`)
335335
.reply(200, mockResponse);
336336

337337
const result = await recovery_HBAREVM_BlockchainExplorerQuery(
@@ -362,7 +362,7 @@ describe('EVM Coin Utils', function () {
362362
},
363363
};
364364

365-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
365+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
366366

367367
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
368368

@@ -389,7 +389,7 @@ describe('EVM Coin Utils', function () {
389389
},
390390
};
391391

392-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
392+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
393393

394394
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
395395

@@ -410,7 +410,7 @@ describe('EVM Coin Utils', function () {
410410
},
411411
};
412412

413-
nock(mockExplorerUrl).get(`/accounts/${mockAddress}`).reply(200, mockResponse);
413+
nock(mockExplorerUrl).get(`/accounts/${mockAddress}?transactions=false`).reply(200, mockResponse);
414414

415415
const result = await recovery_HBAREVM_BlockchainExplorerQuery(query, mockRpcUrl, mockExplorerUrl, mockToken);
416416

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,7 @@ export const allCoinsAndTokens = [
21452145
CoinFeature.EVM_COMPATIBLE_WP,
21462146
CoinFeature.EVM_NON_BITGO_RECOVERY,
21472147
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
2148+
CoinFeature.SUPPORTS_ERC20,
21482149
]
21492150
),
21502151
account(

0 commit comments

Comments
 (0)