Mint Native Tokens
After you have created a native token, you may want to increase the circulating native token supply by minting more tokens.
Example Code
- Rust
- Typescript (Node.js)
- Python
The following example will:
- Instantiate a
Wallet
, get Alice'sAccount
which was created in the first guide and sync it. - Search the account's balance for a foundry and the first native token Id.
- Mint
MINT_AMOUNT
native tokens by calling theAccount.mint_native_token()
function.
The following example will:
- Instantiate a
Wallet
, get Alice'sAccount
which was created in the first guide and sync it. - Search the account's balance for a foundry and the first native token Id.
- Prepare to mint
MINT_AMOUNT
native tokens transaction by calling theAccount.prepareMintNativeToken()
function and send the prepared transaction using theAccount.send()
function.
The following example will:
- Instantiate a
Wallet
, get Alice'sAccount
which was created in the first guide and sync it. - Search the account's balance for a foundry and the first native token Id.
- Prepare to mint
mint_amount
native tokens transaction by calling theAccount.mint_native_token()
function.
Full Example Code
- Rust
- Typescript (Node.js)
- Python
sdk/examples/how_tos/native_tokens/mint.rs
loading...
bindings/nodejs/examples/how_tos/native_tokens/mint.ts
loading...
bindings/python/examples/how_tos/native_tokens/mint.py
loading...
Expected Output
Balance before minting: 90
Transaction sent: 0x6dbec7c73ef511c3945eda6265d3de29a4f572a3bd95e39221cff18135e18ca6
Block included: https://explorer.shimmer.network/testnet/block/0x7b677c0562d8b2a7fdc1fd6182bb6364af517d41ec38a9dab9b29a1c7422f574
Balance after minting: 100