import { type Base64EncodedWireTransaction, type TransactionSigner } from '@solana/kit'; import { type AmountLike, type SessionRequest, type SessionSigner } from './Session.js'; import type { SessionOpener } from './SessionFetch.js'; /** Placeholder signature used while the operator still needs to broadcast the open transaction. */ export declare const PENDING_SERVER_SIGNATURE = "1111111111111111111111111111111111111111111111111111111111111111"; /** * Payment-channel open fields shared by client-built and server-built open flows. */ export interface PaymentChannelOpen { readonly channelId: string; readonly deposit: string; readonly gracePeriod: number; readonly mint: string; readonly openSlot: string; readonly payee: string; readonly payer: string; readonly salt: string; } /** * Single payment-channel open transaction plus the fields needed to authorize a session. */ export interface PaymentChannelOpenTransaction extends PaymentChannelOpen { readonly transaction: Base64EncodedWireTransaction; } /** * Derives the payment-channel open fields without building a transaction. * * Use this for server-opened client-voucher sessions: the client must know the * channel PDA so it can sign vouchers, but the operator still funds and opens * the channel. */ export declare function derivePaymentChannelOpen(parameters: derivePaymentChannelOpen.Parameters): Promise; /** * Builds the payer-signed payment-channel open transaction for pull/client-voucher sessions. * * The transaction uses the operator from the session challenge as fee payer and * is intentionally left partially signed; the server adds the operator * signature before broadcasting it. */ export declare function buildOpenPaymentChannelTransaction(parameters: buildOpenPaymentChannelTransaction.Parameters): Promise; /** * Creates a high-level opener for pull-mode sessions using client-signed vouchers. * * The opener turns a session 402 challenge into a payment-channel open action * with the signed transaction attached. The server/operator broadcasts that * transaction, then subsequent stream commits are cumulative vouchers signed by * the generated session key. */ export declare function createPaymentChannelSessionOpener(parameters: createPaymentChannelSessionOpener.Parameters): SessionOpener; /** * Creates an opener for pull/client-voucher sessions where the operator opens * the payment channel server-side. * * The payload contains the deterministic channel PDA and open fields, but no * transaction. The server validates those fields, opens the channel with its * configured signer, and then the client signs cumulative vouchers for the * derived channel. */ export declare function createServerOpenedPaymentChannelSessionOpener(parameters?: createServerOpenedPaymentChannelSessionOpener.Parameters): SessionOpener; export declare namespace derivePaymentChannelOpen { interface Parameters { readonly authorizedSigner: string; readonly deposit?: AmountLike | undefined; readonly gracePeriod?: number | undefined; /** Overrides the challenge-provided `request.recentSlot` (a channel PDA seed). */ readonly openSlot?: AmountLike | undefined; readonly payer: string; readonly programAddress?: string | undefined; readonly recipients?: readonly { readonly bps: number; readonly recipient: string; }[] | undefined; readonly request: SessionRequest; readonly salt?: AmountLike | undefined; readonly tokenProgram?: string | undefined; } } export declare namespace buildOpenPaymentChannelTransaction { interface Parameters { readonly authorizedSigner: string; readonly deposit?: AmountLike | undefined; readonly gracePeriod?: number | undefined; /** Overrides the challenge-provided `request.recentSlot` (a channel PDA seed). */ readonly openSlot?: AmountLike | undefined; readonly programAddress?: string | undefined; readonly recipients?: readonly { readonly bps: number; readonly recipient: string; }[] | undefined; readonly request: SessionRequest; readonly rpcUrl?: string | undefined; readonly salt?: AmountLike | undefined; readonly signer: TransactionSigner; readonly tokenProgram?: string | undefined; } } export declare namespace createPaymentChannelSessionOpener { interface Parameters { readonly cumulative?: AmountLike | undefined; readonly deposit?: AmountLike | undefined; readonly expiresAt?: AmountLike | undefined; readonly gracePeriod?: number | undefined; /** Overrides the challenge-provided `request.recentSlot` (a channel PDA seed). */ readonly openSlot?: AmountLike | undefined; readonly programAddress?: string | undefined; readonly recipients?: readonly { readonly bps: number; readonly recipient: string; }[] | undefined; readonly rpcUrl?: string | undefined; readonly salt?: AmountLike | undefined; readonly sessionSigner?: SessionSigner | undefined; readonly signature?: string | undefined; readonly signer: TransactionSigner; readonly source?: string | undefined; readonly tokenProgram?: string | undefined; } } export declare namespace createServerOpenedPaymentChannelSessionOpener { interface Parameters { readonly cumulative?: AmountLike | undefined; readonly deposit?: AmountLike | undefined; readonly expiresAt?: AmountLike | undefined; readonly gracePeriod?: number | undefined; /** Overrides the challenge-provided `request.recentSlot` (a channel PDA seed). */ readonly openSlot?: AmountLike | undefined; readonly payer?: string | undefined; readonly programAddress?: string | undefined; readonly salt?: AmountLike | undefined; readonly sessionSigner?: SessionSigner | undefined; readonly signature?: string | undefined; readonly source?: string | undefined; readonly tokenProgram?: string | undefined; } } //# sourceMappingURL=PaymentChannels.d.ts.map