Skip to content

About Batch Transfer (ThirdWeb React v5) #5984

Closed as not planned
Closed as not planned
@emin-karadag

Description

@emin-karadag

Hello,
How can I send to multiple addresses using <TransactionButton/>?
I made sending to a single wallet as follows.

Link: https://portal.thirdweb.com/react/v5/components/TransactionButton

<TransactionButton
        transaction={async () => {
          if (!account)
            return;

          const transaction = transfer({
            contract,
            to: "0x613540d63666C26593Fce4694d10f7d5de76bdEd",
            amount: 0.1,
          });

          var result = await sendTransaction({ transaction, account });
        }}
        onClick={() => alert("Transaction is about to be sent")}
        onTransactionSent={(result) => {
          console.log("Transaction submitted", result);
        }}
        onTransactionConfirmed={(receipt) => {
          console.log("Transaction confirmed", receipt);
        }}
        onError={(error) => {
          console.log("Transaction error", error);
        }}
      >
        Confirm Transaction
</TransactionButton>

But can you show me an example of how I can do “Batch Transfer”? Unfortunately, the “Batch Transfer” examples in the Thirdweb document were not enough.

Thank you in advance.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions