add network and currency

 avatar
unknown
javascript
4 years ago
373 B
4
Indexable
//add network and currency 
window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0x38',
chainName: 'Binance Smart Chain',
nativeCurrency: {
    name: 'Binance Coin',
    symbol: 'BNB',
    decimals: 18
},
rpcUrls: ['https://bsc-dataseed.binance.org/'],
blockExplorerUrls: ['https://bscscan.com']
}]

}) .catch((error) => { console.log(error) })
Editor is loading...