Skip to content

Commit

Permalink
fix(ethereum): catch Ethplorer fetching errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CedrikNikita committed Dec 16, 2024
1 parent 96d042a commit bdcd79a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/protocols/ethereum/libs/EthereumAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ export class EthereumAdapter extends BaseProtocolAdapter {
try {
// Temporary solution for fetching the ERC-20 tokens.
// TODO Replace with our own node API
return new EthplorerService(apiUrl).fetchTopTokens();
const response = await new EthplorerService(apiUrl).fetchTopTokens();
return response;
} catch (error: any) {
Logger.write(error);
return null;
Expand All @@ -264,7 +265,8 @@ export class EthereumAdapter extends BaseProtocolAdapter {
try {
// Temporary solution for fetching the ERC-20 token balances.
// TODO Replace with our own node API
return new EthplorerService(apiUrl).fetchAccountTokenBalances(address);
const response = await new EthplorerService(apiUrl).fetchAccountTokenBalances(address);
return response;
} catch (error: any) {
Logger.write(error);
return null;
Expand All @@ -277,7 +279,8 @@ export class EthereumAdapter extends BaseProtocolAdapter {
try {
// Temporary solution for fetching the ERC-20 token info.
// TODO Replace with our own node API
return new EthplorerService(apiUrl).fetchTokenInfo(contractId);
const response = await new EthplorerService(apiUrl).fetchTokenInfo(contractId);
return response;
} catch (error: any) {
Logger.write(error);
return undefined;
Expand Down

0 comments on commit bdcd79a

Please sign in to comment.