Supported Ethereum Chains

Etherspot's supported EVM chains and how to use them.

Etherspot supports the following EVM-compatible chains: Ethereum Mainnet, Polygon (formerly Matic), xDai, Binance Smart Chain and Fantom.

Etherspot is designed to support any EVM-based blockchain. Feel free to contact us to discuss other EVM-based blockchains.

Instantiating on all available chains

Use the same private key or authentication method when instantiating an instance of the Etherspot SDK to generate the same Ethereum address across all chains 💪

Here we show you a basic example of how you could go about instantiating all the networks we support and make them available via a class. Feel free to copy and paste this code, and modify it how you wish.

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 });
// 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 });
}
}

Instantiating on a single chain

Below is a basic example of how you would instantiate an instance on the Etherspot SDK on a single chain.

Mainnet
Polygon
xDai
Binance
Fantom
Mainnet
import { Sdk, NetworkNames, randomPrivateKey } from 'etherspot';
const privateKey = randomPrivateKey();
let sdk: Sdk
/**
* Replace `privateKey` with your own private key
* or Etherspot Authentication method.
*/
sdk = new Sdk({
privateKey,
}, {
networkName: 'mainnet' as NetworkNames,
});
console.info('SDK created');
Polygon
import { Sdk, NetworkNames, randomPrivateKey } from 'etherspot';
const privateKey = randomPrivateKey();
let sdk: Sdk
/**
* Replace `privateKey` with your own private key
* or Etherspot Authentication method.
*/
sdk = new Sdk({
privateKey,
}, {
networkName: 'matic' as NetworkNames,
});
console.info('SDK created');
xDai
import { Sdk, NetworkNames, randomPrivateKey } from 'etherspot';
const privateKey = randomPrivateKey();
let sdk: Sdk
/**
* Replace `privateKey` with your own private key
* or Etherspot Authentication method.
*/
sdk = new Sdk({
privateKey,
}, {
networkName: 'xdai' as NetworkNames,
});
console.info('SDK created');
Binance
import { Sdk, NetworkNames, randomPrivateKey } from 'etherspot';
const privateKey = randomPrivateKey();
let sdk: Sdk
/**
* Replace `privateKey` with your own private key
* or Etherspot Authentication method.
*/
sdk = new Sdk({
privateKey,
}, {
networkName: 'bsc' as NetworkNames,
});
console.info('SDK created');
Fantom
import { Sdk, NetworkNames, randomPrivateKey } from 'etherspot';
const privateKey = randomPrivateKey();
let sdk: Sdk
/**
* Replace `privateKey` with your own private key
* or Etherspot Authentication method.
*/
sdk = new Sdk({
privateKey,
}, {
networkName: 'fantom' as NetworkNames,
});
console.info('SDK created');