Class AllowanceParams
Allowance Creation and Adjustment Parameters
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class AllowanceParams : TransactionParams<TransactionReceipt>
Examples
Grant another account the right to spend up to a fixed amount of HBAR from the owning account (who must be the transaction Payer):
// Grant `spender` the right to spend up to 5 HBAR from `owner`.
// Owner must be the client's Payer — allowances always originate
// from the transaction payer. Setting Amount = 0 revokes the grant.
var receipt = await client.AllocateAllowanceAsync(new AllowanceParams
{
CryptoAllowances = new[]
{
new CryptoAllowance(owner, spender, 500_000_000) // 5 HBAR
}
});
Console.WriteLine($"Allowance status: {receipt.Status}");
Properties
| Edit this page View SourceCancellationToken
Optional Cancellation token that can interrupt the allowance update process.
Declaration
public CancellationToken? CancellationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| CancellationToken? |
CryptoAllowances
A list of accounts and allocated allowances that each account may sign transactions moving crypto out of this account up to the specified limit.
Declaration
public IReadOnlyList<CryptoAllowance>? CryptoAllowances { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<CryptoAllowance> |
NftAllowances
A list of accounts and allocated allowances that each account may sign transactions moving NFTs out of this account up to the specified limit.
Declaration
public IReadOnlyList<NftAllowance>? NftAllowances { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<NftAllowance> |
Signatory
Additional private key, keys or signing callback method required to authorize the transaction.
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 to change the state of this account.
TokenAllowances
A list of accounts and allocated allowances that each account may sign transactions moving tokens out of this account up to the specified limit.
Declaration
public IReadOnlyList<TokenAllowance>? TokenAllowances { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<TokenAllowance> |