// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate. // Trust me, you don't want to mess with it! /* tslint:disable */ /* eslint-disable */ // @ts-nocheck import nativeModule, { type UniffiRustFutureContinuationCallback, type UniffiForeignFutureDroppedCallback, type UniffiForeignFutureDroppedCallbackStruct, type UniffiForeignFutureResultU8, type UniffiForeignFutureCompleteU8, type UniffiForeignFutureResultI8, type UniffiForeignFutureCompleteI8, type UniffiForeignFutureResultU16, type UniffiForeignFutureCompleteU16, type UniffiForeignFutureResultI16, type UniffiForeignFutureCompleteI16, type UniffiForeignFutureResultU32, type UniffiForeignFutureCompleteU32, type UniffiForeignFutureResultI32, type UniffiForeignFutureCompleteI32, type UniffiForeignFutureResultU64, type UniffiForeignFutureCompleteU64, type UniffiForeignFutureResultI64, type UniffiForeignFutureCompleteI64, type UniffiForeignFutureResultF32, type UniffiForeignFutureCompleteF32, type UniffiForeignFutureResultF64, type UniffiForeignFutureCompleteF64, type UniffiForeignFutureResultRustBuffer, type UniffiForeignFutureCompleteRustBuffer, type UniffiForeignFutureResultVoid, type UniffiForeignFutureCompleteVoid, type UniffiVTableCallbackInterfaceCustomOnchainWalletCallbacks, type UniffiVTableCallbackInterfaceBarkLogger, } from "./bark-ffi"; import { type FfiConverter, type UniffiByteArray, type UniffiGcObject, type UniffiHandle, type UniffiObjectFactory, type UniffiReferenceHolder, type UniffiRustCallStatus, AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterInt32, FfiConverterInt64, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt16, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, RustBuffer, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallWithError, uniffiTypeNameSymbol, variantOrdinalSymbol, } from "uniffi-bindgen-react-native"; // Get converters from the other files, if any. const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 })); const uniffiIsDebug = // @ts-ignore -- The process global might not be defined typeof process !== "object" || // @ts-ignore -- The process global might not be defined process?.env?.NODE_ENV !== "production" || false; // Public interface members begin here. /** * Extract a signed transaction from a PSBT * * Takes a base64-encoded PSBT and extracts the final signed transaction. * This is useful after signing a PSBT (e.g., from drain_exits) before broadcasting. * * # Arguments * * * `psbt_base64` - Base64-encoded PSBT string * * # Returns * * Hex-encoded signed transaction ready for broadcasting */ export function extractTxFromPsbt(psbtBase64: string): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_func_extract_tx_from_psbt( FfiConverterString.lower(psbtBase64), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Generate a new 12-word BIP39 mnemonic */ export function generateMnemonic(): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_func_generate_mnemonic( callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Validate an Ark address (basic format check only) * * This only validates the format of the address, not whether it belongs * to a specific Ark server. For full validation against a connected server, * use Wallet::validate_arkoor_address() instead. */ export function validateArkAddress(address: string): boolean /*throws*/ { return FfiConverterBool.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_func_validate_ark_address( FfiConverterString.lower(address), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Validate a BIP39 mnemonic phrase */ export function validateMnemonic(mnemonic: string): boolean /*throws*/ { return FfiConverterBool.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_func_validate_mnemonic( FfiConverterString.lower(mnemonic), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Install the foreign logger. * * On first call, installs the bridge with `log::set_logger`. Subsequent calls * will return an error. */ export function setLogger( logger: BarkLogger, maxLevel: LogLevel ): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_bark_ffi_fn_func_set_logger( FfiConverterTypeBarkLogger.lower(logger), FfiConverterTypeLogLevel.lower(maxLevel), callStatus ); }, /*liftString:*/ FfiConverterString.lift ); } export type AddressWithIndex = { address: string; index: /*u32*/ number; }; /** * Generated factory for {@link AddressWithIndex} record objects. */ export const AddressWithIndex = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeAddressWithIndex = (() => { type TypeName = AddressWithIndex; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { address: FfiConverterString.read(from), index: FfiConverterUInt32.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.address, into); FfiConverterUInt32.write(value.index, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.address) + FfiConverterUInt32.allocationSize(value.index) ); } } return new FFIConverter(); })(); export type ArkInfo = { network: Network; serverPubkey: string; roundIntervalSecs: /*u64*/ bigint; nbRoundNonces: /*u32*/ number; vtxoExitDelta: /*u32*/ number; vtxoExpiryDelta: /*u32*/ number; htlcSendExpiryDelta: /*u32*/ number; htlcExpiryDelta: /*u32*/ number; maxVtxoAmountSats?: /*u64*/ bigint; requiredBoardConfirmations: /*u32*/ number; maxUserInvoiceCltvDelta: /*u16*/ number; minBoardAmountSats: /*u64*/ bigint; lnReceiveAntiDosRequired: boolean; /** * Fee schedule as JSON string (contains board, offboard, refresh, lightning fees) */ feeScheduleJson: string; /** * Maximum exit depth (genesis chain length) allowed for a VTXO before the * server refuses to cosign further OOR transactions spending it. */ maxVtxoExitDepth: /*u16*/ number; }; /** * Generated factory for {@link ArkInfo} record objects. */ export const ArkInfo = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeArkInfo = (() => { type TypeName = ArkInfo; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { network: FfiConverterTypeNetwork.read(from), serverPubkey: FfiConverterString.read(from), roundIntervalSecs: FfiConverterUInt64.read(from), nbRoundNonces: FfiConverterUInt32.read(from), vtxoExitDelta: FfiConverterUInt32.read(from), vtxoExpiryDelta: FfiConverterUInt32.read(from), htlcSendExpiryDelta: FfiConverterUInt32.read(from), htlcExpiryDelta: FfiConverterUInt32.read(from), maxVtxoAmountSats: FfiConverterOptionalUInt64.read(from), requiredBoardConfirmations: FfiConverterUInt32.read(from), maxUserInvoiceCltvDelta: FfiConverterUInt16.read(from), minBoardAmountSats: FfiConverterUInt64.read(from), lnReceiveAntiDosRequired: FfiConverterBool.read(from), feeScheduleJson: FfiConverterString.read(from), maxVtxoExitDepth: FfiConverterUInt16.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterTypeNetwork.write(value.network, into); FfiConverterString.write(value.serverPubkey, into); FfiConverterUInt64.write(value.roundIntervalSecs, into); FfiConverterUInt32.write(value.nbRoundNonces, into); FfiConverterUInt32.write(value.vtxoExitDelta, into); FfiConverterUInt32.write(value.vtxoExpiryDelta, into); FfiConverterUInt32.write(value.htlcSendExpiryDelta, into); FfiConverterUInt32.write(value.htlcExpiryDelta, into); FfiConverterOptionalUInt64.write(value.maxVtxoAmountSats, into); FfiConverterUInt32.write(value.requiredBoardConfirmations, into); FfiConverterUInt16.write(value.maxUserInvoiceCltvDelta, into); FfiConverterUInt64.write(value.minBoardAmountSats, into); FfiConverterBool.write(value.lnReceiveAntiDosRequired, into); FfiConverterString.write(value.feeScheduleJson, into); FfiConverterUInt16.write(value.maxVtxoExitDepth, into); } allocationSize(value: TypeName): number { return ( FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterString.allocationSize(value.serverPubkey) + FfiConverterUInt64.allocationSize(value.roundIntervalSecs) + FfiConverterUInt32.allocationSize(value.nbRoundNonces) + FfiConverterUInt32.allocationSize(value.vtxoExitDelta) + FfiConverterUInt32.allocationSize(value.vtxoExpiryDelta) + FfiConverterUInt32.allocationSize(value.htlcSendExpiryDelta) + FfiConverterUInt32.allocationSize(value.htlcExpiryDelta) + FfiConverterOptionalUInt64.allocationSize(value.maxVtxoAmountSats) + FfiConverterUInt32.allocationSize(value.requiredBoardConfirmations) + FfiConverterUInt16.allocationSize(value.maxUserInvoiceCltvDelta) + FfiConverterUInt64.allocationSize(value.minBoardAmountSats) + FfiConverterBool.allocationSize(value.lnReceiveAntiDosRequired) + FfiConverterString.allocationSize(value.feeScheduleJson) + FfiConverterUInt16.allocationSize(value.maxVtxoExitDepth) ); } } return new FFIConverter(); })(); export type Balance = { spendableSats: /*u64*/ bigint; pendingInRoundSats: /*u64*/ bigint; pendingExitSats: /*u64*/ bigint; pendingLightningSendSats: /*u64*/ bigint; claimableLightningReceiveSats: /*u64*/ bigint; pendingBoardSats: /*u64*/ bigint; }; /** * Generated factory for {@link Balance} record objects. */ export const Balance = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeBalance = (() => { type TypeName = Balance; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { spendableSats: FfiConverterUInt64.read(from), pendingInRoundSats: FfiConverterUInt64.read(from), pendingExitSats: FfiConverterUInt64.read(from), pendingLightningSendSats: FfiConverterUInt64.read(from), claimableLightningReceiveSats: FfiConverterUInt64.read(from), pendingBoardSats: FfiConverterUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterUInt64.write(value.spendableSats, into); FfiConverterUInt64.write(value.pendingInRoundSats, into); FfiConverterUInt64.write(value.pendingExitSats, into); FfiConverterUInt64.write(value.pendingLightningSendSats, into); FfiConverterUInt64.write(value.claimableLightningReceiveSats, into); FfiConverterUInt64.write(value.pendingBoardSats, into); } allocationSize(value: TypeName): number { return ( FfiConverterUInt64.allocationSize(value.spendableSats) + FfiConverterUInt64.allocationSize(value.pendingInRoundSats) + FfiConverterUInt64.allocationSize(value.pendingExitSats) + FfiConverterUInt64.allocationSize(value.pendingLightningSendSats) + FfiConverterUInt64.allocationSize(value.claimableLightningReceiveSats) + FfiConverterUInt64.allocationSize(value.pendingBoardSats) ); } } return new FFIConverter(); })(); /** * Reference to a block in the blockchain */ export type BlockRef = { height: /*u32*/ number; hash: string; }; /** * Generated factory for {@link BlockRef} record objects. */ export const BlockRef = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeBlockRef = (() => { type TypeName = BlockRef; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { height: FfiConverterUInt32.read(from), hash: FfiConverterString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterUInt32.write(value.height, into); FfiConverterString.write(value.hash, into); } allocationSize(value: TypeName): number { return ( FfiConverterUInt32.allocationSize(value.height) + FfiConverterString.allocationSize(value.hash) ); } } return new FFIConverter(); })(); export type Config = { serverAddress: string; serverAccessToken?: string; esploraAddress?: string; bitcoindAddress?: string; bitcoindCookiefile?: string; bitcoindUser?: string; bitcoindPass?: string; network: Network; vtxoRefreshExpiryThreshold?: /*u32*/ number; vtxoExitMargin?: /*u16*/ number; htlcRecvClaimDelta?: /*u16*/ number; fallbackFeeRate?: /*u64*/ bigint; roundTxRequiredConfirmations?: /*u32*/ number; daemonSyncIntervalSecs?: /*u64*/ bigint; offboardRequiredConfirmations?: /*u32*/ number; daemonManualSync?: boolean; lightningReceiveClaimRetries?: /*u8*/ number; }; /** * Generated factory for {@link Config} record objects. */ export const Config = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeConfig = (() => { type TypeName = Config; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { serverAddress: FfiConverterString.read(from), serverAccessToken: FfiConverterOptionalString.read(from), esploraAddress: FfiConverterOptionalString.read(from), bitcoindAddress: FfiConverterOptionalString.read(from), bitcoindCookiefile: FfiConverterOptionalString.read(from), bitcoindUser: FfiConverterOptionalString.read(from), bitcoindPass: FfiConverterOptionalString.read(from), network: FfiConverterTypeNetwork.read(from), vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt32.read(from), vtxoExitMargin: FfiConverterOptionalUInt16.read(from), htlcRecvClaimDelta: FfiConverterOptionalUInt16.read(from), fallbackFeeRate: FfiConverterOptionalUInt64.read(from), roundTxRequiredConfirmations: FfiConverterOptionalUInt32.read(from), daemonSyncIntervalSecs: FfiConverterOptionalUInt64.read(from), offboardRequiredConfirmations: FfiConverterOptionalUInt32.read(from), daemonManualSync: FfiConverterOptionalBool.read(from), lightningReceiveClaimRetries: FfiConverterOptionalUInt8.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.serverAddress, into); FfiConverterOptionalString.write(value.serverAccessToken, into); FfiConverterOptionalString.write(value.esploraAddress, into); FfiConverterOptionalString.write(value.bitcoindAddress, into); FfiConverterOptionalString.write(value.bitcoindCookiefile, into); FfiConverterOptionalString.write(value.bitcoindUser, into); FfiConverterOptionalString.write(value.bitcoindPass, into); FfiConverterTypeNetwork.write(value.network, into); FfiConverterOptionalUInt32.write(value.vtxoRefreshExpiryThreshold, into); FfiConverterOptionalUInt16.write(value.vtxoExitMargin, into); FfiConverterOptionalUInt16.write(value.htlcRecvClaimDelta, into); FfiConverterOptionalUInt64.write(value.fallbackFeeRate, into); FfiConverterOptionalUInt32.write( value.roundTxRequiredConfirmations, into ); FfiConverterOptionalUInt64.write(value.daemonSyncIntervalSecs, into); FfiConverterOptionalUInt32.write( value.offboardRequiredConfirmations, into ); FfiConverterOptionalBool.write(value.daemonManualSync, into); FfiConverterOptionalUInt8.write(value.lightningReceiveClaimRetries, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.serverAddress) + FfiConverterOptionalString.allocationSize(value.serverAccessToken) + FfiConverterOptionalString.allocationSize(value.esploraAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindCookiefile) + FfiConverterOptionalString.allocationSize(value.bitcoindUser) + FfiConverterOptionalString.allocationSize(value.bitcoindPass) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterOptionalUInt32.allocationSize( value.vtxoRefreshExpiryThreshold ) + FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) + FfiConverterOptionalUInt16.allocationSize(value.htlcRecvClaimDelta) + FfiConverterOptionalUInt64.allocationSize(value.fallbackFeeRate) + FfiConverterOptionalUInt32.allocationSize( value.roundTxRequiredConfirmations ) + FfiConverterOptionalUInt64.allocationSize( value.daemonSyncIntervalSecs ) + FfiConverterOptionalUInt32.allocationSize( value.offboardRequiredConfirmations ) + FfiConverterOptionalBool.allocationSize(value.daemonManualSync) + FfiConverterOptionalUInt8.allocationSize( value.lightningReceiveClaimRetries ) ); } } return new FFIConverter(); })(); /** * Parameters for creating a CPFP (Child Pays For Parent) transaction */ export type CpfpParams = { txHex: string; feesType: string; effectiveFeeRateSatPerVb: /*u64*/ bigint; currentPackageFeeSats?: /*u64*/ bigint; }; /** * Generated factory for {@link CpfpParams} record objects. */ export const CpfpParams = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeCpfpParams = (() => { type TypeName = CpfpParams; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { txHex: FfiConverterString.read(from), feesType: FfiConverterString.read(from), effectiveFeeRateSatPerVb: FfiConverterUInt64.read(from), currentPackageFeeSats: FfiConverterOptionalUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.txHex, into); FfiConverterString.write(value.feesType, into); FfiConverterUInt64.write(value.effectiveFeeRateSatPerVb, into); FfiConverterOptionalUInt64.write(value.currentPackageFeeSats, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.txHex) + FfiConverterString.allocationSize(value.feesType) + FfiConverterUInt64.allocationSize(value.effectiveFeeRateSatPerVb) + FfiConverterOptionalUInt64.allocationSize(value.currentPackageFeeSats) ); } } return new FFIConverter(); })(); /** * A Bitcoin transaction output destination */ export type Destination = { address: string; amountSats: /*u64*/ bigint; }; /** * Generated factory for {@link Destination} record objects. */ export const Destination = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeDestination = (() => { type TypeName = Destination; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { address: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.address, into); FfiConverterUInt64.write(value.amountSats, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.address) + FfiConverterUInt64.allocationSize(value.amountSats) ); } } return new FFIConverter(); })(); /** * Claim transaction for exited funds */ export type ExitClaimTransaction = { psbtBase64: string; feeSats: /*u64*/ bigint; }; /** * Generated factory for {@link ExitClaimTransaction} record objects. */ export const ExitClaimTransaction = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord< ExitClaimTransaction, ReturnType >(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeExitClaimTransaction = (() => { type TypeName = ExitClaimTransaction; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { psbtBase64: FfiConverterString.read(from), feeSats: FfiConverterUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.psbtBase64, into); FfiConverterUInt64.write(value.feeSats, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.psbtBase64) + FfiConverterUInt64.allocationSize(value.feeSats) ); } } return new FFIConverter(); })(); /** * Status of an exit progression */ export type ExitProgressStatus = { vtxoId: string; state: string; error?: string; }; /** * Generated factory for {@link ExitProgressStatus} record objects. */ export const ExitProgressStatus = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeExitProgressStatus = (() => { type TypeName = ExitProgressStatus; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { vtxoId: FfiConverterString.read(from), state: FfiConverterString.read(from), error: FfiConverterOptionalString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.vtxoId, into); FfiConverterString.write(value.state, into); FfiConverterOptionalString.write(value.error, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.vtxoId) + FfiConverterString.allocationSize(value.state) + FfiConverterOptionalString.allocationSize(value.error) ); } } return new FFIConverter(); })(); /** * Detailed status of an exit transaction */ export type ExitTransactionStatus = { vtxoId: string; state: string; history?: Array; transactionCount: /*u32*/ number; }; /** * Generated factory for {@link ExitTransactionStatus} record objects. */ export const ExitTransactionStatus = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord< ExitTransactionStatus, ReturnType >(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeExitTransactionStatus = (() => { type TypeName = ExitTransactionStatus; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { vtxoId: FfiConverterString.read(from), state: FfiConverterString.read(from), history: FfiConverterOptionalArrayString.read(from), transactionCount: FfiConverterUInt32.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.vtxoId, into); FfiConverterString.write(value.state, into); FfiConverterOptionalArrayString.write(value.history, into); FfiConverterUInt32.write(value.transactionCount, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.vtxoId) + FfiConverterString.allocationSize(value.state) + FfiConverterOptionalArrayString.allocationSize(value.history) + FfiConverterUInt32.allocationSize(value.transactionCount) ); } } return new FFIConverter(); })(); /** * A VTXO that is being unilaterally exited */ export type ExitVtxo = { vtxoId: string; amountSats: /*u64*/ bigint; state: string; isClaimable: boolean; }; /** * Generated factory for {@link ExitVtxo} record objects. */ export const ExitVtxo = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeExitVtxo = (() => { type TypeName = ExitVtxo; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { vtxoId: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), state: FfiConverterString.read(from), isClaimable: FfiConverterBool.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.vtxoId, into); FfiConverterUInt64.write(value.amountSats, into); FfiConverterString.write(value.state, into); FfiConverterBool.write(value.isClaimable, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.vtxoId) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterString.allocationSize(value.state) + FfiConverterBool.allocationSize(value.isClaimable) ); } } return new FFIConverter(); })(); export type FeeEstimate = { grossAmountSats: /*u64*/ bigint; feeSats: /*u64*/ bigint; netAmountSats: /*u64*/ bigint; vtxosSpent: Array; }; /** * Generated factory for {@link FeeEstimate} record objects. */ export const FeeEstimate = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeFeeEstimate = (() => { type TypeName = FeeEstimate; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { grossAmountSats: FfiConverterUInt64.read(from), feeSats: FfiConverterUInt64.read(from), netAmountSats: FfiConverterUInt64.read(from), vtxosSpent: FfiConverterArrayString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterUInt64.write(value.grossAmountSats, into); FfiConverterUInt64.write(value.feeSats, into); FfiConverterUInt64.write(value.netAmountSats, into); FfiConverterArrayString.write(value.vtxosSpent, into); } allocationSize(value: TypeName): number { return ( FfiConverterUInt64.allocationSize(value.grossAmountSats) + FfiConverterUInt64.allocationSize(value.feeSats) + FfiConverterUInt64.allocationSize(value.netAmountSats) + FfiConverterArrayString.allocationSize(value.vtxosSpent) ); } } return new FFIConverter(); })(); export type LightningInvoice = { invoice: string; paymentHash: string; amountSats: /*u64*/ bigint; }; /** * Generated factory for {@link LightningInvoice} record objects. */ export const LightningInvoice = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeLightningInvoice = (() => { type TypeName = LightningInvoice; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { invoice: FfiConverterString.read(from), paymentHash: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.invoice, into); FfiConverterString.write(value.paymentHash, into); FfiConverterUInt64.write(value.amountSats, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.invoice) + FfiConverterString.allocationSize(value.paymentHash) + FfiConverterUInt64.allocationSize(value.amountSats) ); } } return new FFIConverter(); })(); export type LightningReceive = { paymentHash: string; paymentPreimage: string; invoice: string; amountSats: /*u64*/ bigint; hasHtlcVtxos: boolean; preimageRevealed: boolean; }; /** * Generated factory for {@link LightningReceive} record objects. */ export const LightningReceive = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeLightningReceive = (() => { type TypeName = LightningReceive; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { paymentHash: FfiConverterString.read(from), paymentPreimage: FfiConverterString.read(from), invoice: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), hasHtlcVtxos: FfiConverterBool.read(from), preimageRevealed: FfiConverterBool.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.paymentHash, into); FfiConverterString.write(value.paymentPreimage, into); FfiConverterString.write(value.invoice, into); FfiConverterUInt64.write(value.amountSats, into); FfiConverterBool.write(value.hasHtlcVtxos, into); FfiConverterBool.write(value.preimageRevealed, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.paymentHash) + FfiConverterString.allocationSize(value.paymentPreimage) + FfiConverterString.allocationSize(value.invoice) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterBool.allocationSize(value.hasHtlcVtxos) + FfiConverterBool.allocationSize(value.preimageRevealed) ); } } return new FFIConverter(); })(); export type LightningSend = { invoice: string; /** * Amount being paid, in sats (`payment_amount`). */ amountSats: /*u64*/ bigint; /** * Routing/ark fee for the send, in sats. */ feeSats: /*u64*/ bigint; /** * Number of input VTXOs locked into the in-flight HTLC. */ htlcVtxoCount: /*u32*/ number; /** * Whether the send is stuck in the revocation-failed state: the payment * failed but revoking the HTLC also failed */ hasFailedRevocation: boolean; }; /** * Generated factory for {@link LightningSend} record objects. */ export const LightningSend = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeLightningSend = (() => { type TypeName = LightningSend; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { invoice: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), feeSats: FfiConverterUInt64.read(from), htlcVtxoCount: FfiConverterUInt32.read(from), hasFailedRevocation: FfiConverterBool.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.invoice, into); FfiConverterUInt64.write(value.amountSats, into); FfiConverterUInt64.write(value.feeSats, into); FfiConverterUInt32.write(value.htlcVtxoCount, into); FfiConverterBool.write(value.hasFailedRevocation, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.invoice) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterUInt64.allocationSize(value.feeSats) + FfiConverterUInt32.allocationSize(value.htlcVtxoCount) + FfiConverterBool.allocationSize(value.hasFailedRevocation) ); } } return new FFIConverter(); })(); export type Movement = { id: /*u32*/ number; status: string; subsystemName: string; subsystemKind: string; metadataJson: string; intendedBalanceSats: /*i64*/ bigint; effectiveBalanceSats: /*i64*/ bigint; offchainFeeSats: /*u64*/ bigint; sentToAddresses: Array; receivedOnAddresses: Array; inputVtxoIds: Array; outputVtxoIds: Array; exitedVtxoIds: Array; createdAt: string; updatedAt: string; completedAt?: string; paymentHash?: string; lightningInvoice?: string; lightningOffer?: string; }; /** * Generated factory for {@link Movement} record objects. */ export const Movement = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeMovement = (() => { type TypeName = Movement; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { id: FfiConverterUInt32.read(from), status: FfiConverterString.read(from), subsystemName: FfiConverterString.read(from), subsystemKind: FfiConverterString.read(from), metadataJson: FfiConverterString.read(from), intendedBalanceSats: FfiConverterInt64.read(from), effectiveBalanceSats: FfiConverterInt64.read(from), offchainFeeSats: FfiConverterUInt64.read(from), sentToAddresses: FfiConverterArrayString.read(from), receivedOnAddresses: FfiConverterArrayString.read(from), inputVtxoIds: FfiConverterArrayString.read(from), outputVtxoIds: FfiConverterArrayString.read(from), exitedVtxoIds: FfiConverterArrayString.read(from), createdAt: FfiConverterString.read(from), updatedAt: FfiConverterString.read(from), completedAt: FfiConverterOptionalString.read(from), paymentHash: FfiConverterOptionalString.read(from), lightningInvoice: FfiConverterOptionalString.read(from), lightningOffer: FfiConverterOptionalString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterUInt32.write(value.id, into); FfiConverterString.write(value.status, into); FfiConverterString.write(value.subsystemName, into); FfiConverterString.write(value.subsystemKind, into); FfiConverterString.write(value.metadataJson, into); FfiConverterInt64.write(value.intendedBalanceSats, into); FfiConverterInt64.write(value.effectiveBalanceSats, into); FfiConverterUInt64.write(value.offchainFeeSats, into); FfiConverterArrayString.write(value.sentToAddresses, into); FfiConverterArrayString.write(value.receivedOnAddresses, into); FfiConverterArrayString.write(value.inputVtxoIds, into); FfiConverterArrayString.write(value.outputVtxoIds, into); FfiConverterArrayString.write(value.exitedVtxoIds, into); FfiConverterString.write(value.createdAt, into); FfiConverterString.write(value.updatedAt, into); FfiConverterOptionalString.write(value.completedAt, into); FfiConverterOptionalString.write(value.paymentHash, into); FfiConverterOptionalString.write(value.lightningInvoice, into); FfiConverterOptionalString.write(value.lightningOffer, into); } allocationSize(value: TypeName): number { return ( FfiConverterUInt32.allocationSize(value.id) + FfiConverterString.allocationSize(value.status) + FfiConverterString.allocationSize(value.subsystemName) + FfiConverterString.allocationSize(value.subsystemKind) + FfiConverterString.allocationSize(value.metadataJson) + FfiConverterInt64.allocationSize(value.intendedBalanceSats) + FfiConverterInt64.allocationSize(value.effectiveBalanceSats) + FfiConverterUInt64.allocationSize(value.offchainFeeSats) + FfiConverterArrayString.allocationSize(value.sentToAddresses) + FfiConverterArrayString.allocationSize(value.receivedOnAddresses) + FfiConverterArrayString.allocationSize(value.inputVtxoIds) + FfiConverterArrayString.allocationSize(value.outputVtxoIds) + FfiConverterArrayString.allocationSize(value.exitedVtxoIds) + FfiConverterString.allocationSize(value.createdAt) + FfiConverterString.allocationSize(value.updatedAt) + FfiConverterOptionalString.allocationSize(value.completedAt) + FfiConverterOptionalString.allocationSize(value.paymentHash) + FfiConverterOptionalString.allocationSize(value.lightningInvoice) + FfiConverterOptionalString.allocationSize(value.lightningOffer) ); } } return new FFIConverter(); })(); export type OffboardResult = { roundId: string; }; /** * Generated factory for {@link OffboardResult} record objects. */ export const OffboardResult = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeOffboardResult = (() => { type TypeName = OffboardResult; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { roundId: FfiConverterString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.roundId, into); } allocationSize(value: TypeName): number { return FfiConverterString.allocationSize(value.roundId); } } return new FFIConverter(); })(); export type OnchainBalance = { confirmedSats: /*u64*/ bigint; pendingSats: /*u64*/ bigint; totalSats: /*u64*/ bigint; }; /** * Generated factory for {@link OnchainBalance} record objects. */ export const OnchainBalance = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeOnchainBalance = (() => { type TypeName = OnchainBalance; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { confirmedSats: FfiConverterUInt64.read(from), pendingSats: FfiConverterUInt64.read(from), totalSats: FfiConverterUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterUInt64.write(value.confirmedSats, into); FfiConverterUInt64.write(value.pendingSats, into); FfiConverterUInt64.write(value.totalSats, into); } allocationSize(value: TypeName): number { return ( FfiConverterUInt64.allocationSize(value.confirmedSats) + FfiConverterUInt64.allocationSize(value.pendingSats) + FfiConverterUInt64.allocationSize(value.totalSats) ); } } return new FFIConverter(); })(); /** * A Bitcoin transaction outpoint (reference to a previous output) */ export type OutPoint = { txid: string; vout: /*u32*/ number; }; /** * Generated factory for {@link OutPoint} record objects. */ export const OutPoint = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeOutPoint = (() => { type TypeName = OutPoint; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { txid: FfiConverterString.read(from), vout: FfiConverterUInt32.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.txid, into); FfiConverterUInt32.write(value.vout, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout) ); } } return new FFIConverter(); })(); export type PendingBoard = { vtxoId: string; amountSats: /*u64*/ bigint; txid: string; }; /** * Generated factory for {@link PendingBoard} record objects. */ export const PendingBoard = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypePendingBoard = (() => { type TypeName = PendingBoard; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { vtxoId: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), txid: FfiConverterString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.vtxoId, into); FfiConverterUInt64.write(value.amountSats, into); FfiConverterString.write(value.txid, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.vtxoId) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterString.allocationSize(value.txid) ); } } return new FFIConverter(); })(); /** * A pending round state */ export type RoundState = { id: /*u32*/ number; /** * Whether the round is ongoing */ ongoing: boolean; }; /** * Generated factory for {@link RoundState} record objects. */ export const RoundState = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeRoundState = (() => { type TypeName = RoundState; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { id: FfiConverterUInt32.read(from), ongoing: FfiConverterBool.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterUInt32.write(value.id, into); FfiConverterBool.write(value.ongoing, into); } allocationSize(value: TypeName): number { return ( FfiConverterUInt32.allocationSize(value.id) + FfiConverterBool.allocationSize(value.ongoing) ); } } return new FFIConverter(); })(); export type Vtxo = { id: string; amountSats: /*u64*/ bigint; expiryHeight: /*u32*/ number; kind: string; state: string; /** * Genesis chain length. Compare against `ArkInfo.max_vtxo_exit_depth` to * detect VTXOs nearing the server's OOR-cosign refusal threshold. */ exitDepth: /*u32*/ number; /** * Weight units of the unilateral exit transaction chain. Lets clients * estimate exit cost without loading the full genesis. */ exitTxWeightWu: /*u64*/ bigint; }; /** * Generated factory for {@link Vtxo} record objects. */ export const Vtxo = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>(defaults); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeVtxo = (() => { type TypeName = Vtxo; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { id: FfiConverterString.read(from), amountSats: FfiConverterUInt64.read(from), expiryHeight: FfiConverterUInt32.read(from), kind: FfiConverterString.read(from), state: FfiConverterString.read(from), exitDepth: FfiConverterUInt32.read(from), exitTxWeightWu: FfiConverterUInt64.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterString.write(value.id, into); FfiConverterUInt64.write(value.amountSats, into); FfiConverterUInt32.write(value.expiryHeight, into); FfiConverterString.write(value.kind, into); FfiConverterString.write(value.state, into); FfiConverterUInt32.write(value.exitDepth, into); FfiConverterUInt64.write(value.exitTxWeightWu, into); } allocationSize(value: TypeName): number { return ( FfiConverterString.allocationSize(value.id) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterUInt32.allocationSize(value.expiryHeight) + FfiConverterString.allocationSize(value.kind) + FfiConverterString.allocationSize(value.state) + FfiConverterUInt32.allocationSize(value.exitDepth) + FfiConverterUInt64.allocationSize(value.exitTxWeightWu) ); } } return new FFIConverter(); })(); export type WalletProperties = { network: Network; fingerprint: string; }; /** * Generated factory for {@link WalletProperties} record objects. */ export const WalletProperties = (() => { const defaults = () => ({}); const create = (() => { return uniffiCreateRecord>( defaults ); })(); return Object.freeze({ create, new: create, defaults: () => Object.freeze(defaults()) as Partial, }); })(); const FfiConverterTypeWalletProperties = (() => { type TypeName = WalletProperties; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { return { network: FfiConverterTypeNetwork.read(from), fingerprint: FfiConverterString.read(from), }; } write(value: TypeName, into: RustBuffer): void { FfiConverterTypeNetwork.write(value.network, into); FfiConverterString.write(value.fingerprint, into); } allocationSize(value: TypeName): number { return ( FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterString.allocationSize(value.fingerprint) ); } } return new FFIConverter(); })(); const stringConverter = { stringToBytes: (s: string) => uniffiCaller.rustCall((status) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer( s, status ) ), bytesToString: (ab: UniffiByteArray) => uniffiCaller.rustCall((status) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string( ab, status ) ), stringByteLength: (s: string) => uniffiCaller.rustCall((status) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length( s, status ) ), }; const FfiConverterString = uniffiCreateFfiConverterString(stringConverter); // Error type: BarkError // Enum: BarkError export enum BarkError_Tags { Network = "Network", Database = "Database", InvalidMnemonic = "InvalidMnemonic", InvalidAddress = "InvalidAddress", InvalidInvoice = "InvalidInvoice", InvalidPsbt = "InvalidPsbt", InvalidTransaction = "InvalidTransaction", InsufficientFunds = "InsufficientFunds", NotFound = "NotFound", ServerConnection = "ServerConnection", Internal = "Internal", OnchainWalletRequired = "OnchainWalletRequired", InvalidVtxoId = "InvalidVtxoId", ServerPubkeyChanged = "ServerPubkeyChanged", } /** * Error types that can occur when using the Bark wallet FFI */ export const BarkError = (() => { type Network__interface = { tag: BarkError_Tags.Network; inner: Readonly<{ errorMessage: string }>; }; class Network_ extends UniffiError implements Network__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.Network; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "Network"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): Network_ { return new Network_(inner); } static instanceOf(obj: any): obj is Network_ { return obj.tag === BarkError_Tags.Network; } static hasInner(obj: any): obj is Network_ { return Network_.instanceOf(obj); } static getInner(obj: Network_): Readonly<{ errorMessage: string }> { return obj.inner; } } type Database__interface = { tag: BarkError_Tags.Database; inner: Readonly<{ errorMessage: string }>; }; class Database_ extends UniffiError implements Database__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.Database; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "Database"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): Database_ { return new Database_(inner); } static instanceOf(obj: any): obj is Database_ { return obj.tag === BarkError_Tags.Database; } static hasInner(obj: any): obj is Database_ { return Database_.instanceOf(obj); } static getInner(obj: Database_): Readonly<{ errorMessage: string }> { return obj.inner; } } type InvalidMnemonic__interface = { tag: BarkError_Tags.InvalidMnemonic; inner: Readonly<{ errorMessage: string }>; }; class InvalidMnemonic_ extends UniffiError implements InvalidMnemonic__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InvalidMnemonic; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InvalidMnemonic"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InvalidMnemonic_ { return new InvalidMnemonic_(inner); } static instanceOf(obj: any): obj is InvalidMnemonic_ { return obj.tag === BarkError_Tags.InvalidMnemonic; } static hasInner(obj: any): obj is InvalidMnemonic_ { return InvalidMnemonic_.instanceOf(obj); } static getInner(obj: InvalidMnemonic_): Readonly<{ errorMessage: string }> { return obj.inner; } } type InvalidAddress__interface = { tag: BarkError_Tags.InvalidAddress; inner: Readonly<{ errorMessage: string }>; }; class InvalidAddress_ extends UniffiError implements InvalidAddress__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InvalidAddress; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InvalidAddress"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InvalidAddress_ { return new InvalidAddress_(inner); } static instanceOf(obj: any): obj is InvalidAddress_ { return obj.tag === BarkError_Tags.InvalidAddress; } static hasInner(obj: any): obj is InvalidAddress_ { return InvalidAddress_.instanceOf(obj); } static getInner(obj: InvalidAddress_): Readonly<{ errorMessage: string }> { return obj.inner; } } type InvalidInvoice__interface = { tag: BarkError_Tags.InvalidInvoice; inner: Readonly<{ errorMessage: string }>; }; class InvalidInvoice_ extends UniffiError implements InvalidInvoice__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InvalidInvoice; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InvalidInvoice"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InvalidInvoice_ { return new InvalidInvoice_(inner); } static instanceOf(obj: any): obj is InvalidInvoice_ { return obj.tag === BarkError_Tags.InvalidInvoice; } static hasInner(obj: any): obj is InvalidInvoice_ { return InvalidInvoice_.instanceOf(obj); } static getInner(obj: InvalidInvoice_): Readonly<{ errorMessage: string }> { return obj.inner; } } type InvalidPsbt__interface = { tag: BarkError_Tags.InvalidPsbt; inner: Readonly<{ errorMessage: string }>; }; class InvalidPsbt_ extends UniffiError implements InvalidPsbt__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InvalidPsbt; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InvalidPsbt"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InvalidPsbt_ { return new InvalidPsbt_(inner); } static instanceOf(obj: any): obj is InvalidPsbt_ { return obj.tag === BarkError_Tags.InvalidPsbt; } static hasInner(obj: any): obj is InvalidPsbt_ { return InvalidPsbt_.instanceOf(obj); } static getInner(obj: InvalidPsbt_): Readonly<{ errorMessage: string }> { return obj.inner; } } type InvalidTransaction__interface = { tag: BarkError_Tags.InvalidTransaction; inner: Readonly<{ errorMessage: string }>; }; class InvalidTransaction_ extends UniffiError implements InvalidTransaction__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InvalidTransaction; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InvalidTransaction"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InvalidTransaction_ { return new InvalidTransaction_(inner); } static instanceOf(obj: any): obj is InvalidTransaction_ { return obj.tag === BarkError_Tags.InvalidTransaction; } static hasInner(obj: any): obj is InvalidTransaction_ { return InvalidTransaction_.instanceOf(obj); } static getInner( obj: InvalidTransaction_ ): Readonly<{ errorMessage: string }> { return obj.inner; } } type InsufficientFunds__interface = { tag: BarkError_Tags.InsufficientFunds; inner: Readonly<{ errorMessage: string }>; }; class InsufficientFunds_ extends UniffiError implements InsufficientFunds__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InsufficientFunds; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InsufficientFunds"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InsufficientFunds_ { return new InsufficientFunds_(inner); } static instanceOf(obj: any): obj is InsufficientFunds_ { return obj.tag === BarkError_Tags.InsufficientFunds; } static hasInner(obj: any): obj is InsufficientFunds_ { return InsufficientFunds_.instanceOf(obj); } static getInner( obj: InsufficientFunds_ ): Readonly<{ errorMessage: string }> { return obj.inner; } } type NotFound__interface = { tag: BarkError_Tags.NotFound; inner: Readonly<{ errorMessage: string }>; }; class NotFound_ extends UniffiError implements NotFound__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.NotFound; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "NotFound"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): NotFound_ { return new NotFound_(inner); } static instanceOf(obj: any): obj is NotFound_ { return obj.tag === BarkError_Tags.NotFound; } static hasInner(obj: any): obj is NotFound_ { return NotFound_.instanceOf(obj); } static getInner(obj: NotFound_): Readonly<{ errorMessage: string }> { return obj.inner; } } type ServerConnection__interface = { tag: BarkError_Tags.ServerConnection; inner: Readonly<{ errorMessage: string }>; }; class ServerConnection_ extends UniffiError implements ServerConnection__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.ServerConnection; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "ServerConnection"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): ServerConnection_ { return new ServerConnection_(inner); } static instanceOf(obj: any): obj is ServerConnection_ { return obj.tag === BarkError_Tags.ServerConnection; } static hasInner(obj: any): obj is ServerConnection_ { return ServerConnection_.instanceOf(obj); } static getInner( obj: ServerConnection_ ): Readonly<{ errorMessage: string }> { return obj.inner; } } type Internal__interface = { tag: BarkError_Tags.Internal; inner: Readonly<{ errorMessage: string }>; }; class Internal_ extends UniffiError implements Internal__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.Internal; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "Internal"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): Internal_ { return new Internal_(inner); } static instanceOf(obj: any): obj is Internal_ { return obj.tag === BarkError_Tags.Internal; } static hasInner(obj: any): obj is Internal_ { return Internal_.instanceOf(obj); } static getInner(obj: Internal_): Readonly<{ errorMessage: string }> { return obj.inner; } } type OnchainWalletRequired__interface = { tag: BarkError_Tags.OnchainWalletRequired; inner: Readonly<{ errorMessage: string }>; }; class OnchainWalletRequired_ extends UniffiError implements OnchainWalletRequired__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.OnchainWalletRequired; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "OnchainWalletRequired"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): OnchainWalletRequired_ { return new OnchainWalletRequired_(inner); } static instanceOf(obj: any): obj is OnchainWalletRequired_ { return obj.tag === BarkError_Tags.OnchainWalletRequired; } static hasInner(obj: any): obj is OnchainWalletRequired_ { return OnchainWalletRequired_.instanceOf(obj); } static getInner( obj: OnchainWalletRequired_ ): Readonly<{ errorMessage: string }> { return obj.inner; } } type InvalidVtxoId__interface = { tag: BarkError_Tags.InvalidVtxoId; inner: Readonly<{ errorMessage: string }>; }; class InvalidVtxoId_ extends UniffiError implements InvalidVtxoId__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.InvalidVtxoId; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "InvalidVtxoId"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): InvalidVtxoId_ { return new InvalidVtxoId_(inner); } static instanceOf(obj: any): obj is InvalidVtxoId_ { return obj.tag === BarkError_Tags.InvalidVtxoId; } static hasInner(obj: any): obj is InvalidVtxoId_ { return InvalidVtxoId_.instanceOf(obj); } static getInner(obj: InvalidVtxoId_): Readonly<{ errorMessage: string }> { return obj.inner; } } type ServerPubkeyChanged__interface = { tag: BarkError_Tags.ServerPubkeyChanged; inner: Readonly<{ errorMessage: string }>; }; class ServerPubkeyChanged_ extends UniffiError implements ServerPubkeyChanged__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "BarkError"; readonly tag = BarkError_Tags.ServerPubkeyChanged; readonly inner: Readonly<{ errorMessage: string }>; constructor(inner: { errorMessage: string }) { super("BarkError", "ServerPubkeyChanged"); this.inner = Object.freeze(inner); } static new(inner: { errorMessage: string }): ServerPubkeyChanged_ { return new ServerPubkeyChanged_(inner); } static instanceOf(obj: any): obj is ServerPubkeyChanged_ { return obj.tag === BarkError_Tags.ServerPubkeyChanged; } static hasInner(obj: any): obj is ServerPubkeyChanged_ { return ServerPubkeyChanged_.instanceOf(obj); } static getInner( obj: ServerPubkeyChanged_ ): Readonly<{ errorMessage: string }> { return obj.inner; } } function instanceOf(obj: any): obj is BarkError { return obj[uniffiTypeNameSymbol] === "BarkError"; } return Object.freeze({ instanceOf, Network: Network_, Database: Database_, InvalidMnemonic: InvalidMnemonic_, InvalidAddress: InvalidAddress_, InvalidInvoice: InvalidInvoice_, InvalidPsbt: InvalidPsbt_, InvalidTransaction: InvalidTransaction_, InsufficientFunds: InsufficientFunds_, NotFound: NotFound_, ServerConnection: ServerConnection_, Internal: Internal_, OnchainWalletRequired: OnchainWalletRequired_, InvalidVtxoId: InvalidVtxoId_, ServerPubkeyChanged: ServerPubkeyChanged_, }); })(); /** * Error types that can occur when using the Bark wallet FFI */ export type BarkError = InstanceType< (typeof BarkError)[keyof Omit] >; // FfiConverter for enum BarkError const FfiConverterTypeBarkError = (() => { const ordinalConverter = FfiConverterInt32; type TypeName = BarkError; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { switch (ordinalConverter.read(from)) { case 1: return new BarkError.Network({ errorMessage: FfiConverterString.read(from), }); case 2: return new BarkError.Database({ errorMessage: FfiConverterString.read(from), }); case 3: return new BarkError.InvalidMnemonic({ errorMessage: FfiConverterString.read(from), }); case 4: return new BarkError.InvalidAddress({ errorMessage: FfiConverterString.read(from), }); case 5: return new BarkError.InvalidInvoice({ errorMessage: FfiConverterString.read(from), }); case 6: return new BarkError.InvalidPsbt({ errorMessage: FfiConverterString.read(from), }); case 7: return new BarkError.InvalidTransaction({ errorMessage: FfiConverterString.read(from), }); case 8: return new BarkError.InsufficientFunds({ errorMessage: FfiConverterString.read(from), }); case 9: return new BarkError.NotFound({ errorMessage: FfiConverterString.read(from), }); case 10: return new BarkError.ServerConnection({ errorMessage: FfiConverterString.read(from), }); case 11: return new BarkError.Internal({ errorMessage: FfiConverterString.read(from), }); case 12: return new BarkError.OnchainWalletRequired({ errorMessage: FfiConverterString.read(from), }); case 13: return new BarkError.InvalidVtxoId({ errorMessage: FfiConverterString.read(from), }); case 14: return new BarkError.ServerPubkeyChanged({ errorMessage: FfiConverterString.read(from), }); default: throw new UniffiInternalError.UnexpectedEnumCase(); } } write(value: TypeName, into: RustBuffer): void { switch (value.tag) { case BarkError_Tags.Network: { ordinalConverter.write(1, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.Database: { ordinalConverter.write(2, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InvalidMnemonic: { ordinalConverter.write(3, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InvalidAddress: { ordinalConverter.write(4, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InvalidInvoice: { ordinalConverter.write(5, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InvalidPsbt: { ordinalConverter.write(6, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InvalidTransaction: { ordinalConverter.write(7, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InsufficientFunds: { ordinalConverter.write(8, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.NotFound: { ordinalConverter.write(9, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.ServerConnection: { ordinalConverter.write(10, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.Internal: { ordinalConverter.write(11, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.OnchainWalletRequired: { ordinalConverter.write(12, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.InvalidVtxoId: { ordinalConverter.write(13, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } case BarkError_Tags.ServerPubkeyChanged: { ordinalConverter.write(14, into); const inner = value.inner; FfiConverterString.write(inner.errorMessage, into); return; } default: // Throwing from here means that BarkError_Tags hasn't matched an ordinal. throw new UniffiInternalError.UnexpectedEnumCase(); } } allocationSize(value: TypeName): number { switch (value.tag) { case BarkError_Tags.Network: { const inner = value.inner; let size = ordinalConverter.allocationSize(1); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.Database: { const inner = value.inner; let size = ordinalConverter.allocationSize(2); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InvalidMnemonic: { const inner = value.inner; let size = ordinalConverter.allocationSize(3); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InvalidAddress: { const inner = value.inner; let size = ordinalConverter.allocationSize(4); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InvalidInvoice: { const inner = value.inner; let size = ordinalConverter.allocationSize(5); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InvalidPsbt: { const inner = value.inner; let size = ordinalConverter.allocationSize(6); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InvalidTransaction: { const inner = value.inner; let size = ordinalConverter.allocationSize(7); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InsufficientFunds: { const inner = value.inner; let size = ordinalConverter.allocationSize(8); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.NotFound: { const inner = value.inner; let size = ordinalConverter.allocationSize(9); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.ServerConnection: { const inner = value.inner; let size = ordinalConverter.allocationSize(10); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.Internal: { const inner = value.inner; let size = ordinalConverter.allocationSize(11); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.OnchainWalletRequired: { const inner = value.inner; let size = ordinalConverter.allocationSize(12); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.InvalidVtxoId: { const inner = value.inner; let size = ordinalConverter.allocationSize(13); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } case BarkError_Tags.ServerPubkeyChanged: { const inner = value.inner; let size = ordinalConverter.allocationSize(14); size += FfiConverterString.allocationSize(inner.errorMessage); return size; } default: throw new UniffiInternalError.UnexpectedEnumCase(); } } } return new FFIConverter(); })(); // Enum: LightningSendStatus export enum LightningSendStatus_Tags { Unknown = "Unknown", InProgress = "InProgress", Paid = "Paid", } /** * Terminal/in-flight state of an outgoing lightning send. * * Mirrors `bark`'s `LightningSendState`. `pay_lightning_*` and * `check_lightning_payment` now return this so callers can drive the * crash-safe send flow themselves (initiate with `wait = false`, then poll). */ export const LightningSendStatus = (() => { type Unknown__interface = { tag: LightningSendStatus_Tags.Unknown; }; /** * No record of this payment (never started, or already pruned). */ class Unknown_ extends UniffiEnum implements Unknown__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "LightningSendStatus"; readonly tag = LightningSendStatus_Tags.Unknown; constructor() { super("LightningSendStatus", "Unknown"); } static new(): Unknown_ { return new Unknown_(); } static instanceOf(obj: any): obj is Unknown_ { return obj.tag === LightningSendStatus_Tags.Unknown; } } type InProgress__interface = { tag: LightningSendStatus_Tags.InProgress; inner: Readonly<{ send: LightningSend }>; }; /** * Send is in flight; HTLC VTXOs are locked. */ class InProgress_ extends UniffiEnum implements InProgress__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "LightningSendStatus"; readonly tag = LightningSendStatus_Tags.InProgress; readonly inner: Readonly<{ send: LightningSend }>; constructor(inner: { send: LightningSend }) { super("LightningSendStatus", "InProgress"); this.inner = Object.freeze(inner); } static new(inner: { send: LightningSend }): InProgress_ { return new InProgress_(inner); } static instanceOf(obj: any): obj is InProgress_ { return obj.tag === LightningSendStatus_Tags.InProgress; } } type Paid__interface = { tag: LightningSendStatus_Tags.Paid; inner: Readonly<{ paymentHash: string; preimage: string }>; }; /** * Send has settled; the preimage proves payment. */ class Paid_ extends UniffiEnum implements Paid__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "LightningSendStatus"; readonly tag = LightningSendStatus_Tags.Paid; readonly inner: Readonly<{ paymentHash: string; preimage: string }>; constructor(inner: { paymentHash: string; preimage: string }) { super("LightningSendStatus", "Paid"); this.inner = Object.freeze(inner); } static new(inner: { paymentHash: string; preimage: string }): Paid_ { return new Paid_(inner); } static instanceOf(obj: any): obj is Paid_ { return obj.tag === LightningSendStatus_Tags.Paid; } } function instanceOf(obj: any): obj is LightningSendStatus { return obj[uniffiTypeNameSymbol] === "LightningSendStatus"; } return Object.freeze({ instanceOf, Unknown: Unknown_, InProgress: InProgress_, Paid: Paid_, }); })(); /** * Terminal/in-flight state of an outgoing lightning send. * * Mirrors `bark`'s `LightningSendState`. `pay_lightning_*` and * `check_lightning_payment` now return this so callers can drive the * crash-safe send flow themselves (initiate with `wait = false`, then poll). */ export type LightningSendStatus = InstanceType< (typeof LightningSendStatus)[keyof Omit< typeof LightningSendStatus, "instanceOf" >] >; // FfiConverter for enum LightningSendStatus const FfiConverterTypeLightningSendStatus = (() => { const ordinalConverter = FfiConverterInt32; type TypeName = LightningSendStatus; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { switch (ordinalConverter.read(from)) { case 1: return new LightningSendStatus.Unknown(); case 2: return new LightningSendStatus.InProgress({ send: FfiConverterTypeLightningSend.read(from), }); case 3: return new LightningSendStatus.Paid({ paymentHash: FfiConverterString.read(from), preimage: FfiConverterString.read(from), }); default: throw new UniffiInternalError.UnexpectedEnumCase(); } } write(value: TypeName, into: RustBuffer): void { switch (value.tag) { case LightningSendStatus_Tags.Unknown: { ordinalConverter.write(1, into); return; } case LightningSendStatus_Tags.InProgress: { ordinalConverter.write(2, into); const inner = value.inner; FfiConverterTypeLightningSend.write(inner.send, into); return; } case LightningSendStatus_Tags.Paid: { ordinalConverter.write(3, into); const inner = value.inner; FfiConverterString.write(inner.paymentHash, into); FfiConverterString.write(inner.preimage, into); return; } default: // Throwing from here means that LightningSendStatus_Tags hasn't matched an ordinal. throw new UniffiInternalError.UnexpectedEnumCase(); } } allocationSize(value: TypeName): number { switch (value.tag) { case LightningSendStatus_Tags.Unknown: { return ordinalConverter.allocationSize(1); } case LightningSendStatus_Tags.InProgress: { const inner = value.inner; let size = ordinalConverter.allocationSize(2); size += FfiConverterTypeLightningSend.allocationSize(inner.send); return size; } case LightningSendStatus_Tags.Paid: { const inner = value.inner; let size = ordinalConverter.allocationSize(3); size += FfiConverterString.allocationSize(inner.paymentHash); size += FfiConverterString.allocationSize(inner.preimage); return size; } default: throw new UniffiInternalError.UnexpectedEnumCase(); } } } return new FFIConverter(); })(); /** * Severity of a log record. */ export enum LogLevel { Error, Warn, Info, Debug, Trace, } const FfiConverterTypeLogLevel = (() => { const ordinalConverter = FfiConverterInt32; type TypeName = LogLevel; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { switch (ordinalConverter.read(from)) { case 1: return LogLevel.Error; case 2: return LogLevel.Warn; case 3: return LogLevel.Info; case 4: return LogLevel.Debug; case 5: return LogLevel.Trace; default: throw new UniffiInternalError.UnexpectedEnumCase(); } } write(value: TypeName, into: RustBuffer): void { switch (value) { case LogLevel.Error: return ordinalConverter.write(1, into); case LogLevel.Warn: return ordinalConverter.write(2, into); case LogLevel.Info: return ordinalConverter.write(3, into); case LogLevel.Debug: return ordinalConverter.write(4, into); case LogLevel.Trace: return ordinalConverter.write(5, into); } } allocationSize(value: TypeName): number { return ordinalConverter.allocationSize(0); } } return new FFIConverter(); })(); export enum Network { Bitcoin, Testnet, Signet, Regtest, } const FfiConverterTypeNetwork = (() => { const ordinalConverter = FfiConverterInt32; type TypeName = Network; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { switch (ordinalConverter.read(from)) { case 1: return Network.Bitcoin; case 2: return Network.Testnet; case 3: return Network.Signet; case 4: return Network.Regtest; default: throw new UniffiInternalError.UnexpectedEnumCase(); } } write(value: TypeName, into: RustBuffer): void { switch (value) { case Network.Bitcoin: return ordinalConverter.write(1, into); case Network.Testnet: return ordinalConverter.write(2, into); case Network.Signet: return ordinalConverter.write(3, into); case Network.Regtest: return ordinalConverter.write(4, into); } } allocationSize(value: TypeName): number { return ordinalConverter.allocationSize(0); } } return new FFIConverter(); })(); // Enum: WalletNotification export enum WalletNotification_Tags { MovementCreated = "MovementCreated", MovementUpdated = "MovementUpdated", ChannelLagging = "ChannelLagging", } /** * A notification event from the wallet */ export const WalletNotification = (() => { type MovementCreated__interface = { tag: WalletNotification_Tags.MovementCreated; inner: Readonly<{ movement: Movement }>; }; /** * A new movement was created */ class MovementCreated_ extends UniffiEnum implements MovementCreated__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "WalletNotification"; readonly tag = WalletNotification_Tags.MovementCreated; readonly inner: Readonly<{ movement: Movement }>; constructor(inner: { movement: Movement }) { super("WalletNotification", "MovementCreated"); this.inner = Object.freeze(inner); } static new(inner: { movement: Movement }): MovementCreated_ { return new MovementCreated_(inner); } static instanceOf(obj: any): obj is MovementCreated_ { return obj.tag === WalletNotification_Tags.MovementCreated; } } type MovementUpdated__interface = { tag: WalletNotification_Tags.MovementUpdated; inner: Readonly<{ movement: Movement }>; }; /** * An existing movement was updated */ class MovementUpdated_ extends UniffiEnum implements MovementUpdated__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "WalletNotification"; readonly tag = WalletNotification_Tags.MovementUpdated; readonly inner: Readonly<{ movement: Movement }>; constructor(inner: { movement: Movement }) { super("WalletNotification", "MovementUpdated"); this.inner = Object.freeze(inner); } static new(inner: { movement: Movement }): MovementUpdated_ { return new MovementUpdated_(inner); } static instanceOf(obj: any): obj is MovementUpdated_ { return obj.tag === WalletNotification_Tags.MovementUpdated; } } type ChannelLagging__interface = { tag: WalletNotification_Tags.ChannelLagging; }; /** * The notification channel is lagging (notifications were dropped) */ class ChannelLagging_ extends UniffiEnum implements ChannelLagging__interface { /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol] = "WalletNotification"; readonly tag = WalletNotification_Tags.ChannelLagging; constructor() { super("WalletNotification", "ChannelLagging"); } static new(): ChannelLagging_ { return new ChannelLagging_(); } static instanceOf(obj: any): obj is ChannelLagging_ { return obj.tag === WalletNotification_Tags.ChannelLagging; } } function instanceOf(obj: any): obj is WalletNotification { return obj[uniffiTypeNameSymbol] === "WalletNotification"; } return Object.freeze({ instanceOf, MovementCreated: MovementCreated_, MovementUpdated: MovementUpdated_, ChannelLagging: ChannelLagging_, }); })(); /** * A notification event from the wallet */ export type WalletNotification = InstanceType< (typeof WalletNotification)[keyof Omit< typeof WalletNotification, "instanceOf" >] >; // FfiConverter for enum WalletNotification const FfiConverterTypeWalletNotification = (() => { const ordinalConverter = FfiConverterInt32; type TypeName = WalletNotification; class FFIConverter extends AbstractFfiConverterByteArray { read(from: RustBuffer): TypeName { switch (ordinalConverter.read(from)) { case 1: return new WalletNotification.MovementCreated({ movement: FfiConverterTypeMovement.read(from), }); case 2: return new WalletNotification.MovementUpdated({ movement: FfiConverterTypeMovement.read(from), }); case 3: return new WalletNotification.ChannelLagging(); default: throw new UniffiInternalError.UnexpectedEnumCase(); } } write(value: TypeName, into: RustBuffer): void { switch (value.tag) { case WalletNotification_Tags.MovementCreated: { ordinalConverter.write(1, into); const inner = value.inner; FfiConverterTypeMovement.write(inner.movement, into); return; } case WalletNotification_Tags.MovementUpdated: { ordinalConverter.write(2, into); const inner = value.inner; FfiConverterTypeMovement.write(inner.movement, into); return; } case WalletNotification_Tags.ChannelLagging: { ordinalConverter.write(3, into); return; } default: // Throwing from here means that WalletNotification_Tags hasn't matched an ordinal. throw new UniffiInternalError.UnexpectedEnumCase(); } } allocationSize(value: TypeName): number { switch (value.tag) { case WalletNotification_Tags.MovementCreated: { const inner = value.inner; let size = ordinalConverter.allocationSize(1); size += FfiConverterTypeMovement.allocationSize(inner.movement); return size; } case WalletNotification_Tags.MovementUpdated: { const inner = value.inner; let size = ordinalConverter.allocationSize(2); size += FfiConverterTypeMovement.allocationSize(inner.movement); return size; } case WalletNotification_Tags.ChannelLagging: { return ordinalConverter.allocationSize(3); } default: throw new UniffiInternalError.UnexpectedEnumCase(); } } } return new FFIConverter(); })(); /** * Foreign-implemented sink for log records. * * IMPORTANT: implementations must not call back into bark APIs that * themselves emit log records, or the foreign runtime may stack-overflow * or deadlock. */ export interface BarkLogger { log(level: LogLevel, target: string, message: string): void; } /** * Foreign-implemented sink for log records. * * IMPORTANT: implementations must not call back into bark APIs that * themselves emit log records, or the foreign runtime may stack-overflow * or deadlock. */ export class BarkLoggerImpl extends UniffiAbstractObject implements BarkLogger { readonly [uniffiTypeNameSymbol] = "BarkLoggerImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeBarkLoggerImplObjectFactory.bless(pointer); } log(level: LogLevel, target: string, message: string): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_bark_ffi_fn_method_barklogger_log( uniffiTypeBarkLoggerImplObjectFactory.clonePointer(this), FfiConverterTypeLogLevel.lower(level), FfiConverterString.lower(target), FfiConverterString.lower(message), callStatus ); }, /*liftString:*/ FfiConverterString.lift ); } /** * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} */ uniffiDestroy(): void { const ptr = (this as any)[destructorGuardSymbol]; if (ptr !== undefined) { const pointer = uniffiTypeBarkLoggerImplObjectFactory.pointer(this); uniffiTypeBarkLoggerImplObjectFactory.freePointer(pointer); uniffiTypeBarkLoggerImplObjectFactory.unbless(ptr); delete (this as any)[destructorGuardSymbol]; } } static instanceOf(obj: any): obj is BarkLoggerImpl { return uniffiTypeBarkLoggerImplObjectFactory.isConcreteType(obj); } } const uniffiTypeBarkLoggerImplObjectFactory: UniffiObjectFactory = (() => { return { create(pointer: UniffiHandle): BarkLogger { const instance = Object.create(BarkLoggerImpl.prototype); instance[pointerLiteralSymbol] = pointer; instance[destructorGuardSymbol] = this.bless(pointer); instance[uniffiTypeNameSymbol] = "BarkLoggerImpl"; return instance; }, bless(p: UniffiHandle): UniffiGcObject { return uniffiCaller.rustCall( /*caller:*/ (status) => nativeModule().ubrn_uniffi_internal_fn_method_barklogger_ffi__bless_pointer( p, status ), /*liftString:*/ FfiConverterString.lift ); }, unbless(ptr: UniffiGcObject) { ptr.markDestroyed(); }, pointer(obj: BarkLogger): UniffiHandle { if ((obj as any)[destructorGuardSymbol] === undefined) { throw new UniffiInternalError.UnexpectedNullPointer(); } return (obj as any)[pointerLiteralSymbol]; }, clonePointer(obj: BarkLogger): UniffiHandle { const pointer = this.pointer(obj); return uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_barklogger( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, freePointer(pointer: UniffiHandle): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_free_barklogger( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, isConcreteType(obj: any): obj is BarkLogger { return ( obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "BarkLoggerImpl" ); }, }; })(); // FfiConverter for BarkLogger const FfiConverterTypeBarkLogger = new FfiConverterObjectWithCallbacks( uniffiTypeBarkLoggerImplObjectFactory ); // Add a vtavble for the callbacks that go in BarkLogger. // Put the implementation in a struct so we don't pollute the top-level namespace const uniffiCallbackInterfaceBarkLogger: { vtable: UniffiVTableCallbackInterfaceBarkLogger; register: () => void; } = { // Create the VTable using a series of closures. // ts automatically converts these into C callback functions. vtable: { log: ( uniffiHandle: bigint, level: Uint8Array, target: Uint8Array, message: Uint8Array ) => { const uniffiMakeCall = (): void => { const jsCallback = FfiConverterTypeBarkLogger.lift(uniffiHandle); return jsCallback.log( FfiConverterTypeLogLevel.lift(level), FfiConverterString.lift(target), FfiConverterString.lift(message) ); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => {}; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCall( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, uniffiFree: (uniffiHandle: UniffiHandle): void => { // BarkLogger: this will throw a stale handle error if the handle isn't found. FfiConverterTypeBarkLogger.drop(uniffiHandle); }, uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { return FfiConverterTypeBarkLogger.clone(uniffiHandle); }, }, register: () => { nativeModule().ubrn_uniffi_bark_ffi_fn_init_callback_vtable_barklogger( uniffiCallbackInterfaceBarkLogger.vtable ); }, }; /** * Callback interface for custom onchain wallet implementations * * Foreign languages implement this trait to provide their own wallet functionality. */ export interface CustomOnchainWalletCallbacks { /** * Get the wallet balance in satoshis */ getBalance(): /*throws*/ /*u64*/ bigint; /** * Prepare a transaction to send to given destinations * * # Arguments * * `destinations` - List of destinations with addresses and amounts * * `fee_rate_sat_per_vb` - Fee rate in sats per vbyte * * # Returns * Base64-encoded PSBT */ prepareTx( destinations: Array, feeRateSatPerVb: /*u64*/ bigint ): /*throws*/ string; /** * Prepare a transaction that drains the wallet to a single address * * # Arguments * * `address` - Bitcoin address to drain to * * `fee_rate_sat_per_vb` - Fee rate in sats per vbyte * * # Returns * Base64-encoded PSBT */ prepareDrainTx( address: string, feeRateSatPerVb: /*u64*/ bigint ): /*throws*/ string; /** * Sign and finalize a PSBT * * # Arguments * * `psbt_base64` - Base64-encoded PSBT * * # Returns * Base64-encoded fully signed PSBT (all witnesses filled in) */ finishPsbt(psbtBase64: string): /*throws*/ string; /** * Get a wallet transaction by txid * * # Arguments * * `txid` - Transaction ID as hex string * * # Returns * Hex-encoded transaction, or null if not found */ getWalletTx(txid: string): /*throws*/ string | undefined; /** * Get the block hash where a transaction was confirmed * * # Arguments * * `txid` - Transaction ID as hex string * * # Returns * Block reference with height and hash, or null if unconfirmed */ getWalletTxConfirmedBlock(txid: string): /*throws*/ BlockRef | undefined; /** * Find transaction that spends a given output * * # Arguments * * `outpoint` - Transaction outpoint to check * * # Returns * Hex-encoded spending transaction, or null if unspent */ getSpendingTx(outpoint: OutPoint): /*throws*/ string | undefined; /** * Create a signed P2A CPFP transaction * * # Arguments * * `params` - CPFP transaction parameters * * # Returns * Hex-encoded signed CPFP transaction */ makeSignedP2aCpfp(params: CpfpParams): /*throws*/ string; /** * Store a signed P2A CPFP transaction in the wallet * * # Arguments * * `tx_hex` - Hex-encoded transaction */ storeSignedP2aCpfp(txHex: string): /*throws*/ void; } /** * Callback interface for custom onchain wallet implementations * * Foreign languages implement this trait to provide their own wallet functionality. */ export class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObject implements CustomOnchainWalletCallbacks { readonly [uniffiTypeNameSymbol] = "CustomOnchainWalletCallbacksImpl"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.bless(pointer); } /** * Get the wallet balance in satoshis */ getBalance(): /*u64*/ bigint /*throws*/ { return FfiConverterUInt64.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_balance( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Prepare a transaction to send to given destinations * * # Arguments * * `destinations` - List of destinations with addresses and amounts * * `fee_rate_sat_per_vb` - Fee rate in sats per vbyte * * # Returns * Base64-encoded PSBT */ prepareTx( destinations: Array, feeRateSatPerVb: /*u64*/ bigint ): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_prepare_tx( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterArrayTypeDestination.lower(destinations), FfiConverterUInt64.lower(feeRateSatPerVb), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Prepare a transaction that drains the wallet to a single address * * # Arguments * * `address` - Bitcoin address to drain to * * `fee_rate_sat_per_vb` - Fee rate in sats per vbyte * * # Returns * Base64-encoded PSBT */ prepareDrainTx( address: string, feeRateSatPerVb: /*u64*/ bigint ): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_prepare_drain_tx( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterString.lower(address), FfiConverterUInt64.lower(feeRateSatPerVb), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Sign and finalize a PSBT * * # Arguments * * `psbt_base64` - Base64-encoded PSBT * * # Returns * Base64-encoded fully signed PSBT (all witnesses filled in) */ finishPsbt(psbtBase64: string): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_finish_psbt( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterString.lower(psbtBase64), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Get a wallet transaction by txid * * # Arguments * * `txid` - Transaction ID as hex string * * # Returns * Hex-encoded transaction, or null if not found */ getWalletTx(txid: string): string | undefined /*throws*/ { return FfiConverterOptionalString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_wallet_tx( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterString.lower(txid), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Get the block hash where a transaction was confirmed * * # Arguments * * `txid` - Transaction ID as hex string * * # Returns * Block reference with height and hash, or null if unconfirmed */ getWalletTxConfirmedBlock(txid: string): BlockRef | undefined /*throws*/ { return FfiConverterOptionalTypeBlockRef.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterString.lower(txid), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Find transaction that spends a given output * * # Arguments * * `outpoint` - Transaction outpoint to check * * # Returns * Hex-encoded spending transaction, or null if unspent */ getSpendingTx(outpoint: OutPoint): string | undefined /*throws*/ { return FfiConverterOptionalString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_spending_tx( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterTypeOutPoint.lower(outpoint), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Create a signed P2A CPFP transaction * * # Arguments * * `params` - CPFP transaction parameters * * # Returns * Hex-encoded signed CPFP transaction */ makeSignedP2aCpfp(params: CpfpParams): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_make_signed_p2a_cpfp( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterTypeCpfpParams.lower(params), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * Store a signed P2A CPFP transaction in the wallet * * # Arguments * * `tx_hex` - Hex-encoded transaction */ storeSignedP2aCpfp(txHex: string): void /*throws*/ { uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_store_signed_p2a_cpfp( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer( this ), FfiConverterString.lower(txHex), callStatus ); }, /*liftString:*/ FfiConverterString.lift ); } /** * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} */ uniffiDestroy(): void { const ptr = (this as any)[destructorGuardSymbol]; if (ptr !== undefined) { const pointer = uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.pointer(this); uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.freePointer( pointer ); uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.unbless(ptr); delete (this as any)[destructorGuardSymbol]; } } static instanceOf(obj: any): obj is CustomOnchainWalletCallbacksImpl { return uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.isConcreteType( obj ); } } const uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory: UniffiObjectFactory = (() => { return { create(pointer: UniffiHandle): CustomOnchainWalletCallbacks { const instance = Object.create( CustomOnchainWalletCallbacksImpl.prototype ); instance[pointerLiteralSymbol] = pointer; instance[destructorGuardSymbol] = this.bless(pointer); instance[uniffiTypeNameSymbol] = "CustomOnchainWalletCallbacksImpl"; return instance; }, bless(p: UniffiHandle): UniffiGcObject { return uniffiCaller.rustCall( /*caller:*/ (status) => nativeModule().ubrn_uniffi_internal_fn_method_customonchainwalletcallbacks_ffi__bless_pointer( p, status ), /*liftString:*/ FfiConverterString.lift ); }, unbless(ptr: UniffiGcObject) { ptr.markDestroyed(); }, pointer(obj: CustomOnchainWalletCallbacks): UniffiHandle { if ((obj as any)[destructorGuardSymbol] === undefined) { throw new UniffiInternalError.UnexpectedNullPointer(); } return (obj as any)[pointerLiteralSymbol]; }, clonePointer(obj: CustomOnchainWalletCallbacks): UniffiHandle { const pointer = this.pointer(obj); return uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_customonchainwalletcallbacks( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, freePointer(pointer: UniffiHandle): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_free_customonchainwalletcallbacks( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, isConcreteType(obj: any): obj is CustomOnchainWalletCallbacks { return ( obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "CustomOnchainWalletCallbacksImpl" ); }, }; })(); // FfiConverter for CustomOnchainWalletCallbacks const FfiConverterTypeCustomOnchainWalletCallbacks = new FfiConverterObjectWithCallbacks( uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory ); // Add a vtavble for the callbacks that go in CustomOnchainWalletCallbacks. // Put the implementation in a struct so we don't pollute the top-level namespace const uniffiCallbackInterfaceCustomOnchainWalletCallbacks: { vtable: UniffiVTableCallbackInterfaceCustomOnchainWalletCallbacks; register: () => void; } = { // Create the VTable using a series of closures. // ts automatically converts these into C callback functions. vtable: { getBalance: (uniffiHandle: bigint) => { const uniffiMakeCall = (): /*u64*/ bigint => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.getBalance(); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess(uniffiResult, FfiConverterUInt64.lower(obj)); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, prepareTx: ( uniffiHandle: bigint, destinations: Uint8Array, feeRateSatPerVb: bigint ) => { const uniffiMakeCall = (): string => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.prepareTx( FfiConverterArrayTypeDestination.lift(destinations), FfiConverterUInt64.lift(feeRateSatPerVb) ); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj)); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, prepareDrainTx: ( uniffiHandle: bigint, address: Uint8Array, feeRateSatPerVb: bigint ) => { const uniffiMakeCall = (): string => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.prepareDrainTx( FfiConverterString.lift(address), FfiConverterUInt64.lift(feeRateSatPerVb) ); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj)); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, finishPsbt: (uniffiHandle: bigint, psbtBase64: Uint8Array) => { const uniffiMakeCall = (): string => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.finishPsbt(FfiConverterString.lift(psbtBase64)); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj)); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, getWalletTx: (uniffiHandle: bigint, txid: Uint8Array) => { const uniffiMakeCall = (): string | undefined => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.getWalletTx(FfiConverterString.lift(txid)); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess( uniffiResult, FfiConverterOptionalString.lower(obj) ); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, getWalletTxConfirmedBlock: (uniffiHandle: bigint, txid: Uint8Array) => { const uniffiMakeCall = (): BlockRef | undefined => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.getWalletTxConfirmedBlock( FfiConverterString.lift(txid) ); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess( uniffiResult, FfiConverterOptionalTypeBlockRef.lower(obj) ); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, getSpendingTx: (uniffiHandle: bigint, outpoint: Uint8Array) => { const uniffiMakeCall = (): string | undefined => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.getSpendingTx( FfiConverterTypeOutPoint.lift(outpoint) ); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess( uniffiResult, FfiConverterOptionalString.lower(obj) ); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, makeSignedP2aCpfp: (uniffiHandle: bigint, params: Uint8Array) => { const uniffiMakeCall = (): string => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.makeSignedP2aCpfp( FfiConverterTypeCpfpParams.lift(params) ); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => { UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj)); }; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, storeSignedP2aCpfp: (uniffiHandle: bigint, txHex: Uint8Array) => { const uniffiMakeCall = (): void => { const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle); return jsCallback.storeSignedP2aCpfp(FfiConverterString.lift(txHex)); }; const uniffiResult = UniffiResult.ready(); const uniffiHandleSuccess = (obj: any) => {}; const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => { UniffiResult.writeError(uniffiResult, code, errBuf); }; uniffiTraitInterfaceCallWithError( /*makeCall:*/ uniffiMakeCall, /*handleSuccess:*/ uniffiHandleSuccess, /*handleError:*/ uniffiHandleError, /*isErrorType:*/ BarkError.instanceOf, /*lowerError:*/ FfiConverterTypeBarkError.lower.bind( FfiConverterTypeBarkError ), /*lowerString:*/ FfiConverterString.lower ); return uniffiResult; }, uniffiFree: (uniffiHandle: UniffiHandle): void => { // CustomOnchainWalletCallbacks: this will throw a stale handle error if the handle isn't found. FfiConverterTypeCustomOnchainWalletCallbacks.drop(uniffiHandle); }, uniffiClone: (uniffiHandle: UniffiHandle): UniffiHandle => { return FfiConverterTypeCustomOnchainWalletCallbacks.clone(uniffiHandle); }, }, register: () => { nativeModule().ubrn_uniffi_bark_ffi_fn_init_callback_vtable_customonchainwalletcallbacks( uniffiCallbackInterfaceCustomOnchainWalletCallbacks.vtable ); }, }; /** * Pull-based notification handle exposed over FFI. * * Obtain via `Wallet::notifications()`. Call `next_notification()` in a loop * to receive events. Call `cancel_next_notification_wait()` to unblock a * pending wait without destroying the underlying stream. * * Each call to `Wallet::notifications()` creates an independent stream backed * by a new broadcast receiver — existing holders are unaffected. * * This holder is intended for a single consumer loop. Concurrent calls to * `next_notification()` on the same holder are not supported and will return * `None` immediately. */ export interface NotificationHolderLike { /** * Cancel the currently pending `next_notification()` wait. * * Causes a blocked `next_notification()` to return `None`. * Has no effect if no wait is currently active. * * This does NOT destroy the underlying `NotificationStream`; a subsequent * call to `next_notification()` will work normally and wait for new events. */ cancelNextNotificationWait(): void; /** * Wait for the next wallet notification. * * Returns `None` when: * - `cancel_next_notification_wait()` was called while this was pending * (cancellation only affects the current wait; the stream lives on) * - The wallet's notification source was shut down permanently * * Returns `Err(BarkError::Internal)` if called concurrently on the same holder. * * After a cancellation this method can be called again normally — the * underlying `NotificationStream` is preserved in `self.stream` and a * fresh per-wait cancel channel is created on every entry. */ nextNotification(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; } /** * @deprecated Use `NotificationHolderLike` instead. */ export type NotificationHolderInterface = NotificationHolderLike; /** * Pull-based notification handle exposed over FFI. * * Obtain via `Wallet::notifications()`. Call `next_notification()` in a loop * to receive events. Call `cancel_next_notification_wait()` to unblock a * pending wait without destroying the underlying stream. * * Each call to `Wallet::notifications()` creates an independent stream backed * by a new broadcast receiver — existing holders are unaffected. * * This holder is intended for a single consumer loop. Concurrent calls to * `next_notification()` on the same holder are not supported and will return * `None` immediately. */ export class NotificationHolder extends UniffiAbstractObject implements NotificationHolderLike { readonly [uniffiTypeNameSymbol] = "NotificationHolder"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeNotificationHolderObjectFactory.bless(pointer); } /** * Cancel the currently pending `next_notification()` wait. * * Causes a blocked `next_notification()` to return `None`. * Has no effect if no wait is currently active. * * This does NOT destroy the underlying `NotificationStream`; a subsequent * call to `next_notification()` will work normally and wait for new events. */ cancelNextNotificationWait(): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => { nativeModule().ubrn_uniffi_bark_ffi_fn_method_notificationholder_cancel_next_notification_wait( uniffiTypeNotificationHolderObjectFactory.clonePointer(this), callStatus ); }, /*liftString:*/ FfiConverterString.lift ); } /** * Wait for the next wallet notification. * * Returns `None` when: * - `cancel_next_notification_wait()` was called while this was pending * (cancellation only affects the current wait; the stream lives on) * - The wallet's notification source was shut down permanently * * Returns `Err(BarkError::Internal)` if called concurrently on the same holder. * * After a cancellation this method can be called again normally — the * underlying `NotificationStream` is preserved in `self.stream` and a * fresh per-wait cancel channel is created on every entry. */ async nextNotification(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_notificationholder_next_notification( uniffiTypeNotificationHolderObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalTypeWalletNotification.lift.bind( FfiConverterOptionalTypeWalletNotification ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } /** * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} */ uniffiDestroy(): void { const ptr = (this as any)[destructorGuardSymbol]; if (ptr !== undefined) { const pointer = uniffiTypeNotificationHolderObjectFactory.pointer(this); uniffiTypeNotificationHolderObjectFactory.freePointer(pointer); uniffiTypeNotificationHolderObjectFactory.unbless(ptr); delete (this as any)[destructorGuardSymbol]; } } static instanceOf(obj: any): obj is NotificationHolder { return uniffiTypeNotificationHolderObjectFactory.isConcreteType(obj); } } const uniffiTypeNotificationHolderObjectFactory: UniffiObjectFactory = (() => { return { create(pointer: UniffiHandle): NotificationHolderLike { const instance = Object.create(NotificationHolder.prototype); instance[pointerLiteralSymbol] = pointer; instance[destructorGuardSymbol] = this.bless(pointer); instance[uniffiTypeNameSymbol] = "NotificationHolder"; return instance; }, bless(p: UniffiHandle): UniffiGcObject { return uniffiCaller.rustCall( /*caller:*/ (status) => nativeModule().ubrn_uniffi_internal_fn_method_notificationholder_ffi__bless_pointer( p, status ), /*liftString:*/ FfiConverterString.lift ); }, unbless(ptr: UniffiGcObject) { ptr.markDestroyed(); }, pointer(obj: NotificationHolderLike): UniffiHandle { if ((obj as any)[destructorGuardSymbol] === undefined) { throw new UniffiInternalError.UnexpectedNullPointer(); } return (obj as any)[pointerLiteralSymbol]; }, clonePointer(obj: NotificationHolderLike): UniffiHandle { const pointer = this.pointer(obj); return uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_notificationholder( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, freePointer(pointer: UniffiHandle): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_free_notificationholder( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, isConcreteType(obj: any): obj is NotificationHolderLike { return ( obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "NotificationHolder" ); }, }; })(); // FfiConverter for NotificationHolderLike const FfiConverterTypeNotificationHolder = new FfiConverterObject( uniffiTypeNotificationHolderObjectFactory ); /** * UniFFI-facing onchain wallet. Supports two backends: * - BDK (real onchain wallet via `bark::onchain::OnchainWallet`) * - Callback (foreign-language implementation) */ export interface OnchainWalletLike { balance(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; newAddress(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; send( address: string, amountSats: /*u64*/ bigint, feeRateSatPerVb: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; sync(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; } /** * @deprecated Use `OnchainWalletLike` instead. */ export type OnchainWalletInterface = OnchainWalletLike; /** * UniFFI-facing onchain wallet. Supports two backends: * - BDK (real onchain wallet via `bark::onchain::OnchainWallet`) * - Callback (foreign-language implementation) */ export class OnchainWallet extends UniffiAbstractObject implements OnchainWalletLike { readonly [uniffiTypeNameSymbol] = "OnchainWallet"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeOnchainWalletObjectFactory.bless(pointer); } /** * Callback-backed wallet for foreign-language implementations. */ static custom( callbacks: CustomOnchainWalletCallbacks ): OnchainWalletLike /*throws*/ { return FfiConverterTypeOnchainWallet.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_onchainwallet_custom( FfiConverterTypeCustomOnchainWalletCallbacks.lower(callbacks), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } /** * BDK-backed wallet. Opens the shared sqlite cache. */ static async default_( mnemonic: string, config: Config, datadir: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_onchainwallet_default( FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterTypeOnchainWallet.lift.bind( FfiConverterTypeOnchainWallet ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async balance(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_balance( uniffiTypeOnchainWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeOnchainBalance.lift.bind( FfiConverterTypeOnchainBalance ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async newAddress(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_new_address( uniffiTypeOnchainWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async send( address: string, amountSats: /*u64*/ bigint, feeRateSatPerVb: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_send( uniffiTypeOnchainWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), FfiConverterUInt64.lower(feeRateSatPerVb) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async sync(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_sync( uniffiTypeOnchainWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } /** * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} */ uniffiDestroy(): void { const ptr = (this as any)[destructorGuardSymbol]; if (ptr !== undefined) { const pointer = uniffiTypeOnchainWalletObjectFactory.pointer(this); uniffiTypeOnchainWalletObjectFactory.freePointer(pointer); uniffiTypeOnchainWalletObjectFactory.unbless(ptr); delete (this as any)[destructorGuardSymbol]; } } static instanceOf(obj: any): obj is OnchainWallet { return uniffiTypeOnchainWalletObjectFactory.isConcreteType(obj); } } const uniffiTypeOnchainWalletObjectFactory: UniffiObjectFactory = (() => { return { create(pointer: UniffiHandle): OnchainWalletLike { const instance = Object.create(OnchainWallet.prototype); instance[pointerLiteralSymbol] = pointer; instance[destructorGuardSymbol] = this.bless(pointer); instance[uniffiTypeNameSymbol] = "OnchainWallet"; return instance; }, bless(p: UniffiHandle): UniffiGcObject { return uniffiCaller.rustCall( /*caller:*/ (status) => nativeModule().ubrn_uniffi_internal_fn_method_onchainwallet_ffi__bless_pointer( p, status ), /*liftString:*/ FfiConverterString.lift ); }, unbless(ptr: UniffiGcObject) { ptr.markDestroyed(); }, pointer(obj: OnchainWalletLike): UniffiHandle { if ((obj as any)[destructorGuardSymbol] === undefined) { throw new UniffiInternalError.UnexpectedNullPointer(); } return (obj as any)[pointerLiteralSymbol]; }, clonePointer(obj: OnchainWalletLike): UniffiHandle { const pointer = this.pointer(obj); return uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_onchainwallet( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, freePointer(pointer: UniffiHandle): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_free_onchainwallet( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, isConcreteType(obj: any): obj is OnchainWalletLike { return ( obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "OnchainWallet" ); }, }; })(); // FfiConverter for OnchainWalletLike const FfiConverterTypeOnchainWallet = new FfiConverterObject( uniffiTypeOnchainWalletObjectFactory ); /** * UniFFI-facing Bark wallet. * * Wraps `core::Wallet` and adds: * - `run_async` runtime offload on every entry point * - mailbox processor task + cancellation on drop * - LNURL `pay_lightning_address` * - Daemon control methods * - Notification holder * - Callback onchain dispatch */ export interface WalletLike { allExitsClaimableAtHeight(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; allVtxos(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; allowLightningSendToExit( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; arkInfo(asyncOpts_?: { signal: AbortSignal }): Promise; attemptLightningReceiveExit( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; balance(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; boardAll( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; boardAmount( onchainWallet: OnchainWalletLike, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; bolt11Invoice( amountSats: /*u64*/ bigint, description: string | undefined, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; broadcastTx( txHex: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; cancelAllPendingRounds(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; cancelLightningReceive( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; cancelPendingRound( roundId: /*u32*/ number, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; checkLightningPayment( paymentHash: string, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; claimableLightningReceiveBalanceSats(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; config(asyncOpts_?: { signal: AbortSignal }): Promise; drainExits( vtxoIds: Array, address: string, feeRateSatPerVb: /*u64*/ bigint | undefined, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateArkoorPaymentFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateBoardFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateLightningReceiveFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateLightningSendFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateOffboardAllFee( address: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateOffboardFee( address: string, vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateRefreshFee( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; estimateSendOnchainFee( address: string, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; fingerprint(): string; getExitStatus( vtxoId: string, includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; getExitVtxos(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; getExpiringVtxos( thresholdBlocks: /*u32*/ number, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise>; getFirstExpiringVtxoBlockheight(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; getNextRequiredRefreshBlockheight(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; getVtxoById( vtxoId: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; getVtxosToRefresh(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; hasPendingExits(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; history(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; historyByPaymentMethod( paymentMethodType: string, paymentMethodValue: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise>; importVtxo( vtxoBase64: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; isInvoicePaid( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; lightningReceiveStatus( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; lightningSendState( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; listClaimableExits(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; mailboxAuthorization(): /*throws*/ string; mailboxIdentifier(): /*throws*/ string; maintenance(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; maintenanceDelegated(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; maintenanceRefresh(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; maintenanceWithOnchain( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; maintenanceWithOnchainDelegated( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; maybeScheduleMaintenanceRefresh(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; network(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; newAddress(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; newAddressWithIndex(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; nextRoundStartTime(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; notifications(): NotificationHolderLike; offboardAll( bitcoinAddress: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; offboardVtxos( vtxoIds: Array, bitcoinAddress: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; /** * Pay to a Lightning Address (LNURL). UniFFI-only — lnurl-rs is not wasm-compatible. */ payLightningAddress( lightningAddress: string, amountSats: /*u64*/ bigint, comment: string | undefined, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; payLightningInvoice( invoice: string, amountSats: /*u64*/ bigint | undefined, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; payLightningOffer( offer: string, amountSats: /*u64*/ bigint | undefined, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; peekAddress( index: /*u32*/ number, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; pendingBoardVtxos(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; pendingBoards(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; pendingExitsTotalSats(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; pendingLightningReceives(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; pendingLightningSendVtxos(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; pendingLightningSends(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; pendingRoundStates(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; progressExits( onchainWallet: OnchainWalletLike, feeRateSatPerVb: /*u64*/ bigint | undefined, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise>; progressPendingRounds(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; properties(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; refreshServer(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; refreshVtxos( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; refreshVtxosDelegated( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; runDaemon( onchainWallet: OnchainWalletLike | undefined, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; sendArkoorPayment( arkAddress: string, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; sendOnchain( address: string, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; signExitClaimInputs( psbtBase64: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; spendableVtxos(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; startExitForEntireWallet(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; startExitForVtxos( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; stopDaemon(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; stuckFailedLightningSends(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise>; sync(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise; syncExits( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; syncPendingBoards(asyncOpts_?: { signal: AbortSignal; }): /*throws*/ Promise; tryClaimAllLightningReceives( wait: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise>; tryClaimLightningReceive( paymentHash: string, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; validateArkoorAddress( address: string, asyncOpts_?: { signal: AbortSignal } ): /*throws*/ Promise; vtxos(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise>; } /** * @deprecated Use `WalletLike` instead. */ export type WalletInterface = WalletLike; /** * UniFFI-facing Bark wallet. * * Wraps `core::Wallet` and adds: * - `run_async` runtime offload on every entry point * - mailbox processor task + cancellation on drop * - LNURL `pay_lightning_address` * - Daemon control methods * - Notification holder * - Callback onchain dispatch */ export class Wallet extends UniffiAbstractObject implements WalletLike { readonly [uniffiTypeNameSymbol] = "Wallet"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; // No primary constructor declared for this class. private constructor(pointer: UniffiHandle) { super(); this[pointerLiteralSymbol] = pointer; this[destructorGuardSymbol] = uniffiTypeWalletObjectFactory.bless(pointer); } static async create( mnemonic: string, config: Config, datadir: string, forceRescan: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_create( FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterBool.lower(forceRescan) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } static async createWithOnchain( mnemonic: string, config: Config, datadir: string, onchainWallet: OnchainWalletLike, forceRescan: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_create_with_onchain( FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterTypeOnchainWallet.lower(onchainWallet), FfiConverterBool.lower(forceRescan) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } static async open( mnemonic: string, config: Config, datadir: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_open( FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } /** * Open an existing wallet and start running the daemon. */ static async openWithDaemon( mnemonic: string, config: Config, datadir: string, onchainWallet: OnchainWalletLike | undefined, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_open_with_daemon( FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterOptionalTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } static async openWithOnchain( mnemonic: string, config: Config, datadir: string, onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_open_with_onchain( FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async allExitsClaimableAtHeight(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_all_exits_claimable_at_height( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalUInt32.lift.bind( FfiConverterOptionalUInt32 ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async allVtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_all_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async allowLightningSendToExit( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_allow_lightning_send_to_exit( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async arkInfo(asyncOpts_?: { signal: AbortSignal; }): Promise { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_ark_info( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalTypeArkInfo.lift.bind( FfiConverterOptionalTypeArkInfo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_ ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async attemptLightningReceiveExit( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_attempt_lightning_receive_exit( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async balance(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_balance( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeBalance.lift.bind( FfiConverterTypeBalance ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async boardAll( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_all( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypePendingBoard.lift.bind( FfiConverterTypePendingBoard ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async boardAmount( onchainWallet: OnchainWalletLike, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_amount( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypePendingBoard.lift.bind( FfiConverterTypePendingBoard ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async bolt11Invoice( amountSats: /*u64*/ bigint, description: string | undefined, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt64.lower(amountSats), FfiConverterOptionalString.lower(description) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeLightningInvoice.lift.bind( FfiConverterTypeLightningInvoice ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async broadcastTx( txHex: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_broadcast_tx( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async cancelAllPendingRounds(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_cancel_all_pending_rounds( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async cancelLightningReceive( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_cancel_lightning_receive( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async cancelPendingRound( roundId: /*u32*/ number, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_cancel_pending_round( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt32.lower(roundId) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async checkLightningPayment( paymentHash: string, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_check_lightning_payment( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash), FfiConverterBool.lower(wait) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeLightningSendStatus.lift.bind( FfiConverterTypeLightningSendStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async claimableLightningReceiveBalanceSats(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_claimable_lightning_receive_balance_sats( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async config(asyncOpts_?: { signal: AbortSignal }): Promise { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_config( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeConfig.lift.bind(FfiConverterTypeConfig), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_ ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async drainExits( vtxoIds: Array, address: string, feeRateSatPerVb: /*u64*/ bigint | undefined, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_drain_exits( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), FfiConverterString.lower(address), FfiConverterOptionalUInt64.lower(feeRateSatPerVb) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeExitClaimTransaction.lift.bind( FfiConverterTypeExitClaimTransaction ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateArkoorPaymentFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_arkoor_payment_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateBoardFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_board_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateLightningReceiveFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_lightning_receive_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateLightningSendFee( amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_lightning_send_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateOffboardAllFee( address: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_offboard_all_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateOffboardFee( address: string, vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_offboard_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterArrayString.lower(vtxoIds) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateRefreshFee( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_refresh_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async estimateSendOnchainFee( address: string, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_send_onchain_fee( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeFeeEstimate.lift.bind( FfiConverterTypeFeeEstimate ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } fingerprint(): string { return FfiConverterString.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_fingerprint( uniffiTypeWalletObjectFactory.clonePointer(this), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } async getExitStatus( vtxoId: string, includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_exit_status( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoId), FfiConverterBool.lower(includeHistory), FfiConverterBool.lower(includeTransactions) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalTypeExitTransactionStatus.lift.bind( FfiConverterOptionalTypeExitTransactionStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async getExitVtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_exit_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeExitVtxo.lift.bind( FfiConverterArrayTypeExitVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async getExpiringVtxos( thresholdBlocks: /*u32*/ number, asyncOpts_?: { signal: AbortSignal } ): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_expiring_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt32.lower(thresholdBlocks) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async getFirstExpiringVtxoBlockheight(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_first_expiring_vtxo_blockheight( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalUInt32.lift.bind( FfiConverterOptionalUInt32 ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async getNextRequiredRefreshBlockheight(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_next_required_refresh_blockheight( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalUInt32.lift.bind( FfiConverterOptionalUInt32 ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async getVtxoById( vtxoId: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_vtxo_by_id( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoId) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeVtxo.lift.bind(FfiConverterTypeVtxo), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async getVtxosToRefresh(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_vtxos_to_refresh( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async hasPendingExits(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_has_pending_exits( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_i8, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_i8, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_i8, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_i8, /*liftFunc:*/ FfiConverterBool.lift.bind(FfiConverterBool), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async history(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_history( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeMovement.lift.bind( FfiConverterArrayTypeMovement ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async historyByPaymentMethod( paymentMethodType: string, paymentMethodValue: string, asyncOpts_?: { signal: AbortSignal } ): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_history_by_payment_method( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentMethodType), FfiConverterString.lower(paymentMethodValue) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeMovement.lift.bind( FfiConverterArrayTypeMovement ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async importVtxo( vtxoBase64: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxo( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoBase64) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async isInvoicePaid( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_is_invoice_paid( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_i8, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_i8, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_i8, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_i8, /*liftFunc:*/ FfiConverterBool.lift.bind(FfiConverterBool), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async lightningReceiveStatus( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_lightning_receive_status( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalTypeLightningReceive.lift.bind( FfiConverterOptionalTypeLightningReceive ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async lightningSendState( paymentHash: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_lightning_send_state( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeLightningSendStatus.lift.bind( FfiConverterTypeLightningSendStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async listClaimableExits(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_list_claimable_exits( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeExitVtxo.lift.bind( FfiConverterArrayTypeExitVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } mailboxAuthorization(): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_mailbox_authorization( uniffiTypeWalletObjectFactory.clonePointer(this), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } mailboxIdentifier(): string /*throws*/ { return FfiConverterString.lift( uniffiCaller.rustCallWithError( /*liftError:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ), /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_mailbox_identifier( uniffiTypeWalletObjectFactory.clonePointer(this), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } async maintenance(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async maintenanceDelegated(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_delegated( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async maintenanceRefresh(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_refresh( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalString.lift.bind( FfiConverterOptionalString ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async maintenanceWithOnchain( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_with_onchain( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async maintenanceWithOnchainDelegated( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_with_onchain_delegated( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async maybeScheduleMaintenanceRefresh(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maybe_schedule_maintenance_refresh( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalUInt32.lift.bind( FfiConverterOptionalUInt32 ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async network(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_network( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeNetwork.lift.bind( FfiConverterTypeNetwork ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async newAddress(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_new_address( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async newAddressWithIndex(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_new_address_with_index( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeAddressWithIndex.lift.bind( FfiConverterTypeAddressWithIndex ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async nextRoundStartTime(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_next_round_start_time( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } notifications(): NotificationHolderLike { return FfiConverterTypeNotificationHolder.lift( uniffiCaller.rustCall( /*caller:*/ (callStatus) => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_notifications( uniffiTypeWalletObjectFactory.clonePointer(this), callStatus ); }, /*liftString:*/ FfiConverterString.lift ) ); } async offboardAll( bitcoinAddress: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_offboard_all( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(bitcoinAddress) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeOffboardResult.lift.bind( FfiConverterTypeOffboardResult ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async offboardVtxos( vtxoIds: Array, bitcoinAddress: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_offboard_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), FfiConverterString.lower(bitcoinAddress) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } /** * Pay to a Lightning Address (LNURL). UniFFI-only — lnurl-rs is not wasm-compatible. */ async payLightningAddress( lightningAddress: string, amountSats: /*u64*/ bigint, comment: string | undefined, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pay_lightning_address( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(lightningAddress), FfiConverterUInt64.lower(amountSats), FfiConverterOptionalString.lower(comment), FfiConverterBool.lower(wait) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeLightningSendStatus.lift.bind( FfiConverterTypeLightningSendStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async payLightningInvoice( invoice: string, amountSats: /*u64*/ bigint | undefined, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pay_lightning_invoice( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(invoice), FfiConverterOptionalUInt64.lower(amountSats), FfiConverterBool.lower(wait) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeLightningSendStatus.lift.bind( FfiConverterTypeLightningSendStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async payLightningOffer( offer: string, amountSats: /*u64*/ bigint | undefined, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pay_lightning_offer( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(offer), FfiConverterOptionalUInt64.lower(amountSats), FfiConverterBool.lower(wait) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeLightningSendStatus.lift.bind( FfiConverterTypeLightningSendStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async peekAddress( index: /*u32*/ number, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_peek_address( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt32.lower(index) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingBoardVtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_board_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingBoards(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_boards( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypePendingBoard.lift.bind( FfiConverterArrayTypePendingBoard ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingExitsTotalSats(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_exits_total_sats( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingLightningReceives(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_lightning_receives( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeLightningReceive.lift.bind( FfiConverterArrayTypeLightningReceive ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingLightningSendVtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_lightning_send_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingLightningSends(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_lightning_sends( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeLightningSend.lift.bind( FfiConverterArrayTypeLightningSend ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_round_input_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async pendingRoundStates(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_round_states( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeRoundState.lift.bind( FfiConverterArrayTypeRoundState ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async progressExits( onchainWallet: OnchainWalletLike, feeRateSatPerVb: /*u64*/ bigint | undefined, asyncOpts_?: { signal: AbortSignal } ): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_progress_exits( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), FfiConverterOptionalUInt64.lower(feeRateSatPerVb) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeExitProgressStatus.lift.bind( FfiConverterArrayTypeExitProgressStatus ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async progressPendingRounds(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_progress_pending_rounds( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async properties(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_properties( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterTypeWalletProperties.lift.bind( FfiConverterTypeWalletProperties ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async refreshServer(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_refresh_server( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async refreshVtxos( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_refresh_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalString.lift.bind( FfiConverterOptionalString ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async refreshVtxosDelegated( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_refresh_vtxos_delegated( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterOptionalTypeRoundState.lift.bind( FfiConverterOptionalTypeRoundState ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async runDaemon( onchainWallet: OnchainWalletLike | undefined, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_run_daemon( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterOptionalTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async sendArkoorPayment( arkAddress: string, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_send_arkoor_payment( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(arkAddress), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async sendOnchain( address: string, amountSats: /*u64*/ bigint, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_send_onchain( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async signExitClaimInputs( psbtBase64: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sign_exit_claim_inputs( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(psbtBase64) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async spendableVtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_spendable_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async startExitForEntireWallet(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_start_exit_for_entire_wallet( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async startExitForVtxos( vtxoIds: Array, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_start_exit_for_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async stopDaemon(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_stop_daemon( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async stuckFailedLightningSends(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_stuck_failed_lightning_sends( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeLightningSend.lift.bind( FfiConverterArrayTypeLightningSend ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async sync(asyncOpts_?: { signal: AbortSignal }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async syncExits( onchainWallet: OnchainWalletLike, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync_exits( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async syncPendingBoards(asyncOpts_?: { signal: AbortSignal; }): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync_pending_boards( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async tryClaimAllLightningReceives( wait: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_try_claim_all_lightning_receives( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterBool.lower(wait) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeLightningReceive.lift.bind( FfiConverterArrayTypeLightningReceive ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async tryClaimLightningReceive( paymentHash: string, wait: boolean, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_try_claim_lightning_receive( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash), FfiConverterBool.lower(wait) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/ (_v) => {}, /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async validateArkoorAddress( address: string, asyncOpts_?: { signal: AbortSignal } ): Promise /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_validate_arkoor_address( uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address) ); }, /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_i8, /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_i8, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_i8, /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_i8, /*liftFunc:*/ FfiConverterBool.lift.bind(FfiConverterBool), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } async vtxos(asyncOpts_?: { signal: AbortSignal; }): Promise> /*throws*/ { const __stack = uniffiIsDebug ? new Error().stack : undefined; try { return await uniffiRustCallAsync( /*rustCaller:*/ uniffiCaller, /*rustFutureFunc:*/ () => { return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_vtxos( uniffiTypeWalletObjectFactory.clonePointer(this) ); }, /*pollFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/ nativeModule() .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/ FfiConverterArrayTypeVtxo.lift.bind( FfiConverterArrayTypeVtxo ), /*liftString:*/ FfiConverterString.lift, /*asyncOpts:*/ asyncOpts_, /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind( FfiConverterTypeBarkError ) ); } catch (__error: any) { if (uniffiIsDebug && __error instanceof Error) { __error.stack = __stack; } throw __error; } } /** * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy} */ uniffiDestroy(): void { const ptr = (this as any)[destructorGuardSymbol]; if (ptr !== undefined) { const pointer = uniffiTypeWalletObjectFactory.pointer(this); uniffiTypeWalletObjectFactory.freePointer(pointer); uniffiTypeWalletObjectFactory.unbless(ptr); delete (this as any)[destructorGuardSymbol]; } } static instanceOf(obj: any): obj is Wallet { return uniffiTypeWalletObjectFactory.isConcreteType(obj); } } const uniffiTypeWalletObjectFactory: UniffiObjectFactory = (() => { return { create(pointer: UniffiHandle): WalletLike { const instance = Object.create(Wallet.prototype); instance[pointerLiteralSymbol] = pointer; instance[destructorGuardSymbol] = this.bless(pointer); instance[uniffiTypeNameSymbol] = "Wallet"; return instance; }, bless(p: UniffiHandle): UniffiGcObject { return uniffiCaller.rustCall( /*caller:*/ (status) => nativeModule().ubrn_uniffi_internal_fn_method_wallet_ffi__bless_pointer( p, status ), /*liftString:*/ FfiConverterString.lift ); }, unbless(ptr: UniffiGcObject) { ptr.markDestroyed(); }, pointer(obj: WalletLike): UniffiHandle { if ((obj as any)[destructorGuardSymbol] === undefined) { throw new UniffiInternalError.UnexpectedNullPointer(); } return (obj as any)[pointerLiteralSymbol]; }, clonePointer(obj: WalletLike): UniffiHandle { const pointer = this.pointer(obj); return uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_wallet( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, freePointer(pointer: UniffiHandle): void { uniffiCaller.rustCall( /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_bark_ffi_fn_free_wallet( pointer, callStatus ), /*liftString:*/ FfiConverterString.lift ); }, isConcreteType(obj: any): obj is WalletLike { return ( obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "Wallet" ); }, }; })(); // FfiConverter for WalletLike const FfiConverterTypeWallet = new FfiConverterObject( uniffiTypeWalletObjectFactory ); // FfiConverter for boolean | undefined const FfiConverterOptionalBool = new FfiConverterOptional(FfiConverterBool); // FfiConverter for ArkInfo | undefined const FfiConverterOptionalTypeArkInfo = new FfiConverterOptional( FfiConverterTypeArkInfo ); // FfiConverter for BlockRef | undefined const FfiConverterOptionalTypeBlockRef = new FfiConverterOptional( FfiConverterTypeBlockRef ); // FfiConverter for ExitTransactionStatus | undefined const FfiConverterOptionalTypeExitTransactionStatus = new FfiConverterOptional( FfiConverterTypeExitTransactionStatus ); // FfiConverter for LightningReceive | undefined const FfiConverterOptionalTypeLightningReceive = new FfiConverterOptional( FfiConverterTypeLightningReceive ); // FfiConverter for RoundState | undefined const FfiConverterOptionalTypeRoundState = new FfiConverterOptional( FfiConverterTypeRoundState ); // FfiConverter for string | undefined const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString); // FfiConverter for /*u16*/number | undefined const FfiConverterOptionalUInt16 = new FfiConverterOptional(FfiConverterUInt16); // FfiConverter for /*u32*/number | undefined const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32); // FfiConverter for /*u64*/bigint | undefined const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64); // FfiConverter for /*u8*/number | undefined const FfiConverterOptionalUInt8 = new FfiConverterOptional(FfiConverterUInt8); // FfiConverter for Array const FfiConverterArrayTypeDestination = new FfiConverterArray( FfiConverterTypeDestination ); // FfiConverter for Array const FfiConverterArrayTypeExitProgressStatus = new FfiConverterArray( FfiConverterTypeExitProgressStatus ); // FfiConverter for Array const FfiConverterArrayTypeExitVtxo = new FfiConverterArray( FfiConverterTypeExitVtxo ); // FfiConverter for Array const FfiConverterArrayTypeLightningReceive = new FfiConverterArray( FfiConverterTypeLightningReceive ); // FfiConverter for Array const FfiConverterArrayTypeLightningSend = new FfiConverterArray( FfiConverterTypeLightningSend ); // FfiConverter for Array const FfiConverterArrayTypeMovement = new FfiConverterArray( FfiConverterTypeMovement ); // FfiConverter for Array const FfiConverterArrayTypePendingBoard = new FfiConverterArray( FfiConverterTypePendingBoard ); // FfiConverter for Array const FfiConverterArrayTypeRoundState = new FfiConverterArray( FfiConverterTypeRoundState ); // FfiConverter for Array const FfiConverterArrayTypeVtxo = new FfiConverterArray(FfiConverterTypeVtxo); // FfiConverter for Array const FfiConverterArrayString = new FfiConverterArray(FfiConverterString); // FfiConverter for WalletNotification | undefined const FfiConverterOptionalTypeWalletNotification = new FfiConverterOptional( FfiConverterTypeWalletNotification ); // FfiConverter for OnchainWalletLike | undefined const FfiConverterOptionalTypeOnchainWallet = new FfiConverterOptional( FfiConverterTypeOnchainWallet ); // FfiConverter for Array | undefined const FfiConverterOptionalArrayString = new FfiConverterOptional( FfiConverterArrayString ); /** * 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. */ function uniffiEnsureInitialized() { // Get the bindings contract version from our ComponentInterface const bindingsContractVersion = 30; // Get the scaffolding contract version by calling the into the dylib const scaffoldingContractVersion = nativeModule().ubrn_ffi_bark_ffi_uniffi_contract_version(); if (bindingsContractVersion !== scaffoldingContractVersion) { throw new UniffiInternalError.ContractVersionMismatch( scaffoldingContractVersion, bindingsContractVersion ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt() !== 16937 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_func_extract_tx_from_psbt" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_func_generate_mnemonic() !== 10284 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_func_generate_mnemonic" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address() !== 6717 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_func_validate_ark_address" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_mnemonic() !== 2618 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_func_validate_mnemonic" ); } if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_set_logger() !== 376) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_func_set_logger" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_notificationholder_cancel_next_notification_wait() !== 45269 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_notificationholder_cancel_next_notification_wait" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_notificationholder_next_notification() !== 320 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_notificationholder_next_notification" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance() !== 38086 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_tx() !== 25200 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_tx" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_drain_tx() !== 29583 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_drain_tx" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_finish_psbt() !== 10227 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_finish_psbt" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx() !== 10525 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block() !== 57629 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_spending_tx() !== 36118 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_spending_tx" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !== 38903 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !== 41506 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_barklogger_log() !== 8627 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_barklogger_log" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_balance() !== 10540 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_onchainwallet_balance" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_new_address() !== 27918 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_onchainwallet_new_address" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_send() !== 12509 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_onchainwallet_send" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_sync() !== 38870 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_onchainwallet_sync" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_all_exits_claimable_at_height() !== 35095 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_all_exits_claimable_at_height" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_all_vtxos() !== 38449 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_all_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_allow_lightning_send_to_exit() !== 44140 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_allow_lightning_send_to_exit" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_ark_info() !== 37357 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_ark_info" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_attempt_lightning_receive_exit() !== 32877 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_attempt_lightning_receive_exit" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_balance() !== 26361 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_balance" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_all() !== 26567 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_board_all" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !== 40800 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_board_amount" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 18425 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_broadcast_tx() !== 48884 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_broadcast_tx" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_cancel_all_pending_rounds() !== 49283 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_cancel_all_pending_rounds" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_cancel_lightning_receive() !== 7354 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_cancel_lightning_receive" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_cancel_pending_round() !== 21817 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_cancel_pending_round" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_check_lightning_payment() !== 33087 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_check_lightning_payment" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_claimable_lightning_receive_balance_sats() !== 57824 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_claimable_lightning_receive_balance_sats" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_config() !== 35661 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_config" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_drain_exits() !== 61748 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_drain_exits" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_arkoor_payment_fee() !== 54949 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_arkoor_payment_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee() !== 2350 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee() !== 35587 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_send_fee() !== 16837 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_send_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_offboard_all_fee() !== 18596 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_offboard_all_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_offboard_fee() !== 13570 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_offboard_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_refresh_fee() !== 51683 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_refresh_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_send_onchain_fee() !== 53725 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_estimate_send_onchain_fee" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_fingerprint() !== 31048 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_fingerprint" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_exit_status() !== 849 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_exit_status" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_exit_vtxos() !== 62832 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_exit_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_expiring_vtxos() !== 62926 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_expiring_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_first_expiring_vtxo_blockheight() !== 9891 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_first_expiring_vtxo_blockheight" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_next_required_refresh_blockheight() !== 60321 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_next_required_refresh_blockheight" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_vtxo_by_id() !== 54348 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_vtxo_by_id" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_vtxos_to_refresh() !== 56166 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_get_vtxos_to_refresh" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_has_pending_exits() !== 31064 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_has_pending_exits" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_history() !== 49526 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_history" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_history_by_payment_method() !== 49277 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_history_by_payment_method" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxo() !== 58528 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_import_vtxo" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid() !== 43344 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_receive_status() !== 37213 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_lightning_receive_status" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_send_state() !== 37487 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_lightning_send_state" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_list_claimable_exits() !== 46928 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_list_claimable_exits" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_mailbox_authorization() !== 37256 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_mailbox_authorization" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_mailbox_identifier() !== 4339 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_mailbox_identifier" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance() !== 42287 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_maintenance" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_delegated() !== 20659 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_maintenance_delegated" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_refresh() !== 13823 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_maintenance_refresh" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain() !== 41935 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain_delegated() !== 23897 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain_delegated" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maybe_schedule_maintenance_refresh() !== 24944 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_maybe_schedule_maintenance_refresh" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_network() !== 28437 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_network" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_new_address() !== 46889 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_new_address" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_new_address_with_index() !== 26065 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_new_address_with_index" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_next_round_start_time() !== 18913 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_next_round_start_time" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_notifications() !== 4292 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_notifications" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_offboard_all() !== 33338 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_offboard_all" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_offboard_vtxos() !== 45323 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_offboard_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_address() !== 2440 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pay_lightning_address" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_invoice() !== 18714 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pay_lightning_invoice" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_offer() !== 31129 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pay_lightning_offer" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_peek_address() !== 55042 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_peek_address" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_board_vtxos() !== 25647 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_board_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_boards() !== 41590 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_boards" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_exits_total_sats() !== 8001 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_exits_total_sats" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_receives() !== 59673 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_lightning_receives" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_send_vtxos() !== 43740 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_lightning_send_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends() !== 47848 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_input_vtxos() !== 21093 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_round_input_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_states() !== 3426 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_pending_round_states" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_exits() !== 27512 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_progress_exits" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_pending_rounds() !== 2915 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_progress_pending_rounds" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_properties() !== 47133 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_properties" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !== 2646 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_refresh_server" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos() !== 18792 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_delegated() !== 32568 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_delegated" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_run_daemon() !== 62932 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_run_daemon" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_send_arkoor_payment() !== 50386 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_send_arkoor_payment" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_send_onchain() !== 38644 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_send_onchain" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sign_exit_claim_inputs() !== 53765 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_sign_exit_claim_inputs" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_spendable_vtxos() !== 65142 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_spendable_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_start_exit_for_entire_wallet() !== 31961 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_start_exit_for_entire_wallet" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_start_exit_for_vtxos() !== 34614 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_start_exit_for_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon() !== 27848 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_stop_daemon" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends() !== 51351 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync() !== 38360 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_sync" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_exits() !== 47734 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_sync_exits" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards() !== 49211 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives() !== 63130 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_lightning_receive() !== 9806 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_try_claim_lightning_receive" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address() !== 55064 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_vtxos() !== 5883 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_method_wallet_vtxos" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_custom() !== 1549 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_onchainwallet_custom" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_default() !== 3877 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_onchainwallet_default" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_create() !== 60393 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_wallet_create" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_create_with_onchain() !== 55243 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_wallet_create_with_onchain" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open() !== 36564 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_wallet_open" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open_with_daemon() !== 9668 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_wallet_open_with_daemon" ); } if ( nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain() !== 39500 ) { throw new UniffiInternalError.ApiChecksumMismatch( "uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain" ); } uniffiCallbackInterfaceBarkLogger.register(); uniffiCallbackInterfaceCustomOnchainWalletCallbacks.register(); } export default Object.freeze({ initialize: uniffiEnsureInitialized, converters: { FfiConverterTypeAddressWithIndex, FfiConverterTypeArkInfo, FfiConverterTypeBalance, FfiConverterTypeBarkError, FfiConverterTypeBarkLogger, FfiConverterTypeBlockRef, FfiConverterTypeConfig, FfiConverterTypeCpfpParams, FfiConverterTypeCustomOnchainWalletCallbacks, FfiConverterTypeDestination, FfiConverterTypeExitClaimTransaction, FfiConverterTypeExitProgressStatus, FfiConverterTypeExitTransactionStatus, FfiConverterTypeExitVtxo, FfiConverterTypeFeeEstimate, FfiConverterTypeLightningInvoice, FfiConverterTypeLightningReceive, FfiConverterTypeLightningSend, FfiConverterTypeLightningSendStatus, FfiConverterTypeLogLevel, FfiConverterTypeMovement, FfiConverterTypeNetwork, FfiConverterTypeNotificationHolder, FfiConverterTypeOffboardResult, FfiConverterTypeOnchainBalance, FfiConverterTypeOnchainWallet, FfiConverterTypeOutPoint, FfiConverterTypePendingBoard, FfiConverterTypeRoundState, FfiConverterTypeVtxo, FfiConverterTypeWallet, FfiConverterTypeWalletNotification, FfiConverterTypeWalletProperties, }, });