# 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                        |
| 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                         |
| 25         | Cronos Chain                            |
| 8217       | Kaia (EVM) Mainnet                      |
| 7518       | MEVerse                                 |
| 8453       | BASE                                    |
| 84531      | BASE Goerli (Testnet)                   |
| 11155111   | Etherum 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>
* EIP-1102 : <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md>

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.&#x20;

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.

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

### 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.

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

## Connect to Wallet

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

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

You can also use the old style code.

```javascript
ethereum.enable()
```

### Wallet Connection UI

If the connection to wallet is requested, you can see the popup like below.

![](/files/-M_W6XOKzypeb6Wr_b9i)

## Get the current network

To get the current network ID, you can use the following code.

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

You can also use the old style code.

```javascript
ethereum.networkVersion
```

## Get the current account's address

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

```javascript
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.

```javascript
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],
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev-docs.dcentwallet.com/in-app-browser/evm-compatible-networks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
