The TokenClaimAirdropTransaction allows an intended airdrop recipient to claim a pending token transfer, requiring signatures from both the receiver and transaction payer. When no auto-association slots are available, this transaction handles both the TokenAssociate and CryptoTransfer steps. If the receiver account has auto-association slots available, the token is automatically associated and transferred, making the claim transaction unnecessary. The receiver pays only the transaction fee, while the sender covers association and custom fees. Once claimed, the transfer is irreversible and removed from network state. All referenced pending airdrops must succeed for the transaction to complete.
Claimed airdrops result in token transfers recorded in the token_transfer_list in the transaction record.
Claimed pending airdrops are removed from the network state and cannot be claimed again.
Transaction Signing Requirements
The receiver account key.
The transaction fee payer account key if it differs from the sender.
Transaction Fees
Please see the transaction and query fees table for the base transaction fee.
Please use the Hedera fee estimator to estimate the cost of your transaction fee.
// Create the token claim airdrop transactionTokenClaimAirdropTransaction transaction =newTokenClaimAirdropTransaction().addPendingAirdropId(pendingAirdropId).freezeWith(client);// Sign with the sender account key and submit the transaction to a Hedera networkTransactionResponse txResponse =transaction.sign(accountKey).execute(client);// Request the receipt of the transactionTransactionReceipt receipt =txResponse.getReceipt(client);// Get the transaction consensus statusStatus transactionStatus =receipt.status;System.out.println("The transaction consensus status: "+transactionStatus.toString());// v2.51.0
// Create the token claim airdrop transactionconsttransaction=awaitnewTokenClaimAirdropTransaction().addPendingAirdropId(pendingAirdropId).freezeWith(client);// Sign with the sender account key and submit the transaction to a Hedera networkconsttxResponse=awaittransaction.sign(accountKey).execute(client);// Request the receipt of the transactionconstreceipt=awaittxResponse.getReceipt(client);// Get the transaction consensus statusconsttransactionStatus=receipt.status;console.log("The transaction consensus status "+transactionStatus.toString());// v2.51.0
// Create the token claim airdrop transactiontransaction, err := hedera.NewTokenClaimAirdropTransaction().AddPendingAirdropId(pendingAirdropId).FreezeWith(client)if err !=nil {panic(err)}// Sign with the sender account key and submit the transaction to the Hedera networktxResponse, err := transaction.Sign(accountKey).Execute(client)if err !=nil {panic(err)}// Request the receipt of the transactionreceipt, err := txResponse.GetReceipt(client)if err !=nil {panic(err)}// Get the transaction consensus statustransactionStatus := receipt.Statusfmt.Println("The transaction consensus status:", transactionStatus)// v2.51.0
Adds the ID of a pending airdrop to the transaction, indicating which specific airdrop the receiver wants to claim. This method is used to reference and claim one or more pending airdrops by their unique identifiers. The transaction can have up to 10 entries and must no have any duplicates.