EVM compatible networks
How to integrate with D'CENT wallet for dapps on EVM compatible networks.
D'CENT mobile app's in-app browser injects window.ethereum
as a provider. If your dapp is based on EVM compatible network, you can interact with D'CENT wallet through window.ethereum
provider.
Supported Networks
The following is the D'CENT in-app browser's supported network list which can use window.ethereum
provider. Additional networks (https://chainid.network/) will be added to this list in the future.
Chain ID | Network |
1 | Ethereum Mainnet |
3 | Ethereum Testnet Ropsten |
4 | Ethereum Testnet Rinkeby |
5 | Ethereum Testnet Goerli |
42 | Ethereum Testnet Kovan |
56 | Binance Smart Chain Mainnet |
97 | Binance Smart Chain Testnet |
137 | Polygon (previously Matic) Mainnet |
80001 | Polygon Testnet Mumbai |
30 | RSK Mainnet |
31 | RSK Testnet |
14 | Flare Network |
16 | Flare Testnet Coston |
19 | Songbird Mainnet |
128 | HECO Chain Mainnet |
100 | Gnosis Chain (prev. xDai Chain) Mainnet |
250 | Fantom Mainnet Opera |
50 | XinFin Network Mainnet |
42220 | Celo Mainnet |
321 | KCC Mainnet |
43114 | Avalanche C-Chain Mainnet |
42161 | Arbitrum |
421611 | Arbitrum Testnet Rinkeby |
288 | BOBA L2 |
66 | OEC |
10 | Optimism Mainnet |
11 | Metadium Mainnit |
12 | Metadium Testnet |
246 | EWC (Energy Web Token) Mainnet |
1666600000 | Harmony Mainnet |
1666700000 | Harmony Testnet |
2017 | Orbit Chain Mainnet |
25 | Cronos Chain |
8217 | Klaytn (EVM) Mainnet |
7518 | MEVerse |
8453 | BASE |
84531 | BASE Goerli (Testnet) |
11155111 | Etherum Sepolia (Testnet) |
255 | Kroma |
2358 | Kroma Sepolia (Testnet) |
592 | Astar (EVM) |
How to Switch the Network
By clicking the "network" icon on the right top corner of "discovery" tab, you can switch the blockchain network for dapp browser.
For more details, please see D'CENT user guide.
Switch Network User Guide : https://userguide.dcentwallet.com/native-service/dapp-browser/switch-blockchain-network
If your dapp is already integrated with MetaMask
D'CENT wallet's provider uses EIP-1193 & EIP-1102 interface.
EIP-1193 Ethereum Provider JavaScript API : https://eips.ethereum.org/EIPS/eip-1193
MetaMask also uses the same provider interface (not exactly the same, but almost the same). This means if your dapp is already integrated with MetaMask, it's very easy to integrate with D'CENT wallet.
For your reference, you can also find the MetaMask's developer guide in the link below.
MetaMask Developer Guide : https://docs.metamask.io/
How to detect in-app browser
In order to check if your dapp running on EVM networks is supported by the dapp-browser, you need to check whether window.ethereum
is defined.
How to check D'CENT provider
Most of dapp browsers for EVM networks use the same interface window.ethereum
. You can check whether the dapp browser is D'CENT wallet's in-app browser with the following code.
Connect to Wallet
You can use the following code in order to connect to D'CENT wallet's account.
You can also use the old style code.
Wallet Connection UI
If the connection to wallet is requested, you can see the popup like below.
Get the current network
To get the current network ID, you can use the following code.
You can also use the old style code.
Get the current account's address
To get the address of the current account, you can use the following code.
Send Transaction
By using ethereum.request
method to call eth_sendTransaction
, you can send the transaction. The following is the example code to show how to send the transaction.
Last updated