@secondts/bark-react-native 0.21.0 → 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.
- package/README.md +1 -1
- package/cpp/generated/bark.cpp +38 -0
- package/cpp/generated/bark.hpp +2 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +84 -1
- 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 +83 -0
- 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 +93 -0
- 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 +93 -0
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/generated/bark-ffi.ts +7 -0
- package/src/generated/bark.ts +183 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeBark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;AAAA;AACA;;AAEA;AACA;AACA;;
|
|
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":[]}
|
|
@@ -489,6 +489,57 @@ const FfiConverterTypeDestination = (() => {
|
|
|
489
489
|
return new FFIConverter();
|
|
490
490
|
})();
|
|
491
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
|
+
|
|
492
543
|
/**
|
|
493
544
|
* Outcome of a cancellation request.
|
|
494
545
|
*
|
|
@@ -4933,6 +4984,34 @@ export class Wallet extends UniffiAbstractObject {
|
|
|
4933
4984
|
throw __error;
|
|
4934
4985
|
}
|
|
4935
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
|
+
}
|
|
4936
5015
|
async estimateLightningReceiveFee(amountSats, asyncOpts_) /*throws*/{
|
|
4937
5016
|
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
4938
5017
|
try {
|
|
@@ -6279,6 +6358,9 @@ function uniffiEnsureInitialized() {
|
|
|
6279
6358
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee() !== 55967) {
|
|
6280
6359
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee");
|
|
6281
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
|
+
}
|
|
6282
6364
|
if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee() !== 33637) {
|
|
6283
6365
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee");
|
|
6284
6366
|
}
|
|
@@ -6536,6 +6618,7 @@ export default Object.freeze({
|
|
|
6536
6618
|
FfiConverterTypeCpfpParams,
|
|
6537
6619
|
FfiConverterTypeCustomOnchainWalletCallbacks,
|
|
6538
6620
|
FfiConverterTypeDestination,
|
|
6621
|
+
FfiConverterTypeEmergencyExitFeeEstimate,
|
|
6539
6622
|
FfiConverterTypeError,
|
|
6540
6623
|
FfiConverterTypeExitCancelFailure,
|
|
6541
6624
|
FfiConverterTypeExitCancelResult,
|