Class SuspendTokenExtensions
Extension methods for suspending an account's ability to transact a token.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class SuspendTokenExtensions
Methods
| Edit this page View SourceSuspendTokenAsync(ConsensusClient, EntityId, EntityId, Action<IConsensusContext>?)
Suspends the associated account's ability to send or receive the specified token.
Declaration
public static Task<TransactionReceipt> SuspendTokenAsync(this ConsensusClient client, EntityId token, EntityId holder, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client orchestrating the suspend. |
| EntityId | token | The identifier of the token to suspend/freeze. |
| EntityId | holder | The account holding the token to suspend. |
| 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<TransactionReceipt> | A transaction receipt indicating a successful operation. |
Examples
// Freeze one holder's ability to move this token. Different from
// PauseTokenAsync (which affects all holders). Requires the token's
// SuspendEndorsement key to sign.
var receipt = await client.SuspendTokenAsync(token, holder);
Console.WriteLine($"Suspend status: {receipt.Status}");
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. |
SuspendTokenAsync(ConsensusClient, SuspendTokenParams, Action<IConsensusContext>?)
Suspends the associated account's ability to send or receive the specified token.
Declaration
public static Task<TransactionReceipt> SuspendTokenAsync(this ConsensusClient client, SuspendTokenParams suspendParams, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client orchestrating the suspend. |
| SuspendTokenParams | suspendParams | The parameters identifying the token and holder account to suspend. |
| 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<TransactionReceipt> | A transaction receipt indicating a successful operation. |
Examples
// Freeze one holder's ability to move this token. Different from
// PauseTokenAsync (which affects all holders). Requires the token's
// SuspendEndorsement key to sign.
var receipt = await client.SuspendTokenAsync(token, holder);
Console.WriteLine($"Suspend status: {receipt.Status}");
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. |