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 authored and adderpositive committed Dec 11, 2024
1 parent 631f150 commit 692a0e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/connect/src/api/ethereum/ethereumDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,5 @@ export const ethereumNetworkInfoFromDefinition = (
T3W1: '2.0.0',
},
blockchainLink: undefined,
chain: '',
});
6 changes: 3 additions & 3 deletions packages/connect/src/data/coinInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ export const getEthereumNetwork = (pathOrName: DerivationPath) => {
if (typeof pathOrName === 'string') {
const name = pathOrName.toLowerCase();

return networks.find(
n => n.name.toLowerCase() === name || n.shortcut.toLowerCase() === name,
);
// name is network symbol (bnb, op, btc)
return networks.find(n => n.name.toLowerCase() === name || n.chain.toLowerCase() === name);
}
const slip44 = fromHardened(pathOrName[1]);

Expand Down Expand Up @@ -266,6 +265,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 @@ -91,6 +91,7 @@ export const EthereumNetworkInfo = Type.Intersect([
type: Type.Literal('ethereum'),
chainId: Type.Number(),
network: Type.Optional(Type.Undefined()),
chain: Type.String(),
}),
]);

Expand Down

0 comments on commit 692a0e3

Please sign in to comment.