wallet_addEthereumChain
Params
interface AddEthereumChainParameters {
chainId: string; // a 0x-prefixed hexadecimal string
chainName: string; // A human-readable name for the chain.
rpcUrls: string[]; // One or more URLs pointing to RPC endpoints that can be used to communicate with the chain. At least one item is required, and only the first item is used.
nativeCurrency: { // Describes the native currency of the chain using the name, symbol, and decimals fields.
symbol: string; // A human-readable symbol.
decimals: number; // A non-negative integer.
name?: string; // A human-readable name.
},
blockExplorerUrls?: string[] // One or more URLs pointing to block explorer sites for the chain
}Example
Request
await window.NEOLineNeoX.request({
"method": "wallet_addEthereumChain",
"params": [
{
"chainId": "0x1",
"chainName": "Ethereum LlamaNodes",
"rpcUrls": ["https://eth.llamarpc.com"],
"nativeCurrency": {
"name": "ETH",
"symbol": "ETH",
"decimals": 18
},
"blockExplorerUrls": ["https://etherscan.io"]
}
]
});Result
最后更新于