// 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! import nativeModule, { type UniffiRustFutureContinuationCallback, type UniffiForeignFuture, type UniffiForeignFutureStructU8, type UniffiForeignFutureCompleteU8, type UniffiForeignFutureStructI8, type UniffiForeignFutureCompleteI8, type UniffiForeignFutureStructU16, type UniffiForeignFutureCompleteU16, type UniffiForeignFutureStructI16, type UniffiForeignFutureCompleteI16, type UniffiForeignFutureStructU32, type UniffiForeignFutureCompleteU32, type UniffiForeignFutureStructI32, type UniffiForeignFutureCompleteI32, type UniffiForeignFutureStructU64, type UniffiForeignFutureCompleteU64, type UniffiForeignFutureStructI64, type UniffiForeignFutureCompleteI64, type UniffiForeignFutureStructF32, type UniffiForeignFutureCompleteF32, type UniffiForeignFutureStructF64, type UniffiForeignFutureCompleteF64, type UniffiForeignFutureStructPointer, type UniffiForeignFutureCompletePointer, type UniffiForeignFutureStructRustBuffer, type UniffiForeignFutureCompleteRustBuffer, type UniffiForeignFutureStructVoid, type UniffiForeignFutureCompleteVoid, } from './breez_sdk_spark_bindings-ffi'; import { type UniffiByteArray, RustBuffer, UniffiInternalError, UniffiRustCaller, uniffiCreateFfiConverterString, } 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. 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); /** * 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 = 29; // Get the scaffolding contract version by calling the into the dylib const scaffoldingContractVersion = nativeModule().ubrn_ffi_breez_sdk_spark_bindings_uniffi_contract_version(); if (bindingsContractVersion !== scaffoldingContractVersion) { throw new UniffiInternalError.ContractVersionMismatch( scaffoldingContractVersion, bindingsContractVersion ); } } export default Object.freeze({ initialize: uniffiEnsureInitialized, });