@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.
@@ -279,6 +279,10 @@ export type ArkInfo = {
279
279
  * server refuses to cosign further OOR transactions spending it.
280
280
  */
281
281
  maxVtxoExitDepth: number;
282
+ /**
283
+ * Maximum number of outputs of a single round participation.
284
+ */
285
+ maxRoundParticipationOutputs: number;
282
286
  };
283
287
  /**
284
288
  * Generated factory for {@link ArkInfo} record objects.
@@ -1016,17 +1020,31 @@ export declare const BlockRef: Readonly<{
1016
1020
  defaults: () => Partial<BlockRef>;
1017
1021
  }>;
1018
1022
  /**
1019
- * Destination for an externally funded board (e.g. a payjoin receive).
1023
+ * Destination for an externally funded board (e.g. a payjoin receive),
1024
+ * mirroring `bark::BoardFundingAddress`.
1020
1025
  *
1021
- * The funding script commits to the derived keypair and expiry height, so
1022
- * `keypair_index` and `expiry_height` must be passed back unchanged to
1023
- * `board_psbt` once the funding PSBT is available — including on retries
1024
- * after the sender changes the transaction.
1026
+ * The funding script commits to `user_pubkey` and `expiry_height`, so persist
1027
+ * this record and pass it back unchanged to `board_psbt` once the funding
1028
+ * PSBT is available — including on retries after the sender changes the
1029
+ * transaction. Fund it right away: the board VTXO's lifetime started when
1030
+ * the address was made, and once it expires the server can sweep the funding
1031
+ * output alone.
1025
1032
  */
1026
1033
  export type BoardFundingInfo = {
1034
+ /**
1035
+ * Address the funding transaction must pay. Informational only:
1036
+ * `board_psbt` rebuilds the funding script from `user_pubkey` and
1037
+ * `expiry_height` and does not read it.
1038
+ */
1027
1039
  address: string;
1040
+ /**
1041
+ * Block height at which the board VTXO expires.
1042
+ */
1028
1043
  expiryHeight: number;
1029
- keypairIndex: number;
1044
+ /**
1045
+ * Hex-encoded wallet public key the board VTXO is locked to.
1046
+ */
1047
+ userPubkey: string;
1030
1048
  };
1031
1049
  /**
1032
1050
  * Generated factory for {@link BoardFundingInfo} record objects.
@@ -1090,6 +1108,15 @@ export type Config = {
1090
1108
  bitcoindPass?: string;
1091
1109
  vtxoRefreshExpiryThreshold?: number;
1092
1110
  vtxoExitMargin?: number;
1111
+ /**
1112
+ * The default lifetime of a board VTXO, in blocks.
1113
+ *
1114
+ * Capped at the server's `ArkInfo.vtxo_lifetime`. Override it per board
1115
+ * with the `expiry_height` argument of the board methods.
1116
+ *
1117
+ * Default: 432 (3 days) on mainnet, 4320 (30 days) otherwise
1118
+ */
1119
+ boardLifetime?: number;
1093
1120
  htlcRecvClaimDelta?: number;
1094
1121
  fallbackFeeRate?: bigint;
1095
1122
  roundTxRequiredConfirmations?: number;
@@ -1117,25 +1144,53 @@ export type Config = {
1117
1144
  * Generated factory for {@link Config} record objects.
1118
1145
  */
1119
1146
  export declare const Config: Readonly<{
1120
- create: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
1121
- new: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
1147
+ create: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "boardLifetime" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
1148
+ new: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "boardLifetime" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
1122
1149
  defaults: () => Partial<Config>;
1123
1150
  }>;
1124
1151
  /**
1125
1152
  * Parameters for creating a CPFP (Child Pays For Parent) transaction
1126
1153
  */
1127
1154
  export type CpfpParams = {
1155
+ /**
1156
+ * Hex-encoded zero-fee parent transaction to bump through its P2A anchor
1157
+ */
1128
1158
  txHex: string;
1159
+ /**
1160
+ * `"Effective"` for a fresh child, `"Rbf"` to replace a child already in
1161
+ * the mempool. The `Rbf`-only fields below are `None` for `"Effective"`.
1162
+ */
1129
1163
  feesType: string;
1164
+ /**
1165
+ * Effective fee rate the whole package (parent + child) must reach, in
1166
+ * sat/vB rounded up
1167
+ */
1130
1168
  effectiveFeeRateSatPerVb: bigint;
1131
- currentPackageFeeSats?: bigint;
1169
+ /**
1170
+ * `Rbf` only: total fee of the transactions the new child replaces
1171
+ */
1172
+ replacedFeeSats?: bigint;
1173
+ /**
1174
+ * `Rbf` only: fee rate of the transactions the new child replaces, in
1175
+ * sat/vB rounded up
1176
+ */
1177
+ replacedFeeRateSatPerVb?: bigint;
1178
+ /**
1179
+ * `Rbf` only: the node's incremental relay fee, in sat/vB rounded up
1180
+ */
1181
+ incrementalRelayFeeSatPerVb?: bigint;
1182
+ /**
1183
+ * `Rbf` only: whether the parent is already in the mempool. If not, the
1184
+ * parent is part of the replacement.
1185
+ */
1186
+ parentInMempool?: boolean;
1132
1187
  };
1133
1188
  /**
1134
1189
  * Generated factory for {@link CpfpParams} record objects.
1135
1190
  */
1136
1191
  export declare const CpfpParams: Readonly<{
1137
- create: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "currentPackageFeeSats">>) => CpfpParams;
1138
- new: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "currentPackageFeeSats">>) => CpfpParams;
1192
+ create: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "replacedFeeSats" | "replacedFeeRateSatPerVb" | "incrementalRelayFeeSatPerVb" | "parentInMempool">>) => CpfpParams;
1193
+ new: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "replacedFeeSats" | "replacedFeeRateSatPerVb" | "incrementalRelayFeeSatPerVb" | "parentInMempool">>) => CpfpParams;
1139
1194
  defaults: () => Partial<CpfpParams>;
1140
1195
  }>;
1141
1196
  /**
@@ -2904,8 +2959,8 @@ export declare const PresignedExits: Readonly<{
2904
2959
  * One bucket of a [`RecoveryReport`].
2905
2960
  *
2906
2961
  * `total_sats` only sums the VTXOs whose amount is known, so it can
2907
- * under-count `failed`, where a VTXO may have failed before being fetched.
2908
- * `vtxo_ids` is sorted, since upstream buckets them unordered.
2962
+ * under-count `failed`, `abandoned` and `not_found`, where a VTXO may not
2963
+ * have been fetched. `vtxo_ids` is sorted as strings.
2909
2964
  */
2910
2965
  export type RecoveryBucket = {
2911
2966
  vtxoIds: Array<string>;
@@ -2926,8 +2981,10 @@ export declare const RecoveryBucket: Readonly<{
2926
2981
  * `skipped` vs `failed` is the load-bearing distinction: a `skipped` VTXO was
2927
2982
  * decided not to be spendable (spent, exited, or reported non-spendable),
2928
2983
  * while a `failed` one could not be decided because of an error, so its funds
2929
- * may still be missing. `failed` is retryable via `recover_vtxos`; a `foreign`
2930
- * id instead sits beyond the key-derivation gap limit and needs a wider scan.
2984
+ * may still be missing. `failed` is retried by every sync while a seed
2985
+ * recovery is in progress, and via `recover_vtxos`; an `abandoned` one was
2986
+ * given up on after too many attempts; a `foreign` id instead sits beyond the
2987
+ * key-derivation gap limit and needs a wider scan.
2931
2988
  */
2932
2989
  export type RecoveryReport = {
2933
2990
  /**
@@ -2958,7 +3015,20 @@ export type RecoveryReport = {
2958
3015
  */
2959
3016
  exited: RecoveryBucket;
2960
3017
  /**
2961
- * Whether the scan accounted for every VTXO: no `failed`, no `foreign`.
3018
+ * Reported unknown by the server. Recovery trusts the server, so these
3019
+ * are not retried.
3020
+ */
3021
+ notFound: RecoveryBucket;
3022
+ /**
3023
+ * Given up on after `MAX_RECOVERY_ATTEMPTS` (40) attempts the server or
3024
+ * the chain answered without deciding. Funds may be missing. One with a
3025
+ * stored body stays locked, as it may be spent, and a later
3026
+ * `recover_vtxos` tries it again.
3027
+ */
3028
+ abandoned: RecoveryBucket;
3029
+ /**
3030
+ * Whether the scan accounted for every VTXO: no `failed`, no `abandoned`,
3031
+ * no `foreign`.
2962
3032
  */
2963
3033
  isComplete: boolean;
2964
3034
  };
@@ -3779,11 +3849,12 @@ export type WalletOpenArgs = {
3779
3849
  */
3780
3850
  createWithoutServer: boolean;
3781
3851
  /**
3782
- * Whether to skip the seed-recovery mailbox scan
3852
+ * Whether to skip the recovery from seed
3783
3853
  *
3784
- * The scan runs on the open that creates the wallet locally and makes
3785
- * network calls; its outcome is available from `Wallet::recovery_status`.
3786
- * Set this to open without it.
3854
+ * The recovery starts on the open that creates the wallet locally, makes
3855
+ * network calls, and resumes on every sync until it is done; its outcome
3856
+ * is available from `Wallet::recovery_status`. Set this to open without
3857
+ * it.
3787
3858
  *
3788
3859
  * Default: false
3789
3860
  */
@@ -4091,19 +4162,22 @@ export type PaymentResult = InstanceType<typeof PaymentResult['Onchain' | 'Light
4091
4162
  export declare enum RecoveryStatus_Tags {
4092
4163
  NotRun = "NotRun",
4093
4164
  Failed = "Failed",
4165
+ InProgress = "InProgress",
4094
4166
  Completed = "Completed"
4095
4167
  }
4096
4168
  /**
4097
- * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
4169
+ * Outcome of the seed recovery as `Wallet::open` saw it, mirroring
4098
4170
  * `bark::RecoveryStatus`.
4099
4171
  *
4100
- * The three variants are distinguishable on purpose: `NotRun` means nothing
4101
- * was attempted (wallet already existed locally, or `skip_recovery` was set),
4102
- * `Failed` means the scan errored before producing a report so funds may be
4103
- * missing until a retry succeeds, and `Completed` carries the report — whose
4104
- * `is_complete` can still be `false` for individual VTXOs.
4172
+ * The variants are distinguishable on purpose: `NotRun` means nothing was
4173
+ * attempted (wallet already existed locally without a recovery in progress,
4174
+ * or `skip_recovery` was set), `Failed` means the recovery could not be
4175
+ * started or read back so funds may be missing, `InProgress` means it stopped
4176
+ * before it was done and resumes on every sync, and `Completed` carries the
4177
+ * final report — whose `is_complete` can still be `false` for individual
4178
+ * VTXOs.
4105
4179
  *
4106
- * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
4180
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
4107
4181
  */
4108
4182
  export declare const RecoveryStatus: Readonly<{
4109
4183
  instanceOf: (obj: any) => obj is RecoveryStatus;
@@ -4172,6 +4246,45 @@ export declare const RecoveryStatus: Readonly<{
4172
4246
  readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
4173
4247
  };
4174
4248
  };
4249
+ InProgress: {
4250
+ new (inner: {
4251
+ report: RecoveryReport;
4252
+ }): {
4253
+ readonly tag: RecoveryStatus_Tags.InProgress;
4254
+ readonly inner: Readonly<{
4255
+ report: RecoveryReport;
4256
+ }>;
4257
+ /**
4258
+ * @private
4259
+ * This field is private and should not be used, use `tag` instead.
4260
+ */
4261
+ readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
4262
+ };
4263
+ new(inner: {
4264
+ report: RecoveryReport;
4265
+ }): {
4266
+ readonly tag: RecoveryStatus_Tags.InProgress;
4267
+ readonly inner: Readonly<{
4268
+ report: RecoveryReport;
4269
+ }>;
4270
+ /**
4271
+ * @private
4272
+ * This field is private and should not be used, use `tag` instead.
4273
+ */
4274
+ readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
4275
+ };
4276
+ instanceOf(obj: any): obj is {
4277
+ readonly tag: RecoveryStatus_Tags.InProgress;
4278
+ readonly inner: Readonly<{
4279
+ report: RecoveryReport;
4280
+ }>;
4281
+ /**
4282
+ * @private
4283
+ * This field is private and should not be used, use `tag` instead.
4284
+ */
4285
+ readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
4286
+ };
4287
+ };
4175
4288
  Completed: {
4176
4289
  new (inner: {
4177
4290
  report: RecoveryReport;
@@ -4213,18 +4326,20 @@ export declare const RecoveryStatus: Readonly<{
4213
4326
  };
4214
4327
  }>;
4215
4328
  /**
4216
- * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
4329
+ * Outcome of the seed recovery as `Wallet::open` saw it, mirroring
4217
4330
  * `bark::RecoveryStatus`.
4218
4331
  *
4219
- * The three variants are distinguishable on purpose: `NotRun` means nothing
4220
- * was attempted (wallet already existed locally, or `skip_recovery` was set),
4221
- * `Failed` means the scan errored before producing a report so funds may be
4222
- * missing until a retry succeeds, and `Completed` carries the report — whose
4223
- * `is_complete` can still be `false` for individual VTXOs.
4332
+ * The variants are distinguishable on purpose: `NotRun` means nothing was
4333
+ * attempted (wallet already existed locally without a recovery in progress,
4334
+ * or `skip_recovery` was set), `Failed` means the recovery could not be
4335
+ * started or read back so funds may be missing, `InProgress` means it stopped
4336
+ * before it was done and resumes on every sync, and `Completed` carries the
4337
+ * final report — whose `is_complete` can still be `false` for individual
4338
+ * VTXOs.
4224
4339
  *
4225
- * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
4340
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
4226
4341
  */
4227
- export type RecoveryStatus = InstanceType<typeof RecoveryStatus['NotRun' | 'Failed' | 'Completed']>;
4342
+ export type RecoveryStatus = InstanceType<typeof RecoveryStatus['NotRun' | 'Failed' | 'InProgress' | 'Completed']>;
4228
4343
  export declare enum WalletNotification_Tags {
4229
4344
  MovementCreated = "MovementCreated",
4230
4345
  MovementUpdated = "MovementUpdated",
@@ -4449,6 +4564,17 @@ export interface CustomOnchainWalletCallbacks {
4449
4564
  /**
4450
4565
  * Create a signed P2A CPFP transaction
4451
4566
  *
4567
+ * The child spends the parent's P2A anchor and pays the fee for the
4568
+ * whole package: at least (parent vsize + child vsize) times
4569
+ * `effective_fee_rate_sat_per_vb`, the parent being zero-fee.
4570
+ *
4571
+ * For `fees_type == "Rbf"` the child replaces what already spends the
4572
+ * anchor, so bitcoind's replacement rules apply on top. With
4573
+ * `replacement_vsize` the child's vsize, plus the parent's when
4574
+ * `parent_in_mempool` is false, the child must also pay at least:
4575
+ * * `replaced_fee_sats + incremental_relay_fee_sat_per_vb * replacement_vsize`
4576
+ * * `(replaced_fee_rate_sat_per_vb + incremental_relay_fee_sat_per_vb) * replacement_vsize`
4577
+ *
4452
4578
  * # Arguments
4453
4579
  * * `params` - CPFP transaction parameters
4454
4580
  *
@@ -4557,6 +4683,17 @@ export declare class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObje
4557
4683
  /**
4558
4684
  * Create a signed P2A CPFP transaction
4559
4685
  *
4686
+ * The child spends the parent's P2A anchor and pays the fee for the
4687
+ * whole package: at least (parent vsize + child vsize) times
4688
+ * `effective_fee_rate_sat_per_vb`, the parent being zero-fee.
4689
+ *
4690
+ * For `fees_type == "Rbf"` the child replaces what already spends the
4691
+ * anchor, so bitcoind's replacement rules apply on top. With
4692
+ * `replacement_vsize` the child's vsize, plus the parent's when
4693
+ * `parent_in_mempool` is false, the child must also pay at least:
4694
+ * * `replaced_fee_sats + incremental_relay_fee_sat_per_vb * replacement_vsize`
4695
+ * * `(replaced_fee_rate_sat_per_vb + incremental_relay_fee_sat_per_vb) * replacement_vsize`
4696
+ *
4560
4697
  * # Arguments
4561
4698
  * * `params` - CPFP transaction parameters
4562
4699
  *
@@ -4731,16 +4868,47 @@ export interface WalletLike {
4731
4868
  bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
4732
4869
  signal: AbortSignal;
4733
4870
  }): Promise<Bip321Uri>;
4734
- boardAll(asyncOpts_?: {
4871
+ /**
4872
+ * Board all funds of the onchain wallet. See `board_amount` for
4873
+ * `expiry_height`.
4874
+ */
4875
+ boardAll(expiryHeight: number | undefined, asyncOpts_?: {
4735
4876
  signal: AbortSignal;
4736
4877
  }): Promise<PendingBoard>;
4737
- boardAmount(amountSats: bigint, asyncOpts_?: {
4878
+ /**
4879
+ * Board `amount_sats` from the onchain wallet.
4880
+ *
4881
+ * `expiry_height` sets the block height at which the board VTXO expires.
4882
+ * It defaults to `Config.board_lifetime` blocks from the tip, capped at
4883
+ * the server's VTXO lifetime; an expiry beyond that lifetime, or too
4884
+ * close to the tip to confirm and register in time, is refused.
4885
+ */
4886
+ boardAmount(amountSats: bigint, expiryHeight: number | undefined, asyncOpts_?: {
4738
4887
  signal: AbortSignal;
4739
4888
  }): Promise<PendingBoard>;
4740
- boardFundingAddress(asyncOpts_?: {
4889
+ /**
4890
+ * Derive a fresh key and return the address to fund a board with from
4891
+ * elsewhere, e.g. as a payjoin receiver. Persist the returned info and
4892
+ * pass it to `board_psbt` with the funding PSBT. See `board_amount` for
4893
+ * `expiry_height`.
4894
+ */
4895
+ boardFundingAddress(expiryHeight: number | undefined, asyncOpts_?: {
4741
4896
  signal: AbortSignal;
4742
4897
  }): Promise<BoardFundingInfo>;
4743
- boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: {
4898
+ /**
4899
+ * Board from a funding PSBT paying the address of `funding`, made by
4900
+ * `board_funding_address`.
4901
+ *
4902
+ * A finalized PSBT is broadcast by bark; an unfinalized one leaves the
4903
+ * broadcast to another party and bark waits for the transaction to
4904
+ * appear. The board commits to the PSBT's txid, so if the other party
4905
+ * changes the transaction, call this again with the new PSBT and the
4906
+ * same `funding`.
4907
+ *
4908
+ * Fails once `funding` is too close to its expiry height; make a new
4909
+ * funding address then.
4910
+ */
4911
+ boardPsbt(psbtBase64: string, funding: BoardFundingInfo, asyncOpts_?: {
4744
4912
  signal: AbortSignal;
4745
4913
  }): Promise<PendingBoard>;
4746
4914
  /**
@@ -4943,6 +5111,18 @@ export interface WalletLike {
4943
5111
  isInvoicePaid(paymentHash: string, asyncOpts_?: {
4944
5112
  signal: AbortSignal;
4945
5113
  }): Promise<boolean>;
5114
+ /**
5115
+ * Rebuild the funding info of a funding address made before
5116
+ * `BoardFundingInfo` carried `user_pubkey`, from the `keypair_index` and
5117
+ * `expiry_height` stored alongside it.
5118
+ *
5119
+ * Only for boards funded through the old `board_funding_address`. If the
5120
+ * server's key or exit delta changed since, the rebuilt address won't
5121
+ * match and `board_psbt` refuses the PSBT.
5122
+ */
5123
+ legacyBoardFundingAddress(keypairIndex: number, expiryHeight: number, asyncOpts_?: {
5124
+ signal: AbortSignal;
5125
+ }): Promise<BoardFundingInfo>;
4946
5126
  /**
4947
5127
  * Triage a payment hash: settled or in-progress. Errors if no lightning
4948
5128
  * receive is known for this payment hash.
@@ -5091,6 +5271,18 @@ export interface WalletLike {
5091
5271
  pendingLightningSends(asyncOpts_?: {
5092
5272
  signal: AbortSignal;
5093
5273
  }): Promise<Array<LightningSend>>;
5274
+ /**
5275
+ * The report of the recovery from seed in progress, or none once it is
5276
+ * done (or if none ever ran). Its `failed` VTXOs are the ones still
5277
+ * missing: they are kept locked until the server gives their status.
5278
+ *
5279
+ * When a recovery resumed after open is done, bark only logs its final
5280
+ * report; it cannot be read here. VTXOs it gave up on (`abandoned`) stay
5281
+ * locked, so they still show in `vtxos`.
5282
+ */
5283
+ pendingRecovery(asyncOpts_?: {
5284
+ signal: AbortSignal;
5285
+ }): Promise<RecoveryReport | undefined>;
5094
5286
  pendingRoundInputVtxos(asyncOpts_?: {
5095
5287
  signal: AbortSignal;
5096
5288
  }): Promise<Array<Vtxo>>;
@@ -5131,7 +5323,10 @@ export interface WalletLike {
5131
5323
  /**
5132
5324
  * Recover the given VTXO ids from the server, importing the ones this
5133
5325
  * wallet owns that are still spendable. Use it to retry ids a previous
5134
- * scan reported as `failed`.
5326
+ * recovery reported as `failed` or `abandoned`.
5327
+ *
5328
+ * Fails while a recovery from seed is being driven, as both work on the
5329
+ * same locked VTXOs.
5135
5330
  *
5136
5331
  * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
5137
5332
  * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
@@ -5141,21 +5336,23 @@ export interface WalletLike {
5141
5336
  signal: AbortSignal;
5142
5337
  }): Promise<RecoveryReport>;
5143
5338
  /**
5144
- * The report of the seed-recovery scan that ran during `Wallet::open`, or
5145
- * none if the scan did not complete. Use `recovery_status` to tell a scan
5146
- * that failed apart from one that never ran.
5339
+ * The report of the recovery from seed as `Wallet::open` saw it, or none
5340
+ * if it did not run or failed. Use `recovery_status` to tell these apart.
5147
5341
  */
5148
5342
  recoveryReport(): RecoveryReport | undefined;
5149
5343
  /**
5150
- * Outcome of the seed-recovery scan that ran during `Wallet::open`.
5344
+ * Outcome of the recovery from seed as `Wallet::open` saw it. A
5345
+ * snapshot: it does not change after open, see `pending_recovery` for the
5346
+ * live state.
5151
5347
  *
5152
- * Recovery only runs on the open that creates the wallet locally, and not
5153
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
5154
- * on every subsequent open. `Failed` means the scan errored before
5155
- * producing a report — bark logs that and lets open succeed — so funds
5156
- * may be missing until a retry; `Completed` carries the report, and
5157
- * `isComplete == false` there means funds may still be missing. Retry the
5158
- * report's `failed` ids with `recoverVtxos`.
5348
+ * Recovery starts on the open that creates the wallet locally, unless
5349
+ * `WalletOpenArgs.skip_recovery` is set. A later open reports
5350
+ * `InProgress` while that recovery is not done, and `NotRun` otherwise.
5351
+ * `Failed` means the recovery could not be started or read back — bark
5352
+ * logs that and lets open succeed — so funds may be missing. `InProgress`
5353
+ * means it stopped before it was done; every sync resumes it. `Completed`
5354
+ * carries the final report, and `isComplete == false` there means funds
5355
+ * may still be missing.
5159
5356
  */
5160
5357
  recoveryStatus(): RecoveryStatus;
5161
5358
  refreshServer(asyncOpts_?: {
@@ -5252,9 +5449,12 @@ export interface WalletLike {
5252
5449
  signal: AbortSignal;
5253
5450
  }): Promise<void>;
5254
5451
  /**
5255
- * Stop the background daemon and wait until its tasks have finished, so
5256
- * nothing runs in the background afterwards (e.g. before deleting the
5257
- * wallet's datadir). No-op when no daemon is running.
5452
+ * Stop the background daemon and wait until it has finished, e.g. before
5453
+ * deleting the wallet's datadir. No-op when no daemon is running.
5454
+ *
5455
+ * While another call already waits for the daemon, this returns at once
5456
+ * without waiting. A start made while it waits goes ahead, so the daemon
5457
+ * runs again after.
5258
5458
  */
5259
5459
  stopDaemonWait(asyncOpts_?: {
5260
5460
  signal: AbortSignal;
@@ -5284,6 +5484,16 @@ export interface WalletLike {
5284
5484
  syncPendingBoards(asyncOpts_?: {
5285
5485
  signal: AbortSignal;
5286
5486
  }): Promise<void>;
5487
+ /**
5488
+ * Drive the recovery from seed in progress, if any, until it is done or
5489
+ * parks again. Does nothing while another drive holds its lock.
5490
+ *
5491
+ * This already runs as part of `sync`; call it to resume the recovery on
5492
+ * demand.
5493
+ */
5494
+ syncPendingRecovery(asyncOpts_?: {
5495
+ signal: AbortSignal;
5496
+ }): Promise<void>;
5287
5497
  tryClaimAllLightningReceives(wait: boolean, asyncOpts_?: {
5288
5498
  signal: AbortSignal;
5289
5499
  }): Promise<Array<LightningReceive>>;
@@ -5393,16 +5603,47 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5393
5603
  bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
5394
5604
  signal: AbortSignal;
5395
5605
  }): Promise<Bip321Uri>;
5396
- boardAll(asyncOpts_?: {
5606
+ /**
5607
+ * Board all funds of the onchain wallet. See `board_amount` for
5608
+ * `expiry_height`.
5609
+ */
5610
+ boardAll(expiryHeight?: number | undefined, asyncOpts_?: {
5397
5611
  signal: AbortSignal;
5398
5612
  }): Promise<PendingBoard>;
5399
- boardAmount(amountSats: bigint, asyncOpts_?: {
5613
+ /**
5614
+ * Board `amount_sats` from the onchain wallet.
5615
+ *
5616
+ * `expiry_height` sets the block height at which the board VTXO expires.
5617
+ * It defaults to `Config.board_lifetime` blocks from the tip, capped at
5618
+ * the server's VTXO lifetime; an expiry beyond that lifetime, or too
5619
+ * close to the tip to confirm and register in time, is refused.
5620
+ */
5621
+ boardAmount(amountSats: bigint, expiryHeight?: number | undefined, asyncOpts_?: {
5400
5622
  signal: AbortSignal;
5401
5623
  }): Promise<PendingBoard>;
5402
- boardFundingAddress(asyncOpts_?: {
5624
+ /**
5625
+ * Derive a fresh key and return the address to fund a board with from
5626
+ * elsewhere, e.g. as a payjoin receiver. Persist the returned info and
5627
+ * pass it to `board_psbt` with the funding PSBT. See `board_amount` for
5628
+ * `expiry_height`.
5629
+ */
5630
+ boardFundingAddress(expiryHeight?: number | undefined, asyncOpts_?: {
5403
5631
  signal: AbortSignal;
5404
5632
  }): Promise<BoardFundingInfo>;
5405
- boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: {
5633
+ /**
5634
+ * Board from a funding PSBT paying the address of `funding`, made by
5635
+ * `board_funding_address`.
5636
+ *
5637
+ * A finalized PSBT is broadcast by bark; an unfinalized one leaves the
5638
+ * broadcast to another party and bark waits for the transaction to
5639
+ * appear. The board commits to the PSBT's txid, so if the other party
5640
+ * changes the transaction, call this again with the new PSBT and the
5641
+ * same `funding`.
5642
+ *
5643
+ * Fails once `funding` is too close to its expiry height; make a new
5644
+ * funding address then.
5645
+ */
5646
+ boardPsbt(psbtBase64: string, funding: BoardFundingInfo, asyncOpts_?: {
5406
5647
  signal: AbortSignal;
5407
5648
  }): Promise<PendingBoard>;
5408
5649
  /**
@@ -5605,6 +5846,18 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5605
5846
  isInvoicePaid(paymentHash: string, asyncOpts_?: {
5606
5847
  signal: AbortSignal;
5607
5848
  }): Promise<boolean>;
5849
+ /**
5850
+ * Rebuild the funding info of a funding address made before
5851
+ * `BoardFundingInfo` carried `user_pubkey`, from the `keypair_index` and
5852
+ * `expiry_height` stored alongside it.
5853
+ *
5854
+ * Only for boards funded through the old `board_funding_address`. If the
5855
+ * server's key or exit delta changed since, the rebuilt address won't
5856
+ * match and `board_psbt` refuses the PSBT.
5857
+ */
5858
+ legacyBoardFundingAddress(keypairIndex: number, expiryHeight: number, asyncOpts_?: {
5859
+ signal: AbortSignal;
5860
+ }): Promise<BoardFundingInfo>;
5608
5861
  /**
5609
5862
  * Triage a payment hash: settled or in-progress. Errors if no lightning
5610
5863
  * receive is known for this payment hash.
@@ -5753,6 +6006,18 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5753
6006
  pendingLightningSends(asyncOpts_?: {
5754
6007
  signal: AbortSignal;
5755
6008
  }): Promise<Array<LightningSend>>;
6009
+ /**
6010
+ * The report of the recovery from seed in progress, or none once it is
6011
+ * done (or if none ever ran). Its `failed` VTXOs are the ones still
6012
+ * missing: they are kept locked until the server gives their status.
6013
+ *
6014
+ * When a recovery resumed after open is done, bark only logs its final
6015
+ * report; it cannot be read here. VTXOs it gave up on (`abandoned`) stay
6016
+ * locked, so they still show in `vtxos`.
6017
+ */
6018
+ pendingRecovery(asyncOpts_?: {
6019
+ signal: AbortSignal;
6020
+ }): Promise<RecoveryReport | undefined>;
5756
6021
  pendingRoundInputVtxos(asyncOpts_?: {
5757
6022
  signal: AbortSignal;
5758
6023
  }): Promise<Array<Vtxo>>;
@@ -5793,7 +6058,10 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5793
6058
  /**
5794
6059
  * Recover the given VTXO ids from the server, importing the ones this
5795
6060
  * wallet owns that are still spendable. Use it to retry ids a previous
5796
- * scan reported as `failed`.
6061
+ * recovery reported as `failed` or `abandoned`.
6062
+ *
6063
+ * Fails while a recovery from seed is being driven, as both work on the
6064
+ * same locked VTXOs.
5797
6065
  *
5798
6066
  * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
5799
6067
  * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
@@ -5803,21 +6071,23 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5803
6071
  signal: AbortSignal;
5804
6072
  }): Promise<RecoveryReport>;
5805
6073
  /**
5806
- * The report of the seed-recovery scan that ran during `Wallet::open`, or
5807
- * none if the scan did not complete. Use `recovery_status` to tell a scan
5808
- * that failed apart from one that never ran.
6074
+ * The report of the recovery from seed as `Wallet::open` saw it, or none
6075
+ * if it did not run or failed. Use `recovery_status` to tell these apart.
5809
6076
  */
5810
6077
  recoveryReport(): RecoveryReport | undefined;
5811
6078
  /**
5812
- * Outcome of the seed-recovery scan that ran during `Wallet::open`.
6079
+ * Outcome of the recovery from seed as `Wallet::open` saw it. A
6080
+ * snapshot: it does not change after open, see `pending_recovery` for the
6081
+ * live state.
5813
6082
  *
5814
- * Recovery only runs on the open that creates the wallet locally, and not
5815
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
5816
- * on every subsequent open. `Failed` means the scan errored before
5817
- * producing a report — bark logs that and lets open succeed — so funds
5818
- * may be missing until a retry; `Completed` carries the report, and
5819
- * `isComplete == false` there means funds may still be missing. Retry the
5820
- * report's `failed` ids with `recoverVtxos`.
6083
+ * Recovery starts on the open that creates the wallet locally, unless
6084
+ * `WalletOpenArgs.skip_recovery` is set. A later open reports
6085
+ * `InProgress` while that recovery is not done, and `NotRun` otherwise.
6086
+ * `Failed` means the recovery could not be started or read back — bark
6087
+ * logs that and lets open succeed — so funds may be missing. `InProgress`
6088
+ * means it stopped before it was done; every sync resumes it. `Completed`
6089
+ * carries the final report, and `isComplete == false` there means funds
6090
+ * may still be missing.
5821
6091
  */
5822
6092
  recoveryStatus(): RecoveryStatus;
5823
6093
  refreshServer(asyncOpts_?: {
@@ -5914,9 +6184,12 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5914
6184
  signal: AbortSignal;
5915
6185
  }): Promise<void>;
5916
6186
  /**
5917
- * Stop the background daemon and wait until its tasks have finished, so
5918
- * nothing runs in the background afterwards (e.g. before deleting the
5919
- * wallet's datadir). No-op when no daemon is running.
6187
+ * Stop the background daemon and wait until it has finished, e.g. before
6188
+ * deleting the wallet's datadir. No-op when no daemon is running.
6189
+ *
6190
+ * While another call already waits for the daemon, this returns at once
6191
+ * without waiting. A start made while it waits goes ahead, so the daemon
6192
+ * runs again after.
5920
6193
  */
5921
6194
  stopDaemonWait(asyncOpts_?: {
5922
6195
  signal: AbortSignal;
@@ -5946,6 +6219,16 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
5946
6219
  syncPendingBoards(asyncOpts_?: {
5947
6220
  signal: AbortSignal;
5948
6221
  }): Promise<void>;
6222
+ /**
6223
+ * Drive the recovery from seed in progress, if any, until it is done or
6224
+ * parks again. Does nothing while another drive holds its lock.
6225
+ *
6226
+ * This already runs as part of `sync`; call it to resume the recovery on
6227
+ * demand.
6228
+ */
6229
+ syncPendingRecovery(asyncOpts_?: {
6230
+ signal: AbortSignal;
6231
+ }): Promise<void>;
5949
6232
  tryClaimAllLightningReceives(wait?: boolean, asyncOpts_?: {
5950
6233
  signal: AbortSignal;
5951
6234
  }): Promise<Array<LightningReceive>>;