From f72375c1cd97bd94901217a72e58a0dd58c6dd53 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:42:41 +0100 Subject: [PATCH] revive --- packages/arb-token-bridge-ui/src/util/networks.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/arb-token-bridge-ui/src/util/networks.ts b/packages/arb-token-bridge-ui/src/util/networks.ts index c177be40c8..35b446f26e 100644 --- a/packages/arb-token-bridge-ui/src/util/networks.ts +++ b/packages/arb-token-bridge-ui/src/util/networks.ts @@ -524,6 +524,12 @@ export function mapCustomChainToNetworkData(chain: ChainWithRpcUrl) { explorerUrls[chain.chainId] = chain.explorerUrl } +function isArbitrumChain( + chain: NonArbParentNetwork | ArbitrumNetwork +): chain is ArbitrumNetwork { + return typeof (chain as ArbitrumNetwork).parentChainId !== 'undefined' +} + function isNonArbParentChain(chain: { chainId: number }): chain is NonArbParentNetwork { @@ -578,8 +584,7 @@ export function getDestinationChainIds(chainId: ChainId): ChainId[] { return [] } - const parentChainId = - 'parentChainId' in chain ? chain.parentChainId : undefined + const parentChainId = isArbitrumChain(chain) ? chain.parentChainId : undefined const validDestinationChainIds = getChildChainIds(chain)