@secondts/bark-react-native 0.26.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -32
- package/cpp/generated/bark.cpp +81 -6
- package/cpp/generated/bark.hpp +4 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +156 -10
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +155 -9
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +6 -2
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +513 -6
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +6 -2
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +513 -6
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -9
- package/src/generated/bark-ffi.ts +6 -2
- package/src/generated/bark.ts +984 -84
|
@@ -44,6 +44,8 @@ export declare function generateMnemonic(): string;
|
|
|
44
44
|
* Low-level function to initialize a wallet
|
|
45
45
|
*
|
|
46
46
|
* You probably want to use [`Wallet::open`] instead.
|
|
47
|
+
*
|
|
48
|
+
* `datadir` is a filesystem path or a `file://` URI.
|
|
47
49
|
*/
|
|
48
50
|
export declare function initWallet(network: Network, mnemonicOrSeed: string, config: Config, datadir: string, allowUnreachableServer: boolean, asyncOpts_?: {
|
|
49
51
|
signal: AbortSignal;
|
|
@@ -88,6 +90,8 @@ export declare function validateMnemonic(mnemonic: string): boolean;
|
|
|
88
90
|
/**
|
|
89
91
|
* Whether `datadir` holds an initialized bark wallet.
|
|
90
92
|
*
|
|
93
|
+
* `datadir` is a filesystem path or a `file://` URI.
|
|
94
|
+
*
|
|
91
95
|
* Answers without side effects: the database is opened read-only, no
|
|
92
96
|
* migration runs and no file or directory is created. Returns `false` for a
|
|
93
97
|
* missing or empty directory and for a database that never got its wallet
|
|
@@ -1597,6 +1601,29 @@ export declare const ExitClaimTransaction: Readonly<{
|
|
|
1597
1601
|
new: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
|
|
1598
1602
|
defaults: () => Partial<ExitClaimTransaction>;
|
|
1599
1603
|
}>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Fee a transaction commits together with its unconfirmed ancestors,
|
|
1606
|
+
* mirroring `bark::exit::FeeInfo`.
|
|
1607
|
+
*/
|
|
1608
|
+
export type ExitFeeInfo = {
|
|
1609
|
+
/**
|
|
1610
|
+
* Effective fee rate, in sat/kwu (lossless; divide by 250 for sat/vB).
|
|
1611
|
+
*/
|
|
1612
|
+
feeRateSatPerKwu: bigint;
|
|
1613
|
+
/**
|
|
1614
|
+
* Sum of the transaction's own fee and the fees of its unconfirmed
|
|
1615
|
+
* ancestors.
|
|
1616
|
+
*/
|
|
1617
|
+
totalFeeSats: bigint;
|
|
1618
|
+
};
|
|
1619
|
+
/**
|
|
1620
|
+
* Generated factory for {@link ExitFeeInfo} record objects.
|
|
1621
|
+
*/
|
|
1622
|
+
export declare const ExitFeeInfo: Readonly<{
|
|
1623
|
+
create: (partial: Partial<ExitFeeInfo> & Required<Omit<ExitFeeInfo, never>>) => ExitFeeInfo;
|
|
1624
|
+
new: (partial: Partial<ExitFeeInfo> & Required<Omit<ExitFeeInfo, never>>) => ExitFeeInfo;
|
|
1625
|
+
defaults: () => Partial<ExitFeeInfo>;
|
|
1626
|
+
}>;
|
|
1600
1627
|
export declare enum ExitTxStatus_Tags {
|
|
1601
1628
|
VerifyInputs = "VerifyInputs",
|
|
1602
1629
|
AwaitingInputConfirmation = "AwaitingInputConfirmation",
|
|
@@ -2278,6 +2305,24 @@ export declare const ExitProgressStatus: Readonly<{
|
|
|
2278
2305
|
new: (partial: Partial<ExitProgressStatus> & Required<Omit<ExitProgressStatus, "error">>) => ExitProgressStatus;
|
|
2279
2306
|
defaults: () => Partial<ExitProgressStatus>;
|
|
2280
2307
|
}>;
|
|
2308
|
+
/**
|
|
2309
|
+
* A transaction of an exit chain, mirroring `bark::exit::TransactionInfo`.
|
|
2310
|
+
*/
|
|
2311
|
+
export type ExitTransactionInfo = {
|
|
2312
|
+
txid: string;
|
|
2313
|
+
/**
|
|
2314
|
+
* Consensus-encoded transaction, hex.
|
|
2315
|
+
*/
|
|
2316
|
+
txHex: string;
|
|
2317
|
+
};
|
|
2318
|
+
/**
|
|
2319
|
+
* Generated factory for {@link ExitTransactionInfo} record objects.
|
|
2320
|
+
*/
|
|
2321
|
+
export declare const ExitTransactionInfo: Readonly<{
|
|
2322
|
+
create: (partial: Partial<ExitTransactionInfo> & Required<Omit<ExitTransactionInfo, never>>) => ExitTransactionInfo;
|
|
2323
|
+
new: (partial: Partial<ExitTransactionInfo> & Required<Omit<ExitTransactionInfo, never>>) => ExitTransactionInfo;
|
|
2324
|
+
defaults: () => Partial<ExitTransactionInfo>;
|
|
2325
|
+
}>;
|
|
2281
2326
|
/**
|
|
2282
2327
|
* One transaction of an exit: the exit transaction itself and, once it was
|
|
2283
2328
|
* fee-bumped, the child that confirms it. A unilateral exit is a chain of
|
|
@@ -2598,6 +2643,263 @@ export declare const PendingBoard: Readonly<{
|
|
|
2598
2643
|
new: (partial: Partial<PendingBoard> & Required<Omit<PendingBoard, never>>) => PendingBoard;
|
|
2599
2644
|
defaults: () => Partial<PendingBoard>;
|
|
2600
2645
|
}>;
|
|
2646
|
+
export declare enum PresignedExitStatus_Tags {
|
|
2647
|
+
FullySigned = "FullySigned",
|
|
2648
|
+
PartiallySigned = "PartiallySigned",
|
|
2649
|
+
Unsigned = "Unsigned"
|
|
2650
|
+
}
|
|
2651
|
+
/**
|
|
2652
|
+
* How much of a [`PresignedExit`]'s remaining broadcast work could be funded
|
|
2653
|
+
* and signed, mirroring `bark::exit::PresignedExitStatus`.
|
|
2654
|
+
*/
|
|
2655
|
+
export declare const PresignedExitStatus: Readonly<{
|
|
2656
|
+
instanceOf: (obj: any) => obj is PresignedExitStatus;
|
|
2657
|
+
FullySigned: {
|
|
2658
|
+
new (inner: {
|
|
2659
|
+
exitedInWave?: number;
|
|
2660
|
+
feeInfo: ExitFeeInfo;
|
|
2661
|
+
}): {
|
|
2662
|
+
readonly tag: PresignedExitStatus_Tags.FullySigned;
|
|
2663
|
+
readonly inner: Readonly<{
|
|
2664
|
+
exitedInWave?: number;
|
|
2665
|
+
feeInfo: ExitFeeInfo;
|
|
2666
|
+
}>;
|
|
2667
|
+
/**
|
|
2668
|
+
* @private
|
|
2669
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2670
|
+
*/
|
|
2671
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2672
|
+
};
|
|
2673
|
+
new(inner: {
|
|
2674
|
+
exitedInWave?: number;
|
|
2675
|
+
feeInfo: ExitFeeInfo;
|
|
2676
|
+
}): {
|
|
2677
|
+
readonly tag: PresignedExitStatus_Tags.FullySigned;
|
|
2678
|
+
readonly inner: Readonly<{
|
|
2679
|
+
exitedInWave?: number;
|
|
2680
|
+
feeInfo: ExitFeeInfo;
|
|
2681
|
+
}>;
|
|
2682
|
+
/**
|
|
2683
|
+
* @private
|
|
2684
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2685
|
+
*/
|
|
2686
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2687
|
+
};
|
|
2688
|
+
instanceOf(obj: any): obj is {
|
|
2689
|
+
readonly tag: PresignedExitStatus_Tags.FullySigned;
|
|
2690
|
+
readonly inner: Readonly<{
|
|
2691
|
+
exitedInWave?: number;
|
|
2692
|
+
feeInfo: ExitFeeInfo;
|
|
2693
|
+
}>;
|
|
2694
|
+
/**
|
|
2695
|
+
* @private
|
|
2696
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2697
|
+
*/
|
|
2698
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2699
|
+
};
|
|
2700
|
+
};
|
|
2701
|
+
PartiallySigned: {
|
|
2702
|
+
new (inner: {
|
|
2703
|
+
lastWave: number;
|
|
2704
|
+
}): {
|
|
2705
|
+
readonly tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
2706
|
+
readonly inner: Readonly<{
|
|
2707
|
+
lastWave: number;
|
|
2708
|
+
}>;
|
|
2709
|
+
/**
|
|
2710
|
+
* @private
|
|
2711
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2712
|
+
*/
|
|
2713
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2714
|
+
};
|
|
2715
|
+
new(inner: {
|
|
2716
|
+
lastWave: number;
|
|
2717
|
+
}): {
|
|
2718
|
+
readonly tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
2719
|
+
readonly inner: Readonly<{
|
|
2720
|
+
lastWave: number;
|
|
2721
|
+
}>;
|
|
2722
|
+
/**
|
|
2723
|
+
* @private
|
|
2724
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2725
|
+
*/
|
|
2726
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2727
|
+
};
|
|
2728
|
+
instanceOf(obj: any): obj is {
|
|
2729
|
+
readonly tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
2730
|
+
readonly inner: Readonly<{
|
|
2731
|
+
lastWave: number;
|
|
2732
|
+
}>;
|
|
2733
|
+
/**
|
|
2734
|
+
* @private
|
|
2735
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2736
|
+
*/
|
|
2737
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2738
|
+
};
|
|
2739
|
+
};
|
|
2740
|
+
Unsigned: {
|
|
2741
|
+
new (): {
|
|
2742
|
+
readonly tag: PresignedExitStatus_Tags.Unsigned;
|
|
2743
|
+
/**
|
|
2744
|
+
* @private
|
|
2745
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2746
|
+
*/
|
|
2747
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2748
|
+
};
|
|
2749
|
+
new(): {
|
|
2750
|
+
readonly tag: PresignedExitStatus_Tags.Unsigned;
|
|
2751
|
+
/**
|
|
2752
|
+
* @private
|
|
2753
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2754
|
+
*/
|
|
2755
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2756
|
+
};
|
|
2757
|
+
instanceOf(obj: any): obj is {
|
|
2758
|
+
readonly tag: PresignedExitStatus_Tags.Unsigned;
|
|
2759
|
+
/**
|
|
2760
|
+
* @private
|
|
2761
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2762
|
+
*/
|
|
2763
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2764
|
+
};
|
|
2765
|
+
};
|
|
2766
|
+
}>;
|
|
2767
|
+
/**
|
|
2768
|
+
* How much of a [`PresignedExit`]'s remaining broadcast work could be funded
|
|
2769
|
+
* and signed, mirroring `bark::exit::PresignedExitStatus`.
|
|
2770
|
+
*/
|
|
2771
|
+
export type PresignedExitStatus = InstanceType<typeof PresignedExitStatus['FullySigned' | 'PartiallySigned' | 'Unsigned']>;
|
|
2772
|
+
/**
|
|
2773
|
+
* The presigned broadcast work for one VTXO, mirroring
|
|
2774
|
+
* `bark::exit::PresignedExit`.
|
|
2775
|
+
*/
|
|
2776
|
+
export type PresignedExit = {
|
|
2777
|
+
vtxoId: string;
|
|
2778
|
+
status: PresignedExitStatus;
|
|
2779
|
+
/**
|
|
2780
|
+
* The remaining tail of this exit's chain that could not be funded, in
|
|
2781
|
+
* broadcast order; its first transaction spends this exit's last signed
|
|
2782
|
+
* one. Empty when fully signed.
|
|
2783
|
+
*/
|
|
2784
|
+
unsigned: Array<ExitTransactionInfo>;
|
|
2785
|
+
};
|
|
2786
|
+
/**
|
|
2787
|
+
* Generated factory for {@link PresignedExit} record objects.
|
|
2788
|
+
*/
|
|
2789
|
+
export declare const PresignedExit: Readonly<{
|
|
2790
|
+
create: (partial: Partial<PresignedExit> & Required<Omit<PresignedExit, never>>) => PresignedExit;
|
|
2791
|
+
new: (partial: Partial<PresignedExit> & Required<Omit<PresignedExit, never>>) => PresignedExit;
|
|
2792
|
+
defaults: () => Partial<PresignedExit>;
|
|
2793
|
+
}>;
|
|
2794
|
+
/**
|
|
2795
|
+
* A signed CPFP child and the fee it commits, mirroring
|
|
2796
|
+
* `bark::exit::PresignedExitChildInfo`.
|
|
2797
|
+
*/
|
|
2798
|
+
export type PresignedExitChild = {
|
|
2799
|
+
txid: string;
|
|
2800
|
+
/**
|
|
2801
|
+
* Consensus-encoded signed transaction, hex.
|
|
2802
|
+
*/
|
|
2803
|
+
txHex: string;
|
|
2804
|
+
/**
|
|
2805
|
+
* The exit transaction is zero-fee, so this is the fee of the whole
|
|
2806
|
+
* package.
|
|
2807
|
+
*/
|
|
2808
|
+
feeInfo: ExitFeeInfo;
|
|
2809
|
+
};
|
|
2810
|
+
/**
|
|
2811
|
+
* Generated factory for {@link PresignedExitChild} record objects.
|
|
2812
|
+
*/
|
|
2813
|
+
export declare const PresignedExitChild: Readonly<{
|
|
2814
|
+
create: (partial: Partial<PresignedExitChild> & Required<Omit<PresignedExitChild, never>>) => PresignedExitChild;
|
|
2815
|
+
new: (partial: Partial<PresignedExitChild> & Required<Omit<PresignedExitChild, never>>) => PresignedExitChild;
|
|
2816
|
+
defaults: () => Partial<PresignedExitChild>;
|
|
2817
|
+
}>;
|
|
2818
|
+
/**
|
|
2819
|
+
* An `(exit, child)` transaction package, broadcast as one unit (e.g. with
|
|
2820
|
+
* `submitpackage`), mirroring `bark::exit::PresignedExitPackage`.
|
|
2821
|
+
*/
|
|
2822
|
+
export type PresignedExitPackage = {
|
|
2823
|
+
/**
|
|
2824
|
+
* The VTXO whose exit this package advances.
|
|
2825
|
+
*/
|
|
2826
|
+
vtxoId: string;
|
|
2827
|
+
/**
|
|
2828
|
+
* The zero-fee exit transaction.
|
|
2829
|
+
*/
|
|
2830
|
+
exit: ExitTransactionInfo;
|
|
2831
|
+
/**
|
|
2832
|
+
* The signed CPFP child paying for `exit`.
|
|
2833
|
+
*/
|
|
2834
|
+
child: PresignedExitChild;
|
|
2835
|
+
};
|
|
2836
|
+
/**
|
|
2837
|
+
* Generated factory for {@link PresignedExitPackage} record objects.
|
|
2838
|
+
*/
|
|
2839
|
+
export declare const PresignedExitPackage: Readonly<{
|
|
2840
|
+
create: (partial: Partial<PresignedExitPackage> & Required<Omit<PresignedExitPackage, never>>) => PresignedExitPackage;
|
|
2841
|
+
new: (partial: Partial<PresignedExitPackage> & Required<Omit<PresignedExitPackage, never>>) => PresignedExitPackage;
|
|
2842
|
+
defaults: () => Partial<PresignedExitPackage>;
|
|
2843
|
+
}>;
|
|
2844
|
+
/**
|
|
2845
|
+
* One step of a presigned broadcast plan, mirroring
|
|
2846
|
+
* `bark::exit::PresignedWave`. See [`PresignedExits`] for the rules.
|
|
2847
|
+
*/
|
|
2848
|
+
export type PresignedWave = {
|
|
2849
|
+
/**
|
|
2850
|
+
* Packages funded independently of each other, broadcast together.
|
|
2851
|
+
*/
|
|
2852
|
+
packages: Array<PresignedExitPackage>;
|
|
2853
|
+
/**
|
|
2854
|
+
* Exit transactions already in the mempool; they confirm with this wave.
|
|
2855
|
+
* Only the first wave has any.
|
|
2856
|
+
*/
|
|
2857
|
+
inMempool: Array<ExitTransactionInfo>;
|
|
2858
|
+
};
|
|
2859
|
+
/**
|
|
2860
|
+
* Generated factory for {@link PresignedWave} record objects.
|
|
2861
|
+
*/
|
|
2862
|
+
export declare const PresignedWave: Readonly<{
|
|
2863
|
+
create: (partial: Partial<PresignedWave> & Required<Omit<PresignedWave, never>>) => PresignedWave;
|
|
2864
|
+
new: (partial: Partial<PresignedWave> & Required<Omit<PresignedWave, never>>) => PresignedWave;
|
|
2865
|
+
defaults: () => Partial<PresignedWave>;
|
|
2866
|
+
}>;
|
|
2867
|
+
/**
|
|
2868
|
+
* Presigned emergency-exit chains for a set of VTXOs: a wave-by-wave
|
|
2869
|
+
* broadcast plan plus a per-VTXO summary, mirroring
|
|
2870
|
+
* `bark::exit::PresignedExits`.
|
|
2871
|
+
*
|
|
2872
|
+
* Execute the plan in wave order: broadcast all of a wave's packages
|
|
2873
|
+
* together, then wait for every one, and its `in_mempool` transactions, to
|
|
2874
|
+
* confirm before the next wave. Each wave's children spend change confirmed
|
|
2875
|
+
* by the previous wave.
|
|
2876
|
+
*
|
|
2877
|
+
* Presigning reserves no funds, so a later spend from the onchain wallet can
|
|
2878
|
+
* invalidate the remaining children. It does reveal the change addresses
|
|
2879
|
+
* those children pay to. The children are fully signed: treat the result as
|
|
2880
|
+
* sensitive and store it accordingly.
|
|
2881
|
+
*/
|
|
2882
|
+
export type PresignedExits = {
|
|
2883
|
+
/**
|
|
2884
|
+
* One entry per requested VTXO, in request order (duplicates resolve to
|
|
2885
|
+
* their first occurrence).
|
|
2886
|
+
*/
|
|
2887
|
+
exits: Array<PresignedExit>;
|
|
2888
|
+
/**
|
|
2889
|
+
* The broadcast plan. Confirmed transactions are omitted, relayed ones are
|
|
2890
|
+
* listed in [`PresignedWave::in_mempool`], and a package shared by several
|
|
2891
|
+
* exits appears once, under the first exit that references it.
|
|
2892
|
+
*/
|
|
2893
|
+
waves: Array<PresignedWave>;
|
|
2894
|
+
};
|
|
2895
|
+
/**
|
|
2896
|
+
* Generated factory for {@link PresignedExits} record objects.
|
|
2897
|
+
*/
|
|
2898
|
+
export declare const PresignedExits: Readonly<{
|
|
2899
|
+
create: (partial: Partial<PresignedExits> & Required<Omit<PresignedExits, never>>) => PresignedExits;
|
|
2900
|
+
new: (partial: Partial<PresignedExits> & Required<Omit<PresignedExits, never>>) => PresignedExits;
|
|
2901
|
+
defaults: () => Partial<PresignedExits>;
|
|
2902
|
+
}>;
|
|
2601
2903
|
/**
|
|
2602
2904
|
* One bucket of a [`RecoveryReport`].
|
|
2603
2905
|
*
|
|
@@ -2668,6 +2970,51 @@ export declare const RecoveryReport: Readonly<{
|
|
|
2668
2970
|
new: (partial: Partial<RecoveryReport> & Required<Omit<RecoveryReport, never>>) => RecoveryReport;
|
|
2669
2971
|
defaults: () => Partial<RecoveryReport>;
|
|
2670
2972
|
}>;
|
|
2973
|
+
/**
|
|
2974
|
+
* The exit transactions one VTXO still needs confirmed to be exited.
|
|
2975
|
+
*/
|
|
2976
|
+
export type RemainingExit = {
|
|
2977
|
+
vtxoId: string;
|
|
2978
|
+
/**
|
|
2979
|
+
* Txids in broadcast order. Each one's transaction is in
|
|
2980
|
+
* [`RemainingExitTransactions::transactions`]. Empty when the chain is
|
|
2981
|
+
* already confirmed.
|
|
2982
|
+
*/
|
|
2983
|
+
txids: Array<string>;
|
|
2984
|
+
};
|
|
2985
|
+
/**
|
|
2986
|
+
* Generated factory for {@link RemainingExit} record objects.
|
|
2987
|
+
*/
|
|
2988
|
+
export declare const RemainingExit: Readonly<{
|
|
2989
|
+
create: (partial: Partial<RemainingExit> & Required<Omit<RemainingExit, never>>) => RemainingExit;
|
|
2990
|
+
new: (partial: Partial<RemainingExit> & Required<Omit<RemainingExit, never>>) => RemainingExit;
|
|
2991
|
+
defaults: () => Partial<RemainingExit>;
|
|
2992
|
+
}>;
|
|
2993
|
+
/**
|
|
2994
|
+
* The exit transactions of a set of VTXOs still awaiting confirmation,
|
|
2995
|
+
* mirroring `bark::exit::RemainingExitTransactions`.
|
|
2996
|
+
*/
|
|
2997
|
+
export type RemainingExitTransactions = {
|
|
2998
|
+
/**
|
|
2999
|
+
* One entry per requested VTXO, in request order (duplicates resolve to
|
|
3000
|
+
* their first occurrence). Upstream returns a map; it is a list here so
|
|
3001
|
+
* the order is stable across bindings.
|
|
3002
|
+
*/
|
|
3003
|
+
exits: Array<RemainingExit>;
|
|
3004
|
+
/**
|
|
3005
|
+
* Every transaction referenced by `exits` exactly once, parents before
|
|
3006
|
+
* children.
|
|
3007
|
+
*/
|
|
3008
|
+
transactions: Array<ExitTransactionInfo>;
|
|
3009
|
+
};
|
|
3010
|
+
/**
|
|
3011
|
+
* Generated factory for {@link RemainingExitTransactions} record objects.
|
|
3012
|
+
*/
|
|
3013
|
+
export declare const RemainingExitTransactions: Readonly<{
|
|
3014
|
+
create: (partial: Partial<RemainingExitTransactions> & Required<Omit<RemainingExitTransactions, never>>) => RemainingExitTransactions;
|
|
3015
|
+
new: (partial: Partial<RemainingExitTransactions> & Required<Omit<RemainingExitTransactions, never>>) => RemainingExitTransactions;
|
|
3016
|
+
defaults: () => Partial<RemainingExitTransactions>;
|
|
3017
|
+
}>;
|
|
2671
3018
|
/**
|
|
2672
3019
|
* Lifecycle phase of a round participation, mirroring
|
|
2673
3020
|
* `bark::round::RoundFlowKind`.
|
|
@@ -3328,7 +3675,8 @@ export declare class OnchainWallet extends UniffiAbstractObject implements Oncha
|
|
|
3328
3675
|
*/
|
|
3329
3676
|
static custom(callbacks: CustomOnchainWalletCallbacks): OnchainWalletLike;
|
|
3330
3677
|
/**
|
|
3331
|
-
* BDK-backed wallet. Opens the shared sqlite cache
|
|
3678
|
+
* BDK-backed wallet. Opens the shared sqlite cache in `datadir`, a
|
|
3679
|
+
* filesystem path or a `file://` URI.
|
|
3332
3680
|
*/
|
|
3333
3681
|
static default_(network: Network, mnemonic: string, config: Config, datadir: string, asyncOpts_?: {
|
|
3334
3682
|
signal: AbortSignal;
|
|
@@ -3408,7 +3756,8 @@ export type WalletOpenArgs = {
|
|
|
3408
3756
|
*/
|
|
3409
3757
|
runDaemon: boolean;
|
|
3410
3758
|
/**
|
|
3411
|
-
* The data directory to use for this wallet
|
|
3759
|
+
* The data directory to use for this wallet: a filesystem path or a
|
|
3760
|
+
* `file://` URI (such as Expo's `Directory.uri`)
|
|
3412
3761
|
*/
|
|
3413
3762
|
datadir: string;
|
|
3414
3763
|
/**
|
|
@@ -4394,7 +4743,14 @@ export interface WalletLike {
|
|
|
4394
4743
|
boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: {
|
|
4395
4744
|
signal: AbortSignal;
|
|
4396
4745
|
}): Promise<PendingBoard>;
|
|
4397
|
-
|
|
4746
|
+
/**
|
|
4747
|
+
* Create an invoice for an incoming lightning payment.
|
|
4748
|
+
*
|
|
4749
|
+
* `expiry_secs` is how long the invoice can be paid for. It defaults to,
|
|
4750
|
+
* and cannot exceed, the Ark server's invoice expiry; creating the invoice
|
|
4751
|
+
* fails if the server does not honour it. Must be at least 1.
|
|
4752
|
+
*/
|
|
4753
|
+
bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: {
|
|
4398
4754
|
signal: AbortSignal;
|
|
4399
4755
|
}): Promise<LightningInvoice>;
|
|
4400
4756
|
/**
|
|
@@ -4412,8 +4768,10 @@ export interface WalletLike {
|
|
|
4412
4768
|
*
|
|
4413
4769
|
* A `claim_destination` owned by this wallet is claimed locally instead of
|
|
4414
4770
|
* going through its mailbox.
|
|
4771
|
+
*
|
|
4772
|
+
* `expiry_secs` works as in [`Self::bolt11_invoice`].
|
|
4415
4773
|
*/
|
|
4416
|
-
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, asyncOpts_?: {
|
|
4774
|
+
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: {
|
|
4417
4775
|
signal: AbortSignal;
|
|
4418
4776
|
}): Promise<LightningInvoice>;
|
|
4419
4777
|
broadcastTx(txHex: string, asyncOpts_?: {
|
|
@@ -4739,6 +5097,28 @@ export interface WalletLike {
|
|
|
4739
5097
|
pendingRoundStates(asyncOpts_?: {
|
|
4740
5098
|
signal: AbortSignal;
|
|
4741
5099
|
}): Promise<Array<RoundState>>;
|
|
5100
|
+
/**
|
|
5101
|
+
* Sign, without broadcasting, the CPFP child of every exit transaction
|
|
5102
|
+
* that still needs broadcasting to emergency-exit the given VTXOs, for as
|
|
5103
|
+
* long as confirmed onchain funds last. Mirrors bark-rest
|
|
5104
|
+
* `POST /exits/presign`.
|
|
5105
|
+
*
|
|
5106
|
+
* Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
|
|
5107
|
+
* nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
|
|
5108
|
+
* the onchain wallet and exits first.
|
|
5109
|
+
*
|
|
5110
|
+
* Execute the result wave by wave: broadcast a wave's packages together
|
|
5111
|
+
* and wait for them, and its `in_mempool` transactions, to confirm before
|
|
5112
|
+
* the next. No funds are reserved, so a later onchain spend can
|
|
5113
|
+
* invalidate the children. The children are signed: store the result
|
|
5114
|
+
* securely.
|
|
5115
|
+
*
|
|
5116
|
+
* Needs the built-in onchain wallet; with callback wallets
|
|
5117
|
+
* (`CustomOnchainWalletCallbacks`) it fails.
|
|
5118
|
+
*/
|
|
5119
|
+
presignEmergencyExit(vtxoIds: Array<string> | undefined, feeRateSatPerVb: bigint | undefined, asyncOpts_?: {
|
|
5120
|
+
signal: AbortSignal;
|
|
5121
|
+
}): Promise<PresignedExits>;
|
|
4742
5122
|
progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: {
|
|
4743
5123
|
signal: AbortSignal;
|
|
4744
5124
|
}): Promise<Array<ExitProgressStatus>>;
|
|
@@ -4796,6 +5176,19 @@ export interface WalletLike {
|
|
|
4796
5176
|
refreshVtxosScheduled(vtxoIds: Array<string>, scheduledHeight: number, asyncOpts_?: {
|
|
4797
5177
|
signal: AbortSignal;
|
|
4798
5178
|
}): Promise<RoundState | undefined>;
|
|
5179
|
+
/**
|
|
5180
|
+
* List every exit transaction of the given VTXOs still awaiting
|
|
5181
|
+
* confirmation, so anyone can broadcast the exits on the user's behalf.
|
|
5182
|
+
* Mirrors bark-rest `GET /exits/remaining`.
|
|
5183
|
+
*
|
|
5184
|
+
* Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
|
|
5185
|
+
* nothing. Read-only: signs nothing and never touches the onchain wallet,
|
|
5186
|
+
* so it works with callback wallets too. Statuses of started exits reflect
|
|
5187
|
+
* the last `sync_exits`.
|
|
5188
|
+
*/
|
|
5189
|
+
remainingExitTransactions(vtxoIds: Array<string> | undefined, asyncOpts_?: {
|
|
5190
|
+
signal: AbortSignal;
|
|
5191
|
+
}): Promise<RemainingExitTransactions>;
|
|
4799
5192
|
/**
|
|
4800
5193
|
* Start the background daemon. The onchain wallet used by the daemon is
|
|
4801
5194
|
* the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
|
|
@@ -5012,7 +5405,14 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5012
5405
|
boardPsbt(psbtBase64: string, keypairIndex: number, expiryHeight: number, asyncOpts_?: {
|
|
5013
5406
|
signal: AbortSignal;
|
|
5014
5407
|
}): Promise<PendingBoard>;
|
|
5015
|
-
|
|
5408
|
+
/**
|
|
5409
|
+
* Create an invoice for an incoming lightning payment.
|
|
5410
|
+
*
|
|
5411
|
+
* `expiry_secs` is how long the invoice can be paid for. It defaults to,
|
|
5412
|
+
* and cannot exceed, the Ark server's invoice expiry; creating the invoice
|
|
5413
|
+
* fails if the server does not honour it. Must be at least 1.
|
|
5414
|
+
*/
|
|
5415
|
+
bolt11Invoice(amountSats: bigint, description: string | undefined, token?: string | undefined, expirySecs?: bigint | undefined, asyncOpts_?: {
|
|
5016
5416
|
signal: AbortSignal;
|
|
5017
5417
|
}): Promise<LightningInvoice>;
|
|
5018
5418
|
/**
|
|
@@ -5030,8 +5430,10 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5030
5430
|
*
|
|
5031
5431
|
* A `claim_destination` owned by this wallet is claimed locally instead of
|
|
5032
5432
|
* going through its mailbox.
|
|
5433
|
+
*
|
|
5434
|
+
* `expiry_secs` works as in [`Self::bolt11_invoice`].
|
|
5033
5435
|
*/
|
|
5034
|
-
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description?: string | undefined, token?: string | undefined, asyncOpts_?: {
|
|
5436
|
+
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description?: string | undefined, token?: string | undefined, expirySecs?: bigint | undefined, asyncOpts_?: {
|
|
5035
5437
|
signal: AbortSignal;
|
|
5036
5438
|
}): Promise<LightningInvoice>;
|
|
5037
5439
|
broadcastTx(txHex: string, asyncOpts_?: {
|
|
@@ -5357,6 +5759,28 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5357
5759
|
pendingRoundStates(asyncOpts_?: {
|
|
5358
5760
|
signal: AbortSignal;
|
|
5359
5761
|
}): Promise<Array<RoundState>>;
|
|
5762
|
+
/**
|
|
5763
|
+
* Sign, without broadcasting, the CPFP child of every exit transaction
|
|
5764
|
+
* that still needs broadcasting to emergency-exit the given VTXOs, for as
|
|
5765
|
+
* long as confirmed onchain funds last. Mirrors bark-rest
|
|
5766
|
+
* `POST /exits/presign`.
|
|
5767
|
+
*
|
|
5768
|
+
* Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
|
|
5769
|
+
* nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
|
|
5770
|
+
* the onchain wallet and exits first.
|
|
5771
|
+
*
|
|
5772
|
+
* Execute the result wave by wave: broadcast a wave's packages together
|
|
5773
|
+
* and wait for them, and its `in_mempool` transactions, to confirm before
|
|
5774
|
+
* the next. No funds are reserved, so a later onchain spend can
|
|
5775
|
+
* invalidate the children. The children are signed: store the result
|
|
5776
|
+
* securely.
|
|
5777
|
+
*
|
|
5778
|
+
* Needs the built-in onchain wallet; with callback wallets
|
|
5779
|
+
* (`CustomOnchainWalletCallbacks`) it fails.
|
|
5780
|
+
*/
|
|
5781
|
+
presignEmergencyExit(vtxoIds?: Array<string> | undefined, feeRateSatPerVb?: bigint | undefined, asyncOpts_?: {
|
|
5782
|
+
signal: AbortSignal;
|
|
5783
|
+
}): Promise<PresignedExits>;
|
|
5360
5784
|
progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: {
|
|
5361
5785
|
signal: AbortSignal;
|
|
5362
5786
|
}): Promise<Array<ExitProgressStatus>>;
|
|
@@ -5414,6 +5838,19 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5414
5838
|
refreshVtxosScheduled(vtxoIds: Array<string>, scheduledHeight: number, asyncOpts_?: {
|
|
5415
5839
|
signal: AbortSignal;
|
|
5416
5840
|
}): Promise<RoundState | undefined>;
|
|
5841
|
+
/**
|
|
5842
|
+
* List every exit transaction of the given VTXOs still awaiting
|
|
5843
|
+
* confirmation, so anyone can broadcast the exits on the user's behalf.
|
|
5844
|
+
* Mirrors bark-rest `GET /exits/remaining`.
|
|
5845
|
+
*
|
|
5846
|
+
* Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
|
|
5847
|
+
* nothing. Read-only: signs nothing and never touches the onchain wallet,
|
|
5848
|
+
* so it works with callback wallets too. Statuses of started exits reflect
|
|
5849
|
+
* the last `sync_exits`.
|
|
5850
|
+
*/
|
|
5851
|
+
remainingExitTransactions(vtxoIds?: Array<string> | undefined, asyncOpts_?: {
|
|
5852
|
+
signal: AbortSignal;
|
|
5853
|
+
}): Promise<RemainingExitTransactions>;
|
|
5417
5854
|
/**
|
|
5418
5855
|
* Start the background daemon. The onchain wallet used by the daemon is
|
|
5419
5856
|
* the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
|
|
@@ -5799,6 +6236,13 @@ declare const _default: Readonly<{
|
|
|
5799
6236
|
lift(value: Uint8Array): ExitClaimTransaction;
|
|
5800
6237
|
lower(value: ExitClaimTransaction, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5801
6238
|
};
|
|
6239
|
+
FfiConverterTypeExitFeeInfo: {
|
|
6240
|
+
readFromCursor(c: Cursor): ExitFeeInfo;
|
|
6241
|
+
writeIntoCursor(value: ExitFeeInfo, c: Cursor): void;
|
|
6242
|
+
allocationSize(value: ExitFeeInfo): number;
|
|
6243
|
+
lift(value: Uint8Array): ExitFeeInfo;
|
|
6244
|
+
lower(value: ExitFeeInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6245
|
+
};
|
|
5802
6246
|
FfiConverterTypeExitProgressStatus: {
|
|
5803
6247
|
readFromCursor(c: Cursor): ExitProgressStatus;
|
|
5804
6248
|
writeIntoCursor(value: ExitProgressStatus, c: Cursor): void;
|
|
@@ -5820,6 +6264,13 @@ declare const _default: Readonly<{
|
|
|
5820
6264
|
lift(value: Uint8Array): ExitStateKind;
|
|
5821
6265
|
lower(value: ExitStateKind, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5822
6266
|
};
|
|
6267
|
+
FfiConverterTypeExitTransactionInfo: {
|
|
6268
|
+
readFromCursor(c: Cursor): ExitTransactionInfo;
|
|
6269
|
+
writeIntoCursor(value: ExitTransactionInfo, c: Cursor): void;
|
|
6270
|
+
allocationSize(value: ExitTransactionInfo): number;
|
|
6271
|
+
lift(value: Uint8Array): ExitTransactionInfo;
|
|
6272
|
+
lower(value: ExitTransactionInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6273
|
+
};
|
|
5823
6274
|
FfiConverterTypeExitTransactionPackage: {
|
|
5824
6275
|
readFromCursor(c: Cursor): ExitTransactionPackage;
|
|
5825
6276
|
writeIntoCursor(value: ExitTransactionPackage, c: Cursor): void;
|
|
@@ -6032,6 +6483,48 @@ declare const _default: Readonly<{
|
|
|
6032
6483
|
lift(value: Uint8Array): PpmExpiryFeeEntry;
|
|
6033
6484
|
lower(value: PpmExpiryFeeEntry, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6034
6485
|
};
|
|
6486
|
+
FfiConverterTypePresignedExit: {
|
|
6487
|
+
readFromCursor(c: Cursor): PresignedExit;
|
|
6488
|
+
writeIntoCursor(value: PresignedExit, c: Cursor): void;
|
|
6489
|
+
allocationSize(value: PresignedExit): number;
|
|
6490
|
+
lift(value: Uint8Array): PresignedExit;
|
|
6491
|
+
lower(value: PresignedExit, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6492
|
+
};
|
|
6493
|
+
FfiConverterTypePresignedExitChild: {
|
|
6494
|
+
readFromCursor(c: Cursor): PresignedExitChild;
|
|
6495
|
+
writeIntoCursor(value: PresignedExitChild, c: Cursor): void;
|
|
6496
|
+
allocationSize(value: PresignedExitChild): number;
|
|
6497
|
+
lift(value: Uint8Array): PresignedExitChild;
|
|
6498
|
+
lower(value: PresignedExitChild, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6499
|
+
};
|
|
6500
|
+
FfiConverterTypePresignedExitPackage: {
|
|
6501
|
+
readFromCursor(c: Cursor): PresignedExitPackage;
|
|
6502
|
+
writeIntoCursor(value: PresignedExitPackage, c: Cursor): void;
|
|
6503
|
+
allocationSize(value: PresignedExitPackage): number;
|
|
6504
|
+
lift(value: Uint8Array): PresignedExitPackage;
|
|
6505
|
+
lower(value: PresignedExitPackage, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6506
|
+
};
|
|
6507
|
+
FfiConverterTypePresignedExitStatus: {
|
|
6508
|
+
readFromCursor(c: Cursor): PresignedExitStatus;
|
|
6509
|
+
writeIntoCursor(value: PresignedExitStatus, c: Cursor): void;
|
|
6510
|
+
allocationSize(value: PresignedExitStatus): number;
|
|
6511
|
+
lift(value: Uint8Array): PresignedExitStatus;
|
|
6512
|
+
lower(value: PresignedExitStatus, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6513
|
+
};
|
|
6514
|
+
FfiConverterTypePresignedExits: {
|
|
6515
|
+
readFromCursor(c: Cursor): PresignedExits;
|
|
6516
|
+
writeIntoCursor(value: PresignedExits, c: Cursor): void;
|
|
6517
|
+
allocationSize(value: PresignedExits): number;
|
|
6518
|
+
lift(value: Uint8Array): PresignedExits;
|
|
6519
|
+
lower(value: PresignedExits, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6520
|
+
};
|
|
6521
|
+
FfiConverterTypePresignedWave: {
|
|
6522
|
+
readFromCursor(c: Cursor): PresignedWave;
|
|
6523
|
+
writeIntoCursor(value: PresignedWave, c: Cursor): void;
|
|
6524
|
+
allocationSize(value: PresignedWave): number;
|
|
6525
|
+
lift(value: Uint8Array): PresignedWave;
|
|
6526
|
+
lower(value: PresignedWave, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6527
|
+
};
|
|
6035
6528
|
FfiConverterTypeRecoveryBucket: {
|
|
6036
6529
|
readFromCursor(c: Cursor): RecoveryBucket;
|
|
6037
6530
|
writeIntoCursor(value: RecoveryBucket, c: Cursor): void;
|
|
@@ -6060,6 +6553,20 @@ declare const _default: Readonly<{
|
|
|
6060
6553
|
lift(value: Uint8Array): RefreshFees;
|
|
6061
6554
|
lower(value: RefreshFees, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6062
6555
|
};
|
|
6556
|
+
FfiConverterTypeRemainingExit: {
|
|
6557
|
+
readFromCursor(c: Cursor): RemainingExit;
|
|
6558
|
+
writeIntoCursor(value: RemainingExit, c: Cursor): void;
|
|
6559
|
+
allocationSize(value: RemainingExit): number;
|
|
6560
|
+
lift(value: Uint8Array): RemainingExit;
|
|
6561
|
+
lower(value: RemainingExit, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6562
|
+
};
|
|
6563
|
+
FfiConverterTypeRemainingExitTransactions: {
|
|
6564
|
+
readFromCursor(c: Cursor): RemainingExitTransactions;
|
|
6565
|
+
writeIntoCursor(value: RemainingExitTransactions, c: Cursor): void;
|
|
6566
|
+
allocationSize(value: RemainingExitTransactions): number;
|
|
6567
|
+
lift(value: Uint8Array): RemainingExitTransactions;
|
|
6568
|
+
lower(value: RemainingExitTransactions, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6569
|
+
};
|
|
6063
6570
|
FfiConverterTypeRoundFlowKind: {
|
|
6064
6571
|
readFromCursor(c: Cursor): RoundFlowKind;
|
|
6065
6572
|
writeIntoCursor(value: RoundFlowKind, c: Cursor): void;
|