AURA

Quick Start

Install the AURA TypeScript SDK and build your first treasury instruction.

Pre-alpha — not production ready

@aura-protocol/sdk-ts targets Solana devnet only. Program instructions, account layouts, argument shapes, and SDK APIs may change without notice between releases. Do not use this SDK to manage real funds or production treasuries until a stable release and security audit are published.

@aura-protocol/sdk-ts is the canonical TypeScript interface for AURA. It is generated from the on-chain aura-core Anchor IDL and is fully typed: every instruction, account, error, event, and PDA is derived from the program, so the SDK and the program can never drift.

What it exposes

  • AuraClient — a thin RPC + Anchor wrapper (decode, derive, send).
  • instructions.<domain>.<name> — typed builders for all 161 instructions, grouped into 13 domains.
  • accounts.fetch* — typed fetchers for all 32 account types.
  • pda.* — PDA derivation for every program account.
  • errors, events, validation — typed error parsing, event decoding, and input validation.
  • programSurface — a runtime catalog (domains, labels, instruction → domain map) for navigation and tooling.

The SDK is functional, not object-heavy. You build instructions with free functions that take a client and an input object — there are no per-instruction methods on AuraClient itself.

Installation

npm install @aura-protocol/sdk-ts @solana/web3.js bn.js

The package ships ESM with full .d.ts types and @noble/hashes as its only runtime dependency beyond Anchor.

The core pattern

Every instruction follows the same three-step shape:

  1. Derive any PDAs you need (pda.*).
  2. Build the instruction (instructions.<domain>.<name>(client, input)).
  3. Send it — either with the matching send* helper or by composing it into your own transaction.
import BN from "bn.js";
import { Connection, Keypair } from "@solana/web3.js";
import { AuraClient, accounts, instructions } from "@aura-protocol/sdk-ts";

const connection = new Connection(
  "https://api.devnet.solana.com",
  "confirmed",
);
const client = new AuraClient({ connection });
const owner = Keypair.generate();

// 1 + 2. `createTreasuryInput` derives the treasury PDA and shapes the accounts.
const { treasury, input } = accounts.createTreasuryInput({
  owner: owner.publicKey,
  args: {
    agentId: "agent-prod-1",
    aiAuthority: owner.publicKey,
    createdAt: new BN(Math.floor(Date.now() / 1000)),
    pendingTransactionTtlSecs: new BN(900),
    policyConfig,   // PolicyConfigRecord — see the Treasury page
    protocolFees,   // ProtocolFeesRecord
  },
});

// 3. Build + send in one call.
const signature = await instructions.treasury.sendCreateTreasury(
  client,
  owner,
  input,
);

console.log("treasury:", treasury.toBase58());
console.log("signature:", signature);

Prefer to compose the instruction yourself? Drop the send prefix to get a TransactionInstruction back instead:

import { Transaction } from "@solana/web3.js";

const ix = await instructions.treasury.createTreasury(client, input);
const tx = new Transaction().add(ix);
// sign + send however you like, or:
await client.sendInstructions(owner, [ix]);

Import surface

// Everything is available from the root entry point…
import {
  AuraClient,
  accounts,
  instructions,
  pda,
  errors,
  events,
  validation,
  programSurface,
  AURA_PROGRAM_ID,
  deriveTreasuryAddress,
} from "@aura-protocol/sdk-ts";

// …or via subpath exports for tighter bundles.
import { treasury, execution } from "@aura-protocol/sdk-ts/instructions";
import { fetchTreasuryAccount } from "@aura-protocol/sdk-ts/accounts";
import { parseAuraError } from "@aura-protocol/sdk-ts/errors";

Next steps

On this page