send()

Sends all batches and transactions

Introduction

The .send() function simply sends all the <EtherspotBatches />, which contain all <EtherspotBatch /> and <EtherspotTransaction /> components to the blockchain via the Etherspot platform.

You must always estimate before sending

Estimating first performs imporant transaction cost calculations that are required before sending.

How to use

Whenever you are ready to send your transaction to the blockchain, you simply need to call .send() as shown below.

import {
  useEtherspotTransactions,
} from '@etherspot/transaction-kit';

// Later in the main component function...

const { send } = useEtherspotTransactions();

// And when you're ready to end your transaction(s)...

send(); // This is also a Promise

// Your transactions are now being sent to the blockchain

🎉 Congratulations

By calling the above function, you have sent the transactions to the Etherspot platform, and we'll take care of it from here to ensure that the transactions are executed on the blockchain.

Last updated