@breeztech/breez-sdk-spark-react-native 0.2.4 → 0.2.5-dev2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpp/generated/breez_sdk_spark.cpp +55 -53
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +70 -31
- 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 +71 -32
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +5 -5
- 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 +26 -10
- 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 +5 -5
- 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 +26 -10
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/breez_sdk_spark-ffi.ts +12 -12
- package/src/generated/breez_sdk_spark.ts +150 -53
|
@@ -101,8 +101,9 @@ typedef struct UniffiForeignFutureStructVoid {
|
|
|
101
101
|
typedef void (*UniffiForeignFutureCompleteVoid)(
|
|
102
102
|
uint64_t callback_data, UniffiForeignFutureStructVoid result);
|
|
103
103
|
typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(
|
|
104
|
-
uint64_t uniffi_handle, RustBuffer event,
|
|
105
|
-
|
|
104
|
+
uint64_t uniffi_handle, RustBuffer event,
|
|
105
|
+
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
106
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
106
107
|
typedef void (*UniffiCallbackInterfaceLoggerMethod0)(
|
|
107
108
|
uint64_t uniffi_handle, RustBuffer l, void *uniffi_out_return,
|
|
108
109
|
RustCallStatus *rust_call_status);
|
|
@@ -218,8 +219,9 @@ void *uniffi_breez_sdk_spark_fn_clone_breezsdk(void *ptr,
|
|
|
218
219
|
RustCallStatus *uniffi_out_err);
|
|
219
220
|
void uniffi_breez_sdk_spark_fn_free_breezsdk(void *ptr,
|
|
220
221
|
RustCallStatus *uniffi_out_err);
|
|
221
|
-
|
|
222
|
-
|
|
222
|
+
/*handle*/ uint64_t
|
|
223
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(void *ptr,
|
|
224
|
+
uint64_t listener);
|
|
223
225
|
/*handle*/ uint64_t
|
|
224
226
|
uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_available(
|
|
225
227
|
void *ptr, RustBuffer req);
|
|
@@ -271,16 +273,18 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_refund_deposit(void *ptr,
|
|
|
271
273
|
/*handle*/ uint64_t
|
|
272
274
|
uniffi_breez_sdk_spark_fn_method_breezsdk_register_lightning_address(
|
|
273
275
|
void *ptr, RustBuffer request);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
+
/*handle*/ uint64_t
|
|
277
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(void *ptr,
|
|
278
|
+
RustBuffer id);
|
|
276
279
|
/*handle*/ uint64_t
|
|
277
280
|
uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment(void *ptr,
|
|
278
281
|
RustBuffer request);
|
|
279
282
|
/*handle*/ uint64_t
|
|
280
283
|
uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal(
|
|
281
284
|
void *ptr, RustBuffer request, int8_t suppress_payment_event);
|
|
282
|
-
|
|
283
|
-
|
|
285
|
+
/*handle*/ uint64_t
|
|
286
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(void *ptr,
|
|
287
|
+
RustBuffer request);
|
|
284
288
|
void *
|
|
285
289
|
uniffi_breez_sdk_spark_fn_clone_sdkbuilder(void *ptr,
|
|
286
290
|
RustCallStatus *uniffi_out_err);
|
|
@@ -298,7 +302,8 @@ uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_chain_service(
|
|
|
298
302
|
uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(
|
|
299
303
|
void *ptr, void *fiat_service);
|
|
300
304
|
/*handle*/ uint64_t uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(
|
|
301
|
-
void *ptr, RustBuffer key_set_type, int8_t use_address_index
|
|
305
|
+
void *ptr, RustBuffer key_set_type, int8_t use_address_index,
|
|
306
|
+
RustBuffer account_number);
|
|
302
307
|
/*handle*/ uint64_t
|
|
303
308
|
uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client(
|
|
304
309
|
void *ptr, void *lnurl_client);
|
|
@@ -2395,7 +2400,8 @@ using namespace facebook;
|
|
|
2395
2400
|
|
|
2396
2401
|
// We need to store a lambda in a global so we can call it from
|
|
2397
2402
|
// a function pointer. The function pointer is passed to Rust.
|
|
2398
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
2403
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
2404
|
+
uint64_t, UniffiForeignFuture *)>
|
|
2399
2405
|
rsLambda = nullptr;
|
|
2400
2406
|
|
|
2401
2407
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -2404,7 +2410,9 @@ static void body(jsi::Runtime &rt,
|
|
|
2404
2410
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
2405
2411
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
2406
2412
|
uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
2407
|
-
|
|
2413
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
2414
|
+
uint64_t rs_uniffiCallbackData,
|
|
2415
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
2408
2416
|
|
|
2409
2417
|
// Convert the arguments from Rust, into jsi::Values.
|
|
2410
2418
|
// We'll use the Bridging class to do this…
|
|
@@ -2412,6 +2420,11 @@ static void body(jsi::Runtime &rt,
|
|
|
2412
2420
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
2413
2421
|
auto js_event = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
2414
2422
|
rt, callInvoker, rs_event);
|
|
2423
|
+
auto js_uniffiFutureCallback =
|
|
2424
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
2425
|
+
rt, callInvoker, rs_uniffiFutureCallback);
|
|
2426
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
2427
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
2415
2428
|
|
|
2416
2429
|
// Now we are ready to call the callback.
|
|
2417
2430
|
// We are already on the JS thread, because this `body` function was
|
|
@@ -2419,18 +2432,13 @@ static void body(jsi::Runtime &rt,
|
|
|
2419
2432
|
try {
|
|
2420
2433
|
// Getting the callback function
|
|
2421
2434
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
2422
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_event
|
|
2423
|
-
|
|
2424
|
-
// Now copy the result back from JS into the RustCallStatus object.
|
|
2425
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyFromJs(
|
|
2426
|
-
rt, callInvoker, uniffiResult, uniffi_call_status);
|
|
2427
|
-
|
|
2428
|
-
if (uniffi_call_status->code != UNIFFI_CALL_STATUS_OK) {
|
|
2429
|
-
// The JS callback finished abnormally, so we cannot retrieve the return
|
|
2430
|
-
// value.
|
|
2431
|
-
return;
|
|
2432
|
-
}
|
|
2435
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_event,
|
|
2436
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
2433
2437
|
|
|
2438
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
2439
|
+
*rs_uniffiOutReturn = uniffi::breez_sdk_spark::Bridging<
|
|
2440
|
+
ReferenceHolder<UniffiForeignFuture>>::fromJs(rt, callInvoker,
|
|
2441
|
+
uniffiResult);
|
|
2434
2442
|
} catch (const jsi::JSError &error) {
|
|
2435
2443
|
std::cout
|
|
2436
2444
|
<< "Error in callback UniffiCallbackInterfaceEventListenerMethod0: "
|
|
@@ -2440,8 +2448,9 @@ static void body(jsi::Runtime &rt,
|
|
|
2440
2448
|
}
|
|
2441
2449
|
|
|
2442
2450
|
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
2443
|
-
|
|
2444
|
-
|
|
2451
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
2452
|
+
uint64_t rs_uniffiCallbackData,
|
|
2453
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
2445
2454
|
// If the runtime has shutdown, then there is no point in trying to
|
|
2446
2455
|
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
2447
2456
|
//
|
|
@@ -2457,7 +2466,8 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
|
2457
2466
|
|
|
2458
2467
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
2459
2468
|
// are all in the lambda.
|
|
2460
|
-
rsLambda(rs_uniffiHandle, rs_event,
|
|
2469
|
+
rsLambda(rs_uniffiHandle, rs_event, rs_uniffiFutureCallback,
|
|
2470
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
2461
2471
|
}
|
|
2462
2472
|
|
|
2463
2473
|
static UniffiCallbackInterfaceEventListenerMethod0
|
|
@@ -2481,14 +2491,18 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceeventlist
|
|
|
2481
2491
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
2482
2492
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
2483
2493
|
uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
2484
|
-
|
|
2494
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
2495
|
+
uint64_t rs_uniffiCallbackData,
|
|
2496
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
2485
2497
|
// We immediately make a lambda which will do the work of transforming the
|
|
2486
2498
|
// arguments into JSI values and calling the callback.
|
|
2487
2499
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
2488
2500
|
[callInvoker, callbackValue, rs_uniffiHandle, rs_event,
|
|
2489
|
-
|
|
2501
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
2502
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
2490
2503
|
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_event,
|
|
2491
|
-
|
|
2504
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
2505
|
+
rs_uniffiOutReturn);
|
|
2492
2506
|
};
|
|
2493
2507
|
// We'll then call that lambda from the callInvoker which will
|
|
2494
2508
|
// look after calling it on the correct thread.
|
|
@@ -5493,7 +5507,7 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
5493
5507
|
jsi::PropNameID::forAscii(
|
|
5494
5508
|
rt,
|
|
5495
5509
|
"ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set"),
|
|
5496
|
-
|
|
5510
|
+
4,
|
|
5497
5511
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
5498
5512
|
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
5499
5513
|
return this
|
|
@@ -7350,17 +7364,12 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7350
7364
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(
|
|
7351
7365
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7352
7366
|
size_t count) {
|
|
7353
|
-
RustCallStatus status =
|
|
7354
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
7355
7367
|
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(
|
|
7356
7368
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7357
|
-
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[1])
|
|
7358
|
-
&status);
|
|
7359
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
7360
|
-
rt, callInvoker, status, args[count - 1]);
|
|
7369
|
+
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[1]));
|
|
7361
7370
|
|
|
7362
|
-
return
|
|
7363
|
-
|
|
7371
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7372
|
+
value);
|
|
7364
7373
|
}
|
|
7365
7374
|
jsi::Value NativeBreezSdkSpark::
|
|
7366
7375
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_available(
|
|
@@ -7596,17 +7605,13 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7596
7605
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(
|
|
7597
7606
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7598
7607
|
size_t count) {
|
|
7599
|
-
RustCallStatus status =
|
|
7600
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
7601
7608
|
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(
|
|
7602
7609
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7603
7610
|
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
7604
|
-
args[1])
|
|
7605
|
-
&status);
|
|
7606
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
7607
|
-
rt, callInvoker, status, args[count - 1]);
|
|
7611
|
+
args[1]));
|
|
7608
7612
|
|
|
7609
|
-
return uniffi_jsi::Bridging
|
|
7613
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7614
|
+
value);
|
|
7610
7615
|
}
|
|
7611
7616
|
jsi::Value
|
|
7612
7617
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment(
|
|
@@ -7637,18 +7642,13 @@ jsi::Value
|
|
|
7637
7642
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
7638
7643
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7639
7644
|
size_t count) {
|
|
7640
|
-
RustCallStatus status =
|
|
7641
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
7642
7645
|
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
7643
7646
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7644
7647
|
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
7645
|
-
args[1])
|
|
7646
|
-
&status);
|
|
7647
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
7648
|
-
rt, callInvoker, status, args[count - 1]);
|
|
7648
|
+
args[1]));
|
|
7649
7649
|
|
|
7650
|
-
return
|
|
7651
|
-
|
|
7650
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7651
|
+
value);
|
|
7652
7652
|
}
|
|
7653
7653
|
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_sdkbuilder(
|
|
7654
7654
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -7731,7 +7731,9 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7731
7731
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7732
7732
|
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
7733
7733
|
args[1]),
|
|
7734
|
-
uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[2])
|
|
7734
|
+
uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[2]),
|
|
7735
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
7736
|
+
args[3]));
|
|
7735
7737
|
|
|
7736
7738
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7737
7739
|
value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AA0eA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAC3BL,MAAM,EAErB;AA2PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
|
|
@@ -101,18 +101,29 @@ const uniffiCallbackInterfaceEventListener = {
|
|
|
101
101
|
// Create the VTable using a series of closures.
|
|
102
102
|
// ts automatically converts these into C callback functions.
|
|
103
103
|
vtable: {
|
|
104
|
-
onEvent: (uniffiHandle, event) => {
|
|
105
|
-
const uniffiMakeCall =
|
|
104
|
+
onEvent: (uniffiHandle, event, uniffiFutureCallback, uniffiCallbackData) => {
|
|
105
|
+
const uniffiMakeCall = async signal => {
|
|
106
106
|
const jsCallback = FfiConverterTypeEventListener.lift(uniffiHandle);
|
|
107
|
-
return jsCallback.onEvent(FfiConverterTypeSdkEvent.lift(event)
|
|
107
|
+
return await jsCallback.onEvent(FfiConverterTypeSdkEvent.lift(event), {
|
|
108
|
+
signal
|
|
109
|
+
});
|
|
108
110
|
};
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
const uniffiHandleSuccess = returnValue => {
|
|
112
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructVoid */{
|
|
113
|
+
callStatus: uniffiCaller.createCallStatus()
|
|
114
|
+
});
|
|
113
115
|
};
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
+
const uniffiHandleError = (code, errorBuf) => {
|
|
117
|
+
uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructVoid */{
|
|
118
|
+
// TODO create callstatus with error.
|
|
119
|
+
callStatus: {
|
|
120
|
+
code,
|
|
121
|
+
errorBuf
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
const uniffiForeignFuture = (0, _uniffiBindgenReactNative.uniffiTraitInterfaceCallAsync)(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*lowerString:*/FfiConverterString.lower);
|
|
126
|
+
return _uniffiBindgenReactNative.UniffiResult.success(uniffiForeignFuture);
|
|
116
127
|
},
|
|
117
128
|
uniffiFree: uniffiHandle => {
|
|
118
129
|
// EventListener: this will throw a stale handle error if the handle isn't found.
|
|
@@ -508,11 +519,15 @@ const GetInfoRequest = exports.GetInfoRequest = (() => {
|
|
|
508
519
|
const FfiConverterTypeGetInfoRequest = (() => {
|
|
509
520
|
class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
|
|
510
521
|
read(from) {
|
|
511
|
-
return {
|
|
522
|
+
return {
|
|
523
|
+
ensureSynced: FfiConverterOptionalBool.read(from)
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
write(value, into) {
|
|
527
|
+
FfiConverterOptionalBool.write(value.ensureSynced, into);
|
|
512
528
|
}
|
|
513
|
-
write(value, into) {}
|
|
514
529
|
allocationSize(value) {
|
|
515
|
-
return
|
|
530
|
+
return FfiConverterOptionalBool.allocationSize(value.ensureSynced);
|
|
516
531
|
}
|
|
517
532
|
}
|
|
518
533
|
return new FFIConverter();
|
|
@@ -4755,10 +4770,18 @@ class BreezSdk extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
4755
4770
|
*
|
|
4756
4771
|
* A unique identifier for the listener, which can be used to remove it later
|
|
4757
4772
|
*/
|
|
4758
|
-
addEventListener(listener) {
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4773
|
+
async addEventListener(listener, asyncOpts_) {
|
|
4774
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4775
|
+
try {
|
|
4776
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
4777
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeEventListener.lower(listener));
|
|
4778
|
+
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
|
|
4779
|
+
} catch (__error) {
|
|
4780
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
4781
|
+
__error.stack = __stack;
|
|
4782
|
+
}
|
|
4783
|
+
throw __error;
|
|
4784
|
+
}
|
|
4762
4785
|
}
|
|
4763
4786
|
async checkLightningAddressAvailable(req, asyncOpts_) /*throws*/{
|
|
4764
4787
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
@@ -5047,10 +5070,18 @@ class BreezSdk extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5047
5070
|
*
|
|
5048
5071
|
* `true` if the listener was found and removed, `false` otherwise
|
|
5049
5072
|
*/
|
|
5050
|
-
removeEventListener(id) {
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5073
|
+
async removeEventListener(id, asyncOpts_) {
|
|
5074
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5075
|
+
try {
|
|
5076
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5077
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(id));
|
|
5078
|
+
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_i8, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_i8, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_i8, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_i8, /*liftFunc:*/_uniffiBindgenReactNative.FfiConverterBool.lift.bind(_uniffiBindgenReactNative.FfiConverterBool), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
|
|
5079
|
+
} catch (__error) {
|
|
5080
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5081
|
+
__error.stack = __stack;
|
|
5082
|
+
}
|
|
5083
|
+
throw __error;
|
|
5084
|
+
}
|
|
5054
5085
|
}
|
|
5055
5086
|
async sendPayment(request, asyncOpts_) /*throws*/{
|
|
5056
5087
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
@@ -5082,10 +5113,18 @@ class BreezSdk extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5082
5113
|
/**
|
|
5083
5114
|
* Synchronizes the wallet with the Spark network
|
|
5084
5115
|
*/
|
|
5085
|
-
syncWallet(request) /*throws*/{
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5116
|
+
async syncWallet(request, asyncOpts_) /*throws*/{
|
|
5117
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5118
|
+
try {
|
|
5119
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5120
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeSyncWalletRequest.lower(request));
|
|
5121
|
+
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSyncWalletResponse.lift.bind(FfiConverterTypeSyncWalletResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
|
|
5122
|
+
} catch (__error) {
|
|
5123
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
5124
|
+
__error.stack = __stack;
|
|
5125
|
+
}
|
|
5126
|
+
throw __error;
|
|
5127
|
+
}
|
|
5089
5128
|
}
|
|
5090
5129
|
|
|
5091
5130
|
/**
|
|
@@ -5225,11 +5264,11 @@ class SdkBuilder extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
5225
5264
|
* - `key_set_type`: The key set type which determines the derivation path.
|
|
5226
5265
|
* - `use_address_index`: Controls the structure of the BIP derivation path.
|
|
5227
5266
|
*/
|
|
5228
|
-
async withKeySet(keySetType, useAddressIndex, asyncOpts_) {
|
|
5267
|
+
async withKeySet(keySetType, useAddressIndex, accountNumber, asyncOpts_) {
|
|
5229
5268
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5230
5269
|
try {
|
|
5231
5270
|
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
5232
|
-
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypeKeySetType.lower(keySetType), _uniffiBindgenReactNative.FfiConverterBool.lower(useAddressIndex));
|
|
5271
|
+
return (0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypeKeySetType.lower(keySetType), _uniffiBindgenReactNative.FfiConverterBool.lower(useAddressIndex), FfiConverterOptionalUInt32.lower(accountNumber));
|
|
5233
5272
|
}, /*pollFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/(0, _breez_sdk_sparkFfi.default)().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
|
|
5234
5273
|
} catch (__error) {
|
|
5235
5274
|
if (uniffiIsDebug && __error instanceof Error) {
|
|
@@ -6018,7 +6057,7 @@ function uniffiEnsureInitialized() {
|
|
|
6018
6057
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction() !== 65179) {
|
|
6019
6058
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction');
|
|
6020
6059
|
}
|
|
6021
|
-
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener() !==
|
|
6060
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener() !== 37737) {
|
|
6022
6061
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener');
|
|
6023
6062
|
}
|
|
6024
6063
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available() !== 31624) {
|
|
@@ -6078,7 +6117,7 @@ function uniffiEnsureInitialized() {
|
|
|
6078
6117
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_address() !== 530) {
|
|
6079
6118
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_address');
|
|
6080
6119
|
}
|
|
6081
|
-
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() !==
|
|
6120
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() !== 41066) {
|
|
6082
6121
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener');
|
|
6083
6122
|
}
|
|
6084
6123
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() !== 54349) {
|
|
@@ -6087,7 +6126,7 @@ function uniffiEnsureInitialized() {
|
|
|
6087
6126
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal() !== 37855) {
|
|
6088
6127
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal');
|
|
6089
6128
|
}
|
|
6090
|
-
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !==
|
|
6129
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !== 30368) {
|
|
6091
6130
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet');
|
|
6092
6131
|
}
|
|
6093
6132
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build() !== 8126) {
|
|
@@ -6099,7 +6138,7 @@ function uniffiEnsureInitialized() {
|
|
|
6099
6138
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service() !== 41113) {
|
|
6100
6139
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service');
|
|
6101
6140
|
}
|
|
6102
|
-
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() !==
|
|
6141
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() !== 42926) {
|
|
6103
6142
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set');
|
|
6104
6143
|
}
|
|
6105
6144
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() !== 61720) {
|
|
@@ -6144,7 +6183,7 @@ function uniffiEnsureInitialized() {
|
|
|
6144
6183
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !== 53882) {
|
|
6145
6184
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new');
|
|
6146
6185
|
}
|
|
6147
|
-
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() !==
|
|
6186
|
+
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() !== 24807) {
|
|
6148
6187
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event');
|
|
6149
6188
|
}
|
|
6150
6189
|
if ((0, _breez_sdk_sparkFfi.default)().ubrn_uniffi_breez_sdk_spark_checksum_method_logger_log() !== 11839) {
|