MOONEUM
Business crypto treasury platform

Treasury API

The org's wallets, its live portfolio, historical value, and the audit trail — everything else on the platform builds on what's in here.

Treasury is the org's home base — a wallet imported here is immediately available to Pay, Trade, Earn, and Borrow, and every product's activity reconciles back into the same portfolio and ledger this API reads. Requires a key or token scoped to Treasury; see Getting started.

Reads are instant, writes go through approvals

Everything on this page except wallet imports is read-only. Anything that moves funds — a payment, a trade, a deposit — is an order that flows through your org's approval policy first: see Approvals & signing.

Watch-only and org-wide — import once here and every product reads from the same list.

Import a wallet

import { TreasuryClient } from '@mooneum/sdk';

const client = new TreasuryClient({
  baseUrl: 'https://api.mooneum.com',
  token: 'sk_…',
});

// A plain address wallet…
const wallet = await client.importWallet({
  app: 'treasury',
  type: 'WATCH_ONLY',
  chain: 'ethereum',
  address: '0x…',
  name: 'Operating wallet',
});

// …or a Bitcoin HD wallet from an xpub (fresh address per invoice — see the Pay API guide):
const btc = await client.importWalletXpub({
  app: 'treasury',
  chain: 'bitcoin',
  xpub: 'zpub6…',
  name: 'BTC treasury',
});

type accepts WATCH_ONLY (the default — Mooneum never holds a key), HOT, or a paired hardware wallet (HARDWARE_LEDGER / HARDWARE_TREZOR). app records which product the import happened from; the wallet itself is still org-wide the moment it exists.

List, sync, and manage

const wallets = await client.listWallets();
const wallet = await client.getWallet(id); // with live balances
await client.syncWallet(id); // request an immediate re-sync
await client.updateWallet(id, { name: 'Renamed wallet' });
await client.setWalletActive(id, false); // deactivate without removing it

Exchange accounts (Binance, Coinbase, Kraken) and Stripe accounts live beside wallets, same shape:

const exchanges = await client.listExchangeAccounts();
await client.createExchangeAccount({
  exchange: 'coinbase',
  label: 'Main',
  apiKey: '…',
  apiSecret: '…',
});

const stripeAccounts = await client.listStripeAccounts();