import { PublicKey, Transaction, TransactionInstruction, Keypair } from "@solana/web3.js"; import { type SolanaV14Deployment, type SolanaNetwork } from "./generated/solanaV14Deployments.generated.js"; import type { SdkEnvironment } from "./deploymentResolver.js"; export declare const SOLANA_TOKEN_PROGRAM = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; export declare const SOLANA_GENESIS: Readonly<{ mainnet: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"; devnet: "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG"; }>; export declare const SOLANA_STABLE_ASSETS: Readonly<{ mainnet: Readonly<{ USDC: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; USDT: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"; }>; devnet: Readonly<{ USDC: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"; }>; }>; export declare const SOLANA_QUOTE_FIELDS: readonly ["payer", "merchant", "token", "grossAmount", "ipCreator", "validUntil", "orderIdHash", "nonce", "routeId"]; export interface SolanaV14Quote { payer: string; merchant: string; token: string; grossAmount: string; ipCreator: string; validUntil: string; orderIdHash: string; nonce: string; routeId: string; } export interface SolanaV14SettlementCall { chain: "solana"; network: SolanaNetwork; contract: string; splitter_version: "1.4"; idl_sha256: string; route: "merchant-aifp1"; asset: string; function: "settle_native" | "settle_stable"; arg_encoding: "borsh-quote+signature"; field_order: readonly string[]; bound_to_payer: true; value_lamports?: string; treasury_owner: string; accounts: Record; remaining_accounts?: readonly string[]; args: { quote: SolanaV14Quote; signature: `0x${string}`; }; } export interface SolanaV14Prepared { family: "solana"; hash: string; serializedTransactionBase64: string; network: SolanaNetwork; programId: string; idlSha256: string; recentBlockhash: string; lastValidBlockHeight: number; settlementNonce: string; } export declare class SolanaV14Error extends Error { readonly code: string; readonly prepared?: SolanaV14Prepared | undefined; readonly actualFeeLamports?: bigint | undefined; constructor(code: string, message: string, prepared?: SolanaV14Prepared | undefined, actualFeeLamports?: bigint | undefined); } /** Exact admission-rate accounting; round fees upwards to whole USD micros. */ export declare function solanaLamportCostUsd(lamports: bigint, rate: string): number; export declare function encodeSolanaV14Quote(q: SolanaV14Quote): Buffer; export declare function solanaV14Digest(programId: string, q: SolanaV14Quote): Buffer; export declare function solanaV14PaymentId(q: SolanaV14Quote): string; /** Zero-fee creator slot is an unused writable account, not SystemProgram. * The signed creator remains zero. No lamports are sent to this placeholder. */ export declare function solanaCreatorPlaceholder(programId: string, payer: string): string; export declare function solanaStableMint(network: SolanaNetwork, asset: string): string; /** Immutable inventory is useful for encoding/recovery, never activates a rail. */ export declare function solanaV14Inventory(environment: SdkEnvironment, network: SolanaNetwork): SolanaV14Deployment; /** Production high-level authorizer; preserves the canonical disabled gate. */ export declare function authorizedSolanaV14Inventory(environment: SdkEnvironment, network: SolanaNetwork): SolanaV14Deployment; export declare function solanaV14Pdas(programId: string, payer: string, nonce: string): Record; export declare function validateSolanaV14Call(call: SolanaV14SettlementCall, d: SolanaV14Deployment, payer: string, orderId: string, historical?: boolean): void; export declare function solanaV14Instruction(call: SolanaV14SettlementCall, treasury: string): TransactionInstruction; export declare function associatedToken(owner: string, mint: string): PublicKey; export interface SolanaV14Rpc { request(method: string, params: unknown[]): Promise; } export declare function solanaV14Rpc(url: string, fetchImpl?: typeof fetch): SolanaV14Rpc; export interface SolanaV14Plan { call: SolanaV14SettlementCall; deployment: SolanaV14Deployment; payer: string; transaction: Transaction; feeRentLamports: bigint; maxFeeLamports: bigint; transactionFeeLamports: bigint; lastValidBlockHeight: number; createdAtMs: number; orderId: string; } /** Read-only verification for a locally unsent expired admission; not a payment proof. */ export declare function verifyHistoricalSolanaV14Quote(call: SolanaV14SettlementCall, ctx: { rpc: SolanaV14Rpc; deployment: SolanaV14Deployment; payer: string; orderId: string; }): Promise; /** Preflight performs no payer signature and no write. Reserve USD after this * succeeds; sign/persist/broadcast the exact prepared message afterwards. */ export declare function prepareSolanaV14Settlement(call: SolanaV14SettlementCall, ctx: { rpc: SolanaV14Rpc; deployment: SolanaV14Deployment; payer: string; orderId: string; maxFeeLamports: bigint; }): Promise; /** Signed bytes and sole signature are persisted before the single send. */ export declare function executeSolanaV14Settlement(plan: SolanaV14Plan, ctx: { rpc: SolanaV14Rpc; keypair: Keypair; onPrepared: (p: SolanaV14Prepared) => Promise; }): Promise; /** Read-only reconciliation of the exact saved signature, never replacement. */ export declare function readSolanaV14FinalizedFailure(call: SolanaV14SettlementCall, p: SolanaV14Prepared, ctx: { rpc: SolanaV14Rpc; deployment: SolanaV14Deployment; payer: string; orderId: string; transactionFeeLamports: bigint; maxFeeLamports: bigint; }): Promise; /** Historical verification is local: no new signature, send, expiry or profile * lookup. Issuance still requires the backend's finalized execution proof. */ export declare function assertPreparedSolanaV14Recovery(call: SolanaV14SettlementCall, p: SolanaV14Prepared, d: SolanaV14Deployment, payer: string, orderId: string): void; //# sourceMappingURL=settlementSolanaV14.d.ts.map