RPC
Add DINX RPC to MetaMask
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.
}Wallet support
Wallet
support
Link
Last updated


