Environments and Wallets

List, fetch, create, and delete payment environments and wallets with the Amboss Payments SDK.

Environments group your wallets and API keys, and separate sandbox from live. Each wallet holds a single asset and its balance. Both are exposed as typed resources on the client.

These map directly to the GraphQL API. For the underlying concepts, precision rules, and asset discovery, see Environments and Wallets.

Environments

// List every environment your key can see.
const environments = await payments.environments.list();

// Fetch one by id (includes wallet count and timestamps).
const environment = await payments.environments.get(id);

// Create a sandbox or live environment.
const created = await payments.environments.create({
  name: "Production",
  type: "PRODUCTION", // 'SANDBOX' | 'PRODUCTION'
});

// Delete one.
await payments.environments.delete(id);

Wallets

// List wallets in an environment. Returns trimmed records (no balance or nodes).
const wallets = await payments.wallets.list({ environmentId });

// Fetch the full wallet record, including balance, asset, and attached nodes.
const wallet = await payments.wallets.get(id);

// Create a wallet for a specific asset.
const created = await payments.wallets.create({
  environment_id: environmentId,
  asset_id: assetId,
  name: "USDT payouts",
});

// Delete one.
await payments.wallets.delete(id);

wallets.list returns a trimmed shape for fast listing. Call wallets.get(id) when you need balance, asset details, or the wallet's attached nodes.

Walking your account

A common first call: list environments, then the wallets in each one. This is also how you grab a wallet_id for a receive or send.

const environments = await payments.environments.list();

for (const environment of environments) {
  console.log(`${environment.name} (${environment.type})`);
  const wallets = await payments.wallets.list({ environmentId: environment.id });
  for (const wallet of wallets) {
    console.log(`  ${wallet.name} [${wallet.asset.symbol}] ${wallet.id}`);
  }
}

Next steps