@secondts/bark-react-native 0.26.1 → 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.
@@ -126,6 +126,8 @@ export function generateMnemonic(): string /*throws*/ {
126
126
  * Low-level function to initialize a wallet
127
127
  *
128
128
  * You probably want to use [`Wallet::open`] instead.
129
+ *
130
+ * `datadir` is a filesystem path or a `file://` URI.
129
131
  */
130
132
  export async function initWallet(network: Network, mnemonicOrSeed: string, config: Config, datadir: string, allowUnreachableServer: boolean, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
131
133
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -250,6 +252,8 @@ export function validateMnemonic(mnemonic: string): boolean /*throws*/ {
250
252
  /**
251
253
  * Whether `datadir` holds an initialized bark wallet.
252
254
  *
255
+ * `datadir` is a filesystem path or a `file://` URI.
256
+ *
253
257
  * Answers without side effects: the database is opened read-only, no
254
258
  * migration runs and no file or directory is created. Returns `false` for a
255
259
  * missing or empty directory and for a database that never got its wallet
@@ -793,7 +797,11 @@ export type ArkInfo = {
793
797
  * Maximum exit depth (genesis chain length) allowed for a VTXO before the
794
798
  * server refuses to cosign further OOR transactions spending it.
795
799
  */
796
- maxVtxoExitDepth: number
800
+ maxVtxoExitDepth: number,
801
+ /**
802
+ * Maximum number of outputs of a single round participation.
803
+ */
804
+ maxRoundParticipationOutputs: number
797
805
  }
798
806
 
799
807
  /**
@@ -832,7 +840,8 @@ const FfiConverterTypeArkInfo = (() => {
832
840
  minBoardAmountSats: FfiConverterUInt64.readFromCursor(c),
833
841
  lnReceiveAntiDosRequired: FfiConverterBool.readFromCursor(c),
834
842
  feeSchedule: FfiConverterTypeFeeSchedule.readFromCursor(c),
835
- maxVtxoExitDepth: FfiConverterUInt16.readFromCursor(c)
843
+ maxVtxoExitDepth: FfiConverterUInt16.readFromCursor(c),
844
+ maxRoundParticipationOutputs: FfiConverterUInt32.readFromCursor(c)
836
845
  };
837
846
  }
838
847
  writeIntoCursor(value: TypeName, c: Cursor): void {
@@ -852,6 +861,7 @@ const FfiConverterTypeArkInfo = (() => {
852
861
  FfiConverterBool.writeIntoCursor(value.lnReceiveAntiDosRequired, c);
853
862
  FfiConverterTypeFeeSchedule.writeIntoCursor(value.feeSchedule, c);
854
863
  FfiConverterUInt16.writeIntoCursor(value.maxVtxoExitDepth, c);
864
+ FfiConverterUInt32.writeIntoCursor(value.maxRoundParticipationOutputs, c);
855
865
  }
856
866
  allocationSize(value: TypeName): number {
857
867
  return FfiConverterTypeNetwork.allocationSize(value.network) +
@@ -869,7 +879,8 @@ const FfiConverterTypeArkInfo = (() => {
869
879
  FfiConverterUInt64.allocationSize(value.minBoardAmountSats) +
870
880
  FfiConverterBool.allocationSize(value.lnReceiveAntiDosRequired) +
871
881
  FfiConverterTypeFeeSchedule.allocationSize(value.feeSchedule) +
872
- FfiConverterUInt16.allocationSize(value.maxVtxoExitDepth);
882
+ FfiConverterUInt16.allocationSize(value.maxVtxoExitDepth) +
883
+ FfiConverterUInt32.allocationSize(value.maxRoundParticipationOutputs);
873
884
 
874
885
  }
875
886
  };
@@ -2075,17 +2086,31 @@ const FfiConverterTypeBlockRef = (() => {
2075
2086
  })();
2076
2087
 
2077
2088
  /**
2078
- * 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`.
2079
2091
  *
2080
- * The funding script commits to the derived keypair and expiry height, so
2081
- * `keypair_index` and `expiry_height` must be passed back unchanged to
2082
- * `board_psbt` once the funding PSBT is available — including on retries
2083
- * 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.
2084
2098
  */
2085
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
+ */
2086
2105
  address: string,
2106
+ /**
2107
+ * Block height at which the board VTXO expires.
2108
+ */
2087
2109
  expiryHeight: number,
2088
- keypairIndex: number
2110
+ /**
2111
+ * Hex-encoded wallet public key the board VTXO is locked to.
2112
+ */
2113
+ userPubkey: string
2089
2114
  }
2090
2115
 
2091
2116
  /**
@@ -2111,18 +2136,18 @@ const FfiConverterTypeBoardFundingInfo = (() => {
2111
2136
  return {
2112
2137
  address: FfiConverterString.readFromCursor(c),
2113
2138
  expiryHeight: FfiConverterUInt32.readFromCursor(c),
2114
- keypairIndex: FfiConverterUInt32.readFromCursor(c)
2139
+ userPubkey: FfiConverterString.readFromCursor(c)
2115
2140
  };
2116
2141
  }
2117
2142
  writeIntoCursor(value: TypeName, c: Cursor): void {
2118
2143
  FfiConverterString.writeIntoCursor(value.address, c);
2119
2144
  FfiConverterUInt32.writeIntoCursor(value.expiryHeight, c);
2120
- FfiConverterUInt32.writeIntoCursor(value.keypairIndex, c);
2145
+ FfiConverterString.writeIntoCursor(value.userPubkey, c);
2121
2146
  }
2122
2147
  allocationSize(value: TypeName): number {
2123
2148
  return FfiConverterString.allocationSize(value.address) +
2124
2149
  FfiConverterUInt32.allocationSize(value.expiryHeight) +
2125
- FfiConverterUInt32.allocationSize(value.keypairIndex);
2150
+ FfiConverterString.allocationSize(value.userPubkey);
2126
2151
 
2127
2152
  }
2128
2153
  };
@@ -2232,6 +2257,15 @@ export type Config = {
2232
2257
  bitcoindPass?: string,
2233
2258
  vtxoRefreshExpiryThreshold?: number,
2234
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,
2235
2269
  htlcRecvClaimDelta?: number,
2236
2270
  fallbackFeeRate?: bigint,
2237
2271
  roundTxRequiredConfirmations?: number,
@@ -2286,6 +2320,7 @@ const FfiConverterTypeConfig = (() => {
2286
2320
  bitcoindPass: FfiConverterOptionalString.readFromCursor(c),
2287
2321
  vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt16.readFromCursor(c),
2288
2322
  vtxoExitMargin: FfiConverterOptionalUInt16.readFromCursor(c),
2323
+ boardLifetime: FfiConverterOptionalUInt16.readFromCursor(c),
2289
2324
  htlcRecvClaimDelta: FfiConverterOptionalUInt16.readFromCursor(c),
2290
2325
  fallbackFeeRate: FfiConverterOptionalUInt64.readFromCursor(c),
2291
2326
  roundTxRequiredConfirmations: FfiConverterOptionalUInt32.readFromCursor(c),
@@ -2307,6 +2342,7 @@ const FfiConverterTypeConfig = (() => {
2307
2342
  FfiConverterOptionalString.writeIntoCursor(value.bitcoindPass, c);
2308
2343
  FfiConverterOptionalUInt16.writeIntoCursor(value.vtxoRefreshExpiryThreshold, c);
2309
2344
  FfiConverterOptionalUInt16.writeIntoCursor(value.vtxoExitMargin, c);
2345
+ FfiConverterOptionalUInt16.writeIntoCursor(value.boardLifetime, c);
2310
2346
  FfiConverterOptionalUInt16.writeIntoCursor(value.htlcRecvClaimDelta, c);
2311
2347
  FfiConverterOptionalUInt64.writeIntoCursor(value.fallbackFeeRate, c);
2312
2348
  FfiConverterOptionalUInt32.writeIntoCursor(value.roundTxRequiredConfirmations, c);
@@ -2327,6 +2363,7 @@ const FfiConverterTypeConfig = (() => {
2327
2363
  FfiConverterOptionalString.allocationSize(value.bitcoindPass) +
2328
2364
  FfiConverterOptionalUInt16.allocationSize(value.vtxoRefreshExpiryThreshold) +
2329
2365
  FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) +
2366
+ FfiConverterOptionalUInt16.allocationSize(value.boardLifetime) +
2330
2367
  FfiConverterOptionalUInt16.allocationSize(value.htlcRecvClaimDelta) +
2331
2368
  FfiConverterOptionalUInt64.allocationSize(value.fallbackFeeRate) +
2332
2369
  FfiConverterOptionalUInt32.allocationSize(value.roundTxRequiredConfirmations) +
@@ -2346,10 +2383,38 @@ const FfiConverterTypeConfig = (() => {
2346
2383
  * Parameters for creating a CPFP (Child Pays For Parent) transaction
2347
2384
  */
2348
2385
  export type CpfpParams = {
2386
+ /**
2387
+ * Hex-encoded zero-fee parent transaction to bump through its P2A anchor
2388
+ */
2349
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
+ */
2350
2394
  feesType: string,
2395
+ /**
2396
+ * Effective fee rate the whole package (parent + child) must reach, in
2397
+ * sat/vB rounded up
2398
+ */
2351
2399
  effectiveFeeRateSatPerVb: bigint,
2352
- 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
2353
2418
  }
2354
2419
 
2355
2420
  /**
@@ -2376,20 +2441,29 @@ const FfiConverterTypeCpfpParams = (() => {
2376
2441
  txHex: FfiConverterString.readFromCursor(c),
2377
2442
  feesType: FfiConverterString.readFromCursor(c),
2378
2443
  effectiveFeeRateSatPerVb: FfiConverterUInt64.readFromCursor(c),
2379
- currentPackageFeeSats: FfiConverterOptionalUInt64.readFromCursor(c)
2444
+ replacedFeeSats: FfiConverterOptionalUInt64.readFromCursor(c),
2445
+ replacedFeeRateSatPerVb: FfiConverterOptionalUInt64.readFromCursor(c),
2446
+ incrementalRelayFeeSatPerVb: FfiConverterOptionalUInt64.readFromCursor(c),
2447
+ parentInMempool: FfiConverterOptionalBoolean.readFromCursor(c)
2380
2448
  };
2381
2449
  }
2382
2450
  writeIntoCursor(value: TypeName, c: Cursor): void {
2383
2451
  FfiConverterString.writeIntoCursor(value.txHex, c);
2384
2452
  FfiConverterString.writeIntoCursor(value.feesType, c);
2385
2453
  FfiConverterUInt64.writeIntoCursor(value.effectiveFeeRateSatPerVb, c);
2386
- 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);
2387
2458
  }
2388
2459
  allocationSize(value: TypeName): number {
2389
2460
  return FfiConverterString.allocationSize(value.txHex) +
2390
2461
  FfiConverterString.allocationSize(value.feesType) +
2391
2462
  FfiConverterUInt64.allocationSize(value.effectiveFeeRateSatPerVb) +
2392
- FfiConverterOptionalUInt64.allocationSize(value.currentPackageFeeSats);
2463
+ FfiConverterOptionalUInt64.allocationSize(value.replacedFeeSats) +
2464
+ FfiConverterOptionalUInt64.allocationSize(value.replacedFeeRateSatPerVb) +
2465
+ FfiConverterOptionalUInt64.allocationSize(value.incrementalRelayFeeSatPerVb) +
2466
+ FfiConverterOptionalBoolean.allocationSize(value.parentInMempool);
2393
2467
 
2394
2468
  }
2395
2469
  };
@@ -3281,6 +3355,60 @@ const FfiConverterTypeExitClaimTransaction = (() => {
3281
3355
  return new FFIConverter();
3282
3356
  })();
3283
3357
 
3358
+ /**
3359
+ * Fee a transaction commits together with its unconfirmed ancestors,
3360
+ * mirroring `bark::exit::FeeInfo`.
3361
+ */
3362
+ export type ExitFeeInfo = {
3363
+ /**
3364
+ * Effective fee rate, in sat/kwu (lossless; divide by 250 for sat/vB).
3365
+ */
3366
+ feeRateSatPerKwu: bigint,
3367
+ /**
3368
+ * Sum of the transaction's own fee and the fees of its unconfirmed
3369
+ * ancestors.
3370
+ */
3371
+ totalFeeSats: bigint
3372
+ }
3373
+
3374
+ /**
3375
+ * Generated factory for {@link ExitFeeInfo} record objects.
3376
+ */
3377
+ export const ExitFeeInfo = (() => {
3378
+ const defaults = () => ({
3379
+ });
3380
+ const create = (() => {
3381
+ return uniffiCreateRecord<ExitFeeInfo, ReturnType<typeof defaults>>(defaults);
3382
+ })();
3383
+ return Object.freeze({
3384
+ create,
3385
+ new: create,
3386
+ defaults: () => Object.freeze(defaults()) as Partial<ExitFeeInfo>,
3387
+ });
3388
+ })();
3389
+
3390
+ const FfiConverterTypeExitFeeInfo = (() => {
3391
+ type TypeName = ExitFeeInfo;
3392
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3393
+ readFromCursor(c: Cursor): TypeName {
3394
+ return {
3395
+ feeRateSatPerKwu: FfiConverterUInt64.readFromCursor(c),
3396
+ totalFeeSats: FfiConverterUInt64.readFromCursor(c)
3397
+ };
3398
+ }
3399
+ writeIntoCursor(value: TypeName, c: Cursor): void {
3400
+ FfiConverterUInt64.writeIntoCursor(value.feeRateSatPerKwu, c);
3401
+ FfiConverterUInt64.writeIntoCursor(value.totalFeeSats, c);
3402
+ }
3403
+ allocationSize(value: TypeName): number {
3404
+ return FfiConverterUInt64.allocationSize(value.feeRateSatPerKwu) +
3405
+ FfiConverterUInt64.allocationSize(value.totalFeeSats);
3406
+
3407
+ }
3408
+ };
3409
+ return new FFIConverter();
3410
+ })();
3411
+
3284
3412
 
3285
3413
  // Enum: ExitTxStatus
3286
3414
  export enum ExitTxStatus_Tags {
@@ -4229,6 +4357,55 @@ const FfiConverterTypeExitProgressStatus = (() => {
4229
4357
  return new FFIConverter();
4230
4358
  })();
4231
4359
 
4360
+ /**
4361
+ * A transaction of an exit chain, mirroring `bark::exit::TransactionInfo`.
4362
+ */
4363
+ export type ExitTransactionInfo = {
4364
+ txid: string,
4365
+ /**
4366
+ * Consensus-encoded transaction, hex.
4367
+ */
4368
+ txHex: string
4369
+ }
4370
+
4371
+ /**
4372
+ * Generated factory for {@link ExitTransactionInfo} record objects.
4373
+ */
4374
+ export const ExitTransactionInfo = (() => {
4375
+ const defaults = () => ({
4376
+ });
4377
+ const create = (() => {
4378
+ return uniffiCreateRecord<ExitTransactionInfo, ReturnType<typeof defaults>>(defaults);
4379
+ })();
4380
+ return Object.freeze({
4381
+ create,
4382
+ new: create,
4383
+ defaults: () => Object.freeze(defaults()) as Partial<ExitTransactionInfo>,
4384
+ });
4385
+ })();
4386
+
4387
+ const FfiConverterTypeExitTransactionInfo = (() => {
4388
+ type TypeName = ExitTransactionInfo;
4389
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
4390
+ readFromCursor(c: Cursor): TypeName {
4391
+ return {
4392
+ txid: FfiConverterString.readFromCursor(c),
4393
+ txHex: FfiConverterString.readFromCursor(c)
4394
+ };
4395
+ }
4396
+ writeIntoCursor(value: TypeName, c: Cursor): void {
4397
+ FfiConverterString.writeIntoCursor(value.txid, c);
4398
+ FfiConverterString.writeIntoCursor(value.txHex, c);
4399
+ }
4400
+ allocationSize(value: TypeName): number {
4401
+ return FfiConverterString.allocationSize(value.txid) +
4402
+ FfiConverterString.allocationSize(value.txHex);
4403
+
4404
+ }
4405
+ };
4406
+ return new FFIConverter();
4407
+ })();
4408
+
4232
4409
  /**
4233
4410
  * One transaction of an exit: the exit transaction itself and, once it was
4234
4411
  * fee-bumped, the child that confirms it. A unilateral exit is a chain of
@@ -5084,50 +5261,251 @@ const FfiConverterTypePendingBoard = (() => {
5084
5261
  return new FFIConverter();
5085
5262
  })();
5086
5263
 
5264
+
5265
+ // Enum: PresignedExitStatus
5266
+ export enum PresignedExitStatus_Tags {
5267
+ FullySigned = "FullySigned",
5268
+ PartiallySigned = "PartiallySigned",
5269
+ Unsigned = "Unsigned"
5270
+ }
5087
5271
  /**
5088
- * One bucket of a [`RecoveryReport`].
5089
- *
5090
- * `total_sats` only sums the VTXOs whose amount is known, so it can
5091
- * under-count `failed`, where a VTXO may have failed before being fetched.
5092
- * `vtxo_ids` is sorted, since upstream buckets them unordered.
5272
+ * How much of a [`PresignedExit`]'s remaining broadcast work could be funded
5273
+ * and signed, mirroring `bark::exit::PresignedExitStatus`.
5093
5274
  */
5094
- export type RecoveryBucket = {
5095
- vtxoIds: Array<string>,
5096
- totalSats: bigint
5275
+ export const PresignedExitStatus = (() => {
5276
+
5277
+ type FullySigned__interface = {
5278
+ tag: PresignedExitStatus_Tags.FullySigned;
5279
+ inner:
5280
+ Readonly<{exitedInWave?: number; feeInfo: ExitFeeInfo}>
5281
+ };
5282
+ /**
5283
+ * Every package has a signed child. The exit's broadcast completes once
5284
+ * wave `exited_in_wave` (an index into [`PresignedExits::waves`])
5285
+ * confirms; `None` when the chain is already confirmed and there is
5286
+ * nothing to broadcast. `fee_info` totals the children's fees over the
5287
+ * combined weight of this exit's packages.
5288
+ */
5289
+ class FullySigned_ extends UniffiEnum implements FullySigned__interface {
5290
+ /**
5291
+ * @private
5292
+ * This field is private and should not be used, use `tag` instead.
5293
+ */
5294
+ readonly [uniffiTypeNameSymbol] = "PresignedExitStatus";
5295
+ readonly tag = PresignedExitStatus_Tags.FullySigned;
5296
+ readonly inner:
5297
+ Readonly<{exitedInWave?: number; feeInfo: ExitFeeInfo}>;
5298
+ constructor(
5299
+ inner: {exitedInWave?: number; feeInfo: ExitFeeInfo }) {
5300
+ super("PresignedExitStatus", "FullySigned");
5301
+
5302
+ this.inner = Object.freeze(inner);
5303
+ }
5304
+ static new(
5305
+ inner: {exitedInWave?: number; feeInfo: ExitFeeInfo }): FullySigned_ {
5306
+ return new FullySigned_(inner);
5307
+ }
5308
+
5309
+ static instanceOf(obj: any): obj is FullySigned_ {
5310
+ return obj.tag === PresignedExitStatus_Tags.FullySigned;
5311
+ }
5312
+
5313
+ }
5314
+
5315
+ type PartiallySigned__interface = {
5316
+ tag: PresignedExitStatus_Tags.PartiallySigned;
5317
+ inner:
5318
+ Readonly<{lastWave: number}>
5319
+ };
5320
+ /**
5321
+ * Confirmed onchain funds ran out mid-chain: wave `last_wave` holds this
5322
+ * exit's last signed package and [`PresignedExit::unsigned`] continues
5323
+ * right after it.
5324
+ */
5325
+ class PartiallySigned_ extends UniffiEnum implements PartiallySigned__interface {
5326
+ /**
5327
+ * @private
5328
+ * This field is private and should not be used, use `tag` instead.
5329
+ */
5330
+ readonly [uniffiTypeNameSymbol] = "PresignedExitStatus";
5331
+ readonly tag = PresignedExitStatus_Tags.PartiallySigned;
5332
+ readonly inner:
5333
+ Readonly<{lastWave: number}>;
5334
+ constructor(
5335
+ inner: {lastWave: number }) {
5336
+ super("PresignedExitStatus", "PartiallySigned");
5337
+
5338
+ this.inner = Object.freeze(inner);
5339
+ }
5340
+ static new(
5341
+ inner: {lastWave: number }): PartiallySigned_ {
5342
+ return new PartiallySigned_(inner);
5343
+ }
5344
+
5345
+ static instanceOf(obj: any): obj is PartiallySigned_ {
5346
+ return obj.tag === PresignedExitStatus_Tags.PartiallySigned;
5347
+ }
5348
+
5349
+ }
5350
+
5351
+ type Unsigned__interface = {
5352
+ tag: PresignedExitStatus_Tags.Unsigned
5353
+ };
5354
+ /**
5355
+ * No package could be funded.
5356
+ */
5357
+ class Unsigned_ extends UniffiEnum implements Unsigned__interface {
5358
+ /**
5359
+ * @private
5360
+ * This field is private and should not be used, use `tag` instead.
5361
+ */
5362
+ readonly [uniffiTypeNameSymbol] = "PresignedExitStatus";
5363
+ readonly tag = PresignedExitStatus_Tags.Unsigned;
5364
+ constructor() {
5365
+ super("PresignedExitStatus", "Unsigned");
5366
+ }
5367
+
5368
+ static new(): Unsigned_ {
5369
+ return new Unsigned_();
5370
+ }
5371
+
5372
+ static instanceOf(obj: any): obj is Unsigned_ {
5373
+ return obj.tag === PresignedExitStatus_Tags.Unsigned;
5374
+ }
5375
+
5376
+ }
5377
+
5378
+ function instanceOf(obj: any): obj is PresignedExitStatus {
5379
+ return obj[uniffiTypeNameSymbol] === "PresignedExitStatus";
5380
+ }
5381
+
5382
+ return Object.freeze({
5383
+ instanceOf,
5384
+ FullySigned: FullySigned_,
5385
+ PartiallySigned: PartiallySigned_,
5386
+ Unsigned: Unsigned_
5387
+ });
5388
+
5389
+ })();
5390
+ /**
5391
+ * How much of a [`PresignedExit`]'s remaining broadcast work could be funded
5392
+ * and signed, mirroring `bark::exit::PresignedExitStatus`.
5393
+ */
5394
+ export type PresignedExitStatus = InstanceType<
5395
+ typeof PresignedExitStatus['FullySigned' | 'PartiallySigned' | 'Unsigned']
5396
+ >;
5397
+
5398
+ // FfiConverter for enum PresignedExitStatus
5399
+ const FfiConverterTypePresignedExitStatus = (() => {
5400
+ type TypeName = PresignedExitStatus;
5401
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5402
+ readFromCursor(c: Cursor): TypeName {
5403
+ switch (c.readI32()) {
5404
+ case 1: return new PresignedExitStatus.FullySigned({exitedInWave: FfiConverterOptionalUInt32.readFromCursor(c), feeInfo: FfiConverterTypeExitFeeInfo.readFromCursor(c) });
5405
+ case 2: return new PresignedExitStatus.PartiallySigned({lastWave: FfiConverterUInt32.readFromCursor(c) });
5406
+ case 3: return new PresignedExitStatus.Unsigned();
5407
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
5408
+ }
5409
+ }
5410
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5411
+ switch (value.tag) {
5412
+ case PresignedExitStatus_Tags.FullySigned: {
5413
+ c.writeI32(1);
5414
+ const inner = value.inner;
5415
+ FfiConverterOptionalUInt32.writeIntoCursor(inner.exitedInWave, c);
5416
+ FfiConverterTypeExitFeeInfo.writeIntoCursor(inner.feeInfo, c);
5417
+ return;
5418
+ }
5419
+ case PresignedExitStatus_Tags.PartiallySigned: {
5420
+ c.writeI32(2);
5421
+ const inner = value.inner;
5422
+ FfiConverterUInt32.writeIntoCursor(inner.lastWave, c);
5423
+ return;
5424
+ }
5425
+ case PresignedExitStatus_Tags.Unsigned: {
5426
+ c.writeI32(3);
5427
+ return;
5428
+ }
5429
+ default:
5430
+ // Throwing from here means that PresignedExitStatus_Tags hasn't matched an ordinal.
5431
+ throw new UniffiInternalError.UnexpectedEnumCase();
5432
+ }
5433
+ }
5434
+ allocationSize(value: TypeName): number {
5435
+ switch (value.tag) {
5436
+ case PresignedExitStatus_Tags.FullySigned: {
5437
+ const inner = value.inner;
5438
+ let size = 4;
5439
+ size += FfiConverterOptionalUInt32.allocationSize(inner.exitedInWave);
5440
+ size += FfiConverterTypeExitFeeInfo.allocationSize(inner.feeInfo);
5441
+ return size;
5442
+ }
5443
+ case PresignedExitStatus_Tags.PartiallySigned: {
5444
+ const inner = value.inner;
5445
+ let size = 4;
5446
+ size += FfiConverterUInt32.allocationSize(inner.lastWave);
5447
+ return size;
5448
+ }
5449
+ case PresignedExitStatus_Tags.Unsigned: {
5450
+ return 4;
5451
+ }
5452
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
5453
+ }
5454
+ }
5455
+ }
5456
+ return new FFIConverter();
5457
+ })();
5458
+
5459
+ /**
5460
+ * The presigned broadcast work for one VTXO, mirroring
5461
+ * `bark::exit::PresignedExit`.
5462
+ */
5463
+ export type PresignedExit = {
5464
+ vtxoId: string,
5465
+ status: PresignedExitStatus,
5466
+ /**
5467
+ * The remaining tail of this exit's chain that could not be funded, in
5468
+ * broadcast order; its first transaction spends this exit's last signed
5469
+ * one. Empty when fully signed.
5470
+ */
5471
+ unsigned: Array<ExitTransactionInfo>
5097
5472
  }
5098
5473
 
5099
5474
  /**
5100
- * Generated factory for {@link RecoveryBucket} record objects.
5475
+ * Generated factory for {@link PresignedExit} record objects.
5101
5476
  */
5102
- export const RecoveryBucket = (() => {
5477
+ export const PresignedExit = (() => {
5103
5478
  const defaults = () => ({
5104
5479
  });
5105
5480
  const create = (() => {
5106
- return uniffiCreateRecord<RecoveryBucket, ReturnType<typeof defaults>>(defaults);
5481
+ return uniffiCreateRecord<PresignedExit, ReturnType<typeof defaults>>(defaults);
5107
5482
  })();
5108
5483
  return Object.freeze({
5109
5484
  create,
5110
5485
  new: create,
5111
- defaults: () => Object.freeze(defaults()) as Partial<RecoveryBucket>,
5486
+ defaults: () => Object.freeze(defaults()) as Partial<PresignedExit>,
5112
5487
  });
5113
5488
  })();
5114
5489
 
5115
- const FfiConverterTypeRecoveryBucket = (() => {
5116
- type TypeName = RecoveryBucket;
5490
+ const FfiConverterTypePresignedExit = (() => {
5491
+ type TypeName = PresignedExit;
5117
5492
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5118
5493
  readFromCursor(c: Cursor): TypeName {
5119
5494
  return {
5120
- vtxoIds: FfiConverterSequenceString.readFromCursor(c),
5121
- totalSats: FfiConverterUInt64.readFromCursor(c)
5495
+ vtxoId: FfiConverterString.readFromCursor(c),
5496
+ status: FfiConverterTypePresignedExitStatus.readFromCursor(c),
5497
+ unsigned: FfiConverterSequenceTypeExitTransactionInfo.readFromCursor(c)
5122
5498
  };
5123
5499
  }
5124
5500
  writeIntoCursor(value: TypeName, c: Cursor): void {
5125
- FfiConverterSequenceString.writeIntoCursor(value.vtxoIds, c);
5126
- FfiConverterUInt64.writeIntoCursor(value.totalSats, c);
5501
+ FfiConverterString.writeIntoCursor(value.vtxoId, c);
5502
+ FfiConverterTypePresignedExitStatus.writeIntoCursor(value.status, c);
5503
+ FfiConverterSequenceTypeExitTransactionInfo.writeIntoCursor(value.unsigned, c);
5127
5504
  }
5128
5505
  allocationSize(value: TypeName): number {
5129
- return FfiConverterSequenceString.allocationSize(value.vtxoIds) +
5130
- FfiConverterUInt64.allocationSize(value.totalSats);
5506
+ return FfiConverterString.allocationSize(value.vtxoId) +
5507
+ FfiConverterTypePresignedExitStatus.allocationSize(value.status) +
5508
+ FfiConverterSequenceTypeExitTransactionInfo.allocationSize(value.unsigned);
5131
5509
 
5132
5510
  }
5133
5511
  };
@@ -5135,29 +5513,320 @@ const FfiConverterTypeRecoveryBucket = (() => {
5135
5513
  })();
5136
5514
 
5137
5515
  /**
5138
- * Outcome of a recovery scan: every VTXO id the scan looked at, bucketed by
5139
- * what was decided about it.
5140
- *
5141
- * `skipped` vs `failed` is the load-bearing distinction: a `skipped` VTXO was
5142
- * decided not to be spendable (spent, exited, or reported non-spendable),
5143
- * while a `failed` one could not be decided because of an error, so its funds
5144
- * may still be missing. `failed` is retryable via `recover_vtxos`; a `foreign`
5145
- * id instead sits beyond the key-derivation gap limit and needs a wider scan.
5516
+ * A signed CPFP child and the fee it commits, mirroring
5517
+ * `bark::exit::PresignedExitChildInfo`.
5146
5518
  */
5147
- export type RecoveryReport = {
5519
+ export type PresignedExitChild = {
5520
+ txid: string,
5148
5521
  /**
5149
- * Spendable VTXOs that were successfully re-imported.
5522
+ * Consensus-encoded signed transaction, hex.
5150
5523
  */
5151
- recovered: RecoveryBucket,
5524
+ txHex: string,
5152
5525
  /**
5153
- * Deliberately left out: spent into a newer recovered VTXO, exited
5154
- * on-chain, or reported non-spendable by the server.
5526
+ * The exit transaction is zero-fee, so this is the fee of the whole
5527
+ * package.
5155
5528
  */
5156
- skipped: RecoveryBucket,
5157
- /**
5158
- * No matching key could be derived within the gap limit (the configured
5159
- * run of consecutive unused key indices, 250 by default). For a mailbox scan these are most likely this wallet's
5160
- * own VTXOs, keyed beyond the limit, so funds may be missing; retrying
5529
+ feeInfo: ExitFeeInfo
5530
+ }
5531
+
5532
+ /**
5533
+ * Generated factory for {@link PresignedExitChild} record objects.
5534
+ */
5535
+ export const PresignedExitChild = (() => {
5536
+ const defaults = () => ({
5537
+ });
5538
+ const create = (() => {
5539
+ return uniffiCreateRecord<PresignedExitChild, ReturnType<typeof defaults>>(defaults);
5540
+ })();
5541
+ return Object.freeze({
5542
+ create,
5543
+ new: create,
5544
+ defaults: () => Object.freeze(defaults()) as Partial<PresignedExitChild>,
5545
+ });
5546
+ })();
5547
+
5548
+ const FfiConverterTypePresignedExitChild = (() => {
5549
+ type TypeName = PresignedExitChild;
5550
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5551
+ readFromCursor(c: Cursor): TypeName {
5552
+ return {
5553
+ txid: FfiConverterString.readFromCursor(c),
5554
+ txHex: FfiConverterString.readFromCursor(c),
5555
+ feeInfo: FfiConverterTypeExitFeeInfo.readFromCursor(c)
5556
+ };
5557
+ }
5558
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5559
+ FfiConverterString.writeIntoCursor(value.txid, c);
5560
+ FfiConverterString.writeIntoCursor(value.txHex, c);
5561
+ FfiConverterTypeExitFeeInfo.writeIntoCursor(value.feeInfo, c);
5562
+ }
5563
+ allocationSize(value: TypeName): number {
5564
+ return FfiConverterString.allocationSize(value.txid) +
5565
+ FfiConverterString.allocationSize(value.txHex) +
5566
+ FfiConverterTypeExitFeeInfo.allocationSize(value.feeInfo);
5567
+
5568
+ }
5569
+ };
5570
+ return new FFIConverter();
5571
+ })();
5572
+
5573
+ /**
5574
+ * An `(exit, child)` transaction package, broadcast as one unit (e.g. with
5575
+ * `submitpackage`), mirroring `bark::exit::PresignedExitPackage`.
5576
+ */
5577
+ export type PresignedExitPackage = {
5578
+ /**
5579
+ * The VTXO whose exit this package advances.
5580
+ */
5581
+ vtxoId: string,
5582
+ /**
5583
+ * The zero-fee exit transaction.
5584
+ */
5585
+ exit: ExitTransactionInfo,
5586
+ /**
5587
+ * The signed CPFP child paying for `exit`.
5588
+ */
5589
+ child: PresignedExitChild
5590
+ }
5591
+
5592
+ /**
5593
+ * Generated factory for {@link PresignedExitPackage} record objects.
5594
+ */
5595
+ export const PresignedExitPackage = (() => {
5596
+ const defaults = () => ({
5597
+ });
5598
+ const create = (() => {
5599
+ return uniffiCreateRecord<PresignedExitPackage, ReturnType<typeof defaults>>(defaults);
5600
+ })();
5601
+ return Object.freeze({
5602
+ create,
5603
+ new: create,
5604
+ defaults: () => Object.freeze(defaults()) as Partial<PresignedExitPackage>,
5605
+ });
5606
+ })();
5607
+
5608
+ const FfiConverterTypePresignedExitPackage = (() => {
5609
+ type TypeName = PresignedExitPackage;
5610
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5611
+ readFromCursor(c: Cursor): TypeName {
5612
+ return {
5613
+ vtxoId: FfiConverterString.readFromCursor(c),
5614
+ exit: FfiConverterTypeExitTransactionInfo.readFromCursor(c),
5615
+ child: FfiConverterTypePresignedExitChild.readFromCursor(c)
5616
+ };
5617
+ }
5618
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5619
+ FfiConverterString.writeIntoCursor(value.vtxoId, c);
5620
+ FfiConverterTypeExitTransactionInfo.writeIntoCursor(value.exit, c);
5621
+ FfiConverterTypePresignedExitChild.writeIntoCursor(value.child, c);
5622
+ }
5623
+ allocationSize(value: TypeName): number {
5624
+ return FfiConverterString.allocationSize(value.vtxoId) +
5625
+ FfiConverterTypeExitTransactionInfo.allocationSize(value.exit) +
5626
+ FfiConverterTypePresignedExitChild.allocationSize(value.child);
5627
+
5628
+ }
5629
+ };
5630
+ return new FFIConverter();
5631
+ })();
5632
+
5633
+ /**
5634
+ * One step of a presigned broadcast plan, mirroring
5635
+ * `bark::exit::PresignedWave`. See [`PresignedExits`] for the rules.
5636
+ */
5637
+ export type PresignedWave = {
5638
+ /**
5639
+ * Packages funded independently of each other, broadcast together.
5640
+ */
5641
+ packages: Array<PresignedExitPackage>,
5642
+ /**
5643
+ * Exit transactions already in the mempool; they confirm with this wave.
5644
+ * Only the first wave has any.
5645
+ */
5646
+ inMempool: Array<ExitTransactionInfo>
5647
+ }
5648
+
5649
+ /**
5650
+ * Generated factory for {@link PresignedWave} record objects.
5651
+ */
5652
+ export const PresignedWave = (() => {
5653
+ const defaults = () => ({
5654
+ });
5655
+ const create = (() => {
5656
+ return uniffiCreateRecord<PresignedWave, ReturnType<typeof defaults>>(defaults);
5657
+ })();
5658
+ return Object.freeze({
5659
+ create,
5660
+ new: create,
5661
+ defaults: () => Object.freeze(defaults()) as Partial<PresignedWave>,
5662
+ });
5663
+ })();
5664
+
5665
+ const FfiConverterTypePresignedWave = (() => {
5666
+ type TypeName = PresignedWave;
5667
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5668
+ readFromCursor(c: Cursor): TypeName {
5669
+ return {
5670
+ packages: FfiConverterSequenceTypePresignedExitPackage.readFromCursor(c),
5671
+ inMempool: FfiConverterSequenceTypeExitTransactionInfo.readFromCursor(c)
5672
+ };
5673
+ }
5674
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5675
+ FfiConverterSequenceTypePresignedExitPackage.writeIntoCursor(value.packages, c);
5676
+ FfiConverterSequenceTypeExitTransactionInfo.writeIntoCursor(value.inMempool, c);
5677
+ }
5678
+ allocationSize(value: TypeName): number {
5679
+ return FfiConverterSequenceTypePresignedExitPackage.allocationSize(value.packages) +
5680
+ FfiConverterSequenceTypeExitTransactionInfo.allocationSize(value.inMempool);
5681
+
5682
+ }
5683
+ };
5684
+ return new FFIConverter();
5685
+ })();
5686
+
5687
+ /**
5688
+ * Presigned emergency-exit chains for a set of VTXOs: a wave-by-wave
5689
+ * broadcast plan plus a per-VTXO summary, mirroring
5690
+ * `bark::exit::PresignedExits`.
5691
+ *
5692
+ * Execute the plan in wave order: broadcast all of a wave's packages
5693
+ * together, then wait for every one, and its `in_mempool` transactions, to
5694
+ * confirm before the next wave. Each wave's children spend change confirmed
5695
+ * by the previous wave.
5696
+ *
5697
+ * Presigning reserves no funds, so a later spend from the onchain wallet can
5698
+ * invalidate the remaining children. It does reveal the change addresses
5699
+ * those children pay to. The children are fully signed: treat the result as
5700
+ * sensitive and store it accordingly.
5701
+ */
5702
+ export type PresignedExits = {
5703
+ /**
5704
+ * One entry per requested VTXO, in request order (duplicates resolve to
5705
+ * their first occurrence).
5706
+ */
5707
+ exits: Array<PresignedExit>,
5708
+ /**
5709
+ * The broadcast plan. Confirmed transactions are omitted, relayed ones are
5710
+ * listed in [`PresignedWave::in_mempool`], and a package shared by several
5711
+ * exits appears once, under the first exit that references it.
5712
+ */
5713
+ waves: Array<PresignedWave>
5714
+ }
5715
+
5716
+ /**
5717
+ * Generated factory for {@link PresignedExits} record objects.
5718
+ */
5719
+ export const PresignedExits = (() => {
5720
+ const defaults = () => ({
5721
+ });
5722
+ const create = (() => {
5723
+ return uniffiCreateRecord<PresignedExits, ReturnType<typeof defaults>>(defaults);
5724
+ })();
5725
+ return Object.freeze({
5726
+ create,
5727
+ new: create,
5728
+ defaults: () => Object.freeze(defaults()) as Partial<PresignedExits>,
5729
+ });
5730
+ })();
5731
+
5732
+ const FfiConverterTypePresignedExits = (() => {
5733
+ type TypeName = PresignedExits;
5734
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5735
+ readFromCursor(c: Cursor): TypeName {
5736
+ return {
5737
+ exits: FfiConverterSequenceTypePresignedExit.readFromCursor(c),
5738
+ waves: FfiConverterSequenceTypePresignedWave.readFromCursor(c)
5739
+ };
5740
+ }
5741
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5742
+ FfiConverterSequenceTypePresignedExit.writeIntoCursor(value.exits, c);
5743
+ FfiConverterSequenceTypePresignedWave.writeIntoCursor(value.waves, c);
5744
+ }
5745
+ allocationSize(value: TypeName): number {
5746
+ return FfiConverterSequenceTypePresignedExit.allocationSize(value.exits) +
5747
+ FfiConverterSequenceTypePresignedWave.allocationSize(value.waves);
5748
+
5749
+ }
5750
+ };
5751
+ return new FFIConverter();
5752
+ })();
5753
+
5754
+ /**
5755
+ * One bucket of a [`RecoveryReport`].
5756
+ *
5757
+ * `total_sats` only sums the VTXOs whose amount is known, so it can
5758
+ * under-count `failed`, `abandoned` and `not_found`, where a VTXO may not
5759
+ * have been fetched. `vtxo_ids` is sorted as strings.
5760
+ */
5761
+ export type RecoveryBucket = {
5762
+ vtxoIds: Array<string>,
5763
+ totalSats: bigint
5764
+ }
5765
+
5766
+ /**
5767
+ * Generated factory for {@link RecoveryBucket} record objects.
5768
+ */
5769
+ export const RecoveryBucket = (() => {
5770
+ const defaults = () => ({
5771
+ });
5772
+ const create = (() => {
5773
+ return uniffiCreateRecord<RecoveryBucket, ReturnType<typeof defaults>>(defaults);
5774
+ })();
5775
+ return Object.freeze({
5776
+ create,
5777
+ new: create,
5778
+ defaults: () => Object.freeze(defaults()) as Partial<RecoveryBucket>,
5779
+ });
5780
+ })();
5781
+
5782
+ const FfiConverterTypeRecoveryBucket = (() => {
5783
+ type TypeName = RecoveryBucket;
5784
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5785
+ readFromCursor(c: Cursor): TypeName {
5786
+ return {
5787
+ vtxoIds: FfiConverterSequenceString.readFromCursor(c),
5788
+ totalSats: FfiConverterUInt64.readFromCursor(c)
5789
+ };
5790
+ }
5791
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5792
+ FfiConverterSequenceString.writeIntoCursor(value.vtxoIds, c);
5793
+ FfiConverterUInt64.writeIntoCursor(value.totalSats, c);
5794
+ }
5795
+ allocationSize(value: TypeName): number {
5796
+ return FfiConverterSequenceString.allocationSize(value.vtxoIds) +
5797
+ FfiConverterUInt64.allocationSize(value.totalSats);
5798
+
5799
+ }
5800
+ };
5801
+ return new FFIConverter();
5802
+ })();
5803
+
5804
+ /**
5805
+ * Outcome of a recovery scan: every VTXO id the scan looked at, bucketed by
5806
+ * what was decided about it.
5807
+ *
5808
+ * `skipped` vs `failed` is the load-bearing distinction: a `skipped` VTXO was
5809
+ * decided not to be spendable (spent, exited, or reported non-spendable),
5810
+ * while a `failed` one could not be decided because of an error, so its funds
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.
5815
+ */
5816
+ export type RecoveryReport = {
5817
+ /**
5818
+ * Spendable VTXOs that were successfully re-imported.
5819
+ */
5820
+ recovered: RecoveryBucket,
5821
+ /**
5822
+ * Deliberately left out: spent into a newer recovered VTXO, exited
5823
+ * on-chain, or reported non-spendable by the server.
5824
+ */
5825
+ skipped: RecoveryBucket,
5826
+ /**
5827
+ * No matching key could be derived within the gap limit (the configured
5828
+ * run of consecutive unused key indices, 250 by default). For a mailbox scan these are most likely this wallet's
5829
+ * own VTXOs, keyed beyond the limit, so funds may be missing; retrying
5161
5830
  * won't help, only a wider gap limit (see `Config.vtxo_key_gap_limit` and
5162
5831
  * the `gap_limit` override on `recover_vtxos`). For `recover_vtxos` it
5163
5832
  * just means the caller passed an id this wallet doesn't own.
@@ -5173,7 +5842,20 @@ export type RecoveryReport = {
5173
5842
  */
5174
5843
  exited: RecoveryBucket,
5175
5844
  /**
5176
- * 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`.
5177
5859
  */
5178
5860
  isComplete: boolean
5179
5861
  }
@@ -5204,6 +5886,8 @@ const FfiConverterTypeRecoveryReport = (() => {
5204
5886
  foreign: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5205
5887
  failed: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5206
5888
  exited: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5889
+ notFound: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5890
+ abandoned: FfiConverterTypeRecoveryBucket.readFromCursor(c),
5207
5891
  isComplete: FfiConverterBool.readFromCursor(c)
5208
5892
  };
5209
5893
  }
@@ -5213,6 +5897,8 @@ const FfiConverterTypeRecoveryReport = (() => {
5213
5897
  FfiConverterTypeRecoveryBucket.writeIntoCursor(value.foreign, c);
5214
5898
  FfiConverterTypeRecoveryBucket.writeIntoCursor(value.failed, c);
5215
5899
  FfiConverterTypeRecoveryBucket.writeIntoCursor(value.exited, c);
5900
+ FfiConverterTypeRecoveryBucket.writeIntoCursor(value.notFound, c);
5901
+ FfiConverterTypeRecoveryBucket.writeIntoCursor(value.abandoned, c);
5216
5902
  FfiConverterBool.writeIntoCursor(value.isComplete, c);
5217
5903
  }
5218
5904
  allocationSize(value: TypeName): number {
@@ -5221,6 +5907,8 @@ const FfiConverterTypeRecoveryReport = (() => {
5221
5907
  FfiConverterTypeRecoveryBucket.allocationSize(value.foreign) +
5222
5908
  FfiConverterTypeRecoveryBucket.allocationSize(value.failed) +
5223
5909
  FfiConverterTypeRecoveryBucket.allocationSize(value.exited) +
5910
+ FfiConverterTypeRecoveryBucket.allocationSize(value.notFound) +
5911
+ FfiConverterTypeRecoveryBucket.allocationSize(value.abandoned) +
5224
5912
  FfiConverterBool.allocationSize(value.isComplete);
5225
5913
 
5226
5914
  }
@@ -5228,6 +5916,113 @@ const FfiConverterTypeRecoveryReport = (() => {
5228
5916
  return new FFIConverter();
5229
5917
  })();
5230
5918
 
5919
+ /**
5920
+ * The exit transactions one VTXO still needs confirmed to be exited.
5921
+ */
5922
+ export type RemainingExit = {
5923
+ vtxoId: string,
5924
+ /**
5925
+ * Txids in broadcast order. Each one's transaction is in
5926
+ * [`RemainingExitTransactions::transactions`]. Empty when the chain is
5927
+ * already confirmed.
5928
+ */
5929
+ txids: Array<string>
5930
+ }
5931
+
5932
+ /**
5933
+ * Generated factory for {@link RemainingExit} record objects.
5934
+ */
5935
+ export const RemainingExit = (() => {
5936
+ const defaults = () => ({
5937
+ });
5938
+ const create = (() => {
5939
+ return uniffiCreateRecord<RemainingExit, ReturnType<typeof defaults>>(defaults);
5940
+ })();
5941
+ return Object.freeze({
5942
+ create,
5943
+ new: create,
5944
+ defaults: () => Object.freeze(defaults()) as Partial<RemainingExit>,
5945
+ });
5946
+ })();
5947
+
5948
+ const FfiConverterTypeRemainingExit = (() => {
5949
+ type TypeName = RemainingExit;
5950
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5951
+ readFromCursor(c: Cursor): TypeName {
5952
+ return {
5953
+ vtxoId: FfiConverterString.readFromCursor(c),
5954
+ txids: FfiConverterSequenceString.readFromCursor(c)
5955
+ };
5956
+ }
5957
+ writeIntoCursor(value: TypeName, c: Cursor): void {
5958
+ FfiConverterString.writeIntoCursor(value.vtxoId, c);
5959
+ FfiConverterSequenceString.writeIntoCursor(value.txids, c);
5960
+ }
5961
+ allocationSize(value: TypeName): number {
5962
+ return FfiConverterString.allocationSize(value.vtxoId) +
5963
+ FfiConverterSequenceString.allocationSize(value.txids);
5964
+
5965
+ }
5966
+ };
5967
+ return new FFIConverter();
5968
+ })();
5969
+
5970
+ /**
5971
+ * The exit transactions of a set of VTXOs still awaiting confirmation,
5972
+ * mirroring `bark::exit::RemainingExitTransactions`.
5973
+ */
5974
+ export type RemainingExitTransactions = {
5975
+ /**
5976
+ * One entry per requested VTXO, in request order (duplicates resolve to
5977
+ * their first occurrence). Upstream returns a map; it is a list here so
5978
+ * the order is stable across bindings.
5979
+ */
5980
+ exits: Array<RemainingExit>,
5981
+ /**
5982
+ * Every transaction referenced by `exits` exactly once, parents before
5983
+ * children.
5984
+ */
5985
+ transactions: Array<ExitTransactionInfo>
5986
+ }
5987
+
5988
+ /**
5989
+ * Generated factory for {@link RemainingExitTransactions} record objects.
5990
+ */
5991
+ export const RemainingExitTransactions = (() => {
5992
+ const defaults = () => ({
5993
+ });
5994
+ const create = (() => {
5995
+ return uniffiCreateRecord<RemainingExitTransactions, ReturnType<typeof defaults>>(defaults);
5996
+ })();
5997
+ return Object.freeze({
5998
+ create,
5999
+ new: create,
6000
+ defaults: () => Object.freeze(defaults()) as Partial<RemainingExitTransactions>,
6001
+ });
6002
+ })();
6003
+
6004
+ const FfiConverterTypeRemainingExitTransactions = (() => {
6005
+ type TypeName = RemainingExitTransactions;
6006
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
6007
+ readFromCursor(c: Cursor): TypeName {
6008
+ return {
6009
+ exits: FfiConverterSequenceTypeRemainingExit.readFromCursor(c),
6010
+ transactions: FfiConverterSequenceTypeExitTransactionInfo.readFromCursor(c)
6011
+ };
6012
+ }
6013
+ writeIntoCursor(value: TypeName, c: Cursor): void {
6014
+ FfiConverterSequenceTypeRemainingExit.writeIntoCursor(value.exits, c);
6015
+ FfiConverterSequenceTypeExitTransactionInfo.writeIntoCursor(value.transactions, c);
6016
+ }
6017
+ allocationSize(value: TypeName): number {
6018
+ return FfiConverterSequenceTypeRemainingExit.allocationSize(value.exits) +
6019
+ FfiConverterSequenceTypeExitTransactionInfo.allocationSize(value.transactions);
6020
+
6021
+ }
6022
+ };
6023
+ return new FFIConverter();
6024
+ })();
6025
+
5231
6026
  /**
5232
6027
  * Lifecycle phase of a round participation, mirroring
5233
6028
  * `bark::round::RoundFlowKind`.
@@ -6234,7 +7029,8 @@ private constructor(pointer: UniffiHandle) {
6234
7029
  }
6235
7030
 
6236
7031
  /**
6237
- * BDK-backed wallet. Opens the shared sqlite cache.
7032
+ * BDK-backed wallet. Opens the shared sqlite cache in `datadir`, a
7033
+ * filesystem path or a `file://` URI.
6238
7034
  */
6239
7035
  static async default_(network: Network, mnemonic: string, config: Config, datadir: string, asyncOpts_?: { signal: AbortSignal }): Promise<OnchainWalletLike> /*throws*/ {
6240
7036
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -6750,7 +7546,8 @@ export type WalletOpenArgs = {
6750
7546
  */
6751
7547
  runDaemon: boolean,
6752
7548
  /**
6753
- * The data directory to use for this wallet
7549
+ * The data directory to use for this wallet: a filesystem path or a
7550
+ * `file://` URI (such as Expo's `Directory.uri`)
6754
7551
  */
6755
7552
  datadir: string,
6756
7553
  /**
@@ -6772,11 +7569,12 @@ export type WalletOpenArgs = {
6772
7569
  */
6773
7570
  createWithoutServer: boolean,
6774
7571
  /**
6775
- * Whether to skip the seed-recovery mailbox scan
7572
+ * Whether to skip the recovery from seed
6776
7573
  *
6777
- * The scan runs on the open that creates the wallet locally and makes
6778
- * network calls; its outcome is available from `Wallet::recovery_status`.
6779
- * 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.
6780
7578
  *
6781
7579
  * Default: false
6782
7580
  */
@@ -7323,19 +8121,22 @@ const FfiConverterTypePaymentResult = (() => {
7323
8121
  export enum RecoveryStatus_Tags {
7324
8122
  NotRun = "NotRun",
7325
8123
  Failed = "Failed",
8124
+ InProgress = "InProgress",
7326
8125
  Completed = "Completed"
7327
8126
  }
7328
8127
  /**
7329
- * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
8128
+ * Outcome of the seed recovery as `Wallet::open` saw it, mirroring
7330
8129
  * `bark::RecoveryStatus`.
7331
8130
  *
7332
- * The three variants are distinguishable on purpose: `NotRun` means nothing
7333
- * was attempted (wallet already existed locally, or `skip_recovery` was set),
7334
- * `Failed` means the scan errored before producing a report so funds may be
7335
- * missing until a retry succeeds, and `Completed` carries the report — whose
7336
- * `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.
7337
8138
  *
7338
- * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
8139
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
7339
8140
  */
7340
8141
  export const RecoveryStatus = (() => {
7341
8142
 
@@ -7372,7 +8173,8 @@ export const RecoveryStatus = (() => {
7372
8173
  Readonly<{message: string}>
7373
8174
  };
7374
8175
  /**
7375
- * 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.
7376
8178
  */
7377
8179
  class Failed_ extends UniffiEnum implements Failed__interface {
7378
8180
  /**
@@ -7400,13 +8202,50 @@ inner: {message: string }): Failed_ {
7400
8202
 
7401
8203
  }
7402
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
+
7403
8242
  type Completed__interface = {
7404
8243
  tag: RecoveryStatus_Tags.Completed;
7405
8244
  inner:
7406
8245
  Readonly<{report: RecoveryReport}>
7407
8246
  };
7408
8247
  /**
7409
- * The scan ran to the end.
8248
+ * The recovery is done: no VTXO is left failed.
7410
8249
  */
7411
8250
  class Completed_ extends UniffiEnum implements Completed__interface {
7412
8251
  /**
@@ -7442,24 +8281,27 @@ inner: {report: RecoveryReport }): Completed_ {
7442
8281
  instanceOf,
7443
8282
  NotRun: NotRun_,
7444
8283
  Failed: Failed_,
8284
+ InProgress: InProgress_,
7445
8285
  Completed: Completed_
7446
8286
  });
7447
8287
 
7448
8288
  })();
7449
8289
  /**
7450
- * Outcome of the seed-recovery scan `Wallet::open` runs, mirroring
8290
+ * Outcome of the seed recovery as `Wallet::open` saw it, mirroring
7451
8291
  * `bark::RecoveryStatus`.
7452
8292
  *
7453
- * The three variants are distinguishable on purpose: `NotRun` means nothing
7454
- * was attempted (wallet already existed locally, or `skip_recovery` was set),
7455
- * `Failed` means the scan errored before producing a report so funds may be
7456
- * missing until a retry succeeds, and `Completed` carries the report — whose
7457
- * `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.
7458
8300
  *
7459
- * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
8301
+ * Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
7460
8302
  */
7461
8303
  export type RecoveryStatus = InstanceType<
7462
- typeof RecoveryStatus['NotRun' | 'Failed' | 'Completed']
8304
+ typeof RecoveryStatus['NotRun' | 'Failed' | 'InProgress' | 'Completed']
7463
8305
  >;
7464
8306
 
7465
8307
  // FfiConverter for enum RecoveryStatus
@@ -7470,7 +8312,8 @@ const FfiConverterTypeRecoveryStatus = (() => {
7470
8312
  switch (c.readI32()) {
7471
8313
  case 1: return new RecoveryStatus.NotRun();
7472
8314
  case 2: return new RecoveryStatus.Failed({message: FfiConverterString.readFromCursor(c) });
7473
- 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) });
7474
8317
  default: throw new UniffiInternalError.UnexpectedEnumCase();
7475
8318
  }
7476
8319
  }
@@ -7486,12 +8329,18 @@ const FfiConverterTypeRecoveryStatus = (() => {
7486
8329
  FfiConverterString.writeIntoCursor(inner.message, c);
7487
8330
  return;
7488
8331
  }
7489
- case RecoveryStatus_Tags.Completed: {
8332
+ case RecoveryStatus_Tags.InProgress: {
7490
8333
  c.writeI32(3);
7491
8334
  const inner = value.inner;
7492
8335
  FfiConverterTypeRecoveryReport.writeIntoCursor(inner.report, c);
7493
8336
  return;
7494
8337
  }
8338
+ case RecoveryStatus_Tags.Completed: {
8339
+ c.writeI32(4);
8340
+ const inner = value.inner;
8341
+ FfiConverterTypeRecoveryReport.writeIntoCursor(inner.report, c);
8342
+ return;
8343
+ }
7495
8344
  default:
7496
8345
  // Throwing from here means that RecoveryStatus_Tags hasn't matched an ordinal.
7497
8346
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -7508,6 +8357,12 @@ const FfiConverterTypeRecoveryStatus = (() => {
7508
8357
  size += FfiConverterString.allocationSize(inner.message);
7509
8358
  return size;
7510
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
+ }
7511
8366
  case RecoveryStatus_Tags.Completed: {
7512
8367
  const inner = value.inner;
7513
8368
  let size = 4;
@@ -7953,6 +8808,17 @@ export interface CustomOnchainWalletCallbacks {
7953
8808
  /**
7954
8809
  * Create a signed P2A CPFP transaction
7955
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
+ *
7956
8822
  * # Arguments
7957
8823
  * * `params` - CPFP transaction parameters
7958
8824
  *
@@ -8169,6 +9035,17 @@ private constructor(pointer: UniffiHandle) {
8169
9035
  /**
8170
9036
  * Create a signed P2A CPFP transaction
8171
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
+ *
8172
9049
  * # Arguments
8173
9050
  * * `params` - CPFP transaction parameters
8174
9051
  *
@@ -8851,18 +9728,56 @@ export interface WalletLike {
8851
9728
  * The numbers to show a user, without the breakdown of `balance`: what
8852
9729
  * they can spend, what needs a refresh, what is pending and the total.
8853
9730
  */
8854
- balanceSummary(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BalanceSummary>;
9731
+ balanceSummary(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BalanceSummary>;
9732
+ /**
9733
+ * Build a BIP 321 `bitcoin:` URI with a new Ark address, a new BOLT11
9734
+ * invoice (when there is an amount) and the caller's onchain address,
9735
+ * as `options` selects.
9736
+ */
9737
+ bip321Uri(options: Bip321UriOptions, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Bip321Uri>;
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>;
8855
9773
  /**
8856
- * Build a BIP 321 `bitcoin:` URI with a new Ark address, a new BOLT11
8857
- * invoice (when there is an amount) and the caller's onchain address,
8858
- * as `options` selects.
9774
+ * Create an invoice for an incoming lightning payment.
9775
+ *
9776
+ * `expiry_secs` is how long the invoice can be paid for. It defaults to,
9777
+ * and cannot exceed, the Ark server's invoice expiry; creating the invoice
9778
+ * fails if the server does not honour it. Must be at least 1.
8859
9779
  */
8860
- bip321Uri(options: Bip321UriOptions, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Bip321Uri>;
8861
- boardAll(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
8862
- boardAmount(amountSats: bigint, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
8863
- boardFundingAddress(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<BoardFundingInfo>;
8864
- boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PendingBoard>;
8865
- bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
9780
+ bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
8866
9781
  /**
8867
9782
  * Create an invoice whose claimed VTXO is delivered to `claim_destination`
8868
9783
  * (an Ark address), letting that wallet receive while offline.
@@ -8878,8 +9793,10 @@ export interface WalletLike {
8878
9793
  *
8879
9794
  * A `claim_destination` owned by this wallet is claimed locally instead of
8880
9795
  * going through its mailbox.
9796
+ *
9797
+ * `expiry_secs` works as in [`Self::bolt11_invoice`].
8881
9798
  */
8882
- bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
9799
+ bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningInvoice>;
8883
9800
  broadcastTx(txHex: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<string>;
8884
9801
  cancelAllPendingRounds(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
8885
9802
  /**
@@ -8983,6 +9900,16 @@ export interface WalletLike {
8983
9900
  * table without consulting the server.
8984
9901
  */
8985
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>;
8986
9913
  /**
8987
9914
  * Triage a payment hash: settled or in-progress. Errors if no lightning
8988
9915
  * receive is known for this payment hash.
@@ -9075,15 +10002,48 @@ export interface WalletLike {
9075
10002
  pendingLightningReceives(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<LightningReceive>>;
9076
10003
  pendingLightningSendVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Vtxo>>;
9077
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>;
9078
10015
  pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Vtxo>>;
9079
10016
  pendingRoundStates(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<RoundState>>;
10017
+ /**
10018
+ * Sign, without broadcasting, the CPFP child of every exit transaction
10019
+ * that still needs broadcasting to emergency-exit the given VTXOs, for as
10020
+ * long as confirmed onchain funds last. Mirrors bark-rest
10021
+ * `POST /exits/presign`.
10022
+ *
10023
+ * Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
10024
+ * nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
10025
+ * the onchain wallet and exits first.
10026
+ *
10027
+ * Execute the result wave by wave: broadcast a wave's packages together
10028
+ * and wait for them, and its `in_mempool` transactions, to confirm before
10029
+ * the next. No funds are reserved, so a later onchain spend can
10030
+ * invalidate the children. The children are signed: store the result
10031
+ * securely.
10032
+ *
10033
+ * Needs the built-in onchain wallet; with callback wallets
10034
+ * (`CustomOnchainWalletCallbacks`) it fails.
10035
+ */
10036
+ presignEmergencyExit(vtxoIds: Array<string> | undefined, feeRateSatPerVb: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<PresignedExits>;
9080
10037
  progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<ExitProgressStatus>>;
9081
10038
  progressPendingRounds(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9082
10039
  properties(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<WalletProperties>;
9083
10040
  /**
9084
10041
  * Recover the given VTXO ids from the server, importing the ones this
9085
10042
  * wallet owns that are still spendable. Use it to retry ids a previous
9086
- * 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.
9087
10047
  *
9088
10048
  * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
9089
10049
  * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
@@ -9091,21 +10051,23 @@ export interface WalletLike {
9091
10051
  */
9092
10052
  recoverVtxos(vtxoIds: Array<string>, gapLimit: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RecoveryReport>;
9093
10053
  /**
9094
- * The report of the seed-recovery scan that ran during `Wallet::open`, or
9095
- * none if the scan did not complete. Use `recovery_status` to tell a scan
9096
- * 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.
9097
10056
  */
9098
10057
  recoveryReport(): RecoveryReport | undefined;
9099
10058
  /**
9100
- * 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.
9101
10062
  *
9102
- * Recovery only runs on the open that creates the wallet locally, and not
9103
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
9104
- * on every subsequent open. `Failed` means the scan errored before
9105
- * producing a report — bark logs that and lets open succeed — so funds
9106
- * may be missing until a retry; `Completed` carries the report, and
9107
- * `isComplete == false` there means funds may still be missing. Retry the
9108
- * 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.
9109
10071
  */
9110
10072
  recoveryStatus(): RecoveryStatus;
9111
10073
  refreshServer(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
@@ -9118,6 +10080,17 @@ export interface WalletLike {
9118
10080
  * so scheduling further out never costs more than refreshing now.
9119
10081
  */
9120
10082
  refreshVtxosScheduled(vtxoIds: Array<string>, scheduledHeight: number, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RoundState | undefined>;
10083
+ /**
10084
+ * List every exit transaction of the given VTXOs still awaiting
10085
+ * confirmation, so anyone can broadcast the exits on the user's behalf.
10086
+ * Mirrors bark-rest `GET /exits/remaining`.
10087
+ *
10088
+ * Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
10089
+ * nothing. Read-only: signs nothing and never touches the onchain wallet,
10090
+ * so it works with callback wallets too. Statuses of started exits reflect
10091
+ * the last `sync_exits`.
10092
+ */
10093
+ remainingExitTransactions(vtxoIds: Array<string> | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<RemainingExitTransactions>;
9121
10094
  /**
9122
10095
  * Start the background daemon. The onchain wallet used by the daemon is
9123
10096
  * the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
@@ -9161,9 +10134,12 @@ export interface WalletLike {
9161
10134
  startExitForVtxosIncludingNonStandard(vtxoIds: Array<string>, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9162
10135
  stopDaemon(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9163
10136
  /**
9164
- * Stop the background daemon and wait until its tasks have finished, so
9165
- * nothing runs in the background afterwards (e.g. before deleting the
9166
- * 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.
9167
10143
  */
9168
10144
  stopDaemonWait(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9169
10145
  /**
@@ -9181,6 +10157,14 @@ export interface WalletLike {
9181
10157
  */
9182
10158
  syncForceExitedVtxos(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;
9183
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>;
9184
10168
  tryClaimAllLightningReceives(wait: boolean, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<LightningReceive>>;
9185
10169
  tryClaimLightningReceive(paymentHash: string, wait: boolean, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<LightningReceive>;
9186
10170
  /**
@@ -9594,14 +10578,18 @@ private constructor(pointer: UniffiHandle) {
9594
10578
  }
9595
10579
  }
9596
10580
 
9597
- 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*/ {
9598
10586
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
9599
10587
  try {
9600
10588
  return await uniffiRustCallAsync(
9601
10589
  /*rustCaller:*/ uniffiCaller,
9602
10590
  /*rustFutureFunc:*/ () => {
9603
10591
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_all(
9604
- uniffiTypeWalletObjectFactory.clonePointer(this)
10592
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
9605
10593
  );
9606
10594
  },
9607
10595
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -9635,14 +10623,22 @@ private constructor(pointer: UniffiHandle) {
9635
10623
  }
9636
10624
  }
9637
10625
 
9638
- 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*/ {
9639
10635
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
9640
10636
  try {
9641
10637
  return await uniffiRustCallAsync(
9642
10638
  /*rustCaller:*/ uniffiCaller,
9643
10639
  /*rustFutureFunc:*/ () => {
9644
10640
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_amount(
9645
- 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)
9646
10642
  );
9647
10643
  },
9648
10644
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -9676,14 +10672,20 @@ private constructor(pointer: UniffiHandle) {
9676
10672
  }
9677
10673
  }
9678
10674
 
9679
- 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*/ {
9680
10682
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
9681
10683
  try {
9682
10684
  return await uniffiRustCallAsync(
9683
10685
  /*rustCaller:*/ uniffiCaller,
9684
10686
  /*rustFutureFunc:*/ () => {
9685
10687
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_funding_address(
9686
- uniffiTypeWalletObjectFactory.clonePointer(this)
10688
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalUInt32.lower(expiryHeight, nativeModule().rustbuffer_alloc)
9687
10689
  );
9688
10690
  },
9689
10691
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -9717,14 +10719,27 @@ private constructor(pointer: UniffiHandle) {
9717
10719
  }
9718
10720
  }
9719
10721
 
9720
- 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*/ {
9721
10736
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
9722
10737
  try {
9723
10738
  return await uniffiRustCallAsync(
9724
10739
  /*rustCaller:*/ uniffiCaller,
9725
10740
  /*rustFutureFunc:*/ () => {
9726
10741
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_psbt(
9727
- 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)
9728
10743
  );
9729
10744
  },
9730
10745
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -9758,14 +10773,21 @@ private constructor(pointer: UniffiHandle) {
9758
10773
  }
9759
10774
  }
9760
10775
 
9761
- async bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
10776
+ /**
10777
+ * Create an invoice for an incoming lightning payment.
10778
+ *
10779
+ * `expiry_secs` is how long the invoice can be paid for. It defaults to,
10780
+ * and cannot exceed, the Ark server's invoice expiry; creating the invoice
10781
+ * fails if the server does not honour it. Must be at least 1.
10782
+ */
10783
+ async bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined = undefined, expirySecs: bigint | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
9762
10784
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
9763
10785
  try {
9764
10786
  return await uniffiRustCallAsync(
9765
10787
  /*rustCaller:*/ uniffiCaller,
9766
10788
  /*rustFutureFunc:*/ () => {
9767
10789
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice(
9768
- uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc)
10790
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(expirySecs, nativeModule().rustbuffer_alloc)
9769
10791
  );
9770
10792
  },
9771
10793
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -9814,15 +10836,17 @@ private constructor(pointer: UniffiHandle) {
9814
10836
  *
9815
10837
  * A `claim_destination` owned by this wallet is claimed locally instead of
9816
10838
  * going through its mailbox.
10839
+ *
10840
+ * `expiry_secs` works as in [`Self::bolt11_invoice`].
9817
10841
  */
9818
- async bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined = undefined, token: string | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
10842
+ async bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined = undefined, token: string | undefined = undefined, expirySecs: bigint | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<LightningInvoice> /*throws*/ {
9819
10843
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
9820
10844
  try {
9821
10845
  return await uniffiRustCallAsync(
9822
10846
  /*rustCaller:*/ uniffiCaller,
9823
10847
  /*rustFutureFunc:*/ () => {
9824
10848
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice_for_address(
9825
- uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterString.lower(claimDestination, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc)
10849
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterUInt64.lower(amountSats, nativeModule().rustbuffer_alloc),FfiConverterString.lower(claimDestination, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(description, nativeModule().rustbuffer_alloc),FfiConverterOptionalString.lower(token, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(expirySecs, nativeModule().rustbuffer_alloc)
9826
10850
  );
9827
10851
  },
9828
10852
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
@@ -11211,6 +12235,56 @@ private constructor(pointer: UniffiHandle) {
11211
12235
  }
11212
12236
  }
11213
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
+
11214
12288
  /**
11215
12289
  * Triage a payment hash: settled or in-progress. Errors if no lightning
11216
12290
  * receive is known for this payment hash.
@@ -12406,6 +13480,56 @@ private constructor(pointer: UniffiHandle) {
12406
13480
  }
12407
13481
  }
12408
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
+
12409
13533
  async pendingRoundInputVtxos(asyncOpts_?: { signal: AbortSignal }): Promise<Array<Vtxo>> /*throws*/ {
12410
13534
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
12411
13535
  try {
@@ -12488,6 +13612,66 @@ private constructor(pointer: UniffiHandle) {
12488
13612
  }
12489
13613
  }
12490
13614
 
13615
+ /**
13616
+ * Sign, without broadcasting, the CPFP child of every exit transaction
13617
+ * that still needs broadcasting to emergency-exit the given VTXOs, for as
13618
+ * long as confirmed onchain funds last. Mirrors bark-rest
13619
+ * `POST /exits/presign`.
13620
+ *
13621
+ * Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
13622
+ * nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
13623
+ * the onchain wallet and exits first.
13624
+ *
13625
+ * Execute the result wave by wave: broadcast a wave's packages together
13626
+ * and wait for them, and its `in_mempool` transactions, to confirm before
13627
+ * the next. No funds are reserved, so a later onchain spend can
13628
+ * invalidate the children. The children are signed: store the result
13629
+ * securely.
13630
+ *
13631
+ * Needs the built-in onchain wallet; with callback wallets
13632
+ * (`CustomOnchainWalletCallbacks`) it fails.
13633
+ */
13634
+ async presignEmergencyExit(vtxoIds: Array<string> | undefined = undefined, feeRateSatPerVb: bigint | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<PresignedExits> /*throws*/ {
13635
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
13636
+ try {
13637
+ return await uniffiRustCallAsync(
13638
+ /*rustCaller:*/ uniffiCaller,
13639
+ /*rustFutureFunc:*/ () => {
13640
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_presign_emergency_exit(
13641
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalSequenceString.lower(vtxoIds, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(feeRateSatPerVb, nativeModule().rustbuffer_alloc)
13642
+ );
13643
+ },
13644
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
13645
+ /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
13646
+ /*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
13647
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
13648
+ // Async returns always go through the JS-side converter: the
13649
+ // FFI symbol returns the future handle (u64), and the user-level
13650
+ // RustBuffer comes back via the shared `rust_future_complete_*`
13651
+ // export. The bytes the runtime hands back must be deserialized
13652
+ // here using the per-callable return-type converter.
13653
+ // Borrowed view over foreign memory: the call site owns the free,
13654
+ // as on the sync paths. Unconditional — a no-op where buffers are
13655
+ // already JS-owned.
13656
+ /*liftFunc:*/ (__rb) => {
13657
+ try {
13658
+ return FfiConverterTypePresignedExits.lift(__rb);
13659
+ } finally {
13660
+ nativeModule().rustbuffer_free(__rb);
13661
+ }
13662
+ },
13663
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
13664
+ /*asyncOpts:*/ asyncOpts_,
13665
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
13666
+ );
13667
+ } catch (__error: any) {
13668
+ if (uniffiIsDebug && __error instanceof Error) {
13669
+ __error.stack = __stack;
13670
+ }
13671
+ throw __error;
13672
+ }
13673
+ }
13674
+
12491
13675
  async progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: { signal: AbortSignal }): Promise<Array<ExitProgressStatus>> /*throws*/ {
12492
13676
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
12493
13677
  try {
@@ -12600,7 +13784,10 @@ private constructor(pointer: UniffiHandle) {
12600
13784
  /**
12601
13785
  * Recover the given VTXO ids from the server, importing the ones this
12602
13786
  * wallet owns that are still spendable. Use it to retry ids a previous
12603
- * 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.
12604
13791
  *
12605
13792
  * `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
12606
13793
  * decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
@@ -12648,9 +13835,8 @@ private constructor(pointer: UniffiHandle) {
12648
13835
  }
12649
13836
 
12650
13837
  /**
12651
- * The report of the seed-recovery scan that ran during `Wallet::open`, or
12652
- * none if the scan did not complete. Use `recovery_status` to tell a scan
12653
- * 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.
12654
13840
  */
12655
13841
  recoveryReport(): RecoveryReport | undefined {
12656
13842
  const __rb: Uint8Array = uniffiCaller.rustCall(
@@ -12669,15 +13855,18 @@ private constructor(pointer: UniffiHandle) {
12669
13855
  }
12670
13856
 
12671
13857
  /**
12672
- * 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.
12673
13861
  *
12674
- * Recovery only runs on the open that creates the wallet locally, and not
12675
- * at all when `WalletOpenArgs.skip_recovery` is set, so this is `NotRun`
12676
- * on every subsequent open. `Failed` means the scan errored before
12677
- * producing a report — bark logs that and lets open succeed — so funds
12678
- * may be missing until a retry; `Completed` carries the report, and
12679
- * `isComplete == false` there means funds may still be missing. Retry the
12680
- * 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.
12681
13870
  */
12682
13871
  recoveryStatus(): RecoveryStatus {
12683
13872
  const __rb: Uint8Array = uniffiCaller.rustCall(
@@ -12851,6 +14040,57 @@ private constructor(pointer: UniffiHandle) {
12851
14040
  }
12852
14041
  }
12853
14042
 
14043
+ /**
14044
+ * List every exit transaction of the given VTXOs still awaiting
14045
+ * confirmation, so anyone can broadcast the exits on the user's behalf.
14046
+ * Mirrors bark-rest `GET /exits/remaining`.
14047
+ *
14048
+ * Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
14049
+ * nothing. Read-only: signs nothing and never touches the onchain wallet,
14050
+ * so it works with callback wallets too. Statuses of started exits reflect
14051
+ * the last `sync_exits`.
14052
+ */
14053
+ async remainingExitTransactions(vtxoIds: Array<string> | undefined = undefined, asyncOpts_?: { signal: AbortSignal }): Promise<RemainingExitTransactions> /*throws*/ {
14054
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
14055
+ try {
14056
+ return await uniffiRustCallAsync(
14057
+ /*rustCaller:*/ uniffiCaller,
14058
+ /*rustFutureFunc:*/ () => {
14059
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_remaining_exit_transactions(
14060
+ uniffiTypeWalletObjectFactory.clonePointer(this),FfiConverterOptionalSequenceString.lower(vtxoIds, nativeModule().rustbuffer_alloc)
14061
+ );
14062
+ },
14063
+ /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
14064
+ /*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
14065
+ /*completeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
14066
+ /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
14067
+ // Async returns always go through the JS-side converter: the
14068
+ // FFI symbol returns the future handle (u64), and the user-level
14069
+ // RustBuffer comes back via the shared `rust_future_complete_*`
14070
+ // export. The bytes the runtime hands back must be deserialized
14071
+ // here using the per-callable return-type converter.
14072
+ // Borrowed view over foreign memory: the call site owns the free,
14073
+ // as on the sync paths. Unconditional — a no-op where buffers are
14074
+ // already JS-owned.
14075
+ /*liftFunc:*/ (__rb) => {
14076
+ try {
14077
+ return FfiConverterTypeRemainingExitTransactions.lift(__rb);
14078
+ } finally {
14079
+ nativeModule().rustbuffer_free(__rb);
14080
+ }
14081
+ },
14082
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
14083
+ /*asyncOpts:*/ asyncOpts_,
14084
+ /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
14085
+ );
14086
+ } catch (__error: any) {
14087
+ if (uniffiIsDebug && __error instanceof Error) {
14088
+ __error.stack = __stack;
14089
+ }
14090
+ throw __error;
14091
+ }
14092
+ }
14093
+
12854
14094
  /**
12855
14095
  * Start the background daemon. The onchain wallet used by the daemon is
12856
14096
  * the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
@@ -13215,9 +14455,12 @@ private constructor(pointer: UniffiHandle) {
13215
14455
  }
13216
14456
 
13217
14457
  /**
13218
- * Stop the background daemon and wait until its tasks have finished, so
13219
- * nothing runs in the background afterwards (e.g. before deleting the
13220
- * 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.
13221
14464
  */
13222
14465
  async stopDaemonWait(asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {
13223
14466
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -13405,6 +14648,40 @@ private constructor(pointer: UniffiHandle) {
13405
14648
  }
13406
14649
  }
13407
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
+
13408
14685
  async tryClaimAllLightningReceives(wait: boolean = false, asyncOpts_?: { signal: AbortSignal }): Promise<Array<LightningReceive>> /*throws*/ {
13409
14686
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
13410
14687
  try {
@@ -13780,6 +15057,21 @@ const FfiConverterSequenceTypeAvailablePaymentMethod = new FfiConverterArray(Ffi
13780
15057
  // FfiConverter for AvailablePaymentMethod | undefined
13781
15058
  const FfiConverterOptionalTypeAvailablePaymentMethod = new FfiConverterOptional(FfiConverterTypeAvailablePaymentMethod);
13782
15059
 
15060
+ // FfiConverter for Array<ExitTransactionInfo>
15061
+ const FfiConverterSequenceTypeExitTransactionInfo = new FfiConverterArray(FfiConverterTypeExitTransactionInfo);
15062
+
15063
+ // FfiConverter for Array<PresignedExit>
15064
+ const FfiConverterSequenceTypePresignedExit = new FfiConverterArray(FfiConverterTypePresignedExit);
15065
+
15066
+ // FfiConverter for Array<PresignedExitPackage>
15067
+ const FfiConverterSequenceTypePresignedExitPackage = new FfiConverterArray(FfiConverterTypePresignedExitPackage);
15068
+
15069
+ // FfiConverter for Array<PresignedWave>
15070
+ const FfiConverterSequenceTypePresignedWave = new FfiConverterArray(FfiConverterTypePresignedWave);
15071
+
15072
+ // FfiConverter for Array<RemainingExit>
15073
+ const FfiConverterSequenceTypeRemainingExit = new FfiConverterArray(FfiConverterTypeRemainingExit);
15074
+
13783
15075
  // FfiConverter for VtxoLockHolder | undefined
13784
15076
  const FfiConverterOptionalTypeVtxoLockHolder = new FfiConverterOptional(FfiConverterTypeVtxoLockHolder);
13785
15077
 
@@ -13831,15 +15123,18 @@ const FfiConverterSequenceTypeLightningReceive = new FfiConverterArray(FfiConver
13831
15123
  // FfiConverter for Array<LightningSend>
13832
15124
  const FfiConverterSequenceTypeLightningSend = new FfiConverterArray(FfiConverterTypeLightningSend);
13833
15125
 
15126
+ // FfiConverter for RecoveryReport | undefined
15127
+ const FfiConverterOptionalTypeRecoveryReport = new FfiConverterOptional(FfiConverterTypeRecoveryReport);
15128
+
13834
15129
  // FfiConverter for Array<RoundState>
13835
15130
  const FfiConverterSequenceTypeRoundState = new FfiConverterArray(FfiConverterTypeRoundState);
13836
15131
 
15132
+ // FfiConverter for Array<string> | undefined
15133
+ const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
15134
+
13837
15135
  // FfiConverter for Array<ExitProgressStatus>
13838
15136
  const FfiConverterSequenceTypeExitProgressStatus = new FfiConverterArray(FfiConverterTypeExitProgressStatus);
13839
15137
 
13840
- // FfiConverter for RecoveryReport | undefined
13841
- const FfiConverterOptionalTypeRecoveryReport = new FfiConverterOptional(FfiConverterTypeRecoveryReport);
13842
-
13843
15138
  // FfiConverter for RoundState | undefined
13844
15139
  const FfiConverterOptionalTypeRoundState = new FfiConverterOptional(FfiConverterTypeRoundState);
13845
15140
 
@@ -13880,7 +15175,7 @@ function uniffiEnsureInitialized() {
13880
15175
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_generate_mnemonic() !== 65033) {
13881
15176
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_generate_mnemonic");
13882
15177
  }
13883
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_init_wallet() !== 41495) {
15178
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_init_wallet() !== 2602) {
13884
15179
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_init_wallet");
13885
15180
  }
13886
15181
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_max_vtxo_key_gap_limit() !== 15808) {
@@ -13898,7 +15193,7 @@ function uniffiEnsureInitialized() {
13898
15193
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_mnemonic() !== 33507) {
13899
15194
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_validate_mnemonic");
13900
15195
  }
13901
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_wallet_exists() !== 32702) {
15196
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_wallet_exists() !== 29370) {
13902
15197
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_wallet_exists");
13903
15198
  }
13904
15199
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_barklogger_log() !== 3468) {
@@ -13925,7 +15220,7 @@ function uniffiEnsureInitialized() {
13925
15220
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx() !== 36298) {
13926
15221
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_evict_tx");
13927
15222
  }
13928
- 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) {
13929
15224
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp");
13930
15225
  }
13931
15226
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !== 64815) {
@@ -13943,7 +15238,7 @@ function uniffiEnsureInitialized() {
13943
15238
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_custom() !== 33645) {
13944
15239
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_onchainwallet_custom");
13945
15240
  }
13946
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_default() !== 61714) {
15241
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_default() !== 23070) {
13947
15242
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_onchainwallet_default");
13948
15243
  }
13949
15244
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_balance() !== 39213) {
@@ -14003,22 +15298,22 @@ function uniffiEnsureInitialized() {
14003
15298
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bip321_uri() !== 64697) {
14004
15299
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bip321_uri");
14005
15300
  }
14006
- 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) {
14007
15302
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_all");
14008
15303
  }
14009
- 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) {
14010
15305
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_amount");
14011
15306
  }
14012
- 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) {
14013
15308
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_funding_address");
14014
15309
  }
14015
- 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) {
14016
15311
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_psbt");
14017
15312
  }
14018
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 54959) {
15313
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 32731) {
14019
15314
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice");
14020
15315
  }
14021
- if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice_for_address() !== 56368) {
15316
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice_for_address() !== 25554) {
14022
15317
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice_for_address");
14023
15318
  }
14024
15319
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_broadcast_tx() !== 46367) {
@@ -14123,6 +15418,9 @@ function uniffiEnsureInitialized() {
14123
15418
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid() !== 5699) {
14124
15419
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_is_invoice_paid");
14125
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
+ }
14126
15424
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state() !== 27834) {
14127
15425
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state");
14128
15426
  }
@@ -14216,12 +15514,18 @@ function uniffiEnsureInitialized() {
14216
15514
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends() !== 8847) {
14217
15515
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends");
14218
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
+ }
14219
15520
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_input_vtxos() !== 54307) {
14220
15521
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_round_input_vtxos");
14221
15522
  }
14222
15523
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_states() !== 11480) {
14223
15524
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_round_states");
14224
15525
  }
15526
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_presign_emergency_exit() !== 32185) {
15527
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_presign_emergency_exit");
15528
+ }
14225
15529
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_exits() !== 6255) {
14226
15530
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_progress_exits");
14227
15531
  }
@@ -14231,13 +15535,13 @@ function uniffiEnsureInitialized() {
14231
15535
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_properties() !== 9773) {
14232
15536
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_properties");
14233
15537
  }
14234
- 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) {
14235
15539
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recover_vtxos");
14236
15540
  }
14237
- 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) {
14238
15542
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recovery_report");
14239
15543
  }
14240
- 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) {
14241
15545
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_recovery_status");
14242
15546
  }
14243
15547
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !== 41162) {
@@ -14252,6 +15556,9 @@ function uniffiEnsureInitialized() {
14252
15556
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_scheduled() !== 50488) {
14253
15557
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos_scheduled");
14254
15558
  }
15559
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_remaining_exit_transactions() !== 44959) {
15560
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_remaining_exit_transactions");
15561
+ }
14255
15562
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_run_daemon() !== 9520) {
14256
15563
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_run_daemon");
14257
15564
  }
@@ -14282,7 +15589,7 @@ function uniffiEnsureInitialized() {
14282
15589
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stop_daemon() !== 7109) {
14283
15590
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon");
14284
15591
  }
14285
- 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) {
14286
15593
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_stop_daemon_wait");
14287
15594
  }
14288
15595
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_stuck_failed_lightning_sends() !== 31613) {
@@ -14300,6 +15607,9 @@ function uniffiEnsureInitialized() {
14300
15607
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards() !== 63453) {
14301
15608
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards");
14302
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
+ }
14303
15613
  if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives() !== 14560) {
14304
15614
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives");
14305
15615
  }
@@ -14350,9 +15660,11 @@ export default Object.freeze({
14350
15660
  FfiConverterTypeExitCancelResult,
14351
15661
  FfiConverterTypeExitChildTransaction,
14352
15662
  FfiConverterTypeExitClaimTransaction,
15663
+ FfiConverterTypeExitFeeInfo,
14353
15664
  FfiConverterTypeExitProgressStatus,
14354
15665
  FfiConverterTypeExitState,
14355
15666
  FfiConverterTypeExitStateKind,
15667
+ FfiConverterTypeExitTransactionInfo,
14356
15668
  FfiConverterTypeExitTransactionPackage,
14357
15669
  FfiConverterTypeExitTransactionStatus,
14358
15670
  FfiConverterTypeExitTx,
@@ -14385,10 +15697,18 @@ export default Object.freeze({
14385
15697
  FfiConverterTypePaymentResult,
14386
15698
  FfiConverterTypePendingBoard,
14387
15699
  FfiConverterTypePpmExpiryFeeEntry,
15700
+ FfiConverterTypePresignedExit,
15701
+ FfiConverterTypePresignedExitChild,
15702
+ FfiConverterTypePresignedExitPackage,
15703
+ FfiConverterTypePresignedExitStatus,
15704
+ FfiConverterTypePresignedExits,
15705
+ FfiConverterTypePresignedWave,
14388
15706
  FfiConverterTypeRecoveryBucket,
14389
15707
  FfiConverterTypeRecoveryReport,
14390
15708
  FfiConverterTypeRecoveryStatus,
14391
15709
  FfiConverterTypeRefreshFees,
15710
+ FfiConverterTypeRemainingExit,
15711
+ FfiConverterTypeRemainingExitTransactions,
14392
15712
  FfiConverterTypeRoundFlowKind,
14393
15713
  FfiConverterTypeRoundState,
14394
15714
  FfiConverterTypeVtxo,