AURA

AuraClient

The thin RPC + Anchor client — constructor, properties, and transaction sending.

AuraClient is a thin wrapper around a Solana Connection and the Anchor Program. It holds no per-instruction logic — instruction building lives in the instructions namespace and account reads in accounts. The client's job is to provide the program, the coder, and a way to send transactions.

Constructor

import { Connection } from "@solana/web3.js";
import { AuraClient, AURA_PROGRAM_ID } from "@aura-protocol/sdk-ts";

// Defaults to the devnet AURA program id.
const client = new AuraClient({
  connection: new Connection("https://api.devnet.solana.com", "confirmed"),
});

// Override the program id (e.g. localnet) and confirm options.
const localClient = new AuraClient({
  connection: new Connection("http://localhost:8899", "confirmed"),
  programId: myLocalProgramId,
  confirmOptions: { commitment: "confirmed", skipPreflight: false },
});

AuraClientOptions:

OptionTypeRequiredDescription
connectionConnectionSolana RPC connection.
programIdPublicKeyProgram id override. Defaults to AURA_PROGRAM_ID.
confirmOptionsConfirmOptionsAnchor confirm options.

Properties

PropertyTypeDescription
connectionConnectionThe underlying RPC connection.
programIdPublicKeyThe program id in use.
confirmOptionsConfirmOptionsResolved confirm options.
providerAnchorProviderRead-only provider. Its wallet cannot sign — it throws if asked.
programProgram<AuraCore>Anchor program used by every instruction builder.
coderBorshInstructionCoderDecodes raw instruction data (see below).

The provider never signs

The client builds a read-only provider so it can never accidentally sign with an unexpected key. You always pass an explicit Signer to sendInstructions and to every send* helper.

Sending transactions

sendInstructions packs one or more instructions into a single transaction, signs with the payer (plus any extra signers), and sends it. It returns the signature immediately — it does not wait for confirmation, so await confirmation yourself if you need to read state right after.

import BN from "bn.js";
import { instructions } from "@aura-protocol/sdk-ts";

const now = new BN(Math.floor(Date.now() / 1000));

// Compose multiple instructions into one transaction.
const pauseIx = await instructions.execution.pauseExecution(client, {
  accounts: { owner: owner.publicKey, treasury },
  args: { paused: true, now },
});
const cancelIx = await instructions.execution.cancelPending(client, {
  accounts: { owner: owner.publicKey, treasury, dwalletState: null },
  args: { now },
});

const signature = await client.sendInstructions(owner, [pauseIx, cancelIx]);
ParameterTypeDescription
payerSignerFee payer and primary signer.
instructionsTransactionInstruction[]Instructions to include.
extraSignersSigner[]Additional signers (optional).
optionsSendOptionse.g. { skipPreflight: true } (optional).

sendInstruction(payer, instruction, extraSigners?, options?) is the single-instruction convenience form.

Confirm before reading state

sendInstructions returns before the validator processes the transaction. To assert on-chain state immediately afterwards, confirm against the blockhash (see the Examples page) or fetch with a short retry.

Decoding instruction data

The Borsh coder decodes raw instruction data back into a name + arguments — useful for inspecting transactions or building explorers.

const ix = await instructions.treasury.createTreasury(client, input);
const decoded = client.coder.decode(ix.data);
console.log(decoded?.name); // "create_treasury"

On this page