Bug
getChainConfig("bsc") throws Chain id for "bsc" not found because getChainIdByName only searches by chain.name.toLowerCase(), not by the mapping key in supportedChainsMapping.
The mapping key is bsc but the viem chain name is BNB Smart Chain. Six chains are affected:
| Key |
Viem Name |
| bsc |
BNB Smart Chain |
| bera |
Berachain |
| sei |
Sei Network |
| soneium |
Soneium Mainnet |
| optimism |
OP Mainnet |
| arbitrum |
Arbitrum One |
This breaks any SDK consumer that uses the gateway API chain names (which return the mapping keys like bsc, not viem names like BNB Smart Chain).
Fix
Updated getChainIdByName in src/gateway/utils/common.ts to check both the mapping key and chain.name.