@secondts/bark-react-native 0.18.0 → 0.20.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.
- package/README.md +1 -1
- package/cpp/generated/bark.cpp +36 -0
- package/cpp/generated/bark.hpp +2 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +27 -2
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +27 -2
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +2 -0
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +24 -2
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +2 -0
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +24 -2
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/generated/bark-ffi.ts +5 -0
- package/src/generated/bark.ts +62 -2
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ npx expo install @secondts/bark-react-native@beta
|
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
# Or install a specific beta version
|
|
63
|
-
npx expo install @secondts/bark-react-native@0.
|
|
63
|
+
npx expo install @secondts/bark-react-native@0.20.0
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
For bare React Native projects, use:
|
package/cpp/generated/bark.cpp
CHANGED
|
@@ -320,6 +320,10 @@ extern "C" {
|
|
|
320
320
|
/*handle*/ uint64_t uniffi_bark_ffi_fn_method_onchainwallet_fee_rates(
|
|
321
321
|
/*handle*/ uint64_t ptr
|
|
322
322
|
);
|
|
323
|
+
/*handle*/ uint64_t uniffi_bark_ffi_fn_method_onchainwallet_initial_scan(
|
|
324
|
+
/*handle*/ uint64_t ptr,
|
|
325
|
+
RustBuffer birthday_height
|
|
326
|
+
);
|
|
323
327
|
/*handle*/ uint64_t uniffi_bark_ffi_fn_method_onchainwallet_new_address(
|
|
324
328
|
/*handle*/ uint64_t ptr
|
|
325
329
|
);
|
|
@@ -997,6 +1001,8 @@ extern "C" {
|
|
|
997
1001
|
);
|
|
998
1002
|
uint16_t uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates(
|
|
999
1003
|
);
|
|
1004
|
+
uint16_t uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan(
|
|
1005
|
+
);
|
|
1000
1006
|
uint16_t uniffi_bark_ffi_checksum_method_onchainwallet_new_address(
|
|
1001
1007
|
);
|
|
1002
1008
|
uint16_t uniffi_bark_ffi_checksum_method_onchainwallet_send(
|
|
@@ -4797,6 +4803,14 @@ NativeBark::NativeBark(
|
|
|
4797
4803
|
return this->cpp_uniffi_bark_ffi_fn_method_onchainwallet_fee_rates(rt, thisVal, args, count);
|
|
4798
4804
|
}
|
|
4799
4805
|
);
|
|
4806
|
+
props["ubrn_uniffi_bark_ffi_fn_method_onchainwallet_initial_scan"] = jsi::Function::createFromHostFunction(
|
|
4807
|
+
rt,
|
|
4808
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_onchainwallet_initial_scan"),
|
|
4809
|
+
2,
|
|
4810
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
4811
|
+
return this->cpp_uniffi_bark_ffi_fn_method_onchainwallet_initial_scan(rt, thisVal, args, count);
|
|
4812
|
+
}
|
|
4813
|
+
);
|
|
4800
4814
|
props["ubrn_uniffi_bark_ffi_fn_method_onchainwallet_new_address"] = jsi::Function::createFromHostFunction(
|
|
4801
4815
|
rt,
|
|
4802
4816
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_fn_method_onchainwallet_new_address"),
|
|
@@ -6245,6 +6259,14 @@ NativeBark::NativeBark(
|
|
|
6245
6259
|
return this->cpp_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates(rt, thisVal, args, count);
|
|
6246
6260
|
}
|
|
6247
6261
|
);
|
|
6262
|
+
props["ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan"] = jsi::Function::createFromHostFunction(
|
|
6263
|
+
rt,
|
|
6264
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan"),
|
|
6265
|
+
0,
|
|
6266
|
+
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
6267
|
+
return this->cpp_uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan(rt, thisVal, args, count);
|
|
6268
|
+
}
|
|
6269
|
+
);
|
|
6248
6270
|
props["ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_new_address"] = jsi::Function::createFromHostFunction(
|
|
6249
6271
|
rt,
|
|
6250
6272
|
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_new_address"),
|
|
@@ -7523,6 +7545,13 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_onchainwallet_fee_rates(jsi
|
|
|
7523
7545
|
);
|
|
7524
7546
|
|
|
7525
7547
|
|
|
7548
|
+
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
7549
|
+
}
|
|
7550
|
+
jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_onchainwallet_initial_scan(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
7551
|
+
auto value = uniffi_bark_ffi_fn_method_onchainwallet_initial_scan(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::bark::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1])
|
|
7552
|
+
);
|
|
7553
|
+
|
|
7554
|
+
|
|
7526
7555
|
return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
|
|
7527
7556
|
}
|
|
7528
7557
|
jsi::Value NativeBark::cpp_uniffi_bark_ffi_fn_method_onchainwallet_new_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
@@ -8861,6 +8890,13 @@ jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rat
|
|
|
8861
8890
|
);
|
|
8862
8891
|
|
|
8863
8892
|
|
|
8893
|
+
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
8894
|
+
}
|
|
8895
|
+
jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
8896
|
+
auto value = uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan(
|
|
8897
|
+
);
|
|
8898
|
+
|
|
8899
|
+
|
|
8864
8900
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
8865
8901
|
}
|
|
8866
8902
|
jsi::Value NativeBark::cpp_uniffi_bark_ffi_checksum_method_onchainwallet_new_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
package/cpp/generated/bark.hpp
CHANGED
|
@@ -47,6 +47,7 @@ class NativeBark : public jsi::HostObject {
|
|
|
47
47
|
jsi::Value cpp_uniffi_bark_ffi_fn_constructor_onchainwallet_default(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
48
48
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_onchainwallet_balance(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
49
49
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_onchainwallet_fee_rates(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
50
|
+
jsi::Value cpp_uniffi_bark_ffi_fn_method_onchainwallet_initial_scan(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
50
51
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_onchainwallet_new_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
51
52
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_onchainwallet_send(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
52
53
|
jsi::Value cpp_uniffi_bark_ffi_fn_method_onchainwallet_sync(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -228,6 +229,7 @@ class NativeBark : public jsi::HostObject {
|
|
|
228
229
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_barklogger_log(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
229
230
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_onchainwallet_balance(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
230
231
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
232
|
+
jsi::Value cpp_uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
231
233
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_onchainwallet_new_address(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
232
234
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_onchainwallet_send(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
233
235
|
jsi::Value cpp_uniffi_bark_ffi_checksum_method_onchainwallet_sync(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeBark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeBark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;;AA6yBA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAClBL,MAAM,EAErB;AAwKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
|
|
@@ -4361,6 +4361,28 @@ class OnchainWallet extends _uniffiBindgenReactNative.UniffiAbstractObject {
|
|
|
4361
4361
|
throw __error;
|
|
4362
4362
|
}
|
|
4363
4363
|
}
|
|
4364
|
+
|
|
4365
|
+
/**
|
|
4366
|
+
* Discover the wallet's pre-existing on-chain history. Run once after
|
|
4367
|
+
* restoring a wallet from a mnemonic: `sync` only covers addresses this
|
|
4368
|
+
* wallet instance has already revealed, so it never finds transactions
|
|
4369
|
+
* made by a previous incarnation. Gap-limited full scan on esplora
|
|
4370
|
+
* (`birthday_height` is ignored there), block scan from `birthday_height`
|
|
4371
|
+
* on bitcoind. Returns the total balance in sats afterwards.
|
|
4372
|
+
*/
|
|
4373
|
+
async initialScan(birthdayHeight, asyncOpts_) /*throws*/{
|
|
4374
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4375
|
+
try {
|
|
4376
|
+
return await (0, _uniffiBindgenReactNative.uniffiRustCallAsync)(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
|
|
4377
|
+
return (0, _barkFfi.default)().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_initial_scan(uniffiTypeOnchainWalletObjectFactory.clonePointer(this), FfiConverterOptionalUInt32.lower(birthdayHeight));
|
|
4378
|
+
}, /*pollFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/(0, _barkFfi.default)().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/_uniffiBindgenReactNative.FfiConverterUInt64.lift.bind(_uniffiBindgenReactNative.FfiConverterUInt64), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
|
|
4379
|
+
} catch (__error) {
|
|
4380
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
4381
|
+
__error.stack = __stack;
|
|
4382
|
+
}
|
|
4383
|
+
throw __error;
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4364
4386
|
async newAddress(asyncOpts_) /*throws*/{
|
|
4365
4387
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4366
4388
|
try {
|
|
@@ -4511,7 +4533,7 @@ const FfiConverterTypeOnchainWallet = new _uniffiBindgenReactNative.FfiConverter
|
|
|
4511
4533
|
*
|
|
4512
4534
|
* Wraps `core::Wallet` and adds:
|
|
4513
4535
|
* - `run_async` runtime offload on every entry point
|
|
4514
|
-
* -
|
|
4536
|
+
* - daemon shutdown on drop
|
|
4515
4537
|
* - LNURL `pay_lightning_address`
|
|
4516
4538
|
* - Daemon control methods
|
|
4517
4539
|
* - Notification holder
|
|
@@ -4527,7 +4549,7 @@ const FfiConverterTypeOnchainWallet = new _uniffiBindgenReactNative.FfiConverter
|
|
|
4527
4549
|
*
|
|
4528
4550
|
* Wraps `core::Wallet` and adds:
|
|
4529
4551
|
* - `run_async` runtime offload on every entry point
|
|
4530
|
-
* -
|
|
4552
|
+
* - daemon shutdown on drop
|
|
4531
4553
|
* - LNURL `pay_lightning_address`
|
|
4532
4554
|
* - Daemon control methods
|
|
4533
4555
|
* - Notification holder
|
|
@@ -6111,6 +6133,9 @@ function uniffiEnsureInitialized() {
|
|
|
6111
6133
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates() !== 30741) {
|
|
6112
6134
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates");
|
|
6113
6135
|
}
|
|
6136
|
+
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan() !== 19010) {
|
|
6137
|
+
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_initial_scan");
|
|
6138
|
+
}
|
|
6114
6139
|
if ((0, _barkFfi.default)().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_new_address() !== 7405) {
|
|
6115
6140
|
throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_new_address");
|
|
6116
6141
|
}
|