> For the complete documentation index, see [llms.txt](https://docs.ierc20.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ierc20.com/devs/dinx-evm-beta/rpc.md).

# RPC

The JSON-RPC endpoint is `https://testrpc.dinx.io`. The chain ID inherited from ethereum is 1.

#### Add DINX RPC to MetaMask

You can add the DINX RPC endpoint in two ways: **automatically** or **manually**.

1. **Manual Setup via MetaMask:**
   * Click on the MetaMask settings and add DINX as your RPC provider.
2. **Automatic Setup via URL:**
   * You can switch to DINX by visiting[`https://explorer.dinx.io`](https://explorer.dinx.io) to easily configure your RPC.

Below is an example of how to add the DINX RPC programmatically:

```javascript
try {
  await provider // Or window.ethereum if you don't support EIP-6963.
    .request({
      method: "wallet_switchEthereumChain",
      params: [{ chainId: "0x1" }],
    });
} catch (switchError) {
  // This error code indicates that the chain has not been added to MetaMask.
  if (switchError.code === 4902) {
    try {
      await provider // Or window.ethereum if you don't support EIP-6963.
        .request({
          method: "wallet_addEthereumChain",
          params: [
            {
              chainId: "0x1",
              chainName: "DINX",
              rpcUrls: ["https://testrpc.dinx.io"], // DINX RPC endpoint
            },
          ],
        });
    } catch (addError) {
      // Handle any "add" error.
    }
  }
  // Handle other "switch" errors.
}
```

**Note:** This process is just for switching your RPC provider and does not collect any personal information or introduce additional security risks.

### Wallet support

<table><thead><tr><th width="249">Wallet</th><th width="367">support</th><th>Link</th></tr></thead><tbody><tr><td><img src="/files/S1A0N8ya2hmjJiOFn1o9" alt="" data-size="line"> Metamask</td><td>Yes</td><td><a href="https://chromewebstore.google.com/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn">Download</a></td></tr><tr><td><img src="https://lh3.googleusercontent.com/sO4GPPbgvTCXEFWp-uALYYju9vxVOr5YSr2jqRAclNFSq8FrAIVTQOYmpJV4kMuDM1ZazcgUdjNGLIGKpmMRvR3NzQ=s60" alt="“欧易 Web3 钱包”的产品徽标图片" data-size="line"> OKX Wallet</td><td>Yes</td><td><a href="https://chromewebstore.google.com/detail/%E6%AC%A7%E6%98%93-web3-%E9%92%B1%E5%8C%85/mcohilncbfahbmgdjkbpemcciiolgcge">Download</a></td></tr><tr><td><img src="/files/WyZT24XUq4caMpyPu17b" alt="" data-size="line"> TokenPocket</td><td>Yes</td><td><a href="https://chromewebstore.google.com/detail/tokenpocket-web3-nostr-%E9%92%B1%E5%8C%85/mfgccjchihfkkindfppnaooecgfneiii">Download</a></td></tr><tr><td><img src="/files/4BtlDTNQbYYIjO5nQIi2" alt="" data-size="line"> UniSat Wallet</td><td>No</td><td><a href="https://chromewebstore.google.com/detail/unisat-wallet/ppbibelpcjmhbdihakflkdcoccbgbkpo">Download</a></td></tr></tbody></table>

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ierc20.com/devs/dinx-evm-beta/rpc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
