import { PublicKey } from "@solana/web3.js"; /** * Highest transaction version requested from the RPC. Solana transaction v1 * (4096-byte txs) went live on mainnet 2026-09-15; reads that pass 0 throw * -32015 on any v1 tx that touches the program. Needs @solana/web3.js >= 1.99. */ export declare const MAX_SUPPORTED_TX_VERSION = 1; /** Default relayer fee in basis points (50 = 0.5%). */ export declare const DEFAULT_FEE_BPS = 50; /** Merkle tree depth - matches on-chain MerkleTreeAccount subtrees array size */ export declare const MERKLE_TREE_DEPTH = 22; /** Root history size - matches on-chain MerkleTreeAccount root_history array size */ export declare const ROOT_HISTORY_SIZE = 256; /** Native SOL mint address (Pubkey::default() = all zeros) */ export declare const NATIVE_SOL_MINT: PublicKey; /** Convert SOL to lamports (e.g. `sol(1.5)` → `1_500_000_000n`). */ export declare function sol(n: number): bigint; /** Configuration for initializing a privacy pool */ export type PoolInitConfig = { /** Fee in basis points (0-10000, where 10000 = 100%) */ feeBps?: number; /** Token mint address (use NATIVE_SOL_MINT for SOL pools) */ mintAddress: PublicKey; /** Minimum deposit amount in lamports/token units */ minDepositAmount?: bigint; /** Maximum deposit amount in lamports/token units */ maxDepositAmount?: bigint; /** Minimum withdrawal amount in lamports/token units */ minWithdrawAmount?: bigint; /** Maximum withdrawal amount in lamports/token units */ maxWithdrawAmount?: bigint; }; /** On-chain PrivacyConfig account structure */ export type PrivacyConfigAccount = { bump: number; vaultBump: number; admin: PublicKey; feeBps: number; feeErrorMarginBps: number; minWithdrawalFee: bigint; /** Minimum fee kept by relayer on swaps (in destination token base units) */ minSwapFee: bigint; /** Fee rate applied to swap output in basis points */ swapFeeBps: number; totalTvl: bigint; mintAddress: PublicKey; minDepositAmount: bigint; maxDepositAmount: bigint; minWithdrawAmount: bigint; maxWithdrawAmount: bigint; numRelayers: number; relayers: PublicKey[]; numTrees: number; nextTreeIndex: number; }; /** On-chain GlobalConfig account structure */ export type GlobalConfigAccount = { bump: number; admin: PublicKey; relayerEnabled: boolean; }; /** * Compute the relayer fee for a withdrawal. * Mirrors the formula in the relayer-server: * fee = max(amount * feeBps / 10_000, minWithdrawalFee) * * @returns fee in base token units, and the amount that reaches the recipient */ export declare function computeWithdrawalFee(amount: bigint, feeBps: number, minWithdrawalFee: bigint): { fee: bigint; toRecipient: bigint; }; /** * Compute the relayer fee for a cross-pool swap. * Mirrors the formula in the relayer-server: * relayerFee = max(estimatedOutput * swapFeeBps / 10_000, minSwapFee) * destAmount = minAmountOut - relayerFee * * @param estimatedOutput Jupiter quote output amount * @param swapFeeBps From the destination pool's PrivacyConfigAccount * @param minSwapFee From the destination pool's PrivacyConfigAccount * @param minAmountOut User-agreed minimum swap output (after slippage) * @returns relayerFee and the amount committed into the destination UTXO */ export declare function computeSwapFee(estimatedOutput: bigint, swapFeeBps: number, minSwapFee: bigint, minAmountOut: bigint): { relayerFee: bigint; destAmount: bigint; };