Etherspot
These are our V1 docs and will be deprecated soon. Please visit https://etherspot.fyi/introduction to use our new version of the SDK.
  • Welcome to Etherspot
    • Chains, Bridges & DEXes
    • Social Logins
    • Web3 Logins
  • Transaction Kit
    • Introduction
    • Code Sandboxes
    • Quick Start
    • React Hooks
      • useEtherspotAssets()
      • useEtherspotNfts()
      • useEtherspotHistory()
        • getAccountTransactions()
        • getAccountTransaction()
      • useEtherspotTransactions()
        • estimate()
        • send()
      • useEtherspotAddresses()
      • useEtherspotBalances()
    • React Components
      • <EtherspotTransactionKit />
      • <EtherspotBatches />
      • <EtherspotBatch />
      • <EtherspotTransaction />
      • <EtherspotContractTransaction />
      • <EtherspotApprovalTransaction />
      • <EtherspotTokenTransferTransaction />
  • BUIDLER React Component
    • Introduction
    • Installation
    • Integrate React Component
    • Shared Sessions
    • Wallet Connectors
    • Blocks
      • Send
      • Batching Transaction
      • Multicall Transaction
      • Swaps
      • Bridges
      • Custom Contract Interactions
      • Styling
    • Build Your Own Block
      • Cross-chain KLIMA DAO Staking
  • Etherspot SDK Guides
    • Requirements
    • Install Etherspot SDK
    • Bootstrap Etherspot SDK
      • Instantiate Etherspot SDK
    • Events
    • Etherspot Block Explorer
    • Etherspot Playground
    • Social Login using Etherspot SDK
    • Sponsored Transactions
  • Use Cases & Guides
    • Crosschain Streaming
    • Token Swaps
    • Transactions
      • Historical
      • Sending
    • Multi-chain Bridges
      • ERC20 Bridge
      • DAI - xDai Bridge
      • xDai - DAI Bridge
      • Native Token Bridge
    • Custom Contract Interaction
    • Multi-chain Assets
    • Multi-chain Gas Prices
    • Peer-to-Peer Payments
  • Reference
    • Etherspot SDK API Docs
    • Etherspot SDK on Github
    • Etherspot on NPM
    • Etherspot Playground
    • Etherspot Block Explorer
    • Etherspot Architecture
    • EIP-1271
    • Etherspot/Pillar Audit
  • Brand Assets
    • Etherspot Brand Assets
  • Security
    • Security
  • Get in touch
    • ⚒️Discord
    • Twitter
    • Telegram
Powered by GitBook
On this page
  • Introduction
  • Component Properties
  • How to use
  • Congratulations!

Was this helpful?

  1. Transaction Kit
  2. React Components

<EtherspotBatch />

Indicates that we are going to add one more blockchain transactions to this batch.

Introduction

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

Component Properties

Property
Description

id

Optional: 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.

chainId

gasTokenAddress

Optional: 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).

How to use

Below is an example of how to use the <EtherspotBatch /> component.

// 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>

And that's how to implement the <EtherspotBatch /> component. It's worth remembering that this component expects other components like <EtherspotTransaction /> to live inside it for it to do anything at all.

Previous<EtherspotBatches />Next<EtherspotTransaction />

Last updated 2 years ago

Was this helpful?

Optional: The blockchain ID that you would like to execute this batch on. Check out our to check what we support. The default is "1" - Ethereum Mainnet.

Congratulations!

🎉
supported blockchains