Ethereum Provider

Ethers.js 또는 Web3.js를 Wepin Provider와 함께 사용하면 EVM 계열의 블록체인과 상호작용 할 수 있습니다.

지원 네트워크

Chain ID
Network Name
Network Variable

1

Ethereum Mainnet

ethereum

5

Ethereum Goerli Testnet

evmeth-goerli

11155111

Ethereum Sepolia Testnet

evmeth-sepolia

19

Songbird Canary Network

evmsongbird

137

Polygon Mainnet

evmpolygon

80002

Polygon Amoy

evmpolygon-amoy

8217

Klaytn Mainnet

klaytn-testnet

1001

Klaytn Testnet

klaytn

2731

TimeNetwork Testnet

evmtimenetwork-testnet

설치(Install)

먼저 @wepin/widget-sdk@wepin/provider를 project에 import 합니다.

// 반드시 widget-sdk를 먼저 import 해야합니다. 
import '@wepin/widget-sdk'
import '@wepin/provider'

초기화(Initialize) Web3.js

먼저 Wepin을 initialize 한 이후에 provider를 얻어와서 web3.js를 초기화 합니다.

메서드(Method)

Get Accounts

초기화된 web3를 통해서 account 정보를 받아 올 수 있습니다.

Get Balance

account 정보를 이용해 balance를 조회할 수 있습니다.

아래 링크를 참고하여 Balance 뿐만 아니라 fee 정보, block number 등을 조회할 수 있습니다.

Send Transaction

transaction을 전송할 수 있습니다.

Contract Call

contract call을 수행할 수 있습니다.

이더리움 호환 네트워크 프로바이더의 자세한 내용은 아래 링크를 참고하세요.

Last updated

Was this helpful?