im trying to make a payment button for metamask but i dont know how to choose a specift crypto do send the value.
here is my code:
const ethereumButton = document.querySelector('.enableEthereumButton');
const sendEthButton = document.querySelector('.sendEthButton');
let accounts = [];
//Sending Ethereum to an address
sendEthButton.addEventListener('click', () => {
ethereum
.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: 'MYWALLETHERE',
value: '0x38d7ea4c68000'
},
],
})
.then((txHash) => console.log(txHash))
.catch((error) => console.error);
});
ethereumButton.addEventListener('click', () => {
getAccount();
});
async function getAccount() {
accounts = await ethereum.request({ method: 'eth_requestAccounts' });
}
getAccount();
<button class="enableEthereumButton btn">Enable Metamask</button>
<button class="sendEthButton btn">Fazer pagamento</button>
how can i force a crypto like BNB here in Binance smart chain?