@breeztech/breez-sdk-spark-react-native 0.2.1 → 0.2.2-dev2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,6 +115,10 @@ typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod1)(
115
115
  UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
116
116
  uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
117
117
  typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod2)(
118
+ uint64_t uniffi_handle, RustBuffer txid,
119
+ UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
120
+ uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
121
+ typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod3)(
118
122
  uint64_t uniffi_handle, RustBuffer tx,
119
123
  UniffiForeignFutureCompleteVoid uniffi_future_callback,
120
124
  uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
@@ -173,8 +177,9 @@ typedef struct UniffiVTableCallbackInterfaceLogger {
173
177
  } UniffiVTableCallbackInterfaceLogger;
174
178
  typedef struct UniffiVTableCallbackInterfaceBitcoinChainService {
175
179
  UniffiCallbackInterfaceBitcoinChainServiceMethod0 get_address_utxos;
176
- UniffiCallbackInterfaceBitcoinChainServiceMethod1 get_transaction_hex;
177
- UniffiCallbackInterfaceBitcoinChainServiceMethod2 broadcast_transaction;
180
+ UniffiCallbackInterfaceBitcoinChainServiceMethod1 get_transaction_status;
181
+ UniffiCallbackInterfaceBitcoinChainServiceMethod2 get_transaction_hex;
182
+ UniffiCallbackInterfaceBitcoinChainServiceMethod3 broadcast_transaction;
178
183
  UniffiCallbackInterfaceFree uniffi_free;
179
184
  } UniffiVTableCallbackInterfaceBitcoinChainService;
180
185
  typedef struct UniffiVTableCallbackInterfaceStorage {
@@ -201,6 +206,9 @@ void uniffi_breez_sdk_spark_fn_init_callback_vtable_bitcoinchainservice(
201
206
  uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_utxos(
202
207
  void *ptr, RustBuffer address);
203
208
  /*handle*/ uint64_t
209
+ uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
210
+ void *ptr, RustBuffer txid);
211
+ /*handle*/ uint64_t
204
212
  uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_hex(
205
213
  void *ptr, RustBuffer txid);
206
214
  /*handle*/ uint64_t
@@ -480,6 +488,8 @@ uint16_t uniffi_breez_sdk_spark_checksum_func_parse();
480
488
  uint16_t
481
489
  uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos();
482
490
  uint16_t
491
+ uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status();
492
+ uint16_t
483
493
  uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex();
484
494
  uint16_t
485
495
  uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction();
@@ -2938,6 +2948,151 @@ namespace uniffi::breez_sdk_spark::cb::
2938
2948
  callbackinterfacebitcoinchainservicemethod2 {
2939
2949
  using namespace facebook;
2940
2950
 
2951
+ // We need to store a lambda in a global so we can call it from
2952
+ // a function pointer. The function pointer is passed to Rust.
2953
+ static std::function<void(uint64_t, RustBuffer,
2954
+ UniffiForeignFutureCompleteRustBuffer, uint64_t,
2955
+ UniffiForeignFuture *)>
2956
+ rsLambda = nullptr;
2957
+
2958
+ // This is the main body of the callback. It's called from the lambda,
2959
+ // which itself is called from the callback function which is passed to Rust.
2960
+ static void body(jsi::Runtime &rt,
2961
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
2962
+ std::shared_ptr<jsi::Value> callbackValue,
2963
+ uint64_t rs_uniffiHandle, RustBuffer rs_txid,
2964
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
2965
+ uint64_t rs_uniffiCallbackData,
2966
+ UniffiForeignFuture *rs_uniffiOutReturn) {
2967
+
2968
+ // Convert the arguments from Rust, into jsi::Values.
2969
+ // We'll use the Bridging class to do this…
2970
+ auto js_uniffiHandle =
2971
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
2972
+ auto js_txid = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
2973
+ rt, callInvoker, rs_txid);
2974
+ auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
2975
+ UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
2976
+ rs_uniffiFutureCallback);
2977
+ auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
2978
+ rt, callInvoker, rs_uniffiCallbackData);
2979
+
2980
+ // Now we are ready to call the callback.
2981
+ // We are already on the JS thread, because this `body` function was
2982
+ // invoked from the CallInvoker.
2983
+ try {
2984
+ // Getting the callback function
2985
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
2986
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_txid,
2987
+ js_uniffiFutureCallback, js_uniffiCallbackData);
2988
+
2989
+ // Finally, we need to copy the return value back into the Rust pointer.
2990
+ *rs_uniffiOutReturn = uniffi::breez_sdk_spark::Bridging<
2991
+ ReferenceHolder<UniffiForeignFuture>>::fromJs(rt, callInvoker,
2992
+ uniffiResult);
2993
+ } catch (const jsi::JSError &error) {
2994
+ std::cout << "Error in callback "
2995
+ "UniffiCallbackInterfaceBitcoinChainServiceMethod2: "
2996
+ << error.what() << std::endl;
2997
+ throw error;
2998
+ }
2999
+ }
3000
+
3001
+ static void
3002
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_txid,
3003
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
3004
+ uint64_t rs_uniffiCallbackData,
3005
+ UniffiForeignFuture *rs_uniffiOutReturn) {
3006
+ // If the runtime has shutdown, then there is no point in trying to
3007
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
3008
+ //
3009
+ // Answer: the module destructor calls into callback `cleanup` method,
3010
+ // which nulls out the rsLamda.
3011
+ //
3012
+ // If rsLamda is null, then there is no runtime to call into.
3013
+ if (rsLambda == nullptr) {
3014
+ // This only occurs when destructors are calling into Rust free/drop,
3015
+ // which causes the JS callback to be dropped.
3016
+ return;
3017
+ }
3018
+
3019
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
3020
+ // are all in the lambda.
3021
+ rsLambda(rs_uniffiHandle, rs_txid, rs_uniffiFutureCallback,
3022
+ rs_uniffiCallbackData, rs_uniffiOutReturn);
3023
+ }
3024
+
3025
+ static UniffiCallbackInterfaceBitcoinChainServiceMethod2
3026
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod2
3027
+ jsi::Runtime &rt,
3028
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
3029
+ const jsi::Value &value) {
3030
+ if (rsLambda != nullptr) {
3031
+ // `makeCallbackFunction` is called in two circumstances:
3032
+ //
3033
+ // 1. at startup, when initializing callback interface vtables.
3034
+ // 2. when polling futures. This happens at least once per future that is
3035
+ // exposed to Javascript. We know that this is always the same function,
3036
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
3037
+ //
3038
+ // We can therefore return the callback function without making anything
3039
+ // new if we've been initialized already.
3040
+ return callback;
3041
+ }
3042
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
3043
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
3044
+ rsLambda = [&rt, callInvoker, callbackValue](
3045
+ uint64_t rs_uniffiHandle, RustBuffer rs_txid,
3046
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
3047
+ uint64_t rs_uniffiCallbackData,
3048
+ UniffiForeignFuture *rs_uniffiOutReturn) {
3049
+ // We immediately make a lambda which will do the work of transforming the
3050
+ // arguments into JSI values and calling the callback.
3051
+ uniffi_runtime::UniffiCallFunc jsLambda =
3052
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_txid,
3053
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
3054
+ rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
3055
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_txid,
3056
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
3057
+ rs_uniffiOutReturn);
3058
+ };
3059
+ // We'll then call that lambda from the callInvoker which will
3060
+ // look after calling it on the correct thread.
3061
+ callInvoker->invokeBlocking(rt, jsLambda);
3062
+ };
3063
+ return callback;
3064
+ }
3065
+
3066
+ // This method is called from the destructor of NativeBreezSdkSpark, which only
3067
+ // happens when the jsi::Runtime is being destroyed.
3068
+ static void cleanup() {
3069
+ // The lambda holds a reference to the the Runtime, so when this is nulled
3070
+ // out, then the pointer will no longer be left dangling.
3071
+ rsLambda = nullptr;
3072
+ }
3073
+ } // namespace
3074
+ // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod2
3075
+ // Implementation of callback function calling from Rust to JS
3076
+ // CallbackInterfaceBitcoinChainServiceMethod3
3077
+
3078
+ // Callback function:
3079
+ // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod3::UniffiCallbackInterfaceBitcoinChainServiceMethod3
3080
+ //
3081
+ // We have the following constraints:
3082
+ // - we need to pass a function pointer to Rust.
3083
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
3084
+ // - function pointers can't store state, so we can't use a lamda.
3085
+ //
3086
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
3087
+ // function calls the lambda, which itself calls the `body` which then calls
3088
+ // into JS.
3089
+ //
3090
+ // We then give the `callback` function pointer to Rust which will call the
3091
+ // lambda sometime in the future.
3092
+ namespace uniffi::breez_sdk_spark::cb::
3093
+ callbackinterfacebitcoinchainservicemethod3 {
3094
+ using namespace facebook;
3095
+
2941
3096
  // We need to store a lambda in a global so we can call it from
2942
3097
  // a function pointer. The function pointer is passed to Rust.
2943
3098
  static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
@@ -2981,7 +3136,7 @@ static void body(jsi::Runtime &rt,
2981
3136
  uniffiResult);
2982
3137
  } catch (const jsi::JSError &error) {
2983
3138
  std::cout << "Error in callback "
2984
- "UniffiCallbackInterfaceBitcoinChainServiceMethod2: "
3139
+ "UniffiCallbackInterfaceBitcoinChainServiceMethod3: "
2985
3140
  << error.what() << std::endl;
2986
3141
  throw error;
2987
3142
  }
@@ -3010,8 +3165,8 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_tx,
3010
3165
  rs_uniffiCallbackData, rs_uniffiOutReturn);
3011
3166
  }
3012
3167
 
3013
- static UniffiCallbackInterfaceBitcoinChainServiceMethod2
3014
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod2
3168
+ static UniffiCallbackInterfaceBitcoinChainServiceMethod3
3169
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod3
3015
3170
  jsi::Runtime &rt,
3016
3171
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
3017
3172
  const jsi::Value &value) {
@@ -3059,7 +3214,7 @@ static void cleanup() {
3059
3214
  rsLambda = nullptr;
3060
3215
  }
3061
3216
  } // namespace
3062
- // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod2
3217
+ // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod3
3063
3218
  // Implementation of callback function calling from Rust to JS
3064
3219
  // CallbackInterfaceStorageMethod0
3065
3220
 
@@ -4732,11 +4887,14 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceBitcoinChainService> {
4732
4887
  rsObject.get_address_utxos = uniffi::breez_sdk_spark::cb::
4733
4888
  callbackinterfacebitcoinchainservicemethod0::makeCallbackFunction(
4734
4889
  rt, callInvoker, jsObject.getProperty(rt, "getAddressUtxos"));
4735
- rsObject.get_transaction_hex = uniffi::breez_sdk_spark::cb::
4890
+ rsObject.get_transaction_status = uniffi::breez_sdk_spark::cb::
4736
4891
  callbackinterfacebitcoinchainservicemethod1::makeCallbackFunction(
4892
+ rt, callInvoker, jsObject.getProperty(rt, "getTransactionStatus"));
4893
+ rsObject.get_transaction_hex = uniffi::breez_sdk_spark::cb::
4894
+ callbackinterfacebitcoinchainservicemethod2::makeCallbackFunction(
4737
4895
  rt, callInvoker, jsObject.getProperty(rt, "getTransactionHex"));
4738
4896
  rsObject.broadcast_transaction = uniffi::breez_sdk_spark::cb::
4739
- callbackinterfacebitcoinchainservicemethod2::makeCallbackFunction(
4897
+ callbackinterfacebitcoinchainservicemethod3::makeCallbackFunction(
4740
4898
  rt, callInvoker, jsObject.getProperty(rt, "broadcastTransaction"));
4741
4899
  rsObject.uniffi_free = uniffi::breez_sdk_spark::st::
4742
4900
  vtablecallbackinterfacebitcoinchainservice::
@@ -4906,6 +5064,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
4906
5064
  ->cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_utxos(
4907
5065
  rt, thisVal, args, count);
4908
5066
  });
5067
+ props["ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_"
5068
+ "transaction_status"] = jsi::Function::createFromHostFunction(
5069
+ rt,
5070
+ jsi::PropNameID::forAscii(rt,
5071
+ "ubrn_uniffi_breez_sdk_spark_fn_method_"
5072
+ "bitcoinchainservice_get_transaction_status"),
5073
+ 2,
5074
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
5075
+ const jsi::Value *args, size_t count) -> jsi::Value {
5076
+ return this
5077
+ ->cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
5078
+ rt, thisVal, args, count);
5079
+ });
4909
5080
  props["ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_"
4910
5081
  "transaction_hex"] = jsi::Function::createFromHostFunction(
4911
5082
  rt,
@@ -6212,6 +6383,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
6212
6383
  ->cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos(
6213
6384
  rt, thisVal, args, count);
6214
6385
  });
6386
+ props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
6387
+ "transaction_status"] = jsi::Function::createFromHostFunction(
6388
+ rt,
6389
+ jsi::PropNameID::forAscii(rt,
6390
+ "ubrn_uniffi_breez_sdk_spark_checksum_method_"
6391
+ "bitcoinchainservice_get_transaction_status"),
6392
+ 0,
6393
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
6394
+ const jsi::Value *args, size_t count) -> jsi::Value {
6395
+ return this
6396
+ ->cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status(
6397
+ rt, thisVal, args, count);
6398
+ });
6215
6399
  props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
6216
6400
  "transaction_hex"] = jsi::Function::createFromHostFunction(
6217
6401
  rt,
@@ -6946,6 +7130,9 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
6946
7130
  // Cleanup for callback function CallbackInterfaceBitcoinChainServiceMethod2
6947
7131
  uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod2::
6948
7132
  cleanup();
7133
+ // Cleanup for callback function CallbackInterfaceBitcoinChainServiceMethod3
7134
+ uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod3::
7135
+ cleanup();
6949
7136
  // Cleanup for callback function CallbackInterfaceStorageMethod0
6950
7137
  uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod0::cleanup();
6951
7138
  // Cleanup for callback function CallbackInterfaceStorageMethod1
@@ -7096,6 +7283,19 @@ jsi::Value NativeBreezSdkSpark::
7096
7283
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
7097
7284
  value);
7098
7285
  }
7286
+ jsi::Value NativeBreezSdkSpark::
7287
+ cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
7288
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
7289
+ size_t count) {
7290
+ auto value =
7291
+ uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
7292
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
7293
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
7294
+ args[1]));
7295
+
7296
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
7297
+ value);
7298
+ }
7099
7299
  jsi::Value NativeBreezSdkSpark::
7100
7300
  cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_hex(
7101
7301
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -8461,6 +8661,15 @@ jsi::Value NativeBreezSdkSpark::
8461
8661
 
8462
8662
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
8463
8663
  }
8664
+ jsi::Value NativeBreezSdkSpark::
8665
+ cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status(
8666
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
8667
+ size_t count) {
8668
+ auto value =
8669
+ uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status();
8670
+
8671
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
8672
+ }
8464
8673
  jsi::Value NativeBreezSdkSpark::
8465
8674
  cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex(
8466
8675
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -39,6 +39,10 @@ protected:
39
39
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
40
40
  size_t count);
41
41
  jsi::Value
42
+ cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
43
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
44
+ size_t count);
45
+ jsi::Value
42
46
  cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_hex(
43
47
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
44
48
  size_t count);
@@ -392,6 +396,10 @@ protected:
392
396
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
393
397
  size_t count);
394
398
  jsi::Value
399
+ cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status(
400
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
401
+ size_t count);
402
+ jsi::Value
395
403
  cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex(
396
404
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
397
405
  size_t count);
@@ -1 +1 @@
1
- {"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAueA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAC3BL,MAAM,EAErB;AAkPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AA4eA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAC3BL,MAAM,EAErB;AAyPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
@@ -4516,6 +4516,19 @@ class BitcoinChainServiceImpl extends _uniffiBindgenReactNative.UniffiAbstractOb
4516
4516
  throw __error;
4517
4517
  }
4518
4518
  }
4519
+ async getTransactionStatus(txid, asyncOpts_) /*throws*/{
4520
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4521
+ try {
4522
+ return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4523
+ return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(uniffiTypeBitcoinChainServiceImplObjectFactory.clonePointer(this), FfiConverterString.lower(txid));
4524
+ }, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeTxStatus.lift.bind(FfiConverterTypeTxStatus), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeChainServiceError.lift.bind(FfiConverterTypeChainServiceError));
4525
+ } catch (__error) {
4526
+ if (uniffiIsDebug && __error instanceof Error) {
4527
+ __error.stack = __stack;
4528
+ }
4529
+ throw __error;
4530
+ }
4531
+ }
4519
4532
  async getTransactionHex(txid, asyncOpts_) /*throws*/{
4520
4533
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4521
4534
  try {
@@ -4627,6 +4640,32 @@ const uniffiCallbackInterfaceBitcoinChainService = {
4627
4640
  const uniffiForeignFuture = (0, _uniffiBindgenReactNative.uniffiTraitInterfaceCallAsyncWithError)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ChainServiceError.instanceOf, /*lowerError:*/FfiConverterTypeChainServiceError.lower.bind(FfiConverterTypeChainServiceError), /*lowerString:*/FfiConverterString.lower);
4628
4641
  return _uniffiBindgenReactNative.UniffiResult.success(uniffiForeignFuture);
4629
4642
  },
4643
+ getTransactionStatus: (uniffiHandle, txid, uniffiFutureCallback, uniffiCallbackData) => {
4644
+ const uniffiMakeCall = async signal => {
4645
+ const jsCallback = FfiConverterTypeBitcoinChainService.lift(uniffiHandle);
4646
+ return await jsCallback.getTransactionStatus(FfiConverterString.lift(txid), {
4647
+ signal
4648
+ });
4649
+ };
4650
+ const uniffiHandleSuccess = returnValue => {
4651
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
4652
+ returnValue: FfiConverterTypeTxStatus.lower(returnValue),
4653
+ callStatus: uniffiCaller.createCallStatus()
4654
+ });
4655
+ };
4656
+ const uniffiHandleError = (code, errorBuf) => {
4657
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
4658
+ returnValue: /*empty*/new Uint8Array(0),
4659
+ // TODO create callstatus with error.
4660
+ callStatus: {
4661
+ code,
4662
+ errorBuf
4663
+ }
4664
+ });
4665
+ };
4666
+ const uniffiForeignFuture = (0, _uniffiBindgenReactNative.uniffiTraitInterfaceCallAsyncWithError)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ChainServiceError.instanceOf, /*lowerError:*/FfiConverterTypeChainServiceError.lower.bind(FfiConverterTypeChainServiceError), /*lowerString:*/FfiConverterString.lower);
4667
+ return _uniffiBindgenReactNative.UniffiResult.success(uniffiForeignFuture);
4668
+ },
4630
4669
  getTransactionHex: (uniffiHandle, txid, uniffiFutureCallback, uniffiCallbackData) => {
4631
4670
  const uniffiMakeCall = async signal => {
4632
4671
  const jsCallback = FfiConverterTypeBitcoinChainService.lift(uniffiHandle);
@@ -5970,10 +6009,13 @@ function uniffiEnsureInitialized() {
5970
6009
  if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos() !== 20959) {
5971
6010
  throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos');
5972
6011
  }
5973
- if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex() !== 19571) {
6012
+ if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status() !== 23018) {
6013
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status');
6014
+ }
6015
+ if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex() !== 59376) {
5974
6016
  throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex');
5975
6017
  }
5976
- if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction() !== 61083) {
6018
+ if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction() !== 65179) {
5977
6019
  throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction');
5978
6020
  }
5979
6021
  if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener() !== 61844) {