import { AddressLookupTableAccount, Connection, PublicKey } from "@solana/web3.js"; import type { AltSource, ShieldCachePort } from "./types.js"; /** * Address lookup table handling for the shield path. * * The ALT is not an optimisation here — it is load-bearing. A `transact` carries * 847 bytes of instruction data across 16 accounts, which is ~1500 bytes as a * legacy transaction and therefore unlandable. Compressing the constant pool * accounts to 1-byte indices is what brings it to ~1163 and leaves room for * Phantom's Lighthouse guard instructions. */ /** * The shared, team-owned deposit table. * * Deliberately shared rather than per-wallet: creating a per-wallet table costs * the signer an extra signature and unrecoverable rent, which is unacceptable to * ask of an external wallet shielding once, and impossible to ask of a * third-party platform's managed wallet. */ export declare const SHARED_DEPOSIT_ALT: PublicKey; /** Mints the shared table is provisioned for. */ export declare const SHARED_ALT_MINTS: { symbol: string; mint: PublicKey; }[]; /** * Load the shared table, and verify it actually covers this shield. * * The verification is the important part. Coverage is an *operational* property, * not a code property: the table is populated by a script, and if a mint or a * tree is missing, every one of its accounts falls back to a 32-byte static key * and the transaction silently grows past 1232. Failing here with a list of the * missing addresses is far better than failing at `signTransaction` with * "transaction too large" and no indication why. */ export declare function sharedDepositAlt(address?: PublicKey, opts?: { cache?: ShieldCachePort; verifyCoverage?: boolean; }): AltSource; /** Use a table the caller already loaded. Skips both the RPC call and the coverage check. */ export declare function explicitAlt(account: AddressLookupTableAccount): AltSource; type NamedKey = { label: string; address: PublicKey; }; /** * Accounts that must be in the table for a shield of `mint` into `outputTreeId` * to fit. * * The signer, the two nullifier markers, and the user's token account are * deliberately excluded: markers are unique per transaction and the others are * per-user, so none can live in a shared table. They are the static keys the * size budget accounts for. */ export declare function requiredAltKeys(params: { mint: PublicKey; outputTreeId: number; programId?: PublicKey; }): NamedKey[]; /** * Everything the shared table should contain across every supported mint and * every tree up to `maxTreeId`. * * Exported so this can be asserted in CI. The table currently only covers tree 0 * per mint, which means the size budget quietly loses 32 bytes of headroom the * day tree 0 fills and `getBestTreeForDeposit` starts returning tree 1. That is * a scheduled failure, and this function is how it gets caught before a user * finds it. */ export declare function expectedDepositAltKeys(params: { mints?: PublicKey[]; maxTreeId?: number; programId?: PublicKey; }): Promise; /** Diff the on-chain table against {@link expectedDepositAltKeys}. */ export declare function auditDepositAlt(connection: Connection, params?: { address?: PublicKey; mints?: PublicKey[]; maxTreeId?: number; programId?: PublicKey; }): Promise<{ ok: boolean; present: number; missing: NamedKey[]; extra: string[]; }>; export {};