0

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"); }}
2
  • inpage.js:1 MetaMask - RPC Error: invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Address {code: -32602, message: 'invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Address'} Commented Nov 27, 2022 at 19:53
  • Uncaught (in promise) {code: -32004, message: 'Method not supported.', stack: '{\n "code": -32004,\n "message": "Method not suppo…fbeogaeaoehlefnkodbefgpgknn/common-6.js:19:39026)'} Commented Nov 27, 2022 at 19:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.