import { Network } from '@types' ; import { FallbackProvider } from '@vendor' ; import { createFallbackNetworkProviders } from './helpers' ; interface InstancesObject { [ key ] : FallbackProvider ; } export class EthersJS { public static getEthersInstance ( network ) { if ( ! EthersJS . instances [ network . id ] ) { EthersJS . instances [ network . id ] = createFallbackNetworkProviders ( network ) ; } return EthersJS . instances [ network . id ] ; } public static updateEthersInstance ( network ) { EthersJS . instances [ network . id ] = createFallbackNetworkProviders ( network ) ; return EthersJS . instances [ network . id ] ; } private static instances : InstancesObject = { } ; private constructor ( ) { } }