@secondts/bark-react-native 0.23.0 → 0.25.0

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.
@@ -457,6 +457,7 @@ extern "C" {
457
457
  /*handle*/ uint64_t uniffi_bark_ffi_fn_method_wallet_drain_exits(
458
458
  /*handle*/ uint64_t ptr,
459
459
  RustBuffer vtxo_ids,
460
+ int8_t drain_all,
460
461
  RustBuffer address,
461
462
  RustBuffer fee_rate_sat_per_vb
462
463
  );
@@ -543,7 +544,13 @@ extern "C" {
543
544
  );
544
545
  /*handle*/ uint64_t uniffi_bark_ffi_fn_method_wallet_import_vtxo(
545
546
  /*handle*/ uint64_t ptr,
546
- RustBuffer vtxo_base64
547
+ RustBuffer vtxo_base64,
548
+ RustBuffer args
549
+ );
550
+ /*handle*/ uint64_t uniffi_bark_ffi_fn_method_wallet_import_vtxos(
551
+ /*handle*/ uint64_t ptr,
552
+ RustBuffer encoded_vtxos,
553
+ RustBuffer args
547
554
  );
548
555
  /*handle*/ uint64_t uniffi_bark_ffi_fn_method_wallet_is_invoice_paid(
549
556
  /*handle*/ uint64_t ptr,
@@ -567,6 +574,7 @@ extern "C" {
567
574
  );
568
575
  RustBuffer uniffi_bark_ffi_fn_method_wallet_mailbox_authorization(
569
576
  /*handle*/ uint64_t ptr,
577
+ uint32_t expiry_secs,
570
578
  RustCallStatus *uniffi_out_err
571
579
  );
572
580
  RustBuffer uniffi_bark_ffi_fn_method_wallet_mailbox_identifier(
@@ -673,7 +681,8 @@ extern "C" {
673
681
  );
674
682
  /*handle*/ uint64_t uniffi_bark_ffi_fn_method_wallet_recover_vtxos(
675
683
  /*handle*/ uint64_t ptr,
676
- RustBuffer vtxo_ids
684
+ RustBuffer vtxo_ids,
685
+ RustBuffer gap_limit
677
686
  );
678
687
  RustBuffer uniffi_bark_ffi_fn_method_wallet_recovery_report(
679
688
  /*handle*/ uint64_t ptr,
@@ -776,12 +785,16 @@ extern "C" {
776
785
  /*handle*/ uint64_t uniffi_bark_ffi_fn_method_wallet_vtxos(
777
786
  /*handle*/ uint64_t ptr
778
787
  );
788
+ uint32_t uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit(RustCallStatus *uniffi_out_err
789
+ );
779
790
  RustBuffer uniffi_bark_ffi_fn_func_extract_tx_from_psbt(
780
791
  RustBuffer psbt_base64,
781
792
  RustCallStatus *uniffi_out_err
782
793
  );
783
794
  RustBuffer uniffi_bark_ffi_fn_func_generate_mnemonic(RustCallStatus *uniffi_out_err
784
795
  );
796
+ uint32_t uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit(RustCallStatus *uniffi_out_err
797
+ );
785
798
  int8_t uniffi_bark_ffi_fn_func_validate_ark_address(
786
799
  RustBuffer address,
787
800
  RustCallStatus *uniffi_out_err
@@ -999,10 +1012,14 @@ extern "C" {
999
1012
  /*handle*/ uint64_t handle,
1000
1013
  RustCallStatus *uniffi_out_err
1001
1014
  );
1015
+ uint16_t uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit(
1016
+ );
1002
1017
  uint16_t uniffi_bark_ffi_checksum_func_extract_tx_from_psbt(
1003
1018
  );
1004
1019
  uint16_t uniffi_bark_ffi_checksum_func_generate_mnemonic(
1005
1020
  );
1021
+ uint16_t uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit(
1022
+ );
1006
1023
  uint16_t uniffi_bark_ffi_checksum_func_validate_ark_address(
1007
1024
  );
1008
1025
  uint16_t uniffi_bark_ffi_checksum_func_validate_mnemonic(
@@ -1141,6 +1158,8 @@ extern "C" {
1141
1158
  );
1142
1159
  uint16_t uniffi_bark_ffi_checksum_method_wallet_import_vtxo(
1143
1160
  );
1161
+ uint16_t uniffi_bark_ffi_checksum_method_wallet_import_vtxos(
1162
+ );
1144
1163
  uint16_t uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid(
1145
1164
  );
1146
1165
  uint16_t uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state(
@@ -1331,18 +1350,58 @@ template <> struct Bridging<RustBuffer> {
1331
1350
  static RustBuffer fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
1332
1351
  const jsi::Value &value) {
1333
1352
  try {
1353
+ auto obj = value.asObject(rt);
1354
+
1355
+ // Adoption vs copy. Two kinds of view arrive here:
1356
+ //
1357
+ // * Library-owned views from `rustbuffer_alloc`. Codegen allocates one,
1358
+ // fills it in place, and ships it as an argument — and never frees a
1359
+ // lowered argument, while the view's backing `CMutableBuffer` is
1360
+ // non-owning (its destructor leaves `data` alone). Such a view carries
1361
+ // a capacity hint (stamped by `rustbuffer_alloc` in the wrapper). We
1362
+ // *adopt* it: hand the existing allocation to the callee, which frees
1363
+ // it. Copying instead would orphan the allocation and leak one whole
1364
+ // payload per call.
1365
+ // * Ordinary JS-owned arrays, which carry no hint. These are *copied*
1366
+ // into a fresh library allocation — they are not ours to give away.
1367
+ //
1368
+ // On adoption we reset the hint to 0 so a later `rustbuffer_free(view)` is
1369
+ // a no-op rather than a double free.
1370
+ if (obj.hasProperty(rt, uniffi_jsi::kUbrnRustCapacity)) {
1371
+ auto capacity = static_cast<uint64_t>(
1372
+ obj.getProperty(rt, uniffi_jsi::kUbrnRustCapacity).asNumber());
1373
+ if (capacity == 0) {
1374
+ // Hint present but zeroed: the view was already adopted by a previous
1375
+ // call and its memory has been freed. Reading it would be a
1376
+ // use-after-free, so refuse rather than hand over a dangling pointer.
1377
+ throw jsi::JSError(
1378
+ rt,
1379
+ "RustBuffer argument was already consumed by a previous FFI call");
1380
+ }
1381
+ auto arrayBuffer =
1382
+ obj.getPropertyAsObject(rt, "buffer").getArrayBuffer(rt);
1383
+ auto byteOffset =
1384
+ static_cast<size_t>(obj.getProperty(rt, "byteOffset").asNumber());
1385
+ auto byteLength =
1386
+ static_cast<size_t>(obj.getProperty(rt, "byteLength").asNumber());
1387
+ obj.setProperty(rt, uniffi_jsi::kUbrnRustCapacity, jsi::Value(0));
1388
+ return RustBuffer{
1389
+ .capacity = capacity,
1390
+ .len = static_cast<uint64_t>(byteLength),
1391
+ .data = arrayBuffer.data(rt) + byteOffset,
1392
+ };
1393
+ }
1394
+
1334
1395
  auto buffer = uniffi_jsi::Bridging<jsi::ArrayBuffer>::value_to_arraybuffer(rt, value);
1335
1396
  auto bytes = ForeignBytes{
1336
1397
  .len = static_cast<int32_t>(buffer.length(rt)),
1337
1398
  .data = buffer.data(rt),
1338
1399
  };
1339
1400
 
1340
- // This buffer is constructed from foreign bytes. Rust scaffolding copies
1341
- // the bytes, to make the RustBuffer.
1401
+ // No hint: an ordinary JS-owned array. Rust scaffolding copies the bytes
1402
+ // to make the RustBuffer; the copy is destroyed when the callee
1403
+ // deserializes its arguments.
1342
1404
  auto buf = rustbuffer_from_bytes(bytes);
1343
- // Once it leaves this function, the buffer is immediately passed back
1344
- // into Rust, where it's used to deserialize into the Rust versions of the
1345
- // arguments. At that point, the copy is destroyed.
1346
1405
  return buf;
1347
1406
  } catch (const std::logic_error &e) {
1348
1407
  throw jsi::JSError(rt, e.what());
@@ -1351,24 +1410,31 @@ template <> struct Bridging<RustBuffer> {
1351
1410
 
1352
1411
  static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
1353
1412
  RustBuffer buf) {
1354
- // We need to make a copy of the bytes from Rust's memory space into
1355
- // Javascripts memory space. We need to do this because the two languages
1356
- // manages memory very differently: a garbage collector needs to track all
1357
- // the memory at runtime, Rust is doing it all closer to compile time.
1358
- uint8_t *bytes = new uint8_t[buf.len];
1359
- std::memcpy(bytes, buf.data, buf.len);
1360
-
1361
- // Construct an ArrayBuffer with copy of the bytes from the RustBuffer.
1413
+ // View-handoff: hand JS a `Uint8Array` view aliasing the Rust-owned bytes
1414
+ // (no boundary copy). The single mandatory copy now happens inside
1415
+ // `converter.lift(view)` (string decode, byte-array `set`, field-by-field
1416
+ // record reads). The codegen-emitted try/finally calls `rustbuffer_free`
1417
+ // on the view after `lift` returns, releasing the Rust allocation.
1418
+ //
1419
+ // Capacity hint: Rust may return a buffer where `capacity > len`. The
1420
+ // view's `byteLength` is `len` (so converters that decode the whole view
1421
+ // see only the message bytes), but `rustbuffer_free` needs `capacity` to
1422
+ // free correctly. We stash `capacity` on the view via a string-keyed
1423
+ // property when it differs from `len`; the JSI `rustbufferFree` host
1424
+ // function reads it back and falls back to `byteLength` for views from
1425
+ // `rustbufferAlloc(n)` where `byteLength == capacity` already.
1426
+ //
1427
+ // CMutableBuffer is non-owning here: its destructor leaves `buf.data`
1428
+ // alone. Only the codegen-emitted `rustbuffer_free` path frees it.
1362
1429
  auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
1363
- uniffi_jsi::CMutableBuffer((uint8_t *)bytes, buf.len));
1364
- auto arrayBuffer = jsi::ArrayBuffer(rt, payload);
1365
-
1366
- // Once we have a Javascript version, we no longer need the Rust version, so
1367
- // we can call into Rust to tell it it's okay to free that memory.
1368
- rustbuffer_free(buf);
1369
-
1370
- // Finally, return the ArrayBuffer.
1371
- return uniffi_jsi::Bridging<jsi::ArrayBuffer>::arraybuffer_to_value(rt, arrayBuffer);;
1430
+ buf.data, static_cast<size_t>(buf.len));
1431
+ auto view = uniffi_jsi::arraybufferToUint8Array(
1432
+ rt, jsi::ArrayBuffer(rt, payload));
1433
+ if (buf.capacity != static_cast<uint64_t>(buf.len)) {
1434
+ view.setProperty(rt, uniffi_jsi::kUbrnRustCapacity,
1435
+ jsi::Value(static_cast<double>(buf.capacity)));
1436
+ }
1437
+ return jsi::Value(rt, view);
1372
1438
  }
1373
1439
  };
1374
1440
 
@@ -1393,9 +1459,22 @@ template <> struct Bridging<RustCallStatus> {
1393
1459
  const jsi::Value &jsStatus) {
1394
1460
  auto statusObject = jsStatus.asObject(rt);
1395
1461
  if (status.error_buf.data != nullptr) {
1396
- auto rbuf = Bridging<RustBuffer>::toJs(rt, callInvoker,
1397
- status.error_buf);
1398
- statusObject.setProperty(rt, "errorBuf", rbuf);
1462
+ // The error path is NOT wrapped in the codegen-emitted try/finally that
1463
+ // covers normal returns: `errorBuf` is read by the runtime's call-status
1464
+ // dispatcher (rust-call.ts) which throws straight to the user without
1465
+ // ever calling `rustbuffer_free`. Switching this site to view-handoff
1466
+ // would leak the Rust allocation, so we keep the copy semantics here:
1467
+ // copy the bytes into a JS-owned ArrayBuffer and free the Rust buffer
1468
+ // immediately. The errorBuf is small (a serialized error variant) and
1469
+ // only allocated on the cold error path, so the boundary copy is cheap.
1470
+ auto len = static_cast<size_t>(status.error_buf.len);
1471
+ uint8_t *bytes = new uint8_t[len];
1472
+ std::memcpy(bytes, status.error_buf.data, len);
1473
+ auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(bytes, len);
1474
+ auto view = uniffi_jsi::arraybufferToUint8Array(
1475
+ rt, jsi::ArrayBuffer(rt, payload));
1476
+ statusObject.setProperty(rt, "errorBuf", view);
1477
+ Bridging<RustBuffer>::rustbuffer_free(status.error_buf);
1399
1478
  }
1400
1479
  if (status.code != UNIFFI_CALL_STATUS_OK) {
1401
1480
  auto code =
@@ -2015,11 +2094,11 @@ template <> struct Bridging<UniffiForeignFutureResultU8> {
2015
2094
  // Create the vtable from the js callbacks.
2016
2095
  rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
2017
2096
  rt, callInvoker,
2018
- jsObject.getProperty(rt, "returnValue")
2097
+ jsObject.getProperty(rt, "return_value")
2019
2098
  );
2020
2099
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2021
2100
  rt, callInvoker,
2022
- jsObject.getProperty(rt, "callStatus")
2101
+ jsObject.getProperty(rt, "call_status")
2023
2102
  );
2024
2103
 
2025
2104
  return rsObject;
@@ -2089,11 +2168,11 @@ template <> struct Bridging<UniffiForeignFutureResultI8> {
2089
2168
  // Create the vtable from the js callbacks.
2090
2169
  rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
2091
2170
  rt, callInvoker,
2092
- jsObject.getProperty(rt, "returnValue")
2171
+ jsObject.getProperty(rt, "return_value")
2093
2172
  );
2094
2173
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2095
2174
  rt, callInvoker,
2096
- jsObject.getProperty(rt, "callStatus")
2175
+ jsObject.getProperty(rt, "call_status")
2097
2176
  );
2098
2177
 
2099
2178
  return rsObject;
@@ -2163,11 +2242,11 @@ template <> struct Bridging<UniffiForeignFutureResultU16> {
2163
2242
  // Create the vtable from the js callbacks.
2164
2243
  rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
2165
2244
  rt, callInvoker,
2166
- jsObject.getProperty(rt, "returnValue")
2245
+ jsObject.getProperty(rt, "return_value")
2167
2246
  );
2168
2247
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2169
2248
  rt, callInvoker,
2170
- jsObject.getProperty(rt, "callStatus")
2249
+ jsObject.getProperty(rt, "call_status")
2171
2250
  );
2172
2251
 
2173
2252
  return rsObject;
@@ -2237,11 +2316,11 @@ template <> struct Bridging<UniffiForeignFutureResultI16> {
2237
2316
  // Create the vtable from the js callbacks.
2238
2317
  rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
2239
2318
  rt, callInvoker,
2240
- jsObject.getProperty(rt, "returnValue")
2319
+ jsObject.getProperty(rt, "return_value")
2241
2320
  );
2242
2321
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2243
2322
  rt, callInvoker,
2244
- jsObject.getProperty(rt, "callStatus")
2323
+ jsObject.getProperty(rt, "call_status")
2245
2324
  );
2246
2325
 
2247
2326
  return rsObject;
@@ -2311,11 +2390,11 @@ template <> struct Bridging<UniffiForeignFutureResultU32> {
2311
2390
  // Create the vtable from the js callbacks.
2312
2391
  rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
2313
2392
  rt, callInvoker,
2314
- jsObject.getProperty(rt, "returnValue")
2393
+ jsObject.getProperty(rt, "return_value")
2315
2394
  );
2316
2395
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2317
2396
  rt, callInvoker,
2318
- jsObject.getProperty(rt, "callStatus")
2397
+ jsObject.getProperty(rt, "call_status")
2319
2398
  );
2320
2399
 
2321
2400
  return rsObject;
@@ -2385,11 +2464,11 @@ template <> struct Bridging<UniffiForeignFutureResultI32> {
2385
2464
  // Create the vtable from the js callbacks.
2386
2465
  rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
2387
2466
  rt, callInvoker,
2388
- jsObject.getProperty(rt, "returnValue")
2467
+ jsObject.getProperty(rt, "return_value")
2389
2468
  );
2390
2469
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2391
2470
  rt, callInvoker,
2392
- jsObject.getProperty(rt, "callStatus")
2471
+ jsObject.getProperty(rt, "call_status")
2393
2472
  );
2394
2473
 
2395
2474
  return rsObject;
@@ -2459,11 +2538,11 @@ template <> struct Bridging<UniffiForeignFutureResultU64> {
2459
2538
  // Create the vtable from the js callbacks.
2460
2539
  rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
2461
2540
  rt, callInvoker,
2462
- jsObject.getProperty(rt, "returnValue")
2541
+ jsObject.getProperty(rt, "return_value")
2463
2542
  );
2464
2543
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2465
2544
  rt, callInvoker,
2466
- jsObject.getProperty(rt, "callStatus")
2545
+ jsObject.getProperty(rt, "call_status")
2467
2546
  );
2468
2547
 
2469
2548
  return rsObject;
@@ -2533,11 +2612,11 @@ template <> struct Bridging<UniffiForeignFutureResultI64> {
2533
2612
  // Create the vtable from the js callbacks.
2534
2613
  rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
2535
2614
  rt, callInvoker,
2536
- jsObject.getProperty(rt, "returnValue")
2615
+ jsObject.getProperty(rt, "return_value")
2537
2616
  );
2538
2617
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2539
2618
  rt, callInvoker,
2540
- jsObject.getProperty(rt, "callStatus")
2619
+ jsObject.getProperty(rt, "call_status")
2541
2620
  );
2542
2621
 
2543
2622
  return rsObject;
@@ -2607,11 +2686,11 @@ template <> struct Bridging<UniffiForeignFutureResultF32> {
2607
2686
  // Create the vtable from the js callbacks.
2608
2687
  rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
2609
2688
  rt, callInvoker,
2610
- jsObject.getProperty(rt, "returnValue")
2689
+ jsObject.getProperty(rt, "return_value")
2611
2690
  );
2612
2691
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2613
2692
  rt, callInvoker,
2614
- jsObject.getProperty(rt, "callStatus")
2693
+ jsObject.getProperty(rt, "call_status")
2615
2694
  );
2616
2695
 
2617
2696
  return rsObject;
@@ -2681,11 +2760,11 @@ template <> struct Bridging<UniffiForeignFutureResultF64> {
2681
2760
  // Create the vtable from the js callbacks.
2682
2761
  rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
2683
2762
  rt, callInvoker,
2684
- jsObject.getProperty(rt, "returnValue")
2763
+ jsObject.getProperty(rt, "return_value")
2685
2764
  );
2686
2765
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2687
2766
  rt, callInvoker,
2688
- jsObject.getProperty(rt, "callStatus")
2767
+ jsObject.getProperty(rt, "call_status")
2689
2768
  );
2690
2769
 
2691
2770
  return rsObject;
@@ -2755,11 +2834,11 @@ template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
2755
2834
  // Create the vtable from the js callbacks.
2756
2835
  rsObject.return_value = uniffi::bark::Bridging<RustBuffer>::fromJs(
2757
2836
  rt, callInvoker,
2758
- jsObject.getProperty(rt, "returnValue")
2837
+ jsObject.getProperty(rt, "return_value")
2759
2838
  );
2760
2839
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2761
2840
  rt, callInvoker,
2762
- jsObject.getProperty(rt, "callStatus")
2841
+ jsObject.getProperty(rt, "call_status")
2763
2842
  );
2764
2843
 
2765
2844
  return rsObject;
@@ -2829,7 +2908,7 @@ template <> struct Bridging<UniffiForeignFutureResultVoid> {
2829
2908
  // Create the vtable from the js callbacks.
2830
2909
  rsObject.call_status = uniffi::bark::Bridging<RustCallStatus>::fromJs(
2831
2910
  rt, callInvoker,
2832
- jsObject.getProperty(rt, "callStatus")
2911
+ jsObject.getProperty(rt, "call_status")
2833
2912
  );
2834
2913
 
2835
2914
  return rsObject;
@@ -4382,37 +4461,37 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceCustomOnchainWalletCall
4382
4461
 
4383
4462
  // Create the vtable from the js callbacks.
4384
4463
  rsObject.uniffi_free = uniffi::bark::st::vtablecallbackinterfacecustomonchainwalletcallbacks::vtablecallbackinterfacecustomonchainwalletcallbacks::free::makeCallbackFunction(
4385
- rt, callInvoker, jsObject.getProperty(rt, "uniffiFree")
4464
+ rt, callInvoker, jsObject.getProperty(rt, "uniffi_free")
4386
4465
  );
4387
4466
  rsObject.uniffi_clone = uniffi::bark::cb::callbackinterfaceclone::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4388
- rt, callInvoker, jsObject.getProperty(rt, "uniffiClone")
4467
+ rt, callInvoker, jsObject.getProperty(rt, "uniffi_clone")
4389
4468
  );
4390
4469
  rsObject.get_balance = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod0::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4391
- rt, callInvoker, jsObject.getProperty(rt, "getBalance")
4470
+ rt, callInvoker, jsObject.getProperty(rt, "get_balance")
4392
4471
  );
4393
4472
  rsObject.prepare_tx = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod1::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4394
- rt, callInvoker, jsObject.getProperty(rt, "prepareTx")
4473
+ rt, callInvoker, jsObject.getProperty(rt, "prepare_tx")
4395
4474
  );
4396
4475
  rsObject.prepare_drain_tx = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod2::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4397
- rt, callInvoker, jsObject.getProperty(rt, "prepareDrainTx")
4476
+ rt, callInvoker, jsObject.getProperty(rt, "prepare_drain_tx")
4398
4477
  );
4399
4478
  rsObject.finish_psbt = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod3::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4400
- rt, callInvoker, jsObject.getProperty(rt, "finishPsbt")
4479
+ rt, callInvoker, jsObject.getProperty(rt, "finish_psbt")
4401
4480
  );
4402
4481
  rsObject.is_mine = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod4::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4403
- rt, callInvoker, jsObject.getProperty(rt, "isMine")
4482
+ rt, callInvoker, jsObject.getProperty(rt, "is_mine")
4404
4483
  );
4405
4484
  rsObject.register_tx = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod5::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4406
- rt, callInvoker, jsObject.getProperty(rt, "registerTx")
4485
+ rt, callInvoker, jsObject.getProperty(rt, "register_tx")
4407
4486
  );
4408
4487
  rsObject.evict_tx = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod6::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4409
- rt, callInvoker, jsObject.getProperty(rt, "evictTx")
4488
+ rt, callInvoker, jsObject.getProperty(rt, "evict_tx")
4410
4489
  );
4411
4490
  rsObject.make_signed_p2a_cpfp = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod7::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4412
- rt, callInvoker, jsObject.getProperty(rt, "makeSignedP2aCpfp")
4491
+ rt, callInvoker, jsObject.getProperty(rt, "make_signed_p2a_cpfp")
4413
4492
  );
4414
4493
  rsObject.store_signed_p2a_cpfp = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod8::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4415
- rt, callInvoker, jsObject.getProperty(rt, "storeSignedP2aCpfp")
4494
+ rt, callInvoker, jsObject.getProperty(rt, "store_signed_p2a_cpfp")
4416
4495
  );
4417
4496
  rsObject.sync = uniffi::bark::cb::callbackinterfacecustomonchainwalletcallbacksmethod9::vtablecallbackinterfacecustomonchainwalletcallbacks::makeCallbackFunction(
4418
4497
  rt, callInvoker, jsObject.getProperty(rt, "sync")
@@ -4712,10 +4791,10 @@ template <> struct Bridging<UniffiVTableCallbackInterfaceBarkLogger> {
4712
4791
 
4713
4792
  // Create the vtable from the js callbacks.
4714
4793
  rsObject.uniffi_free = uniffi::bark::st::vtablecallbackinterfacebarklogger::vtablecallbackinterfacebarklogger::free::makeCallbackFunction(
4715
- rt, callInvoker, jsObject.getProperty(rt, "uniffiFree")
4794
+ rt, callInvoker, jsObject.getProperty(rt, "uniffi_free")
4716
4795
  );
4717
4796
  rsObject.uniffi_clone = uniffi::bark::cb::callbackinterfaceclone::vtablecallbackinterfacebarklogger::makeCallbackFunction(
4718
- rt, callInvoker, jsObject.getProperty(rt, "uniffiClone")
4797
+ rt, callInvoker, jsObject.getProperty(rt, "uniffi_clone")
4719
4798
  );
4720
4799
  rsObject.log = uniffi::bark::cb::callbackinterfacebarkloggermethod0::vtablecallbackinterfacebarklogger::makeCallbackFunction(
4721
4800
  rt, callInvoker, jsObject.getProperty(rt, "log")
@@ -4765,20 +4844,28 @@ NativeBark::NativeBark(
4765
4844
  return this->cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(rt, thisVal, args, count);
4766
4845
  }
4767
4846
  );
4768
- props["ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"] = jsi::Function::createFromHostFunction(
4847
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_buffer"] = jsi::Function::createFromHostFunction(
4769
4848
  rt,
4770
- jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"),
4849
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_buffer"),
4771
4850
  1,
4772
4851
  [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
4773
- return this->cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(rt, thisVal, args, count);
4852
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_buffer(rt, thisVal, args, count);
4774
4853
  }
4775
4854
  );
4776
- props["ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"] = jsi::Function::createFromHostFunction(
4855
+ props["ubrn_uniffi_internal_fn_func_ffi__string_from_buffer"] = jsi::Function::createFromHostFunction(
4777
4856
  rt,
4778
- jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"),
4857
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_from_buffer"),
4779
4858
  1,
4780
4859
  [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
4781
- return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(rt, thisVal, args, count);
4860
+ return this->cpp_uniffi_internal_fn_func_ffi__string_from_buffer(rt, thisVal, args, count);
4861
+ }
4862
+ );
4863
+ props["ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer"] = jsi::Function::createFromHostFunction(
4864
+ rt,
4865
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer"),
4866
+ 3,
4867
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
4868
+ return this->cpp_uniffi_internal_fn_func_ffi__read_string_from_buffer(rt, thisVal, args, count);
4782
4869
  }
4783
4870
  );
4784
4871
  props["ubrn_uniffi_bark_ffi_fn_clone_notificationholder"] = jsi::Function::createFromHostFunction(
@@ -5248,7 +5335,7 @@ NativeBark::NativeBark(
5248
5335
  props["ubrn_uniffi_bark_ffi_fn_method_wallet_drain_exits"] = jsi::Function::createFromHostFunction(
5249
5336
  rt,
5250
5337
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_wallet_drain_exits"),
5251
- 4,
5338
+ 5,
5252
5339
  [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
5253
5340
  return this->cpp_uniffi_bark_ffi_fn_method_wallet_drain_exits(rt, thisVal, args, count);
5254
5341
  }
@@ -5416,11 +5503,19 @@ NativeBark::NativeBark(
5416
5503
  props["ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxo"] = jsi::Function::createFromHostFunction(
5417
5504
  rt,
5418
5505
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxo"),
5419
- 2,
5506
+ 3,
5420
5507
  [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
5421
5508
  return this->cpp_uniffi_bark_ffi_fn_method_wallet_import_vtxo(rt, thisVal, args, count);
5422
5509
  }
5423
5510
  );
5511
+ props["ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxos"] = jsi::Function::createFromHostFunction(
5512
+ rt,
5513
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxos"),
5514
+ 3,
5515
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
5516
+ return this->cpp_uniffi_bark_ffi_fn_method_wallet_import_vtxos(rt, thisVal, args, count);
5517
+ }
5518
+ );
5424
5519
  props["ubrn_uniffi_bark_ffi_fn_method_wallet_is_invoice_paid"] = jsi::Function::createFromHostFunction(
5425
5520
  rt,
5426
5521
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_wallet_is_invoice_paid"),
@@ -5464,7 +5559,7 @@ NativeBark::NativeBark(
5464
5559
  props["ubrn_uniffi_bark_ffi_fn_method_wallet_mailbox_authorization"] = jsi::Function::createFromHostFunction(
5465
5560
  rt,
5466
5561
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_wallet_mailbox_authorization"),
5467
- 1,
5562
+ 2,
5468
5563
  [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
5469
5564
  return this->cpp_uniffi_bark_ffi_fn_method_wallet_mailbox_authorization(rt, thisVal, args, count);
5470
5565
  }
@@ -5688,7 +5783,7 @@ NativeBark::NativeBark(
5688
5783
  props["ubrn_uniffi_bark_ffi_fn_method_wallet_recover_vtxos"] = jsi::Function::createFromHostFunction(
5689
5784
  rt,
5690
5785
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_wallet_recover_vtxos"),
5691
- 2,
5786
+ 3,
5692
5787
  [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
5693
5788
  return this->cpp_uniffi_bark_ffi_fn_method_wallet_recover_vtxos(rt, thisVal, args, count);
5694
5789
  }
@@ -5909,6 +6004,14 @@ NativeBark::NativeBark(
5909
6004
  return this->cpp_uniffi_bark_ffi_fn_method_wallet_vtxos(rt, thisVal, args, count);
5910
6005
  }
5911
6006
  );
6007
+ props["ubrn_uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit"] = jsi::Function::createFromHostFunction(
6008
+ rt,
6009
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit"),
6010
+ 0,
6011
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
6012
+ return this->cpp_uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit(rt, thisVal, args, count);
6013
+ }
6014
+ );
5912
6015
  props["ubrn_uniffi_bark_ffi_fn_func_extract_tx_from_psbt"] = jsi::Function::createFromHostFunction(
5913
6016
  rt,
5914
6017
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_func_extract_tx_from_psbt"),
@@ -5925,6 +6028,14 @@ NativeBark::NativeBark(
5925
6028
  return this->cpp_uniffi_bark_ffi_fn_func_generate_mnemonic(rt, thisVal, args, count);
5926
6029
  }
5927
6030
  );
6031
+ props["ubrn_uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit"] = jsi::Function::createFromHostFunction(
6032
+ rt,
6033
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit"),
6034
+ 0,
6035
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
6036
+ return this->cpp_uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit(rt, thisVal, args, count);
6037
+ }
6038
+ );
5928
6039
  props["ubrn_uniffi_bark_ffi_fn_func_validate_ark_address"] = jsi::Function::createFromHostFunction(
5929
6040
  rt,
5930
6041
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_func_validate_ark_address"),
@@ -6341,6 +6452,14 @@ NativeBark::NativeBark(
6341
6452
  return this->cpp_ffi_bark_ffi_rust_future_complete_void(rt, thisVal, args, count);
6342
6453
  }
6343
6454
  );
6455
+ props["ubrn_uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit"] = jsi::Function::createFromHostFunction(
6456
+ rt,
6457
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit"),
6458
+ 0,
6459
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
6460
+ return this->cpp_uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit(rt, thisVal, args, count);
6461
+ }
6462
+ );
6344
6463
  props["ubrn_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt"] = jsi::Function::createFromHostFunction(
6345
6464
  rt,
6346
6465
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt"),
@@ -6357,6 +6476,14 @@ NativeBark::NativeBark(
6357
6476
  return this->cpp_uniffi_bark_ffi_checksum_func_generate_mnemonic(rt, thisVal, args, count);
6358
6477
  }
6359
6478
  );
6479
+ props["ubrn_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit"] = jsi::Function::createFromHostFunction(
6480
+ rt,
6481
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit"),
6482
+ 0,
6483
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
6484
+ return this->cpp_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit(rt, thisVal, args, count);
6485
+ }
6486
+ );
6360
6487
  props["ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address"] = jsi::Function::createFromHostFunction(
6361
6488
  rt,
6362
6489
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address"),
@@ -6909,6 +7036,14 @@ NativeBark::NativeBark(
6909
7036
  return this->cpp_uniffi_bark_ffi_checksum_method_wallet_import_vtxo(rt, thisVal, args, count);
6910
7037
  }
6911
7038
  );
7039
+ props["ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxos"] = jsi::Function::createFromHostFunction(
7040
+ rt,
7041
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxos"),
7042
+ 0,
7043
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
7044
+ return this->cpp_uniffi_bark_ffi_checksum_method_wallet_import_vtxos(rt, thisVal, args, count);
7045
+ }
7046
+ );
6912
7047
  props["ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid"] = jsi::Function::createFromHostFunction(
6913
7048
  rt,
6914
7049
  jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid"),
@@ -7469,6 +7604,101 @@ NativeBark::NativeBark(
7469
7604
  return this->cpp_uniffi_internal_fn_method_wallet_ffi__bless_pointer(rt, thisVal, args, count);
7470
7605
  }
7471
7606
  );
7607
+
7608
+ // `rustbuffer_alloc(n)` -> Uint8Array view over Rust-owned memory of capacity `n`.
7609
+ // `rustbuffer_free(view)` -> hands the underlying (ptr, capacity) back to the
7610
+ // crate's `rustbuffer_free`. Together they let JS allocate buffers that the
7611
+ // codegen-emitted lowering path can fill in place and ship to Rust without copying.
7612
+ props["rustbuffer_alloc"] = jsi::Function::createFromHostFunction(
7613
+ rt,
7614
+ jsi::PropNameID::forAscii(rt, "rustbuffer_alloc"),
7615
+ 1,
7616
+ [](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
7617
+ if (count < 1 || !args[0].isNumber()) {
7618
+ throw jsi::JSError(rt, "rustbuffer_alloc expected a number argument");
7619
+ }
7620
+ double size = args[0].asNumber();
7621
+ if (size < 0) {
7622
+ throw jsi::JSError(rt, "rustbuffer_alloc: size must be non-negative");
7623
+ }
7624
+ if (size > INT32_MAX) {
7625
+ throw jsi::JSError(rt, "rustbuffer_alloc: size exceeds INT32_MAX");
7626
+ }
7627
+ auto rb = uniffi::bark::Bridging<RustBuffer>::rustbuffer_alloc(static_cast<int32_t>(size));
7628
+ if (rb.data == nullptr) {
7629
+ throw jsi::JSError(rt, "rustbuffer_alloc failed: alloc returned null");
7630
+ }
7631
+ // Non-owning view over Rust-allocated memory; CMutableBuffer's destructor
7632
+ // is the default and does not free `rb.data`. The allocation is released
7633
+ // either by an explicit `rustbuffer_free(view)` or by being adopted when
7634
+ // the view is lowered as an FFI argument.
7635
+ auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
7636
+ rb.data, static_cast<size_t>(rb.capacity));
7637
+ // Wrap as Uint8Array so JS can index/assign bytes directly.
7638
+ auto view = uniffi_jsi::arraybufferToUint8Array(
7639
+ rt, jsi::ArrayBuffer(rt, payload));
7640
+ // Stamp the capacity so the argument-lowering path
7641
+ // (`Bridging<RustBuffer>::fromJs`) recognises this view as
7642
+ // library-owned and adopts the allocation instead of copying it.
7643
+ // Without the stamp, a lowered argument is copied and this
7644
+ // allocation is orphaned — one leaked payload per call.
7645
+ if (rb.capacity > 0) {
7646
+ view.setProperty(rt, uniffi_jsi::kUbrnRustCapacity,
7647
+ jsi::Value(static_cast<double>(rb.capacity)));
7648
+ }
7649
+ return jsi::Value(rt, view);
7650
+ }
7651
+ );
7652
+
7653
+ props["rustbuffer_free"] = jsi::Function::createFromHostFunction(
7654
+ rt,
7655
+ jsi::PropNameID::forAscii(rt, "rustbuffer_free"),
7656
+ 1,
7657
+ [](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
7658
+ if (count < 1 || !args[0].isObject()) {
7659
+ throw jsi::JSError(rt, "rustbuffer_free expected a Uint8Array argument");
7660
+ }
7661
+ auto view = args[0].asObject(rt);
7662
+ auto byteLength =
7663
+ static_cast<size_t>(view.getProperty(rt, "byteLength").asNumber());
7664
+ // Empty views were never allocated by `rustbuffer_alloc`; nothing
7665
+ // to free. Bail out before reading buffer/byteOffset/capacity to
7666
+ // skip three JSI property traversals on the empty path.
7667
+ if (byteLength == 0) {
7668
+ return jsi::Value::undefined();
7669
+ }
7670
+ // Capacity resolution:
7671
+ // * For a view from `rustbuffer_alloc(n)`, `byteLength == n == capacity`,
7672
+ // and no `__ubrnRustCapacity` hint was set.
7673
+ // * For a view from a lift-handoff, the codegen-emitted
7674
+ // `Bridging<RustBuffer>::toJs` set `byteLength = len` and stashed
7675
+ // the original `capacity` on `__ubrnRustCapacity` whenever
7676
+ // `capacity != len`.
7677
+ // So: prefer the hint, fall back to byteLength.
7678
+ size_t capacity = byteLength;
7679
+ if (view.hasProperty(rt, uniffi_jsi::kUbrnRustCapacity)) {
7680
+ capacity = static_cast<size_t>(
7681
+ view.getProperty(rt, uniffi_jsi::kUbrnRustCapacity).asNumber());
7682
+ }
7683
+ // A zero capacity marks a view already adopted as an FFI argument
7684
+ // (its hint was reset to 0) and freed by the callee. Freeing again
7685
+ // would be a double free, so this is a no-op.
7686
+ if (capacity == 0) {
7687
+ return jsi::Value::undefined();
7688
+ }
7689
+ auto buffer = view.getPropertyAsObject(rt, "buffer").getArrayBuffer(rt);
7690
+ auto byteOffset =
7691
+ static_cast<size_t>(view.getProperty(rt, "byteOffset").asNumber());
7692
+ // Honour byteOffset for safety (defensive; currently always 0).
7693
+ RustBuffer rb {
7694
+ .capacity = static_cast<uint64_t>(capacity),
7695
+ .len = 0,
7696
+ .data = buffer.data(rt) + byteOffset,
7697
+ };
7698
+ uniffi::bark::Bridging<RustBuffer>::rustbuffer_free(rb);
7699
+ return jsi::Value::undefined();
7700
+ }
7701
+ );
7472
7702
  }
7473
7703
 
7474
7704
  void NativeBark::registerModule(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker) {
@@ -7486,7 +7716,7 @@ jsi::Value NativeBark::get(jsi::Runtime& rt, const jsi::PropNameID& name) {
7486
7716
  try {
7487
7717
  return jsi::Value(rt, props.at(name.utf8(rt)));
7488
7718
  }
7489
- catch (std::out_of_range &e) {
7719
+ catch (std::out_of_range &) {
7490
7720
  return jsi::Value::undefined();
7491
7721
  }
7492
7722
  }
@@ -7530,12 +7760,16 @@ jsi::Value NativeBark::cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(js
7530
7760
  return uniffi_jsi::Bridging<std::string>::string_to_bytelength(rt, args[0]);
7531
7761
  }
7532
7762
 
7533
- jsi::Value NativeBark::cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
7534
- return uniffi_jsi::Bridging<std::string>::string_to_arraybuffer(rt, args[0]);
7763
+ jsi::Value NativeBark::cpp_uniffi_internal_fn_func_ffi__string_to_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
7764
+ return uniffi_jsi::Bridging<std::string>::string_to_buffer(rt, args[0]);
7535
7765
  }
7536
7766
 
7537
- jsi::Value NativeBark::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
7538
- return uniffi_jsi::Bridging<std::string>::arraybuffer_to_string(rt, args[0]);
7767
+ jsi::Value NativeBark::cpp_uniffi_internal_fn_func_ffi__string_from_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
7768
+ return uniffi_jsi::Bridging<std::string>::string_from_buffer(rt, args[0]);
7769
+ }
7770
+
7771
+ jsi::Value NativeBark::cpp_uniffi_internal_fn_func_ffi__read_string_from_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
7772
+ return uniffi_jsi::Bridging<std::string>::read_string_from_buffer(rt, args[0], args[1], args[2]);
7539
7773
  }jsi::Value NativeBark::cpp_uniffi_internal_fn_method_notificationholder_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
7540
7774
  auto pointer = uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
7541
7775
  auto static destructor = [](uint64_t p) {
@@ -8080,7 +8314,7 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_config(jsi::Runtime&
8080
8314
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
8081
8315
  }
8082
8316
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_drain_exits(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8083
- auto value = uniffi_bark_ffi_fn_method_wallet_drain_exits(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[3])
8317
+ auto value = uniffi_bark_ffi_fn_method_wallet_drain_exits(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[2]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[3]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[4])
8084
8318
  );
8085
8319
 
8086
8320
 
@@ -8230,7 +8464,14 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_history_by_payment_m
8230
8464
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
8231
8465
  }
8232
8466
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_import_vtxo(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8233
- auto value = uniffi_bark_ffi_fn_method_wallet_import_vtxo(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1])
8467
+ auto value = uniffi_bark_ffi_fn_method_wallet_import_vtxo(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2])
8468
+ );
8469
+
8470
+
8471
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
8472
+ }
8473
+ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_import_vtxos(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8474
+ auto value = uniffi_bark_ffi_fn_method_wallet_import_vtxos(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2])
8234
8475
  );
8235
8476
 
8236
8477
 
@@ -8273,7 +8514,7 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_lock_vtxos(jsi::Runt
8273
8514
  }
8274
8515
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_mailbox_authorization(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8275
8516
  RustCallStatus status = uniffi::bark::Bridging<RustCallStatus>::rustSuccess(rt);
8276
- auto value = uniffi_bark_ffi_fn_method_wallet_mailbox_authorization(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
8517
+ auto value = uniffi_bark_ffi_fn_method_wallet_mailbox_authorization(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi_jsi::Bridging<uint32_t>::fromJs(rt, callInvoker, args[1]),
8277
8518
  &status
8278
8519
  );
8279
8520
  uniffi::bark::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
@@ -8477,7 +8718,7 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_properties(jsi::Runt
8477
8718
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
8478
8719
  }
8479
8720
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_recover_vtxos(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8480
- auto value = uniffi_bark_ffi_fn_method_wallet_recover_vtxos(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1])
8721
+ auto value = uniffi_bark_ffi_fn_method_wallet_recover_vtxos(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2])
8481
8722
  );
8482
8723
 
8483
8724
 
@@ -8678,6 +8919,15 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_wallet_vtxos(jsi::Runtime&
8678
8919
 
8679
8920
  return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
8680
8921
  }
8922
+ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8923
+ RustCallStatus status = uniffi::bark::Bridging<RustCallStatus>::rustSuccess(rt);
8924
+ auto value = uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit(&status
8925
+ );
8926
+ uniffi::bark::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
8927
+
8928
+
8929
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
8930
+ }
8681
8931
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_func_extract_tx_from_psbt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8682
8932
  RustCallStatus status = uniffi::bark::Bridging<RustCallStatus>::rustSuccess(rt);
8683
8933
  auto value = uniffi_bark_ffi_fn_func_extract_tx_from_psbt(uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
@@ -8697,6 +8947,15 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_func_generate_mnemonic(jsi::Runtim
8697
8947
 
8698
8948
  return uniffi::bark::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
8699
8949
  }
8950
+ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8951
+ RustCallStatus status = uniffi::bark::Bridging<RustCallStatus>::rustSuccess(rt);
8952
+ auto value = uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit(&status
8953
+ );
8954
+ uniffi::bark::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
8955
+
8956
+
8957
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
8958
+ }
8700
8959
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_func_validate_ark_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
8701
8960
  RustCallStatus status = uniffi::bark::Bridging<RustCallStatus>::rustSuccess(rt);
8702
8961
  auto value = uniffi_bark_ffi_fn_func_validate_ark_address(uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
@@ -9106,6 +9365,13 @@ jsi::Value NativeBark::cpp_ffi_bark_ffi_rust_future_complete_void(jsi::Runtime&
9106
9365
 
9107
9366
  return jsi::Value::undefined();
9108
9367
  }
9368
+ jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
9369
+ auto value = uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit(
9370
+ );
9371
+
9372
+
9373
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
9374
+ }
9109
9375
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
9110
9376
  auto value = uniffi_bark_ffi_checksum_func_extract_tx_from_psbt(
9111
9377
  );
@@ -9118,6 +9384,13 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_func_generate_mnemonic(jsi::
9118
9384
  );
9119
9385
 
9120
9386
 
9387
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
9388
+ }
9389
+ jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
9390
+ auto value = uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit(
9391
+ );
9392
+
9393
+
9121
9394
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
9122
9395
  }
9123
9396
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_func_validate_ark_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
@@ -9601,6 +9874,13 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_method_wallet_import_vtxo(js
9601
9874
  );
9602
9875
 
9603
9876
 
9877
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
9878
+ }
9879
+ jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_method_wallet_import_vtxos(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
9880
+ auto value = uniffi_bark_ffi_checksum_method_wallet_import_vtxos(
9881
+ );
9882
+
9883
+
9604
9884
  return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
9605
9885
  }
9606
9886
  jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {