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:
- Create a wallet.
- Get Alice's account which was created in the first guide.
- Get the account's balance.
- Melt 10 native tokens of the first ID.
- Rust
- Nodejs
- Python
sdk/examples/how_tos/native_tokens/melt.rs
loading...
bindings/nodejs/examples/how_tos/native_tokens/melt.ts
loading...
bindings/python/examples/how_tos/native_tokens/melt.py
loading...
Expected Output
Balance before melting: 100
Transaction sent: 0x7b3b152127d3cf2921891ad1ea279ae484d559e4040a0d3ca8940c89cb64b34e
Block included: https://explorer.shimmer.network/testnet/block/0x70d34d37e9a30d19b641ac24529c2fc512f8c9169ffa3521be4b05b7fefe8933
Balance after melting: 90