@secondts/bark-react-native 0.20.1 → 0.22.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.
@@ -1 +1 @@
1
- {"version":3,"names":["getter","globalThis","NativeBark","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;AAChC,eAAeF,MAAM;;AAErB;;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,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;;AA+zBA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,UAAU;AAChC,eAAeF,MAAM;;AAErB;;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,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
@@ -304,6 +304,50 @@ const FfiConverterTypeBoardFees = (() => {
304
304
  }
305
305
  return new FFIConverter();
306
306
  })();
307
+
308
+ /**
309
+ * Destination for an externally funded board (e.g. a payjoin receive).
310
+ *
311
+ * The funding script commits to the derived keypair and expiry height, so
312
+ * `keypair_index` and `expiry_height` must be passed back unchanged to
313
+ * `board_psbt` once the funding PSBT is available — including on retries
314
+ * after the sender changes the transaction.
315
+ */
316
+
317
+ /**
318
+ * Generated factory for {@link BoardFundingInfo} record objects.
319
+ */
320
+ export const BoardFundingInfo = (() => {
321
+ const defaults = () => ({});
322
+ const create = (() => {
323
+ return uniffiCreateRecord(defaults);
324
+ })();
325
+ return Object.freeze({
326
+ create,
327
+ new: create,
328
+ defaults: () => Object.freeze(defaults())
329
+ });
330
+ })();
331
+ const FfiConverterTypeBoardFundingInfo = (() => {
332
+ class FFIConverter extends AbstractFfiConverterByteArray {
333
+ read(from) {
334
+ return {
335
+ address: FfiConverterString.read(from),
336
+ expiryHeight: FfiConverterUInt32.read(from),
337
+ keypairIndex: FfiConverterUInt32.read(from)
338
+ };
339
+ }
340
+ write(value, into) {
341
+ FfiConverterString.write(value.address, into);
342
+ FfiConverterUInt32.write(value.expiryHeight, into);
343
+ FfiConverterUInt32.write(value.keypairIndex, into);
344
+ }
345
+ allocationSize(value) {
346
+ return FfiConverterString.allocationSize(value.address) + FfiConverterUInt32.allocationSize(value.expiryHeight) + FfiConverterUInt32.allocationSize(value.keypairIndex);
347
+ }
348
+ }
349
+ return new FFIConverter();
350
+ })();
307
351
  /**
308
352
  * Generated factory for {@link Config} record objects.
309
353
  */
@@ -445,6 +489,57 @@ const FfiConverterTypeDestination = (() => {
445
489
  return new FFIConverter();
446
490
  })();
447
491
 
492
+ /**
493
+ * Estimated onchain cost of unilaterally (emergency) exiting a set of VTXOs.
494
+ *
495
+ * Mirrors bark-rest's `GET /exits/fee` response. The two legs are paid from
496
+ * different pockets: `exit_broadcast_fee_sats` is spent now out of confirmed
497
+ * onchain funds to CPFP-bump every not-yet-confirmed exit transaction, while
498
+ * `claim_fee_sats` is deducted later from the recovered value when the
499
+ * matured outputs are drained.
500
+ */
501
+
502
+ /**
503
+ * Generated factory for {@link EmergencyExitFeeEstimate} record objects.
504
+ */
505
+ export const EmergencyExitFeeEstimate = (() => {
506
+ const defaults = () => ({});
507
+ const create = (() => {
508
+ return uniffiCreateRecord(defaults);
509
+ })();
510
+ return Object.freeze({
511
+ create,
512
+ new: create,
513
+ defaults: () => Object.freeze(defaults())
514
+ });
515
+ })();
516
+ const FfiConverterTypeEmergencyExitFeeEstimate = (() => {
517
+ class FFIConverter extends AbstractFfiConverterByteArray {
518
+ read(from) {
519
+ return {
520
+ exitBroadcastFeeSats: FfiConverterUInt64.read(from),
521
+ claimFeeSats: FfiConverterUInt64.read(from),
522
+ totalFeeSats: FfiConverterUInt64.read(from),
523
+ feeRateSatPerVb: FfiConverterUInt64.read(from),
524
+ txsToBroadcast: FfiConverterUInt64.read(from),
525
+ fundable: FfiConverterBool.read(from)
526
+ };
527
+ }
528
+ write(value, into) {
529
+ FfiConverterUInt64.write(value.exitBroadcastFeeSats, into);
530
+ FfiConverterUInt64.write(value.claimFeeSats, into);
531
+ FfiConverterUInt64.write(value.totalFeeSats, into);
532
+ FfiConverterUInt64.write(value.feeRateSatPerVb, into);
533
+ FfiConverterUInt64.write(value.txsToBroadcast, into);
534
+ FfiConverterBool.write(value.fundable, into);
535
+ }
536
+ allocationSize(value) {
537
+ return FfiConverterUInt64.allocationSize(value.exitBroadcastFeeSats) + FfiConverterUInt64.allocationSize(value.claimFeeSats) + FfiConverterUInt64.allocationSize(value.totalFeeSats) + FfiConverterUInt64.allocationSize(value.feeRateSatPerVb) + FfiConverterUInt64.allocationSize(value.txsToBroadcast) + FfiConverterBool.allocationSize(value.fundable);
538
+ }
539
+ }
540
+ return new FFIConverter();
541
+ })();
542
+
448
543
  /**
449
544
  * Outcome of a cancellation request.
450
545
  *
@@ -4677,6 +4772,32 @@ export class Wallet extends UniffiAbstractObject {
4677
4772
  throw __error;
4678
4773
  }
4679
4774
  }
4775
+ async boardFundingAddress(asyncOpts_) /*throws*/{
4776
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4777
+ try {
4778
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4779
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_funding_address(uniffiTypeWalletObjectFactory.clonePointer(this));
4780
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeBoardFundingInfo.lift.bind(FfiConverterTypeBoardFundingInfo), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
4781
+ } catch (__error) {
4782
+ if (uniffiIsDebug && __error instanceof Error) {
4783
+ __error.stack = __stack;
4784
+ }
4785
+ throw __error;
4786
+ }
4787
+ }
4788
+ async boardPsbt(psbtBase64, keypairIndex, expiryHeight, asyncOpts_) /*throws*/{
4789
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4790
+ try {
4791
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4792
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_psbt(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(psbtBase64), FfiConverterUInt32.lower(keypairIndex), FfiConverterUInt32.lower(expiryHeight));
4793
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypePendingBoard.lift.bind(FfiConverterTypePendingBoard), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
4794
+ } catch (__error) {
4795
+ if (uniffiIsDebug && __error instanceof Error) {
4796
+ __error.stack = __stack;
4797
+ }
4798
+ throw __error;
4799
+ }
4800
+ }
4680
4801
  async bolt11Invoice(amountSats, description, token = undefined, asyncOpts_) /*throws*/{
4681
4802
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4682
4803
  try {
@@ -4863,6 +4984,34 @@ export class Wallet extends UniffiAbstractObject {
4863
4984
  throw __error;
4864
4985
  }
4865
4986
  }
4987
+
4988
+ /**
4989
+ * Estimate the onchain cost of unilaterally (emergency) exiting VTXOs.
4990
+ * Mirrors bark-rest `GET /exits/fee`.
4991
+ *
4992
+ * Pass an empty `vtxo_ids` to price exiting the whole wallet (every
4993
+ * spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
4994
+ * use the chain's fast rate for the broadcast leg and regular rate for
4995
+ * the claim leg. `destination` only affects the claim transaction's weight.
4996
+ *
4997
+ * The onchain wallet is synced first so `fundable` reflects the current
4998
+ * confirmed balance. Requires a BDK onchain wallet: callback-backed
4999
+ * wallets (`CustomOnchainWalletCallbacks`) cannot simulate the CPFP walk
5000
+ * and return an error.
5001
+ */
5002
+ async estimateEmergencyExitFee(vtxoIds, feeRateSatPerVb, destination, asyncOpts_) /*throws*/{
5003
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
5004
+ try {
5005
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5006
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_emergency_exit_fee(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), FfiConverterOptionalUInt64.lower(feeRateSatPerVb), FfiConverterOptionalString.lower(destination));
5007
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeEmergencyExitFeeEstimate.lift.bind(FfiConverterTypeEmergencyExitFeeEstimate), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeError.lift.bind(FfiConverterTypeError));
5008
+ } catch (__error) {
5009
+ if (uniffiIsDebug && __error instanceof Error) {
5010
+ __error.stack = __stack;
5011
+ }
5012
+ throw __error;
5013
+ }
5014
+ }
4866
5015
  async estimateLightningReceiveFee(amountSats, asyncOpts_) /*throws*/{
4867
5016
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4868
5017
  try {
@@ -6164,6 +6313,12 @@ function uniffiEnsureInitialized() {
6164
6313
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !== 54692) {
6165
6314
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_amount");
6166
6315
  }
6316
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_funding_address() !== 8961) {
6317
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_funding_address");
6318
+ }
6319
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_psbt() !== 28300) {
6320
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_psbt");
6321
+ }
6167
6322
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 54959) {
6168
6323
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice");
6169
6324
  }
@@ -6203,6 +6358,9 @@ function uniffiEnsureInitialized() {
6203
6358
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee() !== 55967) {
6204
6359
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee");
6205
6360
  }
6361
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_emergency_exit_fee() !== 44713) {
6362
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_estimate_emergency_exit_fee");
6363
+ }
6206
6364
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee() !== 33637) {
6207
6365
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee");
6208
6366
  }
@@ -6455,10 +6613,12 @@ export default Object.freeze({
6455
6613
  FfiConverterTypeBarkLogger,
6456
6614
  FfiConverterTypeBlockRef,
6457
6615
  FfiConverterTypeBoardFees,
6616
+ FfiConverterTypeBoardFundingInfo,
6458
6617
  FfiConverterTypeConfig,
6459
6618
  FfiConverterTypeCpfpParams,
6460
6619
  FfiConverterTypeCustomOnchainWalletCallbacks,
6461
6620
  FfiConverterTypeDestination,
6621
+ FfiConverterTypeEmergencyExitFeeEstimate,
6462
6622
  FfiConverterTypeError,
6463
6623
  FfiConverterTypeExitCancelFailure,
6464
6624
  FfiConverterTypeExitCancelResult,