Ethereum Provider
You can interact with EVM-based blockchains using Ethers.js or Web3.js together with the Wepin Provider.
Supported Networks
Is the blockchain you need not listed? Please contact the Wepin team for blockchain support.
1
Ethereum Mainnet
ethereum
5
Ethereum Goerli Testnet
evmeth-goerli
8217
Klaytn Mainnet
klaytn
1001
Klaytn Testnet
klaytn-testnet
19
Songbird Canary Network
evmsongbird
137
Polygon Mainnet
evmpolygon
248
Oasys
evmoasys-games
34
XPLA Mainnet
evmxpla
7300
XPLA Verse Mainnet
evmxpla-verse
2731
TimeNetwork Testnet
evmtime-elizabeth
11155111
Ethereum Sepolia Testnet
evmeth-sepolia
80002
Polygon Amoy Testnet
evmpolygon-amoy
9372
Oasys Testnet
evmoasys-games-testnet
47
XPLA Testnet
evmxpla-testnet
2225
XPLA Verse Testnet
evmxpla-verse-testnet
204
opBNB Mainnet
evmopbnb
56
Binance Smart Chain
evmbsc
97
BSC-TESTNET
evmbsc-testnet
5611
opBNB Testnet
evmopbnb-testnet
656476
Open Campus Testnet
evmopencampus-testnet
43114
Avalanche
evmavax-c-chain
Installation
Once the installation is complete, initialize the WepinProvider instance using the app ID and app key assigned after registering the app. This will enable the use of WepinProvider.
Initialization
Here's how to initialize the Wepin Provider.
init
Parameters
attributes
<object> optionaldefaultLanguage
: The language to be displayed on the widget (default:'ko'
) Currently, only'ko'
,'en'
and'ja'
are supported.defaultCurrency
: The currency to be displayed on the widget (default:'KRW'
) Currently, only'KRW'
'USD'
and'JPY'
are supported.
Return value
Promise
<void>
Example
isInitialized
It checks if WepinProvider is initialized properly.
Parameters
<void>
Return value
<boolean>
Returnstrue
if init was successful, otherwise returnsfalse
.
Example
changeLanguage
It allows changing the language and currency of the widget.
Parameters
attributes
<object>language
<string> It specifies the language to be displayed on the widget. Currently supported languages areen
,ko
andja
.currency
<string> It specifies the currency to be displayed on the widget. Currently supported currencies areUSD
,KRW
andJPY
.
Return value
<boolean> It returns
true
if the change was successful, otherwise returnsfalse
.
Example
Methods
Methods can be used after initializing the Wepin Provider.
getProvider
It returns the provider for the specified network.
Parameters
network
<string> The Network Variable value for providers supported by Wepin, such as "ethereum" for Ethereum Mainnet, must be entered in lowercase. For the complete list, please refer to the "Supported Networks for Ethereum Provider."
Return value
Promise
<BaseProvider> - A EIP-1193 provider
Example
finalize
It terminates the use of WepinProvider.
Parameters
<void>
Return value
<void>
Example
For more details on EVM-compatible network providers, please refer to the link below.
Last updated