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 about")

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

Check Balance for a Single Asset

Use wallet.getBalance() to retrieve all asset balances, then find the one you need by assetId:
const { assetId } = await wallet.assetManager.issue({
  amount: 1000,
  metadata: { name: 'My Token', ticker: 'MT' },
})

const { assets } = await wallet.getBalance()
const amount = assets.find((a) => a.assetId === assetId)?.amount ?? 0;

console.log('Balance:', amount) // 1000

Check Balances for All Assets

wallet.getBalance() returns every asset your wallet holds in a single call:
const { assets } = await wallet.getBalance()

console.log(assets)
// [
//   { assetId: 'abc123...', amount: 1000 },
//   { assetId: 'def456...', amount: 500 },
// ]
Each entry in the assets array:
interface Asset {
  assetId: string     // permanent asset identifier
  amount: number      // total units held (not adjusted for decimals)
}

Next Steps

Issue Assets

Create new assets

Verify Metadata

Read asset name, ticker, and decimals