🔗Etherem (EVM)

As each blockchain network is different, there are some features that are unique to the packets involved. Here, we have included the special methods available in EVM Chains.

Networks

As you know, many blockchain networks such as BSC, Polygon, Avalanche, etc. are based on Ethereum (EVM) and work with the same logic. That's why our package is called evm-chains. All EVM networks will work in this package.

Networks contains many EVM-based blockchain networks by default, so you can directly launch the Provider with the relevant network.

import { networks, Provider } from '@multiplechain/evm-chains'

const ethereum = networks.ethereum
const bsc = networks.bsc
const polygon = networks.polygon
const sepolia = networks.sepolia

const findNetwork1 = networks.findById(1)
const findNetwork3 = networks.findByHexId('0x1')
const findNetwork2 = networks.findByKey('ethereum')
const findNetwork4 = networks.findByName('Ethereum')
const findNetwork5 = networks.findBySymbol('ETH')

const provider = new Provider(ethereum)

Ethers

The class that contains many methods in Ethers.

import { networks, Provider } from '@multiplechain/evm-chains'

const ethereum = networks.ethereum
const provider = new Provider(ethereum)

const ethers = provider.ethers

const jsonRpcProvider = ethers.jsonRpc
const webSocketProvider = ethers.webSocket
const webSocketProvider2 = await ethers.connectWebSocket()

const instance = ethers.contract('0x', /* abi*/ [], /* signer */)

const wallet = ethers.wallet('0x', jsonRpcProvider)

const factory = ethers.contractFactory(/* abi */ [], /* bytecode */ '0x', /* signer */)

const bytecode = await ethers.getByteCode('0x')

const estimateGas = await ethers.getEstimateGas(/* data */ {})

const gasPrice = await ethers.getGasPrice()

const nonce = await ethers.getNonce('0x')

const block = await ethers.getBlock('0x')

const latestBlockNumber = await ethers.getBlockNumber()

const txData = await ethers.getTransaction('0x')

const receipt = await ethers.getTransactionReceipt('0x')

const lastTransaction = await ethers.getLastTransaction('0x')

const lastTransactions = await ethers.getLastTransactions('0x')

const ethBalance = await ethers.getBalance('0x')

Last updated