Copy import {
Sdk as EtherspotSdk ,
NetworkNames ,
} from 'etherspot' ;
class EtherspotService {
instances : { [network : string ] : EtherspotSdk } = {};
init (privateKey : string ) : void {
/**
* You can use this space to do anything else
* you're application may require to run.
*/
// Mainnet
this .instances[ NetworkNames .Mainnet] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Mainnet });
// Gnosis Chain (xDai)
this .instances[ NetworkNames .Xdai] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Xdai });
// Binance Smart Chain
this .instances[ NetworkNames .Bsc] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Bsc });
// Polygon, formerly known as Matic
this .instances[ NetworkNames .Matic] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Matic });
// Fantom
this .instances[ NetworkNames .Fantom] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Fantom });
// Aurora
this .instances[ NetworkNames .Aurora] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Aurora });
// Avalanche
this .instances[ NetworkNames .Avalanche] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Avalanche });
// Arbitrum
this .instances[ NetworkNames .Arbitrum] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Arbitrum });
// Moonbeam
this .instances[ NetworkNames .Moonbeam] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Moonbeam });
// Celo
this .instances[ NetworkNames .Celo] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Celo });
// Fuse
this .instances[ NetworkNames .Fuse] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Fuse });
// ArbitrumNova
this .instances[ NetworkNames .ArbitrumNova] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .ArbitrumNova });
// Optimism
this .instances[ NetworkNames .Optimism] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Optimism });
// Neon
this .instances[ NetworkNames .Neon] =
new EtherspotSdk (privateKey , { networkName : NetworkNames .Neon });
}
}