Skip to main content

EVM compatible networks

DCENT 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 DCENT wallet through window.ethereum provider.

Supported Networks

The following is the DCENT 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 IDNetwork
1Ethereum Mainnet
3Ethereum Testnet Ropsten
4Ethereum Testnet Rinkeby
5Ethereum Testnet Goerli
42Ethereum Testnet Kovan
56Binance Smart Chain Mainnet
97Binance Smart Chain Testnet
137Polygon (previously Matic) Mainnet
80001Polygon Testnet Mumbai
30RSK Mainnet
31RSK Testnet
14Flare Network
16Flare Testnet Coston
19Songbird Mainnet
100Gnosis Chain (prev. xDai Chain) Mainnet
250Fantom Mainnet Opera
50XinFin Network Mainnet
42220Celo Mainnet
321KCC Mainnet
43114Avalanche C-Chain Mainnet
42161Arbitrum
421611Arbitrum Testnet Rinkeby
288BOBA L2
66OEC
10Optimism Mainnet
11Metadium Mainnet
12Metadium Testnet
246EWC (Energy Web Token) Mainnet
1666600000Harmony Mainnet
1666700000Harmony Testnet
25Cronos Chain
8217Kaia (EVM) Mainnet
7518MEVerse
8453BASE
84531BASE Goerli (Testnet)
11155111Ethereum Sepolia (Testnet)
592Astar (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 DCENT user guide.

If your dapp is already integrated with MetaMask

DCENT wallet's provider uses EIP-1193 & EIP-1102 interface.

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 DCENT wallet. For your reference, you can also find the MetaMask's developer guide in the link below.

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.

if (typeof window.ethereum !== 'undefined') {
console.log("It's in-app browser");
}

How to check DCENT provider

Most of dapp browsers for EVM networks use the same interface window.ethereum. You can check whether the dapp browser is DCENT wallet's in-app browser with the following code.

if (window.ethereum.isDcentWallet === true) {
console.log("It's DCENT wallet's in-app browser")
}

Connect to Wallet

You can use the following code in order to connect to DCENT wallet's account.

ethereum.request({ method: 'eth_requestAccounts' })

You can also use the old style code.

ethereum.enable()

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.

ethereum.request({ method: 'net_version' })

You can also use the old style code.

ethereum.networkVersion

Get the current account's address

To get the address of the current account, you can use the following code.

ethereum.request({ method: 'eth_accounts' })

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.

const transactionParameters = {
nonce: '0x00', // ignored
gasPrice: '0x9184e72a000', // customizable by user
gas: '0x76c0', // customizable by user
to: '0x0000000000000000000000000000000000000000',
from: '0xb60e8dd61c5d32be8058bb8eb970870f07233154', // current account's address
value: '0x9184e72a',
data: '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675',
};

const txHash = await ethereum.request({
method: 'eth_sendTransaction',
params: [transactionParameters],
});