@breeztech/breez-sdk-spark-react-native 0.2.5-dev1 → 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 +49 -50
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +67 -28
- 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 +68 -29
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +4 -4
- 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 +24 -8
- 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 +4 -4
- 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 +24 -8
- 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 +10 -11
- package/src/generated/breez_sdk_spark.ts +145 -51
|
@@ -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);
|
|
@@ -2396,7 +2400,8 @@ using namespace facebook;
|
|
|
2396
2400
|
|
|
2397
2401
|
// We need to store a lambda in a global so we can call it from
|
|
2398
2402
|
// a function pointer. The function pointer is passed to Rust.
|
|
2399
|
-
static std::function<void(uint64_t, RustBuffer,
|
|
2403
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
2404
|
+
uint64_t, UniffiForeignFuture *)>
|
|
2400
2405
|
rsLambda = nullptr;
|
|
2401
2406
|
|
|
2402
2407
|
// This is the main body of the callback. It's called from the lambda,
|
|
@@ -2405,7 +2410,9 @@ static void body(jsi::Runtime &rt,
|
|
|
2405
2410
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
2406
2411
|
std::shared_ptr<jsi::Value> callbackValue,
|
|
2407
2412
|
uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
2408
|
-
|
|
2413
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
2414
|
+
uint64_t rs_uniffiCallbackData,
|
|
2415
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
2409
2416
|
|
|
2410
2417
|
// Convert the arguments from Rust, into jsi::Values.
|
|
2411
2418
|
// We'll use the Bridging class to do this…
|
|
@@ -2413,6 +2420,11 @@ static void body(jsi::Runtime &rt,
|
|
|
2413
2420
|
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
2414
2421
|
auto js_event = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
2415
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);
|
|
2416
2428
|
|
|
2417
2429
|
// Now we are ready to call the callback.
|
|
2418
2430
|
// We are already on the JS thread, because this `body` function was
|
|
@@ -2420,18 +2432,13 @@ static void body(jsi::Runtime &rt,
|
|
|
2420
2432
|
try {
|
|
2421
2433
|
// Getting the callback function
|
|
2422
2434
|
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
2423
|
-
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_event
|
|
2424
|
-
|
|
2425
|
-
// Now copy the result back from JS into the RustCallStatus object.
|
|
2426
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyFromJs(
|
|
2427
|
-
rt, callInvoker, uniffiResult, uniffi_call_status);
|
|
2428
|
-
|
|
2429
|
-
if (uniffi_call_status->code != UNIFFI_CALL_STATUS_OK) {
|
|
2430
|
-
// The JS callback finished abnormally, so we cannot retrieve the return
|
|
2431
|
-
// value.
|
|
2432
|
-
return;
|
|
2433
|
-
}
|
|
2435
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_event,
|
|
2436
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
2434
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);
|
|
2435
2442
|
} catch (const jsi::JSError &error) {
|
|
2436
2443
|
std::cout
|
|
2437
2444
|
<< "Error in callback UniffiCallbackInterfaceEventListenerMethod0: "
|
|
@@ -2441,8 +2448,9 @@ static void body(jsi::Runtime &rt,
|
|
|
2441
2448
|
}
|
|
2442
2449
|
|
|
2443
2450
|
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
2444
|
-
|
|
2445
|
-
|
|
2451
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
2452
|
+
uint64_t rs_uniffiCallbackData,
|
|
2453
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
2446
2454
|
// If the runtime has shutdown, then there is no point in trying to
|
|
2447
2455
|
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
2448
2456
|
//
|
|
@@ -2458,7 +2466,8 @@ static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
|
2458
2466
|
|
|
2459
2467
|
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
2460
2468
|
// are all in the lambda.
|
|
2461
|
-
rsLambda(rs_uniffiHandle, rs_event,
|
|
2469
|
+
rsLambda(rs_uniffiHandle, rs_event, rs_uniffiFutureCallback,
|
|
2470
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
2462
2471
|
}
|
|
2463
2472
|
|
|
2464
2473
|
static UniffiCallbackInterfaceEventListenerMethod0
|
|
@@ -2482,14 +2491,18 @@ makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfaceeventlist
|
|
|
2482
2491
|
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
2483
2492
|
rsLambda = [&rt, callInvoker, callbackValue](
|
|
2484
2493
|
uint64_t rs_uniffiHandle, RustBuffer rs_event,
|
|
2485
|
-
|
|
2494
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
2495
|
+
uint64_t rs_uniffiCallbackData,
|
|
2496
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
2486
2497
|
// We immediately make a lambda which will do the work of transforming the
|
|
2487
2498
|
// arguments into JSI values and calling the callback.
|
|
2488
2499
|
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
2489
2500
|
[callInvoker, callbackValue, rs_uniffiHandle, rs_event,
|
|
2490
|
-
|
|
2501
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
2502
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
2491
2503
|
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_event,
|
|
2492
|
-
|
|
2504
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
2505
|
+
rs_uniffiOutReturn);
|
|
2493
2506
|
};
|
|
2494
2507
|
// We'll then call that lambda from the callInvoker which will
|
|
2495
2508
|
// look after calling it on the correct thread.
|
|
@@ -7351,17 +7364,12 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7351
7364
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(
|
|
7352
7365
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7353
7366
|
size_t count) {
|
|
7354
|
-
RustCallStatus status =
|
|
7355
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
7356
7367
|
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(
|
|
7357
7368
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7358
|
-
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[1])
|
|
7359
|
-
&status);
|
|
7360
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
7361
|
-
rt, callInvoker, status, args[count - 1]);
|
|
7369
|
+
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[1]));
|
|
7362
7370
|
|
|
7363
|
-
return
|
|
7364
|
-
|
|
7371
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7372
|
+
value);
|
|
7365
7373
|
}
|
|
7366
7374
|
jsi::Value NativeBreezSdkSpark::
|
|
7367
7375
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_available(
|
|
@@ -7597,17 +7605,13 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7597
7605
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(
|
|
7598
7606
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7599
7607
|
size_t count) {
|
|
7600
|
-
RustCallStatus status =
|
|
7601
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
7602
7608
|
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(
|
|
7603
7609
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7604
7610
|
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
7605
|
-
args[1])
|
|
7606
|
-
&status);
|
|
7607
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
7608
|
-
rt, callInvoker, status, args[count - 1]);
|
|
7611
|
+
args[1]));
|
|
7609
7612
|
|
|
7610
|
-
return uniffi_jsi::Bridging
|
|
7613
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7614
|
+
value);
|
|
7611
7615
|
}
|
|
7612
7616
|
jsi::Value
|
|
7613
7617
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment(
|
|
@@ -7638,18 +7642,13 @@ jsi::Value
|
|
|
7638
7642
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
7639
7643
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7640
7644
|
size_t count) {
|
|
7641
|
-
RustCallStatus status =
|
|
7642
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
7643
7645
|
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
7644
7646
|
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
7645
7647
|
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
7646
|
-
args[1])
|
|
7647
|
-
&status);
|
|
7648
|
-
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
7649
|
-
rt, callInvoker, status, args[count - 1]);
|
|
7648
|
+
args[1]));
|
|
7650
7649
|
|
|
7651
|
-
return
|
|
7652
|
-
|
|
7650
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7651
|
+
value);
|
|
7653
7652
|
}
|
|
7654
7653
|
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_sdkbuilder(
|
|
7655
7654
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -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
|
/**
|
|
@@ -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) {
|
|
@@ -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) {
|