@breeztech/breez-sdk-spark-react-native 0.19.0 → 0.20.0-dev1
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.
- package/cpp/generated/breez_sdk_spark.cpp +1402 -157
- package/cpp/generated/breez_sdk_spark.hpp +63 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +348 -40
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +347 -39
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +48 -19
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +1493 -163
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +48 -19
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +1493 -163
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/generated/breez_sdk_spark-ffi.ts +104 -18
- package/src/generated/breez_sdk_spark.ts +2727 -61
|
@@ -112,7 +112,7 @@ typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod0)(
|
|
|
112
112
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
113
113
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
114
114
|
typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod1)(
|
|
115
|
-
uint64_t uniffi_handle, RustBuffer
|
|
115
|
+
uint64_t uniffi_handle, RustBuffer address,
|
|
116
116
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
117
117
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
118
118
|
typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod2)(
|
|
@@ -120,13 +120,25 @@ typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod2)(
|
|
|
120
120
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
121
121
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
122
122
|
typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod3)(
|
|
123
|
+
uint64_t uniffi_handle, RustBuffer txid,
|
|
124
|
+
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
125
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
126
|
+
typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod4)(
|
|
127
|
+
uint64_t uniffi_handle, RustBuffer txid, uint32_t vout,
|
|
128
|
+
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
129
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
130
|
+
typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod5)(
|
|
123
131
|
uint64_t uniffi_handle, RustBuffer tx,
|
|
124
132
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
125
133
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
126
|
-
typedef void (*
|
|
134
|
+
typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod6)(
|
|
127
135
|
uint64_t uniffi_handle,
|
|
128
136
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
129
137
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
138
|
+
typedef void (*UniffiCallbackInterfaceCpfpSignerMethod0)(
|
|
139
|
+
uint64_t uniffi_handle, RustBuffer psbt_bytes,
|
|
140
|
+
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
141
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
130
142
|
typedef void (*UniffiCallbackInterfaceExternalBreezSignerMethod0)(
|
|
131
143
|
uint64_t uniffi_handle, RustBuffer path,
|
|
132
144
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
@@ -195,11 +207,11 @@ typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod5)(
|
|
|
195
207
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
196
208
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
197
209
|
typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod6)(
|
|
198
|
-
uint64_t uniffi_handle, RustBuffer
|
|
210
|
+
uint64_t uniffi_handle, RustBuffer leaf_id, RustBuffer sighash,
|
|
199
211
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
200
212
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
201
213
|
typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod7)(
|
|
202
|
-
uint64_t uniffi_handle, RustBuffer
|
|
214
|
+
uint64_t uniffi_handle, RustBuffer jobs,
|
|
203
215
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
204
216
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
205
217
|
typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod8)(
|
|
@@ -234,6 +246,10 @@ typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod15)(
|
|
|
234
246
|
uint64_t uniffi_handle, RustBuffer request,
|
|
235
247
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
236
248
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
249
|
+
typedef void (*UniffiCallbackInterfaceExternalSparkSignerMethod16)(
|
|
250
|
+
uint64_t uniffi_handle, RustBuffer request,
|
|
251
|
+
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
252
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
237
253
|
typedef void (*UniffiCallbackInterfaceFiatServiceMethod0)(
|
|
238
254
|
uint64_t uniffi_handle,
|
|
239
255
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
@@ -421,12 +437,18 @@ typedef struct UniffiVTableCallbackInterfaceLogger {
|
|
|
421
437
|
} UniffiVTableCallbackInterfaceLogger;
|
|
422
438
|
typedef struct UniffiVTableCallbackInterfaceBitcoinChainService {
|
|
423
439
|
UniffiCallbackInterfaceBitcoinChainServiceMethod0 get_address_utxos;
|
|
424
|
-
UniffiCallbackInterfaceBitcoinChainServiceMethod1
|
|
425
|
-
UniffiCallbackInterfaceBitcoinChainServiceMethod2
|
|
426
|
-
UniffiCallbackInterfaceBitcoinChainServiceMethod3
|
|
427
|
-
UniffiCallbackInterfaceBitcoinChainServiceMethod4
|
|
440
|
+
UniffiCallbackInterfaceBitcoinChainServiceMethod1 get_address_txos;
|
|
441
|
+
UniffiCallbackInterfaceBitcoinChainServiceMethod2 get_transaction_status;
|
|
442
|
+
UniffiCallbackInterfaceBitcoinChainServiceMethod3 get_transaction_hex;
|
|
443
|
+
UniffiCallbackInterfaceBitcoinChainServiceMethod4 get_outspend;
|
|
444
|
+
UniffiCallbackInterfaceBitcoinChainServiceMethod5 broadcast_transaction;
|
|
445
|
+
UniffiCallbackInterfaceBitcoinChainServiceMethod6 recommended_fees;
|
|
428
446
|
UniffiCallbackInterfaceFree uniffi_free;
|
|
429
447
|
} UniffiVTableCallbackInterfaceBitcoinChainService;
|
|
448
|
+
typedef struct UniffiVTableCallbackInterfaceCpfpSigner {
|
|
449
|
+
UniffiCallbackInterfaceCpfpSignerMethod0 sign_psbt;
|
|
450
|
+
UniffiCallbackInterfaceFree uniffi_free;
|
|
451
|
+
} UniffiVTableCallbackInterfaceCpfpSigner;
|
|
430
452
|
typedef struct UniffiVTableCallbackInterfaceExternalBreezSigner {
|
|
431
453
|
UniffiCallbackInterfaceExternalBreezSignerMethod0 derive_public_key;
|
|
432
454
|
UniffiCallbackInterfaceExternalBreezSignerMethod1 sign_ecdsa;
|
|
@@ -453,17 +475,18 @@ typedef struct UniffiVTableCallbackInterfaceExternalSparkSigner {
|
|
|
453
475
|
UniffiCallbackInterfaceExternalSparkSignerMethod4
|
|
454
476
|
sign_authentication_challenge;
|
|
455
477
|
UniffiCallbackInterfaceExternalSparkSignerMethod5 sign_message;
|
|
456
|
-
UniffiCallbackInterfaceExternalSparkSignerMethod6
|
|
457
|
-
UniffiCallbackInterfaceExternalSparkSignerMethod7
|
|
458
|
-
UniffiCallbackInterfaceExternalSparkSignerMethod8
|
|
459
|
-
UniffiCallbackInterfaceExternalSparkSignerMethod9
|
|
460
|
-
UniffiCallbackInterfaceExternalSparkSignerMethod10
|
|
461
|
-
UniffiCallbackInterfaceExternalSparkSignerMethod11
|
|
478
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod6 sign_leaf_refund_spend;
|
|
479
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod7 sign_frost;
|
|
480
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod8 prepare_transfer;
|
|
481
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod9 prepare_claim;
|
|
482
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod10 prepare_lightning_receive;
|
|
483
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod11 prepare_static_deposit;
|
|
484
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod12
|
|
462
485
|
start_static_deposit_refund;
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
486
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod13 sign_static_deposit_refund;
|
|
487
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod14 sign_spark_invoice;
|
|
488
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod15 prepare_token_transaction;
|
|
489
|
+
UniffiCallbackInterfaceExternalSparkSignerMethod16
|
|
467
490
|
prepare_static_deposit_claim;
|
|
468
491
|
UniffiCallbackInterfaceFree uniffi_free;
|
|
469
492
|
} UniffiVTableCallbackInterfaceExternalSparkSigner;
|
|
@@ -542,12 +565,18 @@ void uniffi_breez_sdk_spark_fn_init_callback_vtable_bitcoinchainservice(
|
|
|
542
565
|
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_utxos(
|
|
543
566
|
void *ptr, RustBuffer address);
|
|
544
567
|
/*handle*/ uint64_t
|
|
568
|
+
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_txos(
|
|
569
|
+
void *ptr, RustBuffer address);
|
|
570
|
+
/*handle*/ uint64_t
|
|
545
571
|
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
|
|
546
572
|
void *ptr, RustBuffer txid);
|
|
547
573
|
/*handle*/ uint64_t
|
|
548
574
|
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_hex(
|
|
549
575
|
void *ptr, RustBuffer txid);
|
|
550
576
|
/*handle*/ uint64_t
|
|
577
|
+
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_outspend(
|
|
578
|
+
void *ptr, RustBuffer txid, uint32_t vout);
|
|
579
|
+
/*handle*/ uint64_t
|
|
551
580
|
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_broadcast_transaction(
|
|
552
581
|
void *ptr, RustBuffer tx);
|
|
553
582
|
/*handle*/ uint64_t
|
|
@@ -654,6 +683,9 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay(void *ptr,
|
|
|
654
683
|
uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_send_payment(
|
|
655
684
|
void *ptr, RustBuffer request);
|
|
656
685
|
/*handle*/ uint64_t
|
|
686
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_exit(
|
|
687
|
+
void *ptr, RustBuffer request);
|
|
688
|
+
/*handle*/ uint64_t
|
|
657
689
|
uniffi_breez_sdk_spark_fn_method_breezsdk_publish_signed_lnurl_pay_package(
|
|
658
690
|
void *ptr, RustBuffer request);
|
|
659
691
|
/*handle*/ uint64_t
|
|
@@ -687,6 +719,8 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message(void *ptr,
|
|
|
687
719
|
/*handle*/ uint64_t
|
|
688
720
|
uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(void *ptr,
|
|
689
721
|
RustBuffer request);
|
|
722
|
+
/*handle*/ uint64_t uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit(
|
|
723
|
+
void *ptr, RustBuffer request, void *signer);
|
|
690
724
|
/*handle*/ uint64_t
|
|
691
725
|
uniffi_breez_sdk_spark_fn_method_breezsdk_unregister_webhook(
|
|
692
726
|
void *ptr, RustBuffer request);
|
|
@@ -696,6 +730,16 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_update_contact(void *ptr,
|
|
|
696
730
|
/*handle*/ uint64_t
|
|
697
731
|
uniffi_breez_sdk_spark_fn_method_breezsdk_update_user_settings(
|
|
698
732
|
void *ptr, RustBuffer request);
|
|
733
|
+
void *
|
|
734
|
+
uniffi_breez_sdk_spark_fn_clone_cpfpsigner(void *ptr,
|
|
735
|
+
RustCallStatus *uniffi_out_err);
|
|
736
|
+
void uniffi_breez_sdk_spark_fn_free_cpfpsigner(void *ptr,
|
|
737
|
+
RustCallStatus *uniffi_out_err);
|
|
738
|
+
void uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner(
|
|
739
|
+
UniffiVTableCallbackInterfaceCpfpSigner *vtable);
|
|
740
|
+
/*handle*/ uint64_t
|
|
741
|
+
uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt(void *ptr,
|
|
742
|
+
RustBuffer psbt_bytes);
|
|
699
743
|
void *uniffi_breez_sdk_spark_fn_clone_externalbreezsigner(
|
|
700
744
|
void *ptr, RustCallStatus *uniffi_out_err);
|
|
701
745
|
void uniffi_breez_sdk_spark_fn_free_externalbreezsigner(
|
|
@@ -765,6 +809,9 @@ uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_authentication_challen
|
|
|
765
809
|
uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_message(
|
|
766
810
|
void *ptr, RustBuffer message);
|
|
767
811
|
/*handle*/ uint64_t
|
|
812
|
+
uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_refund_spend(
|
|
813
|
+
void *ptr, RustBuffer leaf_id, RustBuffer sighash);
|
|
814
|
+
/*handle*/ uint64_t
|
|
768
815
|
uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_frost(
|
|
769
816
|
void *ptr, RustBuffer jobs);
|
|
770
817
|
/*handle*/ uint64_t
|
|
@@ -1111,6 +1158,8 @@ void uniffi_breez_sdk_spark_fn_func_init_logging(
|
|
|
1111
1158
|
RustBuffer credentials);
|
|
1112
1159
|
/*handle*/ uint64_t
|
|
1113
1160
|
uniffi_breez_sdk_spark_fn_func_new_shared_sdk_context(RustBuffer config);
|
|
1161
|
+
void *uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer(
|
|
1162
|
+
RustBuffer secret_key_bytes, RustCallStatus *uniffi_out_err);
|
|
1114
1163
|
RustBuffer ffi_breez_sdk_spark_rustbuffer_alloc(uint64_t size,
|
|
1115
1164
|
RustCallStatus *uniffi_out_err);
|
|
1116
1165
|
RustBuffer
|
|
@@ -1255,13 +1304,18 @@ uint16_t uniffi_breez_sdk_spark_checksum_func_get_spark_status();
|
|
|
1255
1304
|
uint16_t uniffi_breez_sdk_spark_checksum_func_init_logging();
|
|
1256
1305
|
uint16_t uniffi_breez_sdk_spark_checksum_func_new_rest_chain_service();
|
|
1257
1306
|
uint16_t uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context();
|
|
1307
|
+
uint16_t uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer();
|
|
1258
1308
|
uint16_t
|
|
1259
1309
|
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos();
|
|
1260
1310
|
uint16_t
|
|
1311
|
+
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos();
|
|
1312
|
+
uint16_t
|
|
1261
1313
|
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status();
|
|
1262
1314
|
uint16_t
|
|
1263
1315
|
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex();
|
|
1264
1316
|
uint16_t
|
|
1317
|
+
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend();
|
|
1318
|
+
uint16_t
|
|
1265
1319
|
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction();
|
|
1266
1320
|
uint16_t
|
|
1267
1321
|
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_recommended_fees();
|
|
@@ -1311,6 +1365,8 @@ uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_parse();
|
|
|
1311
1365
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay();
|
|
1312
1366
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment();
|
|
1313
1367
|
uint16_t
|
|
1368
|
+
uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit();
|
|
1369
|
+
uint16_t
|
|
1314
1370
|
uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_lnurl_pay_package();
|
|
1315
1371
|
uint16_t
|
|
1316
1372
|
uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_transfer_package();
|
|
@@ -1327,9 +1383,11 @@ uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener();
|
|
|
1327
1383
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment();
|
|
1328
1384
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message();
|
|
1329
1385
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet();
|
|
1386
|
+
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit();
|
|
1330
1387
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_unregister_webhook();
|
|
1331
1388
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_update_contact();
|
|
1332
1389
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_update_user_settings();
|
|
1390
|
+
uint16_t uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt();
|
|
1333
1391
|
uint16_t
|
|
1334
1392
|
uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_derive_public_key();
|
|
1335
1393
|
uint16_t
|
|
@@ -1364,6 +1422,8 @@ uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_authentication_c
|
|
|
1364
1422
|
uint16_t
|
|
1365
1423
|
uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_message();
|
|
1366
1424
|
uint16_t
|
|
1425
|
+
uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend();
|
|
1426
|
+
uint16_t
|
|
1367
1427
|
uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost();
|
|
1368
1428
|
uint16_t
|
|
1369
1429
|
uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer();
|
|
@@ -2291,6 +2351,118 @@ static void cleanup() {
|
|
|
2291
2351
|
} // namespace
|
|
2292
2352
|
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacebitcoinchainservice::vtablecallbackinterfacebitcoinchainservice::free
|
|
2293
2353
|
|
|
2354
|
+
// Callback function:
|
|
2355
|
+
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacecpfpsigner::vtablecallbackinterfacecpfpsigner::free::UniffiCallbackInterfaceFree
|
|
2356
|
+
//
|
|
2357
|
+
// We have the following constraints:
|
|
2358
|
+
// - we need to pass a function pointer to Rust.
|
|
2359
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
2360
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
2361
|
+
//
|
|
2362
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
2363
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
2364
|
+
// into JS.
|
|
2365
|
+
//
|
|
2366
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
2367
|
+
// lambda sometime in the future.
|
|
2368
|
+
namespace uniffi::breez_sdk_spark::st::vtablecallbackinterfacecpfpsigner::
|
|
2369
|
+
vtablecallbackinterfacecpfpsigner::free {
|
|
2370
|
+
using namespace facebook;
|
|
2371
|
+
|
|
2372
|
+
// We need to store a lambda in a global so we can call it from
|
|
2373
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
2374
|
+
static std::function<void(uint64_t)> rsLambda = nullptr;
|
|
2375
|
+
|
|
2376
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
2377
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
2378
|
+
static void body(jsi::Runtime &rt,
|
|
2379
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
2380
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
2381
|
+
uint64_t rs_handle) {
|
|
2382
|
+
|
|
2383
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
2384
|
+
// We'll use the Bridging class to do this…
|
|
2385
|
+
auto js_handle =
|
|
2386
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
|
|
2387
|
+
|
|
2388
|
+
// Now we are ready to call the callback.
|
|
2389
|
+
// We are already on the JS thread, because this `body` function was
|
|
2390
|
+
// invoked from the CallInvoker.
|
|
2391
|
+
try {
|
|
2392
|
+
// Getting the callback function
|
|
2393
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
2394
|
+
auto uniffiResult = cb.call(rt, js_handle);
|
|
2395
|
+
|
|
2396
|
+
} catch (const jsi::JSError &error) {
|
|
2397
|
+
std::cout << "Error in callback UniffiCallbackInterfaceFree: "
|
|
2398
|
+
<< error.what() << std::endl;
|
|
2399
|
+
throw error;
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
static void callback(uint64_t rs_handle) {
|
|
2404
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
2405
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
2406
|
+
//
|
|
2407
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
2408
|
+
// which nulls out the rsLamda.
|
|
2409
|
+
//
|
|
2410
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
2411
|
+
if (rsLambda == nullptr) {
|
|
2412
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
2413
|
+
// which causes the JS callback to be dropped.
|
|
2414
|
+
return;
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
2418
|
+
// are all in the lambda.
|
|
2419
|
+
rsLambda(rs_handle);
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
static UniffiCallbackInterfaceFree
|
|
2423
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::st::vtablecallbackinterfacecpfpsigner::vtablecallbackinterfacecpfpsigner::free
|
|
2424
|
+
jsi::Runtime &rt,
|
|
2425
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
2426
|
+
const jsi::Value &value) {
|
|
2427
|
+
if (rsLambda != nullptr) {
|
|
2428
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
2429
|
+
//
|
|
2430
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
2431
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
2432
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
2433
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
2434
|
+
//
|
|
2435
|
+
// We can therefore return the callback function without making anything
|
|
2436
|
+
// new if we've been initialized already.
|
|
2437
|
+
return callback;
|
|
2438
|
+
}
|
|
2439
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
2440
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
2441
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
|
|
2442
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
2443
|
+
// arguments into JSI values and calling the callback.
|
|
2444
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
2445
|
+
[callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
|
|
2446
|
+
body(rt, callInvoker, callbackValue, rs_handle);
|
|
2447
|
+
};
|
|
2448
|
+
// We'll then call that lambda from the callInvoker which will
|
|
2449
|
+
// look after calling it on the correct thread.
|
|
2450
|
+
|
|
2451
|
+
callInvoker->invokeNonBlocking(rt, jsLambda);
|
|
2452
|
+
};
|
|
2453
|
+
return callback;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
2457
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
2458
|
+
static void cleanup() {
|
|
2459
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
2460
|
+
// out, then the pointer will no longer be left dangling.
|
|
2461
|
+
rsLambda = nullptr;
|
|
2462
|
+
}
|
|
2463
|
+
} // namespace
|
|
2464
|
+
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacecpfpsigner::vtablecallbackinterfacecpfpsigner::free
|
|
2465
|
+
|
|
2294
2466
|
// Callback function:
|
|
2295
2467
|
// uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalbreezsigner::vtablecallbackinterfaceexternalbreezsigner::free::UniffiCallbackInterfaceFree
|
|
2296
2468
|
//
|
|
@@ -4776,7 +4948,7 @@ static std::function<void(uint64_t, RustBuffer,
|
|
|
4776
4948
|
static void body(jsi::Runtime &rt,
|
|
4777
4949
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
4778
4950
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
4779
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
4951
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_address,
|
|
4780
4952
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
4781
4953
|
uint64_t rs_uniffiCallbackData,
|
|
4782
4954
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -4785,8 +4957,8 @@ static void body(jsi::Runtime &rt,
|
|
|
4785
4957
|
// We'll use the Bridging class to do this…
|
|
4786
4958
|
auto js_uniffiHandle =
|
|
4787
4959
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
4788
|
-
auto
|
|
4789
|
-
rt, callInvoker,
|
|
4960
|
+
auto js_address = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
4961
|
+
rt, callInvoker, rs_address);
|
|
4790
4962
|
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
4791
4963
|
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
4792
4964
|
rs_uniffiFutureCallback);
|
|
@@ -4799,7 +4971,7 @@ static void body(jsi::Runtime &rt,
|
|
|
4799
4971
|
try {
|
|
4800
4972
|
// Getting the callback function
|
|
4801
4973
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
4802
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
4974
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_address,
|
|
4803
4975
|
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
4804
4976
|
|
|
4805
4977
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
@@ -4816,7 +4988,7 @@ static void body(jsi::Runtime &rt,
|
|
|
4816
4988
|
}
|
|
4817
4989
|
|
|
4818
4990
|
static void
|
|
4819
|
-
callback(uint64_t rs_uniffiHandle, RustBuffer
|
|
4991
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_address,
|
|
4820
4992
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
4821
4993
|
uint64_t rs_uniffiCallbackData,
|
|
4822
4994
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -4835,7 +5007,7 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_txid,
|
|
|
4835
5007
|
|
|
4836
5008
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
4837
5009
|
// are all in the lambda.
|
|
4838
|
-
rsLambda(rs_uniffiHandle,
|
|
5010
|
+
rsLambda(rs_uniffiHandle, rs_address, rs_uniffiFutureCallback,
|
|
4839
5011
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
4840
5012
|
}
|
|
4841
5013
|
|
|
@@ -4859,17 +5031,17 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinch
|
|
|
4859
5031
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
4860
5032
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
4861
5033
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
4862
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
5034
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_address,
|
|
4863
5035
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
4864
5036
|
uint64_t rs_uniffiCallbackData,
|
|
4865
5037
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
4866
5038
|
// We immediately make a lambda which will do the work of transforming the
|
|
4867
5039
|
// arguments into JSI values and calling the callback.
|
|
4868
5040
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
4869
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
5041
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_address,
|
|
4870
5042
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
4871
5043
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
4872
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
5044
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_address,
|
|
4873
5045
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
4874
5046
|
rs_uniffiOutReturn);
|
|
4875
5047
|
};
|
|
@@ -5058,8 +5230,9 @@ using namespace facebook;
|
|
|
5058
5230
|
|
|
5059
5231
|
// We need to store a lambda in a global so we can call it from
|
|
5060
5232
|
// a function pointer. The function pointer is passed to Rust.
|
|
5061
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
5062
|
-
uint64_t,
|
|
5233
|
+
static std::function<void(uint64_t, RustBuffer,
|
|
5234
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
5235
|
+
UniffiForeignFuture *)>
|
|
5063
5236
|
rsLambda = nullptr;
|
|
5064
5237
|
|
|
5065
5238
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -5067,8 +5240,8 @@ static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
|
5067
5240
|
static void body(jsi::Runtime &rt,
|
|
5068
5241
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5069
5242
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
5070
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
5071
|
-
|
|
5243
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_txid,
|
|
5244
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5072
5245
|
uint64_t rs_uniffiCallbackData,
|
|
5073
5246
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5074
5247
|
|
|
@@ -5076,11 +5249,11 @@ static void body(jsi::Runtime &rt,
|
|
|
5076
5249
|
// We'll use the Bridging class to do this…
|
|
5077
5250
|
auto js_uniffiHandle =
|
|
5078
5251
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
5079
|
-
auto
|
|
5080
|
-
rt, callInvoker,
|
|
5081
|
-
auto js_uniffiFutureCallback =
|
|
5082
|
-
|
|
5083
|
-
|
|
5252
|
+
auto js_txid = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
5253
|
+
rt, callInvoker, rs_txid);
|
|
5254
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
5255
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
5256
|
+
rs_uniffiFutureCallback);
|
|
5084
5257
|
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
5085
5258
|
rt, callInvoker, rs_uniffiCallbackData);
|
|
5086
5259
|
|
|
@@ -5090,7 +5263,7 @@ static void body(jsi::Runtime &rt,
|
|
|
5090
5263
|
try {
|
|
5091
5264
|
// Getting the callback function
|
|
5092
5265
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
5093
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
5266
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_txid,
|
|
5094
5267
|
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
5095
5268
|
|
|
5096
5269
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
@@ -5106,10 +5279,11 @@ static void body(jsi::Runtime &rt,
|
|
|
5106
5279
|
}
|
|
5107
5280
|
}
|
|
5108
5281
|
|
|
5109
|
-
static void
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5282
|
+
static void
|
|
5283
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_txid,
|
|
5284
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5285
|
+
uint64_t rs_uniffiCallbackData,
|
|
5286
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5113
5287
|
// If the runtime has shutdown, then there is no point in trying to
|
|
5114
5288
|
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
5115
5289
|
//
|
|
@@ -5125,7 +5299,7 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_tx,
|
|
|
5125
5299
|
|
|
5126
5300
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
5127
5301
|
// are all in the lambda.
|
|
5128
|
-
rsLambda(rs_uniffiHandle,
|
|
5302
|
+
rsLambda(rs_uniffiHandle, rs_txid, rs_uniffiFutureCallback,
|
|
5129
5303
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
5130
5304
|
}
|
|
5131
5305
|
|
|
@@ -5149,17 +5323,17 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinch
|
|
|
5149
5323
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
5150
5324
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
5151
5325
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
5152
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
5153
|
-
|
|
5326
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_txid,
|
|
5327
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5154
5328
|
uint64_t rs_uniffiCallbackData,
|
|
5155
5329
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5156
5330
|
// We immediately make a lambda which will do the work of transforming the
|
|
5157
5331
|
// arguments into JSI values and calling the callback.
|
|
5158
5332
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
5159
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
5333
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_txid,
|
|
5160
5334
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5161
5335
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
5162
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
5336
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_txid,
|
|
5163
5337
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5164
5338
|
rs_uniffiOutReturn);
|
|
5165
5339
|
};
|
|
@@ -5202,8 +5376,9 @@ using namespace facebook;
|
|
|
5202
5376
|
|
|
5203
5377
|
// We need to store a lambda in a global so we can call it from
|
|
5204
5378
|
// a function pointer. The function pointer is passed to Rust.
|
|
5205
|
-
static std::function<void(uint64_t,
|
|
5206
|
-
uint64_t,
|
|
5379
|
+
static std::function<void(uint64_t, RustBuffer, uint32_t,
|
|
5380
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
5381
|
+
UniffiForeignFuture *)>
|
|
5207
5382
|
rsLambda = nullptr;
|
|
5208
5383
|
|
|
5209
5384
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -5211,7 +5386,7 @@ static std::function<void(uint64_t, UniffiForeignFutureCompleteRustBuffer,
|
|
|
5211
5386
|
static void body(jsi::Runtime &rt,
|
|
5212
5387
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5213
5388
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
5214
|
-
uint64_t rs_uniffiHandle,
|
|
5389
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_txid, uint32_t rs_vout,
|
|
5215
5390
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5216
5391
|
uint64_t rs_uniffiCallbackData,
|
|
5217
5392
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -5220,6 +5395,9 @@ static void body(jsi::Runtime &rt,
|
|
|
5220
5395
|
// We'll use the Bridging class to do this…
|
|
5221
5396
|
auto js_uniffiHandle =
|
|
5222
5397
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
5398
|
+
auto js_txid = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
5399
|
+
rt, callInvoker, rs_txid);
|
|
5400
|
+
auto js_vout = uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, rs_vout);
|
|
5223
5401
|
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
5224
5402
|
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
5225
5403
|
rs_uniffiFutureCallback);
|
|
@@ -5232,8 +5410,8 @@ static void body(jsi::Runtime &rt,
|
|
|
5232
5410
|
try {
|
|
5233
5411
|
// Getting the callback function
|
|
5234
5412
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
5235
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
5236
|
-
js_uniffiCallbackData);
|
|
5413
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_txid, js_vout,
|
|
5414
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
5237
5415
|
|
|
5238
5416
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
5239
5417
|
// Finally, we need to copy the return value back into the Rust pointer.
|
|
@@ -5249,7 +5427,7 @@ static void body(jsi::Runtime &rt,
|
|
|
5249
5427
|
}
|
|
5250
5428
|
|
|
5251
5429
|
static void
|
|
5252
|
-
callback(uint64_t rs_uniffiHandle,
|
|
5430
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_txid, uint32_t rs_vout,
|
|
5253
5431
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5254
5432
|
uint64_t rs_uniffiCallbackData,
|
|
5255
5433
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -5268,8 +5446,8 @@ callback(uint64_t rs_uniffiHandle,
|
|
|
5268
5446
|
|
|
5269
5447
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
5270
5448
|
// are all in the lambda.
|
|
5271
|
-
rsLambda(rs_uniffiHandle,
|
|
5272
|
-
rs_uniffiOutReturn);
|
|
5449
|
+
rsLambda(rs_uniffiHandle, rs_txid, rs_vout, rs_uniffiFutureCallback,
|
|
5450
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
5273
5451
|
}
|
|
5274
5452
|
|
|
5275
5453
|
static UniffiCallbackInterfaceBitcoinChainServiceMethod4
|
|
@@ -5292,17 +5470,18 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinch
|
|
|
5292
5470
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
5293
5471
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
5294
5472
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
5295
|
-
uint64_t rs_uniffiHandle,
|
|
5473
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_txid, uint32_t rs_vout,
|
|
5296
5474
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5297
5475
|
uint64_t rs_uniffiCallbackData,
|
|
5298
5476
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5299
5477
|
// We immediately make a lambda which will do the work of transforming the
|
|
5300
5478
|
// arguments into JSI values and calling the callback.
|
|
5301
5479
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
5302
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
5303
|
-
rs_uniffiCallbackData,
|
|
5304
|
-
|
|
5305
|
-
|
|
5480
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_txid, rs_vout,
|
|
5481
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5482
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
5483
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_txid,
|
|
5484
|
+
rs_vout, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5306
5485
|
rs_uniffiOutReturn);
|
|
5307
5486
|
};
|
|
5308
5487
|
// We'll then call that lambda from the callInvoker which will
|
|
@@ -5322,10 +5501,10 @@ static void cleanup() {
|
|
|
5322
5501
|
} // namespace
|
|
5323
5502
|
// uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod4
|
|
5324
5503
|
// Implementation of callback function calling from Rust to JS
|
|
5325
|
-
//
|
|
5504
|
+
// CallbackInterfaceBitcoinChainServiceMethod5
|
|
5326
5505
|
|
|
5327
5506
|
// Callback function:
|
|
5328
|
-
// uniffi::breez_sdk_spark::cb::
|
|
5507
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod5::UniffiCallbackInterfaceBitcoinChainServiceMethod5
|
|
5329
5508
|
//
|
|
5330
5509
|
// We have the following constraints:
|
|
5331
5510
|
// - we need to pass a function pointer to Rust.
|
|
@@ -5339,14 +5518,13 @@ static void cleanup() {
|
|
|
5339
5518
|
// We then give the `callback` function pointer to Rust which will call the
|
|
5340
5519
|
// lambda sometime in the future.
|
|
5341
5520
|
namespace uniffi::breez_sdk_spark::cb::
|
|
5342
|
-
|
|
5521
|
+
callbackinterfacebitcoinchainservicemethod5 {
|
|
5343
5522
|
using namespace facebook;
|
|
5344
5523
|
|
|
5345
5524
|
// We need to store a lambda in a global so we can call it from
|
|
5346
5525
|
// a function pointer. The function pointer is passed to Rust.
|
|
5347
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
5348
|
-
|
|
5349
|
-
UniffiForeignFuture *)>
|
|
5526
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
5527
|
+
uint64_t, UniffiForeignFuture *)>
|
|
5350
5528
|
rsLambda = nullptr;
|
|
5351
5529
|
|
|
5352
5530
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -5354,8 +5532,8 @@ static std::function<void(uint64_t, RustBuffer,
|
|
|
5354
5532
|
static void body(jsi::Runtime &rt,
|
|
5355
5533
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5356
5534
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
5357
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
5358
|
-
|
|
5535
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_tx,
|
|
5536
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
5359
5537
|
uint64_t rs_uniffiCallbackData,
|
|
5360
5538
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5361
5539
|
|
|
@@ -5363,11 +5541,11 @@ static void body(jsi::Runtime &rt,
|
|
|
5363
5541
|
// We'll use the Bridging class to do this…
|
|
5364
5542
|
auto js_uniffiHandle =
|
|
5365
5543
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
5366
|
-
auto
|
|
5367
|
-
rt, callInvoker,
|
|
5368
|
-
auto js_uniffiFutureCallback =
|
|
5369
|
-
|
|
5370
|
-
|
|
5544
|
+
auto js_tx = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
5545
|
+
rt, callInvoker, rs_tx);
|
|
5546
|
+
auto js_uniffiFutureCallback =
|
|
5547
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
5548
|
+
rt, callInvoker, rs_uniffiFutureCallback);
|
|
5371
5549
|
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
5372
5550
|
rt, callInvoker, rs_uniffiCallbackData);
|
|
5373
5551
|
|
|
@@ -5377,7 +5555,7 @@ static void body(jsi::Runtime &rt,
|
|
|
5377
5555
|
try {
|
|
5378
5556
|
// Getting the callback function
|
|
5379
5557
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
5380
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
5558
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_tx,
|
|
5381
5559
|
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
5382
5560
|
|
|
5383
5561
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
@@ -5387,14 +5565,444 @@ static void body(jsi::Runtime &rt,
|
|
|
5387
5565
|
rt, callInvoker, uniffiResult);
|
|
5388
5566
|
} catch (const jsi::JSError &error) {
|
|
5389
5567
|
std::cout << "Error in callback "
|
|
5390
|
-
"
|
|
5568
|
+
"UniffiCallbackInterfaceBitcoinChainServiceMethod5: "
|
|
5391
5569
|
<< error.what() << std::endl;
|
|
5392
5570
|
throw error;
|
|
5393
5571
|
}
|
|
5394
5572
|
}
|
|
5395
5573
|
|
|
5396
|
-
static void
|
|
5397
|
-
|
|
5574
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_tx,
|
|
5575
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
5576
|
+
uint64_t rs_uniffiCallbackData,
|
|
5577
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5578
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
5579
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
5580
|
+
//
|
|
5581
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
5582
|
+
// which nulls out the rsLamda.
|
|
5583
|
+
//
|
|
5584
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
5585
|
+
if (rsLambda == nullptr) {
|
|
5586
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
5587
|
+
// which causes the JS callback to be dropped.
|
|
5588
|
+
return;
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5591
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
5592
|
+
// are all in the lambda.
|
|
5593
|
+
rsLambda(rs_uniffiHandle, rs_tx, rs_uniffiFutureCallback,
|
|
5594
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
5595
|
+
}
|
|
5596
|
+
|
|
5597
|
+
static UniffiCallbackInterfaceBitcoinChainServiceMethod5
|
|
5598
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod5
|
|
5599
|
+
jsi::Runtime &rt,
|
|
5600
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5601
|
+
const jsi::Value &value) {
|
|
5602
|
+
if (rsLambda != nullptr) {
|
|
5603
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
5604
|
+
//
|
|
5605
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
5606
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
5607
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
5608
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
5609
|
+
//
|
|
5610
|
+
// We can therefore return the callback function without making anything
|
|
5611
|
+
// new if we've been initialized already.
|
|
5612
|
+
return callback;
|
|
5613
|
+
}
|
|
5614
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
5615
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
5616
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
5617
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_tx,
|
|
5618
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
5619
|
+
uint64_t rs_uniffiCallbackData,
|
|
5620
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5621
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
5622
|
+
// arguments into JSI values and calling the callback.
|
|
5623
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
5624
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_tx,
|
|
5625
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5626
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
5627
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_tx,
|
|
5628
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5629
|
+
rs_uniffiOutReturn);
|
|
5630
|
+
};
|
|
5631
|
+
// We'll then call that lambda from the callInvoker which will
|
|
5632
|
+
// look after calling it on the correct thread.
|
|
5633
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
5634
|
+
};
|
|
5635
|
+
return callback;
|
|
5636
|
+
}
|
|
5637
|
+
|
|
5638
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
5639
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
5640
|
+
static void cleanup() {
|
|
5641
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
5642
|
+
// out, then the pointer will no longer be left dangling.
|
|
5643
|
+
rsLambda = nullptr;
|
|
5644
|
+
}
|
|
5645
|
+
} // namespace
|
|
5646
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod5
|
|
5647
|
+
// Implementation of callback function calling from Rust to JS
|
|
5648
|
+
// CallbackInterfaceBitcoinChainServiceMethod6
|
|
5649
|
+
|
|
5650
|
+
// Callback function:
|
|
5651
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod6::UniffiCallbackInterfaceBitcoinChainServiceMethod6
|
|
5652
|
+
//
|
|
5653
|
+
// We have the following constraints:
|
|
5654
|
+
// - we need to pass a function pointer to Rust.
|
|
5655
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
5656
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
5657
|
+
//
|
|
5658
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
5659
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
5660
|
+
// into JS.
|
|
5661
|
+
//
|
|
5662
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
5663
|
+
// lambda sometime in the future.
|
|
5664
|
+
namespace uniffi::breez_sdk_spark::cb::
|
|
5665
|
+
callbackinterfacebitcoinchainservicemethod6 {
|
|
5666
|
+
using namespace facebook;
|
|
5667
|
+
|
|
5668
|
+
// We need to store a lambda in a global so we can call it from
|
|
5669
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
5670
|
+
static std::function<void(uint64_t, UniffiForeignFutureCompleteRustBuffer,
|
|
5671
|
+
uint64_t, UniffiForeignFuture *)>
|
|
5672
|
+
rsLambda = nullptr;
|
|
5673
|
+
|
|
5674
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
5675
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
5676
|
+
static void body(jsi::Runtime &rt,
|
|
5677
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5678
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
5679
|
+
uint64_t rs_uniffiHandle,
|
|
5680
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5681
|
+
uint64_t rs_uniffiCallbackData,
|
|
5682
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5683
|
+
|
|
5684
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
5685
|
+
// We'll use the Bridging class to do this…
|
|
5686
|
+
auto js_uniffiHandle =
|
|
5687
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
5688
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
5689
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
5690
|
+
rs_uniffiFutureCallback);
|
|
5691
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
5692
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
5693
|
+
|
|
5694
|
+
// Now we are ready to call the callback.
|
|
5695
|
+
// We are already on the JS thread, because this `body` function was
|
|
5696
|
+
// invoked from the CallInvoker.
|
|
5697
|
+
try {
|
|
5698
|
+
// Getting the callback function
|
|
5699
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
5700
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_uniffiFutureCallback,
|
|
5701
|
+
js_uniffiCallbackData);
|
|
5702
|
+
|
|
5703
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
5704
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
5705
|
+
*rs_uniffiOutReturn =
|
|
5706
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
5707
|
+
rt, callInvoker, uniffiResult);
|
|
5708
|
+
} catch (const jsi::JSError &error) {
|
|
5709
|
+
std::cout << "Error in callback "
|
|
5710
|
+
"UniffiCallbackInterfaceBitcoinChainServiceMethod6: "
|
|
5711
|
+
<< error.what() << std::endl;
|
|
5712
|
+
throw error;
|
|
5713
|
+
}
|
|
5714
|
+
}
|
|
5715
|
+
|
|
5716
|
+
static void
|
|
5717
|
+
callback(uint64_t rs_uniffiHandle,
|
|
5718
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5719
|
+
uint64_t rs_uniffiCallbackData,
|
|
5720
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5721
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
5722
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
5723
|
+
//
|
|
5724
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
5725
|
+
// which nulls out the rsLamda.
|
|
5726
|
+
//
|
|
5727
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
5728
|
+
if (rsLambda == nullptr) {
|
|
5729
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
5730
|
+
// which causes the JS callback to be dropped.
|
|
5731
|
+
return;
|
|
5732
|
+
}
|
|
5733
|
+
|
|
5734
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
5735
|
+
// are all in the lambda.
|
|
5736
|
+
rsLambda(rs_uniffiHandle, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5737
|
+
rs_uniffiOutReturn);
|
|
5738
|
+
}
|
|
5739
|
+
|
|
5740
|
+
static UniffiCallbackInterfaceBitcoinChainServiceMethod6
|
|
5741
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod6
|
|
5742
|
+
jsi::Runtime &rt,
|
|
5743
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5744
|
+
const jsi::Value &value) {
|
|
5745
|
+
if (rsLambda != nullptr) {
|
|
5746
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
5747
|
+
//
|
|
5748
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
5749
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
5750
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
5751
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
5752
|
+
//
|
|
5753
|
+
// We can therefore return the callback function without making anything
|
|
5754
|
+
// new if we've been initialized already.
|
|
5755
|
+
return callback;
|
|
5756
|
+
}
|
|
5757
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
5758
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
5759
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
5760
|
+
uint64_t rs_uniffiHandle,
|
|
5761
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5762
|
+
uint64_t rs_uniffiCallbackData,
|
|
5763
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5764
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
5765
|
+
// arguments into JSI values and calling the callback.
|
|
5766
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
5767
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_uniffiFutureCallback,
|
|
5768
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
5769
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
5770
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5771
|
+
rs_uniffiOutReturn);
|
|
5772
|
+
};
|
|
5773
|
+
// We'll then call that lambda from the callInvoker which will
|
|
5774
|
+
// look after calling it on the correct thread.
|
|
5775
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
5776
|
+
};
|
|
5777
|
+
return callback;
|
|
5778
|
+
}
|
|
5779
|
+
|
|
5780
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
5781
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
5782
|
+
static void cleanup() {
|
|
5783
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
5784
|
+
// out, then the pointer will no longer be left dangling.
|
|
5785
|
+
rsLambda = nullptr;
|
|
5786
|
+
}
|
|
5787
|
+
} // namespace
|
|
5788
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod6
|
|
5789
|
+
// Implementation of callback function calling from Rust to JS
|
|
5790
|
+
// CallbackInterfaceCpfpSignerMethod0
|
|
5791
|
+
|
|
5792
|
+
// Callback function:
|
|
5793
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacecpfpsignermethod0::UniffiCallbackInterfaceCpfpSignerMethod0
|
|
5794
|
+
//
|
|
5795
|
+
// We have the following constraints:
|
|
5796
|
+
// - we need to pass a function pointer to Rust.
|
|
5797
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
5798
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
5799
|
+
//
|
|
5800
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
5801
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
5802
|
+
// into JS.
|
|
5803
|
+
//
|
|
5804
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
5805
|
+
// lambda sometime in the future.
|
|
5806
|
+
namespace uniffi::breez_sdk_spark::cb::callbackinterfacecpfpsignermethod0 {
|
|
5807
|
+
using namespace facebook;
|
|
5808
|
+
|
|
5809
|
+
// We need to store a lambda in a global so we can call it from
|
|
5810
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
5811
|
+
static std::function<void(uint64_t, RustBuffer,
|
|
5812
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
5813
|
+
UniffiForeignFuture *)>
|
|
5814
|
+
rsLambda = nullptr;
|
|
5815
|
+
|
|
5816
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
5817
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
5818
|
+
static void body(jsi::Runtime &rt,
|
|
5819
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5820
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
5821
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_psbtBytes,
|
|
5822
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5823
|
+
uint64_t rs_uniffiCallbackData,
|
|
5824
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5825
|
+
|
|
5826
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
5827
|
+
// We'll use the Bridging class to do this…
|
|
5828
|
+
auto js_uniffiHandle =
|
|
5829
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
5830
|
+
auto js_psbtBytes = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
5831
|
+
rt, callInvoker, rs_psbtBytes);
|
|
5832
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
5833
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
5834
|
+
rs_uniffiFutureCallback);
|
|
5835
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
5836
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
5837
|
+
|
|
5838
|
+
// Now we are ready to call the callback.
|
|
5839
|
+
// We are already on the JS thread, because this `body` function was
|
|
5840
|
+
// invoked from the CallInvoker.
|
|
5841
|
+
try {
|
|
5842
|
+
// Getting the callback function
|
|
5843
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
5844
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_psbtBytes,
|
|
5845
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
5846
|
+
|
|
5847
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
5848
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
5849
|
+
*rs_uniffiOutReturn =
|
|
5850
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
5851
|
+
rt, callInvoker, uniffiResult);
|
|
5852
|
+
} catch (const jsi::JSError &error) {
|
|
5853
|
+
std::cout << "Error in callback UniffiCallbackInterfaceCpfpSignerMethod0: "
|
|
5854
|
+
<< error.what() << std::endl;
|
|
5855
|
+
throw error;
|
|
5856
|
+
}
|
|
5857
|
+
}
|
|
5858
|
+
|
|
5859
|
+
static void
|
|
5860
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_psbtBytes,
|
|
5861
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5862
|
+
uint64_t rs_uniffiCallbackData,
|
|
5863
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5864
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
5865
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
5866
|
+
//
|
|
5867
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
5868
|
+
// which nulls out the rsLamda.
|
|
5869
|
+
//
|
|
5870
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
5871
|
+
if (rsLambda == nullptr) {
|
|
5872
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
5873
|
+
// which causes the JS callback to be dropped.
|
|
5874
|
+
return;
|
|
5875
|
+
}
|
|
5876
|
+
|
|
5877
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
5878
|
+
// are all in the lambda.
|
|
5879
|
+
rsLambda(rs_uniffiHandle, rs_psbtBytes, rs_uniffiFutureCallback,
|
|
5880
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
5881
|
+
}
|
|
5882
|
+
|
|
5883
|
+
static UniffiCallbackInterfaceCpfpSignerMethod0
|
|
5884
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacecpfpsignermethod0
|
|
5885
|
+
jsi::Runtime &rt,
|
|
5886
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5887
|
+
const jsi::Value &value) {
|
|
5888
|
+
if (rsLambda != nullptr) {
|
|
5889
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
5890
|
+
//
|
|
5891
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
5892
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
5893
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
5894
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
5895
|
+
//
|
|
5896
|
+
// We can therefore return the callback function without making anything
|
|
5897
|
+
// new if we've been initialized already.
|
|
5898
|
+
return callback;
|
|
5899
|
+
}
|
|
5900
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
5901
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
5902
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
5903
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_psbtBytes,
|
|
5904
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5905
|
+
uint64_t rs_uniffiCallbackData,
|
|
5906
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5907
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
5908
|
+
// arguments into JSI values and calling the callback.
|
|
5909
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
5910
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_psbtBytes,
|
|
5911
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5912
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
5913
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_psbtBytes,
|
|
5914
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
5915
|
+
rs_uniffiOutReturn);
|
|
5916
|
+
};
|
|
5917
|
+
// We'll then call that lambda from the callInvoker which will
|
|
5918
|
+
// look after calling it on the correct thread.
|
|
5919
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
5920
|
+
};
|
|
5921
|
+
return callback;
|
|
5922
|
+
}
|
|
5923
|
+
|
|
5924
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
5925
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
5926
|
+
static void cleanup() {
|
|
5927
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
5928
|
+
// out, then the pointer will no longer be left dangling.
|
|
5929
|
+
rsLambda = nullptr;
|
|
5930
|
+
}
|
|
5931
|
+
} // namespace uniffi::breez_sdk_spark::cb::callbackinterfacecpfpsignermethod0
|
|
5932
|
+
// Implementation of callback function calling from Rust to JS
|
|
5933
|
+
// CallbackInterfaceExternalBreezSignerMethod0
|
|
5934
|
+
|
|
5935
|
+
// Callback function:
|
|
5936
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod0::UniffiCallbackInterfaceExternalBreezSignerMethod0
|
|
5937
|
+
//
|
|
5938
|
+
// We have the following constraints:
|
|
5939
|
+
// - we need to pass a function pointer to Rust.
|
|
5940
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
5941
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
5942
|
+
//
|
|
5943
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
5944
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
5945
|
+
// into JS.
|
|
5946
|
+
//
|
|
5947
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
5948
|
+
// lambda sometime in the future.
|
|
5949
|
+
namespace uniffi::breez_sdk_spark::cb::
|
|
5950
|
+
callbackinterfaceexternalbreezsignermethod0 {
|
|
5951
|
+
using namespace facebook;
|
|
5952
|
+
|
|
5953
|
+
// We need to store a lambda in a global so we can call it from
|
|
5954
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
5955
|
+
static std::function<void(uint64_t, RustBuffer,
|
|
5956
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
5957
|
+
UniffiForeignFuture *)>
|
|
5958
|
+
rsLambda = nullptr;
|
|
5959
|
+
|
|
5960
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
5961
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
5962
|
+
static void body(jsi::Runtime &rt,
|
|
5963
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
5964
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
5965
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_path,
|
|
5966
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5967
|
+
uint64_t rs_uniffiCallbackData,
|
|
5968
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
5969
|
+
|
|
5970
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
5971
|
+
// We'll use the Bridging class to do this…
|
|
5972
|
+
auto js_uniffiHandle =
|
|
5973
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
5974
|
+
auto js_path = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
5975
|
+
rt, callInvoker, rs_path);
|
|
5976
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
5977
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
5978
|
+
rs_uniffiFutureCallback);
|
|
5979
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
5980
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
5981
|
+
|
|
5982
|
+
// Now we are ready to call the callback.
|
|
5983
|
+
// We are already on the JS thread, because this `body` function was
|
|
5984
|
+
// invoked from the CallInvoker.
|
|
5985
|
+
try {
|
|
5986
|
+
// Getting the callback function
|
|
5987
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
5988
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_path,
|
|
5989
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
5990
|
+
|
|
5991
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
5992
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
5993
|
+
*rs_uniffiOutReturn =
|
|
5994
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
5995
|
+
rt, callInvoker, uniffiResult);
|
|
5996
|
+
} catch (const jsi::JSError &error) {
|
|
5997
|
+
std::cout << "Error in callback "
|
|
5998
|
+
"UniffiCallbackInterfaceExternalBreezSignerMethod0: "
|
|
5999
|
+
<< error.what() << std::endl;
|
|
6000
|
+
throw error;
|
|
6001
|
+
}
|
|
6002
|
+
}
|
|
6003
|
+
|
|
6004
|
+
static void
|
|
6005
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_path,
|
|
5398
6006
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
5399
6007
|
uint64_t rs_uniffiCallbackData,
|
|
5400
6008
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -7845,6 +8453,156 @@ namespace uniffi::breez_sdk_spark::cb::
|
|
|
7845
8453
|
callbackinterfaceexternalsparksignermethod6 {
|
|
7846
8454
|
using namespace facebook;
|
|
7847
8455
|
|
|
8456
|
+
// We need to store a lambda in a global so we can call it from
|
|
8457
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
8458
|
+
static std::function<void(uint64_t, RustBuffer, RustBuffer,
|
|
8459
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
8460
|
+
UniffiForeignFuture *)>
|
|
8461
|
+
rsLambda = nullptr;
|
|
8462
|
+
|
|
8463
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
8464
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
8465
|
+
static void body(jsi::Runtime &rt,
|
|
8466
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8467
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
8468
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_leafId,
|
|
8469
|
+
RustBuffer rs_sighash,
|
|
8470
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
8471
|
+
uint64_t rs_uniffiCallbackData,
|
|
8472
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
8473
|
+
|
|
8474
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
8475
|
+
// We'll use the Bridging class to do this…
|
|
8476
|
+
auto js_uniffiHandle =
|
|
8477
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
8478
|
+
auto js_leafId = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
8479
|
+
rt, callInvoker, rs_leafId);
|
|
8480
|
+
auto js_sighash = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
8481
|
+
rt, callInvoker, rs_sighash);
|
|
8482
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
8483
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
8484
|
+
rs_uniffiFutureCallback);
|
|
8485
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
8486
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
8487
|
+
|
|
8488
|
+
// Now we are ready to call the callback.
|
|
8489
|
+
// We are already on the JS thread, because this `body` function was
|
|
8490
|
+
// invoked from the CallInvoker.
|
|
8491
|
+
try {
|
|
8492
|
+
// Getting the callback function
|
|
8493
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
8494
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_leafId, js_sighash,
|
|
8495
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
8496
|
+
|
|
8497
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
8498
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
8499
|
+
*rs_uniffiOutReturn =
|
|
8500
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
8501
|
+
rt, callInvoker, uniffiResult);
|
|
8502
|
+
} catch (const jsi::JSError &error) {
|
|
8503
|
+
std::cout << "Error in callback "
|
|
8504
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod6: "
|
|
8505
|
+
<< error.what() << std::endl;
|
|
8506
|
+
throw error;
|
|
8507
|
+
}
|
|
8508
|
+
}
|
|
8509
|
+
|
|
8510
|
+
static void
|
|
8511
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_leafId, RustBuffer rs_sighash,
|
|
8512
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
8513
|
+
uint64_t rs_uniffiCallbackData,
|
|
8514
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
8515
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
8516
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
8517
|
+
//
|
|
8518
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
8519
|
+
// which nulls out the rsLamda.
|
|
8520
|
+
//
|
|
8521
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
8522
|
+
if (rsLambda == nullptr) {
|
|
8523
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
8524
|
+
// which causes the JS callback to be dropped.
|
|
8525
|
+
return;
|
|
8526
|
+
}
|
|
8527
|
+
|
|
8528
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
8529
|
+
// are all in the lambda.
|
|
8530
|
+
rsLambda(rs_uniffiHandle, rs_leafId, rs_sighash, rs_uniffiFutureCallback,
|
|
8531
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8532
|
+
}
|
|
8533
|
+
|
|
8534
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod6
|
|
8535
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod6
|
|
8536
|
+
jsi::Runtime &rt,
|
|
8537
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8538
|
+
const jsi::Value &value) {
|
|
8539
|
+
if (rsLambda != nullptr) {
|
|
8540
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
8541
|
+
//
|
|
8542
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
8543
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
8544
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
8545
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
8546
|
+
//
|
|
8547
|
+
// We can therefore return the callback function without making anything
|
|
8548
|
+
// new if we've been initialized already.
|
|
8549
|
+
return callback;
|
|
8550
|
+
}
|
|
8551
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
8552
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
8553
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
8554
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_leafId,
|
|
8555
|
+
RustBuffer rs_sighash,
|
|
8556
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
8557
|
+
uint64_t rs_uniffiCallbackData,
|
|
8558
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
8559
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
8560
|
+
// arguments into JSI values and calling the callback.
|
|
8561
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
8562
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_leafId, rs_sighash,
|
|
8563
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
8564
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
8565
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_leafId,
|
|
8566
|
+
rs_sighash, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
8567
|
+
rs_uniffiOutReturn);
|
|
8568
|
+
};
|
|
8569
|
+
// We'll then call that lambda from the callInvoker which will
|
|
8570
|
+
// look after calling it on the correct thread.
|
|
8571
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
8572
|
+
};
|
|
8573
|
+
return callback;
|
|
8574
|
+
}
|
|
8575
|
+
|
|
8576
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
8577
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
8578
|
+
static void cleanup() {
|
|
8579
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
8580
|
+
// out, then the pointer will no longer be left dangling.
|
|
8581
|
+
rsLambda = nullptr;
|
|
8582
|
+
}
|
|
8583
|
+
} // namespace
|
|
8584
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod6
|
|
8585
|
+
// Implementation of callback function calling from Rust to JS
|
|
8586
|
+
// CallbackInterfaceExternalSparkSignerMethod7
|
|
8587
|
+
|
|
8588
|
+
// Callback function:
|
|
8589
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod7::UniffiCallbackInterfaceExternalSparkSignerMethod7
|
|
8590
|
+
//
|
|
8591
|
+
// We have the following constraints:
|
|
8592
|
+
// - we need to pass a function pointer to Rust.
|
|
8593
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
8594
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
8595
|
+
//
|
|
8596
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
8597
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
8598
|
+
// into JS.
|
|
8599
|
+
//
|
|
8600
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
8601
|
+
// lambda sometime in the future.
|
|
8602
|
+
namespace uniffi::breez_sdk_spark::cb::
|
|
8603
|
+
callbackinterfaceexternalsparksignermethod7 {
|
|
8604
|
+
using namespace facebook;
|
|
8605
|
+
|
|
7848
8606
|
// We need to store a lambda in a global so we can call it from
|
|
7849
8607
|
// a function pointer. The function pointer is passed to Rust.
|
|
7850
8608
|
static std::function<void(uint64_t, RustBuffer,
|
|
@@ -7890,7 +8648,7 @@ static void body(jsi::Runtime &rt,
|
|
|
7890
8648
|
rt, callInvoker, uniffiResult);
|
|
7891
8649
|
} catch (const jsi::JSError &error) {
|
|
7892
8650
|
std::cout << "Error in callback "
|
|
7893
|
-
"
|
|
8651
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod7: "
|
|
7894
8652
|
<< error.what() << std::endl;
|
|
7895
8653
|
throw error;
|
|
7896
8654
|
}
|
|
@@ -7920,8 +8678,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_jobs,
|
|
|
7920
8678
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
7921
8679
|
}
|
|
7922
8680
|
|
|
7923
|
-
static
|
|
7924
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
8681
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod7
|
|
8682
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod7
|
|
7925
8683
|
jsi::Runtime &rt,
|
|
7926
8684
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
7927
8685
|
const jsi::Value &value) {
|
|
@@ -7969,12 +8727,12 @@ static void cleanup() {
|
|
|
7969
8727
|
rsLambda = nullptr;
|
|
7970
8728
|
}
|
|
7971
8729
|
} // namespace
|
|
7972
|
-
// uniffi::breez_sdk_spark::cb::
|
|
8730
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod7
|
|
7973
8731
|
// Implementation of callback function calling from Rust to JS
|
|
7974
|
-
//
|
|
8732
|
+
// CallbackInterfaceExternalSparkSignerMethod8
|
|
7975
8733
|
|
|
7976
8734
|
// Callback function:
|
|
7977
|
-
// uniffi::breez_sdk_spark::cb::
|
|
8735
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod8::UniffiCallbackInterfaceExternalSparkSignerMethod8
|
|
7978
8736
|
//
|
|
7979
8737
|
// We have the following constraints:
|
|
7980
8738
|
// - we need to pass a function pointer to Rust.
|
|
@@ -7988,7 +8746,7 @@ static void cleanup() {
|
|
|
7988
8746
|
// We then give the `callback` function pointer to Rust which will call the
|
|
7989
8747
|
// lambda sometime in the future.
|
|
7990
8748
|
namespace uniffi::breez_sdk_spark::cb::
|
|
7991
|
-
|
|
8749
|
+
callbackinterfaceexternalsparksignermethod8 {
|
|
7992
8750
|
using namespace facebook;
|
|
7993
8751
|
|
|
7994
8752
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8036,7 +8794,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8036
8794
|
rt, callInvoker, uniffiResult);
|
|
8037
8795
|
} catch (const jsi::JSError &error) {
|
|
8038
8796
|
std::cout << "Error in callback "
|
|
8039
|
-
"
|
|
8797
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod8: "
|
|
8040
8798
|
<< error.what() << std::endl;
|
|
8041
8799
|
throw error;
|
|
8042
8800
|
}
|
|
@@ -8066,8 +8824,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8066
8824
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8067
8825
|
}
|
|
8068
8826
|
|
|
8069
|
-
static
|
|
8070
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
8827
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod8
|
|
8828
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod8
|
|
8071
8829
|
jsi::Runtime &rt,
|
|
8072
8830
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8073
8831
|
const jsi::Value &value) {
|
|
@@ -8115,12 +8873,12 @@ static void cleanup() {
|
|
|
8115
8873
|
rsLambda = nullptr;
|
|
8116
8874
|
}
|
|
8117
8875
|
} // namespace
|
|
8118
|
-
// uniffi::breez_sdk_spark::cb::
|
|
8876
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod8
|
|
8119
8877
|
// Implementation of callback function calling from Rust to JS
|
|
8120
|
-
//
|
|
8878
|
+
// CallbackInterfaceExternalSparkSignerMethod9
|
|
8121
8879
|
|
|
8122
8880
|
// Callback function:
|
|
8123
|
-
// uniffi::breez_sdk_spark::cb::
|
|
8881
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod9::UniffiCallbackInterfaceExternalSparkSignerMethod9
|
|
8124
8882
|
//
|
|
8125
8883
|
// We have the following constraints:
|
|
8126
8884
|
// - we need to pass a function pointer to Rust.
|
|
@@ -8134,7 +8892,7 @@ static void cleanup() {
|
|
|
8134
8892
|
// We then give the `callback` function pointer to Rust which will call the
|
|
8135
8893
|
// lambda sometime in the future.
|
|
8136
8894
|
namespace uniffi::breez_sdk_spark::cb::
|
|
8137
|
-
|
|
8895
|
+
callbackinterfaceexternalsparksignermethod9 {
|
|
8138
8896
|
using namespace facebook;
|
|
8139
8897
|
|
|
8140
8898
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8182,7 +8940,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8182
8940
|
rt, callInvoker, uniffiResult);
|
|
8183
8941
|
} catch (const jsi::JSError &error) {
|
|
8184
8942
|
std::cout << "Error in callback "
|
|
8185
|
-
"
|
|
8943
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod9: "
|
|
8186
8944
|
<< error.what() << std::endl;
|
|
8187
8945
|
throw error;
|
|
8188
8946
|
}
|
|
@@ -8212,8 +8970,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8212
8970
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8213
8971
|
}
|
|
8214
8972
|
|
|
8215
|
-
static
|
|
8216
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
8973
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod9
|
|
8974
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod9
|
|
8217
8975
|
jsi::Runtime &rt,
|
|
8218
8976
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8219
8977
|
const jsi::Value &value) {
|
|
@@ -8261,12 +9019,12 @@ static void cleanup() {
|
|
|
8261
9019
|
rsLambda = nullptr;
|
|
8262
9020
|
}
|
|
8263
9021
|
} // namespace
|
|
8264
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9022
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod9
|
|
8265
9023
|
// Implementation of callback function calling from Rust to JS
|
|
8266
|
-
//
|
|
9024
|
+
// CallbackInterfaceExternalSparkSignerMethod10
|
|
8267
9025
|
|
|
8268
9026
|
// Callback function:
|
|
8269
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9027
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod10::UniffiCallbackInterfaceExternalSparkSignerMethod10
|
|
8270
9028
|
//
|
|
8271
9029
|
// We have the following constraints:
|
|
8272
9030
|
// - we need to pass a function pointer to Rust.
|
|
@@ -8280,7 +9038,7 @@ static void cleanup() {
|
|
|
8280
9038
|
// We then give the `callback` function pointer to Rust which will call the
|
|
8281
9039
|
// lambda sometime in the future.
|
|
8282
9040
|
namespace uniffi::breez_sdk_spark::cb::
|
|
8283
|
-
|
|
9041
|
+
callbackinterfaceexternalsparksignermethod10 {
|
|
8284
9042
|
using namespace facebook;
|
|
8285
9043
|
|
|
8286
9044
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8328,7 +9086,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8328
9086
|
rt, callInvoker, uniffiResult);
|
|
8329
9087
|
} catch (const jsi::JSError &error) {
|
|
8330
9088
|
std::cout << "Error in callback "
|
|
8331
|
-
"
|
|
9089
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod10: "
|
|
8332
9090
|
<< error.what() << std::endl;
|
|
8333
9091
|
throw error;
|
|
8334
9092
|
}
|
|
@@ -8358,8 +9116,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8358
9116
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8359
9117
|
}
|
|
8360
9118
|
|
|
8361
|
-
static
|
|
8362
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9119
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod10
|
|
9120
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod10
|
|
8363
9121
|
jsi::Runtime &rt,
|
|
8364
9122
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8365
9123
|
const jsi::Value &value) {
|
|
@@ -8407,12 +9165,12 @@ static void cleanup() {
|
|
|
8407
9165
|
rsLambda = nullptr;
|
|
8408
9166
|
}
|
|
8409
9167
|
} // namespace
|
|
8410
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9168
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod10
|
|
8411
9169
|
// Implementation of callback function calling from Rust to JS
|
|
8412
|
-
//
|
|
9170
|
+
// CallbackInterfaceExternalSparkSignerMethod11
|
|
8413
9171
|
|
|
8414
9172
|
// Callback function:
|
|
8415
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9173
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod11::UniffiCallbackInterfaceExternalSparkSignerMethod11
|
|
8416
9174
|
//
|
|
8417
9175
|
// We have the following constraints:
|
|
8418
9176
|
// - we need to pass a function pointer to Rust.
|
|
@@ -8426,7 +9184,7 @@ static void cleanup() {
|
|
|
8426
9184
|
// We then give the `callback` function pointer to Rust which will call the
|
|
8427
9185
|
// lambda sometime in the future.
|
|
8428
9186
|
namespace uniffi::breez_sdk_spark::cb::
|
|
8429
|
-
|
|
9187
|
+
callbackinterfaceexternalsparksignermethod11 {
|
|
8430
9188
|
using namespace facebook;
|
|
8431
9189
|
|
|
8432
9190
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8474,7 +9232,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8474
9232
|
rt, callInvoker, uniffiResult);
|
|
8475
9233
|
} catch (const jsi::JSError &error) {
|
|
8476
9234
|
std::cout << "Error in callback "
|
|
8477
|
-
"
|
|
9235
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod11: "
|
|
8478
9236
|
<< error.what() << std::endl;
|
|
8479
9237
|
throw error;
|
|
8480
9238
|
}
|
|
@@ -8504,8 +9262,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8504
9262
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8505
9263
|
}
|
|
8506
9264
|
|
|
8507
|
-
static
|
|
8508
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9265
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod11
|
|
9266
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod11
|
|
8509
9267
|
jsi::Runtime &rt,
|
|
8510
9268
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8511
9269
|
const jsi::Value &value) {
|
|
@@ -8553,12 +9311,12 @@ static void cleanup() {
|
|
|
8553
9311
|
rsLambda = nullptr;
|
|
8554
9312
|
}
|
|
8555
9313
|
} // namespace
|
|
8556
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9314
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod11
|
|
8557
9315
|
// Implementation of callback function calling from Rust to JS
|
|
8558
|
-
//
|
|
9316
|
+
// CallbackInterfaceExternalSparkSignerMethod12
|
|
8559
9317
|
|
|
8560
9318
|
// Callback function:
|
|
8561
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9319
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod12::UniffiCallbackInterfaceExternalSparkSignerMethod12
|
|
8562
9320
|
//
|
|
8563
9321
|
// We have the following constraints:
|
|
8564
9322
|
// - we need to pass a function pointer to Rust.
|
|
@@ -8572,7 +9330,7 @@ static void cleanup() {
|
|
|
8572
9330
|
// We then give the `callback` function pointer to Rust which will call the
|
|
8573
9331
|
// lambda sometime in the future.
|
|
8574
9332
|
namespace uniffi::breez_sdk_spark::cb::
|
|
8575
|
-
|
|
9333
|
+
callbackinterfaceexternalsparksignermethod12 {
|
|
8576
9334
|
using namespace facebook;
|
|
8577
9335
|
|
|
8578
9336
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8620,7 +9378,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8620
9378
|
rt, callInvoker, uniffiResult);
|
|
8621
9379
|
} catch (const jsi::JSError &error) {
|
|
8622
9380
|
std::cout << "Error in callback "
|
|
8623
|
-
"
|
|
9381
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod12: "
|
|
8624
9382
|
<< error.what() << std::endl;
|
|
8625
9383
|
throw error;
|
|
8626
9384
|
}
|
|
@@ -8650,8 +9408,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8650
9408
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8651
9409
|
}
|
|
8652
9410
|
|
|
8653
|
-
static
|
|
8654
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9411
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod12
|
|
9412
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod12
|
|
8655
9413
|
jsi::Runtime &rt,
|
|
8656
9414
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8657
9415
|
const jsi::Value &value) {
|
|
@@ -8699,12 +9457,12 @@ static void cleanup() {
|
|
|
8699
9457
|
rsLambda = nullptr;
|
|
8700
9458
|
}
|
|
8701
9459
|
} // namespace
|
|
8702
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9460
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod12
|
|
8703
9461
|
// Implementation of callback function calling from Rust to JS
|
|
8704
|
-
//
|
|
9462
|
+
// CallbackInterfaceExternalSparkSignerMethod13
|
|
8705
9463
|
|
|
8706
9464
|
// Callback function:
|
|
8707
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9465
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod13::UniffiCallbackInterfaceExternalSparkSignerMethod13
|
|
8708
9466
|
//
|
|
8709
9467
|
// We have the following constraints:
|
|
8710
9468
|
// - we need to pass a function pointer to Rust.
|
|
@@ -8718,7 +9476,7 @@ static void cleanup() {
|
|
|
8718
9476
|
// We then give the `callback` function pointer to Rust which will call the
|
|
8719
9477
|
// lambda sometime in the future.
|
|
8720
9478
|
namespace uniffi::breez_sdk_spark::cb::
|
|
8721
|
-
|
|
9479
|
+
callbackinterfaceexternalsparksignermethod13 {
|
|
8722
9480
|
using namespace facebook;
|
|
8723
9481
|
|
|
8724
9482
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8766,7 +9524,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8766
9524
|
rt, callInvoker, uniffiResult);
|
|
8767
9525
|
} catch (const jsi::JSError &error) {
|
|
8768
9526
|
std::cout << "Error in callback "
|
|
8769
|
-
"
|
|
9527
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod13: "
|
|
8770
9528
|
<< error.what() << std::endl;
|
|
8771
9529
|
throw error;
|
|
8772
9530
|
}
|
|
@@ -8796,8 +9554,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8796
9554
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8797
9555
|
}
|
|
8798
9556
|
|
|
8799
|
-
static
|
|
8800
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9557
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod13
|
|
9558
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod13
|
|
8801
9559
|
jsi::Runtime &rt,
|
|
8802
9560
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8803
9561
|
const jsi::Value &value) {
|
|
@@ -8845,12 +9603,12 @@ static void cleanup() {
|
|
|
8845
9603
|
rsLambda = nullptr;
|
|
8846
9604
|
}
|
|
8847
9605
|
} // namespace
|
|
8848
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9606
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod13
|
|
8849
9607
|
// Implementation of callback function calling from Rust to JS
|
|
8850
|
-
//
|
|
9608
|
+
// CallbackInterfaceExternalSparkSignerMethod14
|
|
8851
9609
|
|
|
8852
9610
|
// Callback function:
|
|
8853
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9611
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod14::UniffiCallbackInterfaceExternalSparkSignerMethod14
|
|
8854
9612
|
//
|
|
8855
9613
|
// We have the following constraints:
|
|
8856
9614
|
// - we need to pass a function pointer to Rust.
|
|
@@ -8864,7 +9622,7 @@ static void cleanup() {
|
|
|
8864
9622
|
// We then give the `callback` function pointer to Rust which will call the
|
|
8865
9623
|
// lambda sometime in the future.
|
|
8866
9624
|
namespace uniffi::breez_sdk_spark::cb::
|
|
8867
|
-
|
|
9625
|
+
callbackinterfaceexternalsparksignermethod14 {
|
|
8868
9626
|
using namespace facebook;
|
|
8869
9627
|
|
|
8870
9628
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -8912,7 +9670,7 @@ static void body(jsi::Runtime &rt,
|
|
|
8912
9670
|
rt, callInvoker, uniffiResult);
|
|
8913
9671
|
} catch (const jsi::JSError &error) {
|
|
8914
9672
|
std::cout << "Error in callback "
|
|
8915
|
-
"
|
|
9673
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod14: "
|
|
8916
9674
|
<< error.what() << std::endl;
|
|
8917
9675
|
throw error;
|
|
8918
9676
|
}
|
|
@@ -8942,8 +9700,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
8942
9700
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
8943
9701
|
}
|
|
8944
9702
|
|
|
8945
|
-
static
|
|
8946
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9703
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod14
|
|
9704
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod14
|
|
8947
9705
|
jsi::Runtime &rt,
|
|
8948
9706
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
8949
9707
|
const jsi::Value &value) {
|
|
@@ -8991,12 +9749,12 @@ static void cleanup() {
|
|
|
8991
9749
|
rsLambda = nullptr;
|
|
8992
9750
|
}
|
|
8993
9751
|
} // namespace
|
|
8994
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9752
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod14
|
|
8995
9753
|
// Implementation of callback function calling from Rust to JS
|
|
8996
|
-
//
|
|
9754
|
+
// CallbackInterfaceExternalSparkSignerMethod15
|
|
8997
9755
|
|
|
8998
9756
|
// Callback function:
|
|
8999
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9757
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod15::UniffiCallbackInterfaceExternalSparkSignerMethod15
|
|
9000
9758
|
//
|
|
9001
9759
|
// We have the following constraints:
|
|
9002
9760
|
// - we need to pass a function pointer to Rust.
|
|
@@ -9010,7 +9768,7 @@ static void cleanup() {
|
|
|
9010
9768
|
// We then give the `callback` function pointer to Rust which will call the
|
|
9011
9769
|
// lambda sometime in the future.
|
|
9012
9770
|
namespace uniffi::breez_sdk_spark::cb::
|
|
9013
|
-
|
|
9771
|
+
callbackinterfaceexternalsparksignermethod15 {
|
|
9014
9772
|
using namespace facebook;
|
|
9015
9773
|
|
|
9016
9774
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -9058,7 +9816,7 @@ static void body(jsi::Runtime &rt,
|
|
|
9058
9816
|
rt, callInvoker, uniffiResult);
|
|
9059
9817
|
} catch (const jsi::JSError &error) {
|
|
9060
9818
|
std::cout << "Error in callback "
|
|
9061
|
-
"
|
|
9819
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod15: "
|
|
9062
9820
|
<< error.what() << std::endl;
|
|
9063
9821
|
throw error;
|
|
9064
9822
|
}
|
|
@@ -9088,8 +9846,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
9088
9846
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
9089
9847
|
}
|
|
9090
9848
|
|
|
9091
|
-
static
|
|
9092
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9849
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod15
|
|
9850
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod15
|
|
9093
9851
|
jsi::Runtime &rt,
|
|
9094
9852
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
9095
9853
|
const jsi::Value &value) {
|
|
@@ -9137,12 +9895,12 @@ static void cleanup() {
|
|
|
9137
9895
|
rsLambda = nullptr;
|
|
9138
9896
|
}
|
|
9139
9897
|
} // namespace
|
|
9140
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9898
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod15
|
|
9141
9899
|
// Implementation of callback function calling from Rust to JS
|
|
9142
|
-
//
|
|
9900
|
+
// CallbackInterfaceExternalSparkSignerMethod16
|
|
9143
9901
|
|
|
9144
9902
|
// Callback function:
|
|
9145
|
-
// uniffi::breez_sdk_spark::cb::
|
|
9903
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod16::UniffiCallbackInterfaceExternalSparkSignerMethod16
|
|
9146
9904
|
//
|
|
9147
9905
|
// We have the following constraints:
|
|
9148
9906
|
// - we need to pass a function pointer to Rust.
|
|
@@ -9156,7 +9914,7 @@ static void cleanup() {
|
|
|
9156
9914
|
// We then give the `callback` function pointer to Rust which will call the
|
|
9157
9915
|
// lambda sometime in the future.
|
|
9158
9916
|
namespace uniffi::breez_sdk_spark::cb::
|
|
9159
|
-
|
|
9917
|
+
callbackinterfaceexternalsparksignermethod16 {
|
|
9160
9918
|
using namespace facebook;
|
|
9161
9919
|
|
|
9162
9920
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -9204,7 +9962,7 @@ static void body(jsi::Runtime &rt,
|
|
|
9204
9962
|
rt, callInvoker, uniffiResult);
|
|
9205
9963
|
} catch (const jsi::JSError &error) {
|
|
9206
9964
|
std::cout << "Error in callback "
|
|
9207
|
-
"
|
|
9965
|
+
"UniffiCallbackInterfaceExternalSparkSignerMethod16: "
|
|
9208
9966
|
<< error.what() << std::endl;
|
|
9209
9967
|
throw error;
|
|
9210
9968
|
}
|
|
@@ -9234,8 +9992,8 @@ callback(uint64_t rs_uniffiHandle, RustBuffer rs_request,
|
|
|
9234
9992
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
9235
9993
|
}
|
|
9236
9994
|
|
|
9237
|
-
static
|
|
9238
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
9995
|
+
static UniffiCallbackInterfaceExternalSparkSignerMethod16
|
|
9996
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod16
|
|
9239
9997
|
jsi::Runtime &rt,
|
|
9240
9998
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
9241
9999
|
const jsi::Value &value) {
|
|
@@ -9283,7 +10041,7 @@ static void cleanup() {
|
|
|
9283
10041
|
rsLambda = nullptr;
|
|
9284
10042
|
}
|
|
9285
10043
|
} // namespace
|
|
9286
|
-
// uniffi::breez_sdk_spark::cb::
|
|
10044
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod16
|
|
9287
10045
|
// Implementation of callback function calling from Rust to JS
|
|
9288
10046
|
// CallbackInterfaceFiatServiceMethod0
|
|
9289
10047
|
|
|
@@ -15689,17 +16447,23 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceBitcoinChainService> {
|
|
|
15689
16447
|
rsObject.get_address_utxos = uniffi::breez_sdk_spark::cb::
|
|
15690
16448
|
callbackinterfacebitcoinchainservicemethod0::makeCallbackFunction(
|
|
15691
16449
|
rt, callInvoker, jsObject.getProperty(rt, "getAddressUtxos"));
|
|
15692
|
-
rsObject.
|
|
16450
|
+
rsObject.get_address_txos = uniffi::breez_sdk_spark::cb::
|
|
15693
16451
|
callbackinterfacebitcoinchainservicemethod1::makeCallbackFunction(
|
|
16452
|
+
rt, callInvoker, jsObject.getProperty(rt, "getAddressTxos"));
|
|
16453
|
+
rsObject.get_transaction_status = uniffi::breez_sdk_spark::cb::
|
|
16454
|
+
callbackinterfacebitcoinchainservicemethod2::makeCallbackFunction(
|
|
15694
16455
|
rt, callInvoker, jsObject.getProperty(rt, "getTransactionStatus"));
|
|
15695
16456
|
rsObject.get_transaction_hex = uniffi::breez_sdk_spark::cb::
|
|
15696
|
-
|
|
16457
|
+
callbackinterfacebitcoinchainservicemethod3::makeCallbackFunction(
|
|
15697
16458
|
rt, callInvoker, jsObject.getProperty(rt, "getTransactionHex"));
|
|
16459
|
+
rsObject.get_outspend = uniffi::breez_sdk_spark::cb::
|
|
16460
|
+
callbackinterfacebitcoinchainservicemethod4::makeCallbackFunction(
|
|
16461
|
+
rt, callInvoker, jsObject.getProperty(rt, "getOutspend"));
|
|
15698
16462
|
rsObject.broadcast_transaction = uniffi::breez_sdk_spark::cb::
|
|
15699
|
-
|
|
16463
|
+
callbackinterfacebitcoinchainservicemethod5::makeCallbackFunction(
|
|
15700
16464
|
rt, callInvoker, jsObject.getProperty(rt, "broadcastTransaction"));
|
|
15701
16465
|
rsObject.recommended_fees = uniffi::breez_sdk_spark::cb::
|
|
15702
|
-
|
|
16466
|
+
callbackinterfacebitcoinchainservicemethod6::makeCallbackFunction(
|
|
15703
16467
|
rt, callInvoker, jsObject.getProperty(rt, "recommendedFees"));
|
|
15704
16468
|
rsObject.uniffi_free = uniffi::breez_sdk_spark::st::
|
|
15705
16469
|
vtablecallbackinterfacebitcoinchainservice::
|
|
@@ -15716,6 +16480,40 @@ namespace uniffi::breez_sdk_spark {
|
|
|
15716
16480
|
using namespace facebook;
|
|
15717
16481
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
15718
16482
|
|
|
16483
|
+
template <> struct Bridging<UniffiVTableCallbackInterfaceCpfpSigner> {
|
|
16484
|
+
static UniffiVTableCallbackInterfaceCpfpSigner
|
|
16485
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
16486
|
+
const jsi::Value &jsValue) {
|
|
16487
|
+
// Check if the input is an object
|
|
16488
|
+
if (!jsValue.isObject()) {
|
|
16489
|
+
throw jsi::JSError(
|
|
16490
|
+
rt, "Expected an object for UniffiVTableCallbackInterfaceCpfpSigner");
|
|
16491
|
+
}
|
|
16492
|
+
|
|
16493
|
+
// Get the object from the jsi::Value
|
|
16494
|
+
auto jsObject = jsValue.getObject(rt);
|
|
16495
|
+
|
|
16496
|
+
// Create the vtable struct
|
|
16497
|
+
UniffiVTableCallbackInterfaceCpfpSigner rsObject;
|
|
16498
|
+
|
|
16499
|
+
// Create the vtable from the js callbacks.
|
|
16500
|
+
rsObject.sign_psbt = uniffi::breez_sdk_spark::cb::
|
|
16501
|
+
callbackinterfacecpfpsignermethod0::makeCallbackFunction(
|
|
16502
|
+
rt, callInvoker, jsObject.getProperty(rt, "signPsbt"));
|
|
16503
|
+
rsObject.uniffi_free =
|
|
16504
|
+
uniffi::breez_sdk_spark::st::vtablecallbackinterfacecpfpsigner::
|
|
16505
|
+
vtablecallbackinterfacecpfpsigner::free::makeCallbackFunction(
|
|
16506
|
+
rt, callInvoker, jsObject.getProperty(rt, "uniffiFree"));
|
|
16507
|
+
|
|
16508
|
+
return rsObject;
|
|
16509
|
+
}
|
|
16510
|
+
};
|
|
16511
|
+
|
|
16512
|
+
} // namespace uniffi::breez_sdk_spark
|
|
16513
|
+
namespace uniffi::breez_sdk_spark {
|
|
16514
|
+
using namespace facebook;
|
|
16515
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
16516
|
+
|
|
15719
16517
|
template <> struct Bridging<UniffiVTableCallbackInterfaceExternalBreezSigner> {
|
|
15720
16518
|
static UniffiVTableCallbackInterfaceExternalBreezSigner
|
|
15721
16519
|
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
@@ -15854,39 +16652,42 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceExternalSparkSigner> {
|
|
|
15854
16652
|
rsObject.sign_message = uniffi::breez_sdk_spark::cb::
|
|
15855
16653
|
callbackinterfaceexternalsparksignermethod5::makeCallbackFunction(
|
|
15856
16654
|
rt, callInvoker, jsObject.getProperty(rt, "signMessage"));
|
|
15857
|
-
rsObject.
|
|
16655
|
+
rsObject.sign_leaf_refund_spend = uniffi::breez_sdk_spark::cb::
|
|
15858
16656
|
callbackinterfaceexternalsparksignermethod6::makeCallbackFunction(
|
|
16657
|
+
rt, callInvoker, jsObject.getProperty(rt, "signLeafRefundSpend"));
|
|
16658
|
+
rsObject.sign_frost = uniffi::breez_sdk_spark::cb::
|
|
16659
|
+
callbackinterfaceexternalsparksignermethod7::makeCallbackFunction(
|
|
15859
16660
|
rt, callInvoker, jsObject.getProperty(rt, "signFrost"));
|
|
15860
16661
|
rsObject.prepare_transfer = uniffi::breez_sdk_spark::cb::
|
|
15861
|
-
|
|
16662
|
+
callbackinterfaceexternalsparksignermethod8::makeCallbackFunction(
|
|
15862
16663
|
rt, callInvoker, jsObject.getProperty(rt, "prepareTransfer"));
|
|
15863
16664
|
rsObject.prepare_claim = uniffi::breez_sdk_spark::cb::
|
|
15864
|
-
|
|
16665
|
+
callbackinterfaceexternalsparksignermethod9::makeCallbackFunction(
|
|
15865
16666
|
rt, callInvoker, jsObject.getProperty(rt, "prepareClaim"));
|
|
15866
16667
|
rsObject.prepare_lightning_receive = uniffi::breez_sdk_spark::cb::
|
|
15867
|
-
|
|
16668
|
+
callbackinterfaceexternalsparksignermethod10::makeCallbackFunction(
|
|
15868
16669
|
rt, callInvoker,
|
|
15869
16670
|
jsObject.getProperty(rt, "prepareLightningReceive"));
|
|
15870
16671
|
rsObject.prepare_static_deposit = uniffi::breez_sdk_spark::cb::
|
|
15871
|
-
|
|
16672
|
+
callbackinterfaceexternalsparksignermethod11::makeCallbackFunction(
|
|
15872
16673
|
rt, callInvoker, jsObject.getProperty(rt, "prepareStaticDeposit"));
|
|
15873
16674
|
rsObject.start_static_deposit_refund = uniffi::breez_sdk_spark::cb::
|
|
15874
|
-
|
|
16675
|
+
callbackinterfaceexternalsparksignermethod12::makeCallbackFunction(
|
|
15875
16676
|
rt, callInvoker,
|
|
15876
16677
|
jsObject.getProperty(rt, "startStaticDepositRefund"));
|
|
15877
16678
|
rsObject.sign_static_deposit_refund = uniffi::breez_sdk_spark::cb::
|
|
15878
|
-
|
|
16679
|
+
callbackinterfaceexternalsparksignermethod13::makeCallbackFunction(
|
|
15879
16680
|
rt, callInvoker,
|
|
15880
16681
|
jsObject.getProperty(rt, "signStaticDepositRefund"));
|
|
15881
16682
|
rsObject.sign_spark_invoice = uniffi::breez_sdk_spark::cb::
|
|
15882
|
-
|
|
16683
|
+
callbackinterfaceexternalsparksignermethod14::makeCallbackFunction(
|
|
15883
16684
|
rt, callInvoker, jsObject.getProperty(rt, "signSparkInvoice"));
|
|
15884
16685
|
rsObject.prepare_token_transaction = uniffi::breez_sdk_spark::cb::
|
|
15885
|
-
|
|
16686
|
+
callbackinterfaceexternalsparksignermethod15::makeCallbackFunction(
|
|
15886
16687
|
rt, callInvoker,
|
|
15887
16688
|
jsObject.getProperty(rt, "prepareTokenTransaction"));
|
|
15888
16689
|
rsObject.prepare_static_deposit_claim = uniffi::breez_sdk_spark::cb::
|
|
15889
|
-
|
|
16690
|
+
callbackinterfaceexternalsparksignermethod16::makeCallbackFunction(
|
|
15890
16691
|
rt, callInvoker,
|
|
15891
16692
|
jsObject.getProperty(rt, "prepareStaticDepositClaim"));
|
|
15892
16693
|
rsObject.uniffi_free = uniffi::breez_sdk_spark::st::
|
|
@@ -16364,6 +17165,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
16364
17165
|
->cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_utxos(
|
|
16365
17166
|
rt, thisVal, args, count);
|
|
16366
17167
|
});
|
|
17168
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_"
|
|
17169
|
+
"txos"] = jsi::Function::createFromHostFunction(
|
|
17170
|
+
rt,
|
|
17171
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
17172
|
+
"bitcoinchainservice_get_address_txos"),
|
|
17173
|
+
2,
|
|
17174
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17175
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17176
|
+
return this
|
|
17177
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_txos(
|
|
17178
|
+
rt, thisVal, args, count);
|
|
17179
|
+
});
|
|
16367
17180
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_"
|
|
16368
17181
|
"transaction_status"] = jsi::Function::createFromHostFunction(
|
|
16369
17182
|
rt,
|
|
@@ -16389,6 +17202,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
16389
17202
|
->cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_hex(
|
|
16390
17203
|
rt, thisVal, args, count);
|
|
16391
17204
|
});
|
|
17205
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_"
|
|
17206
|
+
"outspend"] = jsi::Function::createFromHostFunction(
|
|
17207
|
+
rt,
|
|
17208
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
17209
|
+
"bitcoinchainservice_get_outspend"),
|
|
17210
|
+
3,
|
|
17211
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17212
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17213
|
+
return this
|
|
17214
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_outspend(
|
|
17215
|
+
rt, thisVal, args, count);
|
|
17216
|
+
});
|
|
16392
17217
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_broadcast_"
|
|
16393
17218
|
"transaction"] = jsi::Function::createFromHostFunction(
|
|
16394
17219
|
rt,
|
|
@@ -16867,6 +17692,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
16867
17692
|
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_send_payment(
|
|
16868
17693
|
rt, thisVal, args, count);
|
|
16869
17694
|
});
|
|
17695
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_"
|
|
17696
|
+
"exit"] = jsi::Function::createFromHostFunction(
|
|
17697
|
+
rt,
|
|
17698
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
17699
|
+
"breezsdk_prepare_unilateral_exit"),
|
|
17700
|
+
2,
|
|
17701
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17702
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17703
|
+
return this
|
|
17704
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_exit(
|
|
17705
|
+
rt, thisVal, args, count);
|
|
17706
|
+
});
|
|
16870
17707
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_publish_signed_lnurl_"
|
|
16871
17708
|
"pay_package"] = jsi::Function::createFromHostFunction(
|
|
16872
17709
|
rt,
|
|
@@ -17016,6 +17853,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
17016
17853
|
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
17017
17854
|
rt, thisVal, args, count);
|
|
17018
17855
|
});
|
|
17856
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit"] =
|
|
17857
|
+
jsi::Function::createFromHostFunction(
|
|
17858
|
+
rt,
|
|
17859
|
+
jsi::PropNameID::forAscii(
|
|
17860
|
+
rt,
|
|
17861
|
+
"ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit"),
|
|
17862
|
+
3,
|
|
17863
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17864
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17865
|
+
return this
|
|
17866
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit(
|
|
17867
|
+
rt, thisVal, args, count);
|
|
17868
|
+
});
|
|
17019
17869
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_unregister_webhook"] =
|
|
17020
17870
|
jsi::Function::createFromHostFunction(
|
|
17021
17871
|
rt,
|
|
@@ -17053,6 +17903,53 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
17053
17903
|
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_update_user_settings(
|
|
17054
17904
|
rt, thisVal, args, count);
|
|
17055
17905
|
});
|
|
17906
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_clone_cpfpsigner"] =
|
|
17907
|
+
jsi::Function::createFromHostFunction(
|
|
17908
|
+
rt,
|
|
17909
|
+
jsi::PropNameID::forAscii(
|
|
17910
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_clone_cpfpsigner"),
|
|
17911
|
+
1,
|
|
17912
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17913
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17914
|
+
return this->cpp_uniffi_breez_sdk_spark_fn_clone_cpfpsigner(
|
|
17915
|
+
rt, thisVal, args, count);
|
|
17916
|
+
});
|
|
17917
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_free_cpfpsigner"] =
|
|
17918
|
+
jsi::Function::createFromHostFunction(
|
|
17919
|
+
rt,
|
|
17920
|
+
jsi::PropNameID::forAscii(
|
|
17921
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_free_cpfpsigner"),
|
|
17922
|
+
1,
|
|
17923
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17924
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17925
|
+
return this->cpp_uniffi_breez_sdk_spark_fn_free_cpfpsigner(
|
|
17926
|
+
rt, thisVal, args, count);
|
|
17927
|
+
});
|
|
17928
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner"] =
|
|
17929
|
+
jsi::Function::createFromHostFunction(
|
|
17930
|
+
rt,
|
|
17931
|
+
jsi::PropNameID::forAscii(
|
|
17932
|
+
rt,
|
|
17933
|
+
"ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner"),
|
|
17934
|
+
1,
|
|
17935
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17936
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17937
|
+
return this
|
|
17938
|
+
->cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner(
|
|
17939
|
+
rt, thisVal, args, count);
|
|
17940
|
+
});
|
|
17941
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt"] =
|
|
17942
|
+
jsi::Function::createFromHostFunction(
|
|
17943
|
+
rt,
|
|
17944
|
+
jsi::PropNameID::forAscii(
|
|
17945
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt"),
|
|
17946
|
+
2,
|
|
17947
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17948
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17949
|
+
return this
|
|
17950
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt(
|
|
17951
|
+
rt, thisVal, args, count);
|
|
17952
|
+
});
|
|
17056
17953
|
props["ubrn_uniffi_breez_sdk_spark_fn_clone_externalbreezsigner"] =
|
|
17057
17954
|
jsi::Function::createFromHostFunction(
|
|
17058
17955
|
rt,
|
|
@@ -17369,6 +18266,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
17369
18266
|
->cpp_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_message(
|
|
17370
18267
|
rt, thisVal, args, count);
|
|
17371
18268
|
});
|
|
18269
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_"
|
|
18270
|
+
"refund_spend"] = jsi::Function::createFromHostFunction(
|
|
18271
|
+
rt,
|
|
18272
|
+
jsi::PropNameID::forAscii(rt,
|
|
18273
|
+
"ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
18274
|
+
"externalsparksigner_sign_leaf_refund_spend"),
|
|
18275
|
+
3,
|
|
18276
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
18277
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
18278
|
+
return this
|
|
18279
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_refund_spend(
|
|
18280
|
+
rt, thisVal, args, count);
|
|
18281
|
+
});
|
|
17372
18282
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_"
|
|
17373
18283
|
"frost"] = jsi::Function::createFromHostFunction(
|
|
17374
18284
|
rt,
|
|
@@ -18960,6 +19870,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
18960
19870
|
->cpp_uniffi_breez_sdk_spark_fn_func_new_shared_sdk_context(
|
|
18961
19871
|
rt, thisVal, args, count);
|
|
18962
19872
|
});
|
|
19873
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer"] =
|
|
19874
|
+
jsi::Function::createFromHostFunction(
|
|
19875
|
+
rt,
|
|
19876
|
+
jsi::PropNameID::forAscii(
|
|
19877
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer"),
|
|
19878
|
+
1,
|
|
19879
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
19880
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
19881
|
+
return this
|
|
19882
|
+
->cpp_uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer(
|
|
19883
|
+
rt, thisVal, args, count);
|
|
19884
|
+
});
|
|
18963
19885
|
props["ubrn_ffi_breez_sdk_spark_rust_future_poll_u8"] =
|
|
18964
19886
|
jsi::Function::createFromHostFunction(
|
|
18965
19887
|
rt,
|
|
@@ -19712,6 +20634,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
19712
20634
|
->cpp_uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context(
|
|
19713
20635
|
rt, thisVal, args, count);
|
|
19714
20636
|
});
|
|
20637
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer"] =
|
|
20638
|
+
jsi::Function::createFromHostFunction(
|
|
20639
|
+
rt,
|
|
20640
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
20641
|
+
"func_single_key_cpfp_signer"),
|
|
20642
|
+
0,
|
|
20643
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
20644
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
20645
|
+
return this
|
|
20646
|
+
->cpp_uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer(
|
|
20647
|
+
rt, thisVal, args, count);
|
|
20648
|
+
});
|
|
19715
20649
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
|
|
19716
20650
|
"address_utxos"] = jsi::Function::createFromHostFunction(
|
|
19717
20651
|
rt,
|
|
@@ -19725,6 +20659,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
19725
20659
|
->cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos(
|
|
19726
20660
|
rt, thisVal, args, count);
|
|
19727
20661
|
});
|
|
20662
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
|
|
20663
|
+
"address_txos"] = jsi::Function::createFromHostFunction(
|
|
20664
|
+
rt,
|
|
20665
|
+
jsi::PropNameID::forAscii(rt,
|
|
20666
|
+
"ubrn_uniffi_breez_sdk_spark_checksum_method_"
|
|
20667
|
+
"bitcoinchainservice_get_address_txos"),
|
|
20668
|
+
0,
|
|
20669
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
20670
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
20671
|
+
return this
|
|
20672
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos(
|
|
20673
|
+
rt, thisVal, args, count);
|
|
20674
|
+
});
|
|
19728
20675
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
|
|
19729
20676
|
"transaction_status"] = jsi::Function::createFromHostFunction(
|
|
19730
20677
|
rt,
|
|
@@ -19751,6 +20698,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
19751
20698
|
->cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex(
|
|
19752
20699
|
rt, thisVal, args, count);
|
|
19753
20700
|
});
|
|
20701
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
|
|
20702
|
+
"outspend"] = jsi::Function::createFromHostFunction(
|
|
20703
|
+
rt,
|
|
20704
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
20705
|
+
"method_bitcoinchainservice_get_outspend"),
|
|
20706
|
+
0,
|
|
20707
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
20708
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
20709
|
+
return this
|
|
20710
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend(
|
|
20711
|
+
rt, thisVal, args, count);
|
|
20712
|
+
});
|
|
19754
20713
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_"
|
|
19755
20714
|
"broadcast_transaction"] = jsi::Function::createFromHostFunction(
|
|
19756
20715
|
rt,
|
|
@@ -20204,6 +21163,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
20204
21163
|
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment(
|
|
20205
21164
|
rt, thisVal, args, count);
|
|
20206
21165
|
});
|
|
21166
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_"
|
|
21167
|
+
"unilateral_exit"] = jsi::Function::createFromHostFunction(
|
|
21168
|
+
rt,
|
|
21169
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
21170
|
+
"method_breezsdk_prepare_unilateral_exit"),
|
|
21171
|
+
0,
|
|
21172
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
21173
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
21174
|
+
return this
|
|
21175
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit(
|
|
21176
|
+
rt, thisVal, args, count);
|
|
21177
|
+
});
|
|
20207
21178
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_"
|
|
20208
21179
|
"lnurl_pay_package"] = jsi::Function::createFromHostFunction(
|
|
20209
21180
|
rt,
|
|
@@ -20352,6 +21323,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
20352
21323
|
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet(
|
|
20353
21324
|
rt, thisVal, args, count);
|
|
20354
21325
|
});
|
|
21326
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_"
|
|
21327
|
+
"exit"] = jsi::Function::createFromHostFunction(
|
|
21328
|
+
rt,
|
|
21329
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
21330
|
+
"method_breezsdk_unilateral_exit"),
|
|
21331
|
+
0,
|
|
21332
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
21333
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
21334
|
+
return this
|
|
21335
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit(
|
|
21336
|
+
rt, thisVal, args, count);
|
|
21337
|
+
});
|
|
20355
21338
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unregister_"
|
|
20356
21339
|
"webhook"] = jsi::Function::createFromHostFunction(
|
|
20357
21340
|
rt,
|
|
@@ -20388,6 +21371,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
20388
21371
|
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_update_user_settings(
|
|
20389
21372
|
rt, thisVal, args, count);
|
|
20390
21373
|
});
|
|
21374
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt"] =
|
|
21375
|
+
jsi::Function::createFromHostFunction(
|
|
21376
|
+
rt,
|
|
21377
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
21378
|
+
"method_cpfpsigner_sign_psbt"),
|
|
21379
|
+
0,
|
|
21380
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
21381
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
21382
|
+
return this
|
|
21383
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt(
|
|
21384
|
+
rt, thisVal, args, count);
|
|
21385
|
+
});
|
|
20391
21386
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_"
|
|
20392
21387
|
"derive_public_key"] = jsi::Function::createFromHostFunction(
|
|
20393
21388
|
rt,
|
|
@@ -20602,6 +21597,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
20602
21597
|
->cpp_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_message(
|
|
20603
21598
|
rt, thisVal, args, count);
|
|
20604
21599
|
});
|
|
21600
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_"
|
|
21601
|
+
"leaf_refund_spend"] = jsi::Function::createFromHostFunction(
|
|
21602
|
+
rt,
|
|
21603
|
+
jsi::PropNameID::forAscii(rt,
|
|
21604
|
+
"ubrn_uniffi_breez_sdk_spark_checksum_method_"
|
|
21605
|
+
"externalsparksigner_sign_leaf_refund_spend"),
|
|
21606
|
+
0,
|
|
21607
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
21608
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
21609
|
+
return this
|
|
21610
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend(
|
|
21611
|
+
rt, thisVal, args, count);
|
|
21612
|
+
});
|
|
20605
21613
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_"
|
|
20606
21614
|
"frost"] = jsi::Function::createFromHostFunction(
|
|
20607
21615
|
rt,
|
|
@@ -21689,6 +22697,19 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
21689
22697
|
->cpp_uniffi_internal_fn_method_breezsdk_ffi__bless_pointer(
|
|
21690
22698
|
rt, thisVal, args, count);
|
|
21691
22699
|
});
|
|
22700
|
+
props["ubrn_uniffi_internal_fn_method_cpfpsigner_ffi__bless_pointer"] =
|
|
22701
|
+
jsi::Function::createFromHostFunction(
|
|
22702
|
+
rt,
|
|
22703
|
+
jsi::PropNameID::forAscii(
|
|
22704
|
+
rt,
|
|
22705
|
+
"ubrn_uniffi_internal_fn_method_cpfpsigner_ffi__bless_pointer"),
|
|
22706
|
+
1,
|
|
22707
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
22708
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
22709
|
+
return this
|
|
22710
|
+
->cpp_uniffi_internal_fn_method_cpfpsigner_ffi__bless_pointer(
|
|
22711
|
+
rt, thisVal, args, count);
|
|
22712
|
+
});
|
|
21692
22713
|
props["ubrn_uniffi_internal_fn_method_externalbreezsigner_ffi__bless_"
|
|
21693
22714
|
"pointer"] = jsi::Function::createFromHostFunction(
|
|
21694
22715
|
rt,
|
|
@@ -21937,6 +22958,8 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
|
|
|
21937
22958
|
vtablecallbackinterfacelogger::free::cleanup();
|
|
21938
22959
|
uniffi::breez_sdk_spark::st::vtablecallbackinterfacebitcoinchainservice::
|
|
21939
22960
|
vtablecallbackinterfacebitcoinchainservice::free::cleanup();
|
|
22961
|
+
uniffi::breez_sdk_spark::st::vtablecallbackinterfacecpfpsigner::
|
|
22962
|
+
vtablecallbackinterfacecpfpsigner::free::cleanup();
|
|
21940
22963
|
uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalbreezsigner::
|
|
21941
22964
|
vtablecallbackinterfaceexternalbreezsigner::free::cleanup();
|
|
21942
22965
|
uniffi::breez_sdk_spark::st::vtablecallbackinterfaceexternalsigningsigner::
|
|
@@ -21976,6 +22999,14 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
|
|
|
21976
22999
|
// Cleanup for callback function CallbackInterfaceBitcoinChainServiceMethod4
|
|
21977
23000
|
uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod4::
|
|
21978
23001
|
cleanup();
|
|
23002
|
+
// Cleanup for callback function CallbackInterfaceBitcoinChainServiceMethod5
|
|
23003
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod5::
|
|
23004
|
+
cleanup();
|
|
23005
|
+
// Cleanup for callback function CallbackInterfaceBitcoinChainServiceMethod6
|
|
23006
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod6::
|
|
23007
|
+
cleanup();
|
|
23008
|
+
// Cleanup for callback function CallbackInterfaceCpfpSignerMethod0
|
|
23009
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacecpfpsignermethod0::cleanup();
|
|
21979
23010
|
// Cleanup for callback function CallbackInterfaceExternalBreezSignerMethod0
|
|
21980
23011
|
uniffi::breez_sdk_spark::cb::callbackinterfaceexternalbreezsignermethod0::
|
|
21981
23012
|
cleanup();
|
|
@@ -22057,6 +23088,9 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
|
|
|
22057
23088
|
// Cleanup for callback function CallbackInterfaceExternalSparkSignerMethod15
|
|
22058
23089
|
uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod15::
|
|
22059
23090
|
cleanup();
|
|
23091
|
+
// Cleanup for callback function CallbackInterfaceExternalSparkSignerMethod16
|
|
23092
|
+
uniffi::breez_sdk_spark::cb::callbackinterfaceexternalsparksignermethod16::
|
|
23093
|
+
cleanup();
|
|
22060
23094
|
// Cleanup for callback function CallbackInterfaceFiatServiceMethod0
|
|
22061
23095
|
uniffi::breez_sdk_spark::cb::callbackinterfacefiatservicemethod0::cleanup();
|
|
22062
23096
|
// Cleanup for callback function CallbackInterfaceFiatServiceMethod1
|
|
@@ -22203,6 +23237,22 @@ NativeBreezSdkSpark::cpp_uniffi_internal_fn_method_breezsdk_ffi__bless_pointer(
|
|
|
22203
23237
|
auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
|
|
22204
23238
|
return jsi::Value(rt, obj);
|
|
22205
23239
|
}
|
|
23240
|
+
jsi::Value NativeBreezSdkSpark::
|
|
23241
|
+
cpp_uniffi_internal_fn_method_cpfpsigner_ffi__bless_pointer(
|
|
23242
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
23243
|
+
size_t count) {
|
|
23244
|
+
auto pointer =
|
|
23245
|
+
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
|
|
23246
|
+
auto static destructor = [](uint64_t p) {
|
|
23247
|
+
auto pointer = reinterpret_cast<void *>(static_cast<uintptr_t>(p));
|
|
23248
|
+
RustCallStatus status = {0};
|
|
23249
|
+
uniffi_breez_sdk_spark_fn_free_cpfpsigner(pointer, &status);
|
|
23250
|
+
};
|
|
23251
|
+
auto ptrObj =
|
|
23252
|
+
std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
|
|
23253
|
+
auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
|
|
23254
|
+
return jsi::Value(rt, obj);
|
|
23255
|
+
}
|
|
22206
23256
|
jsi::Value NativeBreezSdkSpark::
|
|
22207
23257
|
cpp_uniffi_internal_fn_method_externalbreezsigner_ffi__bless_pointer(
|
|
22208
23258
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -22515,6 +23565,19 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
22515
23565
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
22516
23566
|
value);
|
|
22517
23567
|
}
|
|
23568
|
+
jsi::Value NativeBreezSdkSpark::
|
|
23569
|
+
cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_txos(
|
|
23570
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
23571
|
+
size_t count) {
|
|
23572
|
+
auto value =
|
|
23573
|
+
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_txos(
|
|
23574
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
23575
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
23576
|
+
args[1]));
|
|
23577
|
+
|
|
23578
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23579
|
+
value);
|
|
23580
|
+
}
|
|
22518
23581
|
jsi::Value NativeBreezSdkSpark::
|
|
22519
23582
|
cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_transaction_status(
|
|
22520
23583
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -22541,6 +23604,20 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
22541
23604
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
22542
23605
|
value);
|
|
22543
23606
|
}
|
|
23607
|
+
jsi::Value NativeBreezSdkSpark::
|
|
23608
|
+
cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_outspend(
|
|
23609
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
23610
|
+
size_t count) {
|
|
23611
|
+
auto value =
|
|
23612
|
+
uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_outspend(
|
|
23613
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
23614
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
23615
|
+
args[1]),
|
|
23616
|
+
uniffi_jsi::Bridging<uint32_t>::fromJs(rt, callInvoker, args[2]));
|
|
23617
|
+
|
|
23618
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23619
|
+
value);
|
|
23620
|
+
}
|
|
22544
23621
|
jsi::Value NativeBreezSdkSpark::
|
|
22545
23622
|
cpp_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_broadcast_transaction(
|
|
22546
23623
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -23003,6 +24080,19 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
23003
24080
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23004
24081
|
value);
|
|
23005
24082
|
}
|
|
24083
|
+
jsi::Value NativeBreezSdkSpark::
|
|
24084
|
+
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_exit(
|
|
24085
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24086
|
+
size_t count) {
|
|
24087
|
+
auto value =
|
|
24088
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_exit(
|
|
24089
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
24090
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
24091
|
+
args[1]));
|
|
24092
|
+
|
|
24093
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
24094
|
+
value);
|
|
24095
|
+
}
|
|
23006
24096
|
jsi::Value NativeBreezSdkSpark::
|
|
23007
24097
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_publish_signed_lnurl_pay_package(
|
|
23008
24098
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -23147,6 +24237,19 @@ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
|
23147
24237
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23148
24238
|
value);
|
|
23149
24239
|
}
|
|
24240
|
+
jsi::Value NativeBreezSdkSpark::
|
|
24241
|
+
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit(
|
|
24242
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24243
|
+
size_t count) {
|
|
24244
|
+
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit(
|
|
24245
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
24246
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
24247
|
+
args[1]),
|
|
24248
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[2]));
|
|
24249
|
+
|
|
24250
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
24251
|
+
value);
|
|
24252
|
+
}
|
|
23150
24253
|
jsi::Value NativeBreezSdkSpark::
|
|
23151
24254
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_unregister_webhook(
|
|
23152
24255
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -23183,6 +24286,57 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
23183
24286
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23184
24287
|
value);
|
|
23185
24288
|
}
|
|
24289
|
+
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_cpfpsigner(
|
|
24290
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24291
|
+
size_t count) {
|
|
24292
|
+
RustCallStatus status =
|
|
24293
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
24294
|
+
auto value = uniffi_breez_sdk_spark_fn_clone_cpfpsigner(
|
|
24295
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
|
|
24296
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
24297
|
+
rt, callInvoker, status, args[count - 1]);
|
|
24298
|
+
|
|
24299
|
+
return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
|
|
24300
|
+
}
|
|
24301
|
+
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_free_cpfpsigner(
|
|
24302
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24303
|
+
size_t count) {
|
|
24304
|
+
RustCallStatus status =
|
|
24305
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
24306
|
+
uniffi_breez_sdk_spark_fn_free_cpfpsigner(
|
|
24307
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
|
|
24308
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
24309
|
+
rt, callInvoker, status, args[count - 1]);
|
|
24310
|
+
|
|
24311
|
+
return jsi::Value::undefined();
|
|
24312
|
+
}
|
|
24313
|
+
jsi::Value NativeBreezSdkSpark::
|
|
24314
|
+
cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner(
|
|
24315
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24316
|
+
size_t count) {
|
|
24317
|
+
auto vtableInstance = uniffi::breez_sdk_spark::Bridging<
|
|
24318
|
+
UniffiVTableCallbackInterfaceCpfpSigner>::fromJs(rt, callInvoker,
|
|
24319
|
+
args[0]);
|
|
24320
|
+
|
|
24321
|
+
std::lock_guard<std::mutex> lock(
|
|
24322
|
+
uniffi::breez_sdk_spark::registry::vtableMutex);
|
|
24323
|
+
uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner(
|
|
24324
|
+
uniffi::breez_sdk_spark::registry::putTable(
|
|
24325
|
+
"UniffiVTableCallbackInterfaceCpfpSigner", vtableInstance));
|
|
24326
|
+
return jsi::Value::undefined();
|
|
24327
|
+
}
|
|
24328
|
+
jsi::Value
|
|
24329
|
+
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt(
|
|
24330
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24331
|
+
size_t count) {
|
|
24332
|
+
auto value = uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt(
|
|
24333
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
24334
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
24335
|
+
args[1]));
|
|
24336
|
+
|
|
24337
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
24338
|
+
value);
|
|
24339
|
+
}
|
|
23186
24340
|
jsi::Value
|
|
23187
24341
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_externalbreezsigner(
|
|
23188
24342
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -23542,6 +24696,21 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
23542
24696
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23543
24697
|
value);
|
|
23544
24698
|
}
|
|
24699
|
+
jsi::Value NativeBreezSdkSpark::
|
|
24700
|
+
cpp_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_refund_spend(
|
|
24701
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24702
|
+
size_t count) {
|
|
24703
|
+
auto value =
|
|
24704
|
+
uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_refund_spend(
|
|
24705
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
24706
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
24707
|
+
args[1]),
|
|
24708
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
24709
|
+
args[2]));
|
|
24710
|
+
|
|
24711
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
24712
|
+
value);
|
|
24713
|
+
}
|
|
23545
24714
|
jsi::Value NativeBreezSdkSpark::
|
|
23546
24715
|
cpp_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_frost(
|
|
23547
24716
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -25239,6 +26408,21 @@ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_new_shared_sdk_context(
|
|
|
25239
26408
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
25240
26409
|
value);
|
|
25241
26410
|
}
|
|
26411
|
+
jsi::Value
|
|
26412
|
+
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer(
|
|
26413
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
26414
|
+
size_t count) {
|
|
26415
|
+
RustCallStatus status =
|
|
26416
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
26417
|
+
auto value = uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer(
|
|
26418
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
26419
|
+
args[0]),
|
|
26420
|
+
&status);
|
|
26421
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
26422
|
+
rt, callInvoker, status, args[count - 1]);
|
|
26423
|
+
|
|
26424
|
+
return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
|
|
26425
|
+
}
|
|
25242
26426
|
jsi::Value NativeBreezSdkSpark::cpp_ffi_breez_sdk_spark_rust_future_poll_u8(
|
|
25243
26427
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
25244
26428
|
size_t count) {
|
|
@@ -25977,6 +27161,14 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
25977
27161
|
|
|
25978
27162
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
25979
27163
|
}
|
|
27164
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27165
|
+
cpp_uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer(
|
|
27166
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27167
|
+
size_t count) {
|
|
27168
|
+
auto value = uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer();
|
|
27169
|
+
|
|
27170
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27171
|
+
}
|
|
25980
27172
|
jsi::Value NativeBreezSdkSpark::
|
|
25981
27173
|
cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos(
|
|
25982
27174
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -25986,6 +27178,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
25986
27178
|
|
|
25987
27179
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
25988
27180
|
}
|
|
27181
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27182
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos(
|
|
27183
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27184
|
+
size_t count) {
|
|
27185
|
+
auto value =
|
|
27186
|
+
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos();
|
|
27187
|
+
|
|
27188
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27189
|
+
}
|
|
25989
27190
|
jsi::Value NativeBreezSdkSpark::
|
|
25990
27191
|
cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status(
|
|
25991
27192
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -26004,6 +27205,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
26004
27205
|
|
|
26005
27206
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
26006
27207
|
}
|
|
27208
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27209
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend(
|
|
27210
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27211
|
+
size_t count) {
|
|
27212
|
+
auto value =
|
|
27213
|
+
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend();
|
|
27214
|
+
|
|
27215
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27216
|
+
}
|
|
26007
27217
|
jsi::Value NativeBreezSdkSpark::
|
|
26008
27218
|
cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction(
|
|
26009
27219
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -26322,6 +27532,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
26322
27532
|
|
|
26323
27533
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
26324
27534
|
}
|
|
27535
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27536
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit(
|
|
27537
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27538
|
+
size_t count) {
|
|
27539
|
+
auto value =
|
|
27540
|
+
uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit();
|
|
27541
|
+
|
|
27542
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27543
|
+
}
|
|
26325
27544
|
jsi::Value NativeBreezSdkSpark::
|
|
26326
27545
|
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_lnurl_pay_package(
|
|
26327
27546
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -26426,6 +27645,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
26426
27645
|
|
|
26427
27646
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
26428
27647
|
}
|
|
27648
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27649
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit(
|
|
27650
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27651
|
+
size_t count) {
|
|
27652
|
+
auto value =
|
|
27653
|
+
uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit();
|
|
27654
|
+
|
|
27655
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27656
|
+
}
|
|
26429
27657
|
jsi::Value NativeBreezSdkSpark::
|
|
26430
27658
|
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_unregister_webhook(
|
|
26431
27659
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -26452,6 +27680,14 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
26452
27680
|
|
|
26453
27681
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
26454
27682
|
}
|
|
27683
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27684
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt(
|
|
27685
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27686
|
+
size_t count) {
|
|
27687
|
+
auto value = uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt();
|
|
27688
|
+
|
|
27689
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27690
|
+
}
|
|
26455
27691
|
jsi::Value NativeBreezSdkSpark::
|
|
26456
27692
|
cpp_uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_derive_public_key(
|
|
26457
27693
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -26605,6 +27841,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
26605
27841
|
|
|
26606
27842
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
26607
27843
|
}
|
|
27844
|
+
jsi::Value NativeBreezSdkSpark::
|
|
27845
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend(
|
|
27846
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
27847
|
+
size_t count) {
|
|
27848
|
+
auto value =
|
|
27849
|
+
uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend();
|
|
27850
|
+
|
|
27851
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
27852
|
+
}
|
|
26608
27853
|
jsi::Value NativeBreezSdkSpark::
|
|
26609
27854
|
cpp_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost(
|
|
26610
27855
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|