@breeztech/breez-sdk-spark-react-native 0.3.1 → 0.3.2
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 +556 -41
- package/cpp/generated/breez_sdk_spark.hpp +33 -7
- package/lib/commonjs/generated/breez_sdk_common.js +52 -1
- package/lib/commonjs/generated/breez_sdk_common.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +553 -20
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/generated/breez_sdk_common.js +51 -0
- package/lib/module/generated/breez_sdk_common.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +551 -18
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +44 -0
- package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +15 -2
- 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 +459 -6
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_common.d.ts +44 -0
- package/lib/typescript/module/src/generated/breez_sdk_common.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +15 -2
- 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 +459 -6
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/breez_sdk_common.ts +76 -0
- package/src/generated/breez_sdk_spark-ffi.ts +40 -2
- package/src/generated/breez_sdk_spark.ts +907 -70
|
@@ -123,6 +123,10 @@ typedef void (*UniffiCallbackInterfaceBitcoinChainServiceMethod3)(
|
|
|
123
123
|
uint64_t uniffi_handle, RustBuffer tx,
|
|
124
124
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
125
125
|
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
126
|
+
typedef void (*UniffiCallbackInterfacePaymentObserverMethod0)(
|
|
127
|
+
uint64_t uniffi_handle, RustBuffer payments,
|
|
128
|
+
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
129
|
+
uint64_t uniffi_callback_data, UniffiForeignFuture *uniffi_out_return);
|
|
126
130
|
typedef void (*UniffiCallbackInterfaceStorageMethod0)(
|
|
127
131
|
uint64_t uniffi_handle, RustBuffer key,
|
|
128
132
|
UniffiForeignFutureCompleteVoid uniffi_future_callback,
|
|
@@ -187,6 +191,10 @@ typedef struct UniffiVTableCallbackInterfaceBitcoinChainService {
|
|
|
187
191
|
UniffiCallbackInterfaceBitcoinChainServiceMethod3 broadcast_transaction;
|
|
188
192
|
UniffiCallbackInterfaceFree uniffi_free;
|
|
189
193
|
} UniffiVTableCallbackInterfaceBitcoinChainService;
|
|
194
|
+
typedef struct UniffiVTableCallbackInterfacePaymentObserver {
|
|
195
|
+
UniffiCallbackInterfacePaymentObserverMethod0 before_send;
|
|
196
|
+
UniffiCallbackInterfaceFree uniffi_free;
|
|
197
|
+
} UniffiVTableCallbackInterfacePaymentObserver;
|
|
190
198
|
typedef struct UniffiVTableCallbackInterfaceStorage {
|
|
191
199
|
UniffiCallbackInterfaceStorageMethod0 delete_cached_item;
|
|
192
200
|
UniffiCallbackInterfaceStorageMethod1 get_cached_item;
|
|
@@ -262,6 +270,8 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_list_unclaimed_deposits(
|
|
|
262
270
|
uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay(void *ptr,
|
|
263
271
|
RustBuffer request);
|
|
264
272
|
/*handle*/ uint64_t
|
|
273
|
+
uniffi_breez_sdk_spark_fn_method_breezsdk_parse(void *ptr, RustBuffer input);
|
|
274
|
+
/*handle*/ uint64_t
|
|
265
275
|
uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay(void *ptr,
|
|
266
276
|
RustBuffer request);
|
|
267
277
|
/*handle*/ uint64_t
|
|
@@ -289,6 +299,16 @@ uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(void *ptr,
|
|
|
289
299
|
uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment(void *ptr,
|
|
290
300
|
RustBuffer request);
|
|
291
301
|
void *
|
|
302
|
+
uniffi_breez_sdk_spark_fn_clone_paymentobserver(void *ptr,
|
|
303
|
+
RustCallStatus *uniffi_out_err);
|
|
304
|
+
void uniffi_breez_sdk_spark_fn_free_paymentobserver(
|
|
305
|
+
void *ptr, RustCallStatus *uniffi_out_err);
|
|
306
|
+
void uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver(
|
|
307
|
+
UniffiVTableCallbackInterfacePaymentObserver *vtable);
|
|
308
|
+
/*handle*/ uint64_t
|
|
309
|
+
uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send(
|
|
310
|
+
void *ptr, RustBuffer payments);
|
|
311
|
+
void *
|
|
292
312
|
uniffi_breez_sdk_spark_fn_clone_sdkbuilder(void *ptr,
|
|
293
313
|
RustCallStatus *uniffi_out_err);
|
|
294
314
|
void uniffi_breez_sdk_spark_fn_free_sdkbuilder(void *ptr,
|
|
@@ -311,6 +331,9 @@ uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(
|
|
|
311
331
|
uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client(
|
|
312
332
|
void *ptr, void *lnurl_client);
|
|
313
333
|
/*handle*/ uint64_t
|
|
334
|
+
uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
|
|
335
|
+
void *ptr, void *payment_observer);
|
|
336
|
+
/*handle*/ uint64_t
|
|
314
337
|
uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_rest_chain_service(
|
|
315
338
|
void *ptr, RustBuffer url, RustBuffer credentials);
|
|
316
339
|
void *uniffi_breez_sdk_spark_fn_clone_storage(void *ptr,
|
|
@@ -364,7 +387,6 @@ uniffi_breez_sdk_spark_fn_func_default_storage(RustBuffer data_dir,
|
|
|
364
387
|
void uniffi_breez_sdk_spark_fn_func_init_logging(
|
|
365
388
|
RustBuffer log_dir, RustBuffer app_logger, RustBuffer log_filter,
|
|
366
389
|
RustCallStatus *uniffi_out_err);
|
|
367
|
-
/*handle*/ uint64_t uniffi_breez_sdk_spark_fn_func_parse(RustBuffer input);
|
|
368
390
|
RustBuffer ffi_breez_sdk_spark_rustbuffer_alloc(uint64_t size,
|
|
369
391
|
RustCallStatus *uniffi_out_err);
|
|
370
392
|
RustBuffer
|
|
@@ -496,7 +518,6 @@ uint16_t uniffi_breez_sdk_spark_checksum_func_connect();
|
|
|
496
518
|
uint16_t uniffi_breez_sdk_spark_checksum_func_default_config();
|
|
497
519
|
uint16_t uniffi_breez_sdk_spark_checksum_func_default_storage();
|
|
498
520
|
uint16_t uniffi_breez_sdk_spark_checksum_func_init_logging();
|
|
499
|
-
uint16_t uniffi_breez_sdk_spark_checksum_func_parse();
|
|
500
521
|
uint16_t
|
|
501
522
|
uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos();
|
|
502
523
|
uint16_t
|
|
@@ -523,6 +544,7 @@ uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments();
|
|
|
523
544
|
uint16_t
|
|
524
545
|
uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposits();
|
|
525
546
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay();
|
|
547
|
+
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_parse();
|
|
526
548
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay();
|
|
527
549
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment();
|
|
528
550
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment();
|
|
@@ -534,12 +556,15 @@ uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener();
|
|
|
534
556
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment();
|
|
535
557
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet();
|
|
536
558
|
uint16_t uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment();
|
|
559
|
+
uint16_t uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send();
|
|
537
560
|
uint16_t uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build();
|
|
538
561
|
uint16_t uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service();
|
|
539
562
|
uint16_t uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service();
|
|
540
563
|
uint16_t uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set();
|
|
541
564
|
uint16_t uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client();
|
|
542
565
|
uint16_t
|
|
566
|
+
uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer();
|
|
567
|
+
uint16_t
|
|
543
568
|
uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service();
|
|
544
569
|
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_delete_cached_item();
|
|
545
570
|
uint16_t uniffi_breez_sdk_spark_checksum_method_storage_get_cached_item();
|
|
@@ -1362,6 +1387,118 @@ static void cleanup() {
|
|
|
1362
1387
|
} // namespace
|
|
1363
1388
|
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacebitcoinchainservice::vtablecallbackinterfacebitcoinchainservice::free
|
|
1364
1389
|
|
|
1390
|
+
// Callback function:
|
|
1391
|
+
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacepaymentobserver::vtablecallbackinterfacepaymentobserver::free::UniffiCallbackInterfaceFree
|
|
1392
|
+
//
|
|
1393
|
+
// We have the following constraints:
|
|
1394
|
+
// - we need to pass a function pointer to Rust.
|
|
1395
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
1396
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
1397
|
+
//
|
|
1398
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
1399
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
1400
|
+
// into JS.
|
|
1401
|
+
//
|
|
1402
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
1403
|
+
// lambda sometime in the future.
|
|
1404
|
+
namespace uniffi::breez_sdk_spark::st::vtablecallbackinterfacepaymentobserver::
|
|
1405
|
+
vtablecallbackinterfacepaymentobserver::free {
|
|
1406
|
+
using namespace facebook;
|
|
1407
|
+
|
|
1408
|
+
// We need to store a lambda in a global so we can call it from
|
|
1409
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
1410
|
+
static std::function<void(uint64_t)> rsLambda = nullptr;
|
|
1411
|
+
|
|
1412
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
1413
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
1414
|
+
static void body(jsi::Runtime &rt,
|
|
1415
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1416
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
1417
|
+
uint64_t rs_handle) {
|
|
1418
|
+
|
|
1419
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
1420
|
+
// We'll use the Bridging class to do this…
|
|
1421
|
+
auto js_handle =
|
|
1422
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
|
|
1423
|
+
|
|
1424
|
+
// Now we are ready to call the callback.
|
|
1425
|
+
// We are already on the JS thread, because this `body` function was
|
|
1426
|
+
// invoked from the CallInvoker.
|
|
1427
|
+
try {
|
|
1428
|
+
// Getting the callback function
|
|
1429
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
1430
|
+
auto uniffiResult = cb.call(rt, js_handle);
|
|
1431
|
+
|
|
1432
|
+
} catch (const jsi::JSError &error) {
|
|
1433
|
+
std::cout << "Error in callback UniffiCallbackInterfaceFree: "
|
|
1434
|
+
<< error.what() << std::endl;
|
|
1435
|
+
throw error;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
static void callback(uint64_t rs_handle) {
|
|
1440
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
1441
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
1442
|
+
//
|
|
1443
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
1444
|
+
// which nulls out the rsLamda.
|
|
1445
|
+
//
|
|
1446
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
1447
|
+
if (rsLambda == nullptr) {
|
|
1448
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
1449
|
+
// which causes the JS callback to be dropped.
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
1454
|
+
// are all in the lambda.
|
|
1455
|
+
rsLambda(rs_handle);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
static UniffiCallbackInterfaceFree
|
|
1459
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::st::vtablecallbackinterfacepaymentobserver::vtablecallbackinterfacepaymentobserver::free
|
|
1460
|
+
jsi::Runtime &rt,
|
|
1461
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
1462
|
+
const jsi::Value &value) {
|
|
1463
|
+
if (rsLambda != nullptr) {
|
|
1464
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
1465
|
+
//
|
|
1466
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
1467
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
1468
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
1469
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
1470
|
+
//
|
|
1471
|
+
// We can therefore return the callback function without making anything
|
|
1472
|
+
// new if we've been initialized already.
|
|
1473
|
+
return callback;
|
|
1474
|
+
}
|
|
1475
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
1476
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
1477
|
+
rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
|
|
1478
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
1479
|
+
// arguments into JSI values and calling the callback.
|
|
1480
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
1481
|
+
[callInvoker, callbackValue, rs_handle](jsi::Runtime &rt) mutable {
|
|
1482
|
+
body(rt, callInvoker, callbackValue, rs_handle);
|
|
1483
|
+
};
|
|
1484
|
+
// We'll then call that lambda from the callInvoker which will
|
|
1485
|
+
// look after calling it on the correct thread.
|
|
1486
|
+
|
|
1487
|
+
callInvoker->invokeNonBlocking(rt, jsLambda);
|
|
1488
|
+
};
|
|
1489
|
+
return callback;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
1493
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
1494
|
+
static void cleanup() {
|
|
1495
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
1496
|
+
// out, then the pointer will no longer be left dangling.
|
|
1497
|
+
rsLambda = nullptr;
|
|
1498
|
+
}
|
|
1499
|
+
} // namespace
|
|
1500
|
+
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacepaymentobserver::vtablecallbackinterfacepaymentobserver::free
|
|
1501
|
+
|
|
1365
1502
|
// Callback function:
|
|
1366
1503
|
// uniffi::breez_sdk_spark::st::vtablecallbackinterfacestorage::vtablecallbackinterfacestorage::free::UniffiCallbackInterfaceFree
|
|
1367
1504
|
//
|
|
@@ -3235,6 +3372,148 @@ static void cleanup() {
|
|
|
3235
3372
|
} // namespace
|
|
3236
3373
|
// uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod3
|
|
3237
3374
|
// Implementation of callback function calling from Rust to JS
|
|
3375
|
+
// CallbackInterfacePaymentObserverMethod0
|
|
3376
|
+
|
|
3377
|
+
// Callback function:
|
|
3378
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacepaymentobservermethod0::UniffiCallbackInterfacePaymentObserverMethod0
|
|
3379
|
+
//
|
|
3380
|
+
// We have the following constraints:
|
|
3381
|
+
// - we need to pass a function pointer to Rust.
|
|
3382
|
+
// - we need a jsi::Runtime and jsi::Function to call into JS.
|
|
3383
|
+
// - function pointers can't store state, so we can't use a lamda.
|
|
3384
|
+
//
|
|
3385
|
+
// For this, we store a lambda as a global, as `rsLambda`. The `callback`
|
|
3386
|
+
// function calls the lambda, which itself calls the `body` which then calls
|
|
3387
|
+
// into JS.
|
|
3388
|
+
//
|
|
3389
|
+
// We then give the `callback` function pointer to Rust which will call the
|
|
3390
|
+
// lambda sometime in the future.
|
|
3391
|
+
namespace uniffi::breez_sdk_spark::cb::callbackinterfacepaymentobservermethod0 {
|
|
3392
|
+
using namespace facebook;
|
|
3393
|
+
|
|
3394
|
+
// We need to store a lambda in a global so we can call it from
|
|
3395
|
+
// a function pointer. The function pointer is passed to Rust.
|
|
3396
|
+
static std::function<void(uint64_t, RustBuffer, UniffiForeignFutureCompleteVoid,
|
|
3397
|
+
uint64_t, UniffiForeignFuture *)>
|
|
3398
|
+
rsLambda = nullptr;
|
|
3399
|
+
|
|
3400
|
+
// This is the main body of the callback. It's called from the lambda,
|
|
3401
|
+
// which itself is called from the callback function which is passed to Rust.
|
|
3402
|
+
static void body(jsi::Runtime &rt,
|
|
3403
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
3404
|
+
std::shared_ptr<jsi::Value> callbackValue,
|
|
3405
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_payments,
|
|
3406
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
3407
|
+
uint64_t rs_uniffiCallbackData,
|
|
3408
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
3409
|
+
|
|
3410
|
+
// Convert the arguments from Rust, into jsi::Values.
|
|
3411
|
+
// We'll use the Bridging class to do this…
|
|
3412
|
+
auto js_uniffiHandle =
|
|
3413
|
+
uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_uniffiHandle);
|
|
3414
|
+
auto js_payments = uniffi::breez_sdk_spark::Bridging<RustBuffer>::toJs(
|
|
3415
|
+
rt, callInvoker, rs_payments);
|
|
3416
|
+
auto js_uniffiFutureCallback =
|
|
3417
|
+
uniffi::breez_sdk_spark::Bridging<UniffiForeignFutureCompleteVoid>::toJs(
|
|
3418
|
+
rt, callInvoker, rs_uniffiFutureCallback);
|
|
3419
|
+
auto js_uniffiCallbackData = uniffi_jsi::Bridging<uint64_t>::toJs(
|
|
3420
|
+
rt, callInvoker, rs_uniffiCallbackData);
|
|
3421
|
+
|
|
3422
|
+
// Now we are ready to call the callback.
|
|
3423
|
+
// We are already on the JS thread, because this `body` function was
|
|
3424
|
+
// invoked from the CallInvoker.
|
|
3425
|
+
try {
|
|
3426
|
+
// Getting the callback function
|
|
3427
|
+
auto cb = callbackValue->asObject(rt).asFunction(rt);
|
|
3428
|
+
auto uniffiResult = cb.call(rt, js_uniffiHandle, js_payments,
|
|
3429
|
+
js_uniffiFutureCallback, js_uniffiCallbackData);
|
|
3430
|
+
|
|
3431
|
+
// Finally, we need to copy the return value back into the Rust pointer.
|
|
3432
|
+
*rs_uniffiOutReturn = uniffi::breez_sdk_spark::Bridging<
|
|
3433
|
+
ReferenceHolder<UniffiForeignFuture>>::fromJs(rt, callInvoker,
|
|
3434
|
+
uniffiResult);
|
|
3435
|
+
} catch (const jsi::JSError &error) {
|
|
3436
|
+
std::cout
|
|
3437
|
+
<< "Error in callback UniffiCallbackInterfacePaymentObserverMethod0: "
|
|
3438
|
+
<< error.what() << std::endl;
|
|
3439
|
+
throw error;
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
static void callback(uint64_t rs_uniffiHandle, RustBuffer rs_payments,
|
|
3444
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
3445
|
+
uint64_t rs_uniffiCallbackData,
|
|
3446
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
3447
|
+
// If the runtime has shutdown, then there is no point in trying to
|
|
3448
|
+
// call into Javascript. BUT how do we tell if the runtime has shutdown?
|
|
3449
|
+
//
|
|
3450
|
+
// Answer: the module destructor calls into callback `cleanup` method,
|
|
3451
|
+
// which nulls out the rsLamda.
|
|
3452
|
+
//
|
|
3453
|
+
// If rsLamda is null, then there is no runtime to call into.
|
|
3454
|
+
if (rsLambda == nullptr) {
|
|
3455
|
+
// This only occurs when destructors are calling into Rust free/drop,
|
|
3456
|
+
// which causes the JS callback to be dropped.
|
|
3457
|
+
return;
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3460
|
+
// The runtime, the actual callback jsi::funtion, and the callInvoker
|
|
3461
|
+
// are all in the lambda.
|
|
3462
|
+
rsLambda(rs_uniffiHandle, rs_payments, rs_uniffiFutureCallback,
|
|
3463
|
+
rs_uniffiCallbackData, rs_uniffiOutReturn);
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
static UniffiCallbackInterfacePaymentObserverMethod0
|
|
3467
|
+
makeCallbackFunction( // uniffi::breez_sdk_spark::cb::callbackinterfacepaymentobservermethod0
|
|
3468
|
+
jsi::Runtime &rt,
|
|
3469
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
3470
|
+
const jsi::Value &value) {
|
|
3471
|
+
if (rsLambda != nullptr) {
|
|
3472
|
+
// `makeCallbackFunction` is called in two circumstances:
|
|
3473
|
+
//
|
|
3474
|
+
// 1. at startup, when initializing callback interface vtables.
|
|
3475
|
+
// 2. when polling futures. This happens at least once per future that is
|
|
3476
|
+
// exposed to Javascript. We know that this is always the same function,
|
|
3477
|
+
// `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
|
|
3478
|
+
//
|
|
3479
|
+
// We can therefore return the callback function without making anything
|
|
3480
|
+
// new if we've been initialized already.
|
|
3481
|
+
return callback;
|
|
3482
|
+
}
|
|
3483
|
+
auto callbackFunction = value.asObject(rt).asFunction(rt);
|
|
3484
|
+
auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
|
|
3485
|
+
rsLambda = [&rt, callInvoker, callbackValue](
|
|
3486
|
+
uint64_t rs_uniffiHandle, RustBuffer rs_payments,
|
|
3487
|
+
UniffiForeignFutureCompleteVoid rs_uniffiFutureCallback,
|
|
3488
|
+
uint64_t rs_uniffiCallbackData,
|
|
3489
|
+
UniffiForeignFuture *rs_uniffiOutReturn) {
|
|
3490
|
+
// We immediately make a lambda which will do the work of transforming the
|
|
3491
|
+
// arguments into JSI values and calling the callback.
|
|
3492
|
+
uniffi_runtime::UniffiCallFunc jsLambda =
|
|
3493
|
+
[callInvoker, callbackValue, rs_uniffiHandle, rs_payments,
|
|
3494
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
3495
|
+
rs_uniffiOutReturn](jsi::Runtime &rt) mutable {
|
|
3496
|
+
body(rt, callInvoker, callbackValue, rs_uniffiHandle, rs_payments,
|
|
3497
|
+
rs_uniffiFutureCallback, rs_uniffiCallbackData,
|
|
3498
|
+
rs_uniffiOutReturn);
|
|
3499
|
+
};
|
|
3500
|
+
// We'll then call that lambda from the callInvoker which will
|
|
3501
|
+
// look after calling it on the correct thread.
|
|
3502
|
+
callInvoker->invokeBlocking(rt, jsLambda);
|
|
3503
|
+
};
|
|
3504
|
+
return callback;
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
// This method is called from the destructor of NativeBreezSdkSpark, which only
|
|
3508
|
+
// happens when the jsi::Runtime is being destroyed.
|
|
3509
|
+
static void cleanup() {
|
|
3510
|
+
// The lambda holds a reference to the the Runtime, so when this is nulled
|
|
3511
|
+
// out, then the pointer will no longer be left dangling.
|
|
3512
|
+
rsLambda = nullptr;
|
|
3513
|
+
}
|
|
3514
|
+
} // namespace
|
|
3515
|
+
// uniffi::breez_sdk_spark::cb::callbackinterfacepaymentobservermethod0
|
|
3516
|
+
// Implementation of callback function calling from Rust to JS
|
|
3238
3517
|
// CallbackInterfaceStorageMethod0
|
|
3239
3518
|
|
|
3240
3519
|
// Callback function:
|
|
@@ -5068,6 +5347,40 @@ namespace uniffi::breez_sdk_spark {
|
|
|
5068
5347
|
using namespace facebook;
|
|
5069
5348
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
5070
5349
|
|
|
5350
|
+
template <> struct Bridging<UniffiVTableCallbackInterfacePaymentObserver> {
|
|
5351
|
+
static UniffiVTableCallbackInterfacePaymentObserver
|
|
5352
|
+
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
5353
|
+
const jsi::Value &jsValue) {
|
|
5354
|
+
// Check if the input is an object
|
|
5355
|
+
if (!jsValue.isObject()) {
|
|
5356
|
+
throw jsi::JSError(rt, "Expected an object for "
|
|
5357
|
+
"UniffiVTableCallbackInterfacePaymentObserver");
|
|
5358
|
+
}
|
|
5359
|
+
|
|
5360
|
+
// Get the object from the jsi::Value
|
|
5361
|
+
auto jsObject = jsValue.getObject(rt);
|
|
5362
|
+
|
|
5363
|
+
// Create the vtable struct
|
|
5364
|
+
UniffiVTableCallbackInterfacePaymentObserver rsObject;
|
|
5365
|
+
|
|
5366
|
+
// Create the vtable from the js callbacks.
|
|
5367
|
+
rsObject.before_send = uniffi::breez_sdk_spark::cb::
|
|
5368
|
+
callbackinterfacepaymentobservermethod0::makeCallbackFunction(
|
|
5369
|
+
rt, callInvoker, jsObject.getProperty(rt, "beforeSend"));
|
|
5370
|
+
rsObject.uniffi_free =
|
|
5371
|
+
uniffi::breez_sdk_spark::st::vtablecallbackinterfacepaymentobserver::
|
|
5372
|
+
vtablecallbackinterfacepaymentobserver::free::makeCallbackFunction(
|
|
5373
|
+
rt, callInvoker, jsObject.getProperty(rt, "uniffiFree"));
|
|
5374
|
+
|
|
5375
|
+
return rsObject;
|
|
5376
|
+
}
|
|
5377
|
+
};
|
|
5378
|
+
|
|
5379
|
+
} // namespace uniffi::breez_sdk_spark
|
|
5380
|
+
namespace uniffi::breez_sdk_spark {
|
|
5381
|
+
using namespace facebook;
|
|
5382
|
+
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
5383
|
+
|
|
5071
5384
|
template <> struct Bridging<UniffiVTableCallbackInterfaceStorage> {
|
|
5072
5385
|
static UniffiVTableCallbackInterfaceStorage
|
|
5073
5386
|
fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
|
|
@@ -5455,6 +5768,17 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
5455
5768
|
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay(
|
|
5456
5769
|
rt, thisVal, args, count);
|
|
5457
5770
|
});
|
|
5771
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_parse"] =
|
|
5772
|
+
jsi::Function::createFromHostFunction(
|
|
5773
|
+
rt,
|
|
5774
|
+
jsi::PropNameID::forAscii(
|
|
5775
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_parse"),
|
|
5776
|
+
2,
|
|
5777
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
5778
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
5779
|
+
return this->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_parse(
|
|
5780
|
+
rt, thisVal, args, count);
|
|
5781
|
+
});
|
|
5458
5782
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay"] =
|
|
5459
5783
|
jsi::Function::createFromHostFunction(
|
|
5460
5784
|
rt,
|
|
@@ -5566,6 +5890,40 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
5566
5890
|
->cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment(
|
|
5567
5891
|
rt, thisVal, args, count);
|
|
5568
5892
|
});
|
|
5893
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_clone_paymentobserver"] =
|
|
5894
|
+
jsi::Function::createFromHostFunction(
|
|
5895
|
+
rt,
|
|
5896
|
+
jsi::PropNameID::forAscii(
|
|
5897
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_clone_paymentobserver"),
|
|
5898
|
+
1,
|
|
5899
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
5900
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
5901
|
+
return this->cpp_uniffi_breez_sdk_spark_fn_clone_paymentobserver(
|
|
5902
|
+
rt, thisVal, args, count);
|
|
5903
|
+
});
|
|
5904
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_free_paymentobserver"] =
|
|
5905
|
+
jsi::Function::createFromHostFunction(
|
|
5906
|
+
rt,
|
|
5907
|
+
jsi::PropNameID::forAscii(
|
|
5908
|
+
rt, "ubrn_uniffi_breez_sdk_spark_fn_free_paymentobserver"),
|
|
5909
|
+
1,
|
|
5910
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
5911
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
5912
|
+
return this->cpp_uniffi_breez_sdk_spark_fn_free_paymentobserver(
|
|
5913
|
+
rt, thisVal, args, count);
|
|
5914
|
+
});
|
|
5915
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send"] =
|
|
5916
|
+
jsi::Function::createFromHostFunction(
|
|
5917
|
+
rt,
|
|
5918
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
5919
|
+
"paymentobserver_before_send"),
|
|
5920
|
+
2,
|
|
5921
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
5922
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
5923
|
+
return this
|
|
5924
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send(
|
|
5925
|
+
rt, thisVal, args, count);
|
|
5926
|
+
});
|
|
5569
5927
|
props["ubrn_uniffi_breez_sdk_spark_fn_clone_sdkbuilder"] =
|
|
5570
5928
|
jsi::Function::createFromHostFunction(
|
|
5571
5929
|
rt,
|
|
@@ -5660,6 +6018,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
5660
6018
|
->cpp_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client(
|
|
5661
6019
|
rt, thisVal, args, count);
|
|
5662
6020
|
});
|
|
6021
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_"
|
|
6022
|
+
"observer"] = jsi::Function::createFromHostFunction(
|
|
6023
|
+
rt,
|
|
6024
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_method_"
|
|
6025
|
+
"sdkbuilder_with_payment_observer"),
|
|
6026
|
+
2,
|
|
6027
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
6028
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
6029
|
+
return this
|
|
6030
|
+
->cpp_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
|
|
6031
|
+
rt, thisVal, args, count);
|
|
6032
|
+
});
|
|
5663
6033
|
props["ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_rest_chain_"
|
|
5664
6034
|
"service"] = jsi::Function::createFromHostFunction(
|
|
5665
6035
|
rt,
|
|
@@ -5889,17 +6259,6 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
5889
6259
|
return this->cpp_uniffi_breez_sdk_spark_fn_func_init_logging(
|
|
5890
6260
|
rt, thisVal, args, count);
|
|
5891
6261
|
});
|
|
5892
|
-
props["ubrn_uniffi_breez_sdk_spark_fn_func_parse"] =
|
|
5893
|
-
jsi::Function::createFromHostFunction(
|
|
5894
|
-
rt,
|
|
5895
|
-
jsi::PropNameID::forAscii(
|
|
5896
|
-
rt, "ubrn_uniffi_breez_sdk_spark_fn_func_parse"),
|
|
5897
|
-
1,
|
|
5898
|
-
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
5899
|
-
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
5900
|
-
return this->cpp_uniffi_breez_sdk_spark_fn_func_parse(rt, thisVal,
|
|
5901
|
-
args, count);
|
|
5902
|
-
});
|
|
5903
6262
|
props["ubrn_ffi_breez_sdk_spark_rust_future_poll_u8"] =
|
|
5904
6263
|
jsi::Function::createFromHostFunction(
|
|
5905
6264
|
rt,
|
|
@@ -6519,17 +6878,6 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
6519
6878
|
return this->cpp_uniffi_breez_sdk_spark_checksum_func_init_logging(
|
|
6520
6879
|
rt, thisVal, args, count);
|
|
6521
6880
|
});
|
|
6522
|
-
props["ubrn_uniffi_breez_sdk_spark_checksum_func_parse"] =
|
|
6523
|
-
jsi::Function::createFromHostFunction(
|
|
6524
|
-
rt,
|
|
6525
|
-
jsi::PropNameID::forAscii(
|
|
6526
|
-
rt, "ubrn_uniffi_breez_sdk_spark_checksum_func_parse"),
|
|
6527
|
-
0,
|
|
6528
|
-
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
6529
|
-
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
6530
|
-
return this->cpp_uniffi_breez_sdk_spark_checksum_func_parse(
|
|
6531
|
-
rt, thisVal, args, count);
|
|
6532
|
-
});
|
|
6533
6881
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_"
|
|
6534
6882
|
"address_utxos"] = jsi::Function::createFromHostFunction(
|
|
6535
6883
|
rt,
|
|
@@ -6753,6 +7101,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
6753
7101
|
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay(
|
|
6754
7102
|
rt, thisVal, args, count);
|
|
6755
7103
|
});
|
|
7104
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_parse"] =
|
|
7105
|
+
jsi::Function::createFromHostFunction(
|
|
7106
|
+
rt,
|
|
7107
|
+
jsi::PropNameID::forAscii(
|
|
7108
|
+
rt, "ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_parse"),
|
|
7109
|
+
0,
|
|
7110
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
7111
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
7112
|
+
return this
|
|
7113
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_parse(
|
|
7114
|
+
rt, thisVal, args, count);
|
|
7115
|
+
});
|
|
6756
7116
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_"
|
|
6757
7117
|
"pay"] = jsi::Function::createFromHostFunction(
|
|
6758
7118
|
rt,
|
|
@@ -6862,6 +7222,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
6862
7222
|
->cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment(
|
|
6863
7223
|
rt, thisVal, args, count);
|
|
6864
7224
|
});
|
|
7225
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_"
|
|
7226
|
+
"send"] = jsi::Function::createFromHostFunction(
|
|
7227
|
+
rt,
|
|
7228
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
7229
|
+
"method_paymentobserver_before_send"),
|
|
7230
|
+
0,
|
|
7231
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
7232
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
7233
|
+
return this
|
|
7234
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send(
|
|
7235
|
+
rt, thisVal, args, count);
|
|
7236
|
+
});
|
|
6865
7237
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build"] =
|
|
6866
7238
|
jsi::Function::createFromHostFunction(
|
|
6867
7239
|
rt,
|
|
@@ -6923,6 +7295,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
6923
7295
|
->cpp_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client(
|
|
6924
7296
|
rt, thisVal, args, count);
|
|
6925
7297
|
});
|
|
7298
|
+
props["ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_"
|
|
7299
|
+
"observer"] = jsi::Function::createFromHostFunction(
|
|
7300
|
+
rt,
|
|
7301
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_checksum_"
|
|
7302
|
+
"method_sdkbuilder_with_payment_observer"),
|
|
7303
|
+
0,
|
|
7304
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
7305
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
7306
|
+
return this
|
|
7307
|
+
->cpp_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer(
|
|
7308
|
+
rt, thisVal, args, count);
|
|
7309
|
+
});
|
|
6926
7310
|
props["ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_"
|
|
6927
7311
|
"chain_service"] = jsi::Function::createFromHostFunction(
|
|
6928
7312
|
rt,
|
|
@@ -7162,6 +7546,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
7162
7546
|
->cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_bitcoinchainservice(
|
|
7163
7547
|
rt, thisVal, args, count);
|
|
7164
7548
|
});
|
|
7549
|
+
props["ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver"] =
|
|
7550
|
+
jsi::Function::createFromHostFunction(
|
|
7551
|
+
rt,
|
|
7552
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_breez_sdk_spark_fn_init_"
|
|
7553
|
+
"callback_vtable_paymentobserver"),
|
|
7554
|
+
1,
|
|
7555
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
7556
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
7557
|
+
return this
|
|
7558
|
+
->cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver(
|
|
7559
|
+
rt, thisVal, args, count);
|
|
7560
|
+
});
|
|
7165
7561
|
props["ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_storage"] =
|
|
7166
7562
|
jsi::Function::createFromHostFunction(
|
|
7167
7563
|
rt,
|
|
@@ -7199,6 +7595,18 @@ NativeBreezSdkSpark::NativeBreezSdkSpark(
|
|
|
7199
7595
|
->cpp_uniffi_internal_fn_method_breezsdk_ffi__bless_pointer(
|
|
7200
7596
|
rt, thisVal, args, count);
|
|
7201
7597
|
});
|
|
7598
|
+
props["ubrn_uniffi_internal_fn_method_paymentobserver_ffi__bless_pointer"] =
|
|
7599
|
+
jsi::Function::createFromHostFunction(
|
|
7600
|
+
rt,
|
|
7601
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_"
|
|
7602
|
+
"paymentobserver_ffi__bless_pointer"),
|
|
7603
|
+
1,
|
|
7604
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal,
|
|
7605
|
+
const jsi::Value *args, size_t count) -> jsi::Value {
|
|
7606
|
+
return this
|
|
7607
|
+
->cpp_uniffi_internal_fn_method_paymentobserver_ffi__bless_pointer(
|
|
7608
|
+
rt, thisVal, args, count);
|
|
7609
|
+
});
|
|
7202
7610
|
props["ubrn_uniffi_internal_fn_method_sdkbuilder_ffi__bless_pointer"] =
|
|
7203
7611
|
jsi::Function::createFromHostFunction(
|
|
7204
7612
|
rt,
|
|
@@ -7273,6 +7681,8 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
|
|
|
7273
7681
|
vtablecallbackinterfacelogger::free::cleanup();
|
|
7274
7682
|
uniffi::breez_sdk_spark::st::vtablecallbackinterfacebitcoinchainservice::
|
|
7275
7683
|
vtablecallbackinterfacebitcoinchainservice::free::cleanup();
|
|
7684
|
+
uniffi::breez_sdk_spark::st::vtablecallbackinterfacepaymentobserver::
|
|
7685
|
+
vtablecallbackinterfacepaymentobserver::free::cleanup();
|
|
7276
7686
|
uniffi::breez_sdk_spark::st::vtablecallbackinterfacestorage::
|
|
7277
7687
|
vtablecallbackinterfacestorage::free::cleanup();
|
|
7278
7688
|
// Cleanup for callback function CallbackInterfaceEventListenerMethod0
|
|
@@ -7291,6 +7701,9 @@ NativeBreezSdkSpark::~NativeBreezSdkSpark() {
|
|
|
7291
7701
|
// Cleanup for callback function CallbackInterfaceBitcoinChainServiceMethod3
|
|
7292
7702
|
uniffi::breez_sdk_spark::cb::callbackinterfacebitcoinchainservicemethod3::
|
|
7293
7703
|
cleanup();
|
|
7704
|
+
// Cleanup for callback function CallbackInterfacePaymentObserverMethod0
|
|
7705
|
+
uniffi::breez_sdk_spark::cb::callbackinterfacepaymentobservermethod0::
|
|
7706
|
+
cleanup();
|
|
7294
7707
|
// Cleanup for callback function CallbackInterfaceStorageMethod0
|
|
7295
7708
|
uniffi::breez_sdk_spark::cb::callbackinterfacestoragemethod0::cleanup();
|
|
7296
7709
|
// Cleanup for callback function CallbackInterfaceStorageMethod1
|
|
@@ -7370,6 +7783,22 @@ NativeBreezSdkSpark::cpp_uniffi_internal_fn_method_breezsdk_ffi__bless_pointer(
|
|
|
7370
7783
|
auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
|
|
7371
7784
|
return jsi::Value(rt, obj);
|
|
7372
7785
|
}
|
|
7786
|
+
jsi::Value NativeBreezSdkSpark::
|
|
7787
|
+
cpp_uniffi_internal_fn_method_paymentobserver_ffi__bless_pointer(
|
|
7788
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7789
|
+
size_t count) {
|
|
7790
|
+
auto pointer =
|
|
7791
|
+
uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
|
|
7792
|
+
auto static destructor = [](uint64_t p) {
|
|
7793
|
+
auto pointer = reinterpret_cast<void *>(static_cast<uintptr_t>(p));
|
|
7794
|
+
RustCallStatus status = {0};
|
|
7795
|
+
uniffi_breez_sdk_spark_fn_free_paymentobserver(pointer, &status);
|
|
7796
|
+
};
|
|
7797
|
+
auto ptrObj =
|
|
7798
|
+
std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
|
|
7799
|
+
auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
|
|
7800
|
+
return jsi::Value(rt, obj);
|
|
7801
|
+
}
|
|
7373
7802
|
jsi::Value NativeBreezSdkSpark::
|
|
7374
7803
|
cpp_uniffi_internal_fn_method_sdkbuilder_ffi__bless_pointer(
|
|
7375
7804
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -7666,6 +8095,18 @@ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay(
|
|
|
7666
8095
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7667
8096
|
value);
|
|
7668
8097
|
}
|
|
8098
|
+
jsi::Value
|
|
8099
|
+
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_parse(
|
|
8100
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8101
|
+
size_t count) {
|
|
8102
|
+
auto value = uniffi_breez_sdk_spark_fn_method_breezsdk_parse(
|
|
8103
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
8104
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
8105
|
+
args[1]));
|
|
8106
|
+
|
|
8107
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
8108
|
+
value);
|
|
8109
|
+
}
|
|
7669
8110
|
jsi::Value NativeBreezSdkSpark::
|
|
7670
8111
|
cpp_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay(
|
|
7671
8112
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -7775,6 +8216,44 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7775
8216
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7776
8217
|
value);
|
|
7777
8218
|
}
|
|
8219
|
+
jsi::Value
|
|
8220
|
+
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_paymentobserver(
|
|
8221
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8222
|
+
size_t count) {
|
|
8223
|
+
RustCallStatus status =
|
|
8224
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
8225
|
+
auto value = uniffi_breez_sdk_spark_fn_clone_paymentobserver(
|
|
8226
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
|
|
8227
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
8228
|
+
rt, callInvoker, status, args[count - 1]);
|
|
8229
|
+
|
|
8230
|
+
return uniffi_jsi::Bridging<void *>::toJs(rt, callInvoker, value);
|
|
8231
|
+
}
|
|
8232
|
+
jsi::Value
|
|
8233
|
+
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_free_paymentobserver(
|
|
8234
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8235
|
+
size_t count) {
|
|
8236
|
+
RustCallStatus status =
|
|
8237
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
8238
|
+
uniffi_breez_sdk_spark_fn_free_paymentobserver(
|
|
8239
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]), &status);
|
|
8240
|
+
uniffi::breez_sdk_spark::Bridging<RustCallStatus>::copyIntoJs(
|
|
8241
|
+
rt, callInvoker, status, args[count - 1]);
|
|
8242
|
+
|
|
8243
|
+
return jsi::Value::undefined();
|
|
8244
|
+
}
|
|
8245
|
+
jsi::Value NativeBreezSdkSpark::
|
|
8246
|
+
cpp_uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send(
|
|
8247
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8248
|
+
size_t count) {
|
|
8249
|
+
auto value = uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send(
|
|
8250
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
8251
|
+
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
8252
|
+
args[1]));
|
|
8253
|
+
|
|
8254
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
8255
|
+
value);
|
|
8256
|
+
}
|
|
7778
8257
|
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_clone_sdkbuilder(
|
|
7779
8258
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
7780
8259
|
size_t count) {
|
|
@@ -7874,6 +8353,18 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
7874
8353
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
7875
8354
|
value);
|
|
7876
8355
|
}
|
|
8356
|
+
jsi::Value NativeBreezSdkSpark::
|
|
8357
|
+
cpp_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
|
|
8358
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8359
|
+
size_t count) {
|
|
8360
|
+
auto value =
|
|
8361
|
+
uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
|
|
8362
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[0]),
|
|
8363
|
+
uniffi_jsi::Bridging<void *>::fromJs(rt, callInvoker, args[1]));
|
|
8364
|
+
|
|
8365
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
8366
|
+
value);
|
|
8367
|
+
}
|
|
7877
8368
|
jsi::Value NativeBreezSdkSpark::
|
|
7878
8369
|
cpp_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_rest_chain_service(
|
|
7879
8370
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -8124,16 +8615,6 @@ jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_init_logging(
|
|
|
8124
8615
|
|
|
8125
8616
|
return jsi::Value::undefined();
|
|
8126
8617
|
}
|
|
8127
|
-
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_func_parse(
|
|
8128
|
-
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8129
|
-
size_t count) {
|
|
8130
|
-
auto value = uniffi_breez_sdk_spark_fn_func_parse(
|
|
8131
|
-
uniffi::breez_sdk_spark::Bridging<RustBuffer>::fromJs(rt, callInvoker,
|
|
8132
|
-
args[0]));
|
|
8133
|
-
|
|
8134
|
-
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker,
|
|
8135
|
-
value);
|
|
8136
|
-
}
|
|
8137
8618
|
jsi::Value NativeBreezSdkSpark::cpp_ffi_breez_sdk_spark_rust_future_poll_u8(
|
|
8138
8619
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8139
8620
|
size_t count) {
|
|
@@ -8782,13 +9263,6 @@ NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_checksum_func_init_logging(
|
|
|
8782
9263
|
|
|
8783
9264
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
8784
9265
|
}
|
|
8785
|
-
jsi::Value NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_checksum_func_parse(
|
|
8786
|
-
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
8787
|
-
size_t count) {
|
|
8788
|
-
auto value = uniffi_breez_sdk_spark_checksum_func_parse();
|
|
8789
|
-
|
|
8790
|
-
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
8791
|
-
}
|
|
8792
9266
|
jsi::Value NativeBreezSdkSpark::
|
|
8793
9267
|
cpp_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos(
|
|
8794
9268
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -8945,6 +9419,14 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
8945
9419
|
|
|
8946
9420
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
8947
9421
|
}
|
|
9422
|
+
jsi::Value
|
|
9423
|
+
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_parse(
|
|
9424
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
9425
|
+
size_t count) {
|
|
9426
|
+
auto value = uniffi_breez_sdk_spark_checksum_method_breezsdk_parse();
|
|
9427
|
+
|
|
9428
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
9429
|
+
}
|
|
8948
9430
|
jsi::Value NativeBreezSdkSpark::
|
|
8949
9431
|
cpp_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay(
|
|
8950
9432
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -9023,6 +9505,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
9023
9505
|
|
|
9024
9506
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
9025
9507
|
}
|
|
9508
|
+
jsi::Value NativeBreezSdkSpark::
|
|
9509
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send(
|
|
9510
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
9511
|
+
size_t count) {
|
|
9512
|
+
auto value =
|
|
9513
|
+
uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send();
|
|
9514
|
+
|
|
9515
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
9516
|
+
}
|
|
9026
9517
|
jsi::Value NativeBreezSdkSpark::
|
|
9027
9518
|
cpp_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build(
|
|
9028
9519
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -9066,6 +9557,15 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
9066
9557
|
|
|
9067
9558
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
9068
9559
|
}
|
|
9560
|
+
jsi::Value NativeBreezSdkSpark::
|
|
9561
|
+
cpp_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer(
|
|
9562
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
9563
|
+
size_t count) {
|
|
9564
|
+
auto value =
|
|
9565
|
+
uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer();
|
|
9566
|
+
|
|
9567
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
9568
|
+
}
|
|
9069
9569
|
jsi::Value NativeBreezSdkSpark::
|
|
9070
9570
|
cpp_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service(
|
|
9071
9571
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
@@ -9250,6 +9750,21 @@ jsi::Value NativeBreezSdkSpark::
|
|
|
9250
9750
|
"UniffiVTableCallbackInterfaceBitcoinChainService", vtableInstance));
|
|
9251
9751
|
return jsi::Value::undefined();
|
|
9252
9752
|
}
|
|
9753
|
+
jsi::Value NativeBreezSdkSpark::
|
|
9754
|
+
cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver(
|
|
9755
|
+
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|
|
9756
|
+
size_t count) {
|
|
9757
|
+
auto vtableInstance = uniffi::breez_sdk_spark::Bridging<
|
|
9758
|
+
UniffiVTableCallbackInterfacePaymentObserver>::fromJs(rt, callInvoker,
|
|
9759
|
+
args[0]);
|
|
9760
|
+
|
|
9761
|
+
std::lock_guard<std::mutex> lock(
|
|
9762
|
+
uniffi::breez_sdk_spark::registry::vtableMutex);
|
|
9763
|
+
uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver(
|
|
9764
|
+
uniffi::breez_sdk_spark::registry::putTable(
|
|
9765
|
+
"UniffiVTableCallbackInterfacePaymentObserver", vtableInstance));
|
|
9766
|
+
return jsi::Value::undefined();
|
|
9767
|
+
}
|
|
9253
9768
|
jsi::Value
|
|
9254
9769
|
NativeBreezSdkSpark::cpp_uniffi_breez_sdk_spark_fn_init_callback_vtable_storage(
|
|
9255
9770
|
jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
|