Skip to main content

Mint Native Tokens

You can use a node running the stardust update to mint native tokens. To do so, you will only need to add some funds to your account, define the native token's options and call the Account.mint_native_token(native_token_options, options) function.

Online Faucet

You can request test funds from the Shimmer Testnet Faucet.

Code Example

The following example will:

  1. Create an account manager.
  2. Get Alice's which was created in the first guide.
  3. Create the NativeTokenOptions.
  4. Mint the native token by calling the Account.mint_native_token(native_token_options, options) function.
Dotenv

This example uses dotenv, which is not safe for use in production environments.

wallet/examples/09_mint_native_token.rs
loading...

Run the example by running the following command:

cargo run --example mint_native_token --release

Expected Output

Transaction: 0xaa9737fb4007e8b0f4c181d6923b0e3547ae178c23c25233985bb22f61c84de7
Block sent: http://localhost:14265/api/core/v2/blocks/0x807dbdde107008dcc9acae29a0e32c261590bef13e5f5d8d3bb60949e633abd8