Skip to main content

Melt Native Tokens

You may want to melt some of your circulating native tokens. To do so, you will need to call the Account.melt_native_token(token_id, melt_amount, options) function.

If you melt your native tokens, you can still destroy the foundry that created them.

Code Example

The following example will:

  1. Create a wallet.
  2. Get Alice's account which was created in the first guide.
  3. Get the account's balance.
  4. Melt 10 native tokens of the first ID.
sdk/examples/how_tos/native_tokens/melt.rs
loading...

Expected Output

Balance before melting: 100
Transaction sent: 0x7b3b152127d3cf2921891ad1ea279ae484d559e4040a0d3ca8940c89cb64b34e
Block included: https://explorer.shimmer.network/testnet/block/0x70d34d37e9a30d19b641ac24529c2fc512f8c9169ffa3521be4b05b7fefe8933
Balance after melting: 90