@secondts/bark-react-native 0.21.0 → 0.23.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 +357 -27
- package/cpp/generated/bark.hpp +10 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +468 -20
- 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 +467 -19
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +18 -6
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +391 -20
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +18 -6
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +391 -20
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/generated/bark-ffi.ts +35 -5
- package/src/generated/bark.ts +738 -30
package/src/generated/bark.ts
CHANGED
|
@@ -616,7 +616,7 @@ export type Config = {
|
|
|
616
616
|
bitcoindCookiefile?: string;
|
|
617
617
|
bitcoindUser?: string;
|
|
618
618
|
bitcoindPass?: string;
|
|
619
|
-
vtxoRefreshExpiryThreshold?: /*
|
|
619
|
+
vtxoRefreshExpiryThreshold?: /*u16*/ number;
|
|
620
620
|
vtxoExitMargin?: /*u16*/ number;
|
|
621
621
|
htlcRecvClaimDelta?: /*u16*/ number;
|
|
622
622
|
fallbackFeeRate?: /*u64*/ bigint;
|
|
@@ -655,7 +655,7 @@ const FfiConverterTypeConfig = (() => {
|
|
|
655
655
|
bitcoindCookiefile: FfiConverterOptionalString.read(from),
|
|
656
656
|
bitcoindUser: FfiConverterOptionalString.read(from),
|
|
657
657
|
bitcoindPass: FfiConverterOptionalString.read(from),
|
|
658
|
-
vtxoRefreshExpiryThreshold:
|
|
658
|
+
vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt16.read(from),
|
|
659
659
|
vtxoExitMargin: FfiConverterOptionalUInt16.read(from),
|
|
660
660
|
htlcRecvClaimDelta: FfiConverterOptionalUInt16.read(from),
|
|
661
661
|
fallbackFeeRate: FfiConverterOptionalUInt64.read(from),
|
|
@@ -675,7 +675,7 @@ const FfiConverterTypeConfig = (() => {
|
|
|
675
675
|
FfiConverterOptionalString.write(value.bitcoindCookiefile, into);
|
|
676
676
|
FfiConverterOptionalString.write(value.bitcoindUser, into);
|
|
677
677
|
FfiConverterOptionalString.write(value.bitcoindPass, into);
|
|
678
|
-
|
|
678
|
+
FfiConverterOptionalUInt16.write(value.vtxoRefreshExpiryThreshold, into);
|
|
679
679
|
FfiConverterOptionalUInt16.write(value.vtxoExitMargin, into);
|
|
680
680
|
FfiConverterOptionalUInt16.write(value.htlcRecvClaimDelta, into);
|
|
681
681
|
FfiConverterOptionalUInt64.write(value.fallbackFeeRate, into);
|
|
@@ -701,7 +701,7 @@ const FfiConverterTypeConfig = (() => {
|
|
|
701
701
|
FfiConverterOptionalString.allocationSize(value.bitcoindCookiefile) +
|
|
702
702
|
FfiConverterOptionalString.allocationSize(value.bitcoindUser) +
|
|
703
703
|
FfiConverterOptionalString.allocationSize(value.bitcoindPass) +
|
|
704
|
-
|
|
704
|
+
FfiConverterOptionalUInt16.allocationSize(
|
|
705
705
|
value.vtxoRefreshExpiryThreshold
|
|
706
706
|
) +
|
|
707
707
|
FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) +
|
|
@@ -831,6 +831,105 @@ const FfiConverterTypeDestination = (() => {
|
|
|
831
831
|
return new FFIConverter();
|
|
832
832
|
})();
|
|
833
833
|
|
|
834
|
+
/**
|
|
835
|
+
* Estimated onchain cost of unilaterally (emergency) exiting a set of VTXOs.
|
|
836
|
+
*
|
|
837
|
+
* Mirrors bark-rest's `GET /exits/fee` response. The two legs are paid from
|
|
838
|
+
* different pockets: `exit_broadcast_fee_sats` is spent now out of confirmed
|
|
839
|
+
* onchain funds to CPFP-bump every not-yet-confirmed exit transaction, while
|
|
840
|
+
* `claim_fee_sats` is deducted later from the recovered value when the
|
|
841
|
+
* matured outputs are drained.
|
|
842
|
+
*/
|
|
843
|
+
export type EmergencyExitFeeEstimate = {
|
|
844
|
+
/**
|
|
845
|
+
* CPFP fees to broadcast every not-yet-confirmed exit transaction. Paid
|
|
846
|
+
* now from confirmed onchain funds; this is the minimum onchain balance
|
|
847
|
+
* an emergency exit needs.
|
|
848
|
+
*/
|
|
849
|
+
exitBroadcastFeeSats: /*u64*/ bigint;
|
|
850
|
+
/**
|
|
851
|
+
* Fee of the single batched transaction that later drains the matured
|
|
852
|
+
* exit outputs. Subtracted from the exited amount.
|
|
853
|
+
*/
|
|
854
|
+
claimFeeSats: /*u64*/ bigint;
|
|
855
|
+
/**
|
|
856
|
+
* `exit_broadcast_fee_sats + claim_fee_sats`.
|
|
857
|
+
*/
|
|
858
|
+
totalFeeSats: /*u64*/ bigint;
|
|
859
|
+
/**
|
|
860
|
+
* Fee rate the exit-broadcast leg was priced at (sat/vB, rounded up).
|
|
861
|
+
* Unless an explicit rate was supplied, the claim leg is priced
|
|
862
|
+
* separately at the chain's `regular` rate.
|
|
863
|
+
*/
|
|
864
|
+
feeRateSatPerVb: /*u64*/ bigint;
|
|
865
|
+
/**
|
|
866
|
+
* Number of exit transactions that still need to be broadcast and
|
|
867
|
+
* CPFP-bumped. Already-confirmed tree transactions are not counted.
|
|
868
|
+
*/
|
|
869
|
+
txsToBroadcast: /*u64*/ bigint;
|
|
870
|
+
/**
|
|
871
|
+
* Whether the wallet's current confirmed onchain balance covers the full
|
|
872
|
+
* serial broadcast walk. Each CPFP child can only spend confirmed coins,
|
|
873
|
+
* so `false` means the exit would stall midway even if a single bump
|
|
874
|
+
* looks affordable.
|
|
875
|
+
*/
|
|
876
|
+
fundable: boolean;
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Generated factory for {@link EmergencyExitFeeEstimate} record objects.
|
|
881
|
+
*/
|
|
882
|
+
export const EmergencyExitFeeEstimate = (() => {
|
|
883
|
+
const defaults = () => ({});
|
|
884
|
+
const create = (() => {
|
|
885
|
+
return uniffiCreateRecord<
|
|
886
|
+
EmergencyExitFeeEstimate,
|
|
887
|
+
ReturnType<typeof defaults>
|
|
888
|
+
>(defaults);
|
|
889
|
+
})();
|
|
890
|
+
return Object.freeze({
|
|
891
|
+
create,
|
|
892
|
+
new: create,
|
|
893
|
+
defaults: () =>
|
|
894
|
+
Object.freeze(defaults()) as Partial<EmergencyExitFeeEstimate>,
|
|
895
|
+
});
|
|
896
|
+
})();
|
|
897
|
+
|
|
898
|
+
const FfiConverterTypeEmergencyExitFeeEstimate = (() => {
|
|
899
|
+
type TypeName = EmergencyExitFeeEstimate;
|
|
900
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
901
|
+
read(from: RustBuffer): TypeName {
|
|
902
|
+
return {
|
|
903
|
+
exitBroadcastFeeSats: FfiConverterUInt64.read(from),
|
|
904
|
+
claimFeeSats: FfiConverterUInt64.read(from),
|
|
905
|
+
totalFeeSats: FfiConverterUInt64.read(from),
|
|
906
|
+
feeRateSatPerVb: FfiConverterUInt64.read(from),
|
|
907
|
+
txsToBroadcast: FfiConverterUInt64.read(from),
|
|
908
|
+
fundable: FfiConverterBool.read(from),
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
912
|
+
FfiConverterUInt64.write(value.exitBroadcastFeeSats, into);
|
|
913
|
+
FfiConverterUInt64.write(value.claimFeeSats, into);
|
|
914
|
+
FfiConverterUInt64.write(value.totalFeeSats, into);
|
|
915
|
+
FfiConverterUInt64.write(value.feeRateSatPerVb, into);
|
|
916
|
+
FfiConverterUInt64.write(value.txsToBroadcast, into);
|
|
917
|
+
FfiConverterBool.write(value.fundable, into);
|
|
918
|
+
}
|
|
919
|
+
allocationSize(value: TypeName): number {
|
|
920
|
+
return (
|
|
921
|
+
FfiConverterUInt64.allocationSize(value.exitBroadcastFeeSats) +
|
|
922
|
+
FfiConverterUInt64.allocationSize(value.claimFeeSats) +
|
|
923
|
+
FfiConverterUInt64.allocationSize(value.totalFeeSats) +
|
|
924
|
+
FfiConverterUInt64.allocationSize(value.feeRateSatPerVb) +
|
|
925
|
+
FfiConverterUInt64.allocationSize(value.txsToBroadcast) +
|
|
926
|
+
FfiConverterBool.allocationSize(value.fundable)
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
return new FFIConverter();
|
|
931
|
+
})();
|
|
932
|
+
|
|
834
933
|
/**
|
|
835
934
|
* Outcome of a cancellation request.
|
|
836
935
|
*
|
|
@@ -2227,9 +2326,19 @@ const FfiConverterTypeRefreshFees = (() => {
|
|
|
2227
2326
|
export type RoundState = {
|
|
2228
2327
|
id: /*u32*/ number;
|
|
2229
2328
|
/**
|
|
2230
|
-
* Whether the round is ongoing
|
|
2329
|
+
* Whether the interactive part of the round is ongoing. Equivalent to
|
|
2330
|
+
* `state` being `Pending` or `Ongoing`; kept for compatibility.
|
|
2231
2331
|
*/
|
|
2232
2332
|
ongoing: boolean;
|
|
2333
|
+
/**
|
|
2334
|
+
* Lifecycle phase of the participation.
|
|
2335
|
+
*/
|
|
2336
|
+
state: RoundFlowKind;
|
|
2337
|
+
/**
|
|
2338
|
+
* Block height a delegated participation waits for, if it asked the
|
|
2339
|
+
* server to schedule one. Only set while `state` is `DelegatedPending`.
|
|
2340
|
+
*/
|
|
2341
|
+
scheduledHeight?: /*u32*/ number;
|
|
2233
2342
|
};
|
|
2234
2343
|
|
|
2235
2344
|
/**
|
|
@@ -2256,16 +2365,22 @@ const FfiConverterTypeRoundState = (() => {
|
|
|
2256
2365
|
return {
|
|
2257
2366
|
id: FfiConverterUInt32.read(from),
|
|
2258
2367
|
ongoing: FfiConverterBool.read(from),
|
|
2368
|
+
state: FfiConverterTypeRoundFlowKind.read(from),
|
|
2369
|
+
scheduledHeight: FfiConverterOptionalUInt32.read(from),
|
|
2259
2370
|
};
|
|
2260
2371
|
}
|
|
2261
2372
|
write(value: TypeName, into: RustBuffer): void {
|
|
2262
2373
|
FfiConverterUInt32.write(value.id, into);
|
|
2263
2374
|
FfiConverterBool.write(value.ongoing, into);
|
|
2375
|
+
FfiConverterTypeRoundFlowKind.write(value.state, into);
|
|
2376
|
+
FfiConverterOptionalUInt32.write(value.scheduledHeight, into);
|
|
2264
2377
|
}
|
|
2265
2378
|
allocationSize(value: TypeName): number {
|
|
2266
2379
|
return (
|
|
2267
2380
|
FfiConverterUInt32.allocationSize(value.id) +
|
|
2268
|
-
FfiConverterBool.allocationSize(value.ongoing)
|
|
2381
|
+
FfiConverterBool.allocationSize(value.ongoing) +
|
|
2382
|
+
FfiConverterTypeRoundFlowKind.allocationSize(value.state) +
|
|
2383
|
+
FfiConverterOptionalUInt32.allocationSize(value.scheduledHeight)
|
|
2269
2384
|
);
|
|
2270
2385
|
}
|
|
2271
2386
|
}
|
|
@@ -2393,7 +2508,7 @@ export type WalletOpenArgs = {
|
|
|
2393
2508
|
* Whether to skip the seed-recovery mailbox scan
|
|
2394
2509
|
*
|
|
2395
2510
|
* The scan runs on the open that creates the wallet locally and makes
|
|
2396
|
-
* network calls; its
|
|
2511
|
+
* network calls; its outcome is available from `Wallet::recovery_status`.
|
|
2397
2512
|
* Set this to open without it.
|
|
2398
2513
|
*
|
|
2399
2514
|
* Default: false
|
|
@@ -4528,6 +4643,291 @@ const FfiConverterTypeOnchainUtxo = (() => {
|
|
|
4528
4643
|
return new FFIConverter();
|
|
4529
4644
|
})();
|
|
4530
4645
|
|
|
4646
|
+
// Enum: RecoveryStatus
|
|
4647
|
+
export enum RecoveryStatus_Tags {
|
|
4648
|
+
NotRun = "NotRun",
|
|
4649
|
+
Failed = "Failed",
|
|
4650
|
+
Completed = "Completed",
|
|
4651
|
+
}
|
|
4652
|
+
/**
|
|
4653
|
+
* Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
|
|
4654
|
+
* `bark::RecoveryStatus`.
|
|
4655
|
+
*
|
|
4656
|
+
* The three variants are distinguishable on purpose: `NotRun` means nothing
|
|
4657
|
+
* was attempted (wallet already existed locally, or `skip_recovery` was set),
|
|
4658
|
+
* `Failed` means the scan errored before producing a report so funds may be
|
|
4659
|
+
* missing until a retry succeeds, and `Completed` carries the report — whose
|
|
4660
|
+
* `is_complete` can still be `false` for individual VTXOs.
|
|
4661
|
+
*
|
|
4662
|
+
* Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
|
|
4663
|
+
*/
|
|
4664
|
+
export const RecoveryStatus = (() => {
|
|
4665
|
+
type NotRun__interface = {
|
|
4666
|
+
tag: RecoveryStatus_Tags.NotRun;
|
|
4667
|
+
};
|
|
4668
|
+
|
|
4669
|
+
/**
|
|
4670
|
+
* No scan was attempted.
|
|
4671
|
+
*/
|
|
4672
|
+
class NotRun_ extends UniffiEnum implements NotRun__interface {
|
|
4673
|
+
/**
|
|
4674
|
+
* @private
|
|
4675
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4676
|
+
*/
|
|
4677
|
+
readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
|
|
4678
|
+
readonly tag = RecoveryStatus_Tags.NotRun;
|
|
4679
|
+
constructor() {
|
|
4680
|
+
super("RecoveryStatus", "NotRun");
|
|
4681
|
+
}
|
|
4682
|
+
|
|
4683
|
+
static new(): NotRun_ {
|
|
4684
|
+
return new NotRun_();
|
|
4685
|
+
}
|
|
4686
|
+
|
|
4687
|
+
static instanceOf(obj: any): obj is NotRun_ {
|
|
4688
|
+
return obj.tag === RecoveryStatus_Tags.NotRun;
|
|
4689
|
+
}
|
|
4690
|
+
}
|
|
4691
|
+
|
|
4692
|
+
type Failed__interface = {
|
|
4693
|
+
tag: RecoveryStatus_Tags.Failed;
|
|
4694
|
+
inner: Readonly<{ message: string }>;
|
|
4695
|
+
};
|
|
4696
|
+
|
|
4697
|
+
/**
|
|
4698
|
+
* The scan errored before it could produce a report.
|
|
4699
|
+
*/
|
|
4700
|
+
class Failed_ extends UniffiEnum implements Failed__interface {
|
|
4701
|
+
/**
|
|
4702
|
+
* @private
|
|
4703
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4704
|
+
*/
|
|
4705
|
+
readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
|
|
4706
|
+
readonly tag = RecoveryStatus_Tags.Failed;
|
|
4707
|
+
readonly inner: Readonly<{ message: string }>;
|
|
4708
|
+
constructor(inner: { message: string }) {
|
|
4709
|
+
super("RecoveryStatus", "Failed");
|
|
4710
|
+
this.inner = Object.freeze(inner);
|
|
4711
|
+
}
|
|
4712
|
+
|
|
4713
|
+
static new(inner: { message: string }): Failed_ {
|
|
4714
|
+
return new Failed_(inner);
|
|
4715
|
+
}
|
|
4716
|
+
|
|
4717
|
+
static instanceOf(obj: any): obj is Failed_ {
|
|
4718
|
+
return obj.tag === RecoveryStatus_Tags.Failed;
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
|
|
4722
|
+
type Completed__interface = {
|
|
4723
|
+
tag: RecoveryStatus_Tags.Completed;
|
|
4724
|
+
inner: Readonly<{ report: RecoveryReport }>;
|
|
4725
|
+
};
|
|
4726
|
+
|
|
4727
|
+
/**
|
|
4728
|
+
* The scan ran to the end.
|
|
4729
|
+
*/
|
|
4730
|
+
class Completed_ extends UniffiEnum implements Completed__interface {
|
|
4731
|
+
/**
|
|
4732
|
+
* @private
|
|
4733
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4734
|
+
*/
|
|
4735
|
+
readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
|
|
4736
|
+
readonly tag = RecoveryStatus_Tags.Completed;
|
|
4737
|
+
readonly inner: Readonly<{ report: RecoveryReport }>;
|
|
4738
|
+
constructor(inner: { report: RecoveryReport }) {
|
|
4739
|
+
super("RecoveryStatus", "Completed");
|
|
4740
|
+
this.inner = Object.freeze(inner);
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4743
|
+
static new(inner: { report: RecoveryReport }): Completed_ {
|
|
4744
|
+
return new Completed_(inner);
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
static instanceOf(obj: any): obj is Completed_ {
|
|
4748
|
+
return obj.tag === RecoveryStatus_Tags.Completed;
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
|
|
4752
|
+
function instanceOf(obj: any): obj is RecoveryStatus {
|
|
4753
|
+
return obj[uniffiTypeNameSymbol] === "RecoveryStatus";
|
|
4754
|
+
}
|
|
4755
|
+
|
|
4756
|
+
return Object.freeze({
|
|
4757
|
+
instanceOf,
|
|
4758
|
+
NotRun: NotRun_,
|
|
4759
|
+
Failed: Failed_,
|
|
4760
|
+
Completed: Completed_,
|
|
4761
|
+
});
|
|
4762
|
+
})();
|
|
4763
|
+
|
|
4764
|
+
/**
|
|
4765
|
+
* Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
|
|
4766
|
+
* `bark::RecoveryStatus`.
|
|
4767
|
+
*
|
|
4768
|
+
* The three variants are distinguishable on purpose: `NotRun` means nothing
|
|
4769
|
+
* was attempted (wallet already existed locally, or `skip_recovery` was set),
|
|
4770
|
+
* `Failed` means the scan errored before producing a report so funds may be
|
|
4771
|
+
* missing until a retry succeeds, and `Completed` carries the report — whose
|
|
4772
|
+
* `is_complete` can still be `false` for individual VTXOs.
|
|
4773
|
+
*
|
|
4774
|
+
* Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
|
|
4775
|
+
*/
|
|
4776
|
+
|
|
4777
|
+
export type RecoveryStatus = InstanceType<
|
|
4778
|
+
(typeof RecoveryStatus)[keyof Omit<typeof RecoveryStatus, "instanceOf">]
|
|
4779
|
+
>;
|
|
4780
|
+
|
|
4781
|
+
// FfiConverter for enum RecoveryStatus
|
|
4782
|
+
const FfiConverterTypeRecoveryStatus = (() => {
|
|
4783
|
+
const ordinalConverter = FfiConverterInt32;
|
|
4784
|
+
type TypeName = RecoveryStatus;
|
|
4785
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4786
|
+
read(from: RustBuffer): TypeName {
|
|
4787
|
+
switch (ordinalConverter.read(from)) {
|
|
4788
|
+
case 1:
|
|
4789
|
+
return new RecoveryStatus.NotRun();
|
|
4790
|
+
case 2:
|
|
4791
|
+
return new RecoveryStatus.Failed({
|
|
4792
|
+
message: FfiConverterString.read(from),
|
|
4793
|
+
});
|
|
4794
|
+
case 3:
|
|
4795
|
+
return new RecoveryStatus.Completed({
|
|
4796
|
+
report: FfiConverterTypeRecoveryReport.read(from),
|
|
4797
|
+
});
|
|
4798
|
+
default:
|
|
4799
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
4803
|
+
switch (value.tag) {
|
|
4804
|
+
case RecoveryStatus_Tags.NotRun: {
|
|
4805
|
+
ordinalConverter.write(1, into);
|
|
4806
|
+
return;
|
|
4807
|
+
}
|
|
4808
|
+
case RecoveryStatus_Tags.Failed: {
|
|
4809
|
+
ordinalConverter.write(2, into);
|
|
4810
|
+
const inner = value.inner;
|
|
4811
|
+
FfiConverterString.write(inner.message, into);
|
|
4812
|
+
return;
|
|
4813
|
+
}
|
|
4814
|
+
case RecoveryStatus_Tags.Completed: {
|
|
4815
|
+
ordinalConverter.write(3, into);
|
|
4816
|
+
const inner = value.inner;
|
|
4817
|
+
FfiConverterTypeRecoveryReport.write(inner.report, into);
|
|
4818
|
+
return;
|
|
4819
|
+
}
|
|
4820
|
+
default:
|
|
4821
|
+
// Throwing from here means that RecoveryStatus_Tags hasn't matched an ordinal.
|
|
4822
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4823
|
+
}
|
|
4824
|
+
}
|
|
4825
|
+
allocationSize(value: TypeName): number {
|
|
4826
|
+
switch (value.tag) {
|
|
4827
|
+
case RecoveryStatus_Tags.NotRun: {
|
|
4828
|
+
return ordinalConverter.allocationSize(1);
|
|
4829
|
+
}
|
|
4830
|
+
case RecoveryStatus_Tags.Failed: {
|
|
4831
|
+
const inner = value.inner;
|
|
4832
|
+
let size = ordinalConverter.allocationSize(2);
|
|
4833
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
4834
|
+
return size;
|
|
4835
|
+
}
|
|
4836
|
+
case RecoveryStatus_Tags.Completed: {
|
|
4837
|
+
const inner = value.inner;
|
|
4838
|
+
let size = ordinalConverter.allocationSize(3);
|
|
4839
|
+
size += FfiConverterTypeRecoveryReport.allocationSize(inner.report);
|
|
4840
|
+
return size;
|
|
4841
|
+
}
|
|
4842
|
+
default:
|
|
4843
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4844
|
+
}
|
|
4845
|
+
}
|
|
4846
|
+
}
|
|
4847
|
+
return new FFIConverter();
|
|
4848
|
+
})();
|
|
4849
|
+
|
|
4850
|
+
/**
|
|
4851
|
+
* Lifecycle phase of a round participation, mirroring
|
|
4852
|
+
* `bark::round::RoundFlowKind`.
|
|
4853
|
+
*
|
|
4854
|
+
* Serde/TS tags match upstream's `Display` form: `"delegated-pending"` |
|
|
4855
|
+
* `"pending"` | `"ongoing"` | `"awaiting-confirmations"` | `"failed"` |
|
|
4856
|
+
* `"canceled"`.
|
|
4857
|
+
*/
|
|
4858
|
+
export enum RoundFlowKind {
|
|
4859
|
+
/**
|
|
4860
|
+
* Delegated participation waiting for its scheduled round. See
|
|
4861
|
+
* [`RoundState::scheduled_height`].
|
|
4862
|
+
*/
|
|
4863
|
+
DelegatedPending,
|
|
4864
|
+
/**
|
|
4865
|
+
* Interactive participation waiting for its round.
|
|
4866
|
+
*/
|
|
4867
|
+
Pending,
|
|
4868
|
+
/**
|
|
4869
|
+
* The interactive part is being played out with the server.
|
|
4870
|
+
*/
|
|
4871
|
+
Ongoing,
|
|
4872
|
+
/**
|
|
4873
|
+
* The round finished; waiting for its funding tx to confirm.
|
|
4874
|
+
*/
|
|
4875
|
+
AwaitingConfirmations,
|
|
4876
|
+
/**
|
|
4877
|
+
* The participation failed.
|
|
4878
|
+
*/
|
|
4879
|
+
Failed,
|
|
4880
|
+
/**
|
|
4881
|
+
* The user canceled the participation.
|
|
4882
|
+
*/
|
|
4883
|
+
Canceled,
|
|
4884
|
+
}
|
|
4885
|
+
|
|
4886
|
+
const FfiConverterTypeRoundFlowKind = (() => {
|
|
4887
|
+
const ordinalConverter = FfiConverterInt32;
|
|
4888
|
+
type TypeName = RoundFlowKind;
|
|
4889
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4890
|
+
read(from: RustBuffer): TypeName {
|
|
4891
|
+
switch (ordinalConverter.read(from)) {
|
|
4892
|
+
case 1:
|
|
4893
|
+
return RoundFlowKind.DelegatedPending;
|
|
4894
|
+
case 2:
|
|
4895
|
+
return RoundFlowKind.Pending;
|
|
4896
|
+
case 3:
|
|
4897
|
+
return RoundFlowKind.Ongoing;
|
|
4898
|
+
case 4:
|
|
4899
|
+
return RoundFlowKind.AwaitingConfirmations;
|
|
4900
|
+
case 5:
|
|
4901
|
+
return RoundFlowKind.Failed;
|
|
4902
|
+
case 6:
|
|
4903
|
+
return RoundFlowKind.Canceled;
|
|
4904
|
+
default:
|
|
4905
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
4909
|
+
switch (value) {
|
|
4910
|
+
case RoundFlowKind.DelegatedPending:
|
|
4911
|
+
return ordinalConverter.write(1, into);
|
|
4912
|
+
case RoundFlowKind.Pending:
|
|
4913
|
+
return ordinalConverter.write(2, into);
|
|
4914
|
+
case RoundFlowKind.Ongoing:
|
|
4915
|
+
return ordinalConverter.write(3, into);
|
|
4916
|
+
case RoundFlowKind.AwaitingConfirmations:
|
|
4917
|
+
return ordinalConverter.write(4, into);
|
|
4918
|
+
case RoundFlowKind.Failed:
|
|
4919
|
+
return ordinalConverter.write(5, into);
|
|
4920
|
+
case RoundFlowKind.Canceled:
|
|
4921
|
+
return ordinalConverter.write(6, into);
|
|
4922
|
+
}
|
|
4923
|
+
}
|
|
4924
|
+
allocationSize(value: TypeName): number {
|
|
4925
|
+
return ordinalConverter.allocationSize(0);
|
|
4926
|
+
}
|
|
4927
|
+
}
|
|
4928
|
+
return new FFIConverter();
|
|
4929
|
+
})();
|
|
4930
|
+
|
|
4531
4931
|
// Enum: VtxoLockHolder
|
|
4532
4932
|
export enum VtxoLockHolder_Tags {
|
|
4533
4933
|
Action = "Action",
|
|
@@ -5360,6 +5760,18 @@ export interface CustomOnchainWalletCallbacks {
|
|
|
5360
5760
|
* * `tx_hex` - Hex-encoded transaction
|
|
5361
5761
|
*/
|
|
5362
5762
|
registerTx(txHex: string): /*throws*/ void;
|
|
5763
|
+
/**
|
|
5764
|
+
* Mark a wallet-known transaction as evicted from the mempool
|
|
5765
|
+
*
|
|
5766
|
+
* Bark calls this when a CPFP it broadcast was RBF-replaced by a competing
|
|
5767
|
+
* party, so the tx's inputs should return to coin selection immediately
|
|
5768
|
+
* instead of waiting for the sync eviction grace period. Only ever called
|
|
5769
|
+
* for a tx that has definitively been superseded on-chain.
|
|
5770
|
+
*
|
|
5771
|
+
* # Arguments
|
|
5772
|
+
* * `txid` - Hex-encoded transaction id
|
|
5773
|
+
*/
|
|
5774
|
+
evictTx(txid: string): /*throws*/ void;
|
|
5363
5775
|
/**
|
|
5364
5776
|
* Create a signed P2A CPFP transaction
|
|
5365
5777
|
*
|
|
@@ -5565,6 +5977,33 @@ export class CustomOnchainWalletCallbacksImpl
|
|
|
5565
5977
|
);
|
|
5566
5978
|
}
|
|
5567
5979
|
|
|
5980
|
+
/**
|
|
5981
|
+
* Mark a wallet-known transaction as evicted from the mempool
|
|
5982
|
+
*
|
|
5983
|
+
* Bark calls this when a CPFP it broadcast was RBF-replaced by a competing
|
|
5984
|
+
* party, so the tx's inputs should return to coin selection immediately
|
|
5985
|
+
* instead of waiting for the sync eviction grace period. Only ever called
|
|
5986
|
+
* for a tx that has definitively been superseded on-chain.
|
|
5987
|
+
*
|
|
5988
|
+
* # Arguments
|
|
5989
|
+
* * `txid` - Hex-encoded transaction id
|
|
5990
|
+
*/
|
|
5991
|
+
evictTx(txid: string): void /*throws*/ {
|
|
5992
|
+
uniffiCaller.rustCallWithError(
|
|
5993
|
+
/*liftError:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError),
|
|
5994
|
+
/*caller:*/ (callStatus) => {
|
|
5995
|
+
nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_evict_tx(
|
|
5996
|
+
uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(
|
|
5997
|
+
this
|
|
5998
|
+
),
|
|
5999
|
+
FfiConverterString.lower(txid),
|
|
6000
|
+
callStatus
|
|
6001
|
+
);
|
|
6002
|
+
},
|
|
6003
|
+
/*liftString:*/ FfiConverterString.lift
|
|
6004
|
+
);
|
|
6005
|
+
}
|
|
6006
|
+
|
|
5568
6007
|
/**
|
|
5569
6008
|
* Create a signed P2A CPFP transaction
|
|
5570
6009
|
*
|
|
@@ -5892,6 +6331,27 @@ const uniffiCallbackInterfaceCustomOnchainWalletCallbacks: {
|
|
|
5892
6331
|
);
|
|
5893
6332
|
return uniffiResult;
|
|
5894
6333
|
},
|
|
6334
|
+
evictTx: (uniffiHandle: bigint, txid: Uint8Array) => {
|
|
6335
|
+
const uniffiMakeCall = (): void => {
|
|
6336
|
+
const jsCallback =
|
|
6337
|
+
FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
|
|
6338
|
+
return jsCallback.evictTx(FfiConverterString.lift(txid));
|
|
6339
|
+
};
|
|
6340
|
+
const uniffiResult = UniffiResult.ready<void>();
|
|
6341
|
+
const uniffiHandleSuccess = (obj: any) => {};
|
|
6342
|
+
const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
|
|
6343
|
+
UniffiResult.writeError(uniffiResult, code, errBuf);
|
|
6344
|
+
};
|
|
6345
|
+
uniffiTraitInterfaceCallWithError(
|
|
6346
|
+
/*makeCall:*/ uniffiMakeCall,
|
|
6347
|
+
/*handleSuccess:*/ uniffiHandleSuccess,
|
|
6348
|
+
/*handleError:*/ uniffiHandleError,
|
|
6349
|
+
/*isErrorType:*/ Exception.instanceOf,
|
|
6350
|
+
/*lowerError:*/ FfiConverterTypeError.lower.bind(FfiConverterTypeError),
|
|
6351
|
+
/*lowerString:*/ FfiConverterString.lower
|
|
6352
|
+
);
|
|
6353
|
+
return uniffiResult;
|
|
6354
|
+
},
|
|
5895
6355
|
makeSignedP2aCpfp: (uniffiHandle: bigint, params: Uint8Array) => {
|
|
5896
6356
|
const uniffiMakeCall = (): string => {
|
|
5897
6357
|
const jsCallback =
|
|
@@ -6217,6 +6677,16 @@ export interface OnchainWalletLike {
|
|
|
6217
6677
|
balance(asyncOpts_?: {
|
|
6218
6678
|
signal: AbortSignal;
|
|
6219
6679
|
}): /*throws*/ Promise<OnchainBalance>;
|
|
6680
|
+
/**
|
|
6681
|
+
* Mark a wallet-known transaction as evicted from the mempool, so its
|
|
6682
|
+
* inputs return to coin selection immediately. Only for a tx that has
|
|
6683
|
+
* definitively been superseded on-chain (e.g. an RBF-replaced exit CPFP);
|
|
6684
|
+
* evicting a still-in-flight tx invites a self-inflicted double-spend.
|
|
6685
|
+
*/
|
|
6686
|
+
evictTx(
|
|
6687
|
+
txid: string,
|
|
6688
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
6689
|
+
): /*throws*/ Promise<void>;
|
|
6220
6690
|
/**
|
|
6221
6691
|
* Cached network fee-rate estimates from the wallet's chain source.
|
|
6222
6692
|
*/
|
|
@@ -6385,6 +6855,45 @@ export class OnchainWallet
|
|
|
6385
6855
|
}
|
|
6386
6856
|
}
|
|
6387
6857
|
|
|
6858
|
+
/**
|
|
6859
|
+
* Mark a wallet-known transaction as evicted from the mempool, so its
|
|
6860
|
+
* inputs return to coin selection immediately. Only for a tx that has
|
|
6861
|
+
* definitively been superseded on-chain (e.g. an RBF-replaced exit CPFP);
|
|
6862
|
+
* evicting a still-in-flight tx invites a self-inflicted double-spend.
|
|
6863
|
+
*/
|
|
6864
|
+
async evictTx(
|
|
6865
|
+
txid: string,
|
|
6866
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
6867
|
+
): Promise<void> /*throws*/ {
|
|
6868
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6869
|
+
try {
|
|
6870
|
+
return await uniffiRustCallAsync(
|
|
6871
|
+
/*rustCaller:*/ uniffiCaller,
|
|
6872
|
+
/*rustFutureFunc:*/ () => {
|
|
6873
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_evict_tx(
|
|
6874
|
+
uniffiTypeOnchainWalletObjectFactory.clonePointer(this),
|
|
6875
|
+
FfiConverterString.lower(txid)
|
|
6876
|
+
);
|
|
6877
|
+
},
|
|
6878
|
+
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
|
|
6879
|
+
/*cancelFunc:*/ nativeModule()
|
|
6880
|
+
.ubrn_ffi_bark_ffi_rust_future_cancel_void,
|
|
6881
|
+
/*completeFunc:*/ nativeModule()
|
|
6882
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_void,
|
|
6883
|
+
/*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
|
|
6884
|
+
/*liftFunc:*/ (_v) => {},
|
|
6885
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6886
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6887
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
6888
|
+
);
|
|
6889
|
+
} catch (__error: any) {
|
|
6890
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6891
|
+
__error.stack = __stack;
|
|
6892
|
+
}
|
|
6893
|
+
throw __error;
|
|
6894
|
+
}
|
|
6895
|
+
}
|
|
6896
|
+
|
|
6388
6897
|
/**
|
|
6389
6898
|
* Cached network fee-rate estimates from the wallet's chain source.
|
|
6390
6899
|
*/
|
|
@@ -6877,6 +7386,26 @@ export interface WalletLike {
|
|
|
6877
7386
|
amountSats: /*u64*/ bigint,
|
|
6878
7387
|
asyncOpts_?: { signal: AbortSignal }
|
|
6879
7388
|
): /*throws*/ Promise<FeeEstimate>;
|
|
7389
|
+
/**
|
|
7390
|
+
* Estimate the onchain cost of unilaterally (emergency) exiting VTXOs.
|
|
7391
|
+
* Mirrors bark-rest `GET /exits/fee`.
|
|
7392
|
+
*
|
|
7393
|
+
* Pass an empty `vtxo_ids` to price exiting the whole wallet (every
|
|
7394
|
+
* spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
|
|
7395
|
+
* use the chain's fast rate for the broadcast leg and regular rate for
|
|
7396
|
+
* the claim leg. `destination` only affects the claim transaction's weight.
|
|
7397
|
+
*
|
|
7398
|
+
* The onchain wallet is synced first so `fundable` reflects the current
|
|
7399
|
+
* confirmed balance. Requires a BDK onchain wallet: callback-backed
|
|
7400
|
+
* wallets (`CustomOnchainWalletCallbacks`) cannot simulate the CPFP walk
|
|
7401
|
+
* and return an error.
|
|
7402
|
+
*/
|
|
7403
|
+
estimateEmergencyExitFee(
|
|
7404
|
+
vtxoIds: Array<string>,
|
|
7405
|
+
feeRateSatPerVb: /*u64*/ bigint | undefined,
|
|
7406
|
+
destination: string | undefined,
|
|
7407
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
7408
|
+
): /*throws*/ Promise<EmergencyExitFeeEstimate>;
|
|
6880
7409
|
estimateLightningReceiveFee(
|
|
6881
7410
|
amountSats: /*u64*/ bigint,
|
|
6882
7411
|
asyncOpts_?: { signal: AbortSignal }
|
|
@@ -7086,17 +7615,23 @@ export interface WalletLike {
|
|
|
7086
7615
|
asyncOpts_?: { signal: AbortSignal }
|
|
7087
7616
|
): /*throws*/ Promise<RecoveryReport>;
|
|
7088
7617
|
/**
|
|
7089
|
-
*
|
|
7090
|
-
* if
|
|
7091
|
-
*
|
|
7092
|
-
* Recovery only runs on the open that creates the wallet locally, and not
|
|
7093
|
-
* at all when `WalletOpenArgs.skip_recovery` is set, so this is empty on
|
|
7094
|
-
* every subsequent open. It is also empty when the scan itself failed
|
|
7095
|
-
* outright — bark logs that and lets open succeed, so an empty result does
|
|
7096
|
-
* not prove no funds are missing. `isComplete == false` means funds may
|
|
7097
|
-
* still be missing; retry the report's `failed` ids with `recoverVtxos`.
|
|
7618
|
+
* The report of the seed-recovery scan that ran during `Wallet::open`, or
|
|
7619
|
+
* none if the scan did not complete. Use `recovery_status` to tell a scan
|
|
7620
|
+
* that failed apart from one that never ran.
|
|
7098
7621
|
*/
|
|
7099
7622
|
recoveryReport(): RecoveryReport | undefined;
|
|
7623
|
+
/**
|
|
7624
|
+
* Outcome of the seed-recovery scan that ran during `Wallet::open`.
|
|
7625
|
+
*
|
|
7626
|
+
* Recovery only runs on the open that creates the wallet locally, and not
|
|
7627
|
+
* at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
|
|
7628
|
+
* on every subsequent open. `Failed` means the scan errored before
|
|
7629
|
+
* producing a report — bark logs that and lets open succeed — so funds
|
|
7630
|
+
* may be missing until a retry; `Completed` carries the report, and
|
|
7631
|
+
* `isComplete == false` there means funds may still be missing. Retry the
|
|
7632
|
+
* report's `failed` ids with `recoverVtxos`.
|
|
7633
|
+
*/
|
|
7634
|
+
recoveryStatus(): RecoveryStatus;
|
|
7100
7635
|
refreshServer(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
|
|
7101
7636
|
refreshVtxos(
|
|
7102
7637
|
vtxoIds: Array<string>,
|
|
@@ -7151,6 +7686,14 @@ export interface WalletLike {
|
|
|
7151
7686
|
asyncOpts_?: { signal: AbortSignal }
|
|
7152
7687
|
): /*throws*/ Promise<void>;
|
|
7153
7688
|
stopDaemon(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
|
|
7689
|
+
/**
|
|
7690
|
+
* Stop the background daemon and wait until its tasks have finished, so
|
|
7691
|
+
* nothing runs in the background afterwards (e.g. before deleting the
|
|
7692
|
+
* wallet's datadir). No-op when no daemon is running.
|
|
7693
|
+
*/
|
|
7694
|
+
stopDaemonWait(asyncOpts_?: {
|
|
7695
|
+
signal: AbortSignal;
|
|
7696
|
+
}): /*throws*/ Promise<void>;
|
|
7154
7697
|
stuckFailedLightningSends(asyncOpts_?: {
|
|
7155
7698
|
signal: AbortSignal;
|
|
7156
7699
|
}): /*throws*/ Promise<Array<LightningSend>>;
|
|
@@ -7183,6 +7726,12 @@ export interface WalletLike {
|
|
|
7183
7726
|
expectedHolder: VtxoLockHolder | undefined,
|
|
7184
7727
|
asyncOpts_?: { signal: AbortSignal }
|
|
7185
7728
|
): /*throws*/ Promise<void>;
|
|
7729
|
+
/**
|
|
7730
|
+
* Whether this wallet can pay `address` out-of-round: same network and
|
|
7731
|
+
* server, a supported VTXO policy, and only delivery mechanisms this bark
|
|
7732
|
+
* supports. An address listing no delivery mechanism is valid. Errors only
|
|
7733
|
+
* when the address does not parse.
|
|
7734
|
+
*/
|
|
7186
7735
|
validateArkoorAddress(
|
|
7187
7736
|
address: string,
|
|
7188
7737
|
asyncOpts_?: { signal: AbortSignal }
|
|
@@ -8107,6 +8656,61 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
8107
8656
|
}
|
|
8108
8657
|
}
|
|
8109
8658
|
|
|
8659
|
+
/**
|
|
8660
|
+
* Estimate the onchain cost of unilaterally (emergency) exiting VTXOs.
|
|
8661
|
+
* Mirrors bark-rest `GET /exits/fee`.
|
|
8662
|
+
*
|
|
8663
|
+
* Pass an empty `vtxo_ids` to price exiting the whole wallet (every
|
|
8664
|
+
* spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
|
|
8665
|
+
* use the chain's fast rate for the broadcast leg and regular rate for
|
|
8666
|
+
* the claim leg. `destination` only affects the claim transaction's weight.
|
|
8667
|
+
*
|
|
8668
|
+
* The onchain wallet is synced first so `fundable` reflects the current
|
|
8669
|
+
* confirmed balance. Requires a BDK onchain wallet: callback-backed
|
|
8670
|
+
* wallets (`CustomOnchainWalletCallbacks`) cannot simulate the CPFP walk
|
|
8671
|
+
* and return an error.
|
|
8672
|
+
*/
|
|
8673
|
+
async estimateEmergencyExitFee(
|
|
8674
|
+
vtxoIds: Array<string>,
|
|
8675
|
+
feeRateSatPerVb: /*u64*/ bigint | undefined,
|
|
8676
|
+
destination: string | undefined,
|
|
8677
|
+
asyncOpts_?: { signal: AbortSignal }
|
|
8678
|
+
): Promise<EmergencyExitFeeEstimate> /*throws*/ {
|
|
8679
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
8680
|
+
try {
|
|
8681
|
+
return await uniffiRustCallAsync(
|
|
8682
|
+
/*rustCaller:*/ uniffiCaller,
|
|
8683
|
+
/*rustFutureFunc:*/ () => {
|
|
8684
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_estimate_emergency_exit_fee(
|
|
8685
|
+
uniffiTypeWalletObjectFactory.clonePointer(this),
|
|
8686
|
+
FfiConverterArrayString.lower(vtxoIds),
|
|
8687
|
+
FfiConverterOptionalUInt64.lower(feeRateSatPerVb),
|
|
8688
|
+
FfiConverterOptionalString.lower(destination)
|
|
8689
|
+
);
|
|
8690
|
+
},
|
|
8691
|
+
/*pollFunc:*/ nativeModule()
|
|
8692
|
+
.ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
8693
|
+
/*cancelFunc:*/ nativeModule()
|
|
8694
|
+
.ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
|
|
8695
|
+
/*completeFunc:*/ nativeModule()
|
|
8696
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
|
|
8697
|
+
/*freeFunc:*/ nativeModule()
|
|
8698
|
+
.ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
|
|
8699
|
+
/*liftFunc:*/ FfiConverterTypeEmergencyExitFeeEstimate.lift.bind(
|
|
8700
|
+
FfiConverterTypeEmergencyExitFeeEstimate
|
|
8701
|
+
),
|
|
8702
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
8703
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
8704
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
8705
|
+
);
|
|
8706
|
+
} catch (__error: any) {
|
|
8707
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
8708
|
+
__error.stack = __stack;
|
|
8709
|
+
}
|
|
8710
|
+
throw __error;
|
|
8711
|
+
}
|
|
8712
|
+
}
|
|
8713
|
+
|
|
8110
8714
|
async estimateLightningReceiveFee(
|
|
8111
8715
|
amountSats: /*u64*/ bigint,
|
|
8112
8716
|
asyncOpts_?: { signal: AbortSignal }
|
|
@@ -9907,15 +10511,9 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
9907
10511
|
}
|
|
9908
10512
|
|
|
9909
10513
|
/**
|
|
9910
|
-
*
|
|
9911
|
-
* if
|
|
9912
|
-
*
|
|
9913
|
-
* Recovery only runs on the open that creates the wallet locally, and not
|
|
9914
|
-
* at all when `WalletOpenArgs.skip_recovery` is set, so this is empty on
|
|
9915
|
-
* every subsequent open. It is also empty when the scan itself failed
|
|
9916
|
-
* outright — bark logs that and lets open succeed, so an empty result does
|
|
9917
|
-
* not prove no funds are missing. `isComplete == false` means funds may
|
|
9918
|
-
* still be missing; retry the report's `failed` ids with `recoverVtxos`.
|
|
10514
|
+
* The report of the seed-recovery scan that ran during `Wallet::open`, or
|
|
10515
|
+
* none if the scan did not complete. Use `recovery_status` to tell a scan
|
|
10516
|
+
* that failed apart from one that never ran.
|
|
9919
10517
|
*/
|
|
9920
10518
|
recoveryReport(): RecoveryReport | undefined {
|
|
9921
10519
|
return FfiConverterOptionalTypeRecoveryReport.lift(
|
|
@@ -9931,6 +10529,31 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
9931
10529
|
);
|
|
9932
10530
|
}
|
|
9933
10531
|
|
|
10532
|
+
/**
|
|
10533
|
+
* Outcome of the seed-recovery scan that ran during `Wallet::open`.
|
|
10534
|
+
*
|
|
10535
|
+
* Recovery only runs on the open that creates the wallet locally, and not
|
|
10536
|
+
* at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
|
|
10537
|
+
* on every subsequent open. `Failed` means the scan errored before
|
|
10538
|
+
* producing a report — bark logs that and lets open succeed — so funds
|
|
10539
|
+
* may be missing until a retry; `Completed` carries the report, and
|
|
10540
|
+
* `isComplete == false` there means funds may still be missing. Retry the
|
|
10541
|
+
* report's `failed` ids with `recoverVtxos`.
|
|
10542
|
+
*/
|
|
10543
|
+
recoveryStatus(): RecoveryStatus {
|
|
10544
|
+
return FfiConverterTypeRecoveryStatus.lift(
|
|
10545
|
+
uniffiCaller.rustCall(
|
|
10546
|
+
/*caller:*/ (callStatus) => {
|
|
10547
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_recovery_status(
|
|
10548
|
+
uniffiTypeWalletObjectFactory.clonePointer(this),
|
|
10549
|
+
callStatus
|
|
10550
|
+
);
|
|
10551
|
+
},
|
|
10552
|
+
/*liftString:*/ FfiConverterString.lift
|
|
10553
|
+
)
|
|
10554
|
+
);
|
|
10555
|
+
}
|
|
10556
|
+
|
|
9934
10557
|
async refreshServer(asyncOpts_?: {
|
|
9935
10558
|
signal: AbortSignal;
|
|
9936
10559
|
}): Promise<void> /*throws*/ {
|
|
@@ -10386,6 +11009,42 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
10386
11009
|
}
|
|
10387
11010
|
}
|
|
10388
11011
|
|
|
11012
|
+
/**
|
|
11013
|
+
* Stop the background daemon and wait until its tasks have finished, so
|
|
11014
|
+
* nothing runs in the background afterwards (e.g. before deleting the
|
|
11015
|
+
* wallet's datadir). No-op when no daemon is running.
|
|
11016
|
+
*/
|
|
11017
|
+
async stopDaemonWait(asyncOpts_?: {
|
|
11018
|
+
signal: AbortSignal;
|
|
11019
|
+
}): Promise<void> /*throws*/ {
|
|
11020
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
11021
|
+
try {
|
|
11022
|
+
return await uniffiRustCallAsync(
|
|
11023
|
+
/*rustCaller:*/ uniffiCaller,
|
|
11024
|
+
/*rustFutureFunc:*/ () => {
|
|
11025
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_stop_daemon_wait(
|
|
11026
|
+
uniffiTypeWalletObjectFactory.clonePointer(this)
|
|
11027
|
+
);
|
|
11028
|
+
},
|
|
11029
|
+
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
|
|
11030
|
+
/*cancelFunc:*/ nativeModule()
|
|
11031
|
+
.ubrn_ffi_bark_ffi_rust_future_cancel_void,
|
|
11032
|
+
/*completeFunc:*/ nativeModule()
|
|
11033
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_void,
|
|
11034
|
+
/*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
|
|
11035
|
+
/*liftFunc:*/ (_v) => {},
|
|
11036
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
11037
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
11038
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
11039
|
+
);
|
|
11040
|
+
} catch (__error: any) {
|
|
11041
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
11042
|
+
__error.stack = __stack;
|
|
11043
|
+
}
|
|
11044
|
+
throw __error;
|
|
11045
|
+
}
|
|
11046
|
+
}
|
|
11047
|
+
|
|
10389
11048
|
async stuckFailedLightningSends(asyncOpts_?: {
|
|
10390
11049
|
signal: AbortSignal;
|
|
10391
11050
|
}): Promise<Array<LightningSend>> /*throws*/ {
|
|
@@ -10661,6 +11320,12 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
10661
11320
|
}
|
|
10662
11321
|
}
|
|
10663
11322
|
|
|
11323
|
+
/**
|
|
11324
|
+
* Whether this wallet can pay `address` out-of-round: same network and
|
|
11325
|
+
* server, a supported VTXO policy, and only delivery mechanisms this bark
|
|
11326
|
+
* supports. An address listing no delivery mechanism is valid. Errors only
|
|
11327
|
+
* when the address does not parse.
|
|
11328
|
+
*/
|
|
10664
11329
|
async validateArkoorAddress(
|
|
10665
11330
|
address: string,
|
|
10666
11331
|
asyncOpts_?: { signal: AbortSignal }
|
|
@@ -11127,9 +11792,17 @@ function uniffiEnsureInitialized() {
|
|
|
11127
11792
|
"uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_register_tx"
|
|
11128
11793
|
);
|
|
11129
11794
|
}
|
|
11795
|
+
if (
|
|
11796
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx() !==
|
|
11797
|
+
36298
|
|
11798
|
+
) {
|
|
11799
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
11800
|
+
"uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx"
|
|
11801
|
+
);
|
|
11802
|
+
}
|
|
11130
11803
|
if (
|
|
11131
11804
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !==
|
|
11132
|
-
|
|
11805
|
+
58200
|
|
11133
11806
|
) {
|
|
11134
11807
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
11135
11808
|
"uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp"
|
|
@@ -11137,7 +11810,7 @@ function uniffiEnsureInitialized() {
|
|
|
11137
11810
|
}
|
|
11138
11811
|
if (
|
|
11139
11812
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !==
|
|
11140
|
-
|
|
11813
|
+
64815
|
|
11141
11814
|
) {
|
|
11142
11815
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
11143
11816
|
"uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp"
|
|
@@ -11145,7 +11818,7 @@ function uniffiEnsureInitialized() {
|
|
|
11145
11818
|
}
|
|
11146
11819
|
if (
|
|
11147
11820
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync() !==
|
|
11148
|
-
|
|
11821
|
+
29018
|
|
11149
11822
|
) {
|
|
11150
11823
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
11151
11824
|
"uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync"
|
|
@@ -11167,6 +11840,14 @@ function uniffiEnsureInitialized() {
|
|
|
11167
11840
|
"uniffi_bark_ffi_checksum_method_onchainwallet_balance"
|
|
11168
11841
|
);
|
|
11169
11842
|
}
|
|
11843
|
+
if (
|
|
11844
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_evict_tx() !==
|
|
11845
|
+
26786
|
|
11846
|
+
) {
|
|
11847
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
11848
|
+
"uniffi_bark_ffi_checksum_method_onchainwallet_evict_tx"
|
|
11849
|
+
);
|
|
11850
|
+
}
|
|
11170
11851
|
if (
|
|
11171
11852
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates() !==
|
|
11172
11853
|
30741
|
|
@@ -11415,6 +12096,14 @@ function uniffiEnsureInitialized() {
|
|
|
11415
12096
|
"uniffi_bark_ffi_checksum_method_wallet_estimate_board_fee"
|
|
11416
12097
|
);
|
|
11417
12098
|
}
|
|
12099
|
+
if (
|
|
12100
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_emergency_exit_fee() !==
|
|
12101
|
+
44713
|
|
12102
|
+
) {
|
|
12103
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
12104
|
+
"uniffi_bark_ffi_checksum_method_wallet_estimate_emergency_exit_fee"
|
|
12105
|
+
);
|
|
12106
|
+
}
|
|
11418
12107
|
if (
|
|
11419
12108
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_estimate_lightning_receive_fee() !==
|
|
11420
12109
|
33637
|
|
@@ -11833,12 +12522,20 @@ function uniffiEnsureInitialized() {
|
|
|
11833
12522
|
}
|
|
11834
12523
|
if (
|
|
11835
12524
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_report() !==
|
|
11836
|
-
|
|
12525
|
+
10331
|
|
11837
12526
|
) {
|
|
11838
12527
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
11839
12528
|
"uniffi_bark_ffi_checksum_method_wallet_recovery_report"
|
|
11840
12529
|
);
|
|
11841
12530
|
}
|
|
12531
|
+
if (
|
|
12532
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_status() !==
|
|
12533
|
+
14132
|
|
12534
|
+
) {
|
|
12535
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
12536
|
+
"uniffi_bark_ffi_checksum_method_wallet_recovery_status"
|
|
12537
|
+
);
|
|
12538
|
+
}
|
|
11842
12539
|
if (
|
|
11843
12540
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !==
|
|
11844
12541
|
41162
|
|
@@ -11943,6 +12640,14 @@ function uniffiEnsureInitialized() {
|
|
|
11943
12640
|
"uniffi_bark_ffi_checksum_method_wallet_stop_daemon"
|
|
11944
12641
|
);
|
|
11945
12642
|
}
|
|
12643
|
+
if (
|
|
12644
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait() !==
|
|
12645
|
+
1734
|
|
12646
|
+
) {
|
|
12647
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
12648
|
+
"uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait"
|
|
12649
|
+
);
|
|
12650
|
+
}
|
|
11946
12651
|
if (
|
|
11947
12652
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends() !==
|
|
11948
12653
|
31451
|
|
@@ -12008,7 +12713,7 @@ function uniffiEnsureInitialized() {
|
|
|
12008
12713
|
}
|
|
12009
12714
|
if (
|
|
12010
12715
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address() !==
|
|
12011
|
-
|
|
12716
|
+
30498
|
|
12012
12717
|
) {
|
|
12013
12718
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
12014
12719
|
"uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address"
|
|
@@ -12072,6 +12777,7 @@ export default Object.freeze({
|
|
|
12072
12777
|
FfiConverterTypeCpfpParams,
|
|
12073
12778
|
FfiConverterTypeCustomOnchainWalletCallbacks,
|
|
12074
12779
|
FfiConverterTypeDestination,
|
|
12780
|
+
FfiConverterTypeEmergencyExitFeeEstimate,
|
|
12075
12781
|
FfiConverterTypeError,
|
|
12076
12782
|
FfiConverterTypeExitCancelFailure,
|
|
12077
12783
|
FfiConverterTypeExitCancelResult,
|
|
@@ -12107,7 +12813,9 @@ export default Object.freeze({
|
|
|
12107
12813
|
FfiConverterTypePpmExpiryFeeEntry,
|
|
12108
12814
|
FfiConverterTypeRecoveryBucket,
|
|
12109
12815
|
FfiConverterTypeRecoveryReport,
|
|
12816
|
+
FfiConverterTypeRecoveryStatus,
|
|
12110
12817
|
FfiConverterTypeRefreshFees,
|
|
12818
|
+
FfiConverterTypeRoundFlowKind,
|
|
12111
12819
|
FfiConverterTypeRoundState,
|
|
12112
12820
|
FfiConverterTypeVtxo,
|
|
12113
12821
|
FfiConverterTypeVtxoLockHolder,
|