Components
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| 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. |
| to | The destination blockchain address, on the same chain. For example, if you are sending from the Polygon blockchain, make sure you sent it to another address on the Polygon blockchain. |
| value | This can either be a string represented in Ether or as a BigNumber (see example). |
| data | Optional: An optional data object which can be read by the recipient (the to address), if it is a Smart Contract, to perform additional functions as part of the transaction (see example), or, to just store an arbitrary piece of data along with the transaction. |
// 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>
{/*
The following <EtherspotTransaction /> will send
0.01 ETH to 0x0763d68dd586AB1DD8Be2e00c514B2ac8757453b.
*/}
<EtherspotTransaction
to={'0x0763d68dd586AB1DD8Be2e00c514B2ac8757453b'}
value={'0.01'}
/>
{/*
You can add 1 or more <EtherspotTransaction />
components here, and they will all be executed
together and at the same time (i.e. as part of
this batch).
*/}
</EtherspotBatch>
</EtherspotBatches>
// 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>
{/*
The following <EtherspotTransaction /> will send
0.01 ETH to 0x0763d68dd586AB1DD8Be2e00c514B2ac8757453b
and will include a data object containing the the
message 'i am a teapot'.
*/}
<EtherspotTransaction
to={'0x0763d68dd586AB1DD8Be2e00c514B2ac8757453b'}
value={'0.01'}
data={'i am a teapot'}
/>
{/*
You can add 1 or more <EtherspotTransaction />
components here, and they will all be executed
together and at the same time (i.e. as part of
this batch).
*/}
</EtherspotBatch>
</EtherspotBatches>
