* refactor(solana): remove support for solana * chore: update @thirdweb-dev/react and @thirdweb-dev/sdk versions * remove unused code & re-update-next-versions * refactor: Remove unused Solana currency metadata * fix build
18 lines
434 B
TypeScript
18 lines
434 B
TypeScript
import { useSupportedChainsRecord } from "./configureChains";
|
|
|
|
/**
|
|
*
|
|
* @returns the slug for the given evm chainId
|
|
*/
|
|
export function useChainSlug(chainId: string | number) {
|
|
const configuredChainsRecord = useSupportedChainsRecord();
|
|
|
|
// EVM
|
|
if (chainId in configuredChainsRecord) {
|
|
return configuredChainsRecord[chainId as number].slug;
|
|
}
|
|
|
|
// if can not find a network slug - use chainId as slug
|
|
return chainId;
|
|
}
|