import { type UniffiByteArray, type UniffiGcObject, type UniffiHandle, FfiConverterObject, FfiConverterObjectAsError, FfiConverterObjectWithCallbacks, RustBuffer, UniffiAbstractObject, UniffiThrownObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from "@ubjs/core"; /** * Fetch the OHTTP keys for a payjoin directory, proxied via an OHTTP relay. * * * `ohttp_relay` — HTTP `CONNECT` proxy used to request the keys. Proxying * ensures the client IP address is never revealed to the directory. * * `payjoin_directory` — directory to fetch the keys from. It stores and * forwards payjoin client payloads. * * Returns keys suitable for passing to a receiver session. */ export declare function fetchOhttpKeys(ohttpRelay: string, payjoinDirectory: string, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Applies the receiver's finalized inputs onto a cleared proposal PSBT. * * Exposed because every receiver finalize callback needs it, including the * BIP77 (v2) `finalize_proposal` path, where the callback runs in the host * language. PDK hands that callback a PSBT with the sender's finals stripped, so * returning the wallet-signed PSBT wholesale would reintroduce the sender's * finals and yield an invalid proposal. Copying per-input is the correct merge. * * * `cleared_psbt_base64` — the PSBT handed to the finalize callback. * * `signed_psbt_base64` — the same PSBT after the receiver's wallet signed it. */ export declare function mergeFinalizedProposalInputs(clearedPsbtBase64: string, signedPsbtBase64: string): string; /** * Offline receiver step 1: ingest the sender's Original PSBT, run the receiver * checks, contribute one input, and return the provisional PSBT to sign. * * * `owned_scripts_hex` — the receiver's own scriptPubKeys, used to identify * which outputs belong to the receiver alongside `receive_address`. * * `owned_outpoints` — the receiver's wallet outpoints, formatted `txid:vout`. * Rejecting an Original PSBT that spends these stops a sender from getting the * receiver to spend its own coins. * * `seen_outpoints` — outpoints from previous payjoin sessions, formatted * `txid:vout`. Rejecting these blocks probing attacks that replay inputs to * discover the receiver's UTXO set. * * The broadcast-suitability check is skipped: an interactive receiver imports * the Original PSBT deliberately, so the anti-probing guard that check provides * is unnecessary and it would require a mempool connection this path lacks. */ export declare function receiverManualContribute(originalPsbtBase64: string, receiveAddress: string, disableOutputSubstitution: boolean, input: ManualReceiverInput, ownedScriptsHex: Array, ownedOutpoints: Array, seenOutpoints: Array): ManualContributeResult; /** * Offline receiver step 2: finalize the proposal from the state returned by * [`receiver_manual_contribute`] and the receiver-signed provisional PSBT. * * Returns the proposal PSBT to hand back to the sender out of band. */ export declare function receiverManualFinalize(provisionalState: string, signedPsbtBase64: string): ManualFinalizeResult; export declare function replayReceiverEventLog(persister: JsonReceiverSessionPersister): ReplayResultLike; export declare function replayReceiverEventLogAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; export declare function replaySenderEventLog(persister: JsonSenderSessionPersister): SenderReplayResultLike; export declare function replaySenderEventLogAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Result of [`receiver_manual_contribute`]. */ export type ManualContributeResult = { /** * PSBT for the receiver's wallet to sign. */ provisionalPsbtBase64: string; /** * Opaque resumable state to pass to [`receiver_manual_finalize`]. */ provisionalState: string; }; /** * Generated factory for {@link ManualContributeResult} record objects. */ export declare const ManualContributeResult: Readonly<{ create: (partial: Partial & Required>) => ManualContributeResult; new: (partial: Partial & Required>) => ManualContributeResult; defaults: () => Partial; }>; /** * Result of [`receiver_manual_finalize`]. */ export type ManualFinalizeResult = { /** * Proposal PSBT to hand back to the sender out of band. */ proposalPsbtBase64: string; }; /** * Generated factory for {@link ManualFinalizeResult} record objects. */ export declare const ManualFinalizeResult: Readonly<{ create: (partial: Partial & Required>) => ManualFinalizeResult; new: (partial: Partial & Required>) => ManualFinalizeResult; defaults: () => Partial; }>; /** * A wallet UTXO offered as the receiver's contribution. */ export type ManualReceiverInput = { /** * Hex-encoded txid (big-endian), as displayed by explorers. */ txid: string; /** * Output index. */ vout: number; /** * Amount in satoshis. */ value: bigint; /** * Hex-encoded scriptPubKey. */ scriptHex: string; }; /** * Generated factory for {@link ManualReceiverInput} record objects. */ export declare const ManualReceiverInput: Readonly<{ create: (partial: Partial & Required>) => ManualReceiverInput; new: (partial: Partial & Required>) => ManualReceiverInput; defaults: () => Partial; }>; /** * Primitive representation of an outpoint for the FFI boundary. */ export type OutPoint = { /** * Hex-encoded txid (big-endian). */ txid: string; /** * Output index. */ vout: number; }; /** * Generated factory for {@link OutPoint} record objects. */ export declare const OutPoint: Readonly<{ create: (partial: Partial & Required>) => OutPoint; new: (partial: Partial & Required>) => OutPoint; defaults: () => Partial; }>; /** * Primitive representation of a transaction output for the FFI boundary. */ export type TxOut = { /** * Amount in satoshis. */ valueSat: bigint; /** * Raw scriptPubKey bytes. */ scriptPubkey: ArrayBuffer; }; /** * Generated factory for {@link TxOut} record objects. */ export declare const TxOut: Readonly<{ create: (partial: Partial & Required>) => TxOut; new: (partial: Partial & Required>) => TxOut; defaults: () => Partial; }>; /** * Primitive representation of a PSBT input for the FFI boundary. */ export type PsbtInput = { witnessUtxo?: TxOut; redeemScript?: ArrayBuffer; witnessScript?: ArrayBuffer; }; /** * Generated factory for {@link PsbtInput} record objects. */ export declare const PsbtInput: Readonly<{ create: (partial: Partial & Required>) => PsbtInput; new: (partial: Partial & Required>) => PsbtInput; defaults: () => Partial; }>; /** * Represents data that needs to be transmitted to the receiver. * You need to send this request over HTTP(S) to the receiver. */ export type Request = { /** * URL to send the request to. * * This is full URL with scheme etc - you can pass it right to `reqwest` or a similar library. */ url: string; /** * The `Content-Type` header to use for the request. * * `text/plain` for v1 requests and `message/ohttp-req` for v2 requests. */ contentType: string; /** * Bytes to be sent to the receiver. * * This is properly encoded PSBT payload either in base64 in v1 or an OHTTP encapsulated payload in v2. */ body: ArrayBuffer; }; /** * Generated factory for {@link Request} record objects. */ export declare const Request: Readonly<{ create: (partial: Partial & Required>) => Request; new: (partial: Partial & Required>) => Request; defaults: () => Partial; }>; export interface ClientResponseLike { } /** * @deprecated Use `ClientResponseLike` instead. */ export type ClientResponseInterface = ClientResponseLike; export declare class ClientResponse extends UniffiAbstractObject implements ClientResponseLike { readonly [uniffiTypeNameSymbol] = "ClientResponse"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ClientResponse; } export type RequestOhttpContext = { request: Request; ohttpCtx: ClientResponseLike; }; /** * Generated factory for {@link RequestOhttpContext} record objects. */ export declare const RequestOhttpContext: Readonly<{ create: (partial: Partial & Required>) => RequestOhttpContext; new: (partial: Partial & Required>) => RequestOhttpContext; defaults: () => Partial; }>; export type RequestResponse = { request: Request; clientResponse: ClientResponseLike; }; /** * Generated factory for {@link RequestResponse} record objects. */ export declare const RequestResponse: Readonly<{ create: (partial: Partial & Required>) => RequestResponse; new: (partial: Partial & Required>) => RequestResponse; defaults: () => Partial; }>; /** * BIP-78 well-known error code, surfaced to bindings so senders can branch * on the code instead of parsing the Display string. */ export declare enum ErrorCode { /** * The payjoin endpoint is not available for now. */ Unavailable = 0, /** * The receiver added some inputs but could not bump the fee. */ NotEnoughMoney = 1, /** * This version of payjoin is not supported. */ VersionUnsupported = 2, /** * The receiver rejected the original PSBT. */ OriginalPsbtRejected = 3, /** * A well-known code newer than this binding understands. */ Unrecognized = 4 } /** * A well-known error that can be safely displayed to end users. */ export interface WellKnownErrorLike { /** * Return the BIP-78 well-known error code, letting senders branch on it * instead of parsing the Display string. */ code(): ErrorCode; } /** * @deprecated Use `WellKnownErrorLike` instead. */ export type WellKnownErrorInterface = WellKnownErrorLike; /** * A well-known error that can be safely displayed to end users. */ export declare class WellKnownError extends UniffiAbstractObject implements WellKnownErrorLike { readonly [uniffiTypeNameSymbol] = "WellKnownError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Return the BIP-78 well-known error code, letting senders branch on it * instead of parsing the Display string. */ code(): ErrorCode; toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WellKnownError; } /** * Error that may occur when the response from receiver is malformed. */ export interface ValidationErrorLike { } /** * @deprecated Use `ValidationErrorLike` instead. */ export type ValidationErrorInterface = ValidationErrorLike; /** * Error that may occur when the response from receiver is malformed. */ export declare class ValidationError extends UniffiAbstractObject implements ValidationErrorLike { readonly [uniffiTypeNameSymbol] = "ValidationError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ValidationError; } export declare enum ResponseError_Tags { WellKnown = "WellKnown", Validation = "Validation", Unrecognized = "Unrecognized" } /** * Represent an error returned by Payjoin receiver. */ export declare const ResponseError: Readonly<{ instanceOf: (obj: any) => obj is ResponseError; WellKnown: { new (v0: WellKnownErrorLike): { readonly tag: ResponseError_Tags.WellKnown; readonly inner: Readonly<[WellKnownErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: WellKnownErrorLike): { readonly tag: ResponseError_Tags.WellKnown; readonly inner: Readonly<[WellKnownErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ResponseError_Tags.WellKnown; readonly inner: Readonly<[WellKnownErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ResponseError_Tags.WellKnown; readonly inner: Readonly<[WellKnownErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ResponseError_Tags.WellKnown; readonly inner: Readonly<[WellKnownErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[WellKnownErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Validation: { new (v0: ValidationErrorLike): { readonly tag: ResponseError_Tags.Validation; readonly inner: Readonly<[ValidationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ValidationErrorLike): { readonly tag: ResponseError_Tags.Validation; readonly inner: Readonly<[ValidationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ResponseError_Tags.Validation; readonly inner: Readonly<[ValidationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ResponseError_Tags.Validation; readonly inner: Readonly<[ValidationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ResponseError_Tags.Validation; readonly inner: Readonly<[ValidationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ValidationErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Unrecognized: { new (inner: { errorCode: string; msg: string; }): { readonly tag: ResponseError_Tags.Unrecognized; readonly inner: Readonly<{ errorCode: string; msg: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { errorCode: string; msg: string; }): { readonly tag: ResponseError_Tags.Unrecognized; readonly inner: Readonly<{ errorCode: string; msg: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ResponseError_Tags.Unrecognized; readonly inner: Readonly<{ errorCode: string; msg: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ResponseError_Tags.Unrecognized; readonly inner: Readonly<{ errorCode: string; msg: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ResponseError_Tags.Unrecognized; readonly inner: Readonly<{ errorCode: string; msg: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ResponseError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ errorCode: string; msg: string; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Represent an error returned by Payjoin receiver. */ export type ResponseError = InstanceType<(typeof ResponseError)["WellKnown" | "Validation" | "Unrecognized"]>; /** * Data required for validation of response. * This type is used to process the response. Get it from SenderBuilder's build methods. Then you only need to call .process_response() on it to continue BIP78 flow. */ export interface V1ContextLike { /** * Decodes and validates the response. * Call this method with response from receiver to continue BIP78 flow. If the response is valid you will get appropriate PSBT that you should sign and broadcast. */ processResponse(response: ArrayBuffer): string; } /** * @deprecated Use `V1ContextLike` instead. */ export type V1ContextInterface = V1ContextLike; /** * Data required for validation of response. * This type is used to process the response. Get it from SenderBuilder's build methods. Then you only need to call .process_response() on it to continue BIP78 flow. */ export declare class V1Context extends UniffiAbstractObject implements V1ContextLike { readonly [uniffiTypeNameSymbol] = "V1Context"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Decodes and validates the response. * Call this method with response from receiver to continue BIP78 flow. If the response is valid you will get appropriate PSBT that you should sign and broadcast. */ processResponse(response: ArrayBuffer): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is V1Context; } export type RequestV1Context = { request: Request; context: V1ContextLike; }; /** * Generated factory for {@link RequestV1Context} record objects. */ export declare const RequestV1Context: Readonly<{ create: (partial: Partial & Required>) => RequestV1Context; new: (partial: Partial & Required>) => RequestV1Context; defaults: () => Partial; }>; /** * Primitive representation of a transaction input for the FFI boundary. */ export type TxIn = { previousOutput: OutPoint; scriptSig: ArrayBuffer; sequence: number; witness: Array; }; /** * Generated factory for {@link TxIn} record objects. */ export declare const TxIn: Readonly<{ create: (partial: Partial & Required>) => TxIn; new: (partial: Partial & Required>) => TxIn; defaults: () => Partial; }>; /** * Primitive representation of a weight measurement. */ export type Weight = { weightUnits: bigint; }; /** * Generated factory for {@link Weight} record objects. */ export declare const Weight: Readonly<{ create: (partial: Partial & Required>) => Weight; new: (partial: Partial & Required>) => Weight; defaults: () => Partial; }>; export declare enum FfiValidationError_Tags { AmountOutOfRange = "AmountOutOfRange", ScriptEmpty = "ScriptEmpty", ScriptTooLarge = "ScriptTooLarge", WitnessItemsTooMany = "WitnessItemsTooMany", WitnessItemTooLarge = "WitnessItemTooLarge", WitnessTooLarge = "WitnessTooLarge", WeightOutOfRange = "WeightOutOfRange", FeeRateOutOfRange = "FeeRateOutOfRange", ExpirationOutOfRange = "ExpirationOutOfRange" } export declare const FfiValidationError: Readonly<{ instanceOf: (obj: any) => obj is FfiValidationError; AmountOutOfRange: { new (inner: { amountSat: bigint; maxSat: bigint; }): { readonly tag: FfiValidationError_Tags.AmountOutOfRange; readonly inner: Readonly<{ amountSat: bigint; maxSat: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { amountSat: bigint; maxSat: bigint; }): { readonly tag: FfiValidationError_Tags.AmountOutOfRange; readonly inner: Readonly<{ amountSat: bigint; maxSat: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.AmountOutOfRange; readonly inner: Readonly<{ amountSat: bigint; maxSat: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.AmountOutOfRange; readonly inner: Readonly<{ amountSat: bigint; maxSat: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.AmountOutOfRange; readonly inner: Readonly<{ amountSat: bigint; maxSat: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ amountSat: bigint; maxSat: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; ScriptEmpty: { new (inner: { field: string; }): { readonly tag: FfiValidationError_Tags.ScriptEmpty; readonly inner: Readonly<{ field: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { field: string; }): { readonly tag: FfiValidationError_Tags.ScriptEmpty; readonly inner: Readonly<{ field: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.ScriptEmpty; readonly inner: Readonly<{ field: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.ScriptEmpty; readonly inner: Readonly<{ field: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.ScriptEmpty; readonly inner: Readonly<{ field: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ field: string; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; ScriptTooLarge: { new (inner: { field: string; len: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.ScriptTooLarge; readonly inner: Readonly<{ field: string; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { field: string; len: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.ScriptTooLarge; readonly inner: Readonly<{ field: string; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.ScriptTooLarge; readonly inner: Readonly<{ field: string; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.ScriptTooLarge; readonly inner: Readonly<{ field: string; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.ScriptTooLarge; readonly inner: Readonly<{ field: string; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ field: string; len: bigint; max: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; WitnessItemsTooMany: { new (inner: { count: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.WitnessItemsTooMany; readonly inner: Readonly<{ count: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { count: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.WitnessItemsTooMany; readonly inner: Readonly<{ count: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.WitnessItemsTooMany; readonly inner: Readonly<{ count: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.WitnessItemsTooMany; readonly inner: Readonly<{ count: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.WitnessItemsTooMany; readonly inner: Readonly<{ count: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ count: bigint; max: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; WitnessItemTooLarge: { new (inner: { index: bigint; len: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.WitnessItemTooLarge; readonly inner: Readonly<{ index: bigint; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { index: bigint; len: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.WitnessItemTooLarge; readonly inner: Readonly<{ index: bigint; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.WitnessItemTooLarge; readonly inner: Readonly<{ index: bigint; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.WitnessItemTooLarge; readonly inner: Readonly<{ index: bigint; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.WitnessItemTooLarge; readonly inner: Readonly<{ index: bigint; len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ index: bigint; len: bigint; max: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; WitnessTooLarge: { new (inner: { len: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.WitnessTooLarge; readonly inner: Readonly<{ len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { len: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.WitnessTooLarge; readonly inner: Readonly<{ len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.WitnessTooLarge; readonly inner: Readonly<{ len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.WitnessTooLarge; readonly inner: Readonly<{ len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.WitnessTooLarge; readonly inner: Readonly<{ len: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ len: bigint; max: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; WeightOutOfRange: { new (inner: { weightUnits: bigint; maxWu: bigint; }): { readonly tag: FfiValidationError_Tags.WeightOutOfRange; readonly inner: Readonly<{ weightUnits: bigint; maxWu: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { weightUnits: bigint; maxWu: bigint; }): { readonly tag: FfiValidationError_Tags.WeightOutOfRange; readonly inner: Readonly<{ weightUnits: bigint; maxWu: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.WeightOutOfRange; readonly inner: Readonly<{ weightUnits: bigint; maxWu: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.WeightOutOfRange; readonly inner: Readonly<{ weightUnits: bigint; maxWu: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.WeightOutOfRange; readonly inner: Readonly<{ weightUnits: bigint; maxWu: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ weightUnits: bigint; maxWu: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; FeeRateOutOfRange: { new (inner: { value: bigint; unit: string; }): { readonly tag: FfiValidationError_Tags.FeeRateOutOfRange; readonly inner: Readonly<{ value: bigint; unit: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { value: bigint; unit: string; }): { readonly tag: FfiValidationError_Tags.FeeRateOutOfRange; readonly inner: Readonly<{ value: bigint; unit: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.FeeRateOutOfRange; readonly inner: Readonly<{ value: bigint; unit: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.FeeRateOutOfRange; readonly inner: Readonly<{ value: bigint; unit: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.FeeRateOutOfRange; readonly inner: Readonly<{ value: bigint; unit: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ value: bigint; unit: string; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; ExpirationOutOfRange: { new (inner: { seconds: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.ExpirationOutOfRange; readonly inner: Readonly<{ seconds: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { seconds: bigint; max: bigint; }): { readonly tag: FfiValidationError_Tags.ExpirationOutOfRange; readonly inner: Readonly<{ seconds: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: FfiValidationError_Tags.ExpirationOutOfRange; readonly inner: Readonly<{ seconds: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: FfiValidationError_Tags.ExpirationOutOfRange; readonly inner: Readonly<{ seconds: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: FfiValidationError_Tags.ExpirationOutOfRange; readonly inner: Readonly<{ seconds: bigint; max: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "FfiValidationError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ seconds: bigint; max: bigint; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; export type FfiValidationError = InstanceType<(typeof FfiValidationError)["AmountOutOfRange" | "ScriptEmpty" | "ScriptTooLarge" | "WitnessItemsTooMany" | "WitnessItemTooLarge" | "WitnessTooLarge" | "WeightOutOfRange" | "FeeRateOutOfRange" | "ExpirationOutOfRange"]>; export declare enum ForeignError_Tags { InternalError = "InternalError" } export declare const ForeignError: Readonly<{ instanceOf: (obj: any) => obj is ForeignError; InternalError: { new (v0: string): { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: string): { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[string]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; export type ForeignError = InstanceType<(typeof ForeignError)["InternalError"]>; /** * Session persister that should save and load events as JSON strings. */ export interface JsonReceiverSessionPersister { save(event: string): void; load(): Array; close(): void; } /** * Session persister that should save and load events as JSON strings. */ export declare class JsonReceiverSessionPersisterImpl extends UniffiAbstractObject implements JsonReceiverSessionPersister { readonly [uniffiTypeNameSymbol] = "JsonReceiverSessionPersisterImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(event: string): void; load(): Array; close(): void; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is JsonReceiverSessionPersisterImpl; } /** * The replyable error type for the payjoin receiver, representing failures need to be * returned to the sender. * * The error handling is designed to: * 1. Provide structured error responses for protocol-level failures * 2. Hide implementation details of external errors for security * 3. Support proper error propagation through the receiver stack * 4. Provide errors according to BIP-78 JSON error specifications for return * after conversion into [`JsonReply`] */ export interface ProtocolErrorLike { } /** * @deprecated Use `ProtocolErrorLike` instead. */ export type ProtocolErrorInterface = ProtocolErrorLike; /** * The replyable error type for the payjoin receiver, representing failures need to be * returned to the sender. * * The error handling is designed to: * 1. Provide structured error responses for protocol-level failures * 2. Hide implementation details of external errors for security * 3. Support proper error propagation through the receiver stack * 4. Provide errors according to BIP-78 JSON error specifications for return * after conversion into [`JsonReply`] */ export declare class ProtocolError extends UniffiAbstractObject implements ProtocolErrorLike { readonly [uniffiTypeNameSymbol] = "ProtocolError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ProtocolError; } /** * Error arising due to the specific application implementation * * e.g. database errors, network failures, wallet errors */ export interface ImplementationErrorLike { } /** * @deprecated Use `ImplementationErrorLike` instead. */ export type ImplementationErrorInterface = ImplementationErrorLike; /** * Error arising due to the specific application implementation * * e.g. database errors, network failures, wallet errors */ export declare class ImplementationError extends UniffiAbstractObject implements ImplementationErrorLike { readonly [uniffiTypeNameSymbol] = "ImplementationError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ImplementationError; } export interface IntoUrlErrorLike { } /** * @deprecated Use `IntoUrlErrorLike` instead. */ export type IntoUrlErrorInterface = IntoUrlErrorLike; export declare class IntoUrlError extends UniffiAbstractObject implements IntoUrlErrorLike { readonly [uniffiTypeNameSymbol] = "IntoUrlError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is IntoUrlError; } export declare enum ReceiverError_Tags { Protocol = "Protocol", Implementation = "Implementation", IntoUrl = "IntoUrl", Unexpected = "Unexpected" } /** * The top-level error type for the payjoin receiver */ export declare const ReceiverError: Readonly<{ instanceOf: (obj: any) => obj is ReceiverError; Protocol: { new (v0: ProtocolErrorLike): { readonly tag: ReceiverError_Tags.Protocol; readonly inner: Readonly<[ProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ProtocolErrorLike): { readonly tag: ReceiverError_Tags.Protocol; readonly inner: Readonly<[ProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverError_Tags.Protocol; readonly inner: Readonly<[ProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverError_Tags.Protocol; readonly inner: Readonly<[ProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverError_Tags.Protocol; readonly inner: Readonly<[ProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ProtocolErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Implementation: { new (v0: ImplementationErrorLike): { readonly tag: ReceiverError_Tags.Implementation; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ImplementationErrorLike): { readonly tag: ReceiverError_Tags.Implementation; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverError_Tags.Implementation; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverError_Tags.Implementation; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverError_Tags.Implementation; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ImplementationErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; IntoUrl: { new (v0: IntoUrlErrorLike): { readonly tag: ReceiverError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: IntoUrlErrorLike): { readonly tag: ReceiverError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[IntoUrlErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Unexpected: { new (): { readonly tag: ReceiverError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(): { readonly tag: ReceiverError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverError"; name: string; message: string; stack?: string; cause?: unknown; }; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * The top-level error type for the payjoin receiver */ export type ReceiverError = InstanceType<(typeof ReceiverError)["Protocol" | "Implementation" | "IntoUrl" | "Unexpected"]>; export declare enum ReceiverPersistedError_Tags { Transient = "Transient", Fatal = "Fatal", Storage = "Storage" } /** * Error that may occur during state machine transitions */ export declare const ReceiverPersistedError: Readonly<{ instanceOf: (obj: any) => obj is ReceiverPersistedError; Transient: { new (v0: ReceiverError): { readonly tag: ReceiverPersistedError_Tags.Transient; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ReceiverError): { readonly tag: ReceiverPersistedError_Tags.Transient; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverPersistedError_Tags.Transient; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverPersistedError_Tags.Transient; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverPersistedError_Tags.Transient; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ReceiverError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Fatal: { new (v0: ReceiverError): { readonly tag: ReceiverPersistedError_Tags.Fatal; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ReceiverError): { readonly tag: ReceiverPersistedError_Tags.Fatal; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverPersistedError_Tags.Fatal; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverPersistedError_Tags.Fatal; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverPersistedError_Tags.Fatal; readonly inner: Readonly<[ReceiverError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ReceiverError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Storage: { new (v0: ImplementationErrorLike): { readonly tag: ReceiverPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ImplementationErrorLike): { readonly tag: ReceiverPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ImplementationErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error that may occur during state machine transitions */ export type ReceiverPersistedError = InstanceType<(typeof ReceiverPersistedError)["Transient" | "Fatal" | "Storage"]>; /** * Async session persister that should save and load events as JSON strings. */ export interface JsonReceiverSessionPersisterAsync { save(event: string, asyncOpts_?: { signal: AbortSignal; }): Promise; load(asyncOpts_?: { signal: AbortSignal; }): Promise>; close(asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * Async session persister that should save and load events as JSON strings. */ export declare class JsonReceiverSessionPersisterAsyncImpl extends UniffiAbstractObject implements JsonReceiverSessionPersisterAsync { readonly [uniffiTypeNameSymbol] = "JsonReceiverSessionPersisterAsyncImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(event: string, asyncOpts_?: { signal: AbortSignal; }): Promise; load(asyncOpts_?: { signal: AbortSignal; }): Promise>; close(asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is JsonReceiverSessionPersisterAsyncImpl; } export interface PendingFallbackTransitionLike { save(persister: JsonReceiverSessionPersister): void; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `PendingFallbackTransitionLike` instead. */ export type PendingFallbackTransitionInterface = PendingFallbackTransitionLike; export declare class PendingFallbackTransition extends UniffiAbstractObject implements PendingFallbackTransitionLike { readonly [uniffiTypeNameSymbol] = "PendingFallbackTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): void; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PendingFallbackTransition; } export interface ReceiverPendingFallbackLike { close(): PendingFallbackTransitionLike; fallbackTx(): ArrayBuffer; } /** * @deprecated Use `ReceiverPendingFallbackLike` instead. */ export type ReceiverPendingFallbackInterface = ReceiverPendingFallbackLike; export declare class ReceiverPendingFallback extends UniffiAbstractObject implements ReceiverPendingFallbackLike { readonly [uniffiTypeNameSymbol] = "ReceiverPendingFallback"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); close(): PendingFallbackTransitionLike; fallbackTx(): ArrayBuffer; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverPendingFallback; } /** * A transition produced by cancelling a receiver session. */ export interface CancelTransitionLike { /** * Persist the cancellation and return pending fallback handling if needed. */ save(persister: JsonReceiverSessionPersister): /*throws*/ ReceiverPendingFallbackLike | undefined; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `CancelTransitionLike` instead. */ export type CancelTransitionInterface = CancelTransitionLike; /** * A transition produced by cancelling a receiver session. */ export declare class CancelTransition extends UniffiAbstractObject implements CancelTransitionLike { readonly [uniffiTypeNameSymbol] = "CancelTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Persist the cancellation and return pending fallback handling if needed. */ save(persister: JsonReceiverSessionPersister): ReceiverPendingFallbackLike | undefined; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is CancelTransition; } /** * Answers whether the receiver's wallet can sign the coin at a given outpoint. * Implement this against the wallet's own authoritative state, covering every * outpoint the wallet can sign, including locked and unconfirmed coins. */ export interface IsInputOwned { callback(outpoint: OutPoint): boolean; } /** * Answers whether the receiver's wallet can sign the coin at a given outpoint. * Implement this against the wallet's own authoritative state, covering every * outpoint the wallet can sign, including locked and unconfirmed coins. */ export declare class IsInputOwnedImpl extends UniffiAbstractObject implements IsInputOwned { readonly [uniffiTypeNameSymbol] = "IsInputOwnedImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); callback(outpoint: OutPoint): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is IsInputOwnedImpl; } export interface IsOutputKnown { callback(outpoint: OutPoint): boolean; } export declare class IsOutputKnownImpl extends UniffiAbstractObject implements IsOutputKnown { readonly [uniffiTypeNameSymbol] = "IsOutputKnownImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); callback(outpoint: OutPoint): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is IsOutputKnownImpl; } export interface IsScriptOwned { callback(script: ArrayBuffer): boolean; } export declare class IsScriptOwnedImpl extends UniffiAbstractObject implements IsScriptOwned { readonly [uniffiTypeNameSymbol] = "IsScriptOwnedImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); callback(script: ArrayBuffer): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is IsScriptOwnedImpl; } export interface ProcessPsbt { callback(psbt: string): string; } export declare class ProcessPsbtImpl extends UniffiAbstractObject implements ProcessPsbt { readonly [uniffiTypeNameSymbol] = "ProcessPsbtImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); callback(psbt: string): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ProcessPsbtImpl; } /** * Error returned when a receiver request could not be created. * * Returned by `create_poll_request` and `create_post_request`. uniffi attaches * methods to Object types, so the expiry predicate is a method here rather than * a free function over the top-level `ReceiverError`. */ export interface ReceiverCreateRequestErrorLike { /** * Returns `true` if the request could not be created because the session * has expired. */ isExpired(): boolean; } /** * @deprecated Use `ReceiverCreateRequestErrorLike` instead. */ export type ReceiverCreateRequestErrorInterface = ReceiverCreateRequestErrorLike; /** * Error returned when a receiver request could not be created. * * Returned by `create_poll_request` and `create_post_request`. uniffi attaches * methods to Object types, so the expiry predicate is a method here rather than * a free function over the top-level `ReceiverError`. */ export declare class ReceiverCreateRequestError extends UniffiAbstractObject implements ReceiverCreateRequestErrorLike { readonly [uniffiTypeNameSymbol] = "ReceiverCreateRequestError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Returns `true` if the request could not be created because the session * has expired. */ isExpired(): boolean; toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverCreateRequestError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): ReceiverCreateRequestError; } export interface TransactionFinder { callback(txid: string): /*throws*/ ArrayBuffer | undefined; } export declare class TransactionFinderImpl extends UniffiAbstractObject implements TransactionFinder { readonly [uniffiTypeNameSymbol] = "TransactionFinderImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); callback(txid: string): ArrayBuffer | undefined; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is TransactionFinderImpl; } export interface MonitorTransitionLike { save(persister: JsonReceiverSessionPersister): void; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `MonitorTransitionLike` instead. */ export type MonitorTransitionInterface = MonitorTransitionLike; export declare class MonitorTransition extends UniffiAbstractObject implements MonitorTransitionLike { readonly [uniffiTypeNameSymbol] = "MonitorTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): void; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is MonitorTransition; } export interface MonitorLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Check the network for the payjoin or fallback transaction via the * `find_transaction` callback. * * Returns a [`MonitorTransition`] that, once persisted, completes * the session if a transaction is found. */ checkForTransaction(findTransaction: TransactionFinder): MonitorTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; } /** * @deprecated Use `MonitorLike` instead. */ export type MonitorInterface = MonitorLike; export declare class Monitor extends UniffiAbstractObject implements MonitorLike { readonly [uniffiTypeNameSymbol] = "Monitor"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Check the network for the payjoin or fallback transaction via the * `find_transaction` callback. * * Returns a [`MonitorTransition`] that, once persisted, completes * the session if a transaction is found. */ checkForTransaction(findTransaction: TransactionFinder): MonitorTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Monitor; } export interface PayjoinProposalTransitionLike { save(persister: JsonReceiverSessionPersister): MonitorLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `PayjoinProposalTransitionLike` instead. */ export type PayjoinProposalTransitionInterface = PayjoinProposalTransitionLike; export declare class PayjoinProposalTransition extends UniffiAbstractObject implements PayjoinProposalTransitionLike { readonly [uniffiTypeNameSymbol] = "PayjoinProposalTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): MonitorLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PayjoinProposalTransition; } export interface PayjoinProposalLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Construct an OHTTP-encapsulated HTTP request carrying the Proposal PSBT. * * The inner HTTP method, body encoding, and target mailbox depend on * whether the original sender used Payjoin v2 (BIP 77) or Payjoin v1 * (BIP 78), as recorded in the session context: * * - v2 sender (reply key present): POST an HPKE-encrypted `PjV2MsgB` * payload to the sender's reply mailbox. * - v1 sender (no reply key): PUT the base64-encoded PSBT as cleartext * UTF-8 bytes to the receiver's own mailbox, per the * [BIP 77](https://github.com/bitcoin/bips/blob/master/bip-0077.md) * Backwards compatibility section. * * Both paths are then OHTTP-encapsulated to the directory's OHTTP Gateway. */ createPostRequest(ohttpRelay: string): RequestResponse; /** * Processes the response for the final POST message from the receiver client in the v2 Payjoin protocol. * * This function decapsulates the response using the provided OHTTP context. If the response status is successful, it indicates that the Payjoin proposal has been accepted. Otherwise, it returns an error with the status code. * * After this function is called, the receiver can either wait for the Payjoin transaction to be broadcast or choose to broadcast the original PSBT. */ processResponse(body: ArrayBuffer, ohttpContext: ClientResponseLike): PayjoinProposalTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Returns the finalized payjoin proposal PSBT. */ psbt(): string; } /** * @deprecated Use `PayjoinProposalLike` instead. */ export type PayjoinProposalInterface = PayjoinProposalLike; export declare class PayjoinProposal extends UniffiAbstractObject implements PayjoinProposalLike { readonly [uniffiTypeNameSymbol] = "PayjoinProposal"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Construct an OHTTP-encapsulated HTTP request carrying the Proposal PSBT. * * The inner HTTP method, body encoding, and target mailbox depend on * whether the original sender used Payjoin v2 (BIP 77) or Payjoin v1 * (BIP 78), as recorded in the session context: * * - v2 sender (reply key present): POST an HPKE-encrypted `PjV2MsgB` * payload to the sender's reply mailbox. * - v1 sender (no reply key): PUT the base64-encoded PSBT as cleartext * UTF-8 bytes to the receiver's own mailbox, per the * [BIP 77](https://github.com/bitcoin/bips/blob/master/bip-0077.md) * Backwards compatibility section. * * Both paths are then OHTTP-encapsulated to the directory's OHTTP Gateway. */ createPostRequest(ohttpRelay: string): RequestResponse; /** * Processes the response for the final POST message from the receiver client in the v2 Payjoin protocol. * * This function decapsulates the response using the provided OHTTP context. If the response status is successful, it indicates that the Payjoin proposal has been accepted. Otherwise, it returns an error with the status code. * * After this function is called, the receiver can either wait for the Payjoin transaction to be broadcast or choose to broadcast the original PSBT. */ processResponse(body: ArrayBuffer, ohttpContext: ClientResponseLike): PayjoinProposalTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Returns the finalized payjoin proposal PSBT. */ psbt(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PayjoinProposal; } export interface ProvisionalProposalTransitionLike { save(persister: JsonReceiverSessionPersister): PayjoinProposalLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `ProvisionalProposalTransitionLike` instead. */ export type ProvisionalProposalTransitionInterface = ProvisionalProposalTransitionLike; export declare class ProvisionalProposalTransition extends UniffiAbstractObject implements ProvisionalProposalTransitionLike { readonly [uniffiTypeNameSymbol] = "ProvisionalProposalTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): PayjoinProposalLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ProvisionalProposalTransition; } export interface ProvisionalProposalLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Finalize the proposal by signing the PSBT via the `process_psbt` callback. * * Returns a [`ProvisionalProposalTransition`] that, once persisted, * yields the final [`PayjoinProposal`]. */ finalizeProposal(processPsbt: ProcessPsbt): ProvisionalProposalTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Extract the PSBT that needs to be signed by the receiver's wallet. */ psbtToSign(): string; } /** * @deprecated Use `ProvisionalProposalLike` instead. */ export type ProvisionalProposalInterface = ProvisionalProposalLike; export declare class ProvisionalProposal extends UniffiAbstractObject implements ProvisionalProposalLike { readonly [uniffiTypeNameSymbol] = "ProvisionalProposal"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Finalize the proposal by signing the PSBT via the `process_psbt` callback. * * Returns a [`ProvisionalProposalTransition`] that, once persisted, * yields the final [`PayjoinProposal`]. */ finalizeProposal(processPsbt: ProcessPsbt): ProvisionalProposalTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Extract the PSBT that needs to be signed by the receiver's wallet. */ psbtToSign(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ProvisionalProposal; } export interface WantsFeeRangeTransitionLike { save(persister: JsonReceiverSessionPersister): ProvisionalProposalLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `WantsFeeRangeTransitionLike` instead. */ export type WantsFeeRangeTransitionInterface = WantsFeeRangeTransitionLike; export declare class WantsFeeRangeTransition extends UniffiAbstractObject implements WantsFeeRangeTransitionLike { readonly [uniffiTypeNameSymbol] = "WantsFeeRangeTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): ProvisionalProposalLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WantsFeeRangeTransition; } export interface WantsFeeRangeLike { /** * Applies additional fee contribution now that the receiver has contributed inputs * and may have added new outputs. * * How much the receiver ends up paying for fees depends on how much the sender stated they * were willing to pay in the parameters of the original proposal. For additional * inputs, fees will be subtracted from the sender's outputs as much as possible until we hit * the limit the sender specified in the Payjoin parameters. Any remaining fees for the new inputs * will be then subtracted from the change output of the receiver. * Fees for additional outputs are always subtracted from the receiver's outputs. * * `max_effective_fee_rate` is the maximum effective fee rate that the receiver is * willing to pay for their own input/output contributions. A `max_effective_fee_rate` * of zero indicates that the receiver is not willing to pay any additional * fees. Errors if the final effective fee rate exceeds `max_effective_fee_rate`. * * If not provided, `min_fee_rate_sat_per_vb` and `max_effective_fee_rate_sat_per_vb` default to the * minimum possible relay fee. * * The minimum effective fee limit is the highest of the minimum limit set by the sender in * the original proposal parameters and the limit passed in the `min_fee_rate_sat_per_vb` parameter. */ applyFeeRange(minFeeRateSatPerVb: bigint | undefined, maxEffectiveFeeRateSatPerVb: bigint | undefined): WantsFeeRangeTransitionLike; /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; } /** * @deprecated Use `WantsFeeRangeLike` instead. */ export type WantsFeeRangeInterface = WantsFeeRangeLike; export declare class WantsFeeRange extends UniffiAbstractObject implements WantsFeeRangeLike { readonly [uniffiTypeNameSymbol] = "WantsFeeRange"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Applies additional fee contribution now that the receiver has contributed inputs * and may have added new outputs. * * How much the receiver ends up paying for fees depends on how much the sender stated they * were willing to pay in the parameters of the original proposal. For additional * inputs, fees will be subtracted from the sender's outputs as much as possible until we hit * the limit the sender specified in the Payjoin parameters. Any remaining fees for the new inputs * will be then subtracted from the change output of the receiver. * Fees for additional outputs are always subtracted from the receiver's outputs. * * `max_effective_fee_rate` is the maximum effective fee rate that the receiver is * willing to pay for their own input/output contributions. A `max_effective_fee_rate` * of zero indicates that the receiver is not willing to pay any additional * fees. Errors if the final effective fee rate exceeds `max_effective_fee_rate`. * * If not provided, `min_fee_rate_sat_per_vb` and `max_effective_fee_rate_sat_per_vb` default to the * minimum possible relay fee. * * The minimum effective fee limit is the highest of the minimum limit set by the sender in * the original proposal parameters and the limit passed in the `min_fee_rate_sat_per_vb` parameter. */ applyFeeRange(minFeeRateSatPerVb: bigint | undefined, maxEffectiveFeeRateSatPerVb: bigint | undefined): WantsFeeRangeTransitionLike; /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WantsFeeRange; } export interface WantsInputsTransitionLike { save(persister: JsonReceiverSessionPersister): WantsFeeRangeLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `WantsInputsTransitionLike` instead. */ export type WantsInputsTransitionInterface = WantsInputsTransitionLike; export declare class WantsInputsTransition extends UniffiAbstractObject implements WantsInputsTransitionLike { readonly [uniffiTypeNameSymbol] = "WantsInputsTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): WantsFeeRangeLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WantsInputsTransition; } export interface InputPairLike { /** * Returns the outpoint spent by this input pair. */ outpoint(): OutPoint; } /** * @deprecated Use `InputPairLike` instead. */ export type InputPairInterface = InputPairLike; export declare class InputPair extends UniffiAbstractObject implements InputPairLike { readonly [uniffiTypeNameSymbol] = "InputPair"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; constructor(txin: TxIn, psbtin: PsbtInput, expectedWeight: Weight | undefined); /** * Returns the outpoint spent by this input pair. */ outpoint(): OutPoint; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is InputPair; } /** * Error that may occur when input contribution fails. */ export interface InputContributionErrorLike { } /** * @deprecated Use `InputContributionErrorLike` instead. */ export type InputContributionErrorInterface = InputContributionErrorLike; /** * Error that may occur when input contribution fails. */ export declare class InputContributionError extends UniffiAbstractObject implements InputContributionErrorLike { readonly [uniffiTypeNameSymbol] = "InputContributionError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is InputContributionError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): InputContributionError; } /** * Error that may occur when coin selection fails. */ export interface CoinSelectionErrorLike { } /** * @deprecated Use `CoinSelectionErrorLike` instead. */ export type CoinSelectionErrorInterface = CoinSelectionErrorLike; /** * Error that may occur when coin selection fails. */ export declare class CoinSelectionError extends UniffiAbstractObject implements CoinSelectionErrorLike { readonly [uniffiTypeNameSymbol] = "CoinSelectionError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is CoinSelectionError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): CoinSelectionError; } export interface WantsInputsLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Commit the input contributions and proceed to fee negotiation. * * Returns a [`WantsInputsTransition`] that, once persisted, * yields a [`WantsFeeRange`]. */ commitInputs(): WantsInputsTransitionLike; /** * Add the provided inputs to the payjoin proposal. * * Returns an updated [`WantsInputs`] with the contributed inputs. */ contributeInputs(replacementInputs: Array): WantsInputsLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Select receiver input such that the payjoin avoids surveillance. * Return the input chosen that has been applied to the Proposal. * * Proper coin selection allows payjoin to resemble ordinary transactions. * To ensure the resemblance, a number of heuristics must be avoided. * * UIH "Unnecessary input heuristic" is one class of them to avoid. We define * UIH1 and UIH2 according to the BlockSci practice * BlockSci UIH1 and UIH2: */ tryPreservingPrivacy(candidateInputs: Array): InputPairLike; } /** * @deprecated Use `WantsInputsLike` instead. */ export type WantsInputsInterface = WantsInputsLike; export declare class WantsInputs extends UniffiAbstractObject implements WantsInputsLike { readonly [uniffiTypeNameSymbol] = "WantsInputs"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Commit the input contributions and proceed to fee negotiation. * * Returns a [`WantsInputsTransition`] that, once persisted, * yields a [`WantsFeeRange`]. */ commitInputs(): WantsInputsTransitionLike; /** * Add the provided inputs to the payjoin proposal. * * Returns an updated [`WantsInputs`] with the contributed inputs. */ contributeInputs(replacementInputs: Array): WantsInputsLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Select receiver input such that the payjoin avoids surveillance. * Return the input chosen that has been applied to the Proposal. * * Proper coin selection allows payjoin to resemble ordinary transactions. * To ensure the resemblance, a number of heuristics must be avoided. * * UIH "Unnecessary input heuristic" is one class of them to avoid. We define * UIH1 and UIH2 according to the BlockSci practice * BlockSci UIH1 and UIH2: */ tryPreservingPrivacy(candidateInputs: Array): InputPairLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WantsInputs; } export interface WantsOutputsTransitionLike { save(persister: JsonReceiverSessionPersister): WantsInputsLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `WantsOutputsTransitionLike` instead. */ export type WantsOutputsTransitionInterface = WantsOutputsTransitionLike; export declare class WantsOutputsTransition extends UniffiAbstractObject implements WantsOutputsTransitionLike { readonly [uniffiTypeNameSymbol] = "WantsOutputsTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): WantsInputsLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WantsOutputsTransition; } export declare enum OutputSubstitution { Enabled = 0, Disabled = 1 } /** * Protocol error raised during output substitution. */ export interface OutputSubstitutionProtocolErrorLike { } /** * @deprecated Use `OutputSubstitutionProtocolErrorLike` instead. */ export type OutputSubstitutionProtocolErrorInterface = OutputSubstitutionProtocolErrorLike; /** * Protocol error raised during output substitution. */ export declare class OutputSubstitutionProtocolError extends UniffiAbstractObject implements OutputSubstitutionProtocolErrorLike { readonly [uniffiTypeNameSymbol] = "OutputSubstitutionProtocolError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is OutputSubstitutionProtocolError; } export declare enum OutputSubstitutionError_Tags { Protocol = "Protocol", FfiValidation = "FfiValidation" } /** * Error that may occur when output substitution fails. */ export declare const OutputSubstitutionError: Readonly<{ instanceOf: (obj: any) => obj is OutputSubstitutionError; Protocol: { new (v0: OutputSubstitutionProtocolErrorLike): { readonly tag: OutputSubstitutionError_Tags.Protocol; readonly inner: Readonly<[OutputSubstitutionProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: OutputSubstitutionProtocolErrorLike): { readonly tag: OutputSubstitutionError_Tags.Protocol; readonly inner: Readonly<[OutputSubstitutionProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: OutputSubstitutionError_Tags.Protocol; readonly inner: Readonly<[OutputSubstitutionProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: OutputSubstitutionError_Tags.Protocol; readonly inner: Readonly<[OutputSubstitutionProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: OutputSubstitutionError_Tags.Protocol; readonly inner: Readonly<[OutputSubstitutionProtocolErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[OutputSubstitutionProtocolErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; FfiValidation: { new (v0: FfiValidationError): { readonly tag: OutputSubstitutionError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: FfiValidationError): { readonly tag: OutputSubstitutionError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: OutputSubstitutionError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: OutputSubstitutionError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: OutputSubstitutionError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OutputSubstitutionError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[FfiValidationError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error that may occur when output substitution fails. */ export type OutputSubstitutionError = InstanceType<(typeof OutputSubstitutionError)["Protocol" | "FfiValidation"]>; export interface WantsOutputsLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Commit the output modifications and proceed to input contribution. * * Returns a [`WantsOutputsTransition`] that, once persisted, * yields a [`WantsInputs`]. */ commitOutputs(): WantsOutputsTransitionLike; /** * Returns whether output substitution is enabled for this session. */ outputSubstitution(): OutputSubstitution; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Replace all receiver outputs with the provided `replacement_outputs`, * and set up the `drain_script` as the receiver-owned output whose value * may be adjusted based on modifications in subsequent states. * * Returns an updated [`WantsOutputs`] with the replaced outputs. */ replaceReceiverOutputs(replacementOutputs: Array, drainScriptPubkey: ArrayBuffer): WantsOutputsLike; /** * Substitute the receiver output script with the provided script. * * Returns an updated [`WantsOutputs`] with the substituted output. */ substituteReceiverScript(outputScriptPubkey: ArrayBuffer): WantsOutputsLike; } /** * @deprecated Use `WantsOutputsLike` instead. */ export type WantsOutputsInterface = WantsOutputsLike; export declare class WantsOutputs extends UniffiAbstractObject implements WantsOutputsLike { readonly [uniffiTypeNameSymbol] = "WantsOutputs"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Commit the output modifications and proceed to input contribution. * * Returns a [`WantsOutputsTransition`] that, once persisted, * yields a [`WantsInputs`]. */ commitOutputs(): WantsOutputsTransitionLike; /** * Returns whether output substitution is enabled for this session. */ outputSubstitution(): OutputSubstitution; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; /** * Replace all receiver outputs with the provided `replacement_outputs`, * and set up the `drain_script` as the receiver-owned output whose value * may be adjusted based on modifications in subsequent states. * * Returns an updated [`WantsOutputs`] with the replaced outputs. */ replaceReceiverOutputs(replacementOutputs: Array, drainScriptPubkey: ArrayBuffer): WantsOutputsLike; /** * Substitute the receiver output script with the provided script. * * Returns an updated [`WantsOutputs`] with the substituted output. */ substituteReceiverScript(outputScriptPubkey: ArrayBuffer): WantsOutputsLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WantsOutputs; } export interface OutputsUnknownTransitionLike { save(persister: JsonReceiverSessionPersister): WantsOutputsLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `OutputsUnknownTransitionLike` instead. */ export type OutputsUnknownTransitionInterface = OutputsUnknownTransitionLike; export declare class OutputsUnknownTransition extends UniffiAbstractObject implements OutputsUnknownTransitionLike { readonly [uniffiTypeNameSymbol] = "OutputsUnknownTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): WantsOutputsLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is OutputsUnknownTransition; } /** * The receiver has not yet identified which outputs belong to the receiver. * * Only accept PSBTs that send us money. * Identify those outputs with `identify_receiver_outputs()` to proceed */ export interface OutputsUnknownLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Identify which outputs in the original transaction belong to the receiver * and ensure at least one output pays the receiver. * * Returns an [`OutputsUnknownTransition`] that, once persisted, * yields a [`WantsOutputs`] to continue the proposal. */ identifyReceiverOutputs(isReceiverOutput: IsScriptOwned): OutputsUnknownTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; } /** * @deprecated Use `OutputsUnknownLike` instead. */ export type OutputsUnknownInterface = OutputsUnknownLike; /** * The receiver has not yet identified which outputs belong to the receiver. * * Only accept PSBTs that send us money. * Identify those outputs with `identify_receiver_outputs()` to proceed */ export declare class OutputsUnknown extends UniffiAbstractObject implements OutputsUnknownLike { readonly [uniffiTypeNameSymbol] = "OutputsUnknown"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Identify which outputs in the original transaction belong to the receiver * and ensure at least one output pays the receiver. * * Returns an [`OutputsUnknownTransition`] that, once persisted, * yields a [`WantsOutputs`] to continue the proposal. */ identifyReceiverOutputs(isReceiverOutput: IsScriptOwned): OutputsUnknownTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is OutputsUnknown; } export interface MaybeInputsSeenTransitionLike { save(persister: JsonReceiverSessionPersister): OutputsUnknownLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `MaybeInputsSeenTransitionLike` instead. */ export type MaybeInputsSeenTransitionInterface = MaybeInputsSeenTransitionLike; export declare class MaybeInputsSeenTransition extends UniffiAbstractObject implements MaybeInputsSeenTransitionLike { readonly [uniffiTypeNameSymbol] = "MaybeInputsSeenTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): OutputsUnknownLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is MaybeInputsSeenTransition; } export interface MaybeInputsSeenLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Check that none of the inputs have been seen before, preventing input * probing and replay attacks (where inputs have been used in a previous * payjoin attempt). * * Returns a [`MaybeInputsSeenTransition`] that, once persisted, * yields an [`OutputsUnknown`] to continue validation. */ checkNoInputsSeenBefore(isKnown: IsOutputKnown): MaybeInputsSeenTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; } /** * @deprecated Use `MaybeInputsSeenLike` instead. */ export type MaybeInputsSeenInterface = MaybeInputsSeenLike; export declare class MaybeInputsSeen extends UniffiAbstractObject implements MaybeInputsSeenLike { readonly [uniffiTypeNameSymbol] = "MaybeInputsSeen"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Check that none of the inputs have been seen before, preventing input * probing and replay attacks (where inputs have been used in a previous * payjoin attempt). * * Returns a [`MaybeInputsSeenTransition`] that, once persisted, * yields an [`OutputsUnknown`] to continue validation. */ checkNoInputsSeenBefore(isKnown: IsOutputKnown): MaybeInputsSeenTransitionLike; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is MaybeInputsSeen; } export interface MaybeInputsOwnedTransitionLike { save(persister: JsonReceiverSessionPersister): MaybeInputsSeenLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `MaybeInputsOwnedTransitionLike` instead. */ export type MaybeInputsOwnedTransitionInterface = MaybeInputsOwnedTransitionLike; export declare class MaybeInputsOwnedTransition extends UniffiAbstractObject implements MaybeInputsOwnedTransitionLike { readonly [uniffiTypeNameSymbol] = "MaybeInputsOwnedTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): MaybeInputsSeenLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is MaybeInputsOwnedTransition; } export interface MaybeInputsOwnedLike { /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Check that none of the Original PSBT's inputs belong to the receiver, * preventing an attacker from spending the receiver's own inputs. * * Returns a [`MaybeInputsOwnedTransition`] that, once persisted, * yields a [`MaybeInputsSeen`] to continue validation. */ checkInputsNotOwned(isOwned: IsInputOwned): MaybeInputsOwnedTransitionLike; /** * Extract the transaction from the Original PSBT for scheduling broadcast as a * fallback in case the payjoin does not complete. * * Returns the consensus-encoded raw transaction bytes. */ extractTxToScheduleBroadcast(): ArrayBuffer; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; } /** * @deprecated Use `MaybeInputsOwnedLike` instead. */ export type MaybeInputsOwnedInterface = MaybeInputsOwnedLike; export declare class MaybeInputsOwned extends UniffiAbstractObject implements MaybeInputsOwnedLike { readonly [uniffiTypeNameSymbol] = "MaybeInputsOwned"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session and return pending fallback handling. * * Returns an [`CancelTransition`] that, once persisted, yields a * [`ReceiverPendingFallback`]. */ cancel(): CancelTransitionLike; /** * Check that none of the Original PSBT's inputs belong to the receiver, * preventing an attacker from spending the receiver's own inputs. * * Returns a [`MaybeInputsOwnedTransition`] that, once persisted, * yields a [`MaybeInputsSeen`] to continue validation. */ checkInputsNotOwned(isOwned: IsInputOwned): MaybeInputsOwnedTransitionLike; /** * Extract the transaction from the Original PSBT for scheduling broadcast as a * fallback in case the payjoin does not complete. * * Returns the consensus-encoded raw transaction bytes. */ extractTxToScheduleBroadcast(): ArrayBuffer; /** * Whether the payjoin proposal's transaction ID is knowable in advance. * * If every sender input is native SegWit (empty script_sig), the * transaction ID computed from the unsigned proposal remains valid once * the sender re-signs, so the receiver can record it (e.g. to reconcile * an incoming payment) and monitor the network for it. If any sender * input finalizes with a non-empty script_sig — legacy inputs, but also * P2SH-wrapped SegWit — the sender's final script_sig changes the * transaction ID: any ID derived from the proposal before the sender * signs will never appear on the network, and monitoring concludes the * session without checking. */ proposalTxidIsStable(): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is MaybeInputsOwned; } export interface AssumeInteractiveTransitionLike { save(persister: JsonReceiverSessionPersister): MaybeInputsOwnedLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `AssumeInteractiveTransitionLike` instead. */ export type AssumeInteractiveTransitionInterface = AssumeInteractiveTransitionLike; export declare class AssumeInteractiveTransition extends UniffiAbstractObject implements AssumeInteractiveTransitionLike { readonly [uniffiTypeNameSymbol] = "AssumeInteractiveTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): MaybeInputsOwnedLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is AssumeInteractiveTransition; } export interface CanBroadcast { callback(tx: ArrayBuffer): boolean; } export declare class CanBroadcastImpl extends UniffiAbstractObject implements CanBroadcast { readonly [uniffiTypeNameSymbol] = "CanBroadcastImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); callback(tx: ArrayBuffer): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is CanBroadcastImpl; } export interface UncheckedOriginalPayloadTransitionLike { save(persister: JsonReceiverSessionPersister): MaybeInputsOwnedLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `UncheckedOriginalPayloadTransitionLike` instead. */ export type UncheckedOriginalPayloadTransitionInterface = UncheckedOriginalPayloadTransitionLike; export declare class UncheckedOriginalPayloadTransition extends UniffiAbstractObject implements UncheckedOriginalPayloadTransitionLike { readonly [uniffiTypeNameSymbol] = "UncheckedOriginalPayloadTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): MaybeInputsOwnedLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is UncheckedOriginalPayloadTransition; } export interface UncheckedOriginalPayloadLike { /** * Call this method if the only way to initiate a Payjoin with this receiver * requires manual intervention, as in most consumer wallets. * * So-called "non-interactive" receivers, like payment processors, that allow arbitrary requests are otherwise vulnerable to probing attacks. * Those receivers call `extract_tx_to_check_broadcast()` and `attest_tested_and_scheduled_broadcast()` after making those checks downstream. */ assumeInteractiveReceiver(): AssumeInteractiveTransitionLike; /** * Cancel the Payjoin session immediately. * * Returns an [`CancelTransition`] that, once persisted, closes the * the receiver session. */ cancel(): CancelTransitionLike; /** * Check that the sender's Original PSBT is suitable for broadcast, ensuring * it can be used as a fallback if the payjoin does not complete. * * Returns an [`UncheckedOriginalPayloadTransition`] that, once persisted, * yields a [`MaybeInputsOwned`] to continue validation. */ checkBroadcastSuitability(minFeeRateSatPerKwu: bigint | undefined, canBroadcast: CanBroadcast): UncheckedOriginalPayloadTransitionLike; } /** * @deprecated Use `UncheckedOriginalPayloadLike` instead. */ export type UncheckedOriginalPayloadInterface = UncheckedOriginalPayloadLike; export declare class UncheckedOriginalPayload extends UniffiAbstractObject implements UncheckedOriginalPayloadLike { readonly [uniffiTypeNameSymbol] = "UncheckedOriginalPayload"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Call this method if the only way to initiate a Payjoin with this receiver * requires manual intervention, as in most consumer wallets. * * So-called "non-interactive" receivers, like payment processors, that allow arbitrary requests are otherwise vulnerable to probing attacks. * Those receivers call `extract_tx_to_check_broadcast()` and `attest_tested_and_scheduled_broadcast()` after making those checks downstream. */ assumeInteractiveReceiver(): AssumeInteractiveTransitionLike; /** * Cancel the Payjoin session immediately. * * Returns an [`CancelTransition`] that, once persisted, closes the * the receiver session. */ cancel(): CancelTransitionLike; /** * Check that the sender's Original PSBT is suitable for broadcast, ensuring * it can be used as a fallback if the payjoin does not complete. * * Returns an [`UncheckedOriginalPayloadTransition`] that, once persisted, * yields a [`MaybeInputsOwned`] to continue validation. */ checkBroadcastSuitability(minFeeRateSatPerKwu: bigint | undefined, canBroadcast: CanBroadcast): UncheckedOriginalPayloadTransitionLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is UncheckedOriginalPayload; } export interface PjUriLike { address(): string; /** * Number of sats requested as payment */ amountSats(): bigint | undefined; asString(): string; pjEndpoint(): string; /** * Sets the amount in sats and returns a new PjUri */ setAmountSats(amountSats: bigint): PjUriLike; } /** * @deprecated Use `PjUriLike` instead. */ export type PjUriInterface = PjUriLike; export declare class PjUri extends UniffiAbstractObject implements PjUriLike { readonly [uniffiTypeNameSymbol] = "PjUri"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); address(): string; /** * Number of sats requested as payment */ amountSats(): bigint | undefined; asString(): string; pjEndpoint(): string; /** * Sets the amount in sats and returns a new PjUri */ setAmountSats(amountSats: bigint): PjUriLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PjUri; } export interface InitializedTransitionLike { save(persister: JsonReceiverSessionPersister): InitializedTransitionOutcome; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `InitializedTransitionLike` instead. */ export type InitializedTransitionInterface = InitializedTransitionLike; export declare class InitializedTransition extends UniffiAbstractObject implements InitializedTransitionLike { readonly [uniffiTypeNameSymbol] = "InitializedTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): InitializedTransitionOutcome; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is InitializedTransition; } export interface InitializedLike { /** * Cancel the Payjoin session immediately. * * Returns an [`CancelTransition`] that, once persisted, closes the * the receiver session. */ cancel(): CancelTransitionLike; /** * Construct an OHTTP encapsulated GET request, polling the mailbox for the Original PSBT */ createPollRequest(ohttpRelay: string): RequestResponse; /** * Build a V2 Payjoin URI from the receiver's context */ pjUri(): PjUriLike; /** * Process the polling response from the directory. * * Returns an [`InitializedTransition`] that, once persisted, yields either * an [`UncheckedOriginalPayload`] if the sender's Original PSBT is available, * or [`Initialized`] if no proposal has arrived yet. */ processResponse(body: ArrayBuffer, ctx: ClientResponseLike): InitializedTransitionLike; } /** * @deprecated Use `InitializedLike` instead. */ export type InitializedInterface = InitializedLike; export declare class Initialized extends UniffiAbstractObject implements InitializedLike { readonly [uniffiTypeNameSymbol] = "Initialized"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session immediately. * * Returns an [`CancelTransition`] that, once persisted, closes the * the receiver session. */ cancel(): CancelTransitionLike; /** * Construct an OHTTP encapsulated GET request, polling the mailbox for the Original PSBT */ createPollRequest(ohttpRelay: string): RequestResponse; /** * Build a V2 Payjoin URI from the receiver's context */ pjUri(): PjUriLike; /** * Process the polling response from the directory. * * Returns an [`InitializedTransition`] that, once persisted, yields either * an [`UncheckedOriginalPayload`] if the sender's Original PSBT is available, * or [`Initialized`] if no proposal has arrived yet. */ processResponse(body: ArrayBuffer, ctx: ClientResponseLike): InitializedTransitionLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Initialized; } export declare enum InitializedTransitionOutcome_Tags { Progress = "Progress", Stasis = "Stasis" } export declare const InitializedTransitionOutcome: Readonly<{ instanceOf: (obj: any) => obj is InitializedTransitionOutcome; Progress: { new (inner: { inner: UncheckedOriginalPayloadLike; }): { readonly tag: InitializedTransitionOutcome_Tags.Progress; readonly inner: Readonly<{ inner: UncheckedOriginalPayloadLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InitializedTransitionOutcome"; }; "new"(inner: { inner: UncheckedOriginalPayloadLike; }): { readonly tag: InitializedTransitionOutcome_Tags.Progress; readonly inner: Readonly<{ inner: UncheckedOriginalPayloadLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InitializedTransitionOutcome"; }; instanceOf(obj: any): obj is { readonly tag: InitializedTransitionOutcome_Tags.Progress; readonly inner: Readonly<{ inner: UncheckedOriginalPayloadLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InitializedTransitionOutcome"; }; }; Stasis: { new (inner: { inner: InitializedLike; }): { readonly tag: InitializedTransitionOutcome_Tags.Stasis; readonly inner: Readonly<{ inner: InitializedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InitializedTransitionOutcome"; }; "new"(inner: { inner: InitializedLike; }): { readonly tag: InitializedTransitionOutcome_Tags.Stasis; readonly inner: Readonly<{ inner: InitializedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InitializedTransitionOutcome"; }; instanceOf(obj: any): obj is { readonly tag: InitializedTransitionOutcome_Tags.Stasis; readonly inner: Readonly<{ inner: InitializedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InitializedTransitionOutcome"; }; }; }>; export type InitializedTransitionOutcome = InstanceType<(typeof InitializedTransitionOutcome)["Progress" | "Stasis"]>; /** * Error validating a PSBT Input */ export interface PsbtInputErrorLike { } /** * @deprecated Use `PsbtInputErrorLike` instead. */ export type PsbtInputErrorInterface = PsbtInputErrorLike; /** * Error validating a PSBT Input */ export declare class PsbtInputError extends UniffiAbstractObject implements PsbtInputErrorLike { readonly [uniffiTypeNameSymbol] = "PsbtInputError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PsbtInputError; } export declare enum InputPairError_Tags { InvalidOutPoint = "InvalidOutPoint", InvalidPsbtInput = "InvalidPsbtInput", FfiValidation = "FfiValidation" } /** * Error constructing an [`InputPair`](crate::InputPair). */ export declare const InputPairError: Readonly<{ instanceOf: (obj: any) => obj is InputPairError; InvalidOutPoint: { new (inner: { txid: string; vout: number; }): { readonly tag: InputPairError_Tags.InvalidOutPoint; readonly inner: Readonly<{ txid: string; vout: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { txid: string; vout: number; }): { readonly tag: InputPairError_Tags.InvalidOutPoint; readonly inner: Readonly<{ txid: string; vout: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: InputPairError_Tags.InvalidOutPoint; readonly inner: Readonly<{ txid: string; vout: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: InputPairError_Tags.InvalidOutPoint; readonly inner: Readonly<{ txid: string; vout: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: InputPairError_Tags.InvalidOutPoint; readonly inner: Readonly<{ txid: string; vout: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ txid: string; vout: number; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; InvalidPsbtInput: { new (v0: PsbtInputErrorLike): { readonly tag: InputPairError_Tags.InvalidPsbtInput; readonly inner: Readonly<[PsbtInputErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: PsbtInputErrorLike): { readonly tag: InputPairError_Tags.InvalidPsbtInput; readonly inner: Readonly<[PsbtInputErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: InputPairError_Tags.InvalidPsbtInput; readonly inner: Readonly<[PsbtInputErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: InputPairError_Tags.InvalidPsbtInput; readonly inner: Readonly<[PsbtInputErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: InputPairError_Tags.InvalidPsbtInput; readonly inner: Readonly<[PsbtInputErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[PsbtInputErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; FfiValidation: { new (v0: FfiValidationError): { readonly tag: InputPairError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: FfiValidationError): { readonly tag: InputPairError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: InputPairError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: InputPairError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: InputPairError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "InputPairError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[FfiValidationError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error constructing an [`InputPair`](crate::InputPair). */ export type InputPairError = InstanceType<(typeof InputPairError)["InvalidOutPoint" | "InvalidPsbtInput" | "FfiValidation"]>; export declare enum ManualReceiveError_Tags { Invalid = "Invalid", Check = "Check" } /** * Errors from the offline receiver primitives. */ export declare const ManualReceiveError: Readonly<{ instanceOf: (obj: any) => obj is ManualReceiveError; Invalid: { new (inner: { message: string; }): { readonly tag: ManualReceiveError_Tags.Invalid; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { message: string; }): { readonly tag: ManualReceiveError_Tags.Invalid; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ManualReceiveError_Tags.Invalid; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ManualReceiveError_Tags.Invalid; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ManualReceiveError_Tags.Invalid; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ message: string; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Check: { new (inner: { message: string; }): { readonly tag: ManualReceiveError_Tags.Check; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { message: string; }): { readonly tag: ManualReceiveError_Tags.Check; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ManualReceiveError_Tags.Check; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ManualReceiveError_Tags.Check; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ManualReceiveError_Tags.Check; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ManualReceiveError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ message: string; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Errors from the offline receiver primitives. */ export type ManualReceiveError = InstanceType<(typeof ManualReceiveError)["Invalid" | "Check"]>; export declare enum OhttpKeysFetchError_Tags { Fetch = "Fetch" } /** * Errors from fetching OHTTP keys. */ export declare const OhttpKeysFetchError: Readonly<{ instanceOf: (obj: any) => obj is OhttpKeysFetchError; Fetch: { new (inner: { message: string; }): { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(inner: { message: string; }): { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<{ message: string; }>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Errors from fetching OHTTP keys. */ export type OhttpKeysFetchError = InstanceType<(typeof OhttpKeysFetchError)["Fetch"]>; /** * Session persister that should save and load events as JSON strings. */ export interface JsonSenderSessionPersister { save(event: string): void; load(): Array; close(): void; } /** * Session persister that should save and load events as JSON strings. */ export declare class JsonSenderSessionPersisterImpl extends UniffiAbstractObject implements JsonSenderSessionPersister { readonly [uniffiTypeNameSymbol] = "JsonSenderSessionPersisterImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(event: string): void; load(): Array; close(): void; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is JsonSenderSessionPersisterImpl; } /** * Error returned for v2-specific payload decapsulation errors. */ export interface DecapsulationErrorLike { } /** * @deprecated Use `DecapsulationErrorLike` instead. */ export type DecapsulationErrorInterface = DecapsulationErrorLike; /** * Error returned for v2-specific payload decapsulation errors. */ export declare class DecapsulationError extends UniffiAbstractObject implements DecapsulationErrorLike { readonly [uniffiTypeNameSymbol] = "DecapsulationError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is DecapsulationError; } /** * Error building a Sender from a SenderBuilder. * * This error is unrecoverable. */ export interface SenderBuilderErrorLike { } /** * @deprecated Use `SenderBuilderErrorLike` instead. */ export type SenderBuilderErrorInterface = SenderBuilderErrorLike; /** * Error building a Sender from a SenderBuilder. * * This error is unrecoverable. */ export declare class SenderBuilderError extends UniffiAbstractObject implements SenderBuilderErrorLike { readonly [uniffiTypeNameSymbol] = "SenderBuilderError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; equals(other: SenderBuilderError): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderBuilderError; } export declare enum SenderError_Tags { Decapsulation = "Decapsulation", Response = "Response", Build = "Build", Unexpected = "Unexpected" } /** * Error raised by a sender state machine transition */ export declare const SenderError: Readonly<{ instanceOf: (obj: any) => obj is SenderError; Decapsulation: { new (v0: DecapsulationErrorLike): { readonly tag: SenderError_Tags.Decapsulation; readonly inner: Readonly<[DecapsulationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: DecapsulationErrorLike): { readonly tag: SenderError_Tags.Decapsulation; readonly inner: Readonly<[DecapsulationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderError_Tags.Decapsulation; readonly inner: Readonly<[DecapsulationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderError_Tags.Decapsulation; readonly inner: Readonly<[DecapsulationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderError_Tags.Decapsulation; readonly inner: Readonly<[DecapsulationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[DecapsulationErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Response: { new (v0: ResponseError): { readonly tag: SenderError_Tags.Response; readonly inner: Readonly<[ResponseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ResponseError): { readonly tag: SenderError_Tags.Response; readonly inner: Readonly<[ResponseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderError_Tags.Response; readonly inner: Readonly<[ResponseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderError_Tags.Response; readonly inner: Readonly<[ResponseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderError_Tags.Response; readonly inner: Readonly<[ResponseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ResponseError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Build: { new (v0: SenderBuilderErrorLike): { readonly tag: SenderError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: SenderBuilderErrorLike): { readonly tag: SenderError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[SenderBuilderErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Unexpected: { new (): { readonly tag: SenderError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(): { readonly tag: SenderError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderError_Tags.Unexpected; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderError"; name: string; message: string; stack?: string; cause?: unknown; }; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error raised by a sender state machine transition */ export type SenderError = InstanceType<(typeof SenderError)["Decapsulation" | "Response" | "Build" | "Unexpected"]>; export declare enum SenderPersistedError_Tags { Transient = "Transient", Fatal = "Fatal", Storage = "Storage" } /** * Error that may occur during state machine transitions */ export declare const SenderPersistedError: Readonly<{ instanceOf: (obj: any) => obj is SenderPersistedError; Transient: { new (v0: SenderError): { readonly tag: SenderPersistedError_Tags.Transient; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: SenderError): { readonly tag: SenderPersistedError_Tags.Transient; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderPersistedError_Tags.Transient; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderPersistedError_Tags.Transient; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderPersistedError_Tags.Transient; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[SenderError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Fatal: { new (v0: SenderError): { readonly tag: SenderPersistedError_Tags.Fatal; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: SenderError): { readonly tag: SenderPersistedError_Tags.Fatal; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderPersistedError_Tags.Fatal; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderPersistedError_Tags.Fatal; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderPersistedError_Tags.Fatal; readonly inner: Readonly<[SenderError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[SenderError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Storage: { new (v0: ImplementationErrorLike): { readonly tag: SenderPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: ImplementationErrorLike): { readonly tag: SenderPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderPersistedError_Tags.Storage; readonly inner: Readonly<[ImplementationErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderPersistedError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[ImplementationErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error that may occur during state machine transitions */ export type SenderPersistedError = InstanceType<(typeof SenderPersistedError)["Transient" | "Fatal" | "Storage"]>; /** * Async session persister that should save and load events as JSON strings. */ export interface JsonSenderSessionPersisterAsync { save(event: string, asyncOpts_?: { signal: AbortSignal; }): Promise; load(asyncOpts_?: { signal: AbortSignal; }): Promise>; close(asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * Async session persister that should save and load events as JSON strings. */ export declare class JsonSenderSessionPersisterAsyncImpl extends UniffiAbstractObject implements JsonSenderSessionPersisterAsync { readonly [uniffiTypeNameSymbol] = "JsonSenderSessionPersisterAsyncImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(event: string, asyncOpts_?: { signal: AbortSignal; }): Promise; load(asyncOpts_?: { signal: AbortSignal; }): Promise>; close(asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is JsonSenderSessionPersisterAsyncImpl; } export interface BroadcastedTransitionLike { save(persister: JsonSenderSessionPersister): void; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `BroadcastedTransitionLike` instead. */ export type BroadcastedTransitionInterface = BroadcastedTransitionLike; export declare class BroadcastedTransition extends UniffiAbstractObject implements BroadcastedTransitionLike { readonly [uniffiTypeNameSymbol] = "BroadcastedTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonSenderSessionPersister): void; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is BroadcastedTransition; } export interface SenderPendingFallbackLike { /** * Mark the session as complete, signaling that the fallback transaction * has been broadcast or its control has been transferred. * * Persist the returned [`BroadcastedTransition`] to close the session. */ close(): BroadcastedTransitionLike; /** * Returns the fallback transaction as consensus-encoded raw bytes. * * This is the sender's original transaction that should be broadcast to * complete the payment without Payjoin. */ fallbackTx(): ArrayBuffer; } /** * @deprecated Use `SenderPendingFallbackLike` instead. */ export type SenderPendingFallbackInterface = SenderPendingFallbackLike; export declare class SenderPendingFallback extends UniffiAbstractObject implements SenderPendingFallbackLike { readonly [uniffiTypeNameSymbol] = "SenderPendingFallback"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Mark the session as complete, signaling that the fallback transaction * has been broadcast or its control has been transferred. * * Persist the returned [`BroadcastedTransition`] to close the session. */ close(): BroadcastedTransitionLike; /** * Returns the fallback transaction as consensus-encoded raw bytes. * * This is the sender's original transaction that should be broadcast to * complete the payment without Payjoin. */ fallbackTx(): ArrayBuffer; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderPendingFallback; } export interface SenderCancelTransitionLike { save(persister: JsonSenderSessionPersister): SenderPendingFallbackLike; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `SenderCancelTransitionLike` instead. */ export type SenderCancelTransitionInterface = SenderCancelTransitionLike; export declare class SenderCancelTransition extends UniffiAbstractObject implements SenderCancelTransitionLike { readonly [uniffiTypeNameSymbol] = "SenderCancelTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonSenderSessionPersister): SenderPendingFallbackLike; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderCancelTransition; } /** * Error returned when request could not be created. * * This error can currently only happen due to programmer mistake. * `unwrap()`ing it is thus considered OK in Rust but you may achieve nicer message by displaying * it. */ export interface CreateRequestErrorLike { /** * Returns `true` if the request could not be created because the session * has expired. */ isExpired(): boolean; } /** * @deprecated Use `CreateRequestErrorLike` instead. */ export type CreateRequestErrorInterface = CreateRequestErrorLike; /** * Error returned when request could not be created. * * This error can currently only happen due to programmer mistake. * `unwrap()`ing it is thus considered OK in Rust but you may achieve nicer message by displaying * it. */ export declare class CreateRequestError extends UniffiAbstractObject implements CreateRequestErrorLike { readonly [uniffiTypeNameSymbol] = "CreateRequestError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Returns `true` if the request could not be created because the session * has expired. */ isExpired(): boolean; toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is CreateRequestError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): CreateRequestError; } export interface PollingForProposalTransitionLike { save(persister: JsonSenderSessionPersister): PollingForProposalTransitionOutcome; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `PollingForProposalTransitionLike` instead. */ export type PollingForProposalTransitionInterface = PollingForProposalTransitionLike; export declare class PollingForProposalTransition extends UniffiAbstractObject implements PollingForProposalTransitionLike { readonly [uniffiTypeNameSymbol] = "PollingForProposalTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonSenderSessionPersister): PollingForProposalTransitionOutcome; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PollingForProposalTransition; } export interface PollingForProposalLike { /** * Cancel the Payjoin session immediately. * * Returns a [`SenderCancelTransition`] that, once persisted, yields a * [`SenderPendingFallback`] state. Call [`SenderPendingFallback::fallback_tx`] to get * the original transaction */ cancel(): SenderCancelTransitionLike; createPollRequest(ohttpRelay: string): RequestOhttpContext; /** * Decodes and validates the response. * Call this method with a response from the receiver to continue the BIP77 flow. * A successful response can either be `None` if the relay has no response yet, * or `Some(Psbt)`. * If the response is a valid PSBT you should sign and broadcast it. */ processResponse(response: ArrayBuffer, ohttpCtx: ClientResponseLike): PollingForProposalTransitionLike; } /** * @deprecated Use `PollingForProposalLike` instead. */ export type PollingForProposalInterface = PollingForProposalLike; export declare class PollingForProposal extends UniffiAbstractObject implements PollingForProposalLike { readonly [uniffiTypeNameSymbol] = "PollingForProposal"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session immediately. * * Returns a [`SenderCancelTransition`] that, once persisted, yields a * [`SenderPendingFallback`] state. Call [`SenderPendingFallback::fallback_tx`] to get * the original transaction */ cancel(): SenderCancelTransitionLike; createPollRequest(ohttpRelay: string): RequestOhttpContext; /** * Decodes and validates the response. * Call this method with a response from the receiver to continue the BIP77 flow. * A successful response can either be `None` if the relay has no response yet, * or `Some(Psbt)`. * If the response is a valid PSBT you should sign and broadcast it. */ processResponse(response: ArrayBuffer, ohttpCtx: ClientResponseLike): PollingForProposalTransitionLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PollingForProposal; } export declare enum PollingForProposalTransitionOutcome_Tags { Progress = "Progress", Stasis = "Stasis" } export declare const PollingForProposalTransitionOutcome: Readonly<{ instanceOf: (obj: any) => obj is PollingForProposalTransitionOutcome; Progress: { new (inner: { psbtBase64: string; }): { readonly tag: PollingForProposalTransitionOutcome_Tags.Progress; readonly inner: Readonly<{ psbtBase64: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PollingForProposalTransitionOutcome"; }; "new"(inner: { psbtBase64: string; }): { readonly tag: PollingForProposalTransitionOutcome_Tags.Progress; readonly inner: Readonly<{ psbtBase64: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PollingForProposalTransitionOutcome"; }; instanceOf(obj: any): obj is { readonly tag: PollingForProposalTransitionOutcome_Tags.Progress; readonly inner: Readonly<{ psbtBase64: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PollingForProposalTransitionOutcome"; }; }; Stasis: { new (inner: { inner: PollingForProposalLike; }): { readonly tag: PollingForProposalTransitionOutcome_Tags.Stasis; readonly inner: Readonly<{ inner: PollingForProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PollingForProposalTransitionOutcome"; }; "new"(inner: { inner: PollingForProposalLike; }): { readonly tag: PollingForProposalTransitionOutcome_Tags.Stasis; readonly inner: Readonly<{ inner: PollingForProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PollingForProposalTransitionOutcome"; }; instanceOf(obj: any): obj is { readonly tag: PollingForProposalTransitionOutcome_Tags.Stasis; readonly inner: Readonly<{ inner: PollingForProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PollingForProposalTransitionOutcome"; }; }; }>; export type PollingForProposalTransitionOutcome = InstanceType<(typeof PollingForProposalTransitionOutcome)["Progress" | "Stasis"]>; export declare enum PsbtParseError_Tags { InvalidPsbt = "InvalidPsbt" } /** * FFI-visible PSBT parsing error surfaced at the sender boundary. */ export declare const PsbtParseError: Readonly<{ instanceOf: (obj: any) => obj is PsbtParseError; InvalidPsbt: { new (v0: string): { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: string): { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[string]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * FFI-visible PSBT parsing error surfaced at the sender boundary. */ export type PsbtParseError = InstanceType<(typeof PsbtParseError)["InvalidPsbt"]>; export interface HasReplyableErrorTransitionLike { save(persister: JsonReceiverSessionPersister): /*throws*/ ReceiverPendingFallbackLike | undefined; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `HasReplyableErrorTransitionLike` instead. */ export type HasReplyableErrorTransitionInterface = HasReplyableErrorTransitionLike; export declare class HasReplyableErrorTransition extends UniffiAbstractObject implements HasReplyableErrorTransitionLike { readonly [uniffiTypeNameSymbol] = "HasReplyableErrorTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): ReceiverPendingFallbackLike | undefined; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is HasReplyableErrorTransition; } export interface HasReplyableErrorLike { /** * Cancel the Payjoin session without posting the receiver error response. * * Returns an [`CancelTransition`] that, once persisted, yields either * a [`ReceiverPendingFallback`] if current session has validated fallback tx, * or otherwise closes the session. */ cancel(): CancelTransitionLike; /** * Construct an OHTTP encapsulated POST request to post the receiver * error response to the directory so it can be retrieved by the sender. */ createErrorRequest(ohttpRelay: string): RequestResponse; /** * Process the response from the directory after posting the receiver * error response. * * Returns a [`HasReplyableErrorTransition`] that, once persisted, * completes the error reporting and either yields a * [`ReceiverPendingFallback`] if current session has validated fallback tx, * or otherwise closes the session. */ processErrorResponse(body: ArrayBuffer, ohttpContext: ClientResponseLike): HasReplyableErrorTransitionLike; } /** * @deprecated Use `HasReplyableErrorLike` instead. */ export type HasReplyableErrorInterface = HasReplyableErrorLike; export declare class HasReplyableError extends UniffiAbstractObject implements HasReplyableErrorLike { readonly [uniffiTypeNameSymbol] = "HasReplyableError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session without posting the receiver error response. * * Returns an [`CancelTransition`] that, once persisted, yields either * a [`ReceiverPendingFallback`] if current session has validated fallback tx, * or otherwise closes the session. */ cancel(): CancelTransitionLike; /** * Construct an OHTTP encapsulated POST request to post the receiver * error response to the directory so it can be retrieved by the sender. */ createErrorRequest(ohttpRelay: string): RequestResponse; /** * Process the response from the directory after posting the receiver * error response. * * Returns a [`HasReplyableErrorTransition`] that, once persisted, * completes the error reporting and either yields a * [`ReceiverPendingFallback`] if current session has validated fallback tx, * or otherwise closes the session. */ processErrorResponse(body: ArrayBuffer, ohttpContext: ClientResponseLike): HasReplyableErrorTransitionLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is HasReplyableError; } export interface ReceiverSessionOutcomeLike { } /** * @deprecated Use `ReceiverSessionOutcomeLike` instead. */ export type ReceiverSessionOutcomeInterface = ReceiverSessionOutcomeLike; export declare class ReceiverSessionOutcome extends UniffiAbstractObject implements ReceiverSessionOutcomeLike { readonly [uniffiTypeNameSymbol] = "ReceiverSessionOutcome"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverSessionOutcome; } export declare enum ReceiveSession_Tags { Initialized = "Initialized", UncheckedOriginalPayload = "UncheckedOriginalPayload", MaybeInputsOwned = "MaybeInputsOwned", MaybeInputsSeen = "MaybeInputsSeen", OutputsUnknown = "OutputsUnknown", WantsOutputs = "WantsOutputs", WantsInputs = "WantsInputs", WantsFeeRange = "WantsFeeRange", ProvisionalProposal = "ProvisionalProposal", PayjoinProposal = "PayjoinProposal", HasReplyableError = "HasReplyableError", Monitor = "Monitor", ReceiverPendingFallback = "ReceiverPendingFallback", Closed = "Closed" } export declare const ReceiveSession: Readonly<{ instanceOf: (obj: any) => obj is ReceiveSession; Initialized: { new (inner: { inner: InitializedLike; }): { readonly tag: ReceiveSession_Tags.Initialized; readonly inner: Readonly<{ inner: InitializedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: InitializedLike; }): { readonly tag: ReceiveSession_Tags.Initialized; readonly inner: Readonly<{ inner: InitializedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.Initialized; readonly inner: Readonly<{ inner: InitializedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; UncheckedOriginalPayload: { new (inner: { inner: UncheckedOriginalPayloadLike; }): { readonly tag: ReceiveSession_Tags.UncheckedOriginalPayload; readonly inner: Readonly<{ inner: UncheckedOriginalPayloadLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: UncheckedOriginalPayloadLike; }): { readonly tag: ReceiveSession_Tags.UncheckedOriginalPayload; readonly inner: Readonly<{ inner: UncheckedOriginalPayloadLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.UncheckedOriginalPayload; readonly inner: Readonly<{ inner: UncheckedOriginalPayloadLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; MaybeInputsOwned: { new (inner: { inner: MaybeInputsOwnedLike; }): { readonly tag: ReceiveSession_Tags.MaybeInputsOwned; readonly inner: Readonly<{ inner: MaybeInputsOwnedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: MaybeInputsOwnedLike; }): { readonly tag: ReceiveSession_Tags.MaybeInputsOwned; readonly inner: Readonly<{ inner: MaybeInputsOwnedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.MaybeInputsOwned; readonly inner: Readonly<{ inner: MaybeInputsOwnedLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; MaybeInputsSeen: { new (inner: { inner: MaybeInputsSeenLike; }): { readonly tag: ReceiveSession_Tags.MaybeInputsSeen; readonly inner: Readonly<{ inner: MaybeInputsSeenLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: MaybeInputsSeenLike; }): { readonly tag: ReceiveSession_Tags.MaybeInputsSeen; readonly inner: Readonly<{ inner: MaybeInputsSeenLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.MaybeInputsSeen; readonly inner: Readonly<{ inner: MaybeInputsSeenLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; OutputsUnknown: { new (inner: { inner: OutputsUnknownLike; }): { readonly tag: ReceiveSession_Tags.OutputsUnknown; readonly inner: Readonly<{ inner: OutputsUnknownLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: OutputsUnknownLike; }): { readonly tag: ReceiveSession_Tags.OutputsUnknown; readonly inner: Readonly<{ inner: OutputsUnknownLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.OutputsUnknown; readonly inner: Readonly<{ inner: OutputsUnknownLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; WantsOutputs: { new (inner: { inner: WantsOutputsLike; }): { readonly tag: ReceiveSession_Tags.WantsOutputs; readonly inner: Readonly<{ inner: WantsOutputsLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: WantsOutputsLike; }): { readonly tag: ReceiveSession_Tags.WantsOutputs; readonly inner: Readonly<{ inner: WantsOutputsLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.WantsOutputs; readonly inner: Readonly<{ inner: WantsOutputsLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; WantsInputs: { new (inner: { inner: WantsInputsLike; }): { readonly tag: ReceiveSession_Tags.WantsInputs; readonly inner: Readonly<{ inner: WantsInputsLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: WantsInputsLike; }): { readonly tag: ReceiveSession_Tags.WantsInputs; readonly inner: Readonly<{ inner: WantsInputsLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.WantsInputs; readonly inner: Readonly<{ inner: WantsInputsLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; WantsFeeRange: { new (inner: { inner: WantsFeeRangeLike; }): { readonly tag: ReceiveSession_Tags.WantsFeeRange; readonly inner: Readonly<{ inner: WantsFeeRangeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: WantsFeeRangeLike; }): { readonly tag: ReceiveSession_Tags.WantsFeeRange; readonly inner: Readonly<{ inner: WantsFeeRangeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.WantsFeeRange; readonly inner: Readonly<{ inner: WantsFeeRangeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; ProvisionalProposal: { new (inner: { inner: ProvisionalProposalLike; }): { readonly tag: ReceiveSession_Tags.ProvisionalProposal; readonly inner: Readonly<{ inner: ProvisionalProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: ProvisionalProposalLike; }): { readonly tag: ReceiveSession_Tags.ProvisionalProposal; readonly inner: Readonly<{ inner: ProvisionalProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.ProvisionalProposal; readonly inner: Readonly<{ inner: ProvisionalProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; PayjoinProposal: { new (inner: { inner: PayjoinProposalLike; }): { readonly tag: ReceiveSession_Tags.PayjoinProposal; readonly inner: Readonly<{ inner: PayjoinProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: PayjoinProposalLike; }): { readonly tag: ReceiveSession_Tags.PayjoinProposal; readonly inner: Readonly<{ inner: PayjoinProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.PayjoinProposal; readonly inner: Readonly<{ inner: PayjoinProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; HasReplyableError: { new (inner: { inner: HasReplyableErrorLike; }): { readonly tag: ReceiveSession_Tags.HasReplyableError; readonly inner: Readonly<{ inner: HasReplyableErrorLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: HasReplyableErrorLike; }): { readonly tag: ReceiveSession_Tags.HasReplyableError; readonly inner: Readonly<{ inner: HasReplyableErrorLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.HasReplyableError; readonly inner: Readonly<{ inner: HasReplyableErrorLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; Monitor: { new (inner: { inner: MonitorLike; }): { readonly tag: ReceiveSession_Tags.Monitor; readonly inner: Readonly<{ inner: MonitorLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: MonitorLike; }): { readonly tag: ReceiveSession_Tags.Monitor; readonly inner: Readonly<{ inner: MonitorLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.Monitor; readonly inner: Readonly<{ inner: MonitorLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; ReceiverPendingFallback: { new (inner: { inner: ReceiverPendingFallbackLike; }): { readonly tag: ReceiveSession_Tags.ReceiverPendingFallback; readonly inner: Readonly<{ inner: ReceiverPendingFallbackLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: ReceiverPendingFallbackLike; }): { readonly tag: ReceiveSession_Tags.ReceiverPendingFallback; readonly inner: Readonly<{ inner: ReceiverPendingFallbackLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.ReceiverPendingFallback; readonly inner: Readonly<{ inner: ReceiverPendingFallbackLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; Closed: { new (inner: { inner: ReceiverSessionOutcomeLike; }): { readonly tag: ReceiveSession_Tags.Closed; readonly inner: Readonly<{ inner: ReceiverSessionOutcomeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; "new"(inner: { inner: ReceiverSessionOutcomeLike; }): { readonly tag: ReceiveSession_Tags.Closed; readonly inner: Readonly<{ inner: ReceiverSessionOutcomeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; instanceOf(obj: any): obj is { readonly tag: ReceiveSession_Tags.Closed; readonly inner: Readonly<{ inner: ReceiverSessionOutcomeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiveSession"; }; }; }>; export type ReceiveSession = InstanceType<(typeof ReceiveSession)["Initialized" | "UncheckedOriginalPayload" | "MaybeInputsOwned" | "MaybeInputsSeen" | "OutputsUnknown" | "WantsOutputs" | "WantsInputs" | "WantsFeeRange" | "ProvisionalProposal" | "PayjoinProposal" | "HasReplyableError" | "Monitor" | "ReceiverPendingFallback" | "Closed"]>; /** * Error parsing a Bitcoin address. */ export interface AddressParseErrorLike { } /** * @deprecated Use `AddressParseErrorLike` instead. */ export type AddressParseErrorInterface = AddressParseErrorLike; /** * Error parsing a Bitcoin address. */ export declare class AddressParseError extends UniffiAbstractObject implements AddressParseErrorLike { readonly [uniffiTypeNameSymbol] = "AddressParseError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is AddressParseError; } export declare enum ReceiverBuilderError_Tags { InvalidAddress = "InvalidAddress", IntoUrl = "IntoUrl" } /** * Error that may occur when building a receiver session. */ export declare const ReceiverBuilderError: Readonly<{ instanceOf: (obj: any) => obj is ReceiverBuilderError; InvalidAddress: { new (v0: AddressParseErrorLike): { readonly tag: ReceiverBuilderError_Tags.InvalidAddress; readonly inner: Readonly<[AddressParseErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: AddressParseErrorLike): { readonly tag: ReceiverBuilderError_Tags.InvalidAddress; readonly inner: Readonly<[AddressParseErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverBuilderError_Tags.InvalidAddress; readonly inner: Readonly<[AddressParseErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverBuilderError_Tags.InvalidAddress; readonly inner: Readonly<[AddressParseErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverBuilderError_Tags.InvalidAddress; readonly inner: Readonly<[AddressParseErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[AddressParseErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; IntoUrl: { new (v0: IntoUrlErrorLike): { readonly tag: ReceiverBuilderError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: IntoUrlErrorLike): { readonly tag: ReceiverBuilderError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: ReceiverBuilderError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: ReceiverBuilderError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: ReceiverBuilderError_Tags.IntoUrl; readonly inner: Readonly<[IntoUrlErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ReceiverBuilderError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[IntoUrlErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error that may occur when building a receiver session. */ export type ReceiverBuilderError = InstanceType<(typeof ReceiverBuilderError)["InvalidAddress" | "IntoUrl"]>; export interface WithReplyKeyTransitionLike { save(persister: JsonSenderSessionPersister): PollingForProposalLike; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `WithReplyKeyTransitionLike` instead. */ export type WithReplyKeyTransitionInterface = WithReplyKeyTransitionLike; export declare class WithReplyKeyTransition extends UniffiAbstractObject implements WithReplyKeyTransitionLike { readonly [uniffiTypeNameSymbol] = "WithReplyKeyTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonSenderSessionPersister): PollingForProposalLike; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WithReplyKeyTransition; } export interface WithReplyKeyLike { /** * Cancel the Payjoin session immediately. * * Returns a [`SenderCancelTransition`] that, once persisted, yields a * [`SenderPendingFallback`] state. Call [`SenderPendingFallback::fallback_tx`] to get * the original transaction */ cancel(): SenderCancelTransitionLike; /** * Construct serialized Request and Context from a Payjoin Proposal. * * Important: This request must not be retried or reused on failure. * Retransmitting the same ciphertext breaks OHTTP privacy properties. * The specific concern is that the relay can see that a request is being retried. */ createV2PostRequest(ohttpRelay: string): RequestOhttpContext; /** * Decodes and validates the response. * Call this method with a response from the receiver to continue the BIP77 flow. * A successful response can either be `None` if the relay has no response yet, * or `Some(Psbt)`. * If the response is a valid PSBT you should sign and broadcast it. */ processResponse(response: ArrayBuffer, postCtx: ClientResponseLike): WithReplyKeyTransitionLike; } /** * @deprecated Use `WithReplyKeyLike` instead. */ export type WithReplyKeyInterface = WithReplyKeyLike; export declare class WithReplyKey extends UniffiAbstractObject implements WithReplyKeyLike { readonly [uniffiTypeNameSymbol] = "WithReplyKey"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Cancel the Payjoin session immediately. * * Returns a [`SenderCancelTransition`] that, once persisted, yields a * [`SenderPendingFallback`] state. Call [`SenderPendingFallback::fallback_tx`] to get * the original transaction */ cancel(): SenderCancelTransitionLike; /** * Construct serialized Request and Context from a Payjoin Proposal. * * Important: This request must not be retried or reused on failure. * Retransmitting the same ciphertext breaks OHTTP privacy properties. * The specific concern is that the relay can see that a request is being retried. */ createV2PostRequest(ohttpRelay: string): RequestOhttpContext; /** * Decodes and validates the response. * Call this method with a response from the receiver to continue the BIP77 flow. * A successful response can either be `None` if the relay has no response yet, * or `Some(Psbt)`. * If the response is a valid PSBT you should sign and broadcast it. */ processResponse(response: ArrayBuffer, postCtx: ClientResponseLike): WithReplyKeyTransitionLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is WithReplyKey; } export interface SenderSessionOutcomeLike { isAborted(): boolean; isSuccess(): boolean; successPsbtBase64(): string | undefined; } /** * @deprecated Use `SenderSessionOutcomeLike` instead. */ export type SenderSessionOutcomeInterface = SenderSessionOutcomeLike; export declare class SenderSessionOutcome extends UniffiAbstractObject implements SenderSessionOutcomeLike { readonly [uniffiTypeNameSymbol] = "SenderSessionOutcome"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); isAborted(): boolean; isSuccess(): boolean; successPsbtBase64(): string | undefined; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderSessionOutcome; } export declare enum SendSession_Tags { WithReplyKey = "WithReplyKey", PollingForProposal = "PollingForProposal", SenderPendingFallback = "SenderPendingFallback", Closed = "Closed" } export declare const SendSession: Readonly<{ instanceOf: (obj: any) => obj is SendSession; WithReplyKey: { new (inner: { inner: WithReplyKeyLike; }): { readonly tag: SendSession_Tags.WithReplyKey; readonly inner: Readonly<{ inner: WithReplyKeyLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; "new"(inner: { inner: WithReplyKeyLike; }): { readonly tag: SendSession_Tags.WithReplyKey; readonly inner: Readonly<{ inner: WithReplyKeyLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; instanceOf(obj: any): obj is { readonly tag: SendSession_Tags.WithReplyKey; readonly inner: Readonly<{ inner: WithReplyKeyLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; }; PollingForProposal: { new (inner: { inner: PollingForProposalLike; }): { readonly tag: SendSession_Tags.PollingForProposal; readonly inner: Readonly<{ inner: PollingForProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; "new"(inner: { inner: PollingForProposalLike; }): { readonly tag: SendSession_Tags.PollingForProposal; readonly inner: Readonly<{ inner: PollingForProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; instanceOf(obj: any): obj is { readonly tag: SendSession_Tags.PollingForProposal; readonly inner: Readonly<{ inner: PollingForProposalLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; }; SenderPendingFallback: { new (inner: { inner: SenderPendingFallbackLike; }): { readonly tag: SendSession_Tags.SenderPendingFallback; readonly inner: Readonly<{ inner: SenderPendingFallbackLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; "new"(inner: { inner: SenderPendingFallbackLike; }): { readonly tag: SendSession_Tags.SenderPendingFallback; readonly inner: Readonly<{ inner: SenderPendingFallbackLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; instanceOf(obj: any): obj is { readonly tag: SendSession_Tags.SenderPendingFallback; readonly inner: Readonly<{ inner: SenderPendingFallbackLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; }; Closed: { new (inner: { inner: SenderSessionOutcomeLike; }): { readonly tag: SendSession_Tags.Closed; readonly inner: Readonly<{ inner: SenderSessionOutcomeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; "new"(inner: { inner: SenderSessionOutcomeLike; }): { readonly tag: SendSession_Tags.Closed; readonly inner: Readonly<{ inner: SenderSessionOutcomeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; instanceOf(obj: any): obj is { readonly tag: SendSession_Tags.Closed; readonly inner: Readonly<{ inner: SenderSessionOutcomeLike; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SendSession"; }; }; }>; export type SendSession = InstanceType<(typeof SendSession)["WithReplyKey" | "PollingForProposal" | "SenderPendingFallback" | "Closed"]>; export declare enum SenderInputError_Tags { Psbt = "Psbt", Build = "Build", FfiValidation = "FfiValidation" } /** * Raised when inputs provided to the sender are malformed or sender build fails. */ export declare const SenderInputError: Readonly<{ instanceOf: (obj: any) => obj is SenderInputError; Psbt: { new (v0: PsbtParseError): { readonly tag: SenderInputError_Tags.Psbt; readonly inner: Readonly<[PsbtParseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: PsbtParseError): { readonly tag: SenderInputError_Tags.Psbt; readonly inner: Readonly<[PsbtParseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderInputError_Tags.Psbt; readonly inner: Readonly<[PsbtParseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderInputError_Tags.Psbt; readonly inner: Readonly<[PsbtParseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderInputError_Tags.Psbt; readonly inner: Readonly<[PsbtParseError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[PsbtParseError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Build: { new (v0: SenderBuilderErrorLike): { readonly tag: SenderInputError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: SenderBuilderErrorLike): { readonly tag: SenderInputError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderInputError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderInputError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderInputError_Tags.Build; readonly inner: Readonly<[SenderBuilderErrorLike]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[SenderBuilderErrorLike]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; FfiValidation: { new (v0: FfiValidationError): { readonly tag: SenderInputError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; "new"(v0: FfiValidationError): { readonly tag: SenderInputError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; instanceOf(obj: any): obj is { readonly tag: SenderInputError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; hasInner(obj: any): obj is { readonly tag: SenderInputError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }; getInner(obj: { readonly tag: SenderInputError_Tags.FfiValidation; readonly inner: Readonly<[FfiValidationError]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SenderInputError"; name: string; message: string; stack?: string; cause?: unknown; }): Readonly<[FfiValidationError]>; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Raised when inputs provided to the sender are malformed or sender build fails. */ export type SenderInputError = InstanceType<(typeof SenderInputError)["Psbt" | "Build" | "FfiValidation"]>; export interface FeeRateErrorLike { } /** * @deprecated Use `FeeRateErrorLike` instead. */ export type FeeRateErrorInterface = FeeRateErrorLike; export declare class FeeRateError extends UniffiAbstractObject implements FeeRateErrorLike { readonly [uniffiTypeNameSymbol] = "FeeRateError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is FeeRateError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): FeeRateError; } export interface InitialReceiveTransitionLike { save(persister: JsonReceiverSessionPersister): InitializedLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `InitialReceiveTransitionLike` instead. */ export type InitialReceiveTransitionInterface = InitialReceiveTransitionLike; export declare class InitialReceiveTransition extends UniffiAbstractObject implements InitialReceiveTransitionLike { readonly [uniffiTypeNameSymbol] = "InitialReceiveTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonReceiverSessionPersister): InitializedLike; saveAsync(persister: JsonReceiverSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is InitialReceiveTransition; } export interface InitialSendTransitionLike { save(persister: JsonSenderSessionPersister): WithReplyKeyLike; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `InitialSendTransitionLike` instead. */ export type InitialSendTransitionInterface = InitialSendTransitionLike; export declare class InitialSendTransition extends UniffiAbstractObject implements InitialSendTransitionLike { readonly [uniffiTypeNameSymbol] = "InitialSendTransition"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); save(persister: JsonSenderSessionPersister): WithReplyKeyLike; saveAsync(persister: JsonSenderSessionPersisterAsync, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is InitialSendTransition; } /** * The standard format for errors that can be replied as JSON. * * The JSON output includes the following fields: * ```json * { * "errorCode": "specific-error-code", * "message": "Human readable error message" * } * ``` */ export interface JsonReplyLike { } /** * @deprecated Use `JsonReplyLike` instead. */ export type JsonReplyInterface = JsonReplyLike; /** * The standard format for errors that can be replied as JSON. * * The JSON output includes the following fields: * ```json * { * "errorCode": "specific-error-code", * "message": "Human readable error message" * } * ``` */ export declare class JsonReply extends UniffiAbstractObject implements JsonReplyLike { readonly [uniffiTypeNameSymbol] = "JsonReply"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toDebugString(): string; toString(): string; equals(other: JsonReply): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is JsonReply; } export interface OhttpErrorLike { } /** * @deprecated Use `OhttpErrorLike` instead. */ export type OhttpErrorInterface = OhttpErrorLike; export declare class OhttpError extends UniffiAbstractObject implements OhttpErrorLike { readonly [uniffiTypeNameSymbol] = "OhttpError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is OhttpError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): OhttpError; } export interface OhttpKeysLike { } /** * @deprecated Use `OhttpKeysLike` instead. */ export type OhttpKeysInterface = OhttpKeysLike; export declare class OhttpKeys extends UniffiAbstractObject implements OhttpKeysLike { readonly [uniffiTypeNameSymbol] = "OhttpKeys"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Decode an OHTTP KeyConfig */ static decode(bytes: ArrayBuffer): OhttpKeysLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is OhttpKeys; } export interface PjNotSupportedLike { } /** * @deprecated Use `PjNotSupportedLike` instead. */ export type PjNotSupportedInterface = PjNotSupportedLike; export declare class PjNotSupported extends UniffiAbstractObject implements PjNotSupportedLike { readonly [uniffiTypeNameSymbol] = "PjNotSupported"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; equals(other: PjNotSupported): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PjNotSupported; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): PjNotSupported; } export interface PjParamLike { /** * The receiver's ephemeral HPKE public key, as 33 compressed bytes. * * Stable for the lifetime of a receive session. Consumers use it to * deduplicate and resume sender sessions and to ensure a receiver key * is not reused across sessions, without parsing the endpoint fragment. */ receiverPubkey(): ArrayBuffer; } /** * @deprecated Use `PjParamLike` instead. */ export type PjParamInterface = PjParamLike; export declare class PjParam extends UniffiAbstractObject implements PjParamLike { readonly [uniffiTypeNameSymbol] = "PjParam"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * The receiver's ephemeral HPKE public key, as 33 compressed bytes. * * Stable for the lifetime of a receive session. Consumers use it to * deduplicate and resume sender sessions and to ensure a receiver key * is not reused across sessions, without parsing the endpoint fragment. */ receiverPubkey(): ArrayBuffer; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is PjParam; } export interface ReceiverBuilderLike { build(): InitialReceiveTransitionLike; withAmount(amountSats: bigint): ReceiverBuilderLike; withExpiration(expirationSecs: bigint): ReceiverBuilderLike; /** * Set the maximum effective fee rate the receiver is willing to pay for their own input/output contributions */ withMaxFeeRate(maxEffectiveFeeRateSatPerVb: bigint): ReceiverBuilderLike; } /** * @deprecated Use `ReceiverBuilderLike` instead. */ export type ReceiverBuilderInterface = ReceiverBuilderLike; export declare class ReceiverBuilder extends UniffiAbstractObject implements ReceiverBuilderLike { readonly [uniffiTypeNameSymbol] = "ReceiverBuilder"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; /** * Creates a new [`Initialized`] with the provided parameters. * * # Parameters * - `address`: The Bitcoin address for the payjoin session. * - `directory`: The URL of the store-and-forward payjoin directory. * - `ohttp_keys`: The OHTTP keys used for encrypting and decrypting HTTP requests and responses. * * # References * - [BIP 77: Payjoin Version 2: Serverless Payjoin](https://github.com/bitcoin/bips/blob/master/bip-0077.md) */ constructor(address: string, directory: string, ohttpKeys: OhttpKeysLike); build(): InitialReceiveTransitionLike; withAmount(amountSats: bigint): ReceiverBuilderLike; withExpiration(expirationSecs: bigint): ReceiverBuilderLike; /** * Set the maximum effective fee rate the receiver is willing to pay for their own input/output contributions */ withMaxFeeRate(maxEffectiveFeeRateSatPerVb: bigint): ReceiverBuilderLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverBuilder; } /** * Error that may occur when a receiver event log is replayed */ export interface ReceiverReplayErrorLike { /** * Returns `true` if the event log could not be replayed because the * session has expired. */ isExpired(): boolean; } /** * @deprecated Use `ReceiverReplayErrorLike` instead. */ export type ReceiverReplayErrorInterface = ReceiverReplayErrorLike; /** * Error that may occur when a receiver event log is replayed */ export declare class ReceiverReplayError extends UniffiAbstractObject implements ReceiverReplayErrorLike { readonly [uniffiTypeNameSymbol] = "ReceiverReplayError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Returns `true` if the event log could not be replayed because the * session has expired. */ isExpired(): boolean; toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverReplayError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): ReceiverReplayError; } export interface SerdeJsonErrorLike { } /** * @deprecated Use `SerdeJsonErrorLike` instead. */ export type SerdeJsonErrorInterface = SerdeJsonErrorLike; export declare class SerdeJsonError extends UniffiAbstractObject implements SerdeJsonErrorLike { readonly [uniffiTypeNameSymbol] = "SerdeJsonError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SerdeJsonError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): SerdeJsonError; } export interface ReceiverSessionEventLike { toJson(): string; } /** * @deprecated Use `ReceiverSessionEventLike` instead. */ export type ReceiverSessionEventInterface = ReceiverSessionEventLike; export declare class ReceiverSessionEvent extends UniffiAbstractObject implements ReceiverSessionEventLike { readonly [uniffiTypeNameSymbol] = "ReceiverSessionEvent"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); static fromJson(json: string): ReceiverSessionEventLike; toJson(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverSessionEvent; } /** * Represents the status of a session that can be inferred from the information in the session * event log. */ export interface ReceiverSessionStatusLike { } /** * @deprecated Use `ReceiverSessionStatusLike` instead. */ export type ReceiverSessionStatusInterface = ReceiverSessionStatusLike; /** * Represents the status of a session that can be inferred from the information in the session * event log. */ export declare class ReceiverSessionStatus extends UniffiAbstractObject implements ReceiverSessionStatusLike { readonly [uniffiTypeNameSymbol] = "ReceiverSessionStatus"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverSessionStatus; } export interface ReceiverSessionHistoryLike { /** * Fallback transaction from the session if present */ fallbackTx(): ArrayBuffer | undefined; /** * Receiver session Payjoin URI */ pjUri(): PjUriLike; /** * Helper method to query the current status of the session. */ status(): ReceiverSessionStatusLike; } /** * @deprecated Use `ReceiverSessionHistoryLike` instead. */ export type ReceiverSessionHistoryInterface = ReceiverSessionHistoryLike; export declare class ReceiverSessionHistory extends UniffiAbstractObject implements ReceiverSessionHistoryLike { readonly [uniffiTypeNameSymbol] = "ReceiverSessionHistory"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Fallback transaction from the session if present */ fallbackTx(): ArrayBuffer | undefined; /** * Receiver session Payjoin URI */ pjUri(): PjUriLike; /** * Helper method to query the current status of the session. */ status(): ReceiverSessionStatusLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReceiverSessionHistory; } export interface ReplayResultLike { sessionHistory(): ReceiverSessionHistoryLike; state(): ReceiveSession; } /** * @deprecated Use `ReplayResultLike` instead. */ export type ReplayResultInterface = ReplayResultLike; export declare class ReplayResult extends UniffiAbstractObject implements ReplayResultLike { readonly [uniffiTypeNameSymbol] = "ReplayResult"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); sessionHistory(): ReceiverSessionHistoryLike; state(): ReceiveSession; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is ReplayResult; } /** * Builder for sender-side payjoin parameters * * These parameters define how client wants to handle Payjoin. */ export interface SenderBuilderLike { /** * Disable output substitution even if the receiver didn't. * * This forbids receiver switching output or decreasing amount. * It is generally **not** recommended to set this as it may prevent the receiver from * doing advanced operations such as opening LN channels and it also guarantees the * receiver will **not** reward the sender with a discount. */ alwaysDisableOutputSubstitution(): SenderBuilderLike; /** * Perform Payjoin without incentivizing the payee to cooperate. * * While it's generally better to offer some contribution some users may wish not to. * This function disables contribution. */ buildNonIncentivizing(minFeeRateSatPerKwu: bigint): InitialSendTransitionLike; buildRecommended(minFeeRateSatPerKwu: bigint): InitialSendTransitionLike; /** * Offer the receiver contribution to pay for his input. * * These parameters will allow the receiver to take `max_fee_contribution_sats` from given change * output to pay for additional inputs. The recommended fee is `size_of_one_input * fee_rate`. * * `change_index` specifies which output can be used to pay fee. If `None` is provided, then * the output is auto-detected unless the supplied transaction has more than two outputs. * * `clamp_fee_contribution` decreases fee contribution instead of erroring. * * If this option is true and a transaction with change amount lower than fee * contribution is provided then instead of returning error the fee contribution will * be just lowered in the request to match the change amount. */ buildWithAdditionalFee(maxFeeContributionSats: bigint, changeIndex: number | undefined, minFeeRateSatPerKwu: bigint, clampFeeContribution: boolean): InitialSendTransitionLike; } /** * @deprecated Use `SenderBuilderLike` instead. */ export type SenderBuilderInterface = SenderBuilderLike; /** * Builder for sender-side payjoin parameters * * These parameters define how client wants to handle Payjoin. */ export declare class SenderBuilder extends UniffiAbstractObject implements SenderBuilderLike { readonly [uniffiTypeNameSymbol] = "SenderBuilder"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; /** * Prepare an HTTP request and request context to process the response * * Call [`SenderBuilder::build_recommended()`] or other `build` methods * to create a [`WithReplyKey`] */ constructor(psbt: string, uri: PjUriLike); /** * Disable output substitution even if the receiver didn't. * * This forbids receiver switching output or decreasing amount. * It is generally **not** recommended to set this as it may prevent the receiver from * doing advanced operations such as opening LN channels and it also guarantees the * receiver will **not** reward the sender with a discount. */ alwaysDisableOutputSubstitution(): SenderBuilderLike; /** * Perform Payjoin without incentivizing the payee to cooperate. * * While it's generally better to offer some contribution some users may wish not to. * This function disables contribution. */ buildNonIncentivizing(minFeeRateSatPerKwu: bigint): InitialSendTransitionLike; buildRecommended(minFeeRateSatPerKwu: bigint): InitialSendTransitionLike; /** * Offer the receiver contribution to pay for his input. * * These parameters will allow the receiver to take `max_fee_contribution_sats` from given change * output to pay for additional inputs. The recommended fee is `size_of_one_input * fee_rate`. * * `change_index` specifies which output can be used to pay fee. If `None` is provided, then * the output is auto-detected unless the supplied transaction has more than two outputs. * * `clamp_fee_contribution` decreases fee contribution instead of erroring. * * If this option is true and a transaction with change amount lower than fee * contribution is provided then instead of returning error the fee contribution will * be just lowered in the request to match the change amount. */ buildWithAdditionalFee(maxFeeContributionSats: bigint, changeIndex: number | undefined, minFeeRateSatPerKwu: bigint, clampFeeContribution: boolean): InitialSendTransitionLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderBuilder; } /** * Error that may occur when the sender session event log is replayed */ export interface SenderReplayErrorLike { /** * Returns `true` if the event log could not be replayed because the * session has expired. */ isExpired(): boolean; } /** * @deprecated Use `SenderReplayErrorLike` instead. */ export type SenderReplayErrorInterface = SenderReplayErrorLike; /** * Error that may occur when the sender session event log is replayed */ export declare class SenderReplayError extends UniffiAbstractObject implements SenderReplayErrorLike { readonly [uniffiTypeNameSymbol] = "SenderReplayError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Returns `true` if the event log could not be replayed because the * session has expired. */ isExpired(): boolean; toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderReplayError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): SenderReplayError; } /** * Represents the status of a session that can be inferred from the information in the session * event log. */ export interface SenderSessionStatusLike { } /** * @deprecated Use `SenderSessionStatusLike` instead. */ export type SenderSessionStatusInterface = SenderSessionStatusLike; /** * Represents the status of a session that can be inferred from the information in the session * event log. */ export declare class SenderSessionStatus extends UniffiAbstractObject implements SenderSessionStatusLike { readonly [uniffiTypeNameSymbol] = "SenderSessionStatus"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderSessionStatus; } export interface SenderSessionHistoryLike { /** * Fallback transaction from the session if present */ fallbackTx(): ArrayBuffer; pjParam(): PjParamLike; status(): SenderSessionStatusLike; } /** * @deprecated Use `SenderSessionHistoryLike` instead. */ export type SenderSessionHistoryInterface = SenderSessionHistoryLike; export declare class SenderSessionHistory extends UniffiAbstractObject implements SenderSessionHistoryLike { readonly [uniffiTypeNameSymbol] = "SenderSessionHistory"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Fallback transaction from the session if present */ fallbackTx(): ArrayBuffer; pjParam(): PjParamLike; status(): SenderSessionStatusLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderSessionHistory; } export interface SenderReplayResultLike { sessionHistory(): SenderSessionHistoryLike; state(): SendSession; } /** * @deprecated Use `SenderReplayResultLike` instead. */ export type SenderReplayResultInterface = SenderReplayResultLike; export declare class SenderReplayResult extends UniffiAbstractObject implements SenderReplayResultLike { readonly [uniffiTypeNameSymbol] = "SenderReplayResult"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); sessionHistory(): SenderSessionHistoryLike; state(): SendSession; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderReplayResult; } export interface SenderSessionEventLike { toJson(): string; } /** * @deprecated Use `SenderSessionEventLike` instead. */ export type SenderSessionEventInterface = SenderSessionEventLike; export declare class SenderSessionEvent extends UniffiAbstractObject implements SenderSessionEventLike { readonly [uniffiTypeNameSymbol] = "SenderSessionEvent"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); static fromJson(json: string): SenderSessionEventLike; toJson(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SenderSessionEvent; } /** * Error that may occur during a v2 session typestate change */ export interface SessionErrorLike { } /** * @deprecated Use `SessionErrorLike` instead. */ export type SessionErrorInterface = SessionErrorLike; /** * Error that may occur during a v2 session typestate change */ export declare class SessionError extends UniffiAbstractObject implements SessionErrorLike { readonly [uniffiTypeNameSymbol] = "SessionError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is SessionError; } export interface UriLike { address(): string; /** * Gets the amount in satoshis. */ amountSats(): bigint | undefined; asString(): string; checkPjSupported(): PjUriLike; label(): string | undefined; message(): string | undefined; } /** * @deprecated Use `UriLike` instead. */ export type UriInterface = UriLike; export declare class Uri extends UniffiAbstractObject implements UriLike { readonly [uniffiTypeNameSymbol] = "Uri"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); static parse(uri: string): UriLike; address(): string; /** * Gets the amount in satoshis. */ amountSats(): bigint | undefined; asString(): string; checkPjSupported(): PjUriLike; label(): string | undefined; message(): string | undefined; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Uri; } export interface UriParseErrorLike { } /** * @deprecated Use `UriParseErrorLike` instead. */ export type UriParseErrorInterface = UriParseErrorLike; export declare class UriParseError extends UniffiAbstractObject implements UriParseErrorLike { readonly [uniffiTypeNameSymbol] = "UriParseError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is UriParseError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): UriParseError; } export interface UrlLike { asString(): string; query(): string | undefined; } /** * @deprecated Use `UrlLike` instead. */ export type UrlInterface = UrlLike; export declare class Url extends UniffiAbstractObject implements UrlLike { readonly [uniffiTypeNameSymbol] = "Url"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); static parse(input: string): UrlLike; asString(): string; query(): string | undefined; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Url; } export interface UrlParseErrorLike { } /** * @deprecated Use `UrlParseErrorLike` instead. */ export type UrlParseErrorInterface = UrlParseErrorLike; export declare class UrlParseError extends UniffiAbstractObject implements UrlParseErrorLike { readonly [uniffiTypeNameSymbol] = "UrlParseError"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); toString(): string; toDebugString(): string; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is UrlParseError; static hasInner(obj_: any): obj_ is UniffiThrownObject; static getInner(err: UniffiThrownObject): UrlParseError; } /** * This should be called before anything else. * * It is likely that this is being done for you by the library's `index.ts`. * * It checks versions of uniffi between when the Rust scaffolding was generated * and when the bindings were generated. * * It also initializes the machinery to enable Rust to talk back to Javascript. */ declare function uniffiEnsureInitialized(): void; declare const _default: Readonly<{ initialize: typeof uniffiEnsureInitialized; converters: { FfiConverterTypeAddressParseError: FfiConverterObject; FfiConverterTypeAssumeInteractiveTransition: FfiConverterObject; FfiConverterTypeBroadcastedTransition: FfiConverterObject; FfiConverterTypeCanBroadcast: FfiConverterObjectWithCallbacks; FfiConverterTypeCancelTransition: FfiConverterObject; FfiConverterTypeClientResponse: FfiConverterObject; FfiConverterTypeCoinSelectionError: FfiConverterObject; FfiConverterTypeCoinSelectionError__as_error: FfiConverterObjectAsError; FfiConverterTypeCreateRequestError: FfiConverterObject; FfiConverterTypeCreateRequestError__as_error: FfiConverterObjectAsError; FfiConverterTypeDecapsulationError: FfiConverterObject; FfiConverterTypeErrorCode: { read(from: RustBuffer): ErrorCode; write(value: ErrorCode, into: RustBuffer): void; allocationSize(value: ErrorCode): number; lift(value: UniffiByteArray): ErrorCode; lower(value: ErrorCode, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeFeeRateError: FfiConverterObject; FfiConverterTypeFeeRateError__as_error: FfiConverterObjectAsError; FfiConverterTypeFfiValidationError: { read(from: RustBuffer): FfiValidationError; write(value: FfiValidationError, into: RustBuffer): void; allocationSize(value: FfiValidationError): number; lift(value: UniffiByteArray): FfiValidationError; lower(value: FfiValidationError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeForeignError: { read(from: RustBuffer): { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }; write(value: { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }, into: RustBuffer): void; allocationSize(value: { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }): number; lift(value: UniffiByteArray): { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }; lower(value: { readonly tag: ForeignError_Tags.InternalError; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ForeignError"; name: string; message: string; stack?: string; cause?: unknown; }, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeHasReplyableError: FfiConverterObject; FfiConverterTypeHasReplyableErrorTransition: FfiConverterObject; FfiConverterTypeImplementationError: FfiConverterObject; FfiConverterTypeInitialReceiveTransition: FfiConverterObject; FfiConverterTypeInitialSendTransition: FfiConverterObject; FfiConverterTypeInitialized: FfiConverterObject; FfiConverterTypeInitializedTransition: FfiConverterObject; FfiConverterTypeInitializedTransitionOutcome: { read(from: RustBuffer): InitializedTransitionOutcome; write(value: InitializedTransitionOutcome, into: RustBuffer): void; allocationSize(value: InitializedTransitionOutcome): number; lift(value: UniffiByteArray): InitializedTransitionOutcome; lower(value: InitializedTransitionOutcome, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeInputContributionError: FfiConverterObject; FfiConverterTypeInputContributionError__as_error: FfiConverterObjectAsError; FfiConverterTypeInputPair: FfiConverterObject; FfiConverterTypeInputPairError: { read(from: RustBuffer): InputPairError; write(value: InputPairError, into: RustBuffer): void; allocationSize(value: InputPairError): number; lift(value: UniffiByteArray): InputPairError; lower(value: InputPairError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeIntoUrlError: FfiConverterObject; FfiConverterTypeIsInputOwned: FfiConverterObjectWithCallbacks; FfiConverterTypeIsOutputKnown: FfiConverterObjectWithCallbacks; FfiConverterTypeIsScriptOwned: FfiConverterObjectWithCallbacks; FfiConverterTypeJsonReceiverSessionPersister: FfiConverterObjectWithCallbacks; FfiConverterTypeJsonReceiverSessionPersisterAsync: FfiConverterObjectWithCallbacks; FfiConverterTypeJsonReply: FfiConverterObject; FfiConverterTypeJsonSenderSessionPersister: FfiConverterObjectWithCallbacks; FfiConverterTypeJsonSenderSessionPersisterAsync: FfiConverterObjectWithCallbacks; FfiConverterTypeManualContributeResult: { read(from: RustBuffer): ManualContributeResult; write(value: ManualContributeResult, into: RustBuffer): void; allocationSize(value: ManualContributeResult): number; lift(value: UniffiByteArray): ManualContributeResult; lower(value: ManualContributeResult, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeManualFinalizeResult: { read(from: RustBuffer): ManualFinalizeResult; write(value: ManualFinalizeResult, into: RustBuffer): void; allocationSize(value: ManualFinalizeResult): number; lift(value: UniffiByteArray): ManualFinalizeResult; lower(value: ManualFinalizeResult, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeManualReceiveError: { read(from: RustBuffer): ManualReceiveError; write(value: ManualReceiveError, into: RustBuffer): void; allocationSize(value: ManualReceiveError): number; lift(value: UniffiByteArray): ManualReceiveError; lower(value: ManualReceiveError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeManualReceiverInput: { read(from: RustBuffer): ManualReceiverInput; write(value: ManualReceiverInput, into: RustBuffer): void; allocationSize(value: ManualReceiverInput): number; lift(value: UniffiByteArray): ManualReceiverInput; lower(value: ManualReceiverInput, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeMaybeInputsOwned: FfiConverterObject; FfiConverterTypeMaybeInputsOwnedTransition: FfiConverterObject; FfiConverterTypeMaybeInputsSeen: FfiConverterObject; FfiConverterTypeMaybeInputsSeenTransition: FfiConverterObject; FfiConverterTypeMonitor: FfiConverterObject; FfiConverterTypeMonitorTransition: FfiConverterObject; FfiConverterTypeOhttpError: FfiConverterObject; FfiConverterTypeOhttpError__as_error: FfiConverterObjectAsError; FfiConverterTypeOhttpKeys: FfiConverterObject; FfiConverterTypeOhttpKeysFetchError: { read(from: RustBuffer): { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }; write(value: { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }, into: RustBuffer): void; allocationSize(value: { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }): number; lift(value: UniffiByteArray): { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }; lower(value: { readonly tag: OhttpKeysFetchError_Tags.Fetch; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OhttpKeysFetchError"; name: string; message: string; stack?: string; cause?: unknown; }, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeOutPoint: { read(from: RustBuffer): OutPoint; write(value: OutPoint, into: RustBuffer): void; allocationSize(value: OutPoint): number; lift(value: UniffiByteArray): OutPoint; lower(value: OutPoint, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeOutputSubstitution: { read(from: RustBuffer): OutputSubstitution; write(value: OutputSubstitution, into: RustBuffer): void; allocationSize(value: OutputSubstitution): number; lift(value: UniffiByteArray): OutputSubstitution; lower(value: OutputSubstitution, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeOutputSubstitutionError: { read(from: RustBuffer): OutputSubstitutionError; write(value: OutputSubstitutionError, into: RustBuffer): void; allocationSize(value: OutputSubstitutionError): number; lift(value: UniffiByteArray): OutputSubstitutionError; lower(value: OutputSubstitutionError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeOutputSubstitutionProtocolError: FfiConverterObject; FfiConverterTypeOutputsUnknown: FfiConverterObject; FfiConverterTypeOutputsUnknownTransition: FfiConverterObject; FfiConverterTypePayjoinProposal: FfiConverterObject; FfiConverterTypePayjoinProposalTransition: FfiConverterObject; FfiConverterTypePendingFallbackTransition: FfiConverterObject; FfiConverterTypePjNotSupported: FfiConverterObject; FfiConverterTypePjNotSupported__as_error: FfiConverterObjectAsError; FfiConverterTypePjParam: FfiConverterObject; FfiConverterTypePjUri: FfiConverterObject; FfiConverterTypePollingForProposal: FfiConverterObject; FfiConverterTypePollingForProposalTransition: FfiConverterObject; FfiConverterTypePollingForProposalTransitionOutcome: { read(from: RustBuffer): PollingForProposalTransitionOutcome; write(value: PollingForProposalTransitionOutcome, into: RustBuffer): void; allocationSize(value: PollingForProposalTransitionOutcome): number; lift(value: UniffiByteArray): PollingForProposalTransitionOutcome; lower(value: PollingForProposalTransitionOutcome, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeProcessPsbt: FfiConverterObjectWithCallbacks; FfiConverterTypeProtocolError: FfiConverterObject; FfiConverterTypeProvisionalProposal: FfiConverterObject; FfiConverterTypeProvisionalProposalTransition: FfiConverterObject; FfiConverterTypePsbtInput: { read(from: RustBuffer): PsbtInput; write(value: PsbtInput, into: RustBuffer): void; allocationSize(value: PsbtInput): number; lift(value: UniffiByteArray): PsbtInput; lower(value: PsbtInput, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypePsbtInputError: FfiConverterObject; FfiConverterTypePsbtParseError: { read(from: RustBuffer): { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }; write(value: { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }, into: RustBuffer): void; allocationSize(value: { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }): number; lift(value: UniffiByteArray): { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }; lower(value: { readonly tag: PsbtParseError_Tags.InvalidPsbt; readonly inner: Readonly<[string]>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "PsbtParseError"; name: string; message: string; stack?: string; cause?: unknown; }, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeReceiveSession: { read(from: RustBuffer): ReceiveSession; write(value: ReceiveSession, into: RustBuffer): void; allocationSize(value: ReceiveSession): number; lift(value: UniffiByteArray): ReceiveSession; lower(value: ReceiveSession, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeReceiverBuilder: FfiConverterObject; FfiConverterTypeReceiverBuilderError: { read(from: RustBuffer): ReceiverBuilderError; write(value: ReceiverBuilderError, into: RustBuffer): void; allocationSize(value: ReceiverBuilderError): number; lift(value: UniffiByteArray): ReceiverBuilderError; lower(value: ReceiverBuilderError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeReceiverCreateRequestError: FfiConverterObject; FfiConverterTypeReceiverCreateRequestError__as_error: FfiConverterObjectAsError; FfiConverterTypeReceiverError: { read(from: RustBuffer): ReceiverError; write(value: ReceiverError, into: RustBuffer): void; allocationSize(value: ReceiverError): number; lift(value: UniffiByteArray): ReceiverError; lower(value: ReceiverError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeReceiverPendingFallback: FfiConverterObject; FfiConverterTypeReceiverPersistedError: { read(from: RustBuffer): ReceiverPersistedError; write(value: ReceiverPersistedError, into: RustBuffer): void; allocationSize(value: ReceiverPersistedError): number; lift(value: UniffiByteArray): ReceiverPersistedError; lower(value: ReceiverPersistedError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeReceiverReplayError: FfiConverterObject; FfiConverterTypeReceiverReplayError__as_error: FfiConverterObjectAsError; FfiConverterTypeReceiverSessionEvent: FfiConverterObject; FfiConverterTypeReceiverSessionHistory: FfiConverterObject; FfiConverterTypeReceiverSessionOutcome: FfiConverterObject; FfiConverterTypeReceiverSessionStatus: FfiConverterObject; FfiConverterTypeReplayResult: FfiConverterObject; FfiConverterTypeRequest: { read(from: RustBuffer): Request; write(value: Request, into: RustBuffer): void; allocationSize(value: Request): number; lift(value: UniffiByteArray): Request; lower(value: Request, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeRequestOhttpContext: { read(from: RustBuffer): RequestOhttpContext; write(value: RequestOhttpContext, into: RustBuffer): void; allocationSize(value: RequestOhttpContext): number; lift(value: UniffiByteArray): RequestOhttpContext; lower(value: RequestOhttpContext, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeRequestResponse: { read(from: RustBuffer): RequestResponse; write(value: RequestResponse, into: RustBuffer): void; allocationSize(value: RequestResponse): number; lift(value: UniffiByteArray): RequestResponse; lower(value: RequestResponse, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeRequestV1Context: { read(from: RustBuffer): RequestV1Context; write(value: RequestV1Context, into: RustBuffer): void; allocationSize(value: RequestV1Context): number; lift(value: UniffiByteArray): RequestV1Context; lower(value: RequestV1Context, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeResponseError: { read(from: RustBuffer): ResponseError; write(value: ResponseError, into: RustBuffer): void; allocationSize(value: ResponseError): number; lift(value: UniffiByteArray): ResponseError; lower(value: ResponseError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSendSession: { read(from: RustBuffer): SendSession; write(value: SendSession, into: RustBuffer): void; allocationSize(value: SendSession): number; lift(value: UniffiByteArray): SendSession; lower(value: SendSession, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSenderBuilder: FfiConverterObject; FfiConverterTypeSenderBuilderError: FfiConverterObject; FfiConverterTypeSenderCancelTransition: FfiConverterObject; FfiConverterTypeSenderError: { read(from: RustBuffer): SenderError; write(value: SenderError, into: RustBuffer): void; allocationSize(value: SenderError): number; lift(value: UniffiByteArray): SenderError; lower(value: SenderError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSenderInputError: { read(from: RustBuffer): SenderInputError; write(value: SenderInputError, into: RustBuffer): void; allocationSize(value: SenderInputError): number; lift(value: UniffiByteArray): SenderInputError; lower(value: SenderInputError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSenderPendingFallback: FfiConverterObject; FfiConverterTypeSenderPersistedError: { read(from: RustBuffer): SenderPersistedError; write(value: SenderPersistedError, into: RustBuffer): void; allocationSize(value: SenderPersistedError): number; lift(value: UniffiByteArray): SenderPersistedError; lower(value: SenderPersistedError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSenderReplayError: FfiConverterObject; FfiConverterTypeSenderReplayError__as_error: FfiConverterObjectAsError; FfiConverterTypeSenderReplayResult: FfiConverterObject; FfiConverterTypeSenderSessionEvent: FfiConverterObject; FfiConverterTypeSenderSessionHistory: FfiConverterObject; FfiConverterTypeSenderSessionOutcome: FfiConverterObject; FfiConverterTypeSenderSessionStatus: FfiConverterObject; FfiConverterTypeSerdeJsonError: FfiConverterObject; FfiConverterTypeSerdeJsonError__as_error: FfiConverterObjectAsError; FfiConverterTypeSessionError: FfiConverterObject; FfiConverterTypeTransactionFinder: FfiConverterObjectWithCallbacks; FfiConverterTypeTxIn: { read(from: RustBuffer): TxIn; write(value: TxIn, into: RustBuffer): void; allocationSize(value: TxIn): number; lift(value: UniffiByteArray): TxIn; lower(value: TxIn, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeTxOut: { read(from: RustBuffer): TxOut; write(value: TxOut, into: RustBuffer): void; allocationSize(value: TxOut): number; lift(value: UniffiByteArray): TxOut; lower(value: TxOut, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeUncheckedOriginalPayload: FfiConverterObject; FfiConverterTypeUncheckedOriginalPayloadTransition: FfiConverterObject; FfiConverterTypeUri: FfiConverterObject; FfiConverterTypeUriParseError: FfiConverterObject; FfiConverterTypeUriParseError__as_error: FfiConverterObjectAsError; FfiConverterTypeUrl: FfiConverterObject; FfiConverterTypeUrlParseError: FfiConverterObject; FfiConverterTypeUrlParseError__as_error: FfiConverterObjectAsError; FfiConverterTypeV1Context: FfiConverterObject; FfiConverterTypeValidationError: FfiConverterObject; FfiConverterTypeWantsFeeRange: FfiConverterObject; FfiConverterTypeWantsFeeRangeTransition: FfiConverterObject; FfiConverterTypeWantsInputs: FfiConverterObject; FfiConverterTypeWantsInputsTransition: FfiConverterObject; FfiConverterTypeWantsOutputs: FfiConverterObject; FfiConverterTypeWantsOutputsTransition: FfiConverterObject; FfiConverterTypeWeight: { read(from: RustBuffer): Weight; write(value: Weight, into: RustBuffer): void; allocationSize(value: Weight): number; lift(value: UniffiByteArray): Weight; lower(value: Weight, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeWellKnownError: FfiConverterObject; FfiConverterTypeWithReplyKey: FfiConverterObject; FfiConverterTypeWithReplyKeyTransition: FfiConverterObject; }; }>; export default _default; //# sourceMappingURL=payjoin.d.ts.map