Overview
AuraClient constructor, properties, transaction sending, and dual-form instruction pattern.
Pre-alpha — not production ready
@aura-protocol/sdk-ts targets Solana devnet only. APIs may change without notice. Do not use for real funds until a stable release and audit are published.
AuraClient is the low-level AURA SDK client. It gives you full control over
every instruction parameter, supports composing multiple instructions into a
single transaction, and exposes the complete 67-instruction surface.
If you want sensible defaults and plain-number inputs, use the
Aura high-level API instead. Access it from a client
instance via aura.lowLevel.
Constructor
import { Connection } from '@solana/web3.js';
import { AuraClient, AURA_PROGRAM_ID } from '@aura-protocol/sdk-ts';
const connection = new Connection(
'https://devnet.helius-rpc.com/?api-key=YOUR_KEY',
'confirmed',
);
// Default — targets devnet AURA_PROGRAM_ID
const client = new AuraClient({ connection });
// Custom program ID (e.g. localnet)
const localClient = new AuraClient({
connection: new Connection('http://localhost:8899', 'confirmed'),
programId: myLocalProgramId,
});AuraClientOptions:
| Option | Type | Required | Description |
|---|---|---|---|
connection | Connection | ✓ | Solana RPC connection |
programId | PublicKey | — | Override program ID (defaults to devnet AURA_PROGRAM_ID) |
confirmOptions | ConfirmOptions | — | Anchor confirm options |
Properties
| Property | Type | Description |
|---|---|---|
connection | Connection | Underlying Solana RPC connection |
programId | PublicKey | AURA program ID in use |
confirmOptions | ConfirmOptions | Anchor confirm options |
provider | AnchorProvider | Read-only Anchor provider (never used to sign) |
program | Program<AuraCore> | Anchor program instance for building typed instructions |
coder | BorshInstructionCoder | Borsh coder for decoding raw instruction data |
Dual-Form Instructions
Every instruction on AuraClient is available in two forms:
*Instruction() — returns a TransactionInstruction for composing into
custom transactions, batching, or signing with external wallets.
Method without suffix — builds, signs, and sends in one call, returning the transaction signature.
// Form 1: instruction only — compose freely
const { treasury, instruction } = await client.createTreasuryInstruction({
owner: owner.publicKey,
args,
});
const tx = new Transaction().add(instruction).add(anotherInstruction);
// Form 2: build + send in one call
const { treasury, signature } = await client.createTreasury(owner, args);
console.log('Signature:', signature);sendInstructions
Send one or more instructions in a single transaction. Returns the signature immediately — does not wait for confirmation.
const now = new BN(Math.floor(Date.now() / 1000));
const pauseIx = await client.pauseExecutionInstruction(
{ owner: owner.publicKey, treasury },
true,
now,
);
const cancelIx = await client.cancelPendingInstruction(
{ owner: owner.publicKey, treasury },
now,
);
const signature = await client.sendInstructions(owner, [pauseIx, cancelIx]);
console.log('Batched tx:', signature);| Parameter | Type | Description |
|---|---|---|
payer | Signer | Fee payer and primary signer |
instructions | TransactionInstruction[] | Instructions to include |
extraSigners | Signer[] | Additional signers (optional) |
options | SendOptions | Send options e.g. skipPreflight (optional) |