/** * @name tools/perpspad/perpspad-escrow * @description Creator-split escrow (Option B) integration for PerpsPad * launches. Derives the escrow PDA for a token mint, builds the * initialize_escrow instruction for the deployed mainnet program, and * swaps the launch creatorAddress to the escrow PDA so PerpsPad's hourly * creator_payout lands in the trustless 70/30 split program. * * Program facts (verified: devnet decisive test 200 + mainnet live deploy): * - Program ID: ENpvWhtTtnveMZ3WHpGKHMEYDrPHHc5v6JjjVUWFNYgA * - PDA seeds: ["creator_escrow", token_mint_bytes] * - initialize_escrow accounts: [escrow(w), mint(r), agent_wallet(r), * payer(+s,w), system_program(r)] — data: single byte 0 * - The agent wallet is stored IMMUTABLY as the 70% destination. * * Launch-order note (verified against the live API, devnet 2026-09-16): * POST /api/v1/launch returns the REAL mint in its response (`mint` * field) even while pending. The launch body requires creatorAddress * UP FRONT, before any mint exists. The clean flow: * 1. Caller generates an ephemeral "escrow seed key" (any valid pubkey). * 2. escrow PDA = findProgramAddress(["creator_escrow", seedKey]). * 3. Launch submitted with creatorAddress = escrow PDA. * 4. PerpsPad responds with the REAL mint. * 5. initialize_escrow is signed with the REAL mint + agent wallet — * the escrow PDA is derived from the REAL mint from then on, so the * hourly creator_payout lands on a PDA owned by our program and the * pre-launch seed key is discarded. * IMPORTANT correction: because the escrow PDA used as creatorAddress is * derived from the seed key while PerpsPad pays the creatorAddress, the * escrow the program initializes later (mint-derived) is NOT the account * that received the payouts. THE VERIFIED WORKING PATTERN is therefore: * derive the escrow from the REAL mint returned by PerpsPad only when * PerpsPad preserves the creatorAddress across the pending→live * transition — OTHERWISE the launch must be a two-phase flow where the * mint is known BEFORE the launch body is submitted. * * RESOLUTION (chosen design, see DESIGN.md): the escrow is derived from * the MINT, and PerpsPad derives its mint FROM THE LAUNCH TX ITSELF — * the mint keypair is generated client-side and the config tx creates * it. So the mint IS known before the launch body is submitted: the * caller generates the mint keypair, derives the escrow PDA from it, * passes escrowPda as creatorAddress, and later signs the config tx that * materializes that exact mint. Everything lines up deterministically. * * @module tools/perpspad/perpspad-escrow */ import { PublicKey } from '@solana/web3.js'; /** Deployed creator-split-escrow program (mainnet). */ export declare const CREATOR_SPLIT_ESCROW_PROGRAM_ID: PublicKey; /** PDA seed constant — must match the Rust `ESCROW_SEED`. */ export declare const ESCROW_SEED = "creator_escrow"; /** initialize_escrow instruction discriminator (first data byte). */ export declare const INITIALIZE_ESCROW_IX = 0; /** * Derives the escrow PDA for a token mint. Same derivation the client uses * for PerpsPad's `creatorAddress` and the Rust program uses in * `initialize_escrow` (runtime `sol_try_find_program_address`). */ export declare function deriveEscrowPda(tokenMint: string | PublicKey): { escrowPda: PublicKey; bump: number; }; /** * Builds the initialize_escrow instruction (borsh-free — the program reads * raw accounts). Account order MUST match the Rust handler: * 0 escrow (writable), 1 mint (ro), 2 agent_wallet (ro), * 3 payer (writable+signer), 4 system_program (ro). */ export declare function buildInitializeEscrowInstruction(params: { readonly escrowPda: PublicKey; readonly tokenMint: PublicKey; readonly agentWallet: PublicKey; readonly payer: PublicKey; }): { programId: PublicKey; keys: { pubkey: PublicKey; isSigner: boolean; isWritable: boolean; }[]; data: Buffer; }; /** * Validates a base58 mint/creator address shape without constructing the * full keypair machinery (cheap fail-fast for tool inputs). */ export declare function isValidSolanaAddress(value: string): boolean; //# sourceMappingURL=perpspad-escrow.d.ts.map