Show / Hide Table of Contents

Class ConfiscateTokenExtensions

Extension methods for confiscating fungible tokens from an account.

Inheritance
object
ConfiscateTokenExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class ConfiscateTokenExtensions

Methods

| Edit this page View Source

ConfiscateTokenAsync(ConsensusClient, ConfiscateTokenParams, Action<IConsensusContext>?)

Removes the given amount of the token from the holder's account and removes it from circulation. Must be signed by the confiscate/wipe admin key.

Declaration
public static Task<TokenReceipt> ConfiscateTokenAsync(this ConsensusClient client, ConfiscateTokenParams confiscateParams, Action<IConsensusContext>? configure = null)
Parameters
Type Name Description
ConsensusClient client

The Consensus Node Client orchestrating the confiscation.

ConfiscateTokenParams confiscateParams

The details identifying the token, holder, and amount to confiscate.

Action<IConsensusContext> configure

Optional callback method providing an opportunity to modify the execution configuration for just this method call. It is executed prior to submitting the request to the network.

Returns
Type Description
Task<TokenReceipt>

A transaction receipt indicating a successful operation.

Examples
// Forcibly remove tokens from a holder's balance and send them to
// nowhere (reduces total circulation). Requires the ConfiscateEndorsement.
var receipt = await client.ConfiscateTokenAsync(token, holder, amount);
Console.WriteLine($"Confiscate status: {receipt.Status}");
Console.WriteLine($"Remaining circulation: {receipt.Circulation}");
Exceptions
Type Condition
ArgumentException

If required arguments are missing or invalid.

InvalidOperationException

If required context configuration is missing.

PrecheckException

If the gateway node refused the transaction. Only a code about the transaction itself proves it did not execute; any other code leaves the outcome unknown, so settle it by its transaction id on a mirror node rather than resubmitting it (see PrecheckException).

ConsensusException

If the outcome could not be confirmed: the transaction may have executed, so settle it by its transaction id on a mirror node rather than resubmitting it.

TransactionException

If the network rejected the request as invalid or had missing data.

| Edit this page View Source

ConfiscateTokenAsync(ConsensusClient, EntityId, EntityId, ulong, Action<IConsensusContext>?)

Removes the given amount of the token from the holder's account and removes it from circulation. Must be signed by the confiscate/wipe admin key.

Declaration
public static Task<TokenReceipt> ConfiscateTokenAsync(this ConsensusClient client, EntityId token, EntityId holder, ulong amount, Action<IConsensusContext>? configure = null)
Parameters
Type Name Description
ConsensusClient client

The Consensus Node Client orchestrating the confiscation.

EntityId token

The identifier of the token that will be confiscated.

EntityId holder

Holder holding the tokens to be confiscated.

ulong amount

The amount of fungible token to confiscate and remove from circulation.

Action<IConsensusContext> configure

Optional callback method providing an opportunity to modify the execution configuration for just this method call. It is executed prior to submitting the request to the network.

Returns
Type Description
Task<TokenReceipt>

A transaction receipt indicating a successful operation.

Examples
// Forcibly remove tokens from a holder's balance and send them to
// nowhere (reduces total circulation). Requires the ConfiscateEndorsement.
var receipt = await client.ConfiscateTokenAsync(token, holder, amount);
Console.WriteLine($"Confiscate status: {receipt.Status}");
Console.WriteLine($"Remaining circulation: {receipt.Circulation}");
Exceptions
Type Condition
ArgumentException

If required arguments are missing or invalid.

InvalidOperationException

If required context configuration is missing.

PrecheckException

If the gateway node refused the transaction. Only a code about the transaction itself proves it did not execute; any other code leaves the outcome unknown, so settle it by its transaction id on a mirror node rather than resubmitting it (see PrecheckException).

ConsensusException

If the outcome could not be confirmed: the transaction may have executed, so settle it by its transaction id on a mirror node rather than resubmitting it.

TransactionException

If the network rejected the request as invalid or had missing data.

  • Edit this page
  • View Source
In this article
Back to top .NET Client Library for Hiero Network and Hedera Hashgraph