/** * Transaction v1 build of a shield (SIMD-0385). * * The v0 shield must squeeze under 1232 bytes by compiling against a shared * address lookup table and dropping the priority-fee instruction when tight. * A v1 shield carries every account inline (no ALT), puts the compute budget in * the message header, and has 4096 bytes โ€” so the same proof and instruction * fit with room to spare and no lookup table ever needs to exist or be funded. * * It reuses the public proof cache from `shield()` / `rebuild()`, so switching * a client to v1 costs no extra proving. */ import type { Connection } from "@solana/web3.js"; import type { ShieldResult } from "./types.js"; import { type V1Config } from "../txv1/compile.js"; import { type ResourceEstimate } from "../txv1/budget.js"; export type ShieldV1Transaction = { /** * UNSIGNED v1 wire bytes with a zeroed signature slot. Sign with * `signV1Bytes` (tx-v1) or a wallet that advertises transaction version 1, * then submit base64-encoded. */ wireBytes: Uint8Array; transactionSize: number; blockhash: string; lastValidBlockHeight: number; deadline: bigint; config: V1Config; }; /** * Build an unsigned transaction v1 shield from a `shield()` / `rebuild()` result. * * Resource limits: pass `limits` only when they were measured for THIS exact * instruction set. A SOL shield and an SPL shield load different accounts * (vault token account, token program, ...), so their compute units and loaded * account data differ โ€” never reuse limits measured for one mint on another. * v1 has no implicit budget: a transaction that exceeds its header limits fails * on-chain and still pays its fee. * * Without `limits`, they are measured by simulation via * `estimateV1ResourceLimits(connection.rpcEndpoint, ...)`, which POSTs to that * URL with a plain `fetch` (only a `content-type` header). The Connection's own * `httpHeaders` / `fetch` / `fetchMiddleware` are NOT used, so an RPC that * authenticates with custom headers will reject the estimate: measure through * your own authenticated transport and pass explicit `limits` instead. */ export declare function buildShieldV1(result: ShieldResult, opts?: { connection?: Connection; blockhash?: { blockhash: string; lastValidBlockHeight: number; }; /** Defaults to the deadline already bound into `result`. */ deadlineSeconds?: number; /** ยต-lamports per CU, converted to v1's total-lamport fee. 0 omits the fee. */ computeUnitPriceMicroLamports?: number; /** * Final resource limits. When omitted they are measured by simulating the * transaction (requires `connection`) and padded with `margins`. * * Must have been measured for this exact instruction set โ€” SOL and SPL * shields differ, so do not reuse limits across mints. The automatic * measurement POSTs to `connection.rpcEndpoint` with a plain `fetch` (no * Connection headers); RPCs that authenticate via custom headers need * explicit `limits`. */ limits?: ResourceEstimate; margins?: { cuMarginBps: number; dataMarginPages: number; }; }): Promise;