diff --git a/src/TokenTransferItem.tsx b/src/TokenTransferItem.tsx index a093b7f..c9f40a2 100644 --- a/src/TokenTransferItem.tsx +++ b/src/TokenTransferItem.tsx @@ -18,6 +18,7 @@ type TokenTransferItemProps = { tokenMetas: TokenMetas; }; +// TODO: handle partial const TokenTransferItem: React.FC = ({ t, txData, diff --git a/src/useErigonHooks.ts b/src/useErigonHooks.ts index 477f7b4..7322a0d 100644 --- a/src/useErigonHooks.ts +++ b/src/useErigonHooks.ts @@ -225,16 +225,20 @@ export const useTxData = ( continue; } const erc20Contract = new Contract(t.token, erc20, provider); - const [name, symbol, decimals] = await Promise.all([ - erc20Contract.name(), - erc20Contract.symbol(), - erc20Contract.decimals(), - ]); - tokenMetas[t.token] = { - name, - symbol, - decimals, - }; + try { + const [name, symbol, decimals] = await Promise.all([ + erc20Contract.name(), + erc20Contract.symbol(), + erc20Contract.decimals(), + ]); + tokenMetas[t.token] = { + name, + symbol, + decimals, + }; + } catch (err) { + console.warn(`Couldn't get token ${t.token} metadata; ignoring`, err); + } } setTxData({