/** * CIRCUITS (V2) * * Valid, currently used: * All circuits with 1 - 10 inputs and 1 - 5 outputs, less the 10x5 circuit * * Valid, but currently unused: * 11x1, 12x1, 13x1 * 1x10, 1x13 */ export declare const VALID_INPUT_COUNTS: number[]; export declare const VALID_OUTPUT_COUNTS: number[]; export declare const MAX_INPUTS: number; /** * The transaction shapes a given signer can actually produce. * * Circuit support is not the only limit once an external signer is involved. A Ledger * clear-signing a transact builds and hashes it on-device, and its Poseidon arity caps * the shape at 1-3 inputs, 1-3 outputs, `n + m <= 5`. Generating solutions outside that * envelope produces batches the device will refuse — after the user has already approved * them — so the bound belongs here, before any UTXOs are selected. * * Blind signing needs no envelope: the device receives an already-computed 32-byte hash * (`RailgunSigner.sign`) and never sees the input or output counts. That is why the * default is simply the circuit envelope. */ export type SigningEnvelope = { readonly validInputCounts: readonly number[]; readonly maxOutputs: number; /** Cross-constraint on `nIn + nOut`, when the signer imposes one. */ readonly maxInputsPlusOutputs?: number; }; /** Circuit limits — what every software wallet and blind-signing hardware wallet gets. */ export declare const DEFAULT_SIGNING_ENVELOPE: SigningEnvelope; /** Ledger CLEAR_SIGN limits. Mirrors `validateClearSignShape` in the device library. */ export declare const CLEAR_SIGN_SIGNING_ENVELOPE: SigningEnvelope; /** * One candidate way to sign a batch: the signing mode and the envelope that mode implies. * * These two must always travel together. Selecting UTXOs under the clear-sign envelope and * then blind-signing is merely wasteful, but selecting under the default envelope and then * clear-signing is the exact failure this envelope exists to prevent — the device refuses a * batch the user has already approved. Pairing them in one value makes that mismatch * unrepresentable. */ export type SigningAttempt = { readonly useClearSign: boolean; readonly envelope: SigningEnvelope; /** * Reject this attempt if it needs more than this many transactions. * * A narrow envelope rarely fails outright — it splits. Asking for four UTXOs' worth * under a 3-input cap yields two transactions, not an error, and each one is its own * device approval. Without a ceiling, `prefer` would hand the user an unbounded number * of approvals rather than falling back to a single blind signature. Undefined means no * ceiling, which is the pre-existing behaviour for every signer. */ readonly maxTransactions?: number; }; /** Blind signing: full circuit envelope. Every software wallet, and any device, always. */ export declare const BLIND_SIGNING_ATTEMPT: SigningAttempt; /** Clear signing: the device's tighter envelope. Only offered when the batch qualifies. */ export declare const CLEAR_SIGNING_ATTEMPT: SigningAttempt; export declare const isValidNullifierCount: (utxoCount: number, envelope?: SigningEnvelope) => boolean; /** * Largest input count still usable once the output count is known. Returns 0 when the * outputs alone already exceed what the signer can handle. */ export declare const maxInputsForOutputCount: (outputCount: number, envelope?: SigningEnvelope) => number;