@secondts/bark-react-native 0.25.0 → 0.26.1

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.
Files changed (52) hide show
  1. package/README.md +4 -12
  2. package/android/CMakeLists.txt +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/proguard-rules.pro +16 -0
  5. package/app.plugin.js +5 -1
  6. package/cpp/generated/bark.cpp +519 -31
  7. package/cpp/generated/bark.hpp +28 -2
  8. package/lib/commonjs/WalletNotifications.js +7 -2
  9. package/lib/commonjs/WalletNotifications.js.map +1 -1
  10. package/lib/commonjs/generated/bark-ffi.js.map +1 -1
  11. package/lib/commonjs/generated/bark.js +948 -573
  12. package/lib/commonjs/generated/bark.js.map +1 -1
  13. package/lib/module/WalletNotifications.js +7 -2
  14. package/lib/module/WalletNotifications.js.map +1 -1
  15. package/lib/module/generated/bark-ffi.js.map +1 -1
  16. package/lib/module/generated/bark.js +948 -573
  17. package/lib/module/generated/bark.js.map +1 -1
  18. package/lib/typescript/commonjs/src/WalletNotifications.d.ts.map +1 -1
  19. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +35 -9
  20. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
  21. package/lib/typescript/commonjs/src/generated/bark.d.ts +1595 -168
  22. package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
  23. package/lib/typescript/module/src/WalletNotifications.d.ts.map +1 -1
  24. package/lib/typescript/module/src/generated/bark-ffi.d.ts +35 -9
  25. package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
  26. package/lib/typescript/module/src/generated/bark.d.ts +1595 -168
  27. package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
  28. package/package.json +5 -10
  29. package/scripts/postinstall.js +127 -40
  30. package/src/WalletNotifications.ts +7 -2
  31. package/src/generated/bark-ffi.ts +397 -950
  32. package/src/generated/bark.ts +13380 -13461
  33. package/lib/typescript/commonjs/plugin/src/index.d.ts +0 -11
  34. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +0 -1
  35. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +0 -6
  36. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +0 -1
  37. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +0 -7
  38. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +0 -1
  39. package/lib/typescript/module/plugin/src/index.d.ts +0 -11
  40. package/lib/typescript/module/plugin/src/index.d.ts.map +0 -1
  41. package/lib/typescript/module/plugin/src/withAndroid.d.ts +0 -6
  42. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +0 -1
  43. package/lib/typescript/module/plugin/src/withIOS.d.ts +0 -7
  44. package/lib/typescript/module/plugin/src/withIOS.d.ts.map +0 -1
  45. package/plugin/build/index.d.ts +0 -10
  46. package/plugin/build/index.js +0 -16
  47. package/plugin/build/withAndroid.d.ts +0 -5
  48. package/plugin/build/withAndroid.js +0 -26
  49. package/plugin/build/withIOS.d.ts +0 -6
  50. package/plugin/build/withIOS.js +0 -13
  51. package/plugin/tsconfig.json +0 -9
  52. package/plugin/tsconfig.tsbuildinfo +0 -1
@@ -1,5 +1,20 @@
1
1
  /// <reference types="node" />
2
2
  import { type UniffiGcObject, type UniffiHandle, Cursor, FfiConverterObject, FfiConverterObjectWithCallbacks, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol, variantOrdinalSymbol } from "@ubjs/core";
3
+ /**
4
+ * Turn logging off and detach the current logger, which is never released.
5
+ *
6
+ * React Native calls this when its JS runtime starts, so a logger left by a
7
+ * runtime that was reloaded is never called.
8
+ */
9
+ export declare function clearLogger(): void;
10
+ /**
11
+ * Decode a BOLT11 invoice, for example to show its amount, description,
12
+ * payee and expiry before paying it.
13
+ *
14
+ * Only decodes: it does not check the invoice's network or whether it has
15
+ * expired. `Wallet::parse_payment_request` checks the network.
16
+ */
17
+ export declare function decodeBolt11Invoice(invoice: string): Bolt11InvoiceDetails;
3
18
  /**
4
19
  * Default for `Config.vtxo_key_gap_limit`: the run of consecutive unused
5
20
  * seed-derived VTXO key indices a scan crosses before concluding a VTXO
@@ -40,10 +55,22 @@ export declare function initWallet(network: Network, mnemonicOrSeed: string, con
40
55
  */
41
56
  export declare function maxVtxoKeyGapLimit(): number;
42
57
  /**
43
- * Install the foreign logger.
58
+ * Network and seed fingerprint of the wallet in `datadir`, or `None` when no
59
+ * wallet is initialized there. Same side-effect guarantees as
60
+ * [`wallet_exists`].
44
61
  *
45
- * On first call, installs the bridge with `log::set_logger`. Subsequent calls
46
- * will return an error.
62
+ * Not named `datadir_info`: the Go bindings would export it as `DatadirInfo`,
63
+ * which collides with the record of the same name.
64
+ */
65
+ export declare function readDatadirInfo(datadir: string): DatadirInfo | undefined;
66
+ /**
67
+ * Send bark's log records at or above `max_level` to `logger`.
68
+ *
69
+ * Calling this again replaces the current logger and level. The replaced
70
+ * logger is never released. `clear_logger` turns logging off.
71
+ *
72
+ * Errors if another logger for Rust's `log` crate was installed in this
73
+ * process before the first call.
47
74
  */
48
75
  export declare function setLogger(logger: BarkLogger, maxLevel: LogLevel): void;
49
76
  /**
@@ -58,6 +85,17 @@ export declare function validateArkAddress(address: string): boolean;
58
85
  * Validate a BIP39 mnemonic phrase
59
86
  */
60
87
  export declare function validateMnemonic(mnemonic: string): boolean;
88
+ /**
89
+ * Whether `datadir` holds an initialized bark wallet.
90
+ *
91
+ * Answers without side effects: the database is opened read-only, no
92
+ * migration runs and no file or directory is created. Returns `false` for a
93
+ * missing or empty directory and for a database that never got its wallet
94
+ * properties (for example after a crash during creation). Returns an error
95
+ * when a database exists but cannot be read, so a corrupt wallet is never
96
+ * mistaken for an absent one.
97
+ */
98
+ export declare function walletExists(datadir: string): boolean;
61
99
  export type AddressWithIndex = {
62
100
  address: string;
63
101
  index: number;
@@ -170,97 +208,793 @@ export declare const LightningReceiveFees: Readonly<{
170
208
  defaults: () => Partial<LightningReceiveFees>;
171
209
  }>;
172
210
  /**
173
- * Fees for sending over lightning.
211
+ * Fees for sending over lightning.
212
+ */
213
+ export type LightningSendFees = {
214
+ minFeeSats: bigint;
215
+ baseFeeSats: bigint;
216
+ ppmExpiryTable: Array<PpmExpiryFeeEntry>;
217
+ };
218
+ /**
219
+ * Generated factory for {@link LightningSendFees} record objects.
220
+ */
221
+ export declare const LightningSendFees: Readonly<{
222
+ create: (partial: Partial<LightningSendFees> & Required<Omit<LightningSendFees, never>>) => LightningSendFees;
223
+ new: (partial: Partial<LightningSendFees> & Required<Omit<LightningSendFees, never>>) => LightningSendFees;
224
+ defaults: () => Partial<LightningSendFees>;
225
+ }>;
226
+ /**
227
+ * The Ark server's complete fee schedule, mirroring `ark::fees::FeeSchedule`.
228
+ */
229
+ export type FeeSchedule = {
230
+ board: BoardFees;
231
+ offboard: OffboardFees;
232
+ refresh: RefreshFees;
233
+ lightningReceive: LightningReceiveFees;
234
+ lightningSend: LightningSendFees;
235
+ };
236
+ /**
237
+ * Generated factory for {@link FeeSchedule} record objects.
238
+ */
239
+ export declare const FeeSchedule: Readonly<{
240
+ create: (partial: Partial<FeeSchedule> & Required<Omit<FeeSchedule, never>>) => FeeSchedule;
241
+ new: (partial: Partial<FeeSchedule> & Required<Omit<FeeSchedule, never>>) => FeeSchedule;
242
+ defaults: () => Partial<FeeSchedule>;
243
+ }>;
244
+ export type ArkInfo = {
245
+ network: Network;
246
+ serverPubkey: string;
247
+ roundIntervalSecs: bigint;
248
+ nbRoundNonces: number;
249
+ vtxoExitDelta: number;
250
+ /**
251
+ * The number of blocks a VTXO lives before it expires.
252
+ */
253
+ vtxoLifetime: number;
254
+ /**
255
+ * The number of blocks a VTXO lives before it expires.
256
+ *
257
+ * Deprecated: upstream renamed this to `vtxo_lifetime`. Both names are
258
+ * exposed and carry the same value; migrate to `vtxo_lifetime`, this one
259
+ * goes away once upstream drops it.
260
+ */
261
+ vtxoExpiryDelta: number;
262
+ htlcSendExpiryDelta: number;
263
+ htlcExpiryDelta: number;
264
+ maxVtxoAmountSats?: bigint;
265
+ requiredBoardConfirmations: number;
266
+ maxUserInvoiceCltvDelta: number;
267
+ minBoardAmountSats: bigint;
268
+ lnReceiveAntiDosRequired: boolean;
269
+ /**
270
+ * The server's fee schedule (board, offboard, refresh, lightning fees).
271
+ */
272
+ feeSchedule: FeeSchedule;
273
+ /**
274
+ * Maximum exit depth (genesis chain length) allowed for a VTXO before the
275
+ * server refuses to cosign further OOR transactions spending it.
276
+ */
277
+ maxVtxoExitDepth: number;
278
+ };
279
+ /**
280
+ * Generated factory for {@link ArkInfo} record objects.
281
+ */
282
+ export declare const ArkInfo: Readonly<{
283
+ create: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
284
+ new: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
285
+ defaults: () => Partial<ArkInfo>;
286
+ }>;
287
+ export declare enum PaymentMethod_Tags {
288
+ Ark = "Ark",
289
+ Bitcoin = "Bitcoin",
290
+ OutputScript = "OutputScript",
291
+ Invoice = "Invoice",
292
+ Offer = "Offer",
293
+ LightningAddress = "LightningAddress",
294
+ Lnurl = "Lnurl",
295
+ Custom = "Custom"
296
+ }
297
+ /**
298
+ * A payment destination, mirroring `bark::movement::PaymentMethod`.
299
+ *
300
+ * Each variant carries the destination as a string. `type` and `value`
301
+ * match upstream's JSON encoding (`{"type":"ark","value":"tark1…"}`), which
302
+ * is what `Movement.sent_to_addresses` and `Movement.received_on_addresses`
303
+ * hold and what `Wallet::history_by_payment_method` takes.
304
+ */
305
+ export declare const PaymentMethod: Readonly<{
306
+ instanceOf: (obj: any) => obj is PaymentMethod;
307
+ Ark: {
308
+ new (inner: {
309
+ value: string;
310
+ }): {
311
+ readonly tag: PaymentMethod_Tags.Ark;
312
+ readonly inner: Readonly<{
313
+ value: string;
314
+ }>;
315
+ /**
316
+ * @private
317
+ * This field is private and should not be used, use `tag` instead.
318
+ */
319
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
320
+ };
321
+ new(inner: {
322
+ value: string;
323
+ }): {
324
+ readonly tag: PaymentMethod_Tags.Ark;
325
+ readonly inner: Readonly<{
326
+ value: string;
327
+ }>;
328
+ /**
329
+ * @private
330
+ * This field is private and should not be used, use `tag` instead.
331
+ */
332
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
333
+ };
334
+ instanceOf(obj: any): obj is {
335
+ readonly tag: PaymentMethod_Tags.Ark;
336
+ readonly inner: Readonly<{
337
+ value: string;
338
+ }>;
339
+ /**
340
+ * @private
341
+ * This field is private and should not be used, use `tag` instead.
342
+ */
343
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
344
+ };
345
+ };
346
+ Bitcoin: {
347
+ new (inner: {
348
+ value: string;
349
+ }): {
350
+ readonly tag: PaymentMethod_Tags.Bitcoin;
351
+ readonly inner: Readonly<{
352
+ value: string;
353
+ }>;
354
+ /**
355
+ * @private
356
+ * This field is private and should not be used, use `tag` instead.
357
+ */
358
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
359
+ };
360
+ new(inner: {
361
+ value: string;
362
+ }): {
363
+ readonly tag: PaymentMethod_Tags.Bitcoin;
364
+ readonly inner: Readonly<{
365
+ value: string;
366
+ }>;
367
+ /**
368
+ * @private
369
+ * This field is private and should not be used, use `tag` instead.
370
+ */
371
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
372
+ };
373
+ instanceOf(obj: any): obj is {
374
+ readonly tag: PaymentMethod_Tags.Bitcoin;
375
+ readonly inner: Readonly<{
376
+ value: string;
377
+ }>;
378
+ /**
379
+ * @private
380
+ * This field is private and should not be used, use `tag` instead.
381
+ */
382
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
383
+ };
384
+ };
385
+ OutputScript: {
386
+ new (inner: {
387
+ value: string;
388
+ }): {
389
+ readonly tag: PaymentMethod_Tags.OutputScript;
390
+ readonly inner: Readonly<{
391
+ value: string;
392
+ }>;
393
+ /**
394
+ * @private
395
+ * This field is private and should not be used, use `tag` instead.
396
+ */
397
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
398
+ };
399
+ new(inner: {
400
+ value: string;
401
+ }): {
402
+ readonly tag: PaymentMethod_Tags.OutputScript;
403
+ readonly inner: Readonly<{
404
+ value: string;
405
+ }>;
406
+ /**
407
+ * @private
408
+ * This field is private and should not be used, use `tag` instead.
409
+ */
410
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
411
+ };
412
+ instanceOf(obj: any): obj is {
413
+ readonly tag: PaymentMethod_Tags.OutputScript;
414
+ readonly inner: Readonly<{
415
+ value: string;
416
+ }>;
417
+ /**
418
+ * @private
419
+ * This field is private and should not be used, use `tag` instead.
420
+ */
421
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
422
+ };
423
+ };
424
+ Invoice: {
425
+ new (inner: {
426
+ value: string;
427
+ }): {
428
+ readonly tag: PaymentMethod_Tags.Invoice;
429
+ readonly inner: Readonly<{
430
+ value: string;
431
+ }>;
432
+ /**
433
+ * @private
434
+ * This field is private and should not be used, use `tag` instead.
435
+ */
436
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
437
+ };
438
+ new(inner: {
439
+ value: string;
440
+ }): {
441
+ readonly tag: PaymentMethod_Tags.Invoice;
442
+ readonly inner: Readonly<{
443
+ value: string;
444
+ }>;
445
+ /**
446
+ * @private
447
+ * This field is private and should not be used, use `tag` instead.
448
+ */
449
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
450
+ };
451
+ instanceOf(obj: any): obj is {
452
+ readonly tag: PaymentMethod_Tags.Invoice;
453
+ readonly inner: Readonly<{
454
+ value: string;
455
+ }>;
456
+ /**
457
+ * @private
458
+ * This field is private and should not be used, use `tag` instead.
459
+ */
460
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
461
+ };
462
+ };
463
+ Offer: {
464
+ new (inner: {
465
+ value: string;
466
+ }): {
467
+ readonly tag: PaymentMethod_Tags.Offer;
468
+ readonly inner: Readonly<{
469
+ value: string;
470
+ }>;
471
+ /**
472
+ * @private
473
+ * This field is private and should not be used, use `tag` instead.
474
+ */
475
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
476
+ };
477
+ new(inner: {
478
+ value: string;
479
+ }): {
480
+ readonly tag: PaymentMethod_Tags.Offer;
481
+ readonly inner: Readonly<{
482
+ value: string;
483
+ }>;
484
+ /**
485
+ * @private
486
+ * This field is private and should not be used, use `tag` instead.
487
+ */
488
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
489
+ };
490
+ instanceOf(obj: any): obj is {
491
+ readonly tag: PaymentMethod_Tags.Offer;
492
+ readonly inner: Readonly<{
493
+ value: string;
494
+ }>;
495
+ /**
496
+ * @private
497
+ * This field is private and should not be used, use `tag` instead.
498
+ */
499
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
500
+ };
501
+ };
502
+ LightningAddress: {
503
+ new (inner: {
504
+ value: string;
505
+ }): {
506
+ readonly tag: PaymentMethod_Tags.LightningAddress;
507
+ readonly inner: Readonly<{
508
+ value: string;
509
+ }>;
510
+ /**
511
+ * @private
512
+ * This field is private and should not be used, use `tag` instead.
513
+ */
514
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
515
+ };
516
+ new(inner: {
517
+ value: string;
518
+ }): {
519
+ readonly tag: PaymentMethod_Tags.LightningAddress;
520
+ readonly inner: Readonly<{
521
+ value: string;
522
+ }>;
523
+ /**
524
+ * @private
525
+ * This field is private and should not be used, use `tag` instead.
526
+ */
527
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
528
+ };
529
+ instanceOf(obj: any): obj is {
530
+ readonly tag: PaymentMethod_Tags.LightningAddress;
531
+ readonly inner: Readonly<{
532
+ value: string;
533
+ }>;
534
+ /**
535
+ * @private
536
+ * This field is private and should not be used, use `tag` instead.
537
+ */
538
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
539
+ };
540
+ };
541
+ Lnurl: {
542
+ new (inner: {
543
+ value: string;
544
+ }): {
545
+ readonly tag: PaymentMethod_Tags.Lnurl;
546
+ readonly inner: Readonly<{
547
+ value: string;
548
+ }>;
549
+ /**
550
+ * @private
551
+ * This field is private and should not be used, use `tag` instead.
552
+ */
553
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
554
+ };
555
+ new(inner: {
556
+ value: string;
557
+ }): {
558
+ readonly tag: PaymentMethod_Tags.Lnurl;
559
+ readonly inner: Readonly<{
560
+ value: string;
561
+ }>;
562
+ /**
563
+ * @private
564
+ * This field is private and should not be used, use `tag` instead.
565
+ */
566
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
567
+ };
568
+ instanceOf(obj: any): obj is {
569
+ readonly tag: PaymentMethod_Tags.Lnurl;
570
+ readonly inner: Readonly<{
571
+ value: string;
572
+ }>;
573
+ /**
574
+ * @private
575
+ * This field is private and should not be used, use `tag` instead.
576
+ */
577
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
578
+ };
579
+ };
580
+ Custom: {
581
+ new (inner: {
582
+ value: string;
583
+ }): {
584
+ readonly tag: PaymentMethod_Tags.Custom;
585
+ readonly inner: Readonly<{
586
+ value: string;
587
+ }>;
588
+ /**
589
+ * @private
590
+ * This field is private and should not be used, use `tag` instead.
591
+ */
592
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
593
+ };
594
+ new(inner: {
595
+ value: string;
596
+ }): {
597
+ readonly tag: PaymentMethod_Tags.Custom;
598
+ readonly inner: Readonly<{
599
+ value: string;
600
+ }>;
601
+ /**
602
+ * @private
603
+ * This field is private and should not be used, use `tag` instead.
604
+ */
605
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
606
+ };
607
+ instanceOf(obj: any): obj is {
608
+ readonly tag: PaymentMethod_Tags.Custom;
609
+ readonly inner: Readonly<{
610
+ value: string;
611
+ }>;
612
+ /**
613
+ * @private
614
+ * This field is private and should not be used, use `tag` instead.
615
+ */
616
+ readonly [uniffiTypeNameSymbol]: "PaymentMethod";
617
+ };
618
+ };
619
+ }>;
620
+ /**
621
+ * A payment destination, mirroring `bark::movement::PaymentMethod`.
622
+ *
623
+ * Each variant carries the destination as a string. `type` and `value`
624
+ * match upstream's JSON encoding (`{"type":"ark","value":"tark1…"}`), which
625
+ * is what `Movement.sent_to_addresses` and `Movement.received_on_addresses`
626
+ * hold and what `Wallet::history_by_payment_method` takes.
627
+ */
628
+ export type PaymentMethod = InstanceType<typeof PaymentMethod['Ark' | 'Bitcoin' | 'OutputScript' | 'Invoice' | 'Offer' | 'LightningAddress' | 'Lnurl' | 'Custom']>;
629
+ export declare enum PaymentMethodParsingError_Tags {
630
+ NetworkMismatch = "NetworkMismatch",
631
+ InvalidArkAddress = "InvalidArkAddress",
632
+ AmountMismatch = "AmountMismatch",
633
+ InvalidAmount = "InvalidAmount",
634
+ Unsupported = "Unsupported"
635
+ }
636
+ /**
637
+ * Why an option of a [`PaymentRequest`] may not be payable, mirroring
638
+ * `bark::PaymentMethodParsingError`.
639
+ *
640
+ * Returned as data in [`AvailablePaymentMethod::errors`] rather than as an
641
+ * error, so the caller can still show every option and flag the bad ones.
642
+ */
643
+ export declare const PaymentMethodParsingError: Readonly<{
644
+ instanceOf: (obj: any) => obj is PaymentMethodParsingError;
645
+ NetworkMismatch: {
646
+ new (): {
647
+ readonly tag: PaymentMethodParsingError_Tags.NetworkMismatch;
648
+ /**
649
+ * @private
650
+ * This field is private and should not be used, use `tag` instead.
651
+ */
652
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
653
+ };
654
+ new(): {
655
+ readonly tag: PaymentMethodParsingError_Tags.NetworkMismatch;
656
+ /**
657
+ * @private
658
+ * This field is private and should not be used, use `tag` instead.
659
+ */
660
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
661
+ };
662
+ instanceOf(obj: any): obj is {
663
+ readonly tag: PaymentMethodParsingError_Tags.NetworkMismatch;
664
+ /**
665
+ * @private
666
+ * This field is private and should not be used, use `tag` instead.
667
+ */
668
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
669
+ };
670
+ };
671
+ InvalidArkAddress: {
672
+ new (inner: {
673
+ reason: string;
674
+ }): {
675
+ readonly tag: PaymentMethodParsingError_Tags.InvalidArkAddress;
676
+ readonly inner: Readonly<{
677
+ reason: string;
678
+ }>;
679
+ /**
680
+ * @private
681
+ * This field is private and should not be used, use `tag` instead.
682
+ */
683
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
684
+ };
685
+ new(inner: {
686
+ reason: string;
687
+ }): {
688
+ readonly tag: PaymentMethodParsingError_Tags.InvalidArkAddress;
689
+ readonly inner: Readonly<{
690
+ reason: string;
691
+ }>;
692
+ /**
693
+ * @private
694
+ * This field is private and should not be used, use `tag` instead.
695
+ */
696
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
697
+ };
698
+ instanceOf(obj: any): obj is {
699
+ readonly tag: PaymentMethodParsingError_Tags.InvalidArkAddress;
700
+ readonly inner: Readonly<{
701
+ reason: string;
702
+ }>;
703
+ /**
704
+ * @private
705
+ * This field is private and should not be used, use `tag` instead.
706
+ */
707
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
708
+ };
709
+ };
710
+ AmountMismatch: {
711
+ new (inner: {
712
+ expectedSats: bigint;
713
+ gotSats: bigint;
714
+ }): {
715
+ readonly tag: PaymentMethodParsingError_Tags.AmountMismatch;
716
+ readonly inner: Readonly<{
717
+ expectedSats: bigint;
718
+ gotSats: bigint;
719
+ }>;
720
+ /**
721
+ * @private
722
+ * This field is private and should not be used, use `tag` instead.
723
+ */
724
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
725
+ };
726
+ new(inner: {
727
+ expectedSats: bigint;
728
+ gotSats: bigint;
729
+ }): {
730
+ readonly tag: PaymentMethodParsingError_Tags.AmountMismatch;
731
+ readonly inner: Readonly<{
732
+ expectedSats: bigint;
733
+ gotSats: bigint;
734
+ }>;
735
+ /**
736
+ * @private
737
+ * This field is private and should not be used, use `tag` instead.
738
+ */
739
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
740
+ };
741
+ instanceOf(obj: any): obj is {
742
+ readonly tag: PaymentMethodParsingError_Tags.AmountMismatch;
743
+ readonly inner: Readonly<{
744
+ expectedSats: bigint;
745
+ gotSats: bigint;
746
+ }>;
747
+ /**
748
+ * @private
749
+ * This field is private and should not be used, use `tag` instead.
750
+ */
751
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
752
+ };
753
+ };
754
+ InvalidAmount: {
755
+ new (): {
756
+ readonly tag: PaymentMethodParsingError_Tags.InvalidAmount;
757
+ /**
758
+ * @private
759
+ * This field is private and should not be used, use `tag` instead.
760
+ */
761
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
762
+ };
763
+ new(): {
764
+ readonly tag: PaymentMethodParsingError_Tags.InvalidAmount;
765
+ /**
766
+ * @private
767
+ * This field is private and should not be used, use `tag` instead.
768
+ */
769
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
770
+ };
771
+ instanceOf(obj: any): obj is {
772
+ readonly tag: PaymentMethodParsingError_Tags.InvalidAmount;
773
+ /**
774
+ * @private
775
+ * This field is private and should not be used, use `tag` instead.
776
+ */
777
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
778
+ };
779
+ };
780
+ Unsupported: {
781
+ new (): {
782
+ readonly tag: PaymentMethodParsingError_Tags.Unsupported;
783
+ /**
784
+ * @private
785
+ * This field is private and should not be used, use `tag` instead.
786
+ */
787
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
788
+ };
789
+ new(): {
790
+ readonly tag: PaymentMethodParsingError_Tags.Unsupported;
791
+ /**
792
+ * @private
793
+ * This field is private and should not be used, use `tag` instead.
794
+ */
795
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
796
+ };
797
+ instanceOf(obj: any): obj is {
798
+ readonly tag: PaymentMethodParsingError_Tags.Unsupported;
799
+ /**
800
+ * @private
801
+ * This field is private and should not be used, use `tag` instead.
802
+ */
803
+ readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
804
+ };
805
+ };
806
+ }>;
807
+ /**
808
+ * Why an option of a [`PaymentRequest`] may not be payable, mirroring
809
+ * `bark::PaymentMethodParsingError`.
810
+ *
811
+ * Returned as data in [`AvailablePaymentMethod::errors`] rather than as an
812
+ * error, so the caller can still show every option and flag the bad ones.
813
+ */
814
+ export type PaymentMethodParsingError = InstanceType<typeof PaymentMethodParsingError['NetworkMismatch' | 'InvalidArkAddress' | 'AmountMismatch' | 'InvalidAmount' | 'Unsupported']>;
815
+ /**
816
+ * One way to pay a [`PaymentRequest`], mirroring
817
+ * `bark::AvailablePaymentMethod`.
818
+ */
819
+ export type AvailablePaymentMethod = {
820
+ method: PaymentMethod;
821
+ /**
822
+ * Why this option may not be payable. Empty when bark found no problem.
823
+ */
824
+ errors: Array<PaymentMethodParsingError>;
825
+ /**
826
+ * Whether `Wallet::send_payment` needs an amount for this method: always
827
+ * for addresses and LNURL, and for invoices and offers that carry none.
828
+ */
829
+ requiresAmount: boolean;
830
+ };
831
+ /**
832
+ * Generated factory for {@link AvailablePaymentMethod} record objects.
833
+ */
834
+ export declare const AvailablePaymentMethod: Readonly<{
835
+ create: (partial: Partial<AvailablePaymentMethod> & Required<Omit<AvailablePaymentMethod, never>>) => AvailablePaymentMethod;
836
+ new: (partial: Partial<AvailablePaymentMethod> & Required<Omit<AvailablePaymentMethod, never>>) => AvailablePaymentMethod;
837
+ defaults: () => Partial<AvailablePaymentMethod>;
838
+ }>;
839
+ export type Balance = {
840
+ /**
841
+ * Sats that can be spent right now. Excludes `needs_refresh_sats`.
842
+ */
843
+ spendableSats: bigint;
844
+ /**
845
+ * Sats in VTXOs that have expired or reached the server's maximum exit
846
+ * depth. They can still be offboarded, exited or refreshed, but not sent
847
+ * out-of-round until maintenance has refreshed them.
848
+ */
849
+ needsRefreshSats: bigint;
850
+ pendingInRoundSats: bigint;
851
+ pendingExitSats: bigint;
852
+ pendingLightningSendSats: bigint;
853
+ claimableLightningReceiveSats: bigint;
854
+ pendingBoardSats: bigint;
855
+ /**
856
+ * Sats locked in an outgoing arkoor payment that has not completed yet.
857
+ */
858
+ pendingArkoorSendSats: bigint;
859
+ /**
860
+ * Sats locked in an offboard whose transaction has not been broadcast
861
+ * yet, including any change that comes back.
862
+ */
863
+ pendingOffboardSats: bigint;
864
+ };
865
+ /**
866
+ * Generated factory for {@link Balance} record objects.
867
+ */
868
+ export declare const Balance: Readonly<{
869
+ create: (partial: Partial<Balance> & Required<Omit<Balance, never>>) => Balance;
870
+ new: (partial: Partial<Balance> & Required<Omit<Balance, never>>) => Balance;
871
+ defaults: () => Partial<Balance>;
872
+ }>;
873
+ /**
874
+ * The numbers to show a user without the breakdown of [`Balance`],
875
+ * mirroring `bark::BalanceSummary`.
876
+ *
877
+ * Show `spendable_sats` as what a user can pay with and `total_sats` as what
878
+ * a user owns.
879
+ */
880
+ export type BalanceSummary = {
881
+ /**
882
+ * Sats that can be spent right now.
883
+ */
884
+ spendableSats: bigint;
885
+ /**
886
+ * Sats that need a refresh before they can be sent again.
887
+ */
888
+ needsRefreshSats: bigint;
889
+ /**
890
+ * Sats held by operations in progress. They either come back as
891
+ * spendable or leave the wallet, for example to the onchain wallet.
892
+ */
893
+ pendingSats: bigint;
894
+ /**
895
+ * All sats that belong to the wallet:
896
+ * `spendable_sats + needs_refresh_sats + pending_sats`.
897
+ */
898
+ totalSats: bigint;
899
+ };
900
+ /**
901
+ * Generated factory for {@link BalanceSummary} record objects.
174
902
  */
175
- export type LightningSendFees = {
176
- minFeeSats: bigint;
177
- baseFeeSats: bigint;
178
- ppmExpiryTable: Array<PpmExpiryFeeEntry>;
903
+ export declare const BalanceSummary: Readonly<{
904
+ create: (partial: Partial<BalanceSummary> & Required<Omit<BalanceSummary, never>>) => BalanceSummary;
905
+ new: (partial: Partial<BalanceSummary> & Required<Omit<BalanceSummary, never>>) => BalanceSummary;
906
+ defaults: () => Partial<BalanceSummary>;
907
+ }>;
908
+ export type LightningInvoice = {
909
+ invoice: string;
910
+ paymentHash: string;
911
+ amountSats: bigint;
179
912
  };
180
913
  /**
181
- * Generated factory for {@link LightningSendFees} record objects.
914
+ * Generated factory for {@link LightningInvoice} record objects.
182
915
  */
183
- export declare const LightningSendFees: Readonly<{
184
- create: (partial: Partial<LightningSendFees> & Required<Omit<LightningSendFees, never>>) => LightningSendFees;
185
- new: (partial: Partial<LightningSendFees> & Required<Omit<LightningSendFees, never>>) => LightningSendFees;
186
- defaults: () => Partial<LightningSendFees>;
916
+ export declare const LightningInvoice: Readonly<{
917
+ create: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
918
+ new: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
919
+ defaults: () => Partial<LightningInvoice>;
187
920
  }>;
188
921
  /**
189
- * The Ark server's complete fee schedule, mirroring `ark::fees::FeeSchedule`.
922
+ * A BIP 321 URI built by `Wallet::bip321_uri`, with the destinations in it.
190
923
  */
191
- export type FeeSchedule = {
192
- board: BoardFees;
193
- offboard: OffboardFees;
194
- refresh: RefreshFees;
195
- lightningReceive: LightningReceiveFees;
196
- lightningSend: LightningSendFees;
924
+ export type Bip321Uri = {
925
+ /**
926
+ * The `bitcoin:` URI, for example to show as a QR code.
927
+ */
928
+ uri: string;
929
+ /**
930
+ * The new Ark address in the URI.
931
+ */
932
+ arkAddress?: string;
933
+ /**
934
+ * The new invoice in the URI. Follow the receive by its `payment_hash`.
935
+ */
936
+ lightningInvoice?: LightningInvoice;
937
+ /**
938
+ * The onchain address in the URI.
939
+ */
940
+ onchainAddress?: string;
197
941
  };
198
942
  /**
199
- * Generated factory for {@link FeeSchedule} record objects.
943
+ * Generated factory for {@link Bip321Uri} record objects.
200
944
  */
201
- export declare const FeeSchedule: Readonly<{
202
- create: (partial: Partial<FeeSchedule> & Required<Omit<FeeSchedule, never>>) => FeeSchedule;
203
- new: (partial: Partial<FeeSchedule> & Required<Omit<FeeSchedule, never>>) => FeeSchedule;
204
- defaults: () => Partial<FeeSchedule>;
945
+ export declare const Bip321Uri: Readonly<{
946
+ create: (partial: Partial<Bip321Uri> & Required<Omit<Bip321Uri, "arkAddress" | "lightningInvoice" | "onchainAddress">>) => Bip321Uri;
947
+ new: (partial: Partial<Bip321Uri> & Required<Omit<Bip321Uri, "arkAddress" | "lightningInvoice" | "onchainAddress">>) => Bip321Uri;
948
+ defaults: () => Partial<Bip321Uri>;
205
949
  }>;
206
- export type ArkInfo = {
207
- network: Network;
208
- serverPubkey: string;
209
- roundIntervalSecs: bigint;
210
- nbRoundNonces: number;
211
- vtxoExitDelta: number;
950
+ /**
951
+ * What `Wallet::bip321_uri` puts in the URI. Every field is optional.
952
+ */
953
+ export type Bip321UriOptions = {
212
954
  /**
213
- * The number of blocks a VTXO lives before it expires.
955
+ * The amount to request. A lightning invoice needs one.
956
+ *
957
+ * Default: none
214
958
  */
215
- vtxoLifetime: number;
959
+ amountSats?: bigint;
216
960
  /**
217
- * The number of blocks a VTXO lives before it expires.
961
+ * Default: none
962
+ */
963
+ label?: string;
964
+ /**
965
+ * Default: none
966
+ */
967
+ message?: string;
968
+ /**
969
+ * Whether to include a new Ark address.
218
970
  *
219
- * Deprecated: upstream renamed this to `vtxo_lifetime`. Both names are
220
- * exposed and carry the same value; migrate to `vtxo_lifetime`, this one
221
- * goes away once upstream drops it.
971
+ * Default: true
222
972
  */
223
- vtxoExpiryDelta: number;
224
- htlcSendExpiryDelta: number;
225
- htlcExpiryDelta: number;
226
- maxVtxoAmountSats?: bigint;
227
- requiredBoardConfirmations: number;
228
- maxUserInvoiceCltvDelta: number;
229
- minBoardAmountSats: bigint;
230
- lnReceiveAntiDosRequired: boolean;
973
+ ark: boolean;
231
974
  /**
232
- * The server's fee schedule (board, offboard, refresh, lightning fees).
975
+ * Whether to include a new BOLT11 invoice. Ignored without
976
+ * `amount_sats`.
977
+ *
978
+ * Default: true
233
979
  */
234
- feeSchedule: FeeSchedule;
980
+ lightning: boolean;
235
981
  /**
236
- * Maximum exit depth (genesis chain length) allowed for a VTXO before the
237
- * server refuses to cosign further OOR transactions spending it.
982
+ * An onchain address to include, such as one from the host's own
983
+ * onchain wallet. It must be for the wallet's network. As in bark's own
984
+ * builder, a mainnet address goes in the URI path and any other in a
985
+ * `tb=` parameter.
986
+ *
987
+ * Default: none
238
988
  */
239
- maxVtxoExitDepth: number;
240
- };
241
- /**
242
- * Generated factory for {@link ArkInfo} record objects.
243
- */
244
- export declare const ArkInfo: Readonly<{
245
- create: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
246
- new: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
247
- defaults: () => Partial<ArkInfo>;
248
- }>;
249
- export type Balance = {
250
- spendableSats: bigint;
251
- pendingInRoundSats: bigint;
252
- pendingExitSats: bigint;
253
- pendingLightningSendSats: bigint;
254
- claimableLightningReceiveSats: bigint;
255
- pendingBoardSats: bigint;
989
+ onchainAddress?: string;
256
990
  };
257
991
  /**
258
- * Generated factory for {@link Balance} record objects.
992
+ * Generated factory for {@link Bip321UriOptions} record objects.
259
993
  */
260
- export declare const Balance: Readonly<{
261
- create: (partial: Partial<Balance> & Required<Omit<Balance, never>>) => Balance;
262
- new: (partial: Partial<Balance> & Required<Omit<Balance, never>>) => Balance;
263
- defaults: () => Partial<Balance>;
994
+ export declare const Bip321UriOptions: Readonly<{
995
+ create: (partial: Partial<Bip321UriOptions> & Required<Omit<Bip321UriOptions, "amountSats" | "onchainAddress" | "label" | "message" | "ark" | "lightning">>) => Bip321UriOptions;
996
+ new: (partial: Partial<Bip321UriOptions> & Required<Omit<Bip321UriOptions, "amountSats" | "onchainAddress" | "label" | "message" | "ark" | "lightning">>) => Bip321UriOptions;
997
+ defaults: () => Partial<Bip321UriOptions>;
264
998
  }>;
265
999
  /**
266
1000
  * Reference to a block in the blockchain
@@ -298,6 +1032,50 @@ export declare const BoardFundingInfo: Readonly<{
298
1032
  new: (partial: Partial<BoardFundingInfo> & Required<Omit<BoardFundingInfo, never>>) => BoardFundingInfo;
299
1033
  defaults: () => Partial<BoardFundingInfo>;
300
1034
  }>;
1035
+ /**
1036
+ * Fields of a BOLT11 invoice, as returned by `decode_bolt11_invoice`.
1037
+ */
1038
+ export type Bolt11InvoiceDetails = {
1039
+ paymentHash: string;
1040
+ /**
1041
+ * `None` for an amountless invoice, which needs an amount to pay.
1042
+ */
1043
+ amountMsat?: bigint;
1044
+ /**
1045
+ * `amount_msat` rounded up to whole sats.
1046
+ */
1047
+ amountSats?: bigint;
1048
+ /**
1049
+ * The description, when the invoice carries it directly.
1050
+ */
1051
+ description?: string;
1052
+ /**
1053
+ * The hex SHA-256 of the description, when the invoice carries that
1054
+ * instead.
1055
+ */
1056
+ descriptionHash?: string;
1057
+ /**
1058
+ * The payee's node public key, hex.
1059
+ */
1060
+ payeePubkey: string;
1061
+ /**
1062
+ * Creation time, in unix seconds.
1063
+ */
1064
+ createdAt: bigint;
1065
+ /**
1066
+ * Expiry time, in unix seconds. Compare it with the current time to
1067
+ * tell whether the invoice can still be paid.
1068
+ */
1069
+ expiresAt: bigint;
1070
+ };
1071
+ /**
1072
+ * Generated factory for {@link Bolt11InvoiceDetails} record objects.
1073
+ */
1074
+ export declare const Bolt11InvoiceDetails: Readonly<{
1075
+ create: (partial: Partial<Bolt11InvoiceDetails> & Required<Omit<Bolt11InvoiceDetails, "amountSats" | "amountMsat" | "description" | "descriptionHash">>) => Bolt11InvoiceDetails;
1076
+ new: (partial: Partial<Bolt11InvoiceDetails> & Required<Omit<Bolt11InvoiceDetails, "amountSats" | "amountMsat" | "description" | "descriptionHash">>) => Bolt11InvoiceDetails;
1077
+ defaults: () => Partial<Bolt11InvoiceDetails>;
1078
+ }>;
301
1079
  export type Config = {
302
1080
  serverAddress: string;
303
1081
  serverAccessToken?: string;
@@ -356,6 +1134,55 @@ export declare const CpfpParams: Readonly<{
356
1134
  new: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "currentPackageFeeSats">>) => CpfpParams;
357
1135
  defaults: () => Partial<CpfpParams>;
358
1136
  }>;
1137
+ /**
1138
+ * What [`read_datadir_info`] found in a wallet directory.
1139
+ */
1140
+ export type DatadirInfo = {
1141
+ /**
1142
+ * Path of the database file that was read.
1143
+ */
1144
+ dbFile: string;
1145
+ network: Network;
1146
+ /**
1147
+ * Fingerprint of the wallet seed, as `Wallet::fingerprint` returns it.
1148
+ * Compare it against the seed you are about to open with to catch a
1149
+ * restore-over-the-wrong-wallet before any file is touched.
1150
+ */
1151
+ fingerprint: string;
1152
+ };
1153
+ /**
1154
+ * Generated factory for {@link DatadirInfo} record objects.
1155
+ */
1156
+ export declare const DatadirInfo: Readonly<{
1157
+ create: (partial: Partial<DatadirInfo> & Required<Omit<DatadirInfo, never>>) => DatadirInfo;
1158
+ new: (partial: Partial<DatadirInfo> & Required<Omit<DatadirInfo, never>>) => DatadirInfo;
1159
+ defaults: () => Partial<DatadirInfo>;
1160
+ }>;
1161
+ /**
1162
+ * Wallet information that helps to debug issues, mirroring
1163
+ * `bark::DebugInfo` (what `bark debug-info` prints). Users can share it in
1164
+ * support requests.
1165
+ */
1166
+ export type DebugInfo = {
1167
+ network: Network;
1168
+ /**
1169
+ * The wallet's server mailbox id, hex-encoded like
1170
+ * `Wallet::mailbox_identifier`.
1171
+ */
1172
+ mailboxId: string;
1173
+ /**
1174
+ * The xpub every VTXO keypair is derived from.
1175
+ */
1176
+ vtxoXpub: string;
1177
+ };
1178
+ /**
1179
+ * Generated factory for {@link DebugInfo} record objects.
1180
+ */
1181
+ export declare const DebugInfo: Readonly<{
1182
+ create: (partial: Partial<DebugInfo> & Required<Omit<DebugInfo, never>>) => DebugInfo;
1183
+ new: (partial: Partial<DebugInfo> & Required<Omit<DebugInfo, never>>) => DebugInfo;
1184
+ defaults: () => Partial<DebugInfo>;
1185
+ }>;
359
1186
  /**
360
1187
  * A Bitcoin transaction output destination
361
1188
  */
@@ -382,9 +1209,10 @@ export declare const Destination: Readonly<{
382
1209
  */
383
1210
  export type EmergencyExitFeeEstimate = {
384
1211
  /**
385
- * CPFP fees to broadcast every not-yet-confirmed exit transaction. Paid
386
- * now from confirmed onchain funds; this is the minimum onchain balance
387
- * an emergency exit needs.
1212
+ * CPFP fees to broadcast every not-yet-confirmed exit transaction,
1213
+ * scaled by the fee margin, so deliberately above `fee_rate × weight`.
1214
+ * Paid now from confirmed onchain funds; this is the onchain balance to
1215
+ * fund the exit with at that margin.
388
1216
  */
389
1217
  exitBroadcastFeeSats: bigint;
390
1218
  /**
@@ -397,9 +1225,9 @@ export type EmergencyExitFeeEstimate = {
397
1225
  */
398
1226
  totalFeeSats: bigint;
399
1227
  /**
400
- * Fee rate the exit-broadcast leg was priced at (sat/vB, rounded up).
401
- * Unless an explicit rate was supplied, the claim leg is priced
402
- * separately at the chain's `regular` rate.
1228
+ * Fee rate the exit-broadcast leg was priced at, before the fee margin
1229
+ * (sat/vB, rounded up). Unless an explicit rate was supplied, the claim
1230
+ * leg is priced separately at the chain's `regular` rate.
403
1231
  */
404
1232
  feeRateSatPerVb: bigint;
405
1233
  /**
@@ -408,10 +1236,12 @@ export type EmergencyExitFeeEstimate = {
408
1236
  */
409
1237
  txsToBroadcast: bigint;
410
1238
  /**
411
- * Whether the wallet's current confirmed onchain balance covers the full
412
- * serial broadcast walk. Each CPFP child can only spend confirmed coins,
413
- * so `false` means the exit would stall midway even if a single bump
414
- * looks affordable.
1239
+ * Whether the onchain wallet's last synced balance covers
1240
+ * `exit_broadcast_fee_sats`. `false` without an onchain wallet.
1241
+ *
1242
+ * Deprecated: bark dropped this field. Compare `exit_broadcast_fee_sats`
1243
+ * against the onchain balance instead; this one goes away in a later
1244
+ * release, as it does in bark-rest.
415
1245
  */
416
1246
  fundable: boolean;
417
1247
  };
@@ -439,7 +1269,8 @@ export declare enum ExitStateKind {
439
1269
  ClaimInProgress = 4,
440
1270
  Claimed = 5,
441
1271
  VtxoAlreadySpent = 6,
442
- Canceled = 7
1272
+ VtxoSwept = 7,
1273
+ Canceled = 8
443
1274
  }
444
1275
  export declare enum ExitCancelFailure_Tags {
445
1276
  NotExiting = "NotExiting",
@@ -569,7 +1400,7 @@ export declare const ExitCancelFailure: Readonly<{
569
1400
  * each is a normal state the exit can legitimately be in. Genuine failures
570
1401
  * (database, chain source unreachable) still surface as `Err`.
571
1402
  */
572
- export type ExitCancelFailure = InstanceType<(typeof ExitCancelFailure)["NotExiting" | "TooLate" | "AlreadyBroadcast"]>;
1403
+ export type ExitCancelFailure = InstanceType<typeof ExitCancelFailure['NotExiting' | 'TooLate' | 'AlreadyBroadcast']>;
573
1404
  /**
574
1405
  * Outcome of a cancellation request.
575
1406
  *
@@ -592,21 +1423,6 @@ export declare const ExitCancelResult: Readonly<{
592
1423
  new: (partial: Partial<ExitCancelResult> & Required<Omit<ExitCancelResult, "reason">>) => ExitCancelResult;
593
1424
  defaults: () => Partial<ExitCancelResult>;
594
1425
  }>;
595
- /**
596
- * Claim transaction for exited funds
597
- */
598
- export type ExitClaimTransaction = {
599
- psbtBase64: string;
600
- feeSats: bigint;
601
- };
602
- /**
603
- * Generated factory for {@link ExitClaimTransaction} record objects.
604
- */
605
- export declare const ExitClaimTransaction: Readonly<{
606
- create: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
607
- new: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
608
- defaults: () => Partial<ExitClaimTransaction>;
609
- }>;
610
1426
  export declare enum ExitTxOrigin_Tags {
611
1427
  Wallet = "Wallet",
612
1428
  Mempool = "Mempool",
@@ -725,7 +1541,62 @@ export declare const ExitTxOrigin: Readonly<{
725
1541
  /**
726
1542
  * Where an exit transaction was first seen, mirroring `bark::exit::ExitTxOrigin`.
727
1543
  */
728
- export type ExitTxOrigin = InstanceType<(typeof ExitTxOrigin)["Wallet" | "Mempool" | "Block"]>;
1544
+ export type ExitTxOrigin = InstanceType<typeof ExitTxOrigin['Wallet' | 'Mempool' | 'Block']>;
1545
+ /**
1546
+ * The CPFP child of an exit transaction.
1547
+ */
1548
+ export type ExitChildTransaction = {
1549
+ txid: string;
1550
+ txHex: string;
1551
+ /**
1552
+ * Who created the child. Only a `Wallet` child was paid for by this
1553
+ * wallet, which is what fee attribution needs.
1554
+ */
1555
+ origin: ExitTxOrigin;
1556
+ /**
1557
+ * Effective fee rate of the child and its unconfirmed ancestors, in
1558
+ * sat/kwu. `None` until the mempool has been queried for it.
1559
+ */
1560
+ feeRateSatPerKwu?: bigint;
1561
+ /**
1562
+ * Fee of the child plus the fees of its unconfirmed ancestors. `None`
1563
+ * until the mempool has been queried for it.
1564
+ */
1565
+ totalFeeSats?: bigint;
1566
+ };
1567
+ /**
1568
+ * Generated factory for {@link ExitChildTransaction} record objects.
1569
+ */
1570
+ export declare const ExitChildTransaction: Readonly<{
1571
+ create: (partial: Partial<ExitChildTransaction> & Required<Omit<ExitChildTransaction, "totalFeeSats" | "feeRateSatPerKwu">>) => ExitChildTransaction;
1572
+ new: (partial: Partial<ExitChildTransaction> & Required<Omit<ExitChildTransaction, "totalFeeSats" | "feeRateSatPerKwu">>) => ExitChildTransaction;
1573
+ defaults: () => Partial<ExitChildTransaction>;
1574
+ }>;
1575
+ /**
1576
+ * Claim transaction for exited funds
1577
+ */
1578
+ export type ExitClaimTransaction = {
1579
+ psbtBase64: string;
1580
+ feeSats: bigint;
1581
+ /**
1582
+ * The exits the PSBT actually spends. Link the claim transaction to
1583
+ * these, not to the ids you asked for.
1584
+ */
1585
+ vtxoIds: Array<string>;
1586
+ /**
1587
+ * Requested ids that were left out because they were not claimable when
1588
+ * the PSBT was built. Empty when draining all claimable exits.
1589
+ */
1590
+ skippedVtxoIds: Array<string>;
1591
+ };
1592
+ /**
1593
+ * Generated factory for {@link ExitClaimTransaction} record objects.
1594
+ */
1595
+ export declare const ExitClaimTransaction: Readonly<{
1596
+ create: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
1597
+ new: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
1598
+ defaults: () => Partial<ExitClaimTransaction>;
1599
+ }>;
729
1600
  export declare enum ExitTxStatus_Tags {
730
1601
  VerifyInputs = "VerifyInputs",
731
1602
  AwaitingInputConfirmation = "AwaitingInputConfirmation",
@@ -928,7 +1799,7 @@ export declare const ExitTxStatus: Readonly<{
928
1799
  * Broadcast/confirmation status of one transaction in an exit chain,
929
1800
  * mirroring `bark::exit::ExitTxStatus`.
930
1801
  */
931
- export type ExitTxStatus = InstanceType<(typeof ExitTxStatus)["VerifyInputs" | "AwaitingInputConfirmation" | "AwaitingCpfpBroadcast" | "AwaitingConfirmation" | "Confirmed"]>;
1802
+ export type ExitTxStatus = InstanceType<typeof ExitTxStatus['VerifyInputs' | 'AwaitingInputConfirmation' | 'AwaitingCpfpBroadcast' | 'AwaitingConfirmation' | 'Confirmed']>;
932
1803
  /**
933
1804
  * One transaction in an exit's unilateral broadcast chain.
934
1805
  */
@@ -944,6 +1815,21 @@ export declare const ExitTx: Readonly<{
944
1815
  new: (partial: Partial<ExitTx> & Required<Omit<ExitTx, never>>) => ExitTx;
945
1816
  defaults: () => Partial<ExitTx>;
946
1817
  }>;
1818
+ /**
1819
+ * A Bitcoin transaction outpoint (reference to a previous output)
1820
+ */
1821
+ export type OutPoint = {
1822
+ txid: string;
1823
+ vout: number;
1824
+ };
1825
+ /**
1826
+ * Generated factory for {@link OutPoint} record objects.
1827
+ */
1828
+ export declare const OutPoint: Readonly<{
1829
+ create: (partial: Partial<OutPoint> & Required<Omit<OutPoint, never>>) => OutPoint;
1830
+ new: (partial: Partial<OutPoint> & Required<Omit<OutPoint, never>>) => OutPoint;
1831
+ defaults: () => Partial<OutPoint>;
1832
+ }>;
947
1833
  export declare enum ExitState_Tags {
948
1834
  Start = "Start",
949
1835
  Processing = "Processing",
@@ -952,6 +1838,7 @@ export declare enum ExitState_Tags {
952
1838
  ClaimInProgress = "ClaimInProgress",
953
1839
  Claimed = "Claimed",
954
1840
  VtxoAlreadySpent = "VtxoAlreadySpent",
1841
+ VtxoSwept = "VtxoSwept",
955
1842
  Canceled = "Canceled"
956
1843
  }
957
1844
  /**
@@ -959,7 +1846,8 @@ export declare enum ExitState_Tags {
959
1846
  *
960
1847
  * Serde/TS tags match upstream's kebab-case serialization (`"start"`,
961
1848
  * `"processing"`, `"awaiting-delta"`, `"claimable"`, `"claim-in-progress"`,
962
- * `"claimed"`, `"vtxo-already-spent"`, `"canceled"`), with camelCase fields.
1849
+ * `"claimed"`, `"vtxo-already-spent"`, `"vtxo-swept"`, `"canceled"`), with
1850
+ * camelCase fields.
963
1851
  */
964
1852
  export declare const ExitState: Readonly<{
965
1853
  instanceOf: (obj: any) => obj is ExitState;
@@ -1232,8 +2120,47 @@ export declare const ExitState: Readonly<{
1232
2120
  readonly tag: ExitState_Tags.Claimed;
1233
2121
  readonly inner: Readonly<{
1234
2122
  tipHeight: number;
1235
- txid: string;
1236
- block: BlockRef;
2123
+ txid: string;
2124
+ block: BlockRef;
2125
+ }>;
2126
+ /**
2127
+ * @private
2128
+ * This field is private and should not be used, use `tag` instead.
2129
+ */
2130
+ readonly [uniffiTypeNameSymbol]: "ExitState";
2131
+ };
2132
+ };
2133
+ VtxoAlreadySpent: {
2134
+ new (inner: {
2135
+ tipHeight: number;
2136
+ }): {
2137
+ readonly tag: ExitState_Tags.VtxoAlreadySpent;
2138
+ readonly inner: Readonly<{
2139
+ tipHeight: number;
2140
+ }>;
2141
+ /**
2142
+ * @private
2143
+ * This field is private and should not be used, use `tag` instead.
2144
+ */
2145
+ readonly [uniffiTypeNameSymbol]: "ExitState";
2146
+ };
2147
+ new(inner: {
2148
+ tipHeight: number;
2149
+ }): {
2150
+ readonly tag: ExitState_Tags.VtxoAlreadySpent;
2151
+ readonly inner: Readonly<{
2152
+ tipHeight: number;
2153
+ }>;
2154
+ /**
2155
+ * @private
2156
+ * This field is private and should not be used, use `tag` instead.
2157
+ */
2158
+ readonly [uniffiTypeNameSymbol]: "ExitState";
2159
+ };
2160
+ instanceOf(obj: any): obj is {
2161
+ readonly tag: ExitState_Tags.VtxoAlreadySpent;
2162
+ readonly inner: Readonly<{
2163
+ tipHeight: number;
1237
2164
  }>;
1238
2165
  /**
1239
2166
  * @private
@@ -1242,13 +2169,15 @@ export declare const ExitState: Readonly<{
1242
2169
  readonly [uniffiTypeNameSymbol]: "ExitState";
1243
2170
  };
1244
2171
  };
1245
- VtxoAlreadySpent: {
2172
+ VtxoSwept: {
1246
2173
  new (inner: {
1247
2174
  tipHeight: number;
2175
+ spentInputs: Array<OutPoint>;
1248
2176
  }): {
1249
- readonly tag: ExitState_Tags.VtxoAlreadySpent;
2177
+ readonly tag: ExitState_Tags.VtxoSwept;
1250
2178
  readonly inner: Readonly<{
1251
2179
  tipHeight: number;
2180
+ spentInputs: Array<OutPoint>;
1252
2181
  }>;
1253
2182
  /**
1254
2183
  * @private
@@ -1258,10 +2187,12 @@ export declare const ExitState: Readonly<{
1258
2187
  };
1259
2188
  new(inner: {
1260
2189
  tipHeight: number;
2190
+ spentInputs: Array<OutPoint>;
1261
2191
  }): {
1262
- readonly tag: ExitState_Tags.VtxoAlreadySpent;
2192
+ readonly tag: ExitState_Tags.VtxoSwept;
1263
2193
  readonly inner: Readonly<{
1264
2194
  tipHeight: number;
2195
+ spentInputs: Array<OutPoint>;
1265
2196
  }>;
1266
2197
  /**
1267
2198
  * @private
@@ -1270,9 +2201,10 @@ export declare const ExitState: Readonly<{
1270
2201
  readonly [uniffiTypeNameSymbol]: "ExitState";
1271
2202
  };
1272
2203
  instanceOf(obj: any): obj is {
1273
- readonly tag: ExitState_Tags.VtxoAlreadySpent;
2204
+ readonly tag: ExitState_Tags.VtxoSwept;
1274
2205
  readonly inner: Readonly<{
1275
2206
  tipHeight: number;
2207
+ spentInputs: Array<OutPoint>;
1276
2208
  }>;
1277
2209
  /**
1278
2210
  * @private
@@ -1326,9 +2258,10 @@ export declare const ExitState: Readonly<{
1326
2258
  *
1327
2259
  * Serde/TS tags match upstream's kebab-case serialization (`"start"`,
1328
2260
  * `"processing"`, `"awaiting-delta"`, `"claimable"`, `"claim-in-progress"`,
1329
- * `"claimed"`, `"vtxo-already-spent"`, `"canceled"`), with camelCase fields.
2261
+ * `"claimed"`, `"vtxo-already-spent"`, `"vtxo-swept"`, `"canceled"`), with
2262
+ * camelCase fields.
1330
2263
  */
1331
- export type ExitState = InstanceType<(typeof ExitState)["Start" | "Processing" | "AwaitingDelta" | "Claimable" | "ClaimInProgress" | "Claimed" | "VtxoAlreadySpent" | "Canceled"]>;
2264
+ export type ExitState = InstanceType<typeof ExitState['Start' | 'Processing' | 'AwaitingDelta' | 'Claimable' | 'ClaimInProgress' | 'Claimed' | 'VtxoAlreadySpent' | 'VtxoSwept' | 'Canceled']>;
1332
2265
  /**
1333
2266
  * Status of an exit progression
1334
2267
  */
@@ -1345,14 +2278,43 @@ export declare const ExitProgressStatus: Readonly<{
1345
2278
  new: (partial: Partial<ExitProgressStatus> & Required<Omit<ExitProgressStatus, "error">>) => ExitProgressStatus;
1346
2279
  defaults: () => Partial<ExitProgressStatus>;
1347
2280
  }>;
2281
+ /**
2282
+ * One transaction of an exit: the exit transaction itself and, once it was
2283
+ * fee-bumped, the child that confirms it. A unilateral exit is a chain of
2284
+ * these, root first.
2285
+ */
2286
+ export type ExitTransactionPackage = {
2287
+ exitTxid: string;
2288
+ exitTxHex: string;
2289
+ child?: ExitChildTransaction;
2290
+ };
2291
+ /**
2292
+ * Generated factory for {@link ExitTransactionPackage} record objects.
2293
+ */
2294
+ export declare const ExitTransactionPackage: Readonly<{
2295
+ create: (partial: Partial<ExitTransactionPackage> & Required<Omit<ExitTransactionPackage, "child">>) => ExitTransactionPackage;
2296
+ new: (partial: Partial<ExitTransactionPackage> & Required<Omit<ExitTransactionPackage, "child">>) => ExitTransactionPackage;
2297
+ defaults: () => Partial<ExitTransactionPackage>;
2298
+ }>;
1348
2299
  /**
1349
2300
  * Detailed status of an exit transaction
2301
+ *
2302
+ * Returned for live and finished exits alike by `get_exit_status`,
2303
+ * `list_all_exits`, `list_live_exits` and `list_finished_exits`.
1350
2304
  */
1351
2305
  export type ExitTransactionStatus = {
1352
2306
  vtxoId: string;
1353
2307
  state: ExitState;
1354
2308
  history?: Array<ExitState>;
2309
+ /**
2310
+ * Same as `transactions.len()`. Kept for callers that only want the count.
2311
+ */
1355
2312
  transactionCount: number;
2313
+ /**
2314
+ * The exit transaction chain, root first. Empty unless the status was
2315
+ * requested with `include_transactions`.
2316
+ */
2317
+ transactions: Array<ExitTransactionPackage>;
1356
2318
  };
1357
2319
  /**
1358
2320
  * Generated factory for {@link ExitTransactionStatus} record objects.
@@ -1450,19 +2412,6 @@ export declare const ImportVtxoArgs: Readonly<{
1450
2412
  new: (partial: Partial<ImportVtxoArgs> & Required<Omit<ImportVtxoArgs, "gapLimit" | "skipStatusCheck" | "allowPartial">>) => ImportVtxoArgs;
1451
2413
  defaults: () => Partial<ImportVtxoArgs>;
1452
2414
  }>;
1453
- export type LightningInvoice = {
1454
- invoice: string;
1455
- paymentHash: string;
1456
- amountSats: bigint;
1457
- };
1458
- /**
1459
- * Generated factory for {@link LightningInvoice} record objects.
1460
- */
1461
- export declare const LightningInvoice: Readonly<{
1462
- create: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
1463
- new: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
1464
- defaults: () => Partial<LightningInvoice>;
1465
- }>;
1466
2415
  export type LightningReceive = {
1467
2416
  paymentHash: string;
1468
2417
  invoice: string;
@@ -1502,6 +2451,16 @@ export declare const LightningReceive: Readonly<{
1502
2451
  }>;
1503
2452
  export type LightningSend = {
1504
2453
  invoice: string;
2454
+ /**
2455
+ * Payment hash of the invoice being paid. Poll `lightning_send_state`
2456
+ * with it; for BOLT12 there is no invoice string to parse it from.
2457
+ */
2458
+ paymentHash: string;
2459
+ /**
2460
+ * Id of the `Movement` that records this send. `None` only for sends
2461
+ * checkpointed by a bark version that predates the field.
2462
+ */
2463
+ movementId?: number;
1505
2464
  /**
1506
2465
  * Amount being paid, in sats (`payment_amount`).
1507
2466
  */
@@ -1524,8 +2483,8 @@ export type LightningSend = {
1524
2483
  * Generated factory for {@link LightningSend} record objects.
1525
2484
  */
1526
2485
  export declare const LightningSend: Readonly<{
1527
- create: (partial: Partial<LightningSend> & Required<Omit<LightningSend, never>>) => LightningSend;
1528
- new: (partial: Partial<LightningSend> & Required<Omit<LightningSend, never>>) => LightningSend;
2486
+ create: (partial: Partial<LightningSend> & Required<Omit<LightningSend, "movementId">>) => LightningSend;
2487
+ new: (partial: Partial<LightningSend> & Required<Omit<LightningSend, "movementId">>) => LightningSend;
1529
2488
  defaults: () => Partial<LightningSend>;
1530
2489
  }>;
1531
2490
  export type Movement = {
@@ -1553,12 +2512,23 @@ export type Movement = {
1553
2512
  * Generated factory for {@link Movement} record objects.
1554
2513
  */
1555
2514
  export declare const Movement: Readonly<{
1556
- create: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "completedAt" | "lightningInvoice" | "lightningOffer">>) => Movement;
1557
- new: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "completedAt" | "lightningInvoice" | "lightningOffer">>) => Movement;
2515
+ create: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "lightningInvoice" | "completedAt" | "lightningOffer">>) => Movement;
2516
+ new: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "lightningInvoice" | "completedAt" | "lightningOffer">>) => Movement;
1558
2517
  defaults: () => Partial<Movement>;
1559
2518
  }>;
2519
+ /**
2520
+ * What `offboard_all`, `offboard_vtxos` and `send_onchain` broadcast,
2521
+ * mirroring `bark::OffboardResult`.
2522
+ */
1560
2523
  export type OffboardResult = {
2524
+ /**
2525
+ * The offboard transaction the server built and bark broadcast.
2526
+ */
1561
2527
  txid: string;
2528
+ /**
2529
+ * The movement that records this offboard.
2530
+ */
2531
+ movementId: number;
1562
2532
  };
1563
2533
  /**
1564
2534
  * Generated factory for {@link OffboardResult} record objects.
@@ -1582,24 +2552,43 @@ export declare const OnchainBalance: Readonly<{
1582
2552
  defaults: () => Partial<OnchainBalance>;
1583
2553
  }>;
1584
2554
  /**
1585
- * A Bitcoin transaction outpoint (reference to a previous output)
2555
+ * A parsed payment string, mirroring `bark::PaymentRequest`.
2556
+ *
2557
+ * `label` and `message` come from a BIP 321 URI. For a bare BOLT11 invoice
2558
+ * or BOLT12 offer, `amount_sats` is its amount and `message` its
2559
+ * description.
1586
2560
  */
1587
- export type OutPoint = {
1588
- txid: string;
1589
- vout: number;
2561
+ export type PaymentRequest = {
2562
+ amountSats?: bigint;
2563
+ label?: string;
2564
+ message?: string;
2565
+ /**
2566
+ * Every destination found, in the order bark parsed them.
2567
+ */
2568
+ options: Array<AvailablePaymentMethod>;
2569
+ /**
2570
+ * The option to pay when the user doesn't pick one: Ark, then
2571
+ * lightning, then onchain, skipping options with errors. `None` when
2572
+ * every option has errors.
2573
+ */
2574
+ defaultOption?: AvailablePaymentMethod;
1590
2575
  };
1591
2576
  /**
1592
- * Generated factory for {@link OutPoint} record objects.
2577
+ * Generated factory for {@link PaymentRequest} record objects.
1593
2578
  */
1594
- export declare const OutPoint: Readonly<{
1595
- create: (partial: Partial<OutPoint> & Required<Omit<OutPoint, never>>) => OutPoint;
1596
- new: (partial: Partial<OutPoint> & Required<Omit<OutPoint, never>>) => OutPoint;
1597
- defaults: () => Partial<OutPoint>;
2579
+ export declare const PaymentRequest: Readonly<{
2580
+ create: (partial: Partial<PaymentRequest> & Required<Omit<PaymentRequest, "amountSats" | "label" | "message" | "defaultOption">>) => PaymentRequest;
2581
+ new: (partial: Partial<PaymentRequest> & Required<Omit<PaymentRequest, "amountSats" | "label" | "message" | "defaultOption">>) => PaymentRequest;
2582
+ defaults: () => Partial<PaymentRequest>;
1598
2583
  }>;
1599
2584
  export type PendingBoard = {
1600
2585
  vtxoId: string;
1601
2586
  amountSats: bigint;
1602
2587
  txid: string;
2588
+ /**
2589
+ * Id of the `Movement` that records this board.
2590
+ */
2591
+ movementId: number;
1603
2592
  };
1604
2593
  /**
1605
2594
  * Generated factory for {@link PendingBoard} record objects.
@@ -1847,7 +2836,7 @@ export declare const VtxoLockHolder: Readonly<{
1847
2836
  *
1848
2837
  * Serde/TS tags match upstream's serialization: `"action"` / `"movement"`.
1849
2838
  */
1850
- export type VtxoLockHolder = InstanceType<(typeof VtxoLockHolder)["Action" | "Movement"]>;
2839
+ export type VtxoLockHolder = InstanceType<typeof VtxoLockHolder['Action' | 'Movement']>;
1851
2840
  export declare enum VtxoState_Tags {
1852
2841
  Spendable = "Spendable",
1853
2842
  Locked = "Locked",
@@ -1986,7 +2975,7 @@ export declare const VtxoState: Readonly<{
1986
2975
  * Serde/TS tags match upstream's kebab-case serialization:
1987
2976
  * `"spendable"` | `"locked"` | `"spent"` | `"exited"`.
1988
2977
  */
1989
- export type VtxoState = InstanceType<(typeof VtxoState)["Spendable" | "Locked" | "Spent" | "Exited"]>;
2978
+ export type VtxoState = InstanceType<typeof VtxoState['Spendable' | 'Locked' | 'Spent' | 'Exited']>;
1990
2979
  export type Vtxo = {
1991
2980
  id: string;
1992
2981
  amountSats: bigint;
@@ -2068,6 +3057,12 @@ export declare const Exception: {
2068
3057
  cause?: unknown;
2069
3058
  };
2070
3059
  captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
3060
+ /**
3061
+ * Turn logging off and detach the current logger, which is never released.
3062
+ *
3063
+ * React Native calls this when its JS runtime starts, so a logger left by a
3064
+ * runtime that was reloaded is never called.
3065
+ */
2071
3066
  prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2072
3067
  stackTraceLimit: number;
2073
3068
  };
@@ -2098,7 +3093,7 @@ export declare const Exception: {
2098
3093
  * `Display` string across the boundary — so the rich anyhow context collapses
2099
3094
  * to a single message on the foreign side.
2100
3095
  */
2101
- export type Exception = InstanceType<(typeof Exception)["Inner"]>;
3096
+ export type Exception = InstanceType<typeof Exception['Inner']>;
2102
3097
  /**
2103
3098
  * Summary of one onchain wallet transaction, mirroring
2104
3099
  * `bark::onchain::WalletTxInfo`.
@@ -2249,7 +3244,7 @@ export declare const OnchainUtxo: Readonly<{
2249
3244
  /**
2250
3245
  * An onchain UTXO known to the wallet, mirroring `bark::onchain::Utxo`.
2251
3246
  */
2252
- export type OnchainUtxo = InstanceType<(typeof OnchainUtxo)["Local" | "Exit"]>;
3247
+ export type OnchainUtxo = InstanceType<typeof OnchainUtxo['Local' | 'Exit']>;
2253
3248
  /**
2254
3249
  * UniFFI-facing onchain wallet. Supports two backends:
2255
3250
  * - BDK (real onchain wallet via `bark::onchain::OnchainWallet`)
@@ -2596,7 +3591,7 @@ export declare const LightningSendStatus: Readonly<{
2596
3591
  * `check_lightning_payment` now return this so callers can drive the
2597
3592
  * crash-safe send flow themselves (initiate with `wait = false`, then poll).
2598
3593
  */
2599
- export type LightningSendStatus = InstanceType<(typeof LightningSendStatus)["Unknown" | "InProgress" | "Paid"]>;
3594
+ export type LightningSendStatus = InstanceType<typeof LightningSendStatus['Unknown' | 'InProgress' | 'Paid']>;
2600
3595
  /**
2601
3596
  * Severity of a log record.
2602
3597
  */
@@ -2607,6 +3602,143 @@ export declare enum LogLevel {
2607
3602
  Debug = 3,
2608
3603
  Trace = 4
2609
3604
  }
3605
+ export declare enum PaymentResult_Tags {
3606
+ Onchain = "Onchain",
3607
+ Lightning = "Lightning",
3608
+ Ark = "Ark"
3609
+ }
3610
+ /**
3611
+ * Outcome of `Wallet::send_payment`, mirroring `bark::PaymentInitOutput`.
3612
+ */
3613
+ export declare const PaymentResult: Readonly<{
3614
+ instanceOf: (obj: any) => obj is PaymentResult;
3615
+ Onchain: {
3616
+ new (inner: {
3617
+ txid: string;
3618
+ }): {
3619
+ readonly tag: PaymentResult_Tags.Onchain;
3620
+ readonly inner: Readonly<{
3621
+ txid: string;
3622
+ }>;
3623
+ /**
3624
+ * @private
3625
+ * This field is private and should not be used, use `tag` instead.
3626
+ */
3627
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3628
+ };
3629
+ new(inner: {
3630
+ txid: string;
3631
+ }): {
3632
+ readonly tag: PaymentResult_Tags.Onchain;
3633
+ readonly inner: Readonly<{
3634
+ txid: string;
3635
+ }>;
3636
+ /**
3637
+ * @private
3638
+ * This field is private and should not be used, use `tag` instead.
3639
+ */
3640
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3641
+ };
3642
+ instanceOf(obj: any): obj is {
3643
+ readonly tag: PaymentResult_Tags.Onchain;
3644
+ readonly inner: Readonly<{
3645
+ txid: string;
3646
+ }>;
3647
+ /**
3648
+ * @private
3649
+ * This field is private and should not be used, use `tag` instead.
3650
+ */
3651
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3652
+ };
3653
+ };
3654
+ Lightning: {
3655
+ new (inner: {
3656
+ invoice: string;
3657
+ paymentHash: string;
3658
+ }): {
3659
+ readonly tag: PaymentResult_Tags.Lightning;
3660
+ readonly inner: Readonly<{
3661
+ invoice: string;
3662
+ paymentHash: string;
3663
+ }>;
3664
+ /**
3665
+ * @private
3666
+ * This field is private and should not be used, use `tag` instead.
3667
+ */
3668
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3669
+ };
3670
+ new(inner: {
3671
+ invoice: string;
3672
+ paymentHash: string;
3673
+ }): {
3674
+ readonly tag: PaymentResult_Tags.Lightning;
3675
+ readonly inner: Readonly<{
3676
+ invoice: string;
3677
+ paymentHash: string;
3678
+ }>;
3679
+ /**
3680
+ * @private
3681
+ * This field is private and should not be used, use `tag` instead.
3682
+ */
3683
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3684
+ };
3685
+ instanceOf(obj: any): obj is {
3686
+ readonly tag: PaymentResult_Tags.Lightning;
3687
+ readonly inner: Readonly<{
3688
+ invoice: string;
3689
+ paymentHash: string;
3690
+ }>;
3691
+ /**
3692
+ * @private
3693
+ * This field is private and should not be used, use `tag` instead.
3694
+ */
3695
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3696
+ };
3697
+ };
3698
+ Ark: {
3699
+ new (inner: {
3700
+ movementId: number;
3701
+ }): {
3702
+ readonly tag: PaymentResult_Tags.Ark;
3703
+ readonly inner: Readonly<{
3704
+ movementId: number;
3705
+ }>;
3706
+ /**
3707
+ * @private
3708
+ * This field is private and should not be used, use `tag` instead.
3709
+ */
3710
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3711
+ };
3712
+ new(inner: {
3713
+ movementId: number;
3714
+ }): {
3715
+ readonly tag: PaymentResult_Tags.Ark;
3716
+ readonly inner: Readonly<{
3717
+ movementId: number;
3718
+ }>;
3719
+ /**
3720
+ * @private
3721
+ * This field is private and should not be used, use `tag` instead.
3722
+ */
3723
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3724
+ };
3725
+ instanceOf(obj: any): obj is {
3726
+ readonly tag: PaymentResult_Tags.Ark;
3727
+ readonly inner: Readonly<{
3728
+ movementId: number;
3729
+ }>;
3730
+ /**
3731
+ * @private
3732
+ * This field is private and should not be used, use `tag` instead.
3733
+ */
3734
+ readonly [uniffiTypeNameSymbol]: "PaymentResult";
3735
+ };
3736
+ };
3737
+ }>;
3738
+ /**
3739
+ * Outcome of `Wallet::send_payment`, mirroring `bark::PaymentInitOutput`.
3740
+ */
3741
+ export type PaymentResult = InstanceType<typeof PaymentResult['Onchain' | 'Lightning' | 'Ark']>;
2610
3742
  export declare enum RecoveryStatus_Tags {
2611
3743
  NotRun = "NotRun",
2612
3744
  Failed = "Failed",
@@ -2743,7 +3875,7 @@ export declare const RecoveryStatus: Readonly<{
2743
3875
  *
2744
3876
  * Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
2745
3877
  */
2746
- export type RecoveryStatus = InstanceType<(typeof RecoveryStatus)["NotRun" | "Failed" | "Completed"]>;
3878
+ export type RecoveryStatus = InstanceType<typeof RecoveryStatus['NotRun' | 'Failed' | 'Completed']>;
2747
3879
  export declare enum WalletNotification_Tags {
2748
3880
  MovementCreated = "MovementCreated",
2749
3881
  MovementUpdated = "MovementUpdated",
@@ -2862,7 +3994,7 @@ export declare const WalletNotification: Readonly<{
2862
3994
  /**
2863
3995
  * A notification event from the wallet
2864
3996
  */
2865
- export type WalletNotification = InstanceType<(typeof WalletNotification)["MovementCreated" | "MovementUpdated" | "ChannelLagging"]>;
3997
+ export type WalletNotification = InstanceType<typeof WalletNotification['MovementCreated' | 'MovementUpdated' | 'ChannelLagging']>;
2866
3998
  /**
2867
3999
  * Foreign-implemented sink for log records.
2868
4000
  *
@@ -2925,7 +4057,11 @@ export interface CustomOnchainWalletCallbacks {
2925
4057
  */
2926
4058
  prepareDrainTx(address: string, feeRateSatPerVb: bigint): string;
2927
4059
  /**
2928
- * Sign and finalize a PSBT
4060
+ * Sign and finalize a PSBT, without recording the transaction
4061
+ *
4062
+ * The wallet must not treat the transaction as spent yet: a board that
4063
+ * fails after signing has to leave the wallet untouched. Once the
4064
+ * transaction is broadcast, Bark reports it through `register_tx`.
2929
4065
  *
2930
4066
  * # Arguments
2931
4067
  * * `psbt_base64` - Base64-encoded PSBT
@@ -2934,7 +4070,7 @@ export interface CustomOnchainWalletCallbacks {
2934
4070
  * Base64-encoded fully signed PSBT (all witnesses filled in). Rejected
2935
4071
  * unless the unsigned transaction is unchanged.
2936
4072
  */
2937
- finishPsbt(psbtBase64: string): string;
4073
+ signPsbt(psbtBase64: string): string;
2938
4074
  /**
2939
4075
  * Whether a script pubkey belongs to the wallet's keychains
2940
4076
  *
@@ -3029,7 +4165,11 @@ export declare class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObje
3029
4165
  */
3030
4166
  prepareDrainTx(address: string, feeRateSatPerVb: bigint): string;
3031
4167
  /**
3032
- * Sign and finalize a PSBT
4168
+ * Sign and finalize a PSBT, without recording the transaction
4169
+ *
4170
+ * The wallet must not treat the transaction as spent yet: a board that
4171
+ * fails after signing has to leave the wallet untouched. Once the
4172
+ * transaction is broadcast, Bark reports it through `register_tx`.
3033
4173
  *
3034
4174
  * # Arguments
3035
4175
  * * `psbt_base64` - Base64-encoded PSBT
@@ -3038,7 +4178,7 @@ export declare class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObje
3038
4178
  * Base64-encoded fully signed PSBT (all witnesses filled in). Rejected
3039
4179
  * unless the unsigned transaction is unchanged.
3040
4180
  */
3041
- finishPsbt(psbtBase64: string): string;
4181
+ signPsbt(psbtBase64: string): string;
3042
4182
  /**
3043
4183
  * Whether a script pubkey belongs to the wallet's keychains
3044
4184
  *
@@ -3227,6 +4367,21 @@ export interface WalletLike {
3227
4367
  balance(asyncOpts_?: {
3228
4368
  signal: AbortSignal;
3229
4369
  }): Promise<Balance>;
4370
+ /**
4371
+ * The numbers to show a user, without the breakdown of `balance`: what
4372
+ * they can spend, what needs a refresh, what is pending and the total.
4373
+ */
4374
+ balanceSummary(asyncOpts_?: {
4375
+ signal: AbortSignal;
4376
+ }): Promise<BalanceSummary>;
4377
+ /**
4378
+ * Build a BIP 321 `bitcoin:` URI with a new Ark address, a new BOLT11
4379
+ * invoice (when there is an amount) and the caller's onchain address,
4380
+ * as `options` selects.
4381
+ */
4382
+ bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
4383
+ signal: AbortSignal;
4384
+ }): Promise<Bip321Uri>;
3230
4385
  boardAll(asyncOpts_?: {
3231
4386
  signal: AbortSignal;
3232
4387
  }): Promise<PendingBoard>;
@@ -3292,6 +4447,13 @@ export interface WalletLike {
3292
4447
  config(asyncOpts_?: {
3293
4448
  signal: AbortSignal;
3294
4449
  }): Promise<Config>;
4450
+ /**
4451
+ * The network, mailbox id and VTXO xpub, as `bark debug-info` prints
4452
+ * them. Users can share this in support requests.
4453
+ */
4454
+ debugInfo(asyncOpts_?: {
4455
+ signal: AbortSignal;
4456
+ }): Promise<DebugInfo>;
3295
4457
  /**
3296
4458
  * Build a PSBT claiming exited VTXOs to `address`.
3297
4459
  *
@@ -3316,13 +4478,14 @@ export interface WalletLike {
3316
4478
  * spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
3317
4479
  * use the chain's fast rate for the broadcast leg and regular rate for
3318
4480
  * the claim leg. `destination` only affects the claim transaction's weight.
4481
+ * `fee_margin` scales the broadcast leg (finite and non-negative; default
4482
+ * 1.2).
3319
4483
  *
3320
- * The onchain wallet is synced first so `fundable` reflects the current
3321
- * confirmed balance. Requires a BDK onchain wallet: callback-backed
3322
- * wallets (`CustomOnchainWalletCallbacks`) cannot simulate the CPFP walk
3323
- * and return an error.
4484
+ * The estimate never reads the onchain wallet, so it works before the
4485
+ * wallet holds funds and with callback wallets
4486
+ * (`CustomOnchainWalletCallbacks`) too.
3324
4487
  */
3325
- estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, asyncOpts_?: {
4488
+ estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, feeMargin: number | undefined, asyncOpts_?: {
3326
4489
  signal: AbortSignal;
3327
4490
  }): Promise<EmergencyExitFeeEstimate>;
3328
4491
  estimateLightningReceiveFee(amountSats: bigint, asyncOpts_?: {
@@ -3337,6 +4500,12 @@ export interface WalletLike {
3337
4500
  estimateOffboardFee(address: string, vtxoIds: Array<string>, asyncOpts_?: {
3338
4501
  signal: AbortSignal;
3339
4502
  }): Promise<FeeEstimate>;
4503
+ /**
4504
+ * Estimate the fee of paying `amount_sats` to `method`.
4505
+ */
4506
+ estimatePaymentFee(method: PaymentMethod, amountSats: bigint, asyncOpts_?: {
4507
+ signal: AbortSignal;
4508
+ }): Promise<FeeEstimate>;
3340
4509
  estimateRefreshFee(vtxoIds: Array<string>, asyncOpts_?: {
3341
4510
  signal: AbortSignal;
3342
4511
  }): Promise<FeeEstimate>;
@@ -3344,9 +4513,17 @@ export interface WalletLike {
3344
4513
  signal: AbortSignal;
3345
4514
  }): Promise<FeeEstimate>;
3346
4515
  fingerprint(): string;
4516
+ /**
4517
+ * Status of one exit, live or finished. `None` if no exit was ever
4518
+ * started for the VTXO.
4519
+ */
3347
4520
  getExitStatus(vtxoId: string, includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
3348
4521
  signal: AbortSignal;
3349
4522
  }): Promise<ExitTransactionStatus | undefined>;
4523
+ /**
4524
+ * Live exits only. Finished exits leave this list; see
4525
+ * `list_finished_exits` and `get_exit_status`.
4526
+ */
3350
4527
  getExitVtxos(asyncOpts_?: {
3351
4528
  signal: AbortSignal;
3352
4529
  }): Promise<Array<ExitVtxo>>;
@@ -3422,9 +4599,29 @@ export interface WalletLike {
3422
4599
  lightningSendState(paymentHash: string, asyncOpts_?: {
3423
4600
  signal: AbortSignal;
3424
4601
  }): Promise<LightningSendStatus>;
4602
+ /**
4603
+ * Status of every exit this wallet ever started, live and finished.
4604
+ */
4605
+ listAllExits(includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
4606
+ signal: AbortSignal;
4607
+ }): Promise<Array<ExitTransactionStatus>>;
3425
4608
  listClaimableExits(asyncOpts_?: {
3426
4609
  signal: AbortSignal;
3427
4610
  }): Promise<Array<ExitVtxo>>;
4611
+ /**
4612
+ * Status of the exits in a terminal state: claimed, canceled, or aborted
4613
+ * because the VTXO was already spent or swept. They stay queryable after
4614
+ * completion, so a client need not snapshot them at drain time.
4615
+ */
4616
+ listFinishedExits(includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
4617
+ signal: AbortSignal;
4618
+ }): Promise<Array<ExitTransactionStatus>>;
4619
+ /**
4620
+ * Status of the exits that are still progressing.
4621
+ */
4622
+ listLiveExits(includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
4623
+ signal: AbortSignal;
4624
+ }): Promise<Array<ExitTransactionStatus>>;
3428
4625
  /**
3429
4626
  * Reserve VTXOs so wallet-driven flows leave them alone: a locked VTXO is
3430
4627
  * excluded from coin selection.
@@ -3472,16 +4669,38 @@ export interface WalletLike {
3472
4669
  offboardVtxos(vtxoIds: Array<string>, bitcoinAddress: string, asyncOpts_?: {
3473
4670
  signal: AbortSignal;
3474
4671
  }): Promise<OffboardResult>;
4672
+ /**
4673
+ * Parse any payment string bark understands: a BIP 321 `bitcoin:` URI, a
4674
+ * `lightning:` URI (any case), a BOLT11 invoice, a BOLT12 offer, a
4675
+ * lightning address, an LNURL-pay link or LUD-17 `lnurlp://` URI, an Ark
4676
+ * address, a bitcoin address or a hex output script. Surrounding
4677
+ * whitespace is not trimmed.
4678
+ *
4679
+ * Problems with a single option (wrong network, an Ark address of
4680
+ * another server, an amount mismatch) are reported in that option's
4681
+ * `errors`. Errors only when nothing in the string can be paid at all.
4682
+ * Checking an Ark address needs a server connection.
4683
+ */
4684
+ parsePaymentRequest(payment: string, asyncOpts_?: {
4685
+ signal: AbortSignal;
4686
+ }): Promise<PaymentRequest>;
3475
4687
  /**
3476
4688
  * Pay to a Lightning Address (`user@domain`), resolved via LNURL-pay.
3477
4689
  */
3478
- payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait: boolean, asyncOpts_?: {
4690
+ payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
3479
4691
  signal: AbortSignal;
3480
4692
  }): Promise<LightningSendStatus>;
3481
- payLightningInvoice(invoice: string, amountSats: bigint | undefined, wait: boolean, asyncOpts_?: {
4693
+ /**
4694
+ * Pay a BOLT11 invoice.
4695
+ *
4696
+ * `retry_for_secs` is how long the Ark server keeps trying to pay,
4697
+ * capped to the server's maximum; `None` leaves it to the server and 0
4698
+ * makes a single attempt. The same holds for every `pay_*` method.
4699
+ */
4700
+ payLightningInvoice(invoice: string, amountSats: bigint | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
3482
4701
  signal: AbortSignal;
3483
4702
  }): Promise<LightningSendStatus>;
3484
- payLightningOffer(offer: string, amountSats: bigint | undefined, wait: boolean, asyncOpts_?: {
4703
+ payLightningOffer(offer: string, amountSats: bigint | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
3485
4704
  signal: AbortSignal;
3486
4705
  }): Promise<LightningSendStatus>;
3487
4706
  /**
@@ -3490,7 +4709,7 @@ export interface WalletLike {
3490
4709
  * Resolves the LNURL-pay endpoint to a BOLT11 invoice and pays it. Errors
3491
4710
  * if the link decodes to a non-pay LNURL (auth, withdraw, channel).
3492
4711
  */
3493
- payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait: boolean, asyncOpts_?: {
4712
+ payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
3494
4713
  signal: AbortSignal;
3495
4714
  }): Promise<LightningSendStatus>;
3496
4715
  peekAddress(index: number, asyncOpts_?: {
@@ -3589,13 +4808,32 @@ export interface WalletLike {
3589
4808
  *
3590
4809
  * An address this bark cannot deliver to (see `validateArkoorAddress`) is
3591
4810
  * rejected up front, leaving the VTXOs spendable rather than cosigned.
4811
+ *
4812
+ * Returns the id of the movement that records the payment.
3592
4813
  */
3593
4814
  sendArkoorPayment(arkAddress: string, amountSats: bigint, asyncOpts_?: {
3594
4815
  signal: AbortSignal;
3595
- }): Promise<void>;
4816
+ }): Promise<number>;
4817
+ /**
4818
+ * Send `amount_sats` from the offchain balance to an onchain address,
4819
+ * as an offboard. Returns the offboard txid and its movement id.
4820
+ */
3596
4821
  sendOnchain(address: string, amountSats: bigint, asyncOpts_?: {
3597
4822
  signal: AbortSignal;
3598
- }): Promise<string>;
4823
+ }): Promise<OffboardResult>;
4824
+ /**
4825
+ * Pay `method` over the matching rail: Ark, lightning or onchain.
4826
+ *
4827
+ * `amount_sats` is required for addresses and LNURL, and for invoices
4828
+ * and offers without an amount (`AvailablePaymentMethod.requires_amount`).
4829
+ * `comment` only reaches lightning addresses and LNURL. `wait` and
4830
+ * `retry_for_secs` only affect lightning. `retry_for_secs` is how long
4831
+ * the Ark server keeps trying to pay, capped to the server's maximum;
4832
+ * `None` leaves it to the server and 0 makes a single attempt.
4833
+ */
4834
+ sendPayment(method: PaymentMethod, amountSats: bigint | undefined, comment: string | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
4835
+ signal: AbortSignal;
4836
+ }): Promise<PaymentResult>;
3599
4837
  signExitClaimInputs(psbtBase64: string, asyncOpts_?: {
3600
4838
  signal: AbortSignal;
3601
4839
  }): Promise<string>;
@@ -3747,6 +4985,21 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3747
4985
  balance(asyncOpts_?: {
3748
4986
  signal: AbortSignal;
3749
4987
  }): Promise<Balance>;
4988
+ /**
4989
+ * The numbers to show a user, without the breakdown of `balance`: what
4990
+ * they can spend, what needs a refresh, what is pending and the total.
4991
+ */
4992
+ balanceSummary(asyncOpts_?: {
4993
+ signal: AbortSignal;
4994
+ }): Promise<BalanceSummary>;
4995
+ /**
4996
+ * Build a BIP 321 `bitcoin:` URI with a new Ark address, a new BOLT11
4997
+ * invoice (when there is an amount) and the caller's onchain address,
4998
+ * as `options` selects.
4999
+ */
5000
+ bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
5001
+ signal: AbortSignal;
5002
+ }): Promise<Bip321Uri>;
3750
5003
  boardAll(asyncOpts_?: {
3751
5004
  signal: AbortSignal;
3752
5005
  }): Promise<PendingBoard>;
@@ -3812,6 +5065,13 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3812
5065
  config(asyncOpts_?: {
3813
5066
  signal: AbortSignal;
3814
5067
  }): Promise<Config>;
5068
+ /**
5069
+ * The network, mailbox id and VTXO xpub, as `bark debug-info` prints
5070
+ * them. Users can share this in support requests.
5071
+ */
5072
+ debugInfo(asyncOpts_?: {
5073
+ signal: AbortSignal;
5074
+ }): Promise<DebugInfo>;
3815
5075
  /**
3816
5076
  * Build a PSBT claiming exited VTXOs to `address`.
3817
5077
  *
@@ -3836,13 +5096,14 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3836
5096
  * spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
3837
5097
  * use the chain's fast rate for the broadcast leg and regular rate for
3838
5098
  * the claim leg. `destination` only affects the claim transaction's weight.
5099
+ * `fee_margin` scales the broadcast leg (finite and non-negative; default
5100
+ * 1.2).
3839
5101
  *
3840
- * The onchain wallet is synced first so `fundable` reflects the current
3841
- * confirmed balance. Requires a BDK onchain wallet: callback-backed
3842
- * wallets (`CustomOnchainWalletCallbacks`) cannot simulate the CPFP walk
3843
- * and return an error.
5102
+ * The estimate never reads the onchain wallet, so it works before the
5103
+ * wallet holds funds and with callback wallets
5104
+ * (`CustomOnchainWalletCallbacks`) too.
3844
5105
  */
3845
- estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, asyncOpts_?: {
5106
+ estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, feeMargin?: number | undefined, asyncOpts_?: {
3846
5107
  signal: AbortSignal;
3847
5108
  }): Promise<EmergencyExitFeeEstimate>;
3848
5109
  estimateLightningReceiveFee(amountSats: bigint, asyncOpts_?: {
@@ -3857,6 +5118,12 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3857
5118
  estimateOffboardFee(address: string, vtxoIds: Array<string>, asyncOpts_?: {
3858
5119
  signal: AbortSignal;
3859
5120
  }): Promise<FeeEstimate>;
5121
+ /**
5122
+ * Estimate the fee of paying `amount_sats` to `method`.
5123
+ */
5124
+ estimatePaymentFee(method: PaymentMethod, amountSats: bigint, asyncOpts_?: {
5125
+ signal: AbortSignal;
5126
+ }): Promise<FeeEstimate>;
3860
5127
  estimateRefreshFee(vtxoIds: Array<string>, asyncOpts_?: {
3861
5128
  signal: AbortSignal;
3862
5129
  }): Promise<FeeEstimate>;
@@ -3864,9 +5131,17 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3864
5131
  signal: AbortSignal;
3865
5132
  }): Promise<FeeEstimate>;
3866
5133
  fingerprint(): string;
5134
+ /**
5135
+ * Status of one exit, live or finished. `None` if no exit was ever
5136
+ * started for the VTXO.
5137
+ */
3867
5138
  getExitStatus(vtxoId: string, includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
3868
5139
  signal: AbortSignal;
3869
5140
  }): Promise<ExitTransactionStatus | undefined>;
5141
+ /**
5142
+ * Live exits only. Finished exits leave this list; see
5143
+ * `list_finished_exits` and `get_exit_status`.
5144
+ */
3870
5145
  getExitVtxos(asyncOpts_?: {
3871
5146
  signal: AbortSignal;
3872
5147
  }): Promise<Array<ExitVtxo>>;
@@ -3942,9 +5217,29 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3942
5217
  lightningSendState(paymentHash: string, asyncOpts_?: {
3943
5218
  signal: AbortSignal;
3944
5219
  }): Promise<LightningSendStatus>;
5220
+ /**
5221
+ * Status of every exit this wallet ever started, live and finished.
5222
+ */
5223
+ listAllExits(includeHistory?: boolean, includeTransactions?: boolean, asyncOpts_?: {
5224
+ signal: AbortSignal;
5225
+ }): Promise<Array<ExitTransactionStatus>>;
3945
5226
  listClaimableExits(asyncOpts_?: {
3946
5227
  signal: AbortSignal;
3947
5228
  }): Promise<Array<ExitVtxo>>;
5229
+ /**
5230
+ * Status of the exits in a terminal state: claimed, canceled, or aborted
5231
+ * because the VTXO was already spent or swept. They stay queryable after
5232
+ * completion, so a client need not snapshot them at drain time.
5233
+ */
5234
+ listFinishedExits(includeHistory?: boolean, includeTransactions?: boolean, asyncOpts_?: {
5235
+ signal: AbortSignal;
5236
+ }): Promise<Array<ExitTransactionStatus>>;
5237
+ /**
5238
+ * Status of the exits that are still progressing.
5239
+ */
5240
+ listLiveExits(includeHistory?: boolean, includeTransactions?: boolean, asyncOpts_?: {
5241
+ signal: AbortSignal;
5242
+ }): Promise<Array<ExitTransactionStatus>>;
3948
5243
  /**
3949
5244
  * Reserve VTXOs so wallet-driven flows leave them alone: a locked VTXO is
3950
5245
  * excluded from coin selection.
@@ -3992,16 +5287,38 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
3992
5287
  offboardVtxos(vtxoIds: Array<string>, bitcoinAddress: string, asyncOpts_?: {
3993
5288
  signal: AbortSignal;
3994
5289
  }): Promise<OffboardResult>;
5290
+ /**
5291
+ * Parse any payment string bark understands: a BIP 321 `bitcoin:` URI, a
5292
+ * `lightning:` URI (any case), a BOLT11 invoice, a BOLT12 offer, a
5293
+ * lightning address, an LNURL-pay link or LUD-17 `lnurlp://` URI, an Ark
5294
+ * address, a bitcoin address or a hex output script. Surrounding
5295
+ * whitespace is not trimmed.
5296
+ *
5297
+ * Problems with a single option (wrong network, an Ark address of
5298
+ * another server, an amount mismatch) are reported in that option's
5299
+ * `errors`. Errors only when nothing in the string can be paid at all.
5300
+ * Checking an Ark address needs a server connection.
5301
+ */
5302
+ parsePaymentRequest(payment: string, asyncOpts_?: {
5303
+ signal: AbortSignal;
5304
+ }): Promise<PaymentRequest>;
3995
5305
  /**
3996
5306
  * Pay to a Lightning Address (`user@domain`), resolved via LNURL-pay.
3997
5307
  */
3998
- payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait?: boolean, asyncOpts_?: {
5308
+ payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
3999
5309
  signal: AbortSignal;
4000
5310
  }): Promise<LightningSendStatus>;
4001
- payLightningInvoice(invoice: string, amountSats: bigint | undefined, wait?: boolean, asyncOpts_?: {
5311
+ /**
5312
+ * Pay a BOLT11 invoice.
5313
+ *
5314
+ * `retry_for_secs` is how long the Ark server keeps trying to pay,
5315
+ * capped to the server's maximum; `None` leaves it to the server and 0
5316
+ * makes a single attempt. The same holds for every `pay_*` method.
5317
+ */
5318
+ payLightningInvoice(invoice: string, amountSats: bigint | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
4002
5319
  signal: AbortSignal;
4003
5320
  }): Promise<LightningSendStatus>;
4004
- payLightningOffer(offer: string, amountSats: bigint | undefined, wait?: boolean, asyncOpts_?: {
5321
+ payLightningOffer(offer: string, amountSats: bigint | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
4005
5322
  signal: AbortSignal;
4006
5323
  }): Promise<LightningSendStatus>;
4007
5324
  /**
@@ -4010,7 +5327,7 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
4010
5327
  * Resolves the LNURL-pay endpoint to a BOLT11 invoice and pays it. Errors
4011
5328
  * if the link decodes to a non-pay LNURL (auth, withdraw, channel).
4012
5329
  */
4013
- payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait?: boolean, asyncOpts_?: {
5330
+ payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
4014
5331
  signal: AbortSignal;
4015
5332
  }): Promise<LightningSendStatus>;
4016
5333
  peekAddress(index: number, asyncOpts_?: {
@@ -4109,13 +5426,32 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
4109
5426
  *
4110
5427
  * An address this bark cannot deliver to (see `validateArkoorAddress`) is
4111
5428
  * rejected up front, leaving the VTXOs spendable rather than cosigned.
5429
+ *
5430
+ * Returns the id of the movement that records the payment.
4112
5431
  */
4113
5432
  sendArkoorPayment(arkAddress: string, amountSats: bigint, asyncOpts_?: {
4114
5433
  signal: AbortSignal;
4115
- }): Promise<void>;
5434
+ }): Promise<number>;
5435
+ /**
5436
+ * Send `amount_sats` from the offchain balance to an onchain address,
5437
+ * as an offboard. Returns the offboard txid and its movement id.
5438
+ */
4116
5439
  sendOnchain(address: string, amountSats: bigint, asyncOpts_?: {
4117
5440
  signal: AbortSignal;
4118
- }): Promise<string>;
5441
+ }): Promise<OffboardResult>;
5442
+ /**
5443
+ * Pay `method` over the matching rail: Ark, lightning or onchain.
5444
+ *
5445
+ * `amount_sats` is required for addresses and LNURL, and for invoices
5446
+ * and offers without an amount (`AvailablePaymentMethod.requires_amount`).
5447
+ * `comment` only reaches lightning addresses and LNURL. `wait` and
5448
+ * `retry_for_secs` only affect lightning. `retry_for_secs` is how long
5449
+ * the Ark server keeps trying to pay, capped to the server's maximum;
5450
+ * `None` leaves it to the server and 0 makes a single attempt.
5451
+ */
5452
+ sendPayment(method: PaymentMethod, amountSats?: bigint | undefined, comment?: string | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
5453
+ signal: AbortSignal;
5454
+ }): Promise<PaymentResult>;
4119
5455
  signExitClaimInputs(psbtBase64: string, asyncOpts_?: {
4120
5456
  signal: AbortSignal;
4121
5457
  }): Promise<string>;
@@ -4241,6 +5577,13 @@ declare const _default: Readonly<{
4241
5577
  lift(value: Uint8Array): ArkInfo;
4242
5578
  lower(value: ArkInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4243
5579
  };
5580
+ FfiConverterTypeAvailablePaymentMethod: {
5581
+ readFromCursor(c: Cursor): AvailablePaymentMethod;
5582
+ writeIntoCursor(value: AvailablePaymentMethod, c: Cursor): void;
5583
+ allocationSize(value: AvailablePaymentMethod): number;
5584
+ lift(value: Uint8Array): AvailablePaymentMethod;
5585
+ lower(value: AvailablePaymentMethod, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5586
+ };
4244
5587
  FfiConverterTypeBalance: {
4245
5588
  readFromCursor(c: Cursor): Balance;
4246
5589
  writeIntoCursor(value: Balance, c: Cursor): void;
@@ -4248,7 +5591,28 @@ declare const _default: Readonly<{
4248
5591
  lift(value: Uint8Array): Balance;
4249
5592
  lower(value: Balance, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4250
5593
  };
5594
+ FfiConverterTypeBalanceSummary: {
5595
+ readFromCursor(c: Cursor): BalanceSummary;
5596
+ writeIntoCursor(value: BalanceSummary, c: Cursor): void;
5597
+ allocationSize(value: BalanceSummary): number;
5598
+ lift(value: Uint8Array): BalanceSummary;
5599
+ lower(value: BalanceSummary, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5600
+ };
4251
5601
  FfiConverterTypeBarkLogger: FfiConverterObjectWithCallbacks<BarkLogger>;
5602
+ FfiConverterTypeBip321Uri: {
5603
+ readFromCursor(c: Cursor): Bip321Uri;
5604
+ writeIntoCursor(value: Bip321Uri, c: Cursor): void;
5605
+ allocationSize(value: Bip321Uri): number;
5606
+ lift(value: Uint8Array): Bip321Uri;
5607
+ lower(value: Bip321Uri, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5608
+ };
5609
+ FfiConverterTypeBip321UriOptions: {
5610
+ readFromCursor(c: Cursor): Bip321UriOptions;
5611
+ writeIntoCursor(value: Bip321UriOptions, c: Cursor): void;
5612
+ allocationSize(value: Bip321UriOptions): number;
5613
+ lift(value: Uint8Array): Bip321UriOptions;
5614
+ lower(value: Bip321UriOptions, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5615
+ };
4252
5616
  FfiConverterTypeBlockRef: {
4253
5617
  readFromCursor(c: Cursor): BlockRef;
4254
5618
  writeIntoCursor(value: BlockRef, c: Cursor): void;
@@ -4270,6 +5634,13 @@ declare const _default: Readonly<{
4270
5634
  lift(value: Uint8Array): BoardFundingInfo;
4271
5635
  lower(value: BoardFundingInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4272
5636
  };
5637
+ FfiConverterTypeBolt11InvoiceDetails: {
5638
+ readFromCursor(c: Cursor): Bolt11InvoiceDetails;
5639
+ writeIntoCursor(value: Bolt11InvoiceDetails, c: Cursor): void;
5640
+ allocationSize(value: Bolt11InvoiceDetails): number;
5641
+ lift(value: Uint8Array): Bolt11InvoiceDetails;
5642
+ lower(value: Bolt11InvoiceDetails, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5643
+ };
4273
5644
  FfiConverterTypeConfig: {
4274
5645
  readFromCursor(c: Cursor): Config;
4275
5646
  writeIntoCursor(value: Config, c: Cursor): void;
@@ -4285,6 +5656,20 @@ declare const _default: Readonly<{
4285
5656
  lower(value: CpfpParams, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4286
5657
  };
4287
5658
  FfiConverterTypeCustomOnchainWalletCallbacks: FfiConverterObjectWithCallbacks<CustomOnchainWalletCallbacks>;
5659
+ FfiConverterTypeDatadirInfo: {
5660
+ readFromCursor(c: Cursor): DatadirInfo;
5661
+ writeIntoCursor(value: DatadirInfo, c: Cursor): void;
5662
+ allocationSize(value: DatadirInfo): number;
5663
+ lift(value: Uint8Array): DatadirInfo;
5664
+ lower(value: DatadirInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5665
+ };
5666
+ FfiConverterTypeDebugInfo: {
5667
+ readFromCursor(c: Cursor): DebugInfo;
5668
+ writeIntoCursor(value: DebugInfo, c: Cursor): void;
5669
+ allocationSize(value: DebugInfo): number;
5670
+ lift(value: Uint8Array): DebugInfo;
5671
+ lower(value: DebugInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5672
+ };
4288
5673
  FfiConverterTypeDestination: {
4289
5674
  readFromCursor(c: Cursor): Destination;
4290
5675
  writeIntoCursor(value: Destination, c: Cursor): void;
@@ -4400,6 +5785,13 @@ declare const _default: Readonly<{
4400
5785
  lift(value: Uint8Array): ExitCancelResult;
4401
5786
  lower(value: ExitCancelResult, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4402
5787
  };
5788
+ FfiConverterTypeExitChildTransaction: {
5789
+ readFromCursor(c: Cursor): ExitChildTransaction;
5790
+ writeIntoCursor(value: ExitChildTransaction, c: Cursor): void;
5791
+ allocationSize(value: ExitChildTransaction): number;
5792
+ lift(value: Uint8Array): ExitChildTransaction;
5793
+ lower(value: ExitChildTransaction, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5794
+ };
4403
5795
  FfiConverterTypeExitClaimTransaction: {
4404
5796
  readFromCursor(c: Cursor): ExitClaimTransaction;
4405
5797
  writeIntoCursor(value: ExitClaimTransaction, c: Cursor): void;
@@ -4428,6 +5820,13 @@ declare const _default: Readonly<{
4428
5820
  lift(value: Uint8Array): ExitStateKind;
4429
5821
  lower(value: ExitStateKind, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4430
5822
  };
5823
+ FfiConverterTypeExitTransactionPackage: {
5824
+ readFromCursor(c: Cursor): ExitTransactionPackage;
5825
+ writeIntoCursor(value: ExitTransactionPackage, c: Cursor): void;
5826
+ allocationSize(value: ExitTransactionPackage): number;
5827
+ lift(value: Uint8Array): ExitTransactionPackage;
5828
+ lower(value: ExitTransactionPackage, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5829
+ };
4431
5830
  FfiConverterTypeExitTransactionStatus: {
4432
5831
  readFromCursor(c: Cursor): ExitTransactionStatus;
4433
5832
  writeIntoCursor(value: ExitTransactionStatus, c: Cursor): void;
@@ -4591,6 +5990,34 @@ declare const _default: Readonly<{
4591
5990
  lift(value: Uint8Array): OutPoint;
4592
5991
  lower(value: OutPoint, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
4593
5992
  };
5993
+ FfiConverterTypePaymentMethod: {
5994
+ readFromCursor(c: Cursor): PaymentMethod;
5995
+ writeIntoCursor(value: PaymentMethod, c: Cursor): void;
5996
+ allocationSize(value: PaymentMethod): number;
5997
+ lift(value: Uint8Array): PaymentMethod;
5998
+ lower(value: PaymentMethod, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
5999
+ };
6000
+ FfiConverterTypePaymentMethodParsingError: {
6001
+ readFromCursor(c: Cursor): PaymentMethodParsingError;
6002
+ writeIntoCursor(value: PaymentMethodParsingError, c: Cursor): void;
6003
+ allocationSize(value: PaymentMethodParsingError): number;
6004
+ lift(value: Uint8Array): PaymentMethodParsingError;
6005
+ lower(value: PaymentMethodParsingError, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
6006
+ };
6007
+ FfiConverterTypePaymentRequest: {
6008
+ readFromCursor(c: Cursor): PaymentRequest;
6009
+ writeIntoCursor(value: PaymentRequest, c: Cursor): void;
6010
+ allocationSize(value: PaymentRequest): number;
6011
+ lift(value: Uint8Array): PaymentRequest;
6012
+ lower(value: PaymentRequest, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
6013
+ };
6014
+ FfiConverterTypePaymentResult: {
6015
+ readFromCursor(c: Cursor): PaymentResult;
6016
+ writeIntoCursor(value: PaymentResult, c: Cursor): void;
6017
+ allocationSize(value: PaymentResult): number;
6018
+ lift(value: Uint8Array): PaymentResult;
6019
+ lower(value: PaymentResult, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
6020
+ };
4594
6021
  FfiConverterTypePendingBoard: {
4595
6022
  readFromCursor(c: Cursor): PendingBoard;
4596
6023
  writeIntoCursor(value: PendingBoard, c: Cursor): void;