mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* Support both chain slug and chain id in page parameters in multichain explorer mode Resolves #3320 * fix test
11 lines
296 B
TypeScript
11 lines
296 B
TypeScript
import multichainConfig from 'configs/multichain';
|
|
|
|
export default function getChainIdFromSlugOrId(slugOrId: string) {
|
|
const config = multichainConfig();
|
|
if (!config) {
|
|
return undefined;
|
|
}
|
|
|
|
return config.chains.find((chain) => chain.slug === slugOrId || chain.id === slugOrId)?.id;
|
|
}
|