*pokt-rpc-endpoints needs to be imported dynamically

This commit is contained in:
Derrick Hammer 2022-08-27 22:25:05 -04:00
parent d0b65f4dc2
commit b9bb588a35
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 2 deletions

View File

@ -1,10 +1,14 @@
import chainNetworks from "@lumeweb/pokt-rpc-endpoints"; let chainNetworks: networks;
dynImport("@lumeweb/pokt-rpc-endpoints").then(
(module) => (chainNetworks = module as any)
);
type networks = { [net: string]: string }; type networks = { [net: string]: string };
export function maybeMapChainId(chain: string): string | boolean { export function maybeMapChainId(chain: string): string | boolean {
if (chain in chainNetworks) { if (chain in chainNetworks) {
return (chainNetworks as networks)[chain]; return chainNetworks[chain];
} }
if ( if (