Skip to content

Commit

Permalink
feat(connect): parseCoins start using chain shortcut and not just symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Aug 6, 2024
1 parent 3e1f011 commit dba8ea4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/connect/src/data/coinInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ export const getEthereumNetwork = (pathOrName: DerivationPath) => {
if (typeof pathOrName === 'string') {
const name = pathOrName.toLowerCase();

// name is network symbol (bnb, op, btc)
return networks.find(
n => n.name.toLowerCase() === name || n.shortcut.toLowerCase() === name,
n =>
n.name.toLowerCase() === name ||
n.chain?.toLowerCase() === name ||
n.shortcut.toLowerCase() === name,
);
}
const slip44 = fromHardened(pathOrName[1]);
Expand Down Expand Up @@ -262,6 +266,7 @@ const parseEthereumNetworksJson = (json: any) => {
shortcut: network.shortcut,
slip44: network.slip44,
support: network.support,
chain: network.chain,
});
});
};
Expand Down
1 change: 1 addition & 0 deletions packages/connect/src/types/coinInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const EthereumNetworkInfo = Type.Intersect([
type: Type.Literal('ethereum'),
chainId: Type.Number(),
network: Type.Optional(Type.Undefined()),
chain: Type.Optional(Type.String()),
}),
]);

Expand Down

0 comments on commit dba8ea4

Please sign in to comment.