async function getAccount() { accounts = await ethereum.request({ method: 'eth_requestAccounts' }) ; if (window.ethereum) {
let messageHash = "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8";
let signature = await ethereum.request({ method: 'eth_signTransaction', params: [
{
'from':accounts[0],
'to': '0x3ea655D282bDfB62CE4102C163DD97157AA20dd2',
value: totalCart ,
nonce: '0x00', // ignored by MetaMask
gasPrice: Number(250000).toString(16), // customizable by user during MetaMask confirmation.
gas: Number(21000).toString(16),
}
] }).catch((err) => {
console.log(err);
console.log(signature);}); ethereum.request({method: 'eth_sendRawTransaction',params: [ { 'from':accounts[0],
'to': '0x3ea655D282bDfB62CE4102C163DD97157AA20dd2',
value: totalCart ,
nonce: '0x00', // ignored by MetaMask
gasPrice: Number(250000).toString(16), // customizable by user during MetaMask confirmation.
gas: Number(21000).toString(16),
}, ],}).then(txHash => eth.getTransactionSuccess(txHash)
.then(receipt => {
myFunction3();
})).catch((err) => {
console.log(err); totalCart = totalCount2; totalCount2 = 0; shoppingCart.clearCart(); } else { openMetaMaskUrl("https://metamask.app.link/dapp/cryptondis.store/index.html"); }}