import type { VoucherData, VoucherDataInput } from './session-types.js'; /** * Constant 2-byte magic prefix of the signed voucher payload. The on-chain * program rejects vouchers without it (`voucherBadMagic`). */ export declare const VOUCHER_MAGIC: Readonly; /** * Signed voucher as it may arrive on the wire. `cumulative` is the legacy * alias for `cumulativeAmount` — the Rust mirror deserializes both (see * `VoucherData` in `rust/crates/mpp/src/protocol/intents/session.rs`). */ export interface WireSignedVoucher { readonly data: { readonly channelId: string; readonly cumulative?: string | undefined; readonly cumulativeAmount?: string | undefined; readonly expiresAt: number; readonly nonce?: number | undefined; }; readonly signature: string; } /** * Normalize an inbound signed voucher to the canonical shape: maps the * legacy `cumulative` alias onto `cumulativeAmount` and validates that * `expiresAt` survived JSON parsing intact. Outbound serialization always * uses `cumulativeAmount`. */ export declare function normalizeSignedVoucher(signed: WireSignedVoucher): { data: VoucherData; signature: string; }; /** * Canonical 50-byte payment-channel voucher payload signed by the session * key. Accepts the strict `VoucherData` shape used in the protocol types. */ export declare function encodeVoucherMessage(voucher: VoucherData): Uint8Array; /** * Variant of {@link encodeVoucherMessage} that accepts the looser input * shape used by client helpers (allows `cumulative` alias and string/number * amounts). */ export declare function encodeVoucherMessageLoose(data: VoucherDataInput): Uint8Array; /** * Verify an Ed25519 voucher signature against the authorized signer. * Both the signature and signer are base58-encoded (Solana wire format). */ export declare function verifyVoucherSignature(args: { readonly signatureBase58: string; readonly signerBase58: string; readonly voucher: VoucherData; }): Promise; //# sourceMappingURL=voucher.d.ts.map