add network and currency

mail@pastecode.io avatar
unknown
javascript
3 years ago
373 B
3
Indexable
Never
//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) })