@secondts/bark-react-native 0.22.0 → 0.24.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.
@@ -84,6 +84,23 @@ const uniffiIsDebug =
84
84
  false;
85
85
  // Public interface members begin here.
86
86
 
87
+ /**
88
+ * Default for `Config.vtxo_key_gap_limit`: the run of consecutive unused
89
+ * seed-derived VTXO key indices a scan crosses before concluding a VTXO
90
+ * isn't ours.
91
+ */
92
+ export function defaultVtxoKeyGapLimit(): /*u32*/ number {
93
+ return FfiConverterUInt32.lift(
94
+ uniffiCaller.rustCall(
95
+ /*caller:*/ (callStatus) => {
96
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_func_default_vtxo_key_gap_limit(
97
+ callStatus
98
+ );
99
+ },
100
+ /*liftString:*/ FfiConverterString.lift
101
+ )
102
+ );
103
+ }
87
104
  /**
88
105
  * Extract a signed transaction from a PSBT
89
106
  *
@@ -128,6 +145,23 @@ export function generateMnemonic(): string /*throws*/ {
128
145
  )
129
146
  );
130
147
  }
148
+ /**
149
+ * Largest value `Config.vtxo_key_gap_limit` (or an import/recovery
150
+ * `gap_limit` override) accepts. A scan that matches nothing runs the limit
151
+ * to its end, so an unbounded limit is unbounded work.
152
+ */
153
+ export function maxVtxoKeyGapLimit(): /*u32*/ number {
154
+ return FfiConverterUInt32.lift(
155
+ uniffiCaller.rustCall(
156
+ /*caller:*/ (callStatus) => {
157
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_func_max_vtxo_key_gap_limit(
158
+ callStatus
159
+ );
160
+ },
161
+ /*liftString:*/ FfiConverterString.lift
162
+ )
163
+ );
164
+ }
131
165
  /**
132
166
  * Validate an Ark address (basic format check only)
133
167
  *
@@ -616,7 +650,7 @@ export type Config = {
616
650
  bitcoindCookiefile?: string;
617
651
  bitcoindUser?: string;
618
652
  bitcoindPass?: string;
619
- vtxoRefreshExpiryThreshold?: /*u32*/ number;
653
+ vtxoRefreshExpiryThreshold?: /*u16*/ number;
620
654
  vtxoExitMargin?: /*u16*/ number;
621
655
  htlcRecvClaimDelta?: /*u16*/ number;
622
656
  fallbackFeeRate?: /*u64*/ bigint;
@@ -626,6 +660,20 @@ export type Config = {
626
660
  daemonManualSync?: boolean;
627
661
  lightningReceiveClaimRetries?: /*u8*/ number;
628
662
  userAgent?: string;
663
+ /**
664
+ * How many consecutive unused seed-derived VTXO key indices a scan
665
+ * crosses before concluding a VTXO isn't ours.
666
+ *
667
+ * Used by `Wallet::recover_vtxos` and `Wallet::import_vtxo(s)`, and by
668
+ * the seed-recovery scan that runs at wallet creation. Every match
669
+ * extends the window, so this bounds the run of unused indices, not the
670
+ * total keys derived. Raise it for a wallet that handed out many
671
+ * addresses without receiving into them.
672
+ *
673
+ * Default: 250. Capped at 100_000; a higher value is rejected when the
674
+ * wallet is opened or created.
675
+ */
676
+ vtxoKeyGapLimit?: /*u32*/ number;
629
677
  };
630
678
 
631
679
  /**
@@ -655,7 +703,7 @@ const FfiConverterTypeConfig = (() => {
655
703
  bitcoindCookiefile: FfiConverterOptionalString.read(from),
656
704
  bitcoindUser: FfiConverterOptionalString.read(from),
657
705
  bitcoindPass: FfiConverterOptionalString.read(from),
658
- vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt32.read(from),
706
+ vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt16.read(from),
659
707
  vtxoExitMargin: FfiConverterOptionalUInt16.read(from),
660
708
  htlcRecvClaimDelta: FfiConverterOptionalUInt16.read(from),
661
709
  fallbackFeeRate: FfiConverterOptionalUInt64.read(from),
@@ -665,6 +713,7 @@ const FfiConverterTypeConfig = (() => {
665
713
  daemonManualSync: FfiConverterOptionalBool.read(from),
666
714
  lightningReceiveClaimRetries: FfiConverterOptionalUInt8.read(from),
667
715
  userAgent: FfiConverterOptionalString.read(from),
716
+ vtxoKeyGapLimit: FfiConverterOptionalUInt32.read(from),
668
717
  };
669
718
  }
670
719
  write(value: TypeName, into: RustBuffer): void {
@@ -675,7 +724,7 @@ const FfiConverterTypeConfig = (() => {
675
724
  FfiConverterOptionalString.write(value.bitcoindCookiefile, into);
676
725
  FfiConverterOptionalString.write(value.bitcoindUser, into);
677
726
  FfiConverterOptionalString.write(value.bitcoindPass, into);
678
- FfiConverterOptionalUInt32.write(value.vtxoRefreshExpiryThreshold, into);
727
+ FfiConverterOptionalUInt16.write(value.vtxoRefreshExpiryThreshold, into);
679
728
  FfiConverterOptionalUInt16.write(value.vtxoExitMargin, into);
680
729
  FfiConverterOptionalUInt16.write(value.htlcRecvClaimDelta, into);
681
730
  FfiConverterOptionalUInt64.write(value.fallbackFeeRate, into);
@@ -691,6 +740,7 @@ const FfiConverterTypeConfig = (() => {
691
740
  FfiConverterOptionalBool.write(value.daemonManualSync, into);
692
741
  FfiConverterOptionalUInt8.write(value.lightningReceiveClaimRetries, into);
693
742
  FfiConverterOptionalString.write(value.userAgent, into);
743
+ FfiConverterOptionalUInt32.write(value.vtxoKeyGapLimit, into);
694
744
  }
695
745
  allocationSize(value: TypeName): number {
696
746
  return (
@@ -701,7 +751,7 @@ const FfiConverterTypeConfig = (() => {
701
751
  FfiConverterOptionalString.allocationSize(value.bitcoindCookiefile) +
702
752
  FfiConverterOptionalString.allocationSize(value.bitcoindUser) +
703
753
  FfiConverterOptionalString.allocationSize(value.bitcoindPass) +
704
- FfiConverterOptionalUInt32.allocationSize(
754
+ FfiConverterOptionalUInt16.allocationSize(
705
755
  value.vtxoRefreshExpiryThreshold
706
756
  ) +
707
757
  FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) +
@@ -720,7 +770,8 @@ const FfiConverterTypeConfig = (() => {
720
770
  FfiConverterOptionalUInt8.allocationSize(
721
771
  value.lightningReceiveClaimRetries
722
772
  ) +
723
- FfiConverterOptionalString.allocationSize(value.userAgent)
773
+ FfiConverterOptionalString.allocationSize(value.userAgent) +
774
+ FfiConverterOptionalUInt32.allocationSize(value.vtxoKeyGapLimit)
724
775
  );
725
776
  }
726
777
  }
@@ -1411,6 +1462,84 @@ const FfiConverterTypeFeeSchedule = (() => {
1411
1462
  return new FFIConverter();
1412
1463
  })();
1413
1464
 
1465
+ /**
1466
+ * Arguments for `Wallet::import_vtxo` / `Wallet::import_vtxos`, mirroring
1467
+ * `bark::ImportVtxoArgs`.
1468
+ *
1469
+ * Every field has a default, so callers only set what they need.
1470
+ */
1471
+ export type ImportVtxoArgs = {
1472
+ /**
1473
+ * Gap limit for the key scan that decides whether we own the VTXOs,
1474
+ * overriding `Config.vtxo_key_gap_limit` for this call.
1475
+ *
1476
+ * Default: none (use the wallet's configured limit)
1477
+ */
1478
+ gapLimit?: /*u32*/ number;
1479
+ /**
1480
+ * Import as spendable without asking the server for each VTXO's state.
1481
+ * Skipping the check is faster but can leave the wallet holding spent
1482
+ * VTXOs marked spendable, which then fail when selected as inputs.
1483
+ *
1484
+ * Default: false
1485
+ */
1486
+ skipStatusCheck: boolean;
1487
+ /**
1488
+ * Keep the VTXOs that import successfully even when another one in the
1489
+ * batch fails; the returned ids are the ones that were kept.
1490
+ *
1491
+ * Default: false, so a single failure discards the whole batch.
1492
+ */
1493
+ allowPartial: boolean;
1494
+ };
1495
+
1496
+ /**
1497
+ * Generated factory for {@link ImportVtxoArgs} record objects.
1498
+ */
1499
+ export const ImportVtxoArgs = (() => {
1500
+ const defaults = () => ({
1501
+ gapLimit: undefined,
1502
+ skipStatusCheck: false,
1503
+ allowPartial: false,
1504
+ });
1505
+ const create = (() => {
1506
+ return uniffiCreateRecord<ImportVtxoArgs, ReturnType<typeof defaults>>(
1507
+ defaults
1508
+ );
1509
+ })();
1510
+ return Object.freeze({
1511
+ create,
1512
+ new: create,
1513
+ defaults: () => Object.freeze(defaults()) as Partial<ImportVtxoArgs>,
1514
+ });
1515
+ })();
1516
+
1517
+ const FfiConverterTypeImportVtxoArgs = (() => {
1518
+ type TypeName = ImportVtxoArgs;
1519
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1520
+ read(from: RustBuffer): TypeName {
1521
+ return {
1522
+ gapLimit: FfiConverterOptionalUInt32.read(from),
1523
+ skipStatusCheck: FfiConverterBool.read(from),
1524
+ allowPartial: FfiConverterBool.read(from),
1525
+ };
1526
+ }
1527
+ write(value: TypeName, into: RustBuffer): void {
1528
+ FfiConverterOptionalUInt32.write(value.gapLimit, into);
1529
+ FfiConverterBool.write(value.skipStatusCheck, into);
1530
+ FfiConverterBool.write(value.allowPartial, into);
1531
+ }
1532
+ allocationSize(value: TypeName): number {
1533
+ return (
1534
+ FfiConverterOptionalUInt32.allocationSize(value.gapLimit) +
1535
+ FfiConverterBool.allocationSize(value.skipStatusCheck) +
1536
+ FfiConverterBool.allocationSize(value.allowPartial)
1537
+ );
1538
+ }
1539
+ }
1540
+ return new FFIConverter();
1541
+ })();
1542
+
1414
1543
  export type LightningInvoice = {
1415
1544
  invoice: string;
1416
1545
  paymentHash: string;
@@ -2196,11 +2325,12 @@ export type RecoveryReport = {
2196
2325
  */
2197
2326
  skipped: RecoveryBucket;
2198
2327
  /**
2199
- * No matching key could be derived within the gap limit (50 consecutive
2200
- * unused indices). For a mailbox scan these are most likely this wallet's
2328
+ * No matching key could be derived within the gap limit (the configured
2329
+ * run of consecutive unused key indices, 250 by default). For a mailbox scan these are most likely this wallet's
2201
2330
  * own VTXOs, keyed beyond the limit, so funds may be missing; retrying
2202
- * won't help, only a wider gap limit. For `recover_vtxos` it just means
2203
- * the caller passed an id this wallet doesn't own.
2331
+ * won't help, only a wider gap limit (see `Config.vtxo_key_gap_limit` and
2332
+ * the `gap_limit` override on `recover_vtxos`). For `recover_vtxos` it
2333
+ * just means the caller passed an id this wallet doesn't own.
2204
2334
  */
2205
2335
  foreign: RecoveryBucket;
2206
2336
  /**
@@ -2326,9 +2456,19 @@ const FfiConverterTypeRefreshFees = (() => {
2326
2456
  export type RoundState = {
2327
2457
  id: /*u32*/ number;
2328
2458
  /**
2329
- * Whether the round is ongoing
2459
+ * Whether the interactive part of the round is ongoing. Equivalent to
2460
+ * `state` being `Pending` or `Ongoing`; kept for compatibility.
2330
2461
  */
2331
2462
  ongoing: boolean;
2463
+ /**
2464
+ * Lifecycle phase of the participation.
2465
+ */
2466
+ state: RoundFlowKind;
2467
+ /**
2468
+ * Block height a delegated participation waits for, if it asked the
2469
+ * server to schedule one. Only set while `state` is `DelegatedPending`.
2470
+ */
2471
+ scheduledHeight?: /*u32*/ number;
2332
2472
  };
2333
2473
 
2334
2474
  /**
@@ -2355,16 +2495,22 @@ const FfiConverterTypeRoundState = (() => {
2355
2495
  return {
2356
2496
  id: FfiConverterUInt32.read(from),
2357
2497
  ongoing: FfiConverterBool.read(from),
2498
+ state: FfiConverterTypeRoundFlowKind.read(from),
2499
+ scheduledHeight: FfiConverterOptionalUInt32.read(from),
2358
2500
  };
2359
2501
  }
2360
2502
  write(value: TypeName, into: RustBuffer): void {
2361
2503
  FfiConverterUInt32.write(value.id, into);
2362
2504
  FfiConverterBool.write(value.ongoing, into);
2505
+ FfiConverterTypeRoundFlowKind.write(value.state, into);
2506
+ FfiConverterOptionalUInt32.write(value.scheduledHeight, into);
2363
2507
  }
2364
2508
  allocationSize(value: TypeName): number {
2365
2509
  return (
2366
2510
  FfiConverterUInt32.allocationSize(value.id) +
2367
- FfiConverterBool.allocationSize(value.ongoing)
2511
+ FfiConverterBool.allocationSize(value.ongoing) +
2512
+ FfiConverterTypeRoundFlowKind.allocationSize(value.state) +
2513
+ FfiConverterOptionalUInt32.allocationSize(value.scheduledHeight)
2368
2514
  );
2369
2515
  }
2370
2516
  }
@@ -2492,7 +2638,7 @@ export type WalletOpenArgs = {
2492
2638
  * Whether to skip the seed-recovery mailbox scan
2493
2639
  *
2494
2640
  * The scan runs on the open that creates the wallet locally and makes
2495
- * network calls; its result is available from `Wallet::recovery_report`.
2641
+ * network calls; its outcome is available from `Wallet::recovery_status`.
2496
2642
  * Set this to open without it.
2497
2643
  *
2498
2644
  * Default: false
@@ -2506,7 +2652,6 @@ export type WalletOpenArgs = {
2506
2652
  export const WalletOpenArgs = (() => {
2507
2653
  const defaults = () => ({
2508
2654
  runDaemon: true,
2509
- onchain: undefined,
2510
2655
  createIfNotExists: true,
2511
2656
  createWithoutServer: false,
2512
2657
  skipRecovery: false,
@@ -4627,6 +4772,291 @@ const FfiConverterTypeOnchainUtxo = (() => {
4627
4772
  return new FFIConverter();
4628
4773
  })();
4629
4774
 
4775
+ // Enum: RecoveryStatus
4776
+ export enum RecoveryStatus_Tags {
4777
+ NotRun = "NotRun",
4778
+ Failed = "Failed",
4779
+ Completed = "Completed",
4780
+ }
4781
+ /**
4782
+ * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
4783
+ * `bark::RecoveryStatus`.
4784
+ *
4785
+ * The three variants are distinguishable on purpose: `NotRun` means nothing
4786
+ * was attempted (wallet already existed locally, or `skip_recovery` was set),
4787
+ * `Failed` means the scan errored before producing a report so funds may be
4788
+ * missing until a retry succeeds, and `Completed` carries the report — whose
4789
+ * `is_complete` can still be `false` for individual VTXOs.
4790
+ *
4791
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
4792
+ */
4793
+ export const RecoveryStatus = (() => {
4794
+ type NotRun__interface = {
4795
+ tag: RecoveryStatus_Tags.NotRun;
4796
+ };
4797
+
4798
+ /**
4799
+ * No scan was attempted.
4800
+ */
4801
+ class NotRun_ extends UniffiEnum implements NotRun__interface {
4802
+ /**
4803
+ * @private
4804
+ * This field is private and should not be used, use `tag` instead.
4805
+ */
4806
+ readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
4807
+ readonly tag = RecoveryStatus_Tags.NotRun;
4808
+ constructor() {
4809
+ super("RecoveryStatus", "NotRun");
4810
+ }
4811
+
4812
+ static new(): NotRun_ {
4813
+ return new NotRun_();
4814
+ }
4815
+
4816
+ static instanceOf(obj: any): obj is NotRun_ {
4817
+ return obj.tag === RecoveryStatus_Tags.NotRun;
4818
+ }
4819
+ }
4820
+
4821
+ type Failed__interface = {
4822
+ tag: RecoveryStatus_Tags.Failed;
4823
+ inner: Readonly<{ message: string }>;
4824
+ };
4825
+
4826
+ /**
4827
+ * The scan errored before it could produce a report.
4828
+ */
4829
+ class Failed_ extends UniffiEnum implements Failed__interface {
4830
+ /**
4831
+ * @private
4832
+ * This field is private and should not be used, use `tag` instead.
4833
+ */
4834
+ readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
4835
+ readonly tag = RecoveryStatus_Tags.Failed;
4836
+ readonly inner: Readonly<{ message: string }>;
4837
+ constructor(inner: { message: string }) {
4838
+ super("RecoveryStatus", "Failed");
4839
+ this.inner = Object.freeze(inner);
4840
+ }
4841
+
4842
+ static new(inner: { message: string }): Failed_ {
4843
+ return new Failed_(inner);
4844
+ }
4845
+
4846
+ static instanceOf(obj: any): obj is Failed_ {
4847
+ return obj.tag === RecoveryStatus_Tags.Failed;
4848
+ }
4849
+ }
4850
+
4851
+ type Completed__interface = {
4852
+ tag: RecoveryStatus_Tags.Completed;
4853
+ inner: Readonly<{ report: RecoveryReport }>;
4854
+ };
4855
+
4856
+ /**
4857
+ * The scan ran to the end.
4858
+ */
4859
+ class Completed_ extends UniffiEnum implements Completed__interface {
4860
+ /**
4861
+ * @private
4862
+ * This field is private and should not be used, use `tag` instead.
4863
+ */
4864
+ readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
4865
+ readonly tag = RecoveryStatus_Tags.Completed;
4866
+ readonly inner: Readonly<{ report: RecoveryReport }>;
4867
+ constructor(inner: { report: RecoveryReport }) {
4868
+ super("RecoveryStatus", "Completed");
4869
+ this.inner = Object.freeze(inner);
4870
+ }
4871
+
4872
+ static new(inner: { report: RecoveryReport }): Completed_ {
4873
+ return new Completed_(inner);
4874
+ }
4875
+
4876
+ static instanceOf(obj: any): obj is Completed_ {
4877
+ return obj.tag === RecoveryStatus_Tags.Completed;
4878
+ }
4879
+ }
4880
+
4881
+ function instanceOf(obj: any): obj is RecoveryStatus {
4882
+ return obj[uniffiTypeNameSymbol] === "RecoveryStatus";
4883
+ }
4884
+
4885
+ return Object.freeze({
4886
+ instanceOf,
4887
+ NotRun: NotRun_,
4888
+ Failed: Failed_,
4889
+ Completed: Completed_,
4890
+ });
4891
+ })();
4892
+
4893
+ /**
4894
+ * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
4895
+ * `bark::RecoveryStatus`.
4896
+ *
4897
+ * The three variants are distinguishable on purpose: `NotRun` means nothing
4898
+ * was attempted (wallet already existed locally, or `skip_recovery` was set),
4899
+ * `Failed` means the scan errored before producing a report so funds may be
4900
+ * missing until a retry succeeds, and `Completed` carries the report — whose
4901
+ * `is_complete` can still be `false` for individual VTXOs.
4902
+ *
4903
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
4904
+ */
4905
+
4906
+ export type RecoveryStatus = InstanceType<
4907
+ (typeof RecoveryStatus)[keyof Omit<typeof RecoveryStatus, "instanceOf">]
4908
+ >;
4909
+
4910
+ // FfiConverter for enum RecoveryStatus
4911
+ const FfiConverterTypeRecoveryStatus = (() => {
4912
+ const ordinalConverter = FfiConverterInt32;
4913
+ type TypeName = RecoveryStatus;
4914
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
4915
+ read(from: RustBuffer): TypeName {
4916
+ switch (ordinalConverter.read(from)) {
4917
+ case 1:
4918
+ return new RecoveryStatus.NotRun();
4919
+ case 2:
4920
+ return new RecoveryStatus.Failed({
4921
+ message: FfiConverterString.read(from),
4922
+ });
4923
+ case 3:
4924
+ return new RecoveryStatus.Completed({
4925
+ report: FfiConverterTypeRecoveryReport.read(from),
4926
+ });
4927
+ default:
4928
+ throw new UniffiInternalError.UnexpectedEnumCase();
4929
+ }
4930
+ }
4931
+ write(value: TypeName, into: RustBuffer): void {
4932
+ switch (value.tag) {
4933
+ case RecoveryStatus_Tags.NotRun: {
4934
+ ordinalConverter.write(1, into);
4935
+ return;
4936
+ }
4937
+ case RecoveryStatus_Tags.Failed: {
4938
+ ordinalConverter.write(2, into);
4939
+ const inner = value.inner;
4940
+ FfiConverterString.write(inner.message, into);
4941
+ return;
4942
+ }
4943
+ case RecoveryStatus_Tags.Completed: {
4944
+ ordinalConverter.write(3, into);
4945
+ const inner = value.inner;
4946
+ FfiConverterTypeRecoveryReport.write(inner.report, into);
4947
+ return;
4948
+ }
4949
+ default:
4950
+ // Throwing from here means that RecoveryStatus_Tags hasn't matched an ordinal.
4951
+ throw new UniffiInternalError.UnexpectedEnumCase();
4952
+ }
4953
+ }
4954
+ allocationSize(value: TypeName): number {
4955
+ switch (value.tag) {
4956
+ case RecoveryStatus_Tags.NotRun: {
4957
+ return ordinalConverter.allocationSize(1);
4958
+ }
4959
+ case RecoveryStatus_Tags.Failed: {
4960
+ const inner = value.inner;
4961
+ let size = ordinalConverter.allocationSize(2);
4962
+ size += FfiConverterString.allocationSize(inner.message);
4963
+ return size;
4964
+ }
4965
+ case RecoveryStatus_Tags.Completed: {
4966
+ const inner = value.inner;
4967
+ let size = ordinalConverter.allocationSize(3);
4968
+ size += FfiConverterTypeRecoveryReport.allocationSize(inner.report);
4969
+ return size;
4970
+ }
4971
+ default:
4972
+ throw new UniffiInternalError.UnexpectedEnumCase();
4973
+ }
4974
+ }
4975
+ }
4976
+ return new FFIConverter();
4977
+ })();
4978
+
4979
+ /**
4980
+ * Lifecycle phase of a round participation, mirroring
4981
+ * `bark::round::RoundFlowKind`.
4982
+ *
4983
+ * Serde/TS tags match upstream's `Display` form: `"delegated-pending"` |
4984
+ * `"pending"` | `"ongoing"` | `"awaiting-confirmations"` | `"failed"` |
4985
+ * `"canceled"`.
4986
+ */
4987
+ export enum RoundFlowKind {
4988
+ /**
4989
+ * Delegated participation waiting for its scheduled round. See
4990
+ * [`RoundState::scheduled_height`].
4991
+ */
4992
+ DelegatedPending,
4993
+ /**
4994
+ * Interactive participation waiting for its round.
4995
+ */
4996
+ Pending,
4997
+ /**
4998
+ * The interactive part is being played out with the server.
4999
+ */
5000
+ Ongoing,
5001
+ /**
5002
+ * The round finished; waiting for its funding tx to confirm.
5003
+ */
5004
+ AwaitingConfirmations,
5005
+ /**
5006
+ * The participation failed.
5007
+ */
5008
+ Failed,
5009
+ /**
5010
+ * The user canceled the participation.
5011
+ */
5012
+ Canceled,
5013
+ }
5014
+
5015
+ const FfiConverterTypeRoundFlowKind = (() => {
5016
+ const ordinalConverter = FfiConverterInt32;
5017
+ type TypeName = RoundFlowKind;
5018
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5019
+ read(from: RustBuffer): TypeName {
5020
+ switch (ordinalConverter.read(from)) {
5021
+ case 1:
5022
+ return RoundFlowKind.DelegatedPending;
5023
+ case 2:
5024
+ return RoundFlowKind.Pending;
5025
+ case 3:
5026
+ return RoundFlowKind.Ongoing;
5027
+ case 4:
5028
+ return RoundFlowKind.AwaitingConfirmations;
5029
+ case 5:
5030
+ return RoundFlowKind.Failed;
5031
+ case 6:
5032
+ return RoundFlowKind.Canceled;
5033
+ default:
5034
+ throw new UniffiInternalError.UnexpectedEnumCase();
5035
+ }
5036
+ }
5037
+ write(value: TypeName, into: RustBuffer): void {
5038
+ switch (value) {
5039
+ case RoundFlowKind.DelegatedPending:
5040
+ return ordinalConverter.write(1, into);
5041
+ case RoundFlowKind.Pending:
5042
+ return ordinalConverter.write(2, into);
5043
+ case RoundFlowKind.Ongoing:
5044
+ return ordinalConverter.write(3, into);
5045
+ case RoundFlowKind.AwaitingConfirmations:
5046
+ return ordinalConverter.write(4, into);
5047
+ case RoundFlowKind.Failed:
5048
+ return ordinalConverter.write(5, into);
5049
+ case RoundFlowKind.Canceled:
5050
+ return ordinalConverter.write(6, into);
5051
+ }
5052
+ }
5053
+ allocationSize(value: TypeName): number {
5054
+ return ordinalConverter.allocationSize(0);
5055
+ }
5056
+ }
5057
+ return new FFIConverter();
5058
+ })();
5059
+
4630
5060
  // Enum: VtxoLockHolder
4631
5061
  export enum VtxoLockHolder_Tags {
4632
5062
  Action = "Action",
@@ -5459,6 +5889,18 @@ export interface CustomOnchainWalletCallbacks {
5459
5889
  * * `tx_hex` - Hex-encoded transaction
5460
5890
  */
5461
5891
  registerTx(txHex: string): /*throws*/ void;
5892
+ /**
5893
+ * Mark a wallet-known transaction as evicted from the mempool
5894
+ *
5895
+ * Bark calls this when a CPFP it broadcast was RBF-replaced by a competing
5896
+ * party, so the tx's inputs should return to coin selection immediately
5897
+ * instead of waiting for the sync eviction grace period. Only ever called
5898
+ * for a tx that has definitively been superseded on-chain.
5899
+ *
5900
+ * # Arguments
5901
+ * * `txid` - Hex-encoded transaction id
5902
+ */
5903
+ evictTx(txid: string): /*throws*/ void;
5462
5904
  /**
5463
5905
  * Create a signed P2A CPFP transaction
5464
5906
  *
@@ -5664,6 +6106,33 @@ export class CustomOnchainWalletCallbacksImpl
5664
6106
  );
5665
6107
  }
5666
6108
 
6109
+ /**
6110
+ * Mark a wallet-known transaction as evicted from the mempool
6111
+ *
6112
+ * Bark calls this when a CPFP it broadcast was RBF-replaced by a competing
6113
+ * party, so the tx's inputs should return to coin selection immediately
6114
+ * instead of waiting for the sync eviction grace period. Only ever called
6115
+ * for a tx that has definitively been superseded on-chain.
6116
+ *
6117
+ * # Arguments
6118
+ * * `txid` - Hex-encoded transaction id
6119
+ */
6120
+ evictTx(txid: string): void /*throws*/ {
6121
+ uniffiCaller.rustCallWithError(
6122
+ /*liftError:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError),
6123
+ /*caller:*/ (callStatus) => {
6124
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_evict_tx(
6125
+ uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(
6126
+ this
6127
+ ),
6128
+ FfiConverterString.lower(txid),
6129
+ callStatus
6130
+ );
6131
+ },
6132
+ /*liftString:*/ FfiConverterString.lift
6133
+ );
6134
+ }
6135
+
5667
6136
  /**
5668
6137
  * Create a signed P2A CPFP transaction
5669
6138
  *
@@ -5991,6 +6460,27 @@ const uniffiCallbackInterfaceCustomOnchainWalletCallbacks: {
5991
6460
  );
5992
6461
  return uniffiResult;
5993
6462
  },
6463
+ evictTx: (uniffiHandle: bigint, txid: Uint8Array) => {
6464
+ const uniffiMakeCall = (): void => {
6465
+ const jsCallback =
6466
+ FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
6467
+ return jsCallback.evictTx(FfiConverterString.lift(txid));
6468
+ };
6469
+ const uniffiResult = UniffiResult.ready<void>();
6470
+ const uniffiHandleSuccess = (obj: any) => {};
6471
+ const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
6472
+ UniffiResult.writeError(uniffiResult, code, errBuf);
6473
+ };
6474
+ uniffiTraitInterfaceCallWithError(
6475
+ /*makeCall:*/ uniffiMakeCall,
6476
+ /*handleSuccess:*/ uniffiHandleSuccess,
6477
+ /*handleError:*/ uniffiHandleError,
6478
+ /*isErrorType:*/ Exception.instanceOf,
6479
+ /*lowerError:*/ FfiConverterTypeError.lower.bind(FfiConverterTypeError),
6480
+ /*lowerString:*/ FfiConverterString.lower
6481
+ );
6482
+ return uniffiResult;
6483
+ },
5994
6484
  makeSignedP2aCpfp: (uniffiHandle: bigint, params: Uint8Array) => {
5995
6485
  const uniffiMakeCall = (): string => {
5996
6486
  const jsCallback =
@@ -6316,6 +6806,16 @@ export interface OnchainWalletLike {
6316
6806
  balance(asyncOpts_?: {
6317
6807
  signal: AbortSignal;
6318
6808
  }): /*throws*/ Promise<OnchainBalance>;
6809
+ /**
6810
+ * Mark a wallet-known transaction as evicted from the mempool, so its
6811
+ * inputs return to coin selection immediately. Only for a tx that has
6812
+ * definitively been superseded on-chain (e.g. an RBF-replaced exit CPFP);
6813
+ * evicting a still-in-flight tx invites a self-inflicted double-spend.
6814
+ */
6815
+ evictTx(
6816
+ txid: string,
6817
+ asyncOpts_?: { signal: AbortSignal }
6818
+ ): /*throws*/ Promise<void>;
6319
6819
  /**
6320
6820
  * Cached network fee-rate estimates from the wallet's chain source.
6321
6821
  */
@@ -6484,6 +6984,45 @@ export class OnchainWallet
6484
6984
  }
6485
6985
  }
6486
6986
 
6987
+ /**
6988
+ * Mark a wallet-known transaction as evicted from the mempool, so its
6989
+ * inputs return to coin selection immediately. Only for a tx that has
6990
+ * definitively been superseded on-chain (e.g. an RBF-replaced exit CPFP);
6991
+ * evicting a still-in-flight tx invites a self-inflicted double-spend.
6992
+ */
6993
+ async evictTx(
6994
+ txid: string,
6995
+ asyncOpts_?: { signal: AbortSignal }
6996
+ ): Promise<void> /*throws*/ {
6997
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
6998
+ try {
6999
+ return await uniffiRustCallAsync(
7000
+ /*rustCaller:*/ uniffiCaller,
7001
+ /*rustFutureFunc:*/ () => {
7002
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_evict_tx(
7003
+ uniffiTypeOnchainWalletObjectFactory.clonePointer(this),
7004
+ FfiConverterString.lower(txid)
7005
+ );
7006
+ },
7007
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
7008
+ /*cancelFunc:*/ nativeModule()
7009
+ .ubrn_ffi_bark_ffi_rust_future_cancel_void,
7010
+ /*completeFunc:*/ nativeModule()
7011
+ .ubrn_ffi_bark_ffi_rust_future_complete_void,
7012
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
7013
+ /*liftFunc:*/ (_v) => {},
7014
+ /*liftString:*/ FfiConverterString.lift,
7015
+ /*asyncOpts:*/ asyncOpts_,
7016
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
7017
+ );
7018
+ } catch (__error: any) {
7019
+ if (uniffiIsDebug && __error instanceof Error) {
7020
+ __error.stack = __stack;
7021
+ }
7022
+ throw __error;
7023
+ }
7024
+ }
7025
+
6487
7026
  /**
6488
7027
  * Cached network fee-rate estimates from the wallet's chain source.
6489
7028
  */
@@ -7063,14 +7602,34 @@ export interface WalletLike {
7063
7602
  /**
7064
7603
  * Import a VTXO from its serialized form (hex or base64).
7065
7604
  *
7066
- * The parameter keeps its historical `vtxo_base64` name for foreign
7605
+ * The VTXO is stored in the state the server reports for it, so one that
7606
+ * was already spent is recorded as spent rather than refused. Pass `args`
7607
+ * to widen the key-scan gap limit, skip the server status check, or allow
7608
+ * partial success; omit it for the defaults.
7609
+ *
7610
+ * The first parameter keeps its historical `vtxo_base64` name for foreign
7067
7611
  * binding compatibility (uniffi exposes parameter names), but hex as
7068
7612
  * returned by [`Wallet::vtxo_encoded`] is accepted too.
7069
7613
  */
7070
7614
  importVtxo(
7071
7615
  vtxoBase64: string,
7616
+ args: ImportVtxoArgs | undefined,
7072
7617
  asyncOpts_?: { signal: AbortSignal }
7073
7618
  ): /*throws*/ Promise<void>;
7619
+ /**
7620
+ * Import several VTXOs (hex or base64) under a single key scan and a
7621
+ * single write, which is why this is not just a loop over `import_vtxo`.
7622
+ *
7623
+ * Returns the ids now held — whether this call stored them or found them
7624
+ * already present — so a failed batch can be retried. One VTXO that cannot
7625
+ * be imported discards the whole batch unless `args.allow_partial` is set,
7626
+ * in which case the ones that did import are kept.
7627
+ */
7628
+ importVtxos(
7629
+ encodedVtxos: Array<string>,
7630
+ args: ImportVtxoArgs | undefined,
7631
+ asyncOpts_?: { signal: AbortSignal }
7632
+ ): /*throws*/ Promise<Array<string>>;
7074
7633
  isInvoicePaid(
7075
7634
  paymentHash: string,
7076
7635
  asyncOpts_?: { signal: AbortSignal }
@@ -7199,23 +7758,34 @@ export interface WalletLike {
7199
7758
  * Recover the given VTXO ids from the server, importing the ones this
7200
7759
  * wallet owns that are still spendable. Use it to retry ids a previous
7201
7760
  * scan reported as `failed`.
7761
+ *
7762
+ * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
7763
+ * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
7764
+ * previous scan bucketed as `foreign`.
7202
7765
  */
7203
7766
  recoverVtxos(
7204
7767
  vtxoIds: Array<string>,
7768
+ gapLimit: /*u32*/ number | undefined,
7205
7769
  asyncOpts_?: { signal: AbortSignal }
7206
7770
  ): /*throws*/ Promise<RecoveryReport>;
7207
7771
  /**
7208
- * Result of the seed-recovery scan that ran during `Wallet::open`, or none
7209
- * if no report was produced.
7210
- *
7211
- * Recovery only runs on the open that creates the wallet locally, and not
7212
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is empty on
7213
- * every subsequent open. It is also empty when the scan itself failed
7214
- * outright — bark logs that and lets open succeed, so an empty result does
7215
- * not prove no funds are missing. `isComplete == false` means funds may
7216
- * still be missing; retry the report's `failed` ids with `recoverVtxos`.
7772
+ * The report of the seed-recovery scan that ran during `Wallet::open`, or
7773
+ * none if the scan did not complete. Use `recovery_status` to tell a scan
7774
+ * that failed apart from one that never ran.
7217
7775
  */
7218
7776
  recoveryReport(): RecoveryReport | undefined;
7777
+ /**
7778
+ * Outcome of the seed-recovery scan that ran during `Wallet::open`.
7779
+ *
7780
+ * Recovery only runs on the open that creates the wallet locally, and not
7781
+ * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
7782
+ * on every subsequent open. `Failed` means the scan errored before
7783
+ * producing a report — bark logs that and lets open succeed — so funds
7784
+ * may be missing until a retry; `Completed` carries the report, and
7785
+ * `isComplete == false` there means funds may still be missing. Retry the
7786
+ * report's `failed` ids with `recoverVtxos`.
7787
+ */
7788
+ recoveryStatus(): RecoveryStatus;
7219
7789
  refreshServer(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
7220
7790
  refreshVtxos(
7221
7791
  vtxoIds: Array<string>,
@@ -7270,6 +7840,14 @@ export interface WalletLike {
7270
7840
  asyncOpts_?: { signal: AbortSignal }
7271
7841
  ): /*throws*/ Promise<void>;
7272
7842
  stopDaemon(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
7843
+ /**
7844
+ * Stop the background daemon and wait until its tasks have finished, so
7845
+ * nothing runs in the background afterwards (e.g. before deleting the
7846
+ * wallet's datadir). No-op when no daemon is running.
7847
+ */
7848
+ stopDaemonWait(asyncOpts_?: {
7849
+ signal: AbortSignal;
7850
+ }): /*throws*/ Promise<void>;
7273
7851
  stuckFailedLightningSends(asyncOpts_?: {
7274
7852
  signal: AbortSignal;
7275
7853
  }): /*throws*/ Promise<Array<LightningSend>>;
@@ -7302,6 +7880,12 @@ export interface WalletLike {
7302
7880
  expectedHolder: VtxoLockHolder | undefined,
7303
7881
  asyncOpts_?: { signal: AbortSignal }
7304
7882
  ): /*throws*/ Promise<void>;
7883
+ /**
7884
+ * Whether this wallet can pay `address` out-of-round: same network and
7885
+ * server, a supported VTXO policy, and only delivery mechanisms this bark
7886
+ * supports. An address listing no delivery mechanism is valid. Errors only
7887
+ * when the address does not parse.
7888
+ */
7305
7889
  validateArkoorAddress(
7306
7890
  address: string,
7307
7891
  asyncOpts_?: { signal: AbortSignal }
@@ -8881,12 +9465,18 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
8881
9465
  /**
8882
9466
  * Import a VTXO from its serialized form (hex or base64).
8883
9467
  *
8884
- * The parameter keeps its historical `vtxo_base64` name for foreign
9468
+ * The VTXO is stored in the state the server reports for it, so one that
9469
+ * was already spent is recorded as spent rather than refused. Pass `args`
9470
+ * to widen the key-scan gap limit, skip the server status check, or allow
9471
+ * partial success; omit it for the defaults.
9472
+ *
9473
+ * The first parameter keeps its historical `vtxo_base64` name for foreign
8885
9474
  * binding compatibility (uniffi exposes parameter names), but hex as
8886
9475
  * returned by [`Wallet::vtxo_encoded`] is accepted too.
8887
9476
  */
8888
9477
  async importVtxo(
8889
9478
  vtxoBase64: string,
9479
+ args: ImportVtxoArgs | undefined = undefined,
8890
9480
  asyncOpts_?: { signal: AbortSignal }
8891
9481
  ): Promise<void> /*throws*/ {
8892
9482
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -8896,7 +9486,8 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
8896
9486
  /*rustFutureFunc:*/ () => {
8897
9487
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxo(
8898
9488
  uniffiTypeWalletObjectFactory.clonePointer(this),
8899
- FfiConverterString.lower(vtxoBase64)
9489
+ FfiConverterString.lower(vtxoBase64),
9490
+ FfiConverterOptionalTypeImportVtxoArgs.lower(args)
8900
9491
  );
8901
9492
  },
8902
9493
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
@@ -8918,6 +9509,54 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
8918
9509
  }
8919
9510
  }
8920
9511
 
9512
+ /**
9513
+ * Import several VTXOs (hex or base64) under a single key scan and a
9514
+ * single write, which is why this is not just a loop over `import_vtxo`.
9515
+ *
9516
+ * Returns the ids now held — whether this call stored them or found them
9517
+ * already present — so a failed batch can be retried. One VTXO that cannot
9518
+ * be imported discards the whole batch unless `args.allow_partial` is set,
9519
+ * in which case the ones that did import are kept.
9520
+ */
9521
+ async importVtxos(
9522
+ encodedVtxos: Array<string>,
9523
+ args: ImportVtxoArgs | undefined = undefined,
9524
+ asyncOpts_?: { signal: AbortSignal }
9525
+ ): Promise<Array<string>> /*throws*/ {
9526
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
9527
+ try {
9528
+ return await uniffiRustCallAsync(
9529
+ /*rustCaller:*/ uniffiCaller,
9530
+ /*rustFutureFunc:*/ () => {
9531
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_import_vtxos(
9532
+ uniffiTypeWalletObjectFactory.clonePointer(this),
9533
+ FfiConverterArrayString.lower(encodedVtxos),
9534
+ FfiConverterOptionalTypeImportVtxoArgs.lower(args)
9535
+ );
9536
+ },
9537
+ /*pollFunc:*/ nativeModule()
9538
+ .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
9539
+ /*cancelFunc:*/ nativeModule()
9540
+ .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
9541
+ /*completeFunc:*/ nativeModule()
9542
+ .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
9543
+ /*freeFunc:*/ nativeModule()
9544
+ .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
9545
+ /*liftFunc:*/ FfiConverterArrayString.lift.bind(
9546
+ FfiConverterArrayString
9547
+ ),
9548
+ /*liftString:*/ FfiConverterString.lift,
9549
+ /*asyncOpts:*/ asyncOpts_,
9550
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
9551
+ );
9552
+ } catch (__error: any) {
9553
+ if (uniffiIsDebug && __error instanceof Error) {
9554
+ __error.stack = __stack;
9555
+ }
9556
+ throw __error;
9557
+ }
9558
+ }
9559
+
8921
9560
  async isInvoicePaid(
8922
9561
  paymentHash: string,
8923
9562
  asyncOpts_?: { signal: AbortSignal }
@@ -10042,9 +10681,14 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
10042
10681
  * Recover the given VTXO ids from the server, importing the ones this
10043
10682
  * wallet owns that are still spendable. Use it to retry ids a previous
10044
10683
  * scan reported as `failed`.
10684
+ *
10685
+ * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
10686
+ * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
10687
+ * previous scan bucketed as `foreign`.
10045
10688
  */
10046
10689
  async recoverVtxos(
10047
10690
  vtxoIds: Array<string>,
10691
+ gapLimit: /*u32*/ number | undefined = undefined,
10048
10692
  asyncOpts_?: { signal: AbortSignal }
10049
10693
  ): Promise<RecoveryReport> /*throws*/ {
10050
10694
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -10054,7 +10698,8 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
10054
10698
  /*rustFutureFunc:*/ () => {
10055
10699
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_recover_vtxos(
10056
10700
  uniffiTypeWalletObjectFactory.clonePointer(this),
10057
- FfiConverterArrayString.lower(vtxoIds)
10701
+ FfiConverterArrayString.lower(vtxoIds),
10702
+ FfiConverterOptionalUInt32.lower(gapLimit)
10058
10703
  );
10059
10704
  },
10060
10705
  /*pollFunc:*/ nativeModule()
@@ -10081,15 +10726,9 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
10081
10726
  }
10082
10727
 
10083
10728
  /**
10084
- * Result of the seed-recovery scan that ran during `Wallet::open`, or none
10085
- * if no report was produced.
10086
- *
10087
- * Recovery only runs on the open that creates the wallet locally, and not
10088
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is empty on
10089
- * every subsequent open. It is also empty when the scan itself failed
10090
- * outright — bark logs that and lets open succeed, so an empty result does
10091
- * not prove no funds are missing. `isComplete == false` means funds may
10092
- * still be missing; retry the report's `failed` ids with `recoverVtxos`.
10729
+ * The report of the seed-recovery scan that ran during `Wallet::open`, or
10730
+ * none if the scan did not complete. Use `recovery_status` to tell a scan
10731
+ * that failed apart from one that never ran.
10093
10732
  */
10094
10733
  recoveryReport(): RecoveryReport | undefined {
10095
10734
  return FfiConverterOptionalTypeRecoveryReport.lift(
@@ -10105,6 +10744,31 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
10105
10744
  );
10106
10745
  }
10107
10746
 
10747
+ /**
10748
+ * Outcome of the seed-recovery scan that ran during `Wallet::open`.
10749
+ *
10750
+ * Recovery only runs on the open that creates the wallet locally, and not
10751
+ * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
10752
+ * on every subsequent open. `Failed` means the scan errored before
10753
+ * producing a report — bark logs that and lets open succeed — so funds
10754
+ * may be missing until a retry; `Completed` carries the report, and
10755
+ * `isComplete == false` there means funds may still be missing. Retry the
10756
+ * report's `failed` ids with `recoverVtxos`.
10757
+ */
10758
+ recoveryStatus(): RecoveryStatus {
10759
+ return FfiConverterTypeRecoveryStatus.lift(
10760
+ uniffiCaller.rustCall(
10761
+ /*caller:*/ (callStatus) => {
10762
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_recovery_status(
10763
+ uniffiTypeWalletObjectFactory.clonePointer(this),
10764
+ callStatus
10765
+ );
10766
+ },
10767
+ /*liftString:*/ FfiConverterString.lift
10768
+ )
10769
+ );
10770
+ }
10771
+
10108
10772
  async refreshServer(asyncOpts_?: {
10109
10773
  signal: AbortSignal;
10110
10774
  }): Promise<void> /*throws*/ {
@@ -10560,6 +11224,42 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
10560
11224
  }
10561
11225
  }
10562
11226
 
11227
+ /**
11228
+ * Stop the background daemon and wait until its tasks have finished, so
11229
+ * nothing runs in the background afterwards (e.g. before deleting the
11230
+ * wallet's datadir). No-op when no daemon is running.
11231
+ */
11232
+ async stopDaemonWait(asyncOpts_?: {
11233
+ signal: AbortSignal;
11234
+ }): Promise<void> /*throws*/ {
11235
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
11236
+ try {
11237
+ return await uniffiRustCallAsync(
11238
+ /*rustCaller:*/ uniffiCaller,
11239
+ /*rustFutureFunc:*/ () => {
11240
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_stop_daemon_wait(
11241
+ uniffiTypeWalletObjectFactory.clonePointer(this)
11242
+ );
11243
+ },
11244
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
11245
+ /*cancelFunc:*/ nativeModule()
11246
+ .ubrn_ffi_bark_ffi_rust_future_cancel_void,
11247
+ /*completeFunc:*/ nativeModule()
11248
+ .ubrn_ffi_bark_ffi_rust_future_complete_void,
11249
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
11250
+ /*liftFunc:*/ (_v) => {},
11251
+ /*liftString:*/ FfiConverterString.lift,
11252
+ /*asyncOpts:*/ asyncOpts_,
11253
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
11254
+ );
11255
+ } catch (__error: any) {
11256
+ if (uniffiIsDebug && __error instanceof Error) {
11257
+ __error.stack = __stack;
11258
+ }
11259
+ throw __error;
11260
+ }
11261
+ }
11262
+
10563
11263
  async stuckFailedLightningSends(asyncOpts_?: {
10564
11264
  signal: AbortSignal;
10565
11265
  }): Promise<Array<LightningSend>> /*throws*/ {
@@ -10835,6 +11535,12 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
10835
11535
  }
10836
11536
  }
10837
11537
 
11538
+ /**
11539
+ * Whether this wallet can pay `address` out-of-round: same network and
11540
+ * server, a supported VTXO policy, and only delivery mechanisms this bark
11541
+ * supports. An address listing no delivery mechanism is valid. Errors only
11542
+ * when the address does not parse.
11543
+ */
10838
11544
  async validateArkoorAddress(
10839
11545
  address: string,
10840
11546
  asyncOpts_?: { signal: AbortSignal }
@@ -11048,6 +11754,11 @@ const FfiConverterOptionalTypeExitTransactionStatus = new FfiConverterOptional(
11048
11754
  FfiConverterTypeExitTransactionStatus
11049
11755
  );
11050
11756
 
11757
+ // FfiConverter for ImportVtxoArgs | undefined
11758
+ const FfiConverterOptionalTypeImportVtxoArgs = new FfiConverterOptional(
11759
+ FfiConverterTypeImportVtxoArgs
11760
+ );
11761
+
11051
11762
  // FfiConverter for RecoveryReport | undefined
11052
11763
  const FfiConverterOptionalTypeRecoveryReport = new FfiConverterOptional(
11053
11764
  FfiConverterTypeRecoveryReport
@@ -11191,6 +11902,14 @@ function uniffiEnsureInitialized() {
11191
11902
  bindingsContractVersion
11192
11903
  );
11193
11904
  }
11905
+ if (
11906
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit() !==
11907
+ 3344
11908
+ ) {
11909
+ throw new UniffiInternalError.ApiChecksumMismatch(
11910
+ "uniffi_bark_ffi_checksum_func_default_vtxo_key_gap_limit"
11911
+ );
11912
+ }
11194
11913
  if (
11195
11914
  nativeModule().ubrn_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt() !==
11196
11915
  8893
@@ -11207,6 +11926,14 @@ function uniffiEnsureInitialized() {
11207
11926
  "uniffi_bark_ffi_checksum_func_generate_mnemonic"
11208
11927
  );
11209
11928
  }
11929
+ if (
11930
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit() !==
11931
+ 15808
11932
+ ) {
11933
+ throw new UniffiInternalError.ApiChecksumMismatch(
11934
+ "uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit"
11935
+ );
11936
+ }
11210
11937
  if (
11211
11938
  nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address() !==
11212
11939
  43084
@@ -11301,9 +12028,17 @@ function uniffiEnsureInitialized() {
11301
12028
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_register_tx"
11302
12029
  );
11303
12030
  }
12031
+ if (
12032
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx() !==
12033
+ 36298
12034
+ ) {
12035
+ throw new UniffiInternalError.ApiChecksumMismatch(
12036
+ "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx"
12037
+ );
12038
+ }
11304
12039
  if (
11305
12040
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !==
11306
- 62938
12041
+ 58200
11307
12042
  ) {
11308
12043
  throw new UniffiInternalError.ApiChecksumMismatch(
11309
12044
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp"
@@ -11311,7 +12046,7 @@ function uniffiEnsureInitialized() {
11311
12046
  }
11312
12047
  if (
11313
12048
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !==
11314
- 47426
12049
+ 64815
11315
12050
  ) {
11316
12051
  throw new UniffiInternalError.ApiChecksumMismatch(
11317
12052
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp"
@@ -11319,7 +12054,7 @@ function uniffiEnsureInitialized() {
11319
12054
  }
11320
12055
  if (
11321
12056
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync() !==
11322
- 12900
12057
+ 29018
11323
12058
  ) {
11324
12059
  throw new UniffiInternalError.ApiChecksumMismatch(
11325
12060
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync"
@@ -11341,6 +12076,14 @@ function uniffiEnsureInitialized() {
11341
12076
  "uniffi_bark_ffi_checksum_method_onchainwallet_balance"
11342
12077
  );
11343
12078
  }
12079
+ if (
12080
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_evict_tx() !==
12081
+ 26786
12082
+ ) {
12083
+ throw new UniffiInternalError.ApiChecksumMismatch(
12084
+ "uniffi_bark_ffi_checksum_method_onchainwallet_evict_tx"
12085
+ );
12086
+ }
11344
12087
  if (
11345
12088
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates() !==
11346
12089
  30741
@@ -11735,12 +12478,20 @@ function uniffiEnsureInitialized() {
11735
12478
  }
11736
12479
  if (
11737
12480
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxo() !==
11738
- 48135
12481
+ 26027
11739
12482
  ) {
11740
12483
  throw new UniffiInternalError.ApiChecksumMismatch(
11741
12484
  "uniffi_bark_ffi_checksum_method_wallet_import_vtxo"
11742
12485
  );
11743
12486
  }
12487
+ if (
12488
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxos() !==
12489
+ 13727
12490
+ ) {
12491
+ throw new UniffiInternalError.ApiChecksumMismatch(
12492
+ "uniffi_bark_ffi_checksum_method_wallet_import_vtxos"
12493
+ );
12494
+ }
11744
12495
  if (
11745
12496
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid() !==
11746
12497
  31079
@@ -12007,7 +12758,7 @@ function uniffiEnsureInitialized() {
12007
12758
  }
12008
12759
  if (
12009
12760
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recover_vtxos() !==
12010
- 640
12761
+ 56476
12011
12762
  ) {
12012
12763
  throw new UniffiInternalError.ApiChecksumMismatch(
12013
12764
  "uniffi_bark_ffi_checksum_method_wallet_recover_vtxos"
@@ -12015,12 +12766,20 @@ function uniffiEnsureInitialized() {
12015
12766
  }
12016
12767
  if (
12017
12768
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_report() !==
12018
- 54899
12769
+ 10331
12019
12770
  ) {
12020
12771
  throw new UniffiInternalError.ApiChecksumMismatch(
12021
12772
  "uniffi_bark_ffi_checksum_method_wallet_recovery_report"
12022
12773
  );
12023
12774
  }
12775
+ if (
12776
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_status() !==
12777
+ 14132
12778
+ ) {
12779
+ throw new UniffiInternalError.ApiChecksumMismatch(
12780
+ "uniffi_bark_ffi_checksum_method_wallet_recovery_status"
12781
+ );
12782
+ }
12024
12783
  if (
12025
12784
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !==
12026
12785
  41162
@@ -12125,6 +12884,14 @@ function uniffiEnsureInitialized() {
12125
12884
  "uniffi_bark_ffi_checksum_method_wallet_stop_daemon"
12126
12885
  );
12127
12886
  }
12887
+ if (
12888
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait() !==
12889
+ 1734
12890
+ ) {
12891
+ throw new UniffiInternalError.ApiChecksumMismatch(
12892
+ "uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait"
12893
+ );
12894
+ }
12128
12895
  if (
12129
12896
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends() !==
12130
12897
  31451
@@ -12190,7 +12957,7 @@ function uniffiEnsureInitialized() {
12190
12957
  }
12191
12958
  if (
12192
12959
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address() !==
12193
- 10861
12960
+ 30498
12194
12961
  ) {
12195
12962
  throw new UniffiInternalError.ApiChecksumMismatch(
12196
12963
  "uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address"
@@ -12270,6 +13037,7 @@ export default Object.freeze({
12270
13037
  FfiConverterTypeFeeEstimate,
12271
13038
  FfiConverterTypeFeeRates,
12272
13039
  FfiConverterTypeFeeSchedule,
13040
+ FfiConverterTypeImportVtxoArgs,
12273
13041
  FfiConverterTypeLightningInvoice,
12274
13042
  FfiConverterTypeLightningReceive,
12275
13043
  FfiConverterTypeLightningReceiveFees,
@@ -12290,7 +13058,9 @@ export default Object.freeze({
12290
13058
  FfiConverterTypePpmExpiryFeeEntry,
12291
13059
  FfiConverterTypeRecoveryBucket,
12292
13060
  FfiConverterTypeRecoveryReport,
13061
+ FfiConverterTypeRecoveryStatus,
12293
13062
  FfiConverterTypeRefreshFees,
13063
+ FfiConverterTypeRoundFlowKind,
12294
13064
  FfiConverterTypeRoundState,
12295
13065
  FfiConverterTypeVtxo,
12296
13066
  FfiConverterTypeVtxoLockHolder,