Class AirdropParams
Transaction Parameters for airdropping tokens to one or more recipient accounts.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class AirdropParams : TransactionParams<TransactionReceipt>
Remarks
An airdrop distributes tokens from a sender to recipients. If a recipient
has available auto-association slots or is already associated with the token,
the transfer completes immediately. Otherwise, a pending airdrop is created
that the recipient must claim with a ClaimAirdrop transaction.
Examples
Airdrop the same token to multiple recipients in a single atomic transaction:
// Airdrop the same token to three recipients in one transaction. The
// sender debit (-300) is split into credits totaling +300 across the
// receivers. Per-token amounts in a TokenTransfers list must sum to
// zero, just like CryptoTransfer lists.
var receipt = await client.AirdropAsync(new AirdropParams
{
TokenTransfers = new[]
{
new TokenTransfer(token, sender, -300),
new TokenTransfer(token, recipient1, 100),
new TokenTransfer(token, recipient2, 100),
new TokenTransfer(token, recipient3, 100),
}
});
Console.WriteLine($"Airdrop status: {receipt.Status}");
Properties
| Edit this page View SourceCancellationToken
Optional cancellation token to interrupt the submission process.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| CancellationToken? |
NftTransfers
A list of NFT transfers for the airdrop. Each entry specifies the NFT, the sending account, and the receiving account.
Declaration
public IEnumerable<NftTransfer>? NftTransfers { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<NftTransfer> |
Signatory
Additional private key, keys or signing callback method required to authorize the airdrop. Typically matches the endorsement assigned to the sending account(s).
Declaration
public Signatory? Signatory { get; set; }
Property Value
| Type | Description |
|---|---|
| Signatory |
Remarks
Keys/callbacks added here will be combined with those already identified in the client object's context when signing this transaction.
TokenTransfers
A list of fungible token transfers for the airdrop. Each entry specifies the token, the sending account (negative amount), and the receiving account (positive amount). Entries must balance per token.
Declaration
public IEnumerable<TokenTransfer>? TokenTransfers { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<TokenTransfer> |