Mint Currency Token by ID
Mints new units of a currency token. The token must be in status 3 (Active), so its deploy has confirmed. The mint is signed by the wallet frozen onto the token at creation, on the token's network. The token's node must be the platform root node and inside your API key's node subtree.
amount is a whole number of tokens as a decimal string ("2000"): the token contract mints whole tokens and applies the decimals itself. A fractional amount such as "12.5" is refused, never rounded. See Amounts and Percentages.
The call is asynchronous: it records a MintCurrencyToken (type 2) transaction, publishes it and returns its ID. The supply only grows once that transaction settles. Poll Get Currency Token Transactions by ID until it reaches status 3 (Done) or 4 (Error).
Required permission: currency-token:mint
Request
POST /v2/admin/currency-tokens/{currency_token_id}/mint
Parameters
| Name | Type | In | Description |
|---|---|---|---|
currency_token_id | string | path | Required. Currency token ID (24-character hex) |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Number of whole tokens to mint, greater than zero, no decimals (for example "2000") |
Example
curl --request POST \
--url '{{baseUrl}}/v2/admin/currency-tokens/6a859ae35a7db4268dfb40d2/mint' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": "2000"
}'
Response
{
"transaction_id": "6a8b5e13f9129816a6cc7a12"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | The currency token transaction this call started. A 200 means the mint was queued, not that it finished |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation failed — see details. Includes a missing, zero, malformed or fractional amount |
| 404 | 10001 (domain 15) | Currency token not found |
| 400 | 10005 (domain 15) | The token is not Active: its deploy has not confirmed |
| 400 | 10001 (domain 2) | The token's node was not found |
| 403 | 10005 (domain 2) | The token's node is not the platform root node, or is outside your API key's node subtree |
| 500 | 10000 | Unexpected server error, including a currency_token_id that is not a 24-character hex ID |
See Errors for the error format and common codes.