@secondts/bark-react-native 0.4.0 → 0.4.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.
Files changed (27) hide show
  1. package/BarkReactNative.podspec +2 -2
  2. package/README.md +1 -1
  3. package/cpp/generated/bark.cpp +109 -0
  4. package/cpp/generated/bark.hpp +6 -0
  5. package/lib/commonjs/generated/bark-ffi.js.map +1 -1
  6. package/lib/commonjs/generated/bark.js +74 -0
  7. package/lib/commonjs/generated/bark.js.map +1 -1
  8. package/lib/module/generated/bark-ffi.js.map +1 -1
  9. package/lib/module/generated/bark.js +74 -0
  10. package/lib/module/generated/bark.js.map +1 -1
  11. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +6 -0
  12. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
  13. package/lib/typescript/commonjs/src/generated/bark.d.ts +47 -0
  14. package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
  15. package/lib/typescript/module/src/generated/bark-ffi.d.ts +6 -0
  16. package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
  17. package/lib/typescript/module/src/generated/bark.d.ts +47 -0
  18. package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
  19. package/package.json +10 -4
  20. package/src/generated/bark-ffi.ts +14 -0
  21. package/src/generated/bark.ts +173 -0
  22. package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +0 -2321
  23. package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +0 -2761
  24. package/ios/generated/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +0 -2923
  25. package/ios/generated/build/generated/ios/FBReactNativeSpecJSI.h +0 -7718
  26. package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +0 -18
  27. package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +0 -33
@@ -1 +1 @@
1
- {"version":3,"names":["getter","globalThis","NativeBark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;AAAA;AACA;;AAEA;AACA;AACA;;AA+oBA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,UAAU;AAChC,eAAeF,MAAM;;AAErB;;AA8JA;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,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["getter","globalThis","NativeBark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;AAAA;AACA;;AAEA;AACA;AACA;;AA6pBA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,UAAU;AAChC,eAAeF,MAAM;;AAErB;;AA8JA;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,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
@@ -2435,6 +2435,28 @@ export class Wallet extends UniffiAbstractObject {
2435
2435
  }
2436
2436
  }
2437
2437
 
2438
+ /**
2439
+ * Open an existing Bark wallet and start running the daemon,
2440
+ * optionally with onchain capabilities.
2441
+ *
2442
+ * The daemon runs in the background and is stopped when the wallet is dropped.
2443
+ * Callback-based onchain wallets are not supported for daemon mode and the
2444
+ * wallet will be opened without onchain capabilities in that case.
2445
+ */
2446
+ static async openWithDaemon(mnemonic, config, datadir, onchainWallet, asyncOpts_) /*throws*/{
2447
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
2448
+ try {
2449
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
2450
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_open_with_daemon(FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterOptionalTypeOnchainWallet.lower(onchainWallet));
2451
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u64, /*cancelFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u64, /*completeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_u64, /*freeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u64, /*liftFunc:*/FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError));
2452
+ } catch (__error) {
2453
+ if (uniffiIsDebug && __error instanceof Error) {
2454
+ __error.stack = __stack;
2455
+ }
2456
+ throw __error;
2457
+ }
2458
+ }
2459
+
2438
2460
  /**
2439
2461
  * Open an existing Bark wallet WITH onchain capabilities
2440
2462
  */
@@ -3740,6 +3762,29 @@ export class Wallet extends UniffiAbstractObject {
3740
3762
  throw __error;
3741
3763
  }
3742
3764
  }
3765
+
3766
+ /**
3767
+ * Start a background daemon for the wallet.
3768
+ *
3769
+ * The daemon performs periodic syncs, exit progression and other
3770
+ * background work. It is stopped automatically when the wallet is dropped.
3771
+ * Callback-based onchain wallets are not supported for daemon mode and the
3772
+ * daemon will run without onchain capabilities in that case.
3773
+ * Calling this multiple times stops the previous daemon and starts a new one.
3774
+ */
3775
+ async runDaemon(onchainWallet, asyncOpts_) /*throws*/{
3776
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3777
+ try {
3778
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3779
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_run_daemon(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterOptionalTypeOnchainWallet.lower(onchainWallet));
3780
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError));
3781
+ } catch (__error) {
3782
+ if (uniffiIsDebug && __error instanceof Error) {
3783
+ __error.stack = __stack;
3784
+ }
3785
+ throw __error;
3786
+ }
3787
+ }
3743
3788
  async sendArkoorPayment(arkAddress, amountSats, asyncOpts_) /*throws*/{
3744
3789
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3745
3790
  try {
@@ -3846,6 +3891,23 @@ export class Wallet extends UniffiAbstractObject {
3846
3891
  }
3847
3892
  }
3848
3893
 
3894
+ /**
3895
+ * Stop the running daemon if any. No-op otherwise.
3896
+ */
3897
+ async stopDaemon(asyncOpts_) /*throws*/{
3898
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3899
+ try {
3900
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3901
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_stop_daemon(uniffiTypeWalletObjectFactory.clonePointer(this));
3902
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError));
3903
+ } catch (__error) {
3904
+ if (uniffiIsDebug && __error instanceof Error) {
3905
+ __error.stack = __stack;
3906
+ }
3907
+ throw __error;
3908
+ }
3909
+ }
3910
+
3849
3911
  /**
3850
3912
  * Lightweight sync with Ark server and blockchain
3851
3913
  * Note: Bark's sync() handles errors internally with logging.
@@ -4080,6 +4142,9 @@ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
4080
4142
  // FfiConverter for WalletNotification | undefined
4081
4143
  const FfiConverterOptionalTypeWalletNotification = new FfiConverterOptional(FfiConverterTypeWalletNotification);
4082
4144
 
4145
+ // FfiConverter for OnchainWalletLike | undefined
4146
+ const FfiConverterOptionalTypeOnchainWallet = new FfiConverterOptional(FfiConverterTypeOnchainWallet);
4147
+
4083
4148
  // FfiConverter for Array<string> | undefined
4084
4149
  const FfiConverterOptionalArrayString = new FfiConverterOptional(FfiConverterArrayString);
4085
4150
 
@@ -4344,6 +4409,9 @@ function uniffiEnsureInitialized() {
4344
4409
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_delegated() !== 16216) {
4345
4410
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_delegated");
4346
4411
  }
4412
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_run_daemon() !== 21553) {
4413
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_run_daemon");
4414
+ }
4347
4415
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_send_arkoor_payment() !== 30372) {
4348
4416
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_send_arkoor_payment");
4349
4417
  }
@@ -4362,6 +4430,9 @@ function uniffiEnsureInitialized() {
4362
4430
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_start_exit_for_vtxos() !== 26632) {
4363
4431
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_start_exit_for_vtxos");
4364
4432
  }
4433
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon() !== 9450) {
4434
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon");
4435
+ }
4365
4436
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync() !== 22105) {
4366
4437
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync");
4367
4438
  }
@@ -4398,6 +4469,9 @@ function uniffiEnsureInitialized() {
4398
4469
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open() !== 31794) {
4399
4470
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_open");
4400
4471
  }
4472
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open_with_daemon() !== 8446) {
4473
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_open_with_daemon");
4474
+ }
4401
4475
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain() !== 22896) {
4402
4476
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain");
4403
4477
  }