@secondts/bark-react-native 0.27.0 → 0.28.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.
@@ -797,7 +797,11 @@ export type ArkInfo = {
797
797
  * Maximum exit depth (genesis chain length) allowed for a VTXO before the
798
798
  * server refuses to cosign further OOR transactions spending it.
799
799
  */
800
- maxVtxoExitDepth: number
800
+ maxVtxoExitDepth: number,
801
+ /**
802
+ * Maximum number of outputs of a single round participation.
803
+ */
804
+ maxRoundParticipationOutputs: number
801
805
  }
802
806
 
803
807
  /**
@@ -836,7 +840,8 @@ const FfiConverterTypeArkInfo = (() => {
836
840
  minBoardAmountSats: FfiConverterUInt64.readFromCursor(c),
837
841
  lnReceiveAntiDosRequired: FfiConverterBool.readFromCursor(c),
838
842
  feeSchedule: FfiConverterTypeFeeSchedule.readFromCursor(c),
839
- maxVtxoExitDepth: FfiConverterUInt16.readFromCursor(c)
843
+ maxVtxoExitDepth: FfiConverterUInt16.readFromCursor(c),
844
+ maxRoundParticipationOutputs: FfiConverterUInt32.readFromCursor(c)
840
845
  };
841
846
  }
842
847
  writeIntoCursor(value: TypeName, c: Cursor): void {
@@ -856,6 +861,7 @@ const FfiConverterTypeArkInfo = (() => {
856
861
  FfiConverterBool.writeIntoCursor(value.lnReceiveAntiDosRequired, c);
857
862
  FfiConverterTypeFeeSchedule.writeIntoCursor(value.feeSchedule, c);
858
863
  FfiConverterUInt16.writeIntoCursor(value.maxVtxoExitDepth, c);
864
+ FfiConverterUInt32.writeIntoCursor(value.maxRoundParticipationOutputs, c);
859
865
  }
860
866
  allocationSize(value: TypeName): number {
861
867
  return FfiConverterTypeNetwork.allocationSize(value.network) +
@@ -873,7 +879,8 @@ const FfiConverterTypeArkInfo = (() => {
873
879
  FfiConverterUInt64.allocationSize(value.minBoardAmountSats) +
874
880
  FfiConverterBool.allocationSize(value.lnReceiveAntiDosRequired) +
875
881
  FfiConverterTypeFeeSchedule.allocationSize(value.feeSchedule) +
876
- FfiConverterUInt16.allocationSize(value.maxVtxoExitDepth);
882
+ FfiConverterUInt16.allocationSize(value.maxVtxoExitDepth) +
883
+ FfiConverterUInt32.allocationSize(value.maxRoundParticipationOutputs);
877
884
 
878
885
  }
879
886
  };
@@ -2079,17 +2086,31 @@ const FfiConverterTypeBlockRef = (() => {
2079
2086
  })();
2080
2087
 
2081
2088
  /**
2082
- * Destination for an externally funded board (e.g. a payjoin receive).
2089
+ * Destination for an externally funded board (e.g. a payjoin receive),
2090
+ * mirroring `bark::BoardFundingAddress`.
2083
2091
  *
2084
- * The funding script commits to the derived keypair and expiry height, so
2085
- * `keypair_index` and `expiry_height` must be passed back unchanged to
2086
- * `board_psbt` once the funding PSBT is available — including on retries
2087
- * after the sender changes the transaction.
2092
+ * The funding script commits to `user_pubkey` and `expiry_height`, so persist
2093
+ * this record and pass it back unchanged to `board_psbt` once the funding
2094
+ * PSBT is available — including on retries after the sender changes the
2095
+ * transaction. Fund it right away: the board VTXO's lifetime started when
2096
+ * the address was made, and once it expires the server can sweep the funding
2097
+ * output alone.
2088
2098
  */
2089
2099
  export type BoardFundingInfo = {
2100
+ /**
2101
+ * Address the funding transaction must pay. Informational only:
2102
+ * `board_psbt` rebuilds the funding script from `user_pubkey` and
2103
+ * `expiry_height` and does not read it.
2104
+ */
2090
2105
  address: string,
2106
+ /**
2107
+ * Block height at which the board VTXO expires.
2108
+ */
2091
2109
  expiryHeight: number,
2092
- keypairIndex: number
2110
+ /**
2111
+ * Hex-encoded wallet public key the board VTXO is locked to.
2112
+ */
2113
+ userPubkey: string
2093
2114
  }
2094
2115
 
2095
2116
  /**
@@ -2115,18 +2136,18 @@ const FfiConverterTypeBoardFundingInfo = (() => {
2115
2136
  return {
2116
2137
  address: FfiConverterString.readFromCursor(c),
2117
2138
  expiryHeight: FfiConverterUInt32.readFromCursor(c),
2118
- keypairIndex: FfiConverterUInt32.readFromCursor(c)
2139
+ userPubkey: FfiConverterString.readFromCursor(c)
2119
2140
  };
2120
2141
  }
2121
2142
  writeIntoCursor(value: TypeName, c: Cursor): void {
2122
2143
  FfiConverterString.writeIntoCursor(value.address, c);
2123
2144
  FfiConverterUInt32.writeIntoCursor(value.expiryHeight, c);
2124
- FfiConverterUInt32.writeIntoCursor(value.keypairIndex, c);
2145
+ FfiConverterString.writeIntoCursor(value.userPubkey, c);
2125
2146
  }
2126
2147
  allocationSize(value: TypeName): number {
2127
2148
  return FfiConverterString.allocationSize(value.address) +
2128
2149
  FfiConverterUInt32.allocationSize(value.expiryHeight) +
2129
- FfiConverterUInt32.allocationSize(value.keypairIndex);
2150
+ FfiConverterString.allocationSize(value.userPubkey);
2130
2151
 
2131
2152
  }
2132
2153
  };
@@ -2236,6 +2257,15 @@ export type Config = {
2236
2257
  bitcoindPass?: string,
2237
2258
  vtxoRefreshExpiryThreshold?: number,
2238
2259
  vtxoExitMargin?: number,
2260
+ /**
2261
+ * The default lifetime of a board VTXO, in blocks.
2262
+ *
2263
+ * Capped at the server's `ArkInfo.vtxo_lifetime`. Override it per board
2264
+ * with the `expiry_height` argument of the board methods.
2265
+ *
2266
+ * Default: 432 (3 days) on mainnet, 4320 (30 days) otherwise
2267
+ */
2268
+ boardLifetime?: number,
2239
2269
  htlcRecvClaimDelta?: number,
2240
2270
  fallbackFeeRate?: bigint,
2241
2271
  roundTxRequiredConfirmations?: number,
@@ -2290,6 +2320,7 @@ const FfiConverterTypeConfig = (() => {
2290
2320
  bitcoindPass: FfiConverterOptionalString.readFromCursor(c),
2291
2321
  vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt16.readFromCursor(c),
2292
2322
  vtxoExitMargin: FfiConverterOptionalUInt16.readFromCursor(c),
2323
+ boardLifetime: FfiConverterOptionalUInt16.readFromCursor(c),
2293
2324
  htlcRecvClaimDelta: FfiConverterOptionalUInt16.readFromCursor(c),
2294
2325
  fallbackFeeRate: FfiConverterOptionalUInt64.readFromCursor(c),
2295
2326
  roundTxRequiredConfirmations: FfiConverterOptionalUInt32.readFromCursor(c),
@@ -2311,6 +2342,7 @@ const FfiConverterTypeConfig = (() => {
2311
2342
  FfiConverterOptionalString.writeIntoCursor(value.bitcoindPass, c);
2312
2343
  FfiConverterOptionalUInt16.writeIntoCursor(value.vtxoRefreshExpiryThreshold, c);
2313
2344
  FfiConverterOptionalUInt16.writeIntoCursor(value.vtxoExitMargin, c);
2345
+ FfiConverterOptionalUInt16.writeIntoCursor(value.boardLifetime, c);
2314
2346
  FfiConverterOptionalUInt16.writeIntoCursor(value.htlcRecvClaimDelta, c);
2315
2347
  FfiConverterOptionalUInt64.writeIntoCursor(value.fallbackFeeRate, c);
2316
2348
  FfiConverterOptionalUInt32.writeIntoCursor(value.roundTxRequiredConfirmations, c);
@@ -2331,6 +2363,7 @@ const FfiConverterTypeConfig = (() => {
2331
2363
  FfiConverterOptionalString.allocationSize(value.bitcoindPass) +
2332
2364
  FfiConverterOptionalUInt16.allocationSize(value.vtxoRefreshExpiryThreshold) +
2333
2365
  FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) +
2366
+ FfiConverterOptionalUInt16.allocationSize(value.boardLifetime) +
2334
2367
  FfiConverterOptionalUInt16.allocationSize(value.htlcRecvClaimDelta) +
2335
2368
  FfiConverterOptionalUInt64.allocationSize(value.fallbackFeeRate) +
2336
2369
  FfiConverterOptionalUInt32.allocationSize(value.roundTxRequiredConfirmations) +
@@ -2350,10 +2383,38 @@ const FfiConverterTypeConfig = (() => {
2350
2383
  * Parameters for creating a CPFP (Child Pays For Parent) transaction
2351
2384
  */
2352
2385
  export type CpfpParams = {
2386
+ /**
2387
+ * Hex-encoded zero-fee parent transaction to bump through its P2A anchor
2388
+ */
2353
2389
  txHex: string,
2390
+ /**
2391
+ * `"Effective"` for a fresh child, `"Rbf"` to replace a child already in
2392
+ * the mempool. The `Rbf`-only fields below are `None` for `"Effective"`.
2393
+ */
2354
2394
  feesType: string,
2395
+ /**
2396
+ * Effective fee rate the whole package (parent + child) must reach, in
2397
+ * sat/vB rounded up
2398
+ */
2355
2399
  effectiveFeeRateSatPerVb: bigint,
2356
- currentPackageFeeSats?: bigint
2400
+ /**
2401
+ * `Rbf` only: total fee of the transactions the new child replaces
2402
+ */
2403
+ replacedFeeSats?: bigint,
2404
+ /**
2405
+ * `Rbf` only: fee rate of the transactions the new child replaces, in
2406
+ * sat/vB rounded up
2407
+ */
2408
+ replacedFeeRateSatPerVb?: bigint,
2409
+ /**
2410
+ * `Rbf` only: the node's incremental relay fee, in sat/vB rounded up
2411
+ */
2412
+ incrementalRelayFeeSatPerVb?: bigint,
2413
+ /**
2414
+ * `Rbf` only: whether the parent is already in the mempool. If not, the
2415
+ * parent is part of the replacement.
2416
+ */
2417
+ parentInMempool?: boolean
2357
2418
  }
2358
2419
 
2359
2420
  /**
@@ -2380,20 +2441,29 @@ const FfiConverterTypeCpfpParams = (() => {
2380
2441
  txHex: FfiConverterString.readFromCursor(c),
2381
2442
  feesType: FfiConverterString.readFromCursor(c),
2382
2443
  effectiveFeeRateSatPerVb: FfiConverterUInt64.readFromCursor(c),
2383
- currentPackageFeeSats: FfiConverterOptionalUInt64.readFromCursor(c)
2444
+ replacedFeeSats: FfiConverterOptionalUInt64.readFromCursor(c),
2445
+ replacedFeeRateSatPerVb: FfiConverterOptionalUInt64.readFromCursor(c),
2446
+ incrementalRelayFeeSatPerVb: FfiConverterOptionalUInt64.readFromCursor(c),
2447
+ parentInMempool: FfiConverterOptionalBoolean.readFromCursor(c)
2384
2448
  };
2385
2449
  }
2386
2450
  writeIntoCursor(value: TypeName, c: Cursor): void {
2387
2451
  FfiConverterString.writeIntoCursor(value.txHex, c);
2388
2452
  FfiConverterString.writeIntoCursor(value.feesType, c);
2389
2453
  FfiConverterUInt64.writeIntoCursor(value.effectiveFeeRateSatPerVb, c);
2390
- FfiConverterOptionalUInt64.writeIntoCursor(value.currentPackageFeeSats, c);
2454
+ FfiConverterOptionalUInt64.writeIntoCursor(value.replacedFeeSats, c);
2455
+ FfiConverterOptionalUInt64.writeIntoCursor(value.replacedFeeRateSatPerVb, c);
2456
+ FfiConverterOptionalUInt64.writeIntoCursor(value.incrementalRelayFeeSatPerVb, c);
2457
+ FfiConverterOptionalBoolean.writeIntoCursor(value.parentInMempool, c);
2391
2458
  }
2392
2459
  allocationSize(value: TypeName): number {
2393
2460
  return FfiConverterString.allocationSize(value.txHex) +
2394
2461
  FfiConverterString.allocationSize(value.feesType) +
2395
2462
  FfiConverterUInt64.allocationSize(value.effectiveFeeRateSatPerVb) +
2396
- FfiConverterOptionalUInt64.allocationSize(value.currentPackageFeeSats);
2463
+ FfiConverterOptionalUInt64.allocationSize(value.replacedFeeSats) +
2464
+ FfiConverterOptionalUInt64.allocationSize(value.replacedFeeRateSatPerVb) +
2465
+ FfiConverterOptionalUInt64.allocationSize(value.incrementalRelayFeeSatPerVb) +
2466
+ FfiConverterOptionalBoolean.allocationSize(value.parentInMempool);
2397
2467
 
2398
2468
  }
2399
2469
  };
@@ -5685,8 +5755,8 @@ const FfiConverterTypePresignedExits = (() => {
5685
5755
  * One bucket of a [`RecoveryReport`].
5686
5756
  *
5687
5757
  * `total_sats` only sums the VTXOs whose amount is known, so it can
5688
- * under-count `failed`, where a VTXO may have failed before being fetched.
5689
- * `vtxo_ids` is sorted, since upstream buckets them unordered.
5758
+ * under-count `failed`, `abandoned` and `not_found`, where a VTXO may not
5759
+ * have been fetched. `vtxo_ids` is sorted as strings.
5690
5760
  */
5691
5761
  export type RecoveryBucket = {
5692
5762
  vtxoIds: Array<string>,
@@ -5738,8 +5808,10 @@ const FfiConverterTypeRecoveryBucket = (() => {
5738
5808
  * `skipped` vs `failed` is the load-bearing distinction: a `skipped` VTXO was
5739
5809
  * decided not to be spendable (spent, exited, or reported non-spendable),
5740
5810
  * while a `failed` one could not be decided because of an error, so its funds
5741
- * may still be missing. `failed` is retryable via `recover_vtxos`; a `foreign`
5742
- * id instead sits beyond the key-derivation gap limit and needs a wider scan.
5811
+ * may still be missing. `failed` is retried by every sync while a seed
5812
+ * recovery is in progress, and via `recover_vtxos`; an `abandoned` one was
5813
+ * given up on after too many attempts; a `foreign` id instead sits beyond the
5814
+ * key-derivation gap limit and needs a wider scan.
5743
5815
  */
5744
5816
  export type RecoveryReport = {
5745
5817
  /**
@@ -5770,7 +5842,20 @@ export type RecoveryReport = {
5770
5842
  */
5771
5843
  exited: RecoveryBucket,
5772
5844
  /**
5773
- * Whether the scan accounted for every VTXO: no `failed`, no `foreign`.
5845
+ * Reported unknown by the server. Recovery trusts the server, so these
5846
+ * are not retried.
5847
+ */
5848
+ notFound: RecoveryBucket,
5849
+ /**
5850
+ * Given up on after `MAX_RECOVERY_ATTEMPTS` (40) attempts the server or
5851
+ * the chain answered without deciding. Funds may be missing. One with a
5852
+ * stored body stays locked, as it may be spent, and a later
5853
+ * `recover_vtxos` tries it again.
5854
+ */
5855
+ abandoned: RecoveryBucket,
5856
+ /**
5857
+ * Whether the scan accounted for every VTXO: no `failed`, no `abandoned`,
5858
+ * no `foreign`.
5774
5859
  */
5775
5860
  isComplete: boolean
5776
5861
  }
@@ -5801,6 +5886,8 @@ const FfiConverterTypeRecoveryReport = (() => {
5801
5886
  foreign: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5802
5887
  failed: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5803
5888
  exited: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5889
+ notFound: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5890
+ abandoned: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5804
5891
  isComplete: FfiConverterBool.readFromCursor(c)
5805
5892
  };
5806
5893
  }
@@ -5810,6 +5897,8 @@ const FfiConverterTypeRecoveryReport = (() => {
5810
5897
  FfiConverterTypeRecoveryBucket.writeIntoCursor(value.foreign, c);
5811
5898
  FfiConverterTypeRecoveryBucket.writeIntoCursor(value.failed, c);
5812
5899
  FfiConverterTypeRecoveryBucket.writeIntoCursor(value.exited, c);
5900
+ FfiConverterTypeRecoveryBucket.writeIntoCursor(value.notFound, c);
5901
+ FfiConverterTypeRecoveryBucket.writeIntoCursor(value.abandoned, c);
5813
5902
  FfiConverterBool.writeIntoCursor(value.isComplete, c);
5814
5903
  }
5815
5904
  allocationSize(value: TypeName): number {
@@ -5818,6 +5907,8 @@ const FfiConverterTypeRecoveryReport = (() => {
5818
5907
  FfiConverterTypeRecoveryBucket.allocationSize(value.foreign) +
5819
5908
  FfiConverterTypeRecoveryBucket.allocationSize(value.failed) +
5820
5909
  FfiConverterTypeRecoveryBucket.allocationSize(value.exited) +
5910
+ FfiConverterTypeRecoveryBucket.allocationSize(value.notFound) +
5911
+ FfiConverterTypeRecoveryBucket.allocationSize(value.abandoned) +
5821
5912
  FfiConverterBool.allocationSize(value.isComplete);
5822
5913
 
5823
5914
  }
@@ -7478,11 +7569,12 @@ export type WalletOpenArgs = {
7478
7569
  */
7479
7570
  createWithoutServer: boolean,
7480
7571
  /**
7481
- * Whether to skip the seed-recovery mailbox scan
7572
+ * Whether to skip the recovery from seed
7482
7573
  *
7483
- * The scan runs on the open that creates the wallet locally and makes
7484
- * network calls; its outcome is available from `Wallet::recovery_status`.
7485
- * Set this to open without it.
7574
+ * The recovery starts on the open that creates the wallet locally, makes
7575
+ * network calls, and resumes on every sync until it is done; its outcome
7576
+ * is available from `Wallet::recovery_status`. Set this to open without
7577
+ * it.
7486
7578
  *
7487
7579
  * Default: false
7488
7580
  */
@@ -8029,19 +8121,22 @@ const FfiConverterTypePaymentResult = (() => {
8029
8121
  export enum RecoveryStatus_Tags {
8030
8122
  NotRun = "NotRun",
8031
8123
  Failed = "Failed",
8124
+ InProgress = "InProgress",
8032
8125
  Completed = "Completed"
8033
8126
  }
8034
8127
  /**
8035
- * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
8128
+ * Outcome of the seed recovery as `Wallet::open` saw it, mirroring
8036
8129
  * `bark::RecoveryStatus`.
8037
8130
  *
8038
- * The three variants are distinguishable on purpose: `NotRun` means nothing
8039
- * was attempted (wallet already existed locally, or `skip_recovery` was set),
8040
- * `Failed` means the scan errored before producing a report so funds may be
8041
- * missing until a retry succeeds, and `Completed` carries the report — whose
8042
- * `is_complete` can still be `false` for individual VTXOs.
8131
+ * The variants are distinguishable on purpose: `NotRun` means nothing was
8132
+ * attempted (wallet already existed locally without a recovery in progress,
8133
+ * or `skip_recovery` was set), `Failed` means the recovery could not be
8134
+ * started or read back so funds may be missing, `InProgress` means it stopped
8135
+ * before it was done and resumes on every sync, and `Completed` carries the
8136
+ * final report — whose `is_complete` can still be `false` for individual
8137
+ * VTXOs.
8043
8138
  *
8044
- * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
8139
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
8045
8140
  */
8046
8141
  export const RecoveryStatus = (() => {
8047
8142
 
@@ -8078,7 +8173,8 @@ export const RecoveryStatus = (() => {
8078
8173
  Readonly<{message: string}>
8079
8174
  };
8080
8175
  /**
8081
- * The scan errored before it could produce a report.
8176
+ * The recovery could not be started or its state could not be read
8177
+ * back.
8082
8178
  */
8083
8179
  class Failed_ extends UniffiEnum implements Failed__interface {
8084
8180
  /**
@@ -8106,13 +8202,50 @@ inner: {message: string }): Failed_ {
8106
8202
 
8107
8203
  }
8108
8204
 
8205
+ type InProgress__interface = {
8206
+ tag: RecoveryStatus_Tags.InProgress;
8207
+ inner:
8208
+ Readonly<{report: RecoveryReport}>
8209
+ };
8210
+ /**
8211
+ * The recovery stopped before it was done, on an error or on VTXOs it
8212
+ * could not decide on yet. The report holds what it decided so far; its
8213
+ * `failed` VTXOs are kept locked. Every sync resumes the recovery, see
8214
+ * `Wallet::pending_recovery`.
8215
+ */
8216
+ class InProgress_ extends UniffiEnum implements InProgress__interface {
8217
+ /**
8218
+ * @private
8219
+ * This field is private and should not be used, use `tag` instead.
8220
+ */
8221
+ readonly [uniffiTypeNameSymbol] = "RecoveryStatus";
8222
+ readonly tag = RecoveryStatus_Tags.InProgress;
8223
+ readonly inner:
8224
+ Readonly<{report: RecoveryReport}>;
8225
+ constructor(
8226
+ inner: {report: RecoveryReport }) {
8227
+ super("RecoveryStatus", "InProgress");
8228
+
8229
+ this.inner = Object.freeze(inner);
8230
+ }
8231
+ static new(
8232
+ inner: {report: RecoveryReport }): InProgress_ {
8233
+ return new InProgress_(inner);
8234
+ }
8235
+
8236
+ static instanceOf(obj: any): obj is InProgress_ {
8237
+ return obj.tag === RecoveryStatus_Tags.InProgress;
8238
+ }
8239
+
8240
+ }
8241
+
8109
8242
  type Completed__interface = {
8110
8243
  tag: RecoveryStatus_Tags.Completed;
8111
8244
  inner:
8112
8245
  Readonly<{report: RecoveryReport}>
8113
8246
  };
8114
8247
  /**
8115
- * The scan ran to the end.
8248
+ * The recovery is done: no VTXO is left failed.
8116
8249
  */
8117
8250
  class Completed_ extends UniffiEnum implements Completed__interface {
8118
8251
  /**
@@ -8148,24 +8281,27 @@ inner: {report: RecoveryReport }): Completed_ {
8148
8281
  instanceOf,
8149
8282
  NotRun: NotRun_,
8150
8283
  Failed: Failed_,
8284
+ InProgress: InProgress_,
8151
8285
  Completed: Completed_
8152
8286
  });
8153
8287
 
8154
8288
  })();
8155
8289
  /**
8156
- * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
8290
+ * Outcome of the seed recovery as `Wallet::open` saw it, mirroring
8157
8291
  * `bark::RecoveryStatus`.
8158
8292
  *
8159
- * The three variants are distinguishable on purpose: `NotRun` means nothing
8160
- * was attempted (wallet already existed locally, or `skip_recovery` was set),
8161
- * `Failed` means the scan errored before producing a report so funds may be
8162
- * missing until a retry succeeds, and `Completed` carries the report — whose
8163
- * `is_complete` can still be `false` for individual VTXOs.
8293
+ * The variants are distinguishable on purpose: `NotRun` means nothing was
8294
+ * attempted (wallet already existed locally without a recovery in progress,
8295
+ * or `skip_recovery` was set), `Failed` means the recovery could not be
8296
+ * started or read back so funds may be missing, `InProgress` means it stopped
8297
+ * before it was done and resumes on every sync, and `Completed` carries the
8298
+ * final report — whose `is_complete` can still be `false` for individual
8299
+ * VTXOs.
8164
8300
  *
8165
- * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
8301
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
8166
8302
  */
8167
8303
  export type RecoveryStatus = InstanceType<
8168
- typeof RecoveryStatus['NotRun' | 'Failed' | 'Completed']
8304
+ typeof RecoveryStatus['NotRun' | 'Failed' | 'InProgress' | 'Completed']
8169
8305
  >;
8170
8306
 
8171
8307
  // FfiConverter for enum RecoveryStatus
@@ -8176,7 +8312,8 @@ const FfiConverterTypeRecoveryStatus = (() => {
8176
8312
  switch (c.readI32()) {
8177
8313
  case 1: return new RecoveryStatus.NotRun();
8178
8314
  case 2: return new RecoveryStatus.Failed({message: FfiConverterString.readFromCursor(c) });
8179
- case 3: return new RecoveryStatus.Completed({report: FfiConverterTypeRecoveryReport.readFromCursor(c) });
8315
+ case 3: return new RecoveryStatus.InProgress({report: FfiConverterTypeRecoveryReport.readFromCursor(c) });
8316
+ case 4: return new RecoveryStatus.Completed({report: FfiConverterTypeRecoveryReport.readFromCursor(c) });
8180
8317
  default: throw new UniffiInternalError.UnexpectedEnumCase();
8181
8318
  }
8182
8319
  }
@@ -8192,12 +8329,18 @@ const FfiConverterTypeRecoveryStatus = (() => {
8192
8329
  FfiConverterString.writeIntoCursor(inner.message, c);
8193
8330
  return;
8194
8331
  }
8195
- case RecoveryStatus_Tags.Completed: {
8332
+ case RecoveryStatus_Tags.InProgress: {
8196
8333
  c.writeI32(3);
8197
8334
  const inner = value.inner;
8198
8335
  FfiConverterTypeRecoveryReport.writeIntoCursor(inner.report, c);
8199
8336
  return;
8200
8337
  }
8338
+ case RecoveryStatus_Tags.Completed: {
8339
+ c.writeI32(4);
8340
+ const inner = value.inner;
8341
+ FfiConverterTypeRecoveryReport.writeIntoCursor(inner.report, c);
8342
+ return;
8343
+ }
8201
8344
  default:
8202
8345
  // Throwing from here means that RecoveryStatus_Tags hasn't matched an ordinal.
8203
8346
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -8214,6 +8357,12 @@ const FfiConverterTypeRecoveryStatus = (() => {
8214
8357
  size += FfiConverterString.allocationSize(inner.message);
8215
8358
  return size;
8216
8359
  }
8360
+ case RecoveryStatus_Tags.InProgress: {
8361
+ const inner = value.inner;
8362
+ let size = 4;
8363
+ size += FfiConverterTypeRecoveryReport.allocationSize(inner.report);
8364
+ return size;
8365
+ }
8217
8366
  case RecoveryStatus_Tags.Completed: {
8218
8367
  const inner = value.inner;
8219
8368
  let size = 4;
@@ -8659,6 +8808,17 @@ export interface CustomOnchainWalletCallbacks {
8659
8808
  /**
8660
8809
  * Create a signed P2A CPFP transaction
8661
8810
  *
8811
+ * The child spends the parent's P2A anchor and pays the fee for the
8812
+ * whole package: at least (parent vsize + child vsize) times
8813
+ * `effective_fee_rate_sat_per_vb`, the parent being zero-fee.
8814
+ *
8815
+ * For `fees_type == "Rbf"` the child replaces what already spends the
8816
+ * anchor, so bitcoind's replacement rules apply on top. With
8817
+ * `replacement_vsize` the child's vsize, plus the parent's when
8818
+ * `parent_in_mempool` is false, the child must also pay at least:
8819
+ * * `replaced_fee_sats + incremental_relay_fee_sat_per_vb * replacement_vsize`
8820
+ * * `(replaced_fee_rate_sat_per_vb + incremental_relay_fee_sat_per_vb) * replacement_vsize`
8821
+ *
8662
8822
  * # Arguments
8663
8823
  * * `params` - CPFP transaction parameters
8664
8824
  *
@@ -8875,6 +9035,17 @@ private constructor(pointer: UniffiHandle) {
8875
9035
  /**
8876
9036
  * Create a signed P2A CPFP transaction
8877
9037
  *
9038
+ * The child spends the parent's P2A anchor and pays the fee for the
9039
+ * whole package: at least (parent vsize + child vsize) times
9040
+ * `effective_fee_rate_sat_per_vb`, the parent being zero-fee.
9041
+ *
9042
+ * For `fees_type == "Rbf"` the child replaces what already spends the
9043
+ * anchor, so bitcoind's replacement rules apply on top. With
9044
+ * `replacement_vsize` the child's vsize, plus the parent's when
9045
+ * `parent_in_mempool` is false, the child must also pay at least:
9046
+ * * `replaced_fee_sats + incremental_relay_fee_sat_per_vb * replacement_vsize`
9047
+ * * `(replaced_fee_rate_sat_per_vb + incremental_relay_fee_sat_per_vb) * replacement_vsize`
9048
+ *
8878
9049
  * # Arguments
8879
9050
  * * `params` - CPFP transaction parameters
8880
9051
  *
@@ -9564,10 +9735,41 @@ export interface WalletLike {
9564
9735
  * as `options` selects.
9565
9736
  */
9566
9737
  bip321Uri(options: Bip321UriOptions, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Bip321Uri>;
9567
- boardAll(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
9568
- boardAmount(amountSats: bigint, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
9569
- boardFundingAddress(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BoardFundingInfo>;
9570
- boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
9738
+ /**
9739
+ * Board all funds of the onchain wallet. See `board_amount` for
9740
+ * `expiry_height`.
9741
+ */
9742
+ boardAll(expiryHeight: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
9743
+ /**
9744
+ * Board `amount_sats` from the onchain wallet.
9745
+ *
9746
+ * `expiry_height` sets the block height at which the board VTXO expires.
9747
+ * It defaults to `Config.board_lifetime` blocks from the tip, capped at
9748
+ * the server's VTXO lifetime; an expiry beyond that lifetime, or too
9749
+ * close to the tip to confirm and register in time, is refused.
9750
+ */
9751
+ boardAmount(amountSats: bigint, expiryHeight: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
9752
+ /**
9753
+ * Derive a fresh key and return the address to fund a board with from
9754
+ * elsewhere, e.g. as a payjoin receiver. Persist the returned info and
9755
+ * pass it to `board_psbt` with the funding PSBT. See `board_amount` for
9756
+ * `expiry_height`.
9757
+ */
9758
+ boardFundingAddress(expiryHeight: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BoardFundingInfo>;
9759
+ /**
9760
+ * Board from a funding PSBT paying the address of `funding`, made by
9761
+ * `board_funding_address`.
9762
+ *
9763
+ * A finalized PSBT is broadcast by bark; an unfinalized one leaves the
9764
+ * broadcast to another party and bark waits for the transaction to
9765
+ * appear. The board commits to the PSBT's txid, so if the other party
9766
+ * changes the transaction, call this again with the new PSBT and the
9767
+ * same `funding`.
9768
+ *
9769
+ * Fails once `funding` is too close to its expiry height; make a new
9770
+ * funding address then.
9771
+ */
9772
+ boardPsbt(psbtBase64: string, funding: BoardFundingInfo, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
9571
9773
  /**
9572
9774
  * Create an invoice for an incoming lightning payment.
9573
9775
  *
@@ -9698,6 +9900,16 @@ export interface WalletLike {
9698
9900
  * table without consulting the server.
9699
9901
  */
9700
9902
  isInvoicePaid(paymentHash: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<boolean>;
9903
+ /**
9904
+ * Rebuild the funding info of a funding address made before
9905
+ * `BoardFundingInfo` carried `user_pubkey`, from the `keypair_index` and
9906
+ * `expiry_height` stored alongside it.
9907
+ *
9908
+ * Only for boards funded through the old `board_funding_address`. If the
9909
+ * server's key or exit delta changed since, the rebuilt address won't
9910
+ * match and `board_psbt` refuses the PSBT.
9911
+ */
9912
+ legacyBoardFundingAddress(keypairIndex: number, expiryHeight: number, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BoardFundingInfo>;
9701
9913
  /**
9702
9914
  * Triage a payment hash: settled or in-progress. Errors if no lightning
9703
9915
  * receive is known for this payment hash.
@@ -9790,6 +10002,16 @@ export interface WalletLike {
9790
10002
  pendingLightningReceives(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<LightningReceive>>;
9791
10003
  pendingLightningSendVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Vtxo>>;
9792
10004
  pendingLightningSends(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<LightningSend>>;
10005
+ /**
10006
+ * The report of the recovery from seed in progress, or none once it is
10007
+ * done (or if none ever ran). Its `failed` VTXOs are the ones still
10008
+ * missing: they are kept locked until the server gives their status.
10009
+ *
10010
+ * When a recovery resumed after open is done, bark only logs its final
10011
+ * report; it cannot be read here. VTXOs it gave up on (`abandoned`) stay
10012
+ * locked, so they still show in `vtxos`.
10013
+ */
10014
+ pendingRecovery(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RecoveryReport | undefined>;
9793
10015
  pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Vtxo>>;
9794
10016
  pendingRoundStates(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<RoundState>>;
9795
10017
  /**
@@ -9818,7 +10040,10 @@ export interface WalletLike {
9818
10040
  /**
9819
10041
  * Recover the given VTXO ids from the server, importing the ones this
9820
10042
  * wallet owns that are still spendable. Use it to retry ids a previous
9821
- * scan reported as `failed`.
10043
+ * recovery reported as `failed` or `abandoned`.
10044
+ *
10045
+ * Fails while a recovery from seed is being driven, as both work on the
10046
+ * same locked VTXOs.
9822
10047
  *
9823
10048
  * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
9824
10049
  * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
@@ -9826,21 +10051,23 @@ export interface WalletLike {
9826
10051
  */
9827
10052
  recoverVtxos(vtxoIds: Array<string>, gapLimit: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RecoveryReport>;
9828
10053
  /**
9829
- * The report of the seed-recovery scan that ran during `Wallet::open`, or
9830
- * none if the scan did not complete. Use `recovery_status` to tell a scan
9831
- * that failed apart from one that never ran.
10054
+ * The report of the recovery from seed as `Wallet::open` saw it, or none
10055
+ * if it did not run or failed. Use `recovery_status` to tell these apart.
9832
10056
  */
9833
10057
  recoveryReport(): RecoveryReport | undefined;
9834
10058
  /**
9835
- * Outcome of the seed-recovery scan that ran during `Wallet::open`.
10059
+ * Outcome of the recovery from seed as `Wallet::open` saw it. A
10060
+ * snapshot: it does not change after open, see `pending_recovery` for the
10061
+ * live state.
9836
10062
  *
9837
- * Recovery only runs on the open that creates the wallet locally, and not
9838
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
9839
- * on every subsequent open. `Failed` means the scan errored before
9840
- * producing a report — bark logs that and lets open succeed — so funds
9841
- * may be missing until a retry; `Completed` carries the report, and
9842
- * `isComplete == false` there means funds may still be missing. Retry the
9843
- * report's `failed` ids with `recoverVtxos`.
10063
+ * Recovery starts on the open that creates the wallet locally, unless
10064
+ * `WalletOpenArgs.skip_recovery` is set. A later open reports
10065
+ * `InProgress` while that recovery is not done, and `NotRun` otherwise.
10066
+ * `Failed` means the recovery could not be started or read back — bark
10067
+ * logs that and lets open succeed — so funds may be missing. `InProgress`
10068
+ * means it stopped before it was done; every sync resumes it. `Completed`
10069
+ * carries the final report, and `isComplete == false` there means funds
10070
+ * may still be missing.
9844
10071
  */
9845
10072
  recoveryStatus(): RecoveryStatus;
9846
10073
  refreshServer(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
@@ -9907,9 +10134,12 @@ export interface WalletLike {
9907
10134
  startExitForVtxosIncludingNonStandard(vtxoIds: Array<string>, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9908
10135
  stopDaemon(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9909
10136
  /**
9910
- * Stop the background daemon and wait until its tasks have finished, so
9911
- * nothing runs in the background afterwards (e.g. before deleting the
9912
- * wallet's datadir). No-op when no daemon is running.
10137
+ * Stop the background daemon and wait until it has finished, e.g. before
10138
+ * deleting the wallet's datadir. No-op when no daemon is running.
10139
+ *
10140
+ * While another call already waits for the daemon, this returns at once
10141
+ * without waiting. A start made while it waits goes ahead, so the daemon
10142
+ * runs again after.
9913
10143
  */
9914
10144
  stopDaemonWait(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9915
10145
  /**
@@ -9927,6 +10157,14 @@ export interface WalletLike {
9927
10157
  */
9928
10158
  syncForceExitedVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9929
10159
  syncPendingBoards(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
10160
+ /**
10161
+ * Drive the recovery from seed in progress, if any, until it is done or
10162
+ * parks again. Does nothing while another drive holds its lock.
10163
+ *
10164
+ * This already runs as part of `sync`; call it to resume the recovery on
10165
+ * demand.
10166
+ */
10167
+ syncPendingRecovery(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9930
10168
  tryClaimAllLightningReceives(wait: boolean, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<LightningReceive>>;
9931
10169
  tryClaimLightningReceive(paymentHash: string, wait: boolean, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningReceive>;
9932
10170
  /**
@@ -10340,14 +10578,18 @@ private constructor(pointer: UniffiHandle) {
10340
10578
  }
10341
10579
  }
10342
10580
 
10343
- async boardAll(asyncOpts_?: { signal: AbortSignal }): Promise<PendingBoard> /*throws*/ {
10581
+ /**
10582
+ * Board all funds of the onchain wallet. See `board_amount` for
10583
+ * `expiry_height`.
10584
+ */
10585
+ async boardAll(expiryHeight: number | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<PendingBoard> /*throws*/ {
10344
10586
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
10345
10587
  try {
10346
10588
  return await uniffiRustCallAsync(
10347
10589
  /*rustCaller:*/ uniffiCaller,
10348
10590
  /*rustFutureFunc:*/ () => {
10349
10591
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_all(
10350
- uniffiTypeWalletObjectFactory.clonePointer(this)
10592
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
10351
10593
  );
10352
10594
  },
10353
10595
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -10381,14 +10623,22 @@ private constructor(pointer: UniffiHandle) {
10381
10623
  }
10382
10624
  }
10383
10625
 
10384
- async boardAmount(amountSats: bigint, asyncOpts_?: { signal: AbortSignal }): Promise<PendingBoard> /*throws*/ {
10626
+ /**
10627
+ * Board `amount_sats` from the onchain wallet.
10628
+ *
10629
+ * `expiry_height` sets the block height at which the board VTXO expires.
10630
+ * It defaults to `Config.board_lifetime` blocks from the tip, capped at
10631
+ * the server's VTXO lifetime; an expiry beyond that lifetime, or too
10632
+ * close to the tip to confirm and register in time, is refused.
10633
+ */
10634
+ async boardAmount(amountSats: bigint, expiryHeight: number | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<PendingBoard> /*throws*/ {
10385
10635
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
10386
10636
  try {
10387
10637
  return await uniffiRustCallAsync(
10388
10638
  /*rustCaller:*/ uniffiCaller,
10389
10639
  /*rustFutureFunc:*/ () => {
10390
10640
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_amount(
10391
- uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc)
10641
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
10392
10642
  );
10393
10643
  },
10394
10644
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -10422,14 +10672,20 @@ private constructor(pointer: UniffiHandle) {
10422
10672
  }
10423
10673
  }
10424
10674
 
10425
- async boardFundingAddress(asyncOpts_?: { signal: AbortSignal }): Promise<BoardFundingInfo> /*throws*/ {
10675
+ /**
10676
+ * Derive a fresh key and return the address to fund a board with from
10677
+ * elsewhere, e.g. as a payjoin receiver. Persist the returned info and
10678
+ * pass it to `board_psbt` with the funding PSBT. See `board_amount` for
10679
+ * `expiry_height`.
10680
+ */
10681
+ async boardFundingAddress(expiryHeight: number | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<BoardFundingInfo> /*throws*/ {
10426
10682
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
10427
10683
  try {
10428
10684
  return await uniffiRustCallAsync(
10429
10685
  /*rustCaller:*/ uniffiCaller,
10430
10686
  /*rustFutureFunc:*/ () => {
10431
10687
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_funding_address(
10432
- uniffiTypeWalletObjectFactory.clonePointer(this)
10688
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
10433
10689
  );
10434
10690
  },
10435
10691
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -10463,14 +10719,27 @@ private constructor(pointer: UniffiHandle) {
10463
10719
  }
10464
10720
  }
10465
10721
 
10466
- async boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: { signal: AbortSignal }): Promise<PendingBoard> /*throws*/ {
10722
+ /**
10723
+ * Board from a funding PSBT paying the address of `funding`, made by
10724
+ * `board_funding_address`.
10725
+ *
10726
+ * A finalized PSBT is broadcast by bark; an unfinalized one leaves the
10727
+ * broadcast to another party and bark waits for the transaction to
10728
+ * appear. The board commits to the PSBT's txid, so if the other party
10729
+ * changes the transaction, call this again with the new PSBT and the
10730
+ * same `funding`.
10731
+ *
10732
+ * Fails once `funding` is too close to its expiry height; make a new
10733
+ * funding address then.
10734
+ */
10735
+ async boardPsbt(psbtBase64: string, funding: BoardFundingInfo, asyncOpts_?: { signal: AbortSignal }): Promise<PendingBoard> /*throws*/ {
10467
10736
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
10468
10737
  try {
10469
10738
  return await uniffiRustCallAsync(
10470
10739
  /*rustCaller:*/ uniffiCaller,
10471
10740
  /*rustFutureFunc:*/ () => {
10472
10741
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_psbt(
10473
- uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterString.lower(psbtBase64, nativeModule().rustbuffer_alloc),FfiConverterUInt32.lower(keypairIndex, nativeModule().rustbuffer_alloc),FfiConverterUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
10742
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterString.lower(psbtBase64, nativeModule().rustbuffer_alloc),FfiConverterTypeBoardFundingInfo.lower(funding, nativeModule().rustbuffer_alloc)
10474
10743
  );
10475
10744
  },
10476
10745
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -11966,6 +12235,56 @@ private constructor(pointer: UniffiHandle) {
11966
12235
  }
11967
12236
  }
11968
12237
 
12238
+ /**
12239
+ * Rebuild the funding info of a funding address made before
12240
+ * `BoardFundingInfo` carried `user_pubkey`, from the `keypair_index` and
12241
+ * `expiry_height` stored alongside it.
12242
+ *
12243
+ * Only for boards funded through the old `board_funding_address`. If the
12244
+ * server's key or exit delta changed since, the rebuilt address won't
12245
+ * match and `board_psbt` refuses the PSBT.
12246
+ */
12247
+ async legacyBoardFundingAddress(keypairIndex: number, expiryHeight: number, asyncOpts_?: { signal: AbortSignal }): Promise<BoardFundingInfo> /*throws*/ {
12248
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
12249
+ try {
12250
+ return await uniffiRustCallAsync(
12251
+ /*rustCaller:*/ uniffiCaller,
12252
+ /*rustFutureFunc:*/ () => {
12253
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_legacy_board_funding_address(
12254
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt32.lower(keypairIndex, nativeModule().rustbuffer_alloc),FfiConverterUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
12255
+ );
12256
+ },
12257
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
12258
+ /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
12259
+ /*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
12260
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
12261
+ // Async returns always go through the JS-side converter: the
12262
+ // FFI symbol returns the future handle (u64), and the user-level
12263
+ // RustBuffer comes back via the shared `rust_future_complete_*`
12264
+ // export. The bytes the runtime hands back must be deserialized
12265
+ // here using the per-callable return-type converter.
12266
+ // Borrowed view over foreign memory: the call site owns the free,
12267
+ // as on the sync paths. Unconditional — a no-op where buffers are
12268
+ // already JS-owned.
12269
+ /*liftFunc:*/ (__rb) => {
12270
+ try {
12271
+ return FfiConverterTypeBoardFundingInfo.lift(__rb);
12272
+ } finally {
12273
+ nativeModule().rustbuffer_free(__rb);
12274
+ }
12275
+ },
12276
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
12277
+ /*asyncOpts:*/ asyncOpts_,
12278
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
12279
+ );
12280
+ } catch (__error: any) {
12281
+ if (uniffiIsDebug && __error instanceof Error) {
12282
+ __error.stack = __stack;
12283
+ }
12284
+ throw __error;
12285
+ }
12286
+ }
12287
+
11969
12288
  /**
11970
12289
  * Triage a payment hash: settled or in-progress. Errors if no lightning
11971
12290
  * receive is known for this payment hash.
@@ -13161,6 +13480,56 @@ private constructor(pointer: UniffiHandle) {
13161
13480
  }
13162
13481
  }
13163
13482
 
13483
+ /**
13484
+ * The report of the recovery from seed in progress, or none once it is
13485
+ * done (or if none ever ran). Its `failed` VTXOs are the ones still
13486
+ * missing: they are kept locked until the server gives their status.
13487
+ *
13488
+ * When a recovery resumed after open is done, bark only logs its final
13489
+ * report; it cannot be read here. VTXOs it gave up on (`abandoned`) stay
13490
+ * locked, so they still show in `vtxos`.
13491
+ */
13492
+ async pendingRecovery(asyncOpts_?: { signal: AbortSignal }): Promise<RecoveryReport | undefined> /*throws*/ {
13493
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
13494
+ try {
13495
+ return await uniffiRustCallAsync(
13496
+ /*rustCaller:*/ uniffiCaller,
13497
+ /*rustFutureFunc:*/ () => {
13498
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_recovery(
13499
+ uniffiTypeWalletObjectFactory.clonePointer(this)
13500
+ );
13501
+ },
13502
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
13503
+ /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
13504
+ /*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
13505
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
13506
+ // Async returns always go through the JS-side converter: the
13507
+ // FFI symbol returns the future handle (u64), and the user-level
13508
+ // RustBuffer comes back via the shared `rust_future_complete_*`
13509
+ // export. The bytes the runtime hands back must be deserialized
13510
+ // here using the per-callable return-type converter.
13511
+ // Borrowed view over foreign memory: the call site owns the free,
13512
+ // as on the sync paths. Unconditional — a no-op where buffers are
13513
+ // already JS-owned.
13514
+ /*liftFunc:*/ (__rb) => {
13515
+ try {
13516
+ return FfiConverterOptionalTypeRecoveryReport.lift(__rb);
13517
+ } finally {
13518
+ nativeModule().rustbuffer_free(__rb);
13519
+ }
13520
+ },
13521
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
13522
+ /*asyncOpts:*/ asyncOpts_,
13523
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
13524
+ );
13525
+ } catch (__error: any) {
13526
+ if (uniffiIsDebug && __error instanceof Error) {
13527
+ __error.stack = __stack;
13528
+ }
13529
+ throw __error;
13530
+ }
13531
+ }
13532
+
13164
13533
  async pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal }): Promise<Array<Vtxo>> /*throws*/ {
13165
13534
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
13166
13535
  try {
@@ -13415,7 +13784,10 @@ private constructor(pointer: UniffiHandle) {
13415
13784
  /**
13416
13785
  * Recover the given VTXO ids from the server, importing the ones this
13417
13786
  * wallet owns that are still spendable. Use it to retry ids a previous
13418
- * scan reported as `failed`.
13787
+ * recovery reported as `failed` or `abandoned`.
13788
+ *
13789
+ * Fails while a recovery from seed is being driven, as both work on the
13790
+ * same locked VTXOs.
13419
13791
  *
13420
13792
  * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
13421
13793
  * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
@@ -13463,9 +13835,8 @@ private constructor(pointer: UniffiHandle) {
13463
13835
  }
13464
13836
 
13465
13837
  /**
13466
- * The report of the seed-recovery scan that ran during `Wallet::open`, or
13467
- * none if the scan did not complete. Use `recovery_status` to tell a scan
13468
- * that failed apart from one that never ran.
13838
+ * The report of the recovery from seed as `Wallet::open` saw it, or none
13839
+ * if it did not run or failed. Use `recovery_status` to tell these apart.
13469
13840
  */
13470
13841
  recoveryReport(): RecoveryReport | undefined {
13471
13842
  const __rb: Uint8Array = uniffiCaller.rustCall(
@@ -13484,15 +13855,18 @@ private constructor(pointer: UniffiHandle) {
13484
13855
  }
13485
13856
 
13486
13857
  /**
13487
- * Outcome of the seed-recovery scan that ran during `Wallet::open`.
13858
+ * Outcome of the recovery from seed as `Wallet::open` saw it. A
13859
+ * snapshot: it does not change after open, see `pending_recovery` for the
13860
+ * live state.
13488
13861
  *
13489
- * Recovery only runs on the open that creates the wallet locally, and not
13490
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
13491
- * on every subsequent open. `Failed` means the scan errored before
13492
- * producing a report — bark logs that and lets open succeed — so funds
13493
- * may be missing until a retry; `Completed` carries the report, and
13494
- * `isComplete == false` there means funds may still be missing. Retry the
13495
- * report's `failed` ids with `recoverVtxos`.
13862
+ * Recovery starts on the open that creates the wallet locally, unless
13863
+ * `WalletOpenArgs.skip_recovery` is set. A later open reports
13864
+ * `InProgress` while that recovery is not done, and `NotRun` otherwise.
13865
+ * `Failed` means the recovery could not be started or read back — bark
13866
+ * logs that and lets open succeed — so funds may be missing. `InProgress`
13867
+ * means it stopped before it was done; every sync resumes it. `Completed`
13868
+ * carries the final report, and `isComplete == false` there means funds
13869
+ * may still be missing.
13496
13870
  */
13497
13871
  recoveryStatus(): RecoveryStatus {
13498
13872
  const __rb: Uint8Array = uniffiCaller.rustCall(
@@ -14081,9 +14455,12 @@ private constructor(pointer: UniffiHandle) {
14081
14455
  }
14082
14456
 
14083
14457
  /**
14084
- * Stop the background daemon and wait until its tasks have finished, so
14085
- * nothing runs in the background afterwards (e.g. before deleting the
14086
- * wallet's datadir). No-op when no daemon is running.
14458
+ * Stop the background daemon and wait until it has finished, e.g. before
14459
+ * deleting the wallet's datadir. No-op when no daemon is running.
14460
+ *
14461
+ * While another call already waits for the daemon, this returns at once
14462
+ * without waiting. A start made while it waits goes ahead, so the daemon
14463
+ * runs again after.
14087
14464
  */
14088
14465
  async stopDaemonWait(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
14089
14466
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -14271,6 +14648,40 @@ private constructor(pointer: UniffiHandle) {
14271
14648
  }
14272
14649
  }
14273
14650
 
14651
+ /**
14652
+ * Drive the recovery from seed in progress, if any, until it is done or
14653
+ * parks again. Does nothing while another drive holds its lock.
14654
+ *
14655
+ * This already runs as part of `sync`; call it to resume the recovery on
14656
+ * demand.
14657
+ */
14658
+ async syncPendingRecovery(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
14659
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
14660
+ try {
14661
+ return await uniffiRustCallAsync(
14662
+ /*rustCaller:*/ uniffiCaller,
14663
+ /*rustFutureFunc:*/ () => {
14664
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync_pending_recovery(
14665
+ uniffiTypeWalletObjectFactory.clonePointer(this)
14666
+ );
14667
+ },
14668
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
14669
+ /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_void,
14670
+ /*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_void,
14671
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
14672
+ /*liftFunc:*/ (_v) => {},
14673
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
14674
+ /*asyncOpts:*/ asyncOpts_,
14675
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
14676
+ );
14677
+ } catch (__error: any) {
14678
+ if (uniffiIsDebug && __error instanceof Error) {
14679
+ __error.stack = __stack;
14680
+ }
14681
+ throw __error;
14682
+ }
14683
+ }
14684
+
14274
14685
  async tryClaimAllLightningReceives(wait: boolean = false, asyncOpts_?: { signal: AbortSignal }): Promise<Array<LightningReceive>> /*throws*/ {
14275
14686
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
14276
14687
  try {
@@ -14712,6 +15123,9 @@ const FfiConverterSequenceTypeLightningReceive = new FfiConverterArray(FfiConver
14712
15123
  // FfiConverter for Array<LightningSend>
14713
15124
  const FfiConverterSequenceTypeLightningSend = new FfiConverterArray(FfiConverterTypeLightningSend);
14714
15125
 
15126
+ // FfiConverter for RecoveryReport | undefined
15127
+ const FfiConverterOptionalTypeRecoveryReport = new FfiConverterOptional(FfiConverterTypeRecoveryReport);
15128
+
14715
15129
  // FfiConverter for Array<RoundState>
14716
15130
  const FfiConverterSequenceTypeRoundState = new FfiConverterArray(FfiConverterTypeRoundState);
14717
15131
 
@@ -14721,9 +15135,6 @@ const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverter
14721
15135
  // FfiConverter for Array<ExitProgressStatus>
14722
15136
  const FfiConverterSequenceTypeExitProgressStatus = new FfiConverterArray(FfiConverterTypeExitProgressStatus);
14723
15137
 
14724
- // FfiConverter for RecoveryReport | undefined
14725
- const FfiConverterOptionalTypeRecoveryReport = new FfiConverterOptional(FfiConverterTypeRecoveryReport);
14726
-
14727
15138
  // FfiConverter for RoundState | undefined
14728
15139
  const FfiConverterOptionalTypeRoundState = new FfiConverterOptional(FfiConverterTypeRoundState);
14729
15140
 
@@ -14809,7 +15220,7 @@ function uniffiEnsureInitialized() {
14809
15220
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx() !== 36298) {
14810
15221
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx");
14811
15222
  }
14812
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !== 46075) {
15223
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !== 54481) {
14813
15224
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp");
14814
15225
  }
14815
15226
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !== 64815) {
@@ -14887,16 +15298,16 @@ function uniffiEnsureInitialized() {
14887
15298
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bip321_uri() !== 64697) {
14888
15299
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bip321_uri");
14889
15300
  }
14890
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_all() !== 5667) {
15301
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_all() !== 20725) {
14891
15302
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_all");
14892
15303
  }
14893
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !== 54692) {
15304
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !== 52165) {
14894
15305
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_amount");
14895
15306
  }
14896
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_funding_address() !== 8961) {
15307
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_funding_address() !== 44995) {
14897
15308
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_funding_address");
14898
15309
  }
14899
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_psbt() !== 28300) {
15310
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_psbt() !== 24319) {
14900
15311
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_psbt");
14901
15312
  }
14902
15313
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 32731) {
@@ -15007,6 +15418,9 @@ function uniffiEnsureInitialized() {
15007
15418
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid() !== 5699) {
15008
15419
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid");
15009
15420
  }
15421
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_legacy_board_funding_address() !== 9227) {
15422
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_legacy_board_funding_address");
15423
+ }
15010
15424
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state() !== 27834) {
15011
15425
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state");
15012
15426
  }
@@ -15100,6 +15514,9 @@ function uniffiEnsureInitialized() {
15100
15514
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends() !== 8847) {
15101
15515
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends");
15102
15516
  }
15517
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_recovery() !== 25503) {
15518
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_recovery");
15519
+ }
15103
15520
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_input_vtxos() !== 54307) {
15104
15521
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_round_input_vtxos");
15105
15522
  }
@@ -15118,13 +15535,13 @@ function uniffiEnsureInitialized() {
15118
15535
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_properties() !== 9773) {
15119
15536
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_properties");
15120
15537
  }
15121
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recover_vtxos() !== 56476) {
15538
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recover_vtxos() !== 57570) {
15122
15539
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recover_vtxos");
15123
15540
  }
15124
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_report() !== 10331) {
15541
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_report() !== 3988) {
15125
15542
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recovery_report");
15126
15543
  }
15127
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_status() !== 14132) {
15544
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_recovery_status() !== 60997) {
15128
15545
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recovery_status");
15129
15546
  }
15130
15547
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !== 41162) {
@@ -15172,7 +15589,7 @@ function uniffiEnsureInitialized() {
15172
15589
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon() !== 7109) {
15173
15590
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon");
15174
15591
  }
15175
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait() !== 1734) {
15592
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait() !== 53241) {
15176
15593
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait");
15177
15594
  }
15178
15595
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends() !== 31613) {
@@ -15190,6 +15607,9 @@ function uniffiEnsureInitialized() {
15190
15607
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards() !== 63453) {
15191
15608
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards");
15192
15609
  }
15610
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_pending_recovery() !== 40039) {
15611
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync_pending_recovery");
15612
+ }
15193
15613
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives() !== 14560) {
15194
15614
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives");
15195
15615
  }