Show / Hide Table of Contents

Class MintTokenExtensions

Extension methods for minting fungible tokens to the treasury.

Inheritance
object
MintTokenExtensions
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 MintTokenExtensions

Methods

| Edit this page View Source

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

Adds token coins to the treasury.

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

The Consensus Node Client orchestrating the mint.

EntityId token

The identifier of the token to increase.

ulong amount

The amount of tokens to add, denoted in the smallest denomination.

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
// Mint 500,000 additional tokens (smallest unit) into the token's
// treasury account. The transaction must be signed by the token's
// supply key — supply it via the client's Signatory or on the params.
var receipt = await client.MintTokenAsync(token, 500_000);
Console.WriteLine($"Mint status: {receipt.Status}");
Console.WriteLine($"New 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

MintTokenAsync(ConsensusClient, MintTokenParams, Action<IConsensusContext>?)

Adds token coins to the treasury.

Declaration
public static Task<TokenReceipt> MintTokenAsync(this ConsensusClient client, MintTokenParams mintParams, Action<IConsensusContext>? configure = null)
Parameters
Type Name Description
ConsensusClient client

The Consensus Node Client orchestrating the mint.

MintTokenParams mintParams

The details identifying the token and amount to mint.

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
// Mint 500,000 additional tokens (smallest unit) into the token's
// treasury account. The transaction must be signed by the token's
// supply key — supply it via the client's Signatory or on the params.
var receipt = await client.MintTokenAsync(token, 500_000);
Console.WriteLine($"Mint status: {receipt.Status}");
Console.WriteLine($"New 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