@breeztech/breez-sdk-spark-react-native 0.16.1-dev1 → 0.17.1
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 +827 -163
- package/cpp/generated/breez_sdk_spark.hpp +30 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +332 -59
- 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 +331 -58
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +31 -17
- 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 +1960 -165
- 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 +31 -17
- 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 +1960 -165
- 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 +60 -17
- package/src/generated/breez_sdk_spark.ts +3777 -694
|
@@ -341,38 +341,50 @@ typedef void (*UniffiCallbackInterfaceStorageMethod17)(
|
|
|
341
341
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
342
342
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
343
343
|
typedef void (*UniffiCallbackInterfaceStorageMethod18)(
|
|
344
|
+
uint64_t uniffi_handle, RustBuffer swap,
|
|
345
|
+
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
346
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
347
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod19)(
|
|
348
|
+
uint64_t uniffi_handle, RustBuffer provider, RustBuffer id,
|
|
349
|
+
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
350
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
351
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod20)(
|
|
352
|
+
uint64_t uniffi_handle, RustBuffer provider,
|
|
353
|
+
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
354
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
355
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod21)(
|
|
344
356
|
uint64_t uniffi_handle, RustBuffer record,
|
|
345
357
|
UniffiForeignFutureCompleteU64 uniffi_future_callback,
|
|
346
358
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
347
|
-
typedef void (*
|
|
359
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod22)(
|
|
348
360
|
uint64_t uniffi_handle, RustBuffer record, uint64_t local_revision,
|
|
349
361
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
350
362
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
351
|
-
typedef void (*
|
|
363
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod23)(
|
|
352
364
|
uint64_t uniffi_handle, uint32_t limit,
|
|
353
365
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
354
366
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
355
|
-
typedef void (*
|
|
367
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod24)(
|
|
356
368
|
uint64_t uniffi_handle,
|
|
357
369
|
UniffiForeignFutureCompleteU64 uniffi_future_callback,
|
|
358
370
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
359
|
-
typedef void (*
|
|
371
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod25)(
|
|
360
372
|
uint64_t uniffi_handle, RustBuffer records,
|
|
361
373
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
362
374
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
363
|
-
typedef void (*
|
|
375
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod26)(
|
|
364
376
|
uint64_t uniffi_handle, RustBuffer record,
|
|
365
377
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
366
378
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
367
|
-
typedef void (*
|
|
379
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod27)(
|
|
368
380
|
uint64_t uniffi_handle, uint32_t limit,
|
|
369
381
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
370
382
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
371
|
-
typedef void (*
|
|
383
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod28)(
|
|
372
384
|
uint64_t uniffi_handle,
|
|
373
385
|
UniffiForeignFutureCompleteRustBuffer uniffi_future_callback,
|
|
374
386
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
375
|
-
typedef void (*
|
|
387
|
+
typedef void (*UniffiCallbackInterfaceStorageMethod29)(
|
|
376
388
|
uint64_t uniffi_handle, RustBuffer record,
|
|
377
389
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
378
390
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
@@ -475,15 +487,18 @@ typedef struct UniffiVTableCallbackInterfaceStorage {
|
|
|
475
487
|
UniffiCallbackInterfaceStorageMethod15 get_contact;
|
|
476
488
|
UniffiCallbackInterfaceStorageMethod16 insert_contact;
|
|
477
489
|
UniffiCallbackInterfaceStorageMethod17 delete_contact;
|
|
478
|
-
UniffiCallbackInterfaceStorageMethod18
|
|
479
|
-
UniffiCallbackInterfaceStorageMethod19
|
|
480
|
-
UniffiCallbackInterfaceStorageMethod20
|
|
481
|
-
UniffiCallbackInterfaceStorageMethod21
|
|
482
|
-
UniffiCallbackInterfaceStorageMethod22
|
|
483
|
-
UniffiCallbackInterfaceStorageMethod23
|
|
484
|
-
UniffiCallbackInterfaceStorageMethod24
|
|
485
|
-
UniffiCallbackInterfaceStorageMethod25
|
|
486
|
-
UniffiCallbackInterfaceStorageMethod26
|
|
490
|
+
UniffiCallbackInterfaceStorageMethod18 set_cross_chain_swap;
|
|
491
|
+
UniffiCallbackInterfaceStorageMethod19 get_cross_chain_swap;
|
|
492
|
+
UniffiCallbackInterfaceStorageMethod20 list_active_cross_chain_swaps;
|
|
493
|
+
UniffiCallbackInterfaceStorageMethod21 add_outgoing_change;
|
|
494
|
+
UniffiCallbackInterfaceStorageMethod22 complete_outgoing_sync;
|
|
495
|
+
UniffiCallbackInterfaceStorageMethod23 get_pending_outgoing_changes;
|
|
496
|
+
UniffiCallbackInterfaceStorageMethod24 get_last_revision;
|
|
497
|
+
UniffiCallbackInterfaceStorageMethod25 insert_incoming_records;
|
|
498
|
+
UniffiCallbackInterfaceStorageMethod26 delete_incoming_record;
|
|
499
|
+
UniffiCallbackInterfaceStorageMethod27 get_incoming_records;
|
|
500
|
+
UniffiCallbackInterfaceStorageMethod28 get_latest_outgoing_change;
|
|
501
|
+
UniffiCallbackInterfaceStorageMethod29 update_record_from_incoming;
|
|
487
502
|
UniffiCallbackInterfaceFree uniffi_free;
|
|
488
503
|
} UniffiVTableCallbackInterfaceStorage;
|
|
489
504
|
typedef struct UniffiVTableCallbackInterfaceStorageBackend {
|
|
@@ -553,6 +568,9 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(void *ptr);
|
|
|
553
568
|
uniffi_breez_sdk_spark_fn_method_breezsdk_fetch_conversion_limits(
|
|
554
569
|
void *ptr, RustBuffer request);
|
|
555
570
|
/*handle*/ uint64_t
|
|
571
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_get_cross_chain_routes(
|
|
572
|
+
void *ptr, RustBuffer filter);
|
|
573
|
+
/*handle*/ uint64_t
|
|
556
574
|
uniffi_breez_sdk_spark_fn_method_breezsdk_get_info(void *ptr,
|
|
557
575
|
RustBuffer request);
|
|
558
576
|
/*handle*/ uint64_t
|
|
@@ -920,6 +938,15 @@ uniffi_breez_sdk_spark_fn_method_storage_insert_contact(void *ptr,
|
|
|
920
938
|
uniffi_breez_sdk_spark_fn_method_storage_delete_contact(void *ptr,
|
|
921
939
|
RustBuffer id);
|
|
922
940
|
/*handle*/ uint64_t
|
|
941
|
+
uniffi_breez_sdk_spark_fn_method_storage_set_cross_chain_swap(void *ptr,
|
|
942
|
+
RustBuffer swap);
|
|
943
|
+
/*handle*/ uint64_t
|
|
944
|
+
uniffi_breez_sdk_spark_fn_method_storage_get_cross_chain_swap(
|
|
945
|
+
void *ptr, RustBuffer provider, RustBuffer id);
|
|
946
|
+
/*handle*/ uint64_t
|
|
947
|
+
uniffi_breez_sdk_spark_fn_method_storage_list_active_cross_chain_swaps(
|
|
948
|
+
void *ptr, RustBuffer provider);
|
|
949
|
+
/*handle*/ uint64_t
|
|
923
950
|
uniffi_breez_sdk_spark_fn_method_storage_add_outgoing_change(void *ptr,
|
|
924
951
|
RustBuffer record);
|
|
925
952
|
/*handle*/ uint64_t
|
|
@@ -1177,6 +1204,8 @@ uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address();
|
|
|
1177
1204
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect();
|
|
1178
1205
|
uint16_t
|
|
1179
1206
|
uniffi_breez_sdk_spark_checksum_method_breezsdk_fetch_conversion_limits();
|
|
1207
|
+
uint16_t
|
|
1208
|
+
uniffi_breez_sdk_spark_checksum_method_breezsdk_get_cross_chain_routes();
|
|
1180
1209
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_get_info();
|
|
1181
1210
|
uint16_t
|
|
1182
1211
|
uniffi_breez_sdk_spark_checksum_method_breezsdk_get_lightning_address();
|
|
@@ -1320,6 +1349,10 @@ uint16_t uniffi_breez_sdk_spark_checksum_method_storage_list_contacts();
|
|
|
1320
1349
|
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_get_contact();
|
|
1321
1350
|
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_insert_contact();
|
|
1322
1351
|
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_delete_contact();
|
|
1352
|
+
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_set_cross_chain_swap();
|
|
1353
|
+
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_get_cross_chain_swap();
|
|
1354
|
+
uint16_t
|
|
1355
|
+
uniffi_breez_sdk_spark_checksum_method_storage_list_active_cross_chain_swaps();
|
|
1323
1356
|
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_add_outgoing_change();
|
|
1324
1357
|
uint16_t
|
|
1325
1358
|
uniffi_breez_sdk_spark_checksum_method_storage_complete_outgoing_sync();
|
|
@@ -12787,7 +12820,7 @@ using namespace facebook;
|
|
|
12787
12820
|
|
|
12788
12821
|
// We need to store a lambda in a global so we can call it from
|
|
12789
12822
|
// a function pointer. The function pointer is passed to Rust.
|
|
12790
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
12823
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
12791
12824
|
uint64_t, UniffiForeignFuture *)>
|
|
12792
12825
|
rsLambda = nullptr;
|
|
12793
12826
|
|
|
@@ -12796,8 +12829,8 @@ static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteU64,
|
|
|
12796
12829
|
static void body(jsi::Runtime &rt,
|
|
12797
12830
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
12798
12831
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
12799
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
12800
|
-
|
|
12832
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_swap,
|
|
12833
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
12801
12834
|
uint64_t rs_uniffiCallbackData,
|
|
12802
12835
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
12803
12836
|
|
|
@@ -12805,10 +12838,10 @@ static void body(jsi::Runtime &rt,
|
|
|
12805
12838
|
// We'll use the Bridging class to do this…
|
|
12806
12839
|
auto js_uniffiHandle =
|
|
12807
12840
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
12808
|
-
auto
|
|
12809
|
-
rt, callInvoker,
|
|
12841
|
+
auto js_swap = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
12842
|
+
rt, callInvoker, rs_swap);
|
|
12810
12843
|
auto js_uniffiFutureCallback =
|
|
12811
|
-
uniffi::breez_sdk_spark::Bridging<
|
|
12844
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
12812
12845
|
rt, callInvoker, rs_uniffiFutureCallback);
|
|
12813
12846
|
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
12814
12847
|
rt, callInvoker, rs_uniffiCallbackData);
|
|
@@ -12819,7 +12852,7 @@ static void body(jsi::Runtime &rt,
|
|
|
12819
12852
|
try {
|
|
12820
12853
|
// Getting the callback function
|
|
12821
12854
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
12822
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
12855
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_swap,
|
|
12823
12856
|
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
12824
12857
|
|
|
12825
12858
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
@@ -12834,8 +12867,8 @@ static void body(jsi::Runtime &rt,
|
|
|
12834
12867
|
}
|
|
12835
12868
|
}
|
|
12836
12869
|
|
|
12837
|
-
static void callback(uint64_t rs_uniffiHandle, RustBuffer
|
|
12838
|
-
|
|
12870
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_swap,
|
|
12871
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
12839
12872
|
uint64_t rs_uniffiCallbackData,
|
|
12840
12873
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
12841
12874
|
// If the runtime has shutdown, then there is no point in trying to
|
|
@@ -12853,7 +12886,7 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
|
12853
12886
|
|
|
12854
12887
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
12855
12888
|
// are all in the lambda.
|
|
12856
|
-
rsLambda(rs_uniffiHandle,
|
|
12889
|
+
rsLambda(rs_uniffiHandle, rs_swap, rs_uniffiFutureCallback,
|
|
12857
12890
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
12858
12891
|
}
|
|
12859
12892
|
|
|
@@ -12877,17 +12910,17 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
12877
12910
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
12878
12911
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
12879
12912
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
12880
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
12881
|
-
|
|
12913
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_swap,
|
|
12914
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
12882
12915
|
uint64_t rs_uniffiCallbackData,
|
|
12883
12916
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
12884
12917
|
// We immediately make a lambda which will do the work of transforming the
|
|
12885
12918
|
// arguments into JSI values and calling the callback.
|
|
12886
12919
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
12887
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
12920
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_swap,
|
|
12888
12921
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
12889
12922
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
12890
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
12923
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_swap,
|
|
12891
12924
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
12892
12925
|
rs_uniffiOutReturn);
|
|
12893
12926
|
};
|
|
@@ -12928,8 +12961,8 @@ using namespace facebook;
|
|
|
12928
12961
|
|
|
12929
12962
|
// We need to store a lambda in a global so we can call it from
|
|
12930
12963
|
// a function pointer. The function pointer is passed to Rust.
|
|
12931
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
12932
|
-
|
|
12964
|
+
static std::function<void(uint64_t, RustBuffer, RustBuffer,
|
|
12965
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
12933
12966
|
UniffiForeignFuture *)>
|
|
12934
12967
|
rsLambda = nullptr;
|
|
12935
12968
|
|
|
@@ -12938,9 +12971,9 @@ static std::function<void(uint64_t, RustBuffer, uint64_t,
|
|
|
12938
12971
|
static void body(jsi::Runtime &rt,
|
|
12939
12972
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
12940
12973
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
12941
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
12942
|
-
|
|
12943
|
-
|
|
12974
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_provider,
|
|
12975
|
+
RustBuffer rs_id,
|
|
12976
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
12944
12977
|
uint64_t rs_uniffiCallbackData,
|
|
12945
12978
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
12946
12979
|
|
|
@@ -12948,13 +12981,13 @@ static void body(jsi::Runtime &rt,
|
|
|
12948
12981
|
// We'll use the Bridging class to do this…
|
|
12949
12982
|
auto js_uniffiHandle =
|
|
12950
12983
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
12951
|
-
auto
|
|
12952
|
-
rt, callInvoker,
|
|
12953
|
-
auto
|
|
12954
|
-
|
|
12955
|
-
auto js_uniffiFutureCallback =
|
|
12956
|
-
|
|
12957
|
-
|
|
12984
|
+
auto js_provider = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
12985
|
+
rt, callInvoker, rs_provider);
|
|
12986
|
+
auto js_id = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
12987
|
+
rt, callInvoker, rs_id);
|
|
12988
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
12989
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
12990
|
+
rs_uniffiFutureCallback);
|
|
12958
12991
|
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
12959
12992
|
rt, callInvoker, rs_uniffiCallbackData);
|
|
12960
12993
|
|
|
@@ -12964,9 +12997,8 @@ static void body(jsi::Runtime &rt,
|
|
|
12964
12997
|
try {
|
|
12965
12998
|
// Getting the callback function
|
|
12966
12999
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
12967
|
-
auto uniffiResult =
|
|
12968
|
-
|
|
12969
|
-
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13000
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_provider, js_id,
|
|
13001
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
12970
13002
|
|
|
12971
13003
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
12972
13004
|
// Finally, we need to copy the return value back into the Rust pointer.
|
|
@@ -12980,11 +13012,11 @@ static void body(jsi::Runtime &rt,
|
|
|
12980
13012
|
}
|
|
12981
13013
|
}
|
|
12982
13014
|
|
|
12983
|
-
static void
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
13015
|
+
static void
|
|
13016
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_provider, RustBuffer rs_id,
|
|
13017
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13018
|
+
uint64_t rs_uniffiCallbackData,
|
|
13019
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
12988
13020
|
// If the runtime has shutdown, then there is no point in trying to
|
|
12989
13021
|
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
12990
13022
|
//
|
|
@@ -13000,8 +13032,8 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
|
13000
13032
|
|
|
13001
13033
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13002
13034
|
// are all in the lambda.
|
|
13003
|
-
rsLambda(rs_uniffiHandle,
|
|
13004
|
-
|
|
13035
|
+
rsLambda(rs_uniffiHandle, rs_provider, rs_id, rs_uniffiFutureCallback,
|
|
13036
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13005
13037
|
}
|
|
13006
13038
|
|
|
13007
13039
|
static UniffiCallbackInterfaceStorageMethod19
|
|
@@ -13024,19 +13056,19 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
13024
13056
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13025
13057
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13026
13058
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13027
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
13028
|
-
|
|
13029
|
-
|
|
13059
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_provider,
|
|
13060
|
+
RustBuffer rs_id,
|
|
13061
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13030
13062
|
uint64_t rs_uniffiCallbackData,
|
|
13031
13063
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13032
13064
|
// We immediately make a lambda which will do the work of transforming the
|
|
13033
13065
|
// arguments into JSI values and calling the callback.
|
|
13034
13066
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13035
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
13036
|
-
|
|
13067
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_provider, rs_id,
|
|
13068
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13037
13069
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13038
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
13039
|
-
|
|
13070
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_provider,
|
|
13071
|
+
rs_id, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13040
13072
|
rs_uniffiOutReturn);
|
|
13041
13073
|
};
|
|
13042
13074
|
// We'll then call that lambda from the callInvoker which will
|
|
@@ -13076,7 +13108,7 @@ using namespace facebook;
|
|
|
13076
13108
|
|
|
13077
13109
|
// We need to store a lambda in a global so we can call it from
|
|
13078
13110
|
// a function pointer. The function pointer is passed to Rust.
|
|
13079
|
-
static std::function<void(uint64_t,
|
|
13111
|
+
static std::function<void(uint64_t, RustBuffer,
|
|
13080
13112
|
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
13081
13113
|
UniffiForeignFuture *)>
|
|
13082
13114
|
rsLambda = nullptr;
|
|
@@ -13086,7 +13118,7 @@ static std::function<void(uint64_t, uint32_t,
|
|
|
13086
13118
|
static void body(jsi::Runtime &rt,
|
|
13087
13119
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13088
13120
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
13089
|
-
uint64_t rs_uniffiHandle,
|
|
13121
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_provider,
|
|
13090
13122
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13091
13123
|
uint64_t rs_uniffiCallbackData,
|
|
13092
13124
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -13095,8 +13127,8 @@ static void body(jsi::Runtime &rt,
|
|
|
13095
13127
|
// We'll use the Bridging class to do this…
|
|
13096
13128
|
auto js_uniffiHandle =
|
|
13097
13129
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13098
|
-
auto
|
|
13099
|
-
|
|
13130
|
+
auto js_provider = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
13131
|
+
rt, callInvoker, rs_provider);
|
|
13100
13132
|
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
13101
13133
|
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
13102
13134
|
rs_uniffiFutureCallback);
|
|
@@ -13109,7 +13141,7 @@ static void body(jsi::Runtime &rt,
|
|
|
13109
13141
|
try {
|
|
13110
13142
|
// Getting the callback function
|
|
13111
13143
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13112
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
13144
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_provider,
|
|
13113
13145
|
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13114
13146
|
|
|
13115
13147
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
@@ -13125,7 +13157,7 @@ static void body(jsi::Runtime &rt,
|
|
|
13125
13157
|
}
|
|
13126
13158
|
|
|
13127
13159
|
static void
|
|
13128
|
-
callback(uint64_t rs_uniffiHandle,
|
|
13160
|
+
callback(uint64_t rs_uniffiHandle, RustBuffer rs_provider,
|
|
13129
13161
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13130
13162
|
uint64_t rs_uniffiCallbackData,
|
|
13131
13163
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -13144,7 +13176,7 @@ callback(uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
|
13144
13176
|
|
|
13145
13177
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13146
13178
|
// are all in the lambda.
|
|
13147
|
-
rsLambda(rs_uniffiHandle,
|
|
13179
|
+
rsLambda(rs_uniffiHandle, rs_provider, rs_uniffiFutureCallback,
|
|
13148
13180
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13149
13181
|
}
|
|
13150
13182
|
|
|
@@ -13168,17 +13200,17 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
13168
13200
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13169
13201
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13170
13202
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13171
|
-
uint64_t rs_uniffiHandle,
|
|
13203
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_provider,
|
|
13172
13204
|
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13173
13205
|
uint64_t rs_uniffiCallbackData,
|
|
13174
13206
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13175
13207
|
// We immediately make a lambda which will do the work of transforming the
|
|
13176
13208
|
// arguments into JSI values and calling the callback.
|
|
13177
13209
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13178
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
13210
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_provider,
|
|
13179
13211
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13180
13212
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13181
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
13213
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_provider,
|
|
13182
13214
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13183
13215
|
rs_uniffiOutReturn);
|
|
13184
13216
|
};
|
|
@@ -13219,8 +13251,8 @@ using namespace facebook;
|
|
|
13219
13251
|
|
|
13220
13252
|
// We need to store a lambda in a global so we can call it from
|
|
13221
13253
|
// a function pointer. The function pointer is passed to Rust.
|
|
13222
|
-
static std::function<void(uint64_t,
|
|
13223
|
-
UniffiForeignFuture *)>
|
|
13254
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteU64,
|
|
13255
|
+
uint64_t, UniffiForeignFuture *)>
|
|
13224
13256
|
rsLambda = nullptr;
|
|
13225
13257
|
|
|
13226
13258
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -13228,7 +13260,7 @@ static std::function<void(uint64_t, UniffiForeignFutureCompleteU64, uint64_t,
|
|
|
13228
13260
|
static void body(jsi::Runtime &rt,
|
|
13229
13261
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13230
13262
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
13231
|
-
uint64_t rs_uniffiHandle,
|
|
13263
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13232
13264
|
UniffiForeignFutureCompleteU64 rs_uniffiFutureCallback,
|
|
13233
13265
|
uint64_t rs_uniffiCallbackData,
|
|
13234
13266
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -13237,6 +13269,8 @@ static void body(jsi::Runtime &rt,
|
|
|
13237
13269
|
// We'll use the Bridging class to do this…
|
|
13238
13270
|
auto js_uniffiHandle =
|
|
13239
13271
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13272
|
+
auto js_record = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
13273
|
+
rt, callInvoker, rs_record);
|
|
13240
13274
|
auto js_uniffiFutureCallback =
|
|
13241
13275
|
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteU64>::toJs(
|
|
13242
13276
|
rt, callInvoker, rs_uniffiFutureCallback);
|
|
@@ -13249,8 +13283,8 @@ static void body(jsi::Runtime &rt,
|
|
|
13249
13283
|
try {
|
|
13250
13284
|
// Getting the callback function
|
|
13251
13285
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13252
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
13253
|
-
js_uniffiCallbackData);
|
|
13286
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_record,
|
|
13287
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13254
13288
|
|
|
13255
13289
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
13256
13290
|
// Finally, we need to copy the return value back into the Rust pointer.
|
|
@@ -13264,7 +13298,7 @@ static void body(jsi::Runtime &rt,
|
|
|
13264
13298
|
}
|
|
13265
13299
|
}
|
|
13266
13300
|
|
|
13267
|
-
static void callback(uint64_t rs_uniffiHandle,
|
|
13301
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13268
13302
|
UniffiForeignFutureCompleteU64 rs_uniffiFutureCallback,
|
|
13269
13303
|
uint64_t rs_uniffiCallbackData,
|
|
13270
13304
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -13283,8 +13317,8 @@ static void callback(uint64_t rs_uniffiHandle,
|
|
|
13283
13317
|
|
|
13284
13318
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13285
13319
|
// are all in the lambda.
|
|
13286
|
-
rsLambda(rs_uniffiHandle,
|
|
13287
|
-
rs_uniffiOutReturn);
|
|
13320
|
+
rsLambda(rs_uniffiHandle, rs_record, rs_uniffiFutureCallback,
|
|
13321
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13288
13322
|
}
|
|
13289
13323
|
|
|
13290
13324
|
static UniffiCallbackInterfaceStorageMethod21
|
|
@@ -13307,16 +13341,17 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
13307
13341
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13308
13342
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13309
13343
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13310
|
-
uint64_t rs_uniffiHandle,
|
|
13344
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13311
13345
|
UniffiForeignFutureCompleteU64 rs_uniffiFutureCallback,
|
|
13312
13346
|
uint64_t rs_uniffiCallbackData,
|
|
13313
13347
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13314
13348
|
// We immediately make a lambda which will do the work of transforming the
|
|
13315
13349
|
// arguments into JSI values and calling the callback.
|
|
13316
13350
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13317
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
13318
|
-
rs_uniffiCallbackData,
|
|
13319
|
-
|
|
13351
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_record,
|
|
13352
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13353
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13354
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_record,
|
|
13320
13355
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13321
13356
|
rs_uniffiOutReturn);
|
|
13322
13357
|
};
|
|
@@ -13357,8 +13392,9 @@ using namespace facebook;
|
|
|
13357
13392
|
|
|
13358
13393
|
// We need to store a lambda in a global so we can call it from
|
|
13359
13394
|
// a function pointer. The function pointer is passed to Rust.
|
|
13360
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
13361
|
-
uint64_t,
|
|
13395
|
+
static std::function<void(uint64_t, RustBuffer, uint64_t,
|
|
13396
|
+
UniffiForeignFutureCompleteVoid, uint64_t,
|
|
13397
|
+
UniffiForeignFuture *)>
|
|
13362
13398
|
rsLambda = nullptr;
|
|
13363
13399
|
|
|
13364
13400
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -13366,7 +13402,8 @@ static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
|
13366
13402
|
static void body(jsi::Runtime &rt,
|
|
13367
13403
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13368
13404
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
13369
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
13405
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13406
|
+
uint64_t rs_localRevision,
|
|
13370
13407
|
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13371
13408
|
uint64_t rs_uniffiCallbackData,
|
|
13372
13409
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -13375,8 +13412,10 @@ static void body(jsi::Runtime &rt,
|
|
|
13375
13412
|
// We'll use the Bridging class to do this…
|
|
13376
13413
|
auto js_uniffiHandle =
|
|
13377
13414
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13378
|
-
auto
|
|
13379
|
-
rt, callInvoker,
|
|
13415
|
+
auto js_record = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
13416
|
+
rt, callInvoker, rs_record);
|
|
13417
|
+
auto js_localRevision =
|
|
13418
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_localRevision);
|
|
13380
13419
|
auto js_uniffiFutureCallback =
|
|
13381
13420
|
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
13382
13421
|
rt, callInvoker, rs_uniffiFutureCallback);
|
|
@@ -13389,8 +13428,9 @@ static void body(jsi::Runtime &rt,
|
|
|
13389
13428
|
try {
|
|
13390
13429
|
// Getting the callback function
|
|
13391
13430
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13392
|
-
auto uniffiResult =
|
|
13393
|
-
|
|
13431
|
+
auto uniffiResult =
|
|
13432
|
+
cb.call(rt, js_uniffiHandle, js_record, js_localRevision,
|
|
13433
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13394
13434
|
|
|
13395
13435
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
13396
13436
|
// Finally, we need to copy the return value back into the Rust pointer.
|
|
@@ -13404,7 +13444,8 @@ static void body(jsi::Runtime &rt,
|
|
|
13404
13444
|
}
|
|
13405
13445
|
}
|
|
13406
13446
|
|
|
13407
|
-
static void callback(uint64_t rs_uniffiHandle, RustBuffer
|
|
13447
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13448
|
+
uint64_t rs_localRevision,
|
|
13408
13449
|
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13409
13450
|
uint64_t rs_uniffiCallbackData,
|
|
13410
13451
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
@@ -13423,8 +13464,8 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_records,
|
|
|
13423
13464
|
|
|
13424
13465
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13425
13466
|
// are all in the lambda.
|
|
13426
|
-
rsLambda(rs_uniffiHandle,
|
|
13427
|
-
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13467
|
+
rsLambda(rs_uniffiHandle, rs_record, rs_localRevision,
|
|
13468
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13428
13469
|
}
|
|
13429
13470
|
|
|
13430
13471
|
static UniffiCallbackInterfaceStorageMethod22
|
|
@@ -13447,18 +13488,19 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
13447
13488
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13448
13489
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13449
13490
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13450
|
-
uint64_t rs_uniffiHandle, RustBuffer
|
|
13491
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13492
|
+
uint64_t rs_localRevision,
|
|
13451
13493
|
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13452
13494
|
uint64_t rs_uniffiCallbackData,
|
|
13453
13495
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13454
13496
|
// We immediately make a lambda which will do the work of transforming the
|
|
13455
13497
|
// arguments into JSI values and calling the callback.
|
|
13456
13498
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13457
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
13458
|
-
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13499
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_record,
|
|
13500
|
+
rs_localRevision, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13459
13501
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13460
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
13461
|
-
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13502
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_record,
|
|
13503
|
+
rs_localRevision, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13462
13504
|
rs_uniffiOutReturn);
|
|
13463
13505
|
};
|
|
13464
13506
|
// We'll then call that lambda from the callInvoker which will
|
|
@@ -13498,8 +13540,9 @@ using namespace facebook;
|
|
|
13498
13540
|
|
|
13499
13541
|
// We need to store a lambda in a global so we can call it from
|
|
13500
13542
|
// a function pointer. The function pointer is passed to Rust.
|
|
13501
|
-
static std::function<void(uint64_t,
|
|
13502
|
-
uint64_t,
|
|
13543
|
+
static std::function<void(uint64_t, uint32_t,
|
|
13544
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
13545
|
+
UniffiForeignFuture *)>
|
|
13503
13546
|
rsLambda = nullptr;
|
|
13504
13547
|
|
|
13505
13548
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -13507,8 +13550,8 @@ static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
|
13507
13550
|
static void body(jsi::Runtime &rt,
|
|
13508
13551
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13509
13552
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
13510
|
-
uint64_t rs_uniffiHandle,
|
|
13511
|
-
|
|
13553
|
+
uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
13554
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13512
13555
|
uint64_t rs_uniffiCallbackData,
|
|
13513
13556
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13514
13557
|
|
|
@@ -13516,11 +13559,11 @@ static void body(jsi::Runtime &rt,
|
|
|
13516
13559
|
// We'll use the Bridging class to do this…
|
|
13517
13560
|
auto js_uniffiHandle =
|
|
13518
13561
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13519
|
-
auto
|
|
13520
|
-
rt, callInvoker,
|
|
13521
|
-
auto js_uniffiFutureCallback =
|
|
13522
|
-
|
|
13523
|
-
|
|
13562
|
+
auto js_limit =
|
|
13563
|
+
uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, rs_limit);
|
|
13564
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
13565
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
13566
|
+
rs_uniffiFutureCallback);
|
|
13524
13567
|
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
13525
13568
|
rt, callInvoker, rs_uniffiCallbackData);
|
|
13526
13569
|
|
|
@@ -13530,7 +13573,7 @@ static void body(jsi::Runtime &rt,
|
|
|
13530
13573
|
try {
|
|
13531
13574
|
// Getting the callback function
|
|
13532
13575
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13533
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
13576
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_limit,
|
|
13534
13577
|
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13535
13578
|
|
|
13536
13579
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
@@ -13545,10 +13588,11 @@ static void body(jsi::Runtime &rt,
|
|
|
13545
13588
|
}
|
|
13546
13589
|
}
|
|
13547
13590
|
|
|
13548
|
-
static void
|
|
13549
|
-
|
|
13550
|
-
|
|
13551
|
-
|
|
13591
|
+
static void
|
|
13592
|
+
callback(uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
13593
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13594
|
+
uint64_t rs_uniffiCallbackData,
|
|
13595
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13552
13596
|
// If the runtime has shutdown, then there is no point in trying to
|
|
13553
13597
|
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
13554
13598
|
//
|
|
@@ -13564,7 +13608,7 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
|
13564
13608
|
|
|
13565
13609
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13566
13610
|
// are all in the lambda.
|
|
13567
|
-
rsLambda(rs_uniffiHandle,
|
|
13611
|
+
rsLambda(rs_uniffiHandle, rs_limit, rs_uniffiFutureCallback,
|
|
13568
13612
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13569
13613
|
}
|
|
13570
13614
|
|
|
@@ -13588,17 +13632,17 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
13588
13632
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13589
13633
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13590
13634
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13591
|
-
uint64_t rs_uniffiHandle,
|
|
13592
|
-
|
|
13635
|
+
uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
13636
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13593
13637
|
uint64_t rs_uniffiCallbackData,
|
|
13594
13638
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13595
13639
|
// We immediately make a lambda which will do the work of transforming the
|
|
13596
13640
|
// arguments into JSI values and calling the callback.
|
|
13597
13641
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13598
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
13642
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_limit,
|
|
13599
13643
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13600
13644
|
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13601
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
13645
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_limit,
|
|
13602
13646
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13603
13647
|
rs_uniffiOutReturn);
|
|
13604
13648
|
};
|
|
@@ -13639,8 +13683,7 @@ using namespace facebook;
|
|
|
13639
13683
|
|
|
13640
13684
|
// We need to store a lambda in a global so we can call it from
|
|
13641
13685
|
// a function pointer. The function pointer is passed to Rust.
|
|
13642
|
-
static std::function<void(uint64_t,
|
|
13643
|
-
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
13686
|
+
static std::function<void(uint64_t, UniffiForeignFutureCompleteU64, uint64_t,
|
|
13644
13687
|
UniffiForeignFuture *)>
|
|
13645
13688
|
rsLambda = nullptr;
|
|
13646
13689
|
|
|
@@ -13649,8 +13692,8 @@ static std::function<void(uint64_t, uint32_t,
|
|
|
13649
13692
|
static void body(jsi::Runtime &rt,
|
|
13650
13693
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13651
13694
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
13652
|
-
uint64_t rs_uniffiHandle,
|
|
13653
|
-
|
|
13695
|
+
uint64_t rs_uniffiHandle,
|
|
13696
|
+
UniffiForeignFutureCompleteU64 rs_uniffiFutureCallback,
|
|
13654
13697
|
uint64_t rs_uniffiCallbackData,
|
|
13655
13698
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13656
13699
|
|
|
@@ -13658,11 +13701,9 @@ static void body(jsi::Runtime &rt,
|
|
|
13658
13701
|
// We'll use the Bridging class to do this…
|
|
13659
13702
|
auto js_uniffiHandle =
|
|
13660
13703
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13661
|
-
auto
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
13665
|
-
rs_uniffiFutureCallback);
|
|
13704
|
+
auto js_uniffiFutureCallback =
|
|
13705
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteU64>::toJs(
|
|
13706
|
+
rt, callInvoker, rs_uniffiFutureCallback);
|
|
13666
13707
|
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
13667
13708
|
rt, callInvoker, rs_uniffiCallbackData);
|
|
13668
13709
|
|
|
@@ -13672,8 +13713,8 @@ static void body(jsi::Runtime &rt,
|
|
|
13672
13713
|
try {
|
|
13673
13714
|
// Getting the callback function
|
|
13674
13715
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13675
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle,
|
|
13676
|
-
|
|
13716
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_uniffiFutureCallback,
|
|
13717
|
+
js_uniffiCallbackData);
|
|
13677
13718
|
|
|
13678
13719
|
// return type is MutReference(Struct("ForeignFuture"))
|
|
13679
13720
|
// Finally, we need to copy the return value back into the Rust pointer.
|
|
@@ -13687,11 +13728,10 @@ static void body(jsi::Runtime &rt,
|
|
|
13687
13728
|
}
|
|
13688
13729
|
}
|
|
13689
13730
|
|
|
13690
|
-
static void
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13731
|
+
static void callback(uint64_t rs_uniffiHandle,
|
|
13732
|
+
UniffiForeignFutureCompleteU64 rs_uniffiFutureCallback,
|
|
13733
|
+
uint64_t rs_uniffiCallbackData,
|
|
13734
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13695
13735
|
// If the runtime has shutdown, then there is no point in trying to
|
|
13696
13736
|
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
13697
13737
|
//
|
|
@@ -13707,8 +13747,8 @@ callback(uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
|
13707
13747
|
|
|
13708
13748
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13709
13749
|
// are all in the lambda.
|
|
13710
|
-
rsLambda(rs_uniffiHandle,
|
|
13711
|
-
|
|
13750
|
+
rsLambda(rs_uniffiHandle, rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13751
|
+
rs_uniffiOutReturn);
|
|
13712
13752
|
}
|
|
13713
13753
|
|
|
13714
13754
|
static UniffiCallbackInterfaceStorageMethod24
|
|
@@ -13731,17 +13771,16 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestorageme
|
|
|
13731
13771
|
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13732
13772
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13733
13773
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13734
|
-
uint64_t rs_uniffiHandle,
|
|
13735
|
-
|
|
13774
|
+
uint64_t rs_uniffiHandle,
|
|
13775
|
+
UniffiForeignFutureCompleteU64 rs_uniffiFutureCallback,
|
|
13736
13776
|
uint64_t rs_uniffiCallbackData,
|
|
13737
13777
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13738
13778
|
// We immediately make a lambda which will do the work of transforming the
|
|
13739
13779
|
// arguments into JSI values and calling the callback.
|
|
13740
13780
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13741
|
-
[callInvoker, callbackValue, rs_uniffiHandle,
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_limit,
|
|
13781
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_uniffiFutureCallback,
|
|
13782
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13783
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle,
|
|
13745
13784
|
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13746
13785
|
rs_uniffiOutReturn);
|
|
13747
13786
|
};
|
|
@@ -13782,7 +13821,7 @@ using namespace facebook;
|
|
|
13782
13821
|
|
|
13783
13822
|
// We need to store a lambda in a global so we can call it from
|
|
13784
13823
|
// a function pointer. The function pointer is passed to Rust.
|
|
13785
|
-
static std::function<void(uint64_t,
|
|
13824
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
13786
13825
|
uint64_t, UniffiForeignFuture *)>
|
|
13787
13826
|
rsLambda = nullptr;
|
|
13788
13827
|
|
|
@@ -13791,8 +13830,433 @@ static std::function<void(uint64_t, UniffiForeignFutureCompleteRustBuffer,
|
|
|
13791
13830
|
static void body(jsi::Runtime &rt,
|
|
13792
13831
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13793
13832
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
13794
|
-
uint64_t rs_uniffiHandle,
|
|
13795
|
-
|
|
13833
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_records,
|
|
13834
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13835
|
+
uint64_t rs_uniffiCallbackData,
|
|
13836
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13837
|
+
|
|
13838
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
13839
|
+
// We'll use the Bridging class to do this…
|
|
13840
|
+
auto js_uniffiHandle =
|
|
13841
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13842
|
+
auto js_records = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
13843
|
+
rt, callInvoker, rs_records);
|
|
13844
|
+
auto js_uniffiFutureCallback =
|
|
13845
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
13846
|
+
rt, callInvoker, rs_uniffiFutureCallback);
|
|
13847
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
13848
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
13849
|
+
|
|
13850
|
+
// Now we are ready to call the callback.
|
|
13851
|
+
// We are already on the JS thread, because this `body` function was
|
|
13852
|
+
// invoked from the CallInvoker.
|
|
13853
|
+
try {
|
|
13854
|
+
// Getting the callback function
|
|
13855
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13856
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_records,
|
|
13857
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13858
|
+
|
|
13859
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
13860
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
13861
|
+
*rs_uniffiOutReturn =
|
|
13862
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
13863
|
+
rt, callInvoker, uniffiResult);
|
|
13864
|
+
} catch (const jsi::JSError &error) {
|
|
13865
|
+
std::cout << "Error in callback UniffiCallbackInterfaceStorageMethod25: "
|
|
13866
|
+
<< error.what() << std::endl;
|
|
13867
|
+
throw error;
|
|
13868
|
+
}
|
|
13869
|
+
}
|
|
13870
|
+
|
|
13871
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_records,
|
|
13872
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13873
|
+
uint64_t rs_uniffiCallbackData,
|
|
13874
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13875
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
13876
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
13877
|
+
//
|
|
13878
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
13879
|
+
// which nulls out the rsLamda.
|
|
13880
|
+
//
|
|
13881
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
13882
|
+
if (rsLambda == nullptr) {
|
|
13883
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
13884
|
+
// which causes the JS callback to be dropped.
|
|
13885
|
+
return;
|
|
13886
|
+
}
|
|
13887
|
+
|
|
13888
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
13889
|
+
// are all in the lambda.
|
|
13890
|
+
rsLambda(rs_uniffiHandle, rs_records, rs_uniffiFutureCallback,
|
|
13891
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13892
|
+
}
|
|
13893
|
+
|
|
13894
|
+
static UniffiCallbackInterfaceStorageMethod25
|
|
13895
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod25
|
|
13896
|
+
jsi::Runtime &rt,
|
|
13897
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13898
|
+
const jsi::Value &value) {
|
|
13899
|
+
if (rsLambda != nullptr) {
|
|
13900
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
13901
|
+
//
|
|
13902
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
13903
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
13904
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
13905
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
13906
|
+
//
|
|
13907
|
+
// We can therefore return the callback function without making anything
|
|
13908
|
+
// new if we've been initialized already.
|
|
13909
|
+
return callback;
|
|
13910
|
+
}
|
|
13911
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
13912
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
13913
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
13914
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_records,
|
|
13915
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13916
|
+
uint64_t rs_uniffiCallbackData,
|
|
13917
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13918
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
13919
|
+
// arguments into JSI values and calling the callback.
|
|
13920
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
13921
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_records,
|
|
13922
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13923
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
13924
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_records,
|
|
13925
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
13926
|
+
rs_uniffiOutReturn);
|
|
13927
|
+
};
|
|
13928
|
+
// We'll then call that lambda from the callInvoker which will
|
|
13929
|
+
// look after calling it on the correct thread.
|
|
13930
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
13931
|
+
};
|
|
13932
|
+
return callback;
|
|
13933
|
+
}
|
|
13934
|
+
|
|
13935
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
13936
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
13937
|
+
static void cleanup() {
|
|
13938
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
13939
|
+
// out, then the pointer will no longer be left dangling.
|
|
13940
|
+
rsLambda = nullptr;
|
|
13941
|
+
}
|
|
13942
|
+
} // namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod25
|
|
13943
|
+
// Implementation of callback function calling from Rust to JS
|
|
13944
|
+
// CallbackInterfaceStorageMethod26
|
|
13945
|
+
|
|
13946
|
+
// Callback function:
|
|
13947
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod26::UniffiCallbackInterfaceStorageMethod26
|
|
13948
|
+
//
|
|
13949
|
+
// We have the following constraints:
|
|
13950
|
+
// - we need to pass a function pointer to Rust.
|
|
13951
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
13952
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
13953
|
+
//
|
|
13954
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
13955
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
13956
|
+
// into JS.
|
|
13957
|
+
//
|
|
13958
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
13959
|
+
// lambda sometime in the future.
|
|
13960
|
+
namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod26 {
|
|
13961
|
+
using namespace facebook;
|
|
13962
|
+
|
|
13963
|
+
// We need to store a lambda in a global so we can call it from
|
|
13964
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
13965
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
13966
|
+
uint64_t, UniffiForeignFuture *)>
|
|
13967
|
+
rsLambda = nullptr;
|
|
13968
|
+
|
|
13969
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
13970
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
13971
|
+
static void body(jsi::Runtime &rt,
|
|
13972
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13973
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
13974
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
13975
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
13976
|
+
uint64_t rs_uniffiCallbackData,
|
|
13977
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13978
|
+
|
|
13979
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
13980
|
+
// We'll use the Bridging class to do this…
|
|
13981
|
+
auto js_uniffiHandle =
|
|
13982
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
13983
|
+
auto js_record = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
13984
|
+
rt, callInvoker, rs_record);
|
|
13985
|
+
auto js_uniffiFutureCallback =
|
|
13986
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
13987
|
+
rt, callInvoker, rs_uniffiFutureCallback);
|
|
13988
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
13989
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
13990
|
+
|
|
13991
|
+
// Now we are ready to call the callback.
|
|
13992
|
+
// We are already on the JS thread, because this `body` function was
|
|
13993
|
+
// invoked from the CallInvoker.
|
|
13994
|
+
try {
|
|
13995
|
+
// Getting the callback function
|
|
13996
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
13997
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_record,
|
|
13998
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
13999
|
+
|
|
14000
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
14001
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
14002
|
+
*rs_uniffiOutReturn =
|
|
14003
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
14004
|
+
rt, callInvoker, uniffiResult);
|
|
14005
|
+
} catch (const jsi::JSError &error) {
|
|
14006
|
+
std::cout << "Error in callback UniffiCallbackInterfaceStorageMethod26: "
|
|
14007
|
+
<< error.what() << std::endl;
|
|
14008
|
+
throw error;
|
|
14009
|
+
}
|
|
14010
|
+
}
|
|
14011
|
+
|
|
14012
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
14013
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
14014
|
+
uint64_t rs_uniffiCallbackData,
|
|
14015
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
14016
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
14017
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
14018
|
+
//
|
|
14019
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
14020
|
+
// which nulls out the rsLamda.
|
|
14021
|
+
//
|
|
14022
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
14023
|
+
if (rsLambda == nullptr) {
|
|
14024
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
14025
|
+
// which causes the JS callback to be dropped.
|
|
14026
|
+
return;
|
|
14027
|
+
}
|
|
14028
|
+
|
|
14029
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
14030
|
+
// are all in the lambda.
|
|
14031
|
+
rsLambda(rs_uniffiHandle, rs_record, rs_uniffiFutureCallback,
|
|
14032
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
14033
|
+
}
|
|
14034
|
+
|
|
14035
|
+
static UniffiCallbackInterfaceStorageMethod26
|
|
14036
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod26
|
|
14037
|
+
jsi::Runtime &rt,
|
|
14038
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
14039
|
+
const jsi::Value &value) {
|
|
14040
|
+
if (rsLambda != nullptr) {
|
|
14041
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
14042
|
+
//
|
|
14043
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
14044
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
14045
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
14046
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
14047
|
+
//
|
|
14048
|
+
// We can therefore return the callback function without making anything
|
|
14049
|
+
// new if we've been initialized already.
|
|
14050
|
+
return callback;
|
|
14051
|
+
}
|
|
14052
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
14053
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
14054
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
14055
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
14056
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
14057
|
+
uint64_t rs_uniffiCallbackData,
|
|
14058
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
14059
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
14060
|
+
// arguments into JSI values and calling the callback.
|
|
14061
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
14062
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_record,
|
|
14063
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
14064
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
14065
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_record,
|
|
14066
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
14067
|
+
rs_uniffiOutReturn);
|
|
14068
|
+
};
|
|
14069
|
+
// We'll then call that lambda from the callInvoker which will
|
|
14070
|
+
// look after calling it on the correct thread.
|
|
14071
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
14072
|
+
};
|
|
14073
|
+
return callback;
|
|
14074
|
+
}
|
|
14075
|
+
|
|
14076
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
14077
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
14078
|
+
static void cleanup() {
|
|
14079
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
14080
|
+
// out, then the pointer will no longer be left dangling.
|
|
14081
|
+
rsLambda = nullptr;
|
|
14082
|
+
}
|
|
14083
|
+
} // namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod26
|
|
14084
|
+
// Implementation of callback function calling from Rust to JS
|
|
14085
|
+
// CallbackInterfaceStorageMethod27
|
|
14086
|
+
|
|
14087
|
+
// Callback function:
|
|
14088
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod27::UniffiCallbackInterfaceStorageMethod27
|
|
14089
|
+
//
|
|
14090
|
+
// We have the following constraints:
|
|
14091
|
+
// - we need to pass a function pointer to Rust.
|
|
14092
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
14093
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
14094
|
+
//
|
|
14095
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
14096
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
14097
|
+
// into JS.
|
|
14098
|
+
//
|
|
14099
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
14100
|
+
// lambda sometime in the future.
|
|
14101
|
+
namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod27 {
|
|
14102
|
+
using namespace facebook;
|
|
14103
|
+
|
|
14104
|
+
// We need to store a lambda in a global so we can call it from
|
|
14105
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
14106
|
+
static std::function<void(uint64_t, uint32_t,
|
|
14107
|
+
UniffiForeignFutureCompleteRustBuffer, uint64_t,
|
|
14108
|
+
UniffiForeignFuture *)>
|
|
14109
|
+
rsLambda = nullptr;
|
|
14110
|
+
|
|
14111
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
14112
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
14113
|
+
static void body(jsi::Runtime &rt,
|
|
14114
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
14115
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
14116
|
+
uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
14117
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
14118
|
+
uint64_t rs_uniffiCallbackData,
|
|
14119
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
14120
|
+
|
|
14121
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
14122
|
+
// We'll use the Bridging class to do this…
|
|
14123
|
+
auto js_uniffiHandle =
|
|
14124
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
14125
|
+
auto js_limit =
|
|
14126
|
+
uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, rs_limit);
|
|
14127
|
+
auto js_uniffiFutureCallback = uniffi::breez_sdk_spark::Bridging<
|
|
14128
|
+
UniffiForeignFutureCompleteRustBuffer>::toJs(rt, callInvoker,
|
|
14129
|
+
rs_uniffiFutureCallback);
|
|
14130
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
14131
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
14132
|
+
|
|
14133
|
+
// Now we are ready to call the callback.
|
|
14134
|
+
// We are already on the JS thread, because this `body` function was
|
|
14135
|
+
// invoked from the CallInvoker.
|
|
14136
|
+
try {
|
|
14137
|
+
// Getting the callback function
|
|
14138
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
14139
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_limit,
|
|
14140
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
14141
|
+
|
|
14142
|
+
// return type is MutReference(Struct("ForeignFuture"))
|
|
14143
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
14144
|
+
*rs_uniffiOutReturn =
|
|
14145
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
14146
|
+
rt, callInvoker, uniffiResult);
|
|
14147
|
+
} catch (const jsi::JSError &error) {
|
|
14148
|
+
std::cout << "Error in callback UniffiCallbackInterfaceStorageMethod27: "
|
|
14149
|
+
<< error.what() << std::endl;
|
|
14150
|
+
throw error;
|
|
14151
|
+
}
|
|
14152
|
+
}
|
|
14153
|
+
|
|
14154
|
+
static void
|
|
14155
|
+
callback(uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
14156
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
14157
|
+
uint64_t rs_uniffiCallbackData,
|
|
14158
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
14159
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
14160
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
14161
|
+
//
|
|
14162
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
14163
|
+
// which nulls out the rsLamda.
|
|
14164
|
+
//
|
|
14165
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
14166
|
+
if (rsLambda == nullptr) {
|
|
14167
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
14168
|
+
// which causes the JS callback to be dropped.
|
|
14169
|
+
return;
|
|
14170
|
+
}
|
|
14171
|
+
|
|
14172
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
14173
|
+
// are all in the lambda.
|
|
14174
|
+
rsLambda(rs_uniffiHandle, rs_limit, rs_uniffiFutureCallback,
|
|
14175
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
14176
|
+
}
|
|
14177
|
+
|
|
14178
|
+
static UniffiCallbackInterfaceStorageMethod27
|
|
14179
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod27
|
|
14180
|
+
jsi::Runtime &rt,
|
|
14181
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
14182
|
+
const jsi::Value &value) {
|
|
14183
|
+
if (rsLambda != nullptr) {
|
|
14184
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
14185
|
+
//
|
|
14186
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
14187
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
14188
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
14189
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
14190
|
+
//
|
|
14191
|
+
// We can therefore return the callback function without making anything
|
|
14192
|
+
// new if we've been initialized already.
|
|
14193
|
+
return callback;
|
|
14194
|
+
}
|
|
14195
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
14196
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
14197
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
14198
|
+
uint64_t rs_uniffiHandle, uint32_t rs_limit,
|
|
14199
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
14200
|
+
uint64_t rs_uniffiCallbackData,
|
|
14201
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
14202
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
14203
|
+
// arguments into JSI values and calling the callback.
|
|
14204
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
14205
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_limit,
|
|
14206
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
14207
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
14208
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_limit,
|
|
14209
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
14210
|
+
rs_uniffiOutReturn);
|
|
14211
|
+
};
|
|
14212
|
+
// We'll then call that lambda from the callInvoker which will
|
|
14213
|
+
// look after calling it on the correct thread.
|
|
14214
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
14215
|
+
};
|
|
14216
|
+
return callback;
|
|
14217
|
+
}
|
|
14218
|
+
|
|
14219
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
14220
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
14221
|
+
static void cleanup() {
|
|
14222
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
14223
|
+
// out, then the pointer will no longer be left dangling.
|
|
14224
|
+
rsLambda = nullptr;
|
|
14225
|
+
}
|
|
14226
|
+
} // namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod27
|
|
14227
|
+
// Implementation of callback function calling from Rust to JS
|
|
14228
|
+
// CallbackInterfaceStorageMethod28
|
|
14229
|
+
|
|
14230
|
+
// Callback function:
|
|
14231
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod28::UniffiCallbackInterfaceStorageMethod28
|
|
14232
|
+
//
|
|
14233
|
+
// We have the following constraints:
|
|
14234
|
+
// - we need to pass a function pointer to Rust.
|
|
14235
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
14236
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
14237
|
+
//
|
|
14238
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
14239
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
14240
|
+
// into JS.
|
|
14241
|
+
//
|
|
14242
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
14243
|
+
// lambda sometime in the future.
|
|
14244
|
+
namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod28 {
|
|
14245
|
+
using namespace facebook;
|
|
14246
|
+
|
|
14247
|
+
// We need to store a lambda in a global so we can call it from
|
|
14248
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
14249
|
+
static std::function<void(uint64_t, UniffiForeignFutureCompleteRustBuffer,
|
|
14250
|
+
uint64_t, UniffiForeignFuture *)>
|
|
14251
|
+
rsLambda = nullptr;
|
|
14252
|
+
|
|
14253
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
14254
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
14255
|
+
static void body(jsi::Runtime &rt,
|
|
14256
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
14257
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
14258
|
+
uint64_t rs_uniffiHandle,
|
|
14259
|
+
UniffiForeignFutureCompleteRustBuffer rs_uniffiFutureCallback,
|
|
13796
14260
|
uint64_t rs_uniffiCallbackData,
|
|
13797
14261
|
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
13798
14262
|
|
|
@@ -13821,7 +14285,7 @@ static void body(jsi::Runtime &rt,
|
|
|
13821
14285
|
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
13822
14286
|
rt, callInvoker, uniffiResult);
|
|
13823
14287
|
} catch (const jsi::JSError &error) {
|
|
13824
|
-
std::cout << "Error in callback
|
|
14288
|
+
std::cout << "Error in callback UniffiCallbackInterfaceStorageMethod28: "
|
|
13825
14289
|
<< error.what() << std::endl;
|
|
13826
14290
|
throw error;
|
|
13827
14291
|
}
|
|
@@ -13851,8 +14315,8 @@ callback(uint64_t rs_uniffiHandle,
|
|
|
13851
14315
|
rs_uniffiOutReturn);
|
|
13852
14316
|
}
|
|
13853
14317
|
|
|
13854
|
-
static
|
|
13855
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
14318
|
+
static UniffiCallbackInterfaceStorageMethod28
|
|
14319
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod28
|
|
13856
14320
|
jsi::Runtime &rt,
|
|
13857
14321
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13858
14322
|
const jsi::Value &value) {
|
|
@@ -13898,12 +14362,12 @@ static void cleanup() {
|
|
|
13898
14362
|
// out, then the pointer will no longer be left dangling.
|
|
13899
14363
|
rsLambda = nullptr;
|
|
13900
14364
|
}
|
|
13901
|
-
} // namespace uniffi::breez_sdk_spark::cb::
|
|
14365
|
+
} // namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod28
|
|
13902
14366
|
// Implementation of callback function calling from Rust to JS
|
|
13903
|
-
//
|
|
14367
|
+
// CallbackInterfaceStorageMethod29
|
|
13904
14368
|
|
|
13905
14369
|
// Callback function:
|
|
13906
|
-
// uniffi::breez_sdk_spark::cb::
|
|
14370
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod29::UniffiCallbackInterfaceStorageMethod29
|
|
13907
14371
|
//
|
|
13908
14372
|
// We have the following constraints:
|
|
13909
14373
|
// - we need to pass a function pointer to Rust.
|
|
@@ -13916,7 +14380,7 @@ static void cleanup() {
|
|
|
13916
14380
|
//
|
|
13917
14381
|
// We then give the `callback` function pointer to Rust which will call the
|
|
13918
14382
|
// lambda sometime in the future.
|
|
13919
|
-
namespace uniffi::breez_sdk_spark::cb::
|
|
14383
|
+
namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod29 {
|
|
13920
14384
|
using namespace facebook;
|
|
13921
14385
|
|
|
13922
14386
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -13962,7 +14426,7 @@ static void body(jsi::Runtime &rt,
|
|
|
13962
14426
|
uniffi::breez_sdk_spark::Bridging<UniffiForeignFuture>::fromJs(
|
|
13963
14427
|
rt, callInvoker, uniffiResult);
|
|
13964
14428
|
} catch (const jsi::JSError &error) {
|
|
13965
|
-
std::cout << "Error in callback
|
|
14429
|
+
std::cout << "Error in callback UniffiCallbackInterfaceStorageMethod29: "
|
|
13966
14430
|
<< error.what() << std::endl;
|
|
13967
14431
|
throw error;
|
|
13968
14432
|
}
|
|
@@ -13991,8 +14455,8 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_record,
|
|
|
13991
14455
|
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
13992
14456
|
}
|
|
13993
14457
|
|
|
13994
|
-
static
|
|
13995
|
-
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::
|
|
14458
|
+
static UniffiCallbackInterfaceStorageMethod29
|
|
14459
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod29
|
|
13996
14460
|
jsi::Runtime &rt,
|
|
13997
14461
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
13998
14462
|
const jsi::Value &value) {
|
|
@@ -14039,7 +14503,7 @@ static void cleanup() {
|
|
|
14039
14503
|
// out, then the pointer will no longer be left dangling.
|
|
14040
14504
|
rsLambda = nullptr;
|
|
14041
14505
|
}
|
|
14042
|
-
} // namespace uniffi::breez_sdk_spark::cb::
|
|
14506
|
+
} // namespace uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod29
|
|
14043
14507
|
// Implementation of callback function calling from Rust to JS
|
|
14044
14508
|
// CallbackInterfaceStorageBackendMethod0
|
|
14045
14509
|
|
|
@@ -14718,34 +15182,44 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceStorage> {
|
|
|
14718
15182
|
rsObject.delete_contact = uniffi::breez_sdk_spark::cb::
|
|
14719
15183
|
callbackinterfacestoragemethod17::makeCallbackFunction(
|
|
14720
15184
|
rt, callInvoker, jsObject.getProperty(rt, "deleteContact"));
|
|
14721
|
-
rsObject.
|
|
15185
|
+
rsObject.set_cross_chain_swap = uniffi::breez_sdk_spark::cb::
|
|
14722
15186
|
callbackinterfacestoragemethod18::makeCallbackFunction(
|
|
15187
|
+
rt, callInvoker, jsObject.getProperty(rt, "setCrossChainSwap"));
|
|
15188
|
+
rsObject.get_cross_chain_swap = uniffi::breez_sdk_spark::cb::
|
|
15189
|
+
callbackinterfacestoragemethod19::makeCallbackFunction(
|
|
15190
|
+
rt, callInvoker, jsObject.getProperty(rt, "getCrossChainSwap"));
|
|
15191
|
+
rsObject.list_active_cross_chain_swaps = uniffi::breez_sdk_spark::cb::
|
|
15192
|
+
callbackinterfacestoragemethod20::makeCallbackFunction(
|
|
15193
|
+
rt, callInvoker,
|
|
15194
|
+
jsObject.getProperty(rt, "listActiveCrossChainSwaps"));
|
|
15195
|
+
rsObject.add_outgoing_change = uniffi::breez_sdk_spark::cb::
|
|
15196
|
+
callbackinterfacestoragemethod21::makeCallbackFunction(
|
|
14723
15197
|
rt, callInvoker, jsObject.getProperty(rt, "addOutgoingChange"));
|
|
14724
15198
|
rsObject.complete_outgoing_sync = uniffi::breez_sdk_spark::cb::
|
|
14725
|
-
|
|
15199
|
+
callbackinterfacestoragemethod22::makeCallbackFunction(
|
|
14726
15200
|
rt, callInvoker, jsObject.getProperty(rt, "completeOutgoingSync"));
|
|
14727
15201
|
rsObject.get_pending_outgoing_changes = uniffi::breez_sdk_spark::cb::
|
|
14728
|
-
|
|
15202
|
+
callbackinterfacestoragemethod23::makeCallbackFunction(
|
|
14729
15203
|
rt, callInvoker,
|
|
14730
15204
|
jsObject.getProperty(rt, "getPendingOutgoingChanges"));
|
|
14731
15205
|
rsObject.get_last_revision = uniffi::breez_sdk_spark::cb::
|
|
14732
|
-
|
|
15206
|
+
callbackinterfacestoragemethod24::makeCallbackFunction(
|
|
14733
15207
|
rt, callInvoker, jsObject.getProperty(rt, "getLastRevision"));
|
|
14734
15208
|
rsObject.insert_incoming_records = uniffi::breez_sdk_spark::cb::
|
|
14735
|
-
|
|
15209
|
+
callbackinterfacestoragemethod25::makeCallbackFunction(
|
|
14736
15210
|
rt, callInvoker, jsObject.getProperty(rt, "insertIncomingRecords"));
|
|
14737
15211
|
rsObject.delete_incoming_record = uniffi::breez_sdk_spark::cb::
|
|
14738
|
-
|
|
15212
|
+
callbackinterfacestoragemethod26::makeCallbackFunction(
|
|
14739
15213
|
rt, callInvoker, jsObject.getProperty(rt, "deleteIncomingRecord"));
|
|
14740
15214
|
rsObject.get_incoming_records = uniffi::breez_sdk_spark::cb::
|
|
14741
|
-
|
|
15215
|
+
callbackinterfacestoragemethod27::makeCallbackFunction(
|
|
14742
15216
|
rt, callInvoker, jsObject.getProperty(rt, "getIncomingRecords"));
|
|
14743
15217
|
rsObject.get_latest_outgoing_change = uniffi::breez_sdk_spark::cb::
|
|
14744
|
-
|
|
15218
|
+
callbackinterfacestoragemethod28::makeCallbackFunction(
|
|
14745
15219
|
rt, callInvoker,
|
|
14746
15220
|
jsObject.getProperty(rt, "getLatestOutgoingChange"));
|
|
14747
15221
|
rsObject.update_record_from_incoming = uniffi::breez_sdk_spark::cb::
|
|
14748
|
-
|
|
15222
|
+
callbackinterfacestoragemethod29::makeCallbackFunction(
|
|
14749
15223
|
rt, callInvoker,
|
|
14750
15224
|
jsObject.getProperty(rt, "updateRecordFromIncoming"));
|
|
14751
15225
|
rsObject.uniffi_free =
|
|
@@ -15132,6 +15606,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
15132
15606
|
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_fetch_conversion_limits(
|
|
15133
15607
|
rt, thisVal, args, count);
|
|
15134
15608
|
});
|
|
15609
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_get_cross_chain_"
|
|
15610
|
+
"routes"] = jsi::Function::createFromHostFunction(
|
|
15611
|
+
rt,
|
|
15612
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
15613
|
+
"breezsdk_get_cross_chain_routes"),
|
|
15614
|
+
2,
|
|
15615
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
15616
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
15617
|
+
return this
|
|
15618
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_get_cross_chain_routes(
|
|
15619
|
+
rt, thisVal, args, count);
|
|
15620
|
+
});
|
|
15135
15621
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_get_info"] =
|
|
15136
15622
|
jsi::Function::createFromHostFunction(
|
|
15137
15623
|
rt,
|
|
@@ -16828,6 +17314,42 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
16828
17314
|
->cpp_uniffi_breez_sdk_spark_fn_method_storage_delete_contact(
|
|
16829
17315
|
rt, thisVal, args, count);
|
|
16830
17316
|
});
|
|
17317
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_storage_set_cross_chain_swap"] =
|
|
17318
|
+
jsi::Function::createFromHostFunction(
|
|
17319
|
+
rt,
|
|
17320
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
17321
|
+
"storage_set_cross_chain_swap"),
|
|
17322
|
+
2,
|
|
17323
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17324
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17325
|
+
return this
|
|
17326
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_storage_set_cross_chain_swap(
|
|
17327
|
+
rt, thisVal, args, count);
|
|
17328
|
+
});
|
|
17329
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_cross_chain_swap"] =
|
|
17330
|
+
jsi::Function::createFromHostFunction(
|
|
17331
|
+
rt,
|
|
17332
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
17333
|
+
"storage_get_cross_chain_swap"),
|
|
17334
|
+
3,
|
|
17335
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17336
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17337
|
+
return this
|
|
17338
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_storage_get_cross_chain_swap(
|
|
17339
|
+
rt, thisVal, args, count);
|
|
17340
|
+
});
|
|
17341
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_storage_list_active_cross_chain_"
|
|
17342
|
+
"swaps"] = jsi::Function::createFromHostFunction(
|
|
17343
|
+
rt,
|
|
17344
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
17345
|
+
"storage_list_active_cross_chain_swaps"),
|
|
17346
|
+
2,
|
|
17347
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
17348
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
17349
|
+
return this
|
|
17350
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_storage_list_active_cross_chain_swaps(
|
|
17351
|
+
rt, thisVal, args, count);
|
|
17352
|
+
});
|
|
16831
17353
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_storage_add_outgoing_change"] =
|
|
16832
17354
|
jsi::Function::createFromHostFunction(
|
|
16833
17355
|
rt,
|
|
@@ -18178,6 +18700,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
18178
18700
|
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_fetch_conversion_limits(
|
|
18179
18701
|
rt, thisVal, args, count);
|
|
18180
18702
|
});
|
|
18703
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_cross_chain_"
|
|
18704
|
+
"routes"] = jsi::Function::createFromHostFunction(
|
|
18705
|
+
rt,
|
|
18706
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
18707
|
+
"method_breezsdk_get_cross_chain_routes"),
|
|
18708
|
+
0,
|
|
18709
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
18710
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
18711
|
+
return this
|
|
18712
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_cross_chain_routes(
|
|
18713
|
+
rt, thisVal, args, count);
|
|
18714
|
+
});
|
|
18181
18715
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_info"] =
|
|
18182
18716
|
jsi::Function::createFromHostFunction(
|
|
18183
18717
|
rt,
|
|
@@ -19439,6 +19973,43 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
19439
19973
|
->cpp_uniffi_breez_sdk_spark_checksum_method_storage_delete_contact(
|
|
19440
19974
|
rt, thisVal, args, count);
|
|
19441
19975
|
});
|
|
19976
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_storage_set_cross_chain_"
|
|
19977
|
+
"swap"] = jsi::Function::createFromHostFunction(
|
|
19978
|
+
rt,
|
|
19979
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
19980
|
+
"method_storage_set_cross_chain_swap"),
|
|
19981
|
+
0,
|
|
19982
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
19983
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
19984
|
+
return this
|
|
19985
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_storage_set_cross_chain_swap(
|
|
19986
|
+
rt, thisVal, args, count);
|
|
19987
|
+
});
|
|
19988
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_cross_chain_"
|
|
19989
|
+
"swap"] = jsi::Function::createFromHostFunction(
|
|
19990
|
+
rt,
|
|
19991
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
19992
|
+
"method_storage_get_cross_chain_swap"),
|
|
19993
|
+
0,
|
|
19994
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
19995
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
19996
|
+
return this
|
|
19997
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_storage_get_cross_chain_swap(
|
|
19998
|
+
rt, thisVal, args, count);
|
|
19999
|
+
});
|
|
20000
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_active_cross_"
|
|
20001
|
+
"chain_swaps"] = jsi::Function::createFromHostFunction(
|
|
20002
|
+
rt,
|
|
20003
|
+
jsi::PropNameID::forAscii(rt,
|
|
20004
|
+
"ubrn_uniffi_breez_sdk_spark_checksum_method_"
|
|
20005
|
+
"storage_list_active_cross_chain_swaps"),
|
|
20006
|
+
0,
|
|
20007
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
20008
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
20009
|
+
return this
|
|
20010
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_storage_list_active_cross_chain_swaps(
|
|
20011
|
+
rt, thisVal, args, count);
|
|
20012
|
+
});
|
|
19442
20013
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_outgoing_"
|
|
19443
20014
|
"change"] = jsi::Function::createFromHostFunction(
|
|
19444
20015
|
rt,
|
|
@@ -20163,6 +20734,12 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
|
|
|
20163
20734
|
uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod25::cleanup();
|
|
20164
20735
|
// Cleanup for callback function CallbackInterfaceStorageMethod26
|
|
20165
20736
|
uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod26::cleanup();
|
|
20737
|
+
// Cleanup for callback function CallbackInterfaceStorageMethod27
|
|
20738
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod27::cleanup();
|
|
20739
|
+
// Cleanup for callback function CallbackInterfaceStorageMethod28
|
|
20740
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod28::cleanup();
|
|
20741
|
+
// Cleanup for callback function CallbackInterfaceStorageMethod29
|
|
20742
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod29::cleanup();
|
|
20166
20743
|
// Cleanup for callback function CallbackInterfaceStorageBackendMethod0
|
|
20167
20744
|
uniffi::breez_sdk_spark::cb::callbackinterfacestoragebackendmethod0::
|
|
20168
20745
|
cleanup();
|
|
@@ -20747,6 +21324,18 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
20747
21324
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
20748
21325
|
value);
|
|
20749
21326
|
}
|
|
21327
|
+
jsi::Value NativeBreezSdkSpark::
|
|
21328
|
+
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_get_cross_chain_routes(
|
|
21329
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
21330
|
+
size_t count) {
|
|
21331
|
+
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_get_cross_chain_routes(
|
|
21332
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
21333
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
21334
|
+
args[1]));
|
|
21335
|
+
|
|
21336
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
21337
|
+
value);
|
|
21338
|
+
}
|
|
20750
21339
|
jsi::Value
|
|
20751
21340
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_get_info(
|
|
20752
21341
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -22507,6 +23096,45 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
22507
23096
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
22508
23097
|
value);
|
|
22509
23098
|
}
|
|
23099
|
+
jsi::Value NativeBreezSdkSpark::
|
|
23100
|
+
cpp_uniffi_breez_sdk_spark_fn_method_storage_set_cross_chain_swap(
|
|
23101
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
23102
|
+
size_t count) {
|
|
23103
|
+
auto value = uniffi_breez_sdk_spark_fn_method_storage_set_cross_chain_swap(
|
|
23104
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
23105
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
23106
|
+
args[1]));
|
|
23107
|
+
|
|
23108
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23109
|
+
value);
|
|
23110
|
+
}
|
|
23111
|
+
jsi::Value NativeBreezSdkSpark::
|
|
23112
|
+
cpp_uniffi_breez_sdk_spark_fn_method_storage_get_cross_chain_swap(
|
|
23113
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
23114
|
+
size_t count) {
|
|
23115
|
+
auto value = uniffi_breez_sdk_spark_fn_method_storage_get_cross_chain_swap(
|
|
23116
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
23117
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
23118
|
+
args[1]),
|
|
23119
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
23120
|
+
args[2]));
|
|
23121
|
+
|
|
23122
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23123
|
+
value);
|
|
23124
|
+
}
|
|
23125
|
+
jsi::Value NativeBreezSdkSpark::
|
|
23126
|
+
cpp_uniffi_breez_sdk_spark_fn_method_storage_list_active_cross_chain_swaps(
|
|
23127
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
23128
|
+
size_t count) {
|
|
23129
|
+
auto value =
|
|
23130
|
+
uniffi_breez_sdk_spark_fn_method_storage_list_active_cross_chain_swaps(
|
|
23131
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
23132
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
23133
|
+
args[1]));
|
|
23134
|
+
|
|
23135
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
23136
|
+
value);
|
|
23137
|
+
}
|
|
22510
23138
|
jsi::Value NativeBreezSdkSpark::
|
|
22511
23139
|
cpp_uniffi_breez_sdk_spark_fn_method_storage_add_outgoing_change(
|
|
22512
23140
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -23826,6 +24454,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
23826
24454
|
|
|
23827
24455
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
23828
24456
|
}
|
|
24457
|
+
jsi::Value NativeBreezSdkSpark::
|
|
24458
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_cross_chain_routes(
|
|
24459
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
24460
|
+
size_t count) {
|
|
24461
|
+
auto value =
|
|
24462
|
+
uniffi_breez_sdk_spark_checksum_method_breezsdk_get_cross_chain_routes();
|
|
24463
|
+
|
|
24464
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
24465
|
+
}
|
|
23829
24466
|
jsi::Value NativeBreezSdkSpark::
|
|
23830
24467
|
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_info(
|
|
23831
24468
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -24719,6 +25356,33 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
24719
25356
|
|
|
24720
25357
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
24721
25358
|
}
|
|
25359
|
+
jsi::Value NativeBreezSdkSpark::
|
|
25360
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_storage_set_cross_chain_swap(
|
|
25361
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
25362
|
+
size_t count) {
|
|
25363
|
+
auto value =
|
|
25364
|
+
uniffi_breez_sdk_spark_checksum_method_storage_set_cross_chain_swap();
|
|
25365
|
+
|
|
25366
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
25367
|
+
}
|
|
25368
|
+
jsi::Value NativeBreezSdkSpark::
|
|
25369
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_storage_get_cross_chain_swap(
|
|
25370
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
25371
|
+
size_t count) {
|
|
25372
|
+
auto value =
|
|
25373
|
+
uniffi_breez_sdk_spark_checksum_method_storage_get_cross_chain_swap();
|
|
25374
|
+
|
|
25375
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
25376
|
+
}
|
|
25377
|
+
jsi::Value NativeBreezSdkSpark::
|
|
25378
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_storage_list_active_cross_chain_swaps(
|
|
25379
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
25380
|
+
size_t count) {
|
|
25381
|
+
auto value =
|
|
25382
|
+
uniffi_breez_sdk_spark_checksum_method_storage_list_active_cross_chain_swaps();
|
|
25383
|
+
|
|
25384
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
25385
|
+
}
|
|
24722
25386
|
jsi::Value NativeBreezSdkSpark::
|
|
24723
25387
|
cpp_uniffi_breez_sdk_spark_checksum_method_storage_add_outgoing_change(
|
|
24724
25388
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|