Intro

The EtherspotBatch component allows you to define one or more EtherspotTransaction components to be sent as part of the EtherspotBatch

Component Properties

PropertyDescription
idOptional: An ID (which can be a string, number etc) that allows you to define the ID of this batch group. We will use this ID if you provide it internally, but also allows you to use it to keep track elsewhere within your app.
chainIdOptional: The blockchain ID that you would like to execute this batch on. Check out our supported blockchains to check what we support. The default is “1” - Ethereum Mainnet.
gasTokenAddressOptional: You can choose to pay for for batch of transactions with something else other than the native token for the blockchain you defined in chainId (or Ethereum if none specified).
// In your functional component or elsehwere
const onEstimateReceiver = (estimationData) => {
  console.log(
    'This is the cost estimate for all the batches',
    estimationData,
  );
}

// In your render or as a component...
<EtherspotBatches onEstimated={onEstimateReceiver}>
  <EtherspotBatch>
    {/*
      Within the <EtherspotBatch /> component,
      you can add 1 or more <EtherspotTransaction />
      tags to be performed together and at the same
      time (i.e. within the same "batch").
    */}
  </EtherspotBatch>
</EtherspotBatches>