@breeztech/breez-sdk-spark-react-native 0.17.2 → 0.18.0

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.
@@ -155,6 +155,22 @@ typedef void (*UniffiCallbackInterfaceExternalBreezSignerMethod6)(
155
155
  uint64_t uniffi_handle, RustBuffer message, RustBuffer path,
156
156
  UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
157
157
  uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
158
+ typedef void (*UniffiCallbackInterfaceExternalSigningSignerMethod0)(
159
+ uint64_t uniffi_handle, RustBuffer path,
160
+ UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
161
+ uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
162
+ typedef void (*UniffiCallbackInterfaceExternalSigningSignerMethod1)(
163
+ uint64_t uniffi_handle, RustBuffer message, RustBuffer path,
164
+ UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
165
+ uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
166
+ typedef void (*UniffiCallbackInterfaceExternalSigningSignerMethod2)(
167
+ uint64_t uniffi_handle, RustBuffer message, RustBuffer path,
168
+ UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
169
+ uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
170
+ typedef void (*UniffiCallbackInterfaceExternalSigningSignerMethod3)(
171
+ uint64_t uniffi_handle, RustBuffer hash, RustBuffer path,
172
+ UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
173
+ uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
158
174
  typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod0)(
159
175
  uint64_t uniffi_handle,
160
176
  UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
@@ -418,6 +434,13 @@ typedef struct UniffiVTableCallbackInterfaceExternalBreezSigner {
418
434
  UniffiCallbackInterfaceExternalBreezSignerMethod6 hmac_sha256;
419
435
  UniffiCallbackInterfaceFree uniffi_free;
420
436
  } UniffiVTableCallbackInterfaceExternalBreezSigner;
437
+ typedef struct UniffiVTableCallbackInterfaceExternalSigningSigner {
438
+ UniffiCallbackInterfaceExternalSigningSignerMethod0 derive_public_key;
439
+ UniffiCallbackInterfaceExternalSigningSignerMethod1 sign_ecdsa;
440
+ UniffiCallbackInterfaceExternalSigningSignerMethod2 sign_ecdsa_recoverable;
441
+ UniffiCallbackInterfaceExternalSigningSignerMethod3 sign_hash_schnorr;
442
+ UniffiCallbackInterfaceFree uniffi_free;
443
+ } UniffiVTableCallbackInterfaceExternalSigningSigner;
421
444
  typedef struct UniffiVTableCallbackInterfaceExternalSparkSigner {
422
445
  UniffiCallbackInterfaceExternalSparkSignerMethod0 get_identity_public_key;
423
446
  UniffiCallbackInterfaceExternalSparkSignerMethod1 get_public_key_for_leaf;
@@ -684,6 +707,24 @@ uniffi_breez_sdk_spark_fn_method_externalbreezsigner_sign_hash_schnorr(
684
707
  /*handle*/ uint64_t
685
708
  uniffi_breez_sdk_spark_fn_method_externalbreezsigner_hmac_sha256(
686
709
  void *ptr, RustBuffer message, RustBuffer path);
710
+ void *uniffi_breez_sdk_spark_fn_clone_externalsigningsigner(
711
+ void *ptr, RustCallStatus *uniffi_out_err);
712
+ void uniffi_breez_sdk_spark_fn_free_externalsigningsigner(
713
+ void *ptr, RustCallStatus *uniffi_out_err);
714
+ void uniffi_breez_sdk_spark_fn_init_callback_vtable_externalsigningsigner(
715
+ UniffiVTableCallbackInterfaceExternalSigningSigner *vtable);
716
+ /*handle*/ uint64_t
717
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_derive_public_key(
718
+ void *ptr, RustBuffer path);
719
+ /*handle*/ uint64_t
720
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa(
721
+ void *ptr, RustBuffer message, RustBuffer path);
722
+ /*handle*/ uint64_t
723
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa_recoverable(
724
+ void *ptr, RustBuffer message, RustBuffer path);
725
+ /*handle*/ uint64_t
726
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_hash_schnorr(
727
+ void *ptr, RustBuffer hash, RustBuffer path);
687
728
  void *uniffi_breez_sdk_spark_fn_clone_externalsparksigner(
688
729
  void *ptr, RustCallStatus *uniffi_out_err);
689
730
  void uniffi_breez_sdk_spark_fn_free_externalsparksigner(
@@ -835,6 +876,10 @@ void *uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new(
835
876
  void *uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_signer(
836
877
  RustBuffer config, void *breez_signer, void *spark_signer,
837
878
  RustCallStatus *uniffi_out_err);
879
+ void *
880
+ uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_signing_only_signer(
881
+ RustBuffer config, void *breez_signer, void *spark_signer,
882
+ RustCallStatus *uniffi_out_err);
838
883
  /*handle*/ uint64_t
839
884
  uniffi_breez_sdk_spark_fn_method_sdkbuilder_build(void *ptr);
840
885
  /*handle*/ uint64_t
@@ -1013,7 +1058,13 @@ void uniffi_breez_sdk_spark_fn_init_callback_vtable_logger(
1013
1058
  /*handle*/ uint64_t
1014
1059
  uniffi_breez_sdk_spark_fn_func_connect_with_signer(RustBuffer request);
1015
1060
  /*handle*/ uint64_t
1061
+ uniffi_breez_sdk_spark_fn_func_connect_with_signing_only_signer(
1062
+ RustBuffer request);
1063
+ /*handle*/ uint64_t
1016
1064
  uniffi_breez_sdk_spark_fn_func_create_turnkey_signer(RustBuffer config);
1065
+ /*handle*/ uint64_t
1066
+ uniffi_breez_sdk_spark_fn_func_create_turnkey_signing_only_signer(
1067
+ RustBuffer config);
1017
1068
  void *
1018
1069
  uniffi_breez_sdk_spark_fn_func_custom_storage(void *storage,
1019
1070
  RustCallStatus *uniffi_out_err);
@@ -1166,7 +1217,11 @@ void ffi_breez_sdk_spark_rust_future_complete_void(
1166
1217
  /*handle*/ uint64_t handle, RustCallStatus *uniffi_out_err);
1167
1218
  uint16_t uniffi_breez_sdk_spark_checksum_func_connect();
1168
1219
  uint16_t uniffi_breez_sdk_spark_checksum_func_connect_with_signer();
1220
+ uint16_t
1221
+ uniffi_breez_sdk_spark_checksum_func_connect_with_signing_only_signer();
1169
1222
  uint16_t uniffi_breez_sdk_spark_checksum_func_create_turnkey_signer();
1223
+ uint16_t
1224
+ uniffi_breez_sdk_spark_checksum_func_create_turnkey_signing_only_signer();
1170
1225
  uint16_t uniffi_breez_sdk_spark_checksum_func_custom_storage();
1171
1226
  uint16_t uniffi_breez_sdk_spark_checksum_func_default_config();
1172
1227
  uint16_t uniffi_breez_sdk_spark_checksum_func_default_external_signers();
@@ -1258,6 +1313,14 @@ uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_sign_hash_schnorr();
1258
1313
  uint16_t
1259
1314
  uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_hmac_sha256();
1260
1315
  uint16_t
1316
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_derive_public_key();
1317
+ uint16_t
1318
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa();
1319
+ uint16_t
1320
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa_recoverable();
1321
+ uint16_t
1322
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_hash_schnorr();
1323
+ uint16_t
1261
1324
  uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_identity_public_key();
1262
1325
  uint16_t
1263
1326
  uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_public_key_for_leaf();
@@ -1385,6 +1448,8 @@ uint16_t uniffi_breez_sdk_spark_checksum_constructor_passkeyclient_new();
1385
1448
  uint16_t uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new();
1386
1449
  uint16_t
1387
1450
  uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_signer();
1451
+ uint16_t
1452
+ uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_signing_only_signer();
1388
1453
  uint16_t uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event();
1389
1454
  uint16_t uniffi_breez_sdk_spark_checksum_method_logger_log();
1390
1455
  uint32_t ffi_breez_sdk_spark_uniffi_contract_version();
@@ -2305,6 +2370,119 @@ static void cleanup() {
2305
2370
  } // namespace
2306
2371
  // uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalbreezsigner::vtablecallbackinterfaceexternalbreezsigner::free
2307
2372
 
2373
+ // Callback function:
2374
+ // uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsigningsigner::vtablecallbackinterfaceexternalsigningsigner::free::UniffiCallbackInterfaceFree
2375
+ //
2376
+ // We have the following constraints:
2377
+ // - we need to pass a function pointer to Rust.
2378
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
2379
+ // - function pointers can't store state, so we can't use a lamda.
2380
+ //
2381
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
2382
+ // function calls the lambda, which itself calls the `body` which then calls
2383
+ // into JS.
2384
+ //
2385
+ // We then give the `callback` function pointer to Rust which will call the
2386
+ // lambda sometime in the future.
2387
+ namespace uniffi::breez_sdk_spark::st::
2388
+ vtablecallbackinterfaceexternalsigningsigner::
2389
+ vtablecallbackinterfaceexternalsigningsigner::free {
2390
+ using namespace facebook;
2391
+
2392
+ // We need to store a lambda in a global so we can call it from
2393
+ // a function pointer. The function pointer is passed to Rust.
2394
+ static std::function<void(uint64_t)> rsLambda = nullptr;
2395
+
2396
+ // This is the main body of the callback. It's called from the lambda,
2397
+ // which itself is called from the callback function which is passed to Rust.
2398
+ static void body(jsi::Runtime &rt,
2399
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
2400
+ std::shared_ptr<jsi::Value> callbackValue,
2401
+ uint64_t rs_handle) {
2402
+
2403
+ // Convert the arguments from Rust, into jsi::Values.
2404
+ // We'll use the Bridging class to do this…
2405
+ auto js_handle =
2406
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
2407
+
2408
+ // Now we are ready to call the callback.
2409
+ // We are already on the JS thread, because this `body` function was
2410
+ // invoked from the CallInvoker.
2411
+ try {
2412
+ // Getting the callback function
2413
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
2414
+ auto uniffiResult = cb.call(rt, js_handle);
2415
+
2416
+ } catch (const jsi::JSError &error) {
2417
+ std::cout << "Error in callback UniffiCallbackInterfaceFree: "
2418
+ << error.what() << std::endl;
2419
+ throw error;
2420
+ }
2421
+ }
2422
+
2423
+ static void callback(uint64_t rs_handle) {
2424
+ // If the runtime has shutdown, then there is no point in trying to
2425
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
2426
+ //
2427
+ // Answer: the module destructor calls into callback `cleanup` method,
2428
+ // which nulls out the rsLamda.
2429
+ //
2430
+ // If rsLamda is null, then there is no runtime to call into.
2431
+ if (rsLambda == nullptr) {
2432
+ // This only occurs when destructors are calling into Rust free/drop,
2433
+ // which causes the JS callback to be dropped.
2434
+ return;
2435
+ }
2436
+
2437
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
2438
+ // are all in the lambda.
2439
+ rsLambda(rs_handle);
2440
+ }
2441
+
2442
+ static UniffiCallbackInterfaceFree
2443
+ makeCallbackFunction( // uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsigningsigner::vtablecallbackinterfaceexternalsigningsigner::free
2444
+ jsi::Runtime &rt,
2445
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
2446
+ const jsi::Value &value) {
2447
+ if (rsLambda != nullptr) {
2448
+ // `makeCallbackFunction` is called in two circumstances:
2449
+ //
2450
+ // 1. at startup, when initializing callback interface vtables.
2451
+ // 2. when polling futures. This happens at least once per future that is
2452
+ // exposed to Javascript. We know that this is always the same function,
2453
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
2454
+ //
2455
+ // We can therefore return the callback function without making anything
2456
+ // new if we've been initialized already.
2457
+ return callback;
2458
+ }
2459
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
2460
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
2461
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
2462
+ // We immediately make a lambda which will do the work of transforming the
2463
+ // arguments into JSI values and calling the callback.
2464
+ uniffi_runtime::UniffiCallFunc jsLambda =
2465
+ [callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
2466
+ body(rt, callInvoker, callbackValue, rs_handle);
2467
+ };
2468
+ // We'll then call that lambda from the callInvoker which will
2469
+ // look after calling it on the correct thread.
2470
+
2471
+ callInvoker->invokeNonBlocking(rt, jsLambda);
2472
+ };
2473
+ return callback;
2474
+ }
2475
+
2476
+ // This method is called from the destructor of NativeBreezSdkSpark, which only
2477
+ // happens when the jsi::Runtime is being destroyed.
2478
+ static void cleanup() {
2479
+ // The lambda holds a reference to the the Runtime, so when this is nulled
2480
+ // out, then the pointer will no longer be left dangling.
2481
+ rsLambda = nullptr;
2482
+ }
2483
+ } // namespace
2484
+ // uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsigningsigner::vtablecallbackinterfaceexternalsigningsigner::free
2485
+
2308
2486
  // Callback function:
2309
2487
  // uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsparksigner::vtablecallbackinterfaceexternalsparksigner::free::UniffiCallbackInterfaceFree
2310
2488
  //
@@ -5235,8 +5413,608 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
5235
5413
  [callInvoker, callbackValue, rs_uniffiHandle, rs_path,
5236
5414
  rs_uniffiFutureCallback, rs_uniffiCallbackData,
5237
5415
  rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5238
- body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_path,
5239
- rs_uniffiFutureCallback, rs_uniffiCallbackData,
5416
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_path,
5417
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
5418
+ rs_uniffiOutReturn);
5419
+ };
5420
+ // We'll then call that lambda from the callInvoker which will
5421
+ // look after calling it on the correct thread.
5422
+ callInvoker->invokeBlocking(rt, jsLambda);
5423
+ };
5424
+ return callback;
5425
+ }
5426
+
5427
+ // This method is called from the destructor of NativeBreezSdkSpark, which only
5428
+ // happens when the jsi::Runtime is being destroyed.
5429
+ static void cleanup() {
5430
+ // The lambda holds a reference to the the Runtime, so when this is nulled
5431
+ // out, then the pointer will no longer be left dangling.
5432
+ rsLambda = nullptr;
5433
+ }
5434
+ } // namespace
5435
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod0
5436
+ // Implementation of callback function calling from Rust to JS
5437
+ // CallbackInterfaceExternalBreezSignerMethod1
5438
+
5439
+ // Callback function:
5440
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod1::UniffiCallbackInterfaceExternalBreezSignerMethod1
5441
+ //
5442
+ // We have the following constraints:
5443
+ // - we need to pass a function pointer to Rust.
5444
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
5445
+ // - function pointers can't store state, so we can't use a lamda.
5446
+ //
5447
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
5448
+ // function calls the lambda, which itself calls the `body` which then calls
5449
+ // into JS.
5450
+ //
5451
+ // We then give the `callback` function pointer to Rust which will call the
5452
+ // lambda sometime in the future.
5453
+ namespace uniffi::breez_sdk_spark::cb::
5454
+ callbackinterfaceexternalbreezsignermethod1 {
5455
+ using namespace facebook;
5456
+
5457
+ // We need to store a lambda in a global so we can call it from
5458
+ // a function pointer. The function pointer is passed to Rust.
5459
+ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5460
+ UniffiForeignFutureCompleteRustBuffer, uint64_t,
5461
+ UniffiForeignFuture *)>
5462
+ rsLambda = nullptr;
5463
+
5464
+ // This is the main body of the callback. It's called from the lambda,
5465
+ // which itself is called from the callback function which is passed to Rust.
5466
+ static void body(jsi::Runtime &rt,
5467
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5468
+ std::shared_ptr<jsi::Value> callbackValue,
5469
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5470
+ RustBuffer rs_path,
5471
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5472
+ uint64_t rs_uniffiCallbackData,
5473
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5474
+
5475
+ // Convert the arguments from Rust, into jsi::Values.
5476
+ // We'll use the Bridging class to do this…
5477
+ auto js_uniffiHandle =
5478
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5479
+ auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5480
+ rt, callInvoker, rs_message);
5481
+ auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5482
+ rt, callInvoker, rs_path);
5483
+ auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
5484
+ UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
5485
+ rs_uniffiFutureCallback);
5486
+ auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
5487
+ rt, callInvoker, rs_uniffiCallbackData);
5488
+
5489
+ // Now we are ready to call the callback.
5490
+ // We are already on the JS thread, because this `body` function was
5491
+ // invoked from the CallInvoker.
5492
+ try {
5493
+ // Getting the callback function
5494
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
5495
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
5496
+ js_uniffiFutureCallback, js_uniffiCallbackData);
5497
+
5498
+ // return type is MutReference(Struct("ForeignFuture"))
5499
+ // Finally, we need to copy the return value back into the Rust pointer.
5500
+ *rs_uniffiOutReturn =
5501
+ uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
5502
+ rt, callInvoker, uniffiResult);
5503
+ } catch (const jsi::JSError &error) {
5504
+ std::cout << "Error in callback "
5505
+ "UniffiCallbackInterfaceExternalBreezSignerMethod1: "
5506
+ << error.what() << std::endl;
5507
+ throw error;
5508
+ }
5509
+ }
5510
+
5511
+ static void
5512
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5513
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5514
+ uint64_t rs_uniffiCallbackData,
5515
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5516
+ // If the runtime has shutdown, then there is no point in trying to
5517
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
5518
+ //
5519
+ // Answer: the module destructor calls into callback `cleanup` method,
5520
+ // which nulls out the rsLamda.
5521
+ //
5522
+ // If rsLamda is null, then there is no runtime to call into.
5523
+ if (rsLambda == nullptr) {
5524
+ // This only occurs when destructors are calling into Rust free/drop,
5525
+ // which causes the JS callback to be dropped.
5526
+ return;
5527
+ }
5528
+
5529
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
5530
+ // are all in the lambda.
5531
+ rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
5532
+ rs_uniffiCallbackData, rs_uniffiOutReturn);
5533
+ }
5534
+
5535
+ static UniffiCallbackInterfaceExternalBreezSignerMethod1
5536
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod1
5537
+ jsi::Runtime &rt,
5538
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5539
+ const jsi::Value &value) {
5540
+ if (rsLambda != nullptr) {
5541
+ // `makeCallbackFunction` is called in two circumstances:
5542
+ //
5543
+ // 1. at startup, when initializing callback interface vtables.
5544
+ // 2. when polling futures. This happens at least once per future that is
5545
+ // exposed to Javascript. We know that this is always the same function,
5546
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
5547
+ //
5548
+ // We can therefore return the callback function without making anything
5549
+ // new if we've been initialized already.
5550
+ return callback;
5551
+ }
5552
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
5553
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
5554
+ rsLambda = [&rt, callInvoker, callbackValue](
5555
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5556
+ RustBuffer rs_path,
5557
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5558
+ uint64_t rs_uniffiCallbackData,
5559
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5560
+ // We immediately make a lambda which will do the work of transforming the
5561
+ // arguments into JSI values and calling the callback.
5562
+ uniffi_runtime::UniffiCallFunc jsLambda =
5563
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
5564
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
5565
+ rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5566
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
5567
+ rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
5568
+ rs_uniffiOutReturn);
5569
+ };
5570
+ // We'll then call that lambda from the callInvoker which will
5571
+ // look after calling it on the correct thread.
5572
+ callInvoker->invokeBlocking(rt, jsLambda);
5573
+ };
5574
+ return callback;
5575
+ }
5576
+
5577
+ // This method is called from the destructor of NativeBreezSdkSpark, which only
5578
+ // happens when the jsi::Runtime is being destroyed.
5579
+ static void cleanup() {
5580
+ // The lambda holds a reference to the the Runtime, so when this is nulled
5581
+ // out, then the pointer will no longer be left dangling.
5582
+ rsLambda = nullptr;
5583
+ }
5584
+ } // namespace
5585
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod1
5586
+ // Implementation of callback function calling from Rust to JS
5587
+ // CallbackInterfaceExternalBreezSignerMethod2
5588
+
5589
+ // Callback function:
5590
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod2::UniffiCallbackInterfaceExternalBreezSignerMethod2
5591
+ //
5592
+ // We have the following constraints:
5593
+ // - we need to pass a function pointer to Rust.
5594
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
5595
+ // - function pointers can't store state, so we can't use a lamda.
5596
+ //
5597
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
5598
+ // function calls the lambda, which itself calls the `body` which then calls
5599
+ // into JS.
5600
+ //
5601
+ // We then give the `callback` function pointer to Rust which will call the
5602
+ // lambda sometime in the future.
5603
+ namespace uniffi::breez_sdk_spark::cb::
5604
+ callbackinterfaceexternalbreezsignermethod2 {
5605
+ using namespace facebook;
5606
+
5607
+ // We need to store a lambda in a global so we can call it from
5608
+ // a function pointer. The function pointer is passed to Rust.
5609
+ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5610
+ UniffiForeignFutureCompleteRustBuffer, uint64_t,
5611
+ UniffiForeignFuture *)>
5612
+ rsLambda = nullptr;
5613
+
5614
+ // This is the main body of the callback. It's called from the lambda,
5615
+ // which itself is called from the callback function which is passed to Rust.
5616
+ static void body(jsi::Runtime &rt,
5617
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5618
+ std::shared_ptr<jsi::Value> callbackValue,
5619
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5620
+ RustBuffer rs_path,
5621
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5622
+ uint64_t rs_uniffiCallbackData,
5623
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5624
+
5625
+ // Convert the arguments from Rust, into jsi::Values.
5626
+ // We'll use the Bridging class to do this…
5627
+ auto js_uniffiHandle =
5628
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5629
+ auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5630
+ rt, callInvoker, rs_message);
5631
+ auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5632
+ rt, callInvoker, rs_path);
5633
+ auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
5634
+ UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
5635
+ rs_uniffiFutureCallback);
5636
+ auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
5637
+ rt, callInvoker, rs_uniffiCallbackData);
5638
+
5639
+ // Now we are ready to call the callback.
5640
+ // We are already on the JS thread, because this `body` function was
5641
+ // invoked from the CallInvoker.
5642
+ try {
5643
+ // Getting the callback function
5644
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
5645
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
5646
+ js_uniffiFutureCallback, js_uniffiCallbackData);
5647
+
5648
+ // return type is MutReference(Struct("ForeignFuture"))
5649
+ // Finally, we need to copy the return value back into the Rust pointer.
5650
+ *rs_uniffiOutReturn =
5651
+ uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
5652
+ rt, callInvoker, uniffiResult);
5653
+ } catch (const jsi::JSError &error) {
5654
+ std::cout << "Error in callback "
5655
+ "UniffiCallbackInterfaceExternalBreezSignerMethod2: "
5656
+ << error.what() << std::endl;
5657
+ throw error;
5658
+ }
5659
+ }
5660
+
5661
+ static void
5662
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5663
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5664
+ uint64_t rs_uniffiCallbackData,
5665
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5666
+ // If the runtime has shutdown, then there is no point in trying to
5667
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
5668
+ //
5669
+ // Answer: the module destructor calls into callback `cleanup` method,
5670
+ // which nulls out the rsLamda.
5671
+ //
5672
+ // If rsLamda is null, then there is no runtime to call into.
5673
+ if (rsLambda == nullptr) {
5674
+ // This only occurs when destructors are calling into Rust free/drop,
5675
+ // which causes the JS callback to be dropped.
5676
+ return;
5677
+ }
5678
+
5679
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
5680
+ // are all in the lambda.
5681
+ rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
5682
+ rs_uniffiCallbackData, rs_uniffiOutReturn);
5683
+ }
5684
+
5685
+ static UniffiCallbackInterfaceExternalBreezSignerMethod2
5686
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod2
5687
+ jsi::Runtime &rt,
5688
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5689
+ const jsi::Value &value) {
5690
+ if (rsLambda != nullptr) {
5691
+ // `makeCallbackFunction` is called in two circumstances:
5692
+ //
5693
+ // 1. at startup, when initializing callback interface vtables.
5694
+ // 2. when polling futures. This happens at least once per future that is
5695
+ // exposed to Javascript. We know that this is always the same function,
5696
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
5697
+ //
5698
+ // We can therefore return the callback function without making anything
5699
+ // new if we've been initialized already.
5700
+ return callback;
5701
+ }
5702
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
5703
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
5704
+ rsLambda = [&rt, callInvoker, callbackValue](
5705
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5706
+ RustBuffer rs_path,
5707
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5708
+ uint64_t rs_uniffiCallbackData,
5709
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5710
+ // We immediately make a lambda which will do the work of transforming the
5711
+ // arguments into JSI values and calling the callback.
5712
+ uniffi_runtime::UniffiCallFunc jsLambda =
5713
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
5714
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
5715
+ rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5716
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
5717
+ rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
5718
+ rs_uniffiOutReturn);
5719
+ };
5720
+ // We'll then call that lambda from the callInvoker which will
5721
+ // look after calling it on the correct thread.
5722
+ callInvoker->invokeBlocking(rt, jsLambda);
5723
+ };
5724
+ return callback;
5725
+ }
5726
+
5727
+ // This method is called from the destructor of NativeBreezSdkSpark, which only
5728
+ // happens when the jsi::Runtime is being destroyed.
5729
+ static void cleanup() {
5730
+ // The lambda holds a reference to the the Runtime, so when this is nulled
5731
+ // out, then the pointer will no longer be left dangling.
5732
+ rsLambda = nullptr;
5733
+ }
5734
+ } // namespace
5735
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod2
5736
+ // Implementation of callback function calling from Rust to JS
5737
+ // CallbackInterfaceExternalBreezSignerMethod3
5738
+
5739
+ // Callback function:
5740
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod3::UniffiCallbackInterfaceExternalBreezSignerMethod3
5741
+ //
5742
+ // We have the following constraints:
5743
+ // - we need to pass a function pointer to Rust.
5744
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
5745
+ // - function pointers can't store state, so we can't use a lamda.
5746
+ //
5747
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
5748
+ // function calls the lambda, which itself calls the `body` which then calls
5749
+ // into JS.
5750
+ //
5751
+ // We then give the `callback` function pointer to Rust which will call the
5752
+ // lambda sometime in the future.
5753
+ namespace uniffi::breez_sdk_spark::cb::
5754
+ callbackinterfaceexternalbreezsignermethod3 {
5755
+ using namespace facebook;
5756
+
5757
+ // We need to store a lambda in a global so we can call it from
5758
+ // a function pointer. The function pointer is passed to Rust.
5759
+ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5760
+ UniffiForeignFutureCompleteRustBuffer, uint64_t,
5761
+ UniffiForeignFuture *)>
5762
+ rsLambda = nullptr;
5763
+
5764
+ // This is the main body of the callback. It's called from the lambda,
5765
+ // which itself is called from the callback function which is passed to Rust.
5766
+ static void body(jsi::Runtime &rt,
5767
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5768
+ std::shared_ptr<jsi::Value> callbackValue,
5769
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5770
+ RustBuffer rs_path,
5771
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5772
+ uint64_t rs_uniffiCallbackData,
5773
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5774
+
5775
+ // Convert the arguments from Rust, into jsi::Values.
5776
+ // We'll use the Bridging class to do this…
5777
+ auto js_uniffiHandle =
5778
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5779
+ auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5780
+ rt, callInvoker, rs_message);
5781
+ auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5782
+ rt, callInvoker, rs_path);
5783
+ auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
5784
+ UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
5785
+ rs_uniffiFutureCallback);
5786
+ auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
5787
+ rt, callInvoker, rs_uniffiCallbackData);
5788
+
5789
+ // Now we are ready to call the callback.
5790
+ // We are already on the JS thread, because this `body` function was
5791
+ // invoked from the CallInvoker.
5792
+ try {
5793
+ // Getting the callback function
5794
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
5795
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
5796
+ js_uniffiFutureCallback, js_uniffiCallbackData);
5797
+
5798
+ // return type is MutReference(Struct("ForeignFuture"))
5799
+ // Finally, we need to copy the return value back into the Rust pointer.
5800
+ *rs_uniffiOutReturn =
5801
+ uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
5802
+ rt, callInvoker, uniffiResult);
5803
+ } catch (const jsi::JSError &error) {
5804
+ std::cout << "Error in callback "
5805
+ "UniffiCallbackInterfaceExternalBreezSignerMethod3: "
5806
+ << error.what() << std::endl;
5807
+ throw error;
5808
+ }
5809
+ }
5810
+
5811
+ static void
5812
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5813
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5814
+ uint64_t rs_uniffiCallbackData,
5815
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5816
+ // If the runtime has shutdown, then there is no point in trying to
5817
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
5818
+ //
5819
+ // Answer: the module destructor calls into callback `cleanup` method,
5820
+ // which nulls out the rsLamda.
5821
+ //
5822
+ // If rsLamda is null, then there is no runtime to call into.
5823
+ if (rsLambda == nullptr) {
5824
+ // This only occurs when destructors are calling into Rust free/drop,
5825
+ // which causes the JS callback to be dropped.
5826
+ return;
5827
+ }
5828
+
5829
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
5830
+ // are all in the lambda.
5831
+ rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
5832
+ rs_uniffiCallbackData, rs_uniffiOutReturn);
5833
+ }
5834
+
5835
+ static UniffiCallbackInterfaceExternalBreezSignerMethod3
5836
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod3
5837
+ jsi::Runtime &rt,
5838
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5839
+ const jsi::Value &value) {
5840
+ if (rsLambda != nullptr) {
5841
+ // `makeCallbackFunction` is called in two circumstances:
5842
+ //
5843
+ // 1. at startup, when initializing callback interface vtables.
5844
+ // 2. when polling futures. This happens at least once per future that is
5845
+ // exposed to Javascript. We know that this is always the same function,
5846
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
5847
+ //
5848
+ // We can therefore return the callback function without making anything
5849
+ // new if we've been initialized already.
5850
+ return callback;
5851
+ }
5852
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
5853
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
5854
+ rsLambda = [&rt, callInvoker, callbackValue](
5855
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5856
+ RustBuffer rs_path,
5857
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5858
+ uint64_t rs_uniffiCallbackData,
5859
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5860
+ // We immediately make a lambda which will do the work of transforming the
5861
+ // arguments into JSI values and calling the callback.
5862
+ uniffi_runtime::UniffiCallFunc jsLambda =
5863
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
5864
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
5865
+ rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5866
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
5867
+ rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
5868
+ rs_uniffiOutReturn);
5869
+ };
5870
+ // We'll then call that lambda from the callInvoker which will
5871
+ // look after calling it on the correct thread.
5872
+ callInvoker->invokeBlocking(rt, jsLambda);
5873
+ };
5874
+ return callback;
5875
+ }
5876
+
5877
+ // This method is called from the destructor of NativeBreezSdkSpark, which only
5878
+ // happens when the jsi::Runtime is being destroyed.
5879
+ static void cleanup() {
5880
+ // The lambda holds a reference to the the Runtime, so when this is nulled
5881
+ // out, then the pointer will no longer be left dangling.
5882
+ rsLambda = nullptr;
5883
+ }
5884
+ } // namespace
5885
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod3
5886
+ // Implementation of callback function calling from Rust to JS
5887
+ // CallbackInterfaceExternalBreezSignerMethod4
5888
+
5889
+ // Callback function:
5890
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod4::UniffiCallbackInterfaceExternalBreezSignerMethod4
5891
+ //
5892
+ // We have the following constraints:
5893
+ // - we need to pass a function pointer to Rust.
5894
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
5895
+ // - function pointers can't store state, so we can't use a lamda.
5896
+ //
5897
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback`
5898
+ // function calls the lambda, which itself calls the `body` which then calls
5899
+ // into JS.
5900
+ //
5901
+ // We then give the `callback` function pointer to Rust which will call the
5902
+ // lambda sometime in the future.
5903
+ namespace uniffi::breez_sdk_spark::cb::
5904
+ callbackinterfaceexternalbreezsignermethod4 {
5905
+ using namespace facebook;
5906
+
5907
+ // We need to store a lambda in a global so we can call it from
5908
+ // a function pointer. The function pointer is passed to Rust.
5909
+ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5910
+ UniffiForeignFutureCompleteRustBuffer, uint64_t,
5911
+ UniffiForeignFuture *)>
5912
+ rsLambda = nullptr;
5913
+
5914
+ // This is the main body of the callback. It's called from the lambda,
5915
+ // which itself is called from the callback function which is passed to Rust.
5916
+ static void body(jsi::Runtime &rt,
5917
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5918
+ std::shared_ptr<jsi::Value> callbackValue,
5919
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5920
+ RustBuffer rs_path,
5921
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5922
+ uint64_t rs_uniffiCallbackData,
5923
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5924
+
5925
+ // Convert the arguments from Rust, into jsi::Values.
5926
+ // We'll use the Bridging class to do this…
5927
+ auto js_uniffiHandle =
5928
+ uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5929
+ auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5930
+ rt, callInvoker, rs_message);
5931
+ auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5932
+ rt, callInvoker, rs_path);
5933
+ auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
5934
+ UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
5935
+ rs_uniffiFutureCallback);
5936
+ auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
5937
+ rt, callInvoker, rs_uniffiCallbackData);
5938
+
5939
+ // Now we are ready to call the callback.
5940
+ // We are already on the JS thread, because this `body` function was
5941
+ // invoked from the CallInvoker.
5942
+ try {
5943
+ // Getting the callback function
5944
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
5945
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
5946
+ js_uniffiFutureCallback, js_uniffiCallbackData);
5947
+
5948
+ // return type is MutReference(Struct("ForeignFuture"))
5949
+ // Finally, we need to copy the return value back into the Rust pointer.
5950
+ *rs_uniffiOutReturn =
5951
+ uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
5952
+ rt, callInvoker, uniffiResult);
5953
+ } catch (const jsi::JSError &error) {
5954
+ std::cout << "Error in callback "
5955
+ "UniffiCallbackInterfaceExternalBreezSignerMethod4: "
5956
+ << error.what() << std::endl;
5957
+ throw error;
5958
+ }
5959
+ }
5960
+
5961
+ static void
5962
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5963
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5964
+ uint64_t rs_uniffiCallbackData,
5965
+ UniffiForeignFuture *rs_uniffiOutReturn) {
5966
+ // If the runtime has shutdown, then there is no point in trying to
5967
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
5968
+ //
5969
+ // Answer: the module destructor calls into callback `cleanup` method,
5970
+ // which nulls out the rsLamda.
5971
+ //
5972
+ // If rsLamda is null, then there is no runtime to call into.
5973
+ if (rsLambda == nullptr) {
5974
+ // This only occurs when destructors are calling into Rust free/drop,
5975
+ // which causes the JS callback to be dropped.
5976
+ return;
5977
+ }
5978
+
5979
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
5980
+ // are all in the lambda.
5981
+ rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
5982
+ rs_uniffiCallbackData, rs_uniffiOutReturn);
5983
+ }
5984
+
5985
+ static UniffiCallbackInterfaceExternalBreezSignerMethod4
5986
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod4
5987
+ jsi::Runtime &rt,
5988
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5989
+ const jsi::Value &value) {
5990
+ if (rsLambda != nullptr) {
5991
+ // `makeCallbackFunction` is called in two circumstances:
5992
+ //
5993
+ // 1. at startup, when initializing callback interface vtables.
5994
+ // 2. when polling futures. This happens at least once per future that is
5995
+ // exposed to Javascript. We know that this is always the same function,
5996
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
5997
+ //
5998
+ // We can therefore return the callback function without making anything
5999
+ // new if we've been initialized already.
6000
+ return callback;
6001
+ }
6002
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
6003
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
6004
+ rsLambda = [&rt, callInvoker, callbackValue](
6005
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
6006
+ RustBuffer rs_path,
6007
+ UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
6008
+ uint64_t rs_uniffiCallbackData,
6009
+ UniffiForeignFuture *rs_uniffiOutReturn) {
6010
+ // We immediately make a lambda which will do the work of transforming the
6011
+ // arguments into JSI values and calling the callback.
6012
+ uniffi_runtime::UniffiCallFunc jsLambda =
6013
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
6014
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
6015
+ rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
6016
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
6017
+ rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
5240
6018
  rs_uniffiOutReturn);
5241
6019
  };
5242
6020
  // We'll then call that lambda from the callInvoker which will
@@ -5254,12 +6032,12 @@ static void cleanup() {
5254
6032
  rsLambda = nullptr;
5255
6033
  }
5256
6034
  } // namespace
5257
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod0
6035
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod4
5258
6036
  // Implementation of callback function calling from Rust to JS
5259
- // CallbackInterfaceExternalBreezSignerMethod1
6037
+ // CallbackInterfaceExternalBreezSignerMethod5
5260
6038
 
5261
6039
  // Callback function:
5262
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod1::UniffiCallbackInterfaceExternalBreezSignerMethod1
6040
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod5::UniffiCallbackInterfaceExternalBreezSignerMethod5
5263
6041
  //
5264
6042
  // We have the following constraints:
5265
6043
  // - we need to pass a function pointer to Rust.
@@ -5273,7 +6051,7 @@ static void cleanup() {
5273
6051
  // We then give the `callback` function pointer to Rust which will call the
5274
6052
  // lambda sometime in the future.
5275
6053
  namespace uniffi::breez_sdk_spark::cb::
5276
- callbackinterfaceexternalbreezsignermethod1 {
6054
+ callbackinterfaceexternalbreezsignermethod5 {
5277
6055
  using namespace facebook;
5278
6056
 
5279
6057
  // We need to store a lambda in a global so we can call it from
@@ -5288,7 +6066,7 @@ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5288
6066
  static void body(jsi::Runtime &rt,
5289
6067
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5290
6068
  std::shared_ptr<jsi::Value> callbackValue,
5291
- uint64_t rs_uniffiHandle, RustBuffer rs_message,
6069
+ uint64_t rs_uniffiHandle, RustBuffer rs_hash,
5292
6070
  RustBuffer rs_path,
5293
6071
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5294
6072
  uint64_t rs_uniffiCallbackData,
@@ -5298,8 +6076,8 @@ static void body(jsi::Runtime &rt,
5298
6076
  // We'll use the Bridging class to do this…
5299
6077
  auto js_uniffiHandle =
5300
6078
  uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5301
- auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5302
- rt, callInvoker, rs_message);
6079
+ auto js_hash = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
6080
+ rt, callInvoker, rs_hash);
5303
6081
  auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5304
6082
  rt, callInvoker, rs_path);
5305
6083
  auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
@@ -5314,7 +6092,7 @@ static void body(jsi::Runtime &rt,
5314
6092
  try {
5315
6093
  // Getting the callback function
5316
6094
  auto cb = callbackValue->asObject(rt).asFunction(rt);
5317
- auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
6095
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_hash, js_path,
5318
6096
  js_uniffiFutureCallback, js_uniffiCallbackData);
5319
6097
 
5320
6098
  // return type is MutReference(Struct("ForeignFuture"))
@@ -5324,14 +6102,14 @@ static void body(jsi::Runtime &rt,
5324
6102
  rt, callInvoker, uniffiResult);
5325
6103
  } catch (const jsi::JSError &error) {
5326
6104
  std::cout << "Error in callback "
5327
- "UniffiCallbackInterfaceExternalBreezSignerMethod1: "
6105
+ "UniffiCallbackInterfaceExternalBreezSignerMethod5: "
5328
6106
  << error.what() << std::endl;
5329
6107
  throw error;
5330
6108
  }
5331
6109
  }
5332
6110
 
5333
6111
  static void
5334
- callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
6112
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_hash, RustBuffer rs_path,
5335
6113
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5336
6114
  uint64_t rs_uniffiCallbackData,
5337
6115
  UniffiForeignFuture *rs_uniffiOutReturn) {
@@ -5350,12 +6128,12 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5350
6128
 
5351
6129
  // The runtime, the actual callback jsi::funtion, and the callInvoker
5352
6130
  // are all in the lambda.
5353
- rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
6131
+ rsLambda(rs_uniffiHandle, rs_hash, rs_path, rs_uniffiFutureCallback,
5354
6132
  rs_uniffiCallbackData, rs_uniffiOutReturn);
5355
6133
  }
5356
6134
 
5357
- static UniffiCallbackInterfaceExternalBreezSignerMethod1
5358
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod1
6135
+ static UniffiCallbackInterfaceExternalBreezSignerMethod5
6136
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod5
5359
6137
  jsi::Runtime &rt,
5360
6138
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5361
6139
  const jsi::Value &value) {
@@ -5374,7 +6152,7 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
5374
6152
  auto callbackFunction = value.asObject(rt).asFunction(rt);
5375
6153
  auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
5376
6154
  rsLambda = [&rt, callInvoker, callbackValue](
5377
- uint64_t rs_uniffiHandle, RustBuffer rs_message,
6155
+ uint64_t rs_uniffiHandle, RustBuffer rs_hash,
5378
6156
  RustBuffer rs_path,
5379
6157
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5380
6158
  uint64_t rs_uniffiCallbackData,
@@ -5382,10 +6160,10 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
5382
6160
  // We immediately make a lambda which will do the work of transforming the
5383
6161
  // arguments into JSI values and calling the callback.
5384
6162
  uniffi_runtime::UniffiCallFunc jsLambda =
5385
- [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
6163
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_hash, rs_path,
5386
6164
  rs_uniffiFutureCallback, rs_uniffiCallbackData,
5387
6165
  rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5388
- body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
6166
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_hash,
5389
6167
  rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
5390
6168
  rs_uniffiOutReturn);
5391
6169
  };
@@ -5404,12 +6182,12 @@ static void cleanup() {
5404
6182
  rsLambda = nullptr;
5405
6183
  }
5406
6184
  } // namespace
5407
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod1
6185
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod5
5408
6186
  // Implementation of callback function calling from Rust to JS
5409
- // CallbackInterfaceExternalBreezSignerMethod2
6187
+ // CallbackInterfaceExternalBreezSignerMethod6
5410
6188
 
5411
6189
  // Callback function:
5412
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod2::UniffiCallbackInterfaceExternalBreezSignerMethod2
6190
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6::UniffiCallbackInterfaceExternalBreezSignerMethod6
5413
6191
  //
5414
6192
  // We have the following constraints:
5415
6193
  // - we need to pass a function pointer to Rust.
@@ -5423,7 +6201,7 @@ static void cleanup() {
5423
6201
  // We then give the `callback` function pointer to Rust which will call the
5424
6202
  // lambda sometime in the future.
5425
6203
  namespace uniffi::breez_sdk_spark::cb::
5426
- callbackinterfaceexternalbreezsignermethod2 {
6204
+ callbackinterfaceexternalbreezsignermethod6 {
5427
6205
  using namespace facebook;
5428
6206
 
5429
6207
  // We need to store a lambda in a global so we can call it from
@@ -5474,7 +6252,7 @@ static void body(jsi::Runtime &rt,
5474
6252
  rt, callInvoker, uniffiResult);
5475
6253
  } catch (const jsi::JSError &error) {
5476
6254
  std::cout << "Error in callback "
5477
- "UniffiCallbackInterfaceExternalBreezSignerMethod2: "
6255
+ "UniffiCallbackInterfaceExternalBreezSignerMethod6: "
5478
6256
  << error.what() << std::endl;
5479
6257
  throw error;
5480
6258
  }
@@ -5504,8 +6282,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5504
6282
  rs_uniffiCallbackData, rs_uniffiOutReturn);
5505
6283
  }
5506
6284
 
5507
- static UniffiCallbackInterfaceExternalBreezSignerMethod2
5508
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod2
6285
+ static UniffiCallbackInterfaceExternalBreezSignerMethod6
6286
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6
5509
6287
  jsi::Runtime &rt,
5510
6288
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5511
6289
  const jsi::Value &value) {
@@ -5554,12 +6332,12 @@ static void cleanup() {
5554
6332
  rsLambda = nullptr;
5555
6333
  }
5556
6334
  } // namespace
5557
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod2
6335
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6
5558
6336
  // Implementation of callback function calling from Rust to JS
5559
- // CallbackInterfaceExternalBreezSignerMethod3
6337
+ // CallbackInterfaceExternalSigningSignerMethod0
5560
6338
 
5561
6339
  // Callback function:
5562
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod3::UniffiCallbackInterfaceExternalBreezSignerMethod3
6340
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod0::UniffiCallbackInterfaceExternalSigningSignerMethod0
5563
6341
  //
5564
6342
  // We have the following constraints:
5565
6343
  // - we need to pass a function pointer to Rust.
@@ -5573,12 +6351,12 @@ static void cleanup() {
5573
6351
  // We then give the `callback` function pointer to Rust which will call the
5574
6352
  // lambda sometime in the future.
5575
6353
  namespace uniffi::breez_sdk_spark::cb::
5576
- callbackinterfaceexternalbreezsignermethod3 {
6354
+ callbackinterfaceexternalsigningsignermethod0 {
5577
6355
  using namespace facebook;
5578
6356
 
5579
6357
  // We need to store a lambda in a global so we can call it from
5580
6358
  // a function pointer. The function pointer is passed to Rust.
5581
- static std::function<void(uint64_t, RustBuffer, RustBuffer,
6359
+ static std::function<void(uint64_t, RustBuffer,
5582
6360
  UniffiForeignFutureCompleteRustBuffer, uint64_t,
5583
6361
  UniffiForeignFuture *)>
5584
6362
  rsLambda = nullptr;
@@ -5588,8 +6366,7 @@ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5588
6366
  static void body(jsi::Runtime &rt,
5589
6367
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5590
6368
  std::shared_ptr<jsi::Value> callbackValue,
5591
- uint64_t rs_uniffiHandle, RustBuffer rs_message,
5592
- RustBuffer rs_path,
6369
+ uint64_t rs_uniffiHandle, RustBuffer rs_path,
5593
6370
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5594
6371
  uint64_t rs_uniffiCallbackData,
5595
6372
  UniffiForeignFuture *rs_uniffiOutReturn) {
@@ -5598,8 +6375,6 @@ static void body(jsi::Runtime &rt,
5598
6375
  // We'll use the Bridging class to do this…
5599
6376
  auto js_uniffiHandle =
5600
6377
  uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5601
- auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5602
- rt, callInvoker, rs_message);
5603
6378
  auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5604
6379
  rt, callInvoker, rs_path);
5605
6380
  auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
@@ -5614,7 +6389,7 @@ static void body(jsi::Runtime &rt,
5614
6389
  try {
5615
6390
  // Getting the callback function
5616
6391
  auto cb = callbackValue->asObject(rt).asFunction(rt);
5617
- auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
6392
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_path,
5618
6393
  js_uniffiFutureCallback, js_uniffiCallbackData);
5619
6394
 
5620
6395
  // return type is MutReference(Struct("ForeignFuture"))
@@ -5624,14 +6399,14 @@ static void body(jsi::Runtime &rt,
5624
6399
  rt, callInvoker, uniffiResult);
5625
6400
  } catch (const jsi::JSError &error) {
5626
6401
  std::cout << "Error in callback "
5627
- "UniffiCallbackInterfaceExternalBreezSignerMethod3: "
6402
+ "UniffiCallbackInterfaceExternalSigningSignerMethod0: "
5628
6403
  << error.what() << std::endl;
5629
6404
  throw error;
5630
6405
  }
5631
6406
  }
5632
6407
 
5633
6408
  static void
5634
- callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
6409
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_path,
5635
6410
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5636
6411
  uint64_t rs_uniffiCallbackData,
5637
6412
  UniffiForeignFuture *rs_uniffiOutReturn) {
@@ -5650,12 +6425,12 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5650
6425
 
5651
6426
  // The runtime, the actual callback jsi::funtion, and the callInvoker
5652
6427
  // are all in the lambda.
5653
- rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
6428
+ rsLambda(rs_uniffiHandle, rs_path, rs_uniffiFutureCallback,
5654
6429
  rs_uniffiCallbackData, rs_uniffiOutReturn);
5655
6430
  }
5656
6431
 
5657
- static UniffiCallbackInterfaceExternalBreezSignerMethod3
5658
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod3
6432
+ static UniffiCallbackInterfaceExternalSigningSignerMethod0
6433
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod0
5659
6434
  jsi::Runtime &rt,
5660
6435
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5661
6436
  const jsi::Value &value) {
@@ -5674,19 +6449,18 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
5674
6449
  auto callbackFunction = value.asObject(rt).asFunction(rt);
5675
6450
  auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
5676
6451
  rsLambda = [&rt, callInvoker, callbackValue](
5677
- uint64_t rs_uniffiHandle, RustBuffer rs_message,
5678
- RustBuffer rs_path,
6452
+ uint64_t rs_uniffiHandle, RustBuffer rs_path,
5679
6453
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5680
6454
  uint64_t rs_uniffiCallbackData,
5681
6455
  UniffiForeignFuture *rs_uniffiOutReturn) {
5682
6456
  // We immediately make a lambda which will do the work of transforming the
5683
6457
  // arguments into JSI values and calling the callback.
5684
6458
  uniffi_runtime::UniffiCallFunc jsLambda =
5685
- [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
6459
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_path,
5686
6460
  rs_uniffiFutureCallback, rs_uniffiCallbackData,
5687
6461
  rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5688
- body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
5689
- rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
6462
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_path,
6463
+ rs_uniffiFutureCallback, rs_uniffiCallbackData,
5690
6464
  rs_uniffiOutReturn);
5691
6465
  };
5692
6466
  // We'll then call that lambda from the callInvoker which will
@@ -5704,12 +6478,12 @@ static void cleanup() {
5704
6478
  rsLambda = nullptr;
5705
6479
  }
5706
6480
  } // namespace
5707
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod3
6481
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod0
5708
6482
  // Implementation of callback function calling from Rust to JS
5709
- // CallbackInterfaceExternalBreezSignerMethod4
6483
+ // CallbackInterfaceExternalSigningSignerMethod1
5710
6484
 
5711
6485
  // Callback function:
5712
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod4::UniffiCallbackInterfaceExternalBreezSignerMethod4
6486
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod1::UniffiCallbackInterfaceExternalSigningSignerMethod1
5713
6487
  //
5714
6488
  // We have the following constraints:
5715
6489
  // - we need to pass a function pointer to Rust.
@@ -5723,7 +6497,7 @@ static void cleanup() {
5723
6497
  // We then give the `callback` function pointer to Rust which will call the
5724
6498
  // lambda sometime in the future.
5725
6499
  namespace uniffi::breez_sdk_spark::cb::
5726
- callbackinterfaceexternalbreezsignermethod4 {
6500
+ callbackinterfaceexternalsigningsignermethod1 {
5727
6501
  using namespace facebook;
5728
6502
 
5729
6503
  // We need to store a lambda in a global so we can call it from
@@ -5774,7 +6548,7 @@ static void body(jsi::Runtime &rt,
5774
6548
  rt, callInvoker, uniffiResult);
5775
6549
  } catch (const jsi::JSError &error) {
5776
6550
  std::cout << "Error in callback "
5777
- "UniffiCallbackInterfaceExternalBreezSignerMethod4: "
6551
+ "UniffiCallbackInterfaceExternalSigningSignerMethod1: "
5778
6552
  << error.what() << std::endl;
5779
6553
  throw error;
5780
6554
  }
@@ -5804,8 +6578,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5804
6578
  rs_uniffiCallbackData, rs_uniffiOutReturn);
5805
6579
  }
5806
6580
 
5807
- static UniffiCallbackInterfaceExternalBreezSignerMethod4
5808
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod4
6581
+ static UniffiCallbackInterfaceExternalSigningSignerMethod1
6582
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod1
5809
6583
  jsi::Runtime &rt,
5810
6584
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5811
6585
  const jsi::Value &value) {
@@ -5854,12 +6628,12 @@ static void cleanup() {
5854
6628
  rsLambda = nullptr;
5855
6629
  }
5856
6630
  } // namespace
5857
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod4
6631
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod1
5858
6632
  // Implementation of callback function calling from Rust to JS
5859
- // CallbackInterfaceExternalBreezSignerMethod5
6633
+ // CallbackInterfaceExternalSigningSignerMethod2
5860
6634
 
5861
6635
  // Callback function:
5862
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod5::UniffiCallbackInterfaceExternalBreezSignerMethod5
6636
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod2::UniffiCallbackInterfaceExternalSigningSignerMethod2
5863
6637
  //
5864
6638
  // We have the following constraints:
5865
6639
  // - we need to pass a function pointer to Rust.
@@ -5873,7 +6647,7 @@ static void cleanup() {
5873
6647
  // We then give the `callback` function pointer to Rust which will call the
5874
6648
  // lambda sometime in the future.
5875
6649
  namespace uniffi::breez_sdk_spark::cb::
5876
- callbackinterfaceexternalbreezsignermethod5 {
6650
+ callbackinterfaceexternalsigningsignermethod2 {
5877
6651
  using namespace facebook;
5878
6652
 
5879
6653
  // We need to store a lambda in a global so we can call it from
@@ -5888,7 +6662,7 @@ static std::function<void(uint64_t, RustBuffer, RustBuffer,
5888
6662
  static void body(jsi::Runtime &rt,
5889
6663
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5890
6664
  std::shared_ptr<jsi::Value> callbackValue,
5891
- uint64_t rs_uniffiHandle, RustBuffer rs_hash,
6665
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5892
6666
  RustBuffer rs_path,
5893
6667
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5894
6668
  uint64_t rs_uniffiCallbackData,
@@ -5898,8 +6672,8 @@ static void body(jsi::Runtime &rt,
5898
6672
  // We'll use the Bridging class to do this…
5899
6673
  auto js_uniffiHandle =
5900
6674
  uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
5901
- auto js_hash = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5902
- rt, callInvoker, rs_hash);
6675
+ auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
6676
+ rt, callInvoker, rs_message);
5903
6677
  auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
5904
6678
  rt, callInvoker, rs_path);
5905
6679
  auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
@@ -5914,7 +6688,7 @@ static void body(jsi::Runtime &rt,
5914
6688
  try {
5915
6689
  // Getting the callback function
5916
6690
  auto cb = callbackValue->asObject(rt).asFunction(rt);
5917
- auto uniffiResult = cb.call(rt, js_uniffiHandle, js_hash, js_path,
6691
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
5918
6692
  js_uniffiFutureCallback, js_uniffiCallbackData);
5919
6693
 
5920
6694
  // return type is MutReference(Struct("ForeignFuture"))
@@ -5924,14 +6698,14 @@ static void body(jsi::Runtime &rt,
5924
6698
  rt, callInvoker, uniffiResult);
5925
6699
  } catch (const jsi::JSError &error) {
5926
6700
  std::cout << "Error in callback "
5927
- "UniffiCallbackInterfaceExternalBreezSignerMethod5: "
6701
+ "UniffiCallbackInterfaceExternalSigningSignerMethod2: "
5928
6702
  << error.what() << std::endl;
5929
6703
  throw error;
5930
6704
  }
5931
6705
  }
5932
6706
 
5933
6707
  static void
5934
- callback(uint64_t rs_uniffiHandle, RustBuffer rs_hash, RustBuffer rs_path,
6708
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
5935
6709
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5936
6710
  uint64_t rs_uniffiCallbackData,
5937
6711
  UniffiForeignFuture *rs_uniffiOutReturn) {
@@ -5950,12 +6724,12 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_hash, RustBuffer rs_path,
5950
6724
 
5951
6725
  // The runtime, the actual callback jsi::funtion, and the callInvoker
5952
6726
  // are all in the lambda.
5953
- rsLambda(rs_uniffiHandle, rs_hash, rs_path, rs_uniffiFutureCallback,
6727
+ rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
5954
6728
  rs_uniffiCallbackData, rs_uniffiOutReturn);
5955
6729
  }
5956
6730
 
5957
- static UniffiCallbackInterfaceExternalBreezSignerMethod5
5958
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod5
6731
+ static UniffiCallbackInterfaceExternalSigningSignerMethod2
6732
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod2
5959
6733
  jsi::Runtime &rt,
5960
6734
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
5961
6735
  const jsi::Value &value) {
@@ -5974,7 +6748,7 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
5974
6748
  auto callbackFunction = value.asObject(rt).asFunction(rt);
5975
6749
  auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
5976
6750
  rsLambda = [&rt, callInvoker, callbackValue](
5977
- uint64_t rs_uniffiHandle, RustBuffer rs_hash,
6751
+ uint64_t rs_uniffiHandle, RustBuffer rs_message,
5978
6752
  RustBuffer rs_path,
5979
6753
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
5980
6754
  uint64_t rs_uniffiCallbackData,
@@ -5982,10 +6756,10 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
5982
6756
  // We immediately make a lambda which will do the work of transforming the
5983
6757
  // arguments into JSI values and calling the callback.
5984
6758
  uniffi_runtime::UniffiCallFunc jsLambda =
5985
- [callInvoker, callbackValue, rs_uniffiHandle, rs_hash, rs_path,
6759
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
5986
6760
  rs_uniffiFutureCallback, rs_uniffiCallbackData,
5987
6761
  rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
5988
- body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_hash,
6762
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
5989
6763
  rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
5990
6764
  rs_uniffiOutReturn);
5991
6765
  };
@@ -6004,12 +6778,12 @@ static void cleanup() {
6004
6778
  rsLambda = nullptr;
6005
6779
  }
6006
6780
  } // namespace
6007
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod5
6781
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod2
6008
6782
  // Implementation of callback function calling from Rust to JS
6009
- // CallbackInterfaceExternalBreezSignerMethod6
6783
+ // CallbackInterfaceExternalSigningSignerMethod3
6010
6784
 
6011
6785
  // Callback function:
6012
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6::UniffiCallbackInterfaceExternalBreezSignerMethod6
6786
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod3::UniffiCallbackInterfaceExternalSigningSignerMethod3
6013
6787
  //
6014
6788
  // We have the following constraints:
6015
6789
  // - we need to pass a function pointer to Rust.
@@ -6023,7 +6797,7 @@ static void cleanup() {
6023
6797
  // We then give the `callback` function pointer to Rust which will call the
6024
6798
  // lambda sometime in the future.
6025
6799
  namespace uniffi::breez_sdk_spark::cb::
6026
- callbackinterfaceexternalbreezsignermethod6 {
6800
+ callbackinterfaceexternalsigningsignermethod3 {
6027
6801
  using namespace facebook;
6028
6802
 
6029
6803
  // We need to store a lambda in a global so we can call it from
@@ -6038,7 +6812,7 @@ static std::function<void(uint64_t, RustBuffer, RustBuffer,
6038
6812
  static void body(jsi::Runtime &rt,
6039
6813
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
6040
6814
  std::shared_ptr<jsi::Value> callbackValue,
6041
- uint64_t rs_uniffiHandle, RustBuffer rs_message,
6815
+ uint64_t rs_uniffiHandle, RustBuffer rs_hash,
6042
6816
  RustBuffer rs_path,
6043
6817
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
6044
6818
  uint64_t rs_uniffiCallbackData,
@@ -6048,8 +6822,8 @@ static void body(jsi::Runtime &rt,
6048
6822
  // We'll use the Bridging class to do this…
6049
6823
  auto js_uniffiHandle =
6050
6824
  uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
6051
- auto js_message = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
6052
- rt, callInvoker, rs_message);
6825
+ auto js_hash = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
6826
+ rt, callInvoker, rs_hash);
6053
6827
  auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
6054
6828
  rt, callInvoker, rs_path);
6055
6829
  auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
@@ -6064,7 +6838,7 @@ static void body(jsi::Runtime &rt,
6064
6838
  try {
6065
6839
  // Getting the callback function
6066
6840
  auto cb = callbackValue->asObject(rt).asFunction(rt);
6067
- auto uniffiResult = cb.call(rt, js_uniffiHandle, js_message, js_path,
6841
+ auto uniffiResult = cb.call(rt, js_uniffiHandle, js_hash, js_path,
6068
6842
  js_uniffiFutureCallback, js_uniffiCallbackData);
6069
6843
 
6070
6844
  // return type is MutReference(Struct("ForeignFuture"))
@@ -6074,14 +6848,14 @@ static void body(jsi::Runtime &rt,
6074
6848
  rt, callInvoker, uniffiResult);
6075
6849
  } catch (const jsi::JSError &error) {
6076
6850
  std::cout << "Error in callback "
6077
- "UniffiCallbackInterfaceExternalBreezSignerMethod6: "
6851
+ "UniffiCallbackInterfaceExternalSigningSignerMethod3: "
6078
6852
  << error.what() << std::endl;
6079
6853
  throw error;
6080
6854
  }
6081
6855
  }
6082
6856
 
6083
6857
  static void
6084
- callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
6858
+ callback(uint64_t rs_uniffiHandle, RustBuffer rs_hash, RustBuffer rs_path,
6085
6859
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
6086
6860
  uint64_t rs_uniffiCallbackData,
6087
6861
  UniffiForeignFuture *rs_uniffiOutReturn) {
@@ -6100,12 +6874,12 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_message, RustBuffer rs_path,
6100
6874
 
6101
6875
  // The runtime, the actual callback jsi::funtion, and the callInvoker
6102
6876
  // are all in the lambda.
6103
- rsLambda(rs_uniffiHandle, rs_message, rs_path, rs_uniffiFutureCallback,
6877
+ rsLambda(rs_uniffiHandle, rs_hash, rs_path, rs_uniffiFutureCallback,
6104
6878
  rs_uniffiCallbackData, rs_uniffiOutReturn);
6105
6879
  }
6106
6880
 
6107
- static UniffiCallbackInterfaceExternalBreezSignerMethod6
6108
- makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6
6881
+ static UniffiCallbackInterfaceExternalSigningSignerMethod3
6882
+ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod3
6109
6883
  jsi::Runtime &rt,
6110
6884
  std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
6111
6885
  const jsi::Value &value) {
@@ -6124,7 +6898,7 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
6124
6898
  auto callbackFunction = value.asObject(rt).asFunction(rt);
6125
6899
  auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
6126
6900
  rsLambda = [&rt, callInvoker, callbackValue](
6127
- uint64_t rs_uniffiHandle, RustBuffer rs_message,
6901
+ uint64_t rs_uniffiHandle, RustBuffer rs_hash,
6128
6902
  RustBuffer rs_path,
6129
6903
  UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
6130
6904
  uint64_t rs_uniffiCallbackData,
@@ -6132,10 +6906,10 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalb
6132
6906
  // We immediately make a lambda which will do the work of transforming the
6133
6907
  // arguments into JSI values and calling the callback.
6134
6908
  uniffi_runtime::UniffiCallFunc jsLambda =
6135
- [callInvoker, callbackValue, rs_uniffiHandle, rs_message, rs_path,
6909
+ [callInvoker, callbackValue, rs_uniffiHandle, rs_hash, rs_path,
6136
6910
  rs_uniffiFutureCallback, rs_uniffiCallbackData,
6137
6911
  rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
6138
- body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_message,
6912
+ body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_hash,
6139
6913
  rs_path, rs_uniffiFutureCallback, rs_uniffiCallbackData,
6140
6914
  rs_uniffiOutReturn);
6141
6915
  };
@@ -6154,7 +6928,7 @@ static void cleanup() {
6154
6928
  rsLambda = nullptr;
6155
6929
  }
6156
6930
  } // namespace
6157
- // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6
6931
+ // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod3
6158
6932
  // Implementation of callback function calling from Rust to JS
6159
6933
  // CallbackInterfaceExternalSparkSignerMethod0
6160
6934
 
@@ -14827,6 +15601,52 @@ namespace uniffi::breez_sdk_spark {
14827
15601
  using namespace facebook;
14828
15602
  using CallInvoker = uniffi_runtime::UniffiCallInvoker;
14829
15603
 
15604
+ template <>
15605
+ struct Bridging<UniffiVTableCallbackInterfaceExternalSigningSigner> {
15606
+ static UniffiVTableCallbackInterfaceExternalSigningSigner
15607
+ fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
15608
+ const jsi::Value &jsValue) {
15609
+ // Check if the input is an object
15610
+ if (!jsValue.isObject()) {
15611
+ throw jsi::JSError(rt,
15612
+ "Expected an object for "
15613
+ "UniffiVTableCallbackInterfaceExternalSigningSigner");
15614
+ }
15615
+
15616
+ // Get the object from the jsi::Value
15617
+ auto jsObject = jsValue.getObject(rt);
15618
+
15619
+ // Create the vtable struct
15620
+ UniffiVTableCallbackInterfaceExternalSigningSigner rsObject;
15621
+
15622
+ // Create the vtable from the js callbacks.
15623
+ rsObject.derive_public_key = uniffi::breez_sdk_spark::cb::
15624
+ callbackinterfaceexternalsigningsignermethod0::makeCallbackFunction(
15625
+ rt, callInvoker, jsObject.getProperty(rt, "derivePublicKey"));
15626
+ rsObject.sign_ecdsa = uniffi::breez_sdk_spark::cb::
15627
+ callbackinterfaceexternalsigningsignermethod1::makeCallbackFunction(
15628
+ rt, callInvoker, jsObject.getProperty(rt, "signEcdsa"));
15629
+ rsObject.sign_ecdsa_recoverable = uniffi::breez_sdk_spark::cb::
15630
+ callbackinterfaceexternalsigningsignermethod2::makeCallbackFunction(
15631
+ rt, callInvoker, jsObject.getProperty(rt, "signEcdsaRecoverable"));
15632
+ rsObject.sign_hash_schnorr = uniffi::breez_sdk_spark::cb::
15633
+ callbackinterfaceexternalsigningsignermethod3::makeCallbackFunction(
15634
+ rt, callInvoker, jsObject.getProperty(rt, "signHashSchnorr"));
15635
+ rsObject.uniffi_free = uniffi::breez_sdk_spark::st::
15636
+ vtablecallbackinterfaceexternalsigningsigner::
15637
+ vtablecallbackinterfaceexternalsigningsigner::free::
15638
+ makeCallbackFunction(rt, callInvoker,
15639
+ jsObject.getProperty(rt, "uniffiFree"));
15640
+
15641
+ return rsObject;
15642
+ }
15643
+ };
15644
+
15645
+ } // namespace uniffi::breez_sdk_spark
15646
+ namespace uniffi::breez_sdk_spark {
15647
+ using namespace facebook;
15648
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
15649
+
14830
15650
  template <> struct Bridging<UniffiVTableCallbackInterfaceExternalSparkSigner> {
14831
15651
  static UniffiVTableCallbackInterfaceExternalSparkSigner
14832
15652
  fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
@@ -16131,6 +16951,91 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
16131
16951
  ->cpp_uniffi_breez_sdk_spark_fn_method_externalbreezsigner_hmac_sha256(
16132
16952
  rt, thisVal, args, count);
16133
16953
  });
16954
+ props["ubrn_uniffi_breez_sdk_spark_fn_clone_externalsigningsigner"] =
16955
+ jsi::Function::createFromHostFunction(
16956
+ rt,
16957
+ jsi::PropNameID::forAscii(
16958
+ rt, "ubrn_uniffi_breez_sdk_spark_fn_clone_externalsigningsigner"),
16959
+ 1,
16960
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
16961
+ const jsi::Value *args, size_t count) -> jsi::Value {
16962
+ return this
16963
+ ->cpp_uniffi_breez_sdk_spark_fn_clone_externalsigningsigner(
16964
+ rt, thisVal, args, count);
16965
+ });
16966
+ props["ubrn_uniffi_breez_sdk_spark_fn_free_externalsigningsigner"] =
16967
+ jsi::Function::createFromHostFunction(
16968
+ rt,
16969
+ jsi::PropNameID::forAscii(
16970
+ rt, "ubrn_uniffi_breez_sdk_spark_fn_free_externalsigningsigner"),
16971
+ 1,
16972
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
16973
+ const jsi::Value *args, size_t count) -> jsi::Value {
16974
+ return this
16975
+ ->cpp_uniffi_breez_sdk_spark_fn_free_externalsigningsigner(
16976
+ rt, thisVal, args, count);
16977
+ });
16978
+ props["ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_"
16979
+ "externalsigningsigner"] = jsi::Function::createFromHostFunction(
16980
+ rt,
16981
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_init_"
16982
+ "callback_vtable_externalsigningsigner"),
16983
+ 1,
16984
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
16985
+ const jsi::Value *args, size_t count) -> jsi::Value {
16986
+ return this
16987
+ ->cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_externalsigningsigner(
16988
+ rt, thisVal, args, count);
16989
+ });
16990
+ props["ubrn_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_derive_"
16991
+ "public_key"] = jsi::Function::createFromHostFunction(
16992
+ rt,
16993
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
16994
+ "externalsigningsigner_derive_public_key"),
16995
+ 2,
16996
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
16997
+ const jsi::Value *args, size_t count) -> jsi::Value {
16998
+ return this
16999
+ ->cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_derive_public_key(
17000
+ rt, thisVal, args, count);
17001
+ });
17002
+ props["ubrn_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_"
17003
+ "ecdsa"] = jsi::Function::createFromHostFunction(
17004
+ rt,
17005
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
17006
+ "externalsigningsigner_sign_ecdsa"),
17007
+ 3,
17008
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
17009
+ const jsi::Value *args, size_t count) -> jsi::Value {
17010
+ return this
17011
+ ->cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa(
17012
+ rt, thisVal, args, count);
17013
+ });
17014
+ props["ubrn_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_"
17015
+ "ecdsa_recoverable"] = jsi::Function::createFromHostFunction(
17016
+ rt,
17017
+ jsi::PropNameID::forAscii(rt,
17018
+ "ubrn_uniffi_breez_sdk_spark_fn_method_"
17019
+ "externalsigningsigner_sign_ecdsa_recoverable"),
17020
+ 3,
17021
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
17022
+ const jsi::Value *args, size_t count) -> jsi::Value {
17023
+ return this
17024
+ ->cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa_recoverable(
17025
+ rt, thisVal, args, count);
17026
+ });
17027
+ props["ubrn_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_hash_"
17028
+ "schnorr"] = jsi::Function::createFromHostFunction(
17029
+ rt,
17030
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
17031
+ "externalsigningsigner_sign_hash_schnorr"),
17032
+ 3,
17033
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
17034
+ const jsi::Value *args, size_t count) -> jsi::Value {
17035
+ return this
17036
+ ->cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_hash_schnorr(
17037
+ rt, thisVal, args, count);
17038
+ });
16134
17039
  props["ubrn_uniffi_breez_sdk_spark_fn_clone_externalsparksigner"] =
16135
17040
  jsi::Function::createFromHostFunction(
16136
17041
  rt,
@@ -16840,6 +17745,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
16840
17745
  ->cpp_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_signer(
16841
17746
  rt, thisVal, args, count);
16842
17747
  });
17748
+ props["ubrn_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_"
17749
+ "signing_only_signer"] = jsi::Function::createFromHostFunction(
17750
+ rt,
17751
+ jsi::PropNameID::forAscii(rt,
17752
+ "ubrn_uniffi_breez_sdk_spark_fn_constructor_"
17753
+ "sdkbuilder_new_with_signing_only_signer"),
17754
+ 3,
17755
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
17756
+ const jsi::Value *args, size_t count) -> jsi::Value {
17757
+ return this
17758
+ ->cpp_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_signing_only_signer(
17759
+ rt, thisVal, args, count);
17760
+ });
16843
17761
  props["ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_build"] =
16844
17762
  jsi::Function::createFromHostFunction(
16845
17763
  rt,
@@ -17644,6 +18562,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
17644
18562
  return this->cpp_uniffi_breez_sdk_spark_fn_func_connect_with_signer(
17645
18563
  rt, thisVal, args, count);
17646
18564
  });
18565
+ props["ubrn_uniffi_breez_sdk_spark_fn_func_connect_with_signing_only_"
18566
+ "signer"] = jsi::Function::createFromHostFunction(
18567
+ rt,
18568
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_func_"
18569
+ "connect_with_signing_only_signer"),
18570
+ 1,
18571
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
18572
+ const jsi::Value *args, size_t count) -> jsi::Value {
18573
+ return this
18574
+ ->cpp_uniffi_breez_sdk_spark_fn_func_connect_with_signing_only_signer(
18575
+ rt, thisVal, args, count);
18576
+ });
17647
18577
  props["ubrn_uniffi_breez_sdk_spark_fn_func_create_turnkey_signer"] =
17648
18578
  jsi::Function::createFromHostFunction(
17649
18579
  rt,
@@ -17656,6 +18586,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
17656
18586
  ->cpp_uniffi_breez_sdk_spark_fn_func_create_turnkey_signer(
17657
18587
  rt, thisVal, args, count);
17658
18588
  });
18589
+ props["ubrn_uniffi_breez_sdk_spark_fn_func_create_turnkey_signing_only_"
18590
+ "signer"] = jsi::Function::createFromHostFunction(
18591
+ rt,
18592
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_func_"
18593
+ "create_turnkey_signing_only_signer"),
18594
+ 1,
18595
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
18596
+ const jsi::Value *args, size_t count) -> jsi::Value {
18597
+ return this
18598
+ ->cpp_uniffi_breez_sdk_spark_fn_func_create_turnkey_signing_only_signer(
18599
+ rt, thisVal, args, count);
18600
+ });
17659
18601
  props["ubrn_uniffi_breez_sdk_spark_fn_func_custom_storage"] =
17660
18602
  jsi::Function::createFromHostFunction(
17661
18603
  rt,
@@ -18357,6 +19299,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
18357
19299
  ->cpp_uniffi_breez_sdk_spark_checksum_func_connect_with_signer(
18358
19300
  rt, thisVal, args, count);
18359
19301
  });
19302
+ props["ubrn_uniffi_breez_sdk_spark_checksum_func_connect_with_signing_only_"
19303
+ "signer"] = jsi::Function::createFromHostFunction(
19304
+ rt,
19305
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_func_"
19306
+ "connect_with_signing_only_signer"),
19307
+ 0,
19308
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
19309
+ const jsi::Value *args, size_t count) -> jsi::Value {
19310
+ return this
19311
+ ->cpp_uniffi_breez_sdk_spark_checksum_func_connect_with_signing_only_signer(
19312
+ rt, thisVal, args, count);
19313
+ });
18360
19314
  props["ubrn_uniffi_breez_sdk_spark_checksum_func_create_turnkey_signer"] =
18361
19315
  jsi::Function::createFromHostFunction(
18362
19316
  rt,
@@ -18369,6 +19323,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
18369
19323
  ->cpp_uniffi_breez_sdk_spark_checksum_func_create_turnkey_signer(
18370
19324
  rt, thisVal, args, count);
18371
19325
  });
19326
+ props["ubrn_uniffi_breez_sdk_spark_checksum_func_create_turnkey_signing_only_"
19327
+ "signer"] = jsi::Function::createFromHostFunction(
19328
+ rt,
19329
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_func_"
19330
+ "create_turnkey_signing_only_signer"),
19331
+ 0,
19332
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
19333
+ const jsi::Value *args, size_t count) -> jsi::Value {
19334
+ return this
19335
+ ->cpp_uniffi_breez_sdk_spark_checksum_func_create_turnkey_signing_only_signer(
19336
+ rt, thisVal, args, count);
19337
+ });
18372
19338
  props["ubrn_uniffi_breez_sdk_spark_checksum_func_custom_storage"] =
18373
19339
  jsi::Function::createFromHostFunction(
18374
19340
  rt,
@@ -19187,6 +20153,57 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
19187
20153
  ->cpp_uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_hmac_sha256(
19188
20154
  rt, thisVal, args, count);
19189
20155
  });
20156
+ props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_"
20157
+ "derive_public_key"] = jsi::Function::createFromHostFunction(
20158
+ rt,
20159
+ jsi::PropNameID::forAscii(rt,
20160
+ "ubrn_uniffi_breez_sdk_spark_checksum_method_"
20161
+ "externalsigningsigner_derive_public_key"),
20162
+ 0,
20163
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
20164
+ const jsi::Value *args, size_t count) -> jsi::Value {
20165
+ return this
20166
+ ->cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_derive_public_key(
20167
+ rt, thisVal, args, count);
20168
+ });
20169
+ props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_"
20170
+ "sign_ecdsa"] = jsi::Function::createFromHostFunction(
20171
+ rt,
20172
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
20173
+ "method_externalsigningsigner_sign_ecdsa"),
20174
+ 0,
20175
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
20176
+ const jsi::Value *args, size_t count) -> jsi::Value {
20177
+ return this
20178
+ ->cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa(
20179
+ rt, thisVal, args, count);
20180
+ });
20181
+ props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_"
20182
+ "sign_ecdsa_recoverable"] = jsi::Function::createFromHostFunction(
20183
+ rt,
20184
+ jsi::PropNameID::forAscii(rt,
20185
+ "ubrn_uniffi_breez_sdk_spark_checksum_method_"
20186
+ "externalsigningsigner_sign_ecdsa_recoverable"),
20187
+ 0,
20188
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
20189
+ const jsi::Value *args, size_t count) -> jsi::Value {
20190
+ return this
20191
+ ->cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa_recoverable(
20192
+ rt, thisVal, args, count);
20193
+ });
20194
+ props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_"
20195
+ "sign_hash_schnorr"] = jsi::Function::createFromHostFunction(
20196
+ rt,
20197
+ jsi::PropNameID::forAscii(rt,
20198
+ "ubrn_uniffi_breez_sdk_spark_checksum_method_"
20199
+ "externalsigningsigner_sign_hash_schnorr"),
20200
+ 0,
20201
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
20202
+ const jsi::Value *args, size_t count) -> jsi::Value {
20203
+ return this
20204
+ ->cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_hash_schnorr(
20205
+ rt, thisVal, args, count);
20206
+ });
19190
20207
  props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_"
19191
20208
  "identity_public_key"] = jsi::Function::createFromHostFunction(
19192
20209
  rt,
@@ -20255,6 +21272,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
20255
21272
  ->cpp_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_signer(
20256
21273
  rt, thisVal, args, count);
20257
21274
  });
21275
+ props["ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_"
21276
+ "signing_only_signer"] = jsi::Function::createFromHostFunction(
21277
+ rt,
21278
+ jsi::PropNameID::forAscii(
21279
+ rt, "ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_"
21280
+ "with_signing_only_signer"),
21281
+ 0,
21282
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
21283
+ const jsi::Value *args, size_t count) -> jsi::Value {
21284
+ return this
21285
+ ->cpp_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_signing_only_signer(
21286
+ rt, thisVal, args, count);
21287
+ });
20258
21288
  props["ubrn_uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event"] =
20259
21289
  jsi::Function::createFromHostFunction(
20260
21290
  rt,
@@ -20325,6 +21355,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
20325
21355
  ->cpp_uniffi_internal_fn_method_externalbreezsigner_ffi__bless_pointer(
20326
21356
  rt, thisVal, args, count);
20327
21357
  });
21358
+ props["ubrn_uniffi_internal_fn_method_externalsigningsigner_ffi__bless_"
21359
+ "pointer"] = jsi::Function::createFromHostFunction(
21360
+ rt,
21361
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_"
21362
+ "externalsigningsigner_ffi__bless_pointer"),
21363
+ 1,
21364
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal,
21365
+ const jsi::Value *args, size_t count) -> jsi::Value {
21366
+ return this
21367
+ ->cpp_uniffi_internal_fn_method_externalsigningsigner_ffi__bless_pointer(
21368
+ rt, thisVal, args, count);
21369
+ });
20328
21370
  props["ubrn_uniffi_internal_fn_method_externalsparksigner_ffi__bless_"
20329
21371
  "pointer"] = jsi::Function::createFromHostFunction(
20330
21372
  rt,
@@ -20551,6 +21593,8 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
20551
21593
  vtablecallbackinterfacebitcoinchainservice::free::cleanup();
20552
21594
  uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalbreezsigner::
20553
21595
  vtablecallbackinterfaceexternalbreezsigner::free::cleanup();
21596
+ uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsigningsigner::
21597
+ vtablecallbackinterfaceexternalsigningsigner::free::cleanup();
20554
21598
  uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsparksigner::
20555
21599
  vtablecallbackinterfaceexternalsparksigner::free::cleanup();
20556
21600
  uniffi::breez_sdk_spark::st::vtablecallbackinterfacefiatservice::
@@ -20607,6 +21651,18 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
20607
21651
  // Cleanup for callback function CallbackInterfaceExternalBreezSignerMethod6
20608
21652
  uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod6::
20609
21653
  cleanup();
21654
+ // Cleanup for callback function CallbackInterfaceExternalSigningSignerMethod0
21655
+ uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod0::
21656
+ cleanup();
21657
+ // Cleanup for callback function CallbackInterfaceExternalSigningSignerMethod1
21658
+ uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod1::
21659
+ cleanup();
21660
+ // Cleanup for callback function CallbackInterfaceExternalSigningSignerMethod2
21661
+ uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod2::
21662
+ cleanup();
21663
+ // Cleanup for callback function CallbackInterfaceExternalSigningSignerMethod3
21664
+ uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsigningsignermethod3::
21665
+ cleanup();
20610
21666
  // Cleanup for callback function CallbackInterfaceExternalSparkSignerMethod0
20611
21667
  uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod0::
20612
21668
  cleanup();
@@ -20814,6 +21870,22 @@ jsi::Value NativeBreezSdkSpark::
20814
21870
  auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
20815
21871
  return jsi::Value(rt, obj);
20816
21872
  }
21873
+ jsi::Value NativeBreezSdkSpark::
21874
+ cpp_uniffi_internal_fn_method_externalsigningsigner_ffi__bless_pointer(
21875
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
21876
+ size_t count) {
21877
+ auto pointer =
21878
+ uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
21879
+ auto static destructor = [](uint64_t p) {
21880
+ auto pointer = reinterpret_cast<void *>(static_cast<uintptr_t>(p));
21881
+ RustCallStatus status = {0};
21882
+ uniffi_breez_sdk_spark_fn_free_externalsigningsigner(pointer, &status);
21883
+ };
21884
+ auto ptrObj =
21885
+ std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
21886
+ auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
21887
+ return jsi::Value(rt, obj);
21888
+ }
20817
21889
  jsi::Value NativeBreezSdkSpark::
20818
21890
  cpp_uniffi_internal_fn_method_externalsparksigner_ffi__bless_pointer(
20819
21891
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -21853,6 +22925,107 @@ jsi::Value NativeBreezSdkSpark::
21853
22925
  value);
21854
22926
  }
21855
22927
  jsi::Value
22928
+ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_externalsigningsigner(
22929
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
22930
+ size_t count) {
22931
+ RustCallStatus status =
22932
+ uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
22933
+ auto value = uniffi_breez_sdk_spark_fn_clone_externalsigningsigner(
22934
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
22935
+ uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
22936
+ rt, callInvoker, status, args[count - 1]);
22937
+
22938
+ return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
22939
+ }
22940
+ jsi::Value
22941
+ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_free_externalsigningsigner(
22942
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
22943
+ size_t count) {
22944
+ RustCallStatus status =
22945
+ uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
22946
+ uniffi_breez_sdk_spark_fn_free_externalsigningsigner(
22947
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
22948
+ uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
22949
+ rt, callInvoker, status, args[count - 1]);
22950
+
22951
+ return jsi::Value::undefined();
22952
+ }
22953
+ jsi::Value NativeBreezSdkSpark::
22954
+ cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_externalsigningsigner(
22955
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
22956
+ size_t count) {
22957
+ auto vtableInstance = uniffi::breez_sdk_spark::Bridging<
22958
+ UniffiVTableCallbackInterfaceExternalSigningSigner>::fromJs(rt,
22959
+ callInvoker,
22960
+ args[0]);
22961
+
22962
+ std::lock_guard<std::mutex> lock(
22963
+ uniffi::breez_sdk_spark::registry::vtableMutex);
22964
+ uniffi_breez_sdk_spark_fn_init_callback_vtable_externalsigningsigner(
22965
+ uniffi::breez_sdk_spark::registry::putTable(
22966
+ "UniffiVTableCallbackInterfaceExternalSigningSigner",
22967
+ vtableInstance));
22968
+ return jsi::Value::undefined();
22969
+ }
22970
+ jsi::Value NativeBreezSdkSpark::
22971
+ cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_derive_public_key(
22972
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
22973
+ size_t count) {
22974
+ auto value =
22975
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_derive_public_key(
22976
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
22977
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
22978
+ args[1]));
22979
+
22980
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
22981
+ value);
22982
+ }
22983
+ jsi::Value NativeBreezSdkSpark::
22984
+ cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa(
22985
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
22986
+ size_t count) {
22987
+ auto value =
22988
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa(
22989
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
22990
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
22991
+ args[1]),
22992
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
22993
+ args[2]));
22994
+
22995
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
22996
+ value);
22997
+ }
22998
+ jsi::Value NativeBreezSdkSpark::
22999
+ cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa_recoverable(
23000
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
23001
+ size_t count) {
23002
+ auto value =
23003
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_ecdsa_recoverable(
23004
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
23005
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
23006
+ args[1]),
23007
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
23008
+ args[2]));
23009
+
23010
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
23011
+ value);
23012
+ }
23013
+ jsi::Value NativeBreezSdkSpark::
23014
+ cpp_uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_hash_schnorr(
23015
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
23016
+ size_t count) {
23017
+ auto value =
23018
+ uniffi_breez_sdk_spark_fn_method_externalsigningsigner_sign_hash_schnorr(
23019
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
23020
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
23021
+ args[1]),
23022
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
23023
+ args[2]));
23024
+
23025
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
23026
+ value);
23027
+ }
23028
+ jsi::Value
21856
23029
  NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_externalsparksigner(
21857
23030
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
21858
23031
  size_t count) {
@@ -22614,6 +23787,24 @@ jsi::Value NativeBreezSdkSpark::
22614
23787
 
22615
23788
  return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
22616
23789
  }
23790
+ jsi::Value NativeBreezSdkSpark::
23791
+ cpp_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_signing_only_signer(
23792
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
23793
+ size_t count) {
23794
+ RustCallStatus status =
23795
+ uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
23796
+ auto value =
23797
+ uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new_with_signing_only_signer(
23798
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
23799
+ args[0]),
23800
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[1]),
23801
+ uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[2]),
23802
+ &status);
23803
+ uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
23804
+ rt, callInvoker, status, args[count - 1]);
23805
+
23806
+ return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
23807
+ }
22617
23808
  jsi::Value
22618
23809
  NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_sdkbuilder_build(
22619
23810
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -23438,6 +24629,17 @@ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_connect_with_signer(
23438
24629
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
23439
24630
  value);
23440
24631
  }
24632
+ jsi::Value NativeBreezSdkSpark::
24633
+ cpp_uniffi_breez_sdk_spark_fn_func_connect_with_signing_only_signer(
24634
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
24635
+ size_t count) {
24636
+ auto value = uniffi_breez_sdk_spark_fn_func_connect_with_signing_only_signer(
24637
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
24638
+ args[0]));
24639
+
24640
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
24641
+ value);
24642
+ }
23441
24643
  jsi::Value
23442
24644
  NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_create_turnkey_signer(
23443
24645
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -23449,6 +24651,18 @@ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_create_turnkey_signer(
23449
24651
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
23450
24652
  value);
23451
24653
  }
24654
+ jsi::Value NativeBreezSdkSpark::
24655
+ cpp_uniffi_breez_sdk_spark_fn_func_create_turnkey_signing_only_signer(
24656
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
24657
+ size_t count) {
24658
+ auto value =
24659
+ uniffi_breez_sdk_spark_fn_func_create_turnkey_signing_only_signer(
24660
+ uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
24661
+ args[0]));
24662
+
24663
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
24664
+ value);
24665
+ }
23452
24666
  jsi::Value
23453
24667
  NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_custom_storage(
23454
24668
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -24218,6 +25432,15 @@ jsi::Value NativeBreezSdkSpark::
24218
25432
 
24219
25433
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
24220
25434
  }
25435
+ jsi::Value NativeBreezSdkSpark::
25436
+ cpp_uniffi_breez_sdk_spark_checksum_func_connect_with_signing_only_signer(
25437
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
25438
+ size_t count) {
25439
+ auto value =
25440
+ uniffi_breez_sdk_spark_checksum_func_connect_with_signing_only_signer();
25441
+
25442
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
25443
+ }
24221
25444
  jsi::Value NativeBreezSdkSpark::
24222
25445
  cpp_uniffi_breez_sdk_spark_checksum_func_create_turnkey_signer(
24223
25446
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -24226,6 +25449,15 @@ jsi::Value NativeBreezSdkSpark::
24226
25449
 
24227
25450
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
24228
25451
  }
25452
+ jsi::Value NativeBreezSdkSpark::
25453
+ cpp_uniffi_breez_sdk_spark_checksum_func_create_turnkey_signing_only_signer(
25454
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
25455
+ size_t count) {
25456
+ auto value =
25457
+ uniffi_breez_sdk_spark_checksum_func_create_turnkey_signing_only_signer();
25458
+
25459
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
25460
+ }
24229
25461
  jsi::Value
24230
25462
  NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_checksum_func_custom_storage(
24231
25463
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -24800,6 +26032,42 @@ jsi::Value NativeBreezSdkSpark::
24800
26032
 
24801
26033
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
24802
26034
  }
26035
+ jsi::Value NativeBreezSdkSpark::
26036
+ cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_derive_public_key(
26037
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
26038
+ size_t count) {
26039
+ auto value =
26040
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_derive_public_key();
26041
+
26042
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
26043
+ }
26044
+ jsi::Value NativeBreezSdkSpark::
26045
+ cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa(
26046
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
26047
+ size_t count) {
26048
+ auto value =
26049
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa();
26050
+
26051
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
26052
+ }
26053
+ jsi::Value NativeBreezSdkSpark::
26054
+ cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa_recoverable(
26055
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
26056
+ size_t count) {
26057
+ auto value =
26058
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_ecdsa_recoverable();
26059
+
26060
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
26061
+ }
26062
+ jsi::Value NativeBreezSdkSpark::
26063
+ cpp_uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_hash_schnorr(
26064
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
26065
+ size_t count) {
26066
+ auto value =
26067
+ uniffi_breez_sdk_spark_checksum_method_externalsigningsigner_sign_hash_schnorr();
26068
+
26069
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
26070
+ }
24803
26071
  jsi::Value NativeBreezSdkSpark::
24804
26072
  cpp_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_identity_public_key(
24805
26073
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
@@ -25561,6 +26829,15 @@ jsi::Value NativeBreezSdkSpark::
25561
26829
 
25562
26830
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
25563
26831
  }
26832
+ jsi::Value NativeBreezSdkSpark::
26833
+ cpp_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_signing_only_signer(
26834
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
26835
+ size_t count) {
26836
+ auto value =
26837
+ uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new_with_signing_only_signer();
26838
+
26839
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
26840
+ }
25564
26841
  jsi::Value NativeBreezSdkSpark::
25565
26842
  cpp_uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event(
25566
26843
  jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,