import { type Base64EncodedWireTransaction, type TransactionSigner } from '@solana/kit'; import { Method } from 'mppx'; /** * Creates a Solana `subscription` method for usage on the client. * * Builds the activation transaction (initialize_subscription_authority if * needed, subscribe, transfer_subscription) and signs as the subscriber. * When `feePayer: true` is advertised in the challenge, the server's * `feePayerKey` is used as fee payer and the transaction is partially * signed; the server completes the signature before broadcasting. * * @example * ```ts * import { Mppx, solana } from '@solana/mpp/client' * * const method = solana.subscription({ signer, rpcUrl: 'https://api.devnet.solana.com' }) * const mppx = Mppx.create({ methods: [method] }) * * const response = await mppx.fetch('https://api.example.com/paid-content') * ``` */ export declare function subscription(parameters: subscription.Parameters): Method.Client<{ readonly intent: "subscription"; readonly name: "solana"; readonly schema: { readonly credential: { readonly payload: import("zod/mini").ZodMiniObject<{ signature: import("zod/mini").ZodMiniOptional>; transaction: import("zod/mini").ZodMiniOptional>; type: import("zod/mini").ZodMiniString; }, import("zod/v4/core").$strip>; }; readonly request: import("zod/mini").ZodMiniObject<{ amount: import("zod/mini").ZodMiniString; currency: import("zod/mini").ZodMiniString; description: import("zod/mini").ZodMiniOptional>; externalId: import("zod/mini").ZodMiniOptional>; methodDetails: import("zod/mini").ZodMiniObject<{ decimals: import("zod/mini").ZodMiniNumber; feePayer: import("zod/mini").ZodMiniOptional>; feePayerKey: import("zod/mini").ZodMiniOptional>; mint: import("zod/mini").ZodMiniString; network: import("zod/mini").ZodMiniOptional>; planId: import("zod/mini").ZodMiniString; programId: import("zod/mini").ZodMiniOptional>; puller: import("zod/mini").ZodMiniString; recentBlockhash: import("zod/mini").ZodMiniOptional>; splits: import("zod/mini").ZodMiniOptional; recipient: import("zod/mini").ZodMiniString; }, import("zod/v4/core").$strip>>>; tokenProgram: import("zod/mini").ZodMiniString; }, import("zod/v4/core").$strip>; periodCount: import("zod/mini").ZodMiniString; periodUnit: import("zod/mini").ZodMiniEnum<{ day: "day"; week: "week"; }>; recipient: import("zod/mini").ZodMiniString; subscriptionExpires: import("zod/mini").ZodMiniOptional>; }, import("zod/v4/core").$strip>; }; }, undefined>; /** * Build and sign the activation transaction for a Solana subscription challenge. * * The transaction layout matches the spec's required ordering: * * [ComputeBudgetSetUnitPrice, ComputeBudgetSetUnitLimit, * initialize_subscription_authority?, * subscribe, * transfer_subscription, * memo(externalId)?] */ export declare function buildSubscriptionActivationTransaction(parameters: buildSubscriptionActivationTransaction.Parameters): Promise; export declare namespace subscription { type Parameters = { /** * If true, the client broadcasts the activation transaction itself and * sends the signature as a `type="signature"` credential. Cannot be * combined with server fee sponsorship. */ broadcast?: boolean; /** Compute unit limit. Defaults to 400,000 (activation can include three program calls). */ computeUnitLimit?: number; /** Compute unit price in micro-lamports for priority fees. Defaults to 1. */ computeUnitPrice?: bigint; /** Called at each step of the activation process. */ onProgress?: (event: ProgressEvent) => void; /** Custom RPC URL. If not set, inferred from the challenge's network field. */ rpcUrl?: string; /** Solana transaction signer. The subscriber's funding key. */ signer: TransactionSigner; }; type ProgressEvent = { amount: string; mint: string; periodHours: number; planId: string; recipient: string; type: 'challenge'; } | { signature: string; type: 'activated'; } | { signature: string; type: 'confirming'; } | { transaction: string; type: 'signed'; } | { type: 'paying'; } | { type: 'signing'; }; } export declare namespace buildSubscriptionActivationTransaction { type Parameters = { /** Compute unit limit. Defaults to 400,000. */ computeUnitLimit?: number; /** Compute unit price in micro-lamports for priority fees. Defaults to 1. */ computeUnitPrice?: bigint; /** Called at each step of the activation build/signing process. */ onProgress?: (event: { amount: string; mint: string; periodHours: number; planId: string; recipient: string; type: 'challenge'; } | { type: 'signing'; }) => void; /** Decoded request from a Solana MPP subscription challenge. */ request: { amount: string; currency: string; externalId?: string; methodDetails: { decimals: number; feePayer?: boolean; feePayerKey?: string; mint: string; network?: string; planId: string; programId?: string; puller: string; recentBlockhash?: string; splits?: Array<{ bps: number; recipient: string; }>; tokenProgram: string; }; periodCount: string; periodUnit: 'day' | 'week'; recipient: string; subscriptionExpires?: string; }; /** Custom RPC URL. If not set, inferred from the challenge network field. */ rpcUrl?: string; /** Solana transaction signer (the subscriber). */ signer: TransactionSigner; }; } //# sourceMappingURL=Subscription.d.ts.map