AURA
Advanced

Batch

Simulate multiple proposals in a single transaction for pre-flight policy checks.

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.

proposeBatch

Evaluate a batch of proposals against the treasury's policy rules in a single transaction. No state is committed — this is a simulation-only instruction for pre-flight checks. The result is stored in a PDA that callers can read.

// Build only
const instruction = await client.proposeBatchInstruction(
  accounts: ProposeBatchAccounts,
  args: ProposeBatchArgs,
);

// Build + send
await client.proposeBatch(payer, accounts, args);
interface ProposeBatchAccounts {
  payer: PublicKey;
  treasury: PublicKey;
  batch: PublicKey;  // PDA: deriveBatchProposalAddress(treasury, batchId)
  systemProgram: PublicKey;
}
import { deriveBatchProposalAddress } from '@aura-protocol/sdk-ts';
import BN from 'bn.js';

const batchId = new BN(1);
const [batch] = deriveBatchProposalAddress(treasury, batchId);
const now = new BN(Math.floor(Date.now() / 1000));

await client.proposeBatch(
  payer,
  {
    payer: payer.publicKey,
    treasury,
    batch,
    systemProgram: SystemProgram.programId,
  },
  {
    batchId,
    items: [
      {
        amountUsd: new BN(250),
        targetChain: 2,
        txType: 0,
        protocolId: null,
        recipientOrContract: '0xrecipient1...',
        counterpartyRiskScore: null,
        quoteAgeSecs: null,
        expectedOutputUsd: null,
        actualOutputUsd: null,
      },
      {
        amountUsd: new BN(500),
        targetChain: 2,
        txType: 1,
        protocolId: null,
        recipientOrContract: '0xrecipient2...',
        counterpartyRiskScore: 20,
        quoteAgeSecs: new BN(60),
        expectedOutputUsd: new BN(495),
        actualOutputUsd: new BN(493),
      },
    ],
    currentTimestamp: now,
  },
);

The batch result PDA stores the policy decision for each item. Read it after the transaction to see which proposals would pass or fail before submitting them individually.

On this page