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 in the checked-in SDK surface is
derived from the current program IDL.
What it exposes
AuraClient— a thin RPC + Anchor wrapper (program access, decode, 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.jsThe package ships ESM with full .d.ts types. Runtime dependencies include
Anchor, @noble/hashes, and bs58; @solana/web3.js and bn.js are peer
dependencies.
The core pattern
Every instruction follows the same three-step shape:
- Derive any PDAs you need (
pda.*). - Build the instruction (
instructions.<domain>.<name>(client, input)). - 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";