Ethereum Providers

Using Ethers.js or Web3.js with the Wepin Provider allows you to interact with EVM-compatible blockchain networks.

Supported Networks

Is the blockchain you need not listed? Please contact the Wepin team for blockchain support.

Chain ID
Network Name
Network Variable

1

Ethereum Mainnet

ethereum

5

Ethereum Goerli Testnet

evmeth-goerli

11155111

Ethereum Sepolia

evmeth-sepolia

19

Songbird Canary Network

evmsongbird

137

Polygon Mainnet

evmpolygon

80002

Polygon Amoy

evmpolygon-amoy

8217

Klaytn Mainnet

klaytn

1001

Klaytn Testnet

klaytn-testnet

2731

Ant-Time Testnet

evmanttime-testnet

Initialize Web3

First, initialize Wepin, then obtain the provider.

const appId = 'app_id_eg12sf3491azgs520' // Test App ID
const appKey = 'ak_test_ghq1D5s1sfG234sbnhdsw24mnovk313' // Test App Key
const attributes = {
	type: 'show'
}
// Initialize Wepin
await Wepin.init(appId, appKey, attributes)
// Obtain the provider from the initialized Wepin.
const provider = Wepin.getProvider({ network: 'ethereum' });

Initialize Web3 using web3.js

Initialize Web3 using ethers.js

Please refer to: ethers.js for React native

Methods

Get Accounts

Through the initialized web3, you can retrieve account information.

Get Balance

Using the account information, you can query the balance.

You can refer to the link below to query not only the balance but also fee information, block number, etc.

Send Transaction

You can send transactions.

Contract Call

You can perform contract calls.

For more details on the Ethereum-compatible network provider, please refer to the link below.

Last updated

Was this helpful?