Skip to main content

Setup

Import the SDK and create a wallet:
import { MnemonicIdentity, Wallet } from '@arkade-os/sdk'

const identity = MnemonicIdentity.fromMnemonic("abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon")

const wallet = await Wallet.create({
  identity,
  arkServerUrl: 'https://arkade.computer',
})

Reissue

Reissuing creates additional units of an existing asset. This requires the asset to have been issued with a control asset, and you must hold that control asset in your wallet.
// issue a control asset and main asset first
const { assetId: controlAssetId } = await wallet.assetManager.issue({ amount: 1 })
const { assetId } = await wallet.assetManager.issue({
  amount: 500,
  controlAssetId,
})

// reissue 300 more units
const txid = await wallet.assetManager.reissue({
  assetId,
  amount: 300,
})

console.log('Reissue Tx:', txid)
After reissuance, the total supply is the sum of all issued amounts (800 in this example).
The control asset remains in your wallet after reissuance. You can reissue as many times as needed while you hold it.

Burn

Burning permanently destroys units of an asset. You can burn a partial amount or the full balance.

Partial Burn

const { assetId } = await wallet.assetManager.issue({ amount: 1000 })

const txid = await wallet.assetManager.burn({
  assetId,
  amount: 400,
})

console.log('Burn Tx:', txid)
After burning 400 units from a supply of 1000, the wallet holds 600 remaining units.

Complete Burn

Burn the entire balance to fully remove the asset from your wallet:
await wallet.assetManager.burn({
  assetId,
  amount: 1000, // burn all units
})
Burning the control asset permanently disables reissuance for all assets it controls. This action is irreversible.

Next Steps