diff --git a/.changeset/hip-turtles-sin.md b/.changeset/hip-turtles-sin.md new file mode 100644 index 00000000..80af7a1f --- /dev/null +++ b/.changeset/hip-turtles-sin.md @@ -0,0 +1,5 @@ +--- +"@abstract-money/core": patch +--- + +Ensure that hostChainNameToName doesn't throw diff --git a/packages/core/src/utils/chain-registry/host-chain-name-to-name.ts b/packages/core/src/utils/chain-registry/host-chain-name-to-name.ts index 1be09e13..6aefa417 100644 --- a/packages/core/src/utils/chain-registry/host-chain-name-to-name.ts +++ b/packages/core/src/utils/chain-registry/host-chain-name-to-name.ts @@ -4,7 +4,7 @@ export function hostChainNameToName(hostChainName: string) { const chainName = chains.find( ({ chain_name, chain_id }) => chain_name === hostChainName || - chainIdToHostChainName(chain_id) === hostChainName, + (chain_id && chainIdToHostChainName(chain_id) === hostChainName), )?.chain_name if (!chainName) { throw new Error(`Chain not found by hostChain: ${hostChainName}`)