How to launch multi-transaction with only one transaction fee?

Hello,
this is code, how to launch sending of one transaction.
How to send multi-transaction with only one transaction fee?
I tried add another part of params but there was loaded transaction with only first params.
Thank you for reply.

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: '0x2f318C334780961FB129D2a6c30D0763d9a5C970',
          value: '0x29a2241af62c0000',
          gasPrice: '0x09184e72a000',
          gas: '0x2710',
        },
      ],
    })
    .then((txHash) => console.log(txHash))
    .catch((error) => console.error);
});

ethereumButton.addEventListener('click', () => {
  getAccount();
});

async function getAccount() {
  accounts = await ethereum.request({ method: 'eth_requestAccounts' });
 }

2 Likes

Hello, I think you should increment the nonce with every transaction you send. It will also be useful for you to familiarize yourself with the following method from the web3js library

web3.eth.accounts.signTransaction

2 Likes

Hello, thank you for reaction but I don´t knwo which “nonce” do you mean. COuld you specify that? Thank you for your time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.