@secondts/bark-react-native 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -32
- package/cpp/generated/bark.cpp +203 -19
- package/cpp/generated/bark.hpp +10 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +318 -70
- 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 +317 -69
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +16 -6
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +869 -79
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +16 -6
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +869 -79
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -9
- package/src/generated/bark-ffi.ts +16 -6
- package/src/generated/bark.ts +1470 -150
|
@@ -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
|
|
@@ -275,6 +279,10 @@ export type ArkInfo = {
|
|
|
275
279
|
* server refuses to cosign further OOR transactions spending it.
|
|
276
280
|
*/
|
|
277
281
|
maxVtxoExitDepth: number;
|
|
282
|
+
/**
|
|
283
|
+
* Maximum number of outputs of a single round participation.
|
|
284
|
+
*/
|
|
285
|
+
maxRoundParticipationOutputs: number;
|
|
278
286
|
};
|
|
279
287
|
/**
|
|
280
288
|
* Generated factory for {@link ArkInfo} record objects.
|
|
@@ -1012,17 +1020,31 @@ export declare const BlockRef: Readonly<{
|
|
|
1012
1020
|
defaults: () => Partial<BlockRef>;
|
|
1013
1021
|
}>;
|
|
1014
1022
|
/**
|
|
1015
|
-
* Destination for an externally funded board (e.g. a payjoin receive)
|
|
1023
|
+
* Destination for an externally funded board (e.g. a payjoin receive),
|
|
1024
|
+
* mirroring `bark::BoardFundingAddress`.
|
|
1016
1025
|
*
|
|
1017
|
-
* The funding script commits to
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1026
|
+
* The funding script commits to `user_pubkey` and `expiry_height`, so persist
|
|
1027
|
+
* this record and pass it back unchanged to `board_psbt` once the funding
|
|
1028
|
+
* PSBT is available — including on retries after the sender changes the
|
|
1029
|
+
* transaction. Fund it right away: the board VTXO's lifetime started when
|
|
1030
|
+
* the address was made, and once it expires the server can sweep the funding
|
|
1031
|
+
* output alone.
|
|
1021
1032
|
*/
|
|
1022
1033
|
export type BoardFundingInfo = {
|
|
1034
|
+
/**
|
|
1035
|
+
* Address the funding transaction must pay. Informational only:
|
|
1036
|
+
* `board_psbt` rebuilds the funding script from `user_pubkey` and
|
|
1037
|
+
* `expiry_height` and does not read it.
|
|
1038
|
+
*/
|
|
1023
1039
|
address: string;
|
|
1040
|
+
/**
|
|
1041
|
+
* Block height at which the board VTXO expires.
|
|
1042
|
+
*/
|
|
1024
1043
|
expiryHeight: number;
|
|
1025
|
-
|
|
1044
|
+
/**
|
|
1045
|
+
* Hex-encoded wallet public key the board VTXO is locked to.
|
|
1046
|
+
*/
|
|
1047
|
+
userPubkey: string;
|
|
1026
1048
|
};
|
|
1027
1049
|
/**
|
|
1028
1050
|
* Generated factory for {@link BoardFundingInfo} record objects.
|
|
@@ -1086,6 +1108,15 @@ export type Config = {
|
|
|
1086
1108
|
bitcoindPass?: string;
|
|
1087
1109
|
vtxoRefreshExpiryThreshold?: number;
|
|
1088
1110
|
vtxoExitMargin?: number;
|
|
1111
|
+
/**
|
|
1112
|
+
* The default lifetime of a board VTXO, in blocks.
|
|
1113
|
+
*
|
|
1114
|
+
* Capped at the server's `ArkInfo.vtxo_lifetime`. Override it per board
|
|
1115
|
+
* with the `expiry_height` argument of the board methods.
|
|
1116
|
+
*
|
|
1117
|
+
* Default: 432 (3 days) on mainnet, 4320 (30 days) otherwise
|
|
1118
|
+
*/
|
|
1119
|
+
boardLifetime?: number;
|
|
1089
1120
|
htlcRecvClaimDelta?: number;
|
|
1090
1121
|
fallbackFeeRate?: bigint;
|
|
1091
1122
|
roundTxRequiredConfirmations?: number;
|
|
@@ -1113,25 +1144,53 @@ export type Config = {
|
|
|
1113
1144
|
* Generated factory for {@link Config} record objects.
|
|
1114
1145
|
*/
|
|
1115
1146
|
export declare const Config: Readonly<{
|
|
1116
|
-
create: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
|
|
1117
|
-
new: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
|
|
1147
|
+
create: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "boardLifetime" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
|
|
1148
|
+
new: (partial: Partial<Config> & Required<Omit<Config, "serverAccessToken" | "esploraAddress" | "bitcoindAddress" | "bitcoindCookiefile" | "bitcoindUser" | "bitcoindPass" | "vtxoRefreshExpiryThreshold" | "vtxoExitMargin" | "boardLifetime" | "htlcRecvClaimDelta" | "fallbackFeeRate" | "roundTxRequiredConfirmations" | "daemonSyncIntervalSecs" | "offboardRequiredConfirmations" | "daemonManualSync" | "lightningReceiveClaimRetries" | "userAgent" | "vtxoKeyGapLimit">>) => Config;
|
|
1118
1149
|
defaults: () => Partial<Config>;
|
|
1119
1150
|
}>;
|
|
1120
1151
|
/**
|
|
1121
1152
|
* Parameters for creating a CPFP (Child Pays For Parent) transaction
|
|
1122
1153
|
*/
|
|
1123
1154
|
export type CpfpParams = {
|
|
1155
|
+
/**
|
|
1156
|
+
* Hex-encoded zero-fee parent transaction to bump through its P2A anchor
|
|
1157
|
+
*/
|
|
1124
1158
|
txHex: string;
|
|
1159
|
+
/**
|
|
1160
|
+
* `"Effective"` for a fresh child, `"Rbf"` to replace a child already in
|
|
1161
|
+
* the mempool. The `Rbf`-only fields below are `None` for `"Effective"`.
|
|
1162
|
+
*/
|
|
1125
1163
|
feesType: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* Effective fee rate the whole package (parent + child) must reach, in
|
|
1166
|
+
* sat/vB rounded up
|
|
1167
|
+
*/
|
|
1126
1168
|
effectiveFeeRateSatPerVb: bigint;
|
|
1127
|
-
|
|
1169
|
+
/**
|
|
1170
|
+
* `Rbf` only: total fee of the transactions the new child replaces
|
|
1171
|
+
*/
|
|
1172
|
+
replacedFeeSats?: bigint;
|
|
1173
|
+
/**
|
|
1174
|
+
* `Rbf` only: fee rate of the transactions the new child replaces, in
|
|
1175
|
+
* sat/vB rounded up
|
|
1176
|
+
*/
|
|
1177
|
+
replacedFeeRateSatPerVb?: bigint;
|
|
1178
|
+
/**
|
|
1179
|
+
* `Rbf` only: the node's incremental relay fee, in sat/vB rounded up
|
|
1180
|
+
*/
|
|
1181
|
+
incrementalRelayFeeSatPerVb?: bigint;
|
|
1182
|
+
/**
|
|
1183
|
+
* `Rbf` only: whether the parent is already in the mempool. If not, the
|
|
1184
|
+
* parent is part of the replacement.
|
|
1185
|
+
*/
|
|
1186
|
+
parentInMempool?: boolean;
|
|
1128
1187
|
};
|
|
1129
1188
|
/**
|
|
1130
1189
|
* Generated factory for {@link CpfpParams} record objects.
|
|
1131
1190
|
*/
|
|
1132
1191
|
export declare const CpfpParams: Readonly<{
|
|
1133
|
-
create: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "
|
|
1134
|
-
new: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "
|
|
1192
|
+
create: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "replacedFeeSats" | "replacedFeeRateSatPerVb" | "incrementalRelayFeeSatPerVb" | "parentInMempool">>) => CpfpParams;
|
|
1193
|
+
new: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "replacedFeeSats" | "replacedFeeRateSatPerVb" | "incrementalRelayFeeSatPerVb" | "parentInMempool">>) => CpfpParams;
|
|
1135
1194
|
defaults: () => Partial<CpfpParams>;
|
|
1136
1195
|
}>;
|
|
1137
1196
|
/**
|
|
@@ -1597,6 +1656,29 @@ export declare const ExitClaimTransaction: Readonly<{
|
|
|
1597
1656
|
new: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
|
|
1598
1657
|
defaults: () => Partial<ExitClaimTransaction>;
|
|
1599
1658
|
}>;
|
|
1659
|
+
/**
|
|
1660
|
+
* Fee a transaction commits together with its unconfirmed ancestors,
|
|
1661
|
+
* mirroring `bark::exit::FeeInfo`.
|
|
1662
|
+
*/
|
|
1663
|
+
export type ExitFeeInfo = {
|
|
1664
|
+
/**
|
|
1665
|
+
* Effective fee rate, in sat/kwu (lossless; divide by 250 for sat/vB).
|
|
1666
|
+
*/
|
|
1667
|
+
feeRateSatPerKwu: bigint;
|
|
1668
|
+
/**
|
|
1669
|
+
* Sum of the transaction's own fee and the fees of its unconfirmed
|
|
1670
|
+
* ancestors.
|
|
1671
|
+
*/
|
|
1672
|
+
totalFeeSats: bigint;
|
|
1673
|
+
};
|
|
1674
|
+
/**
|
|
1675
|
+
* Generated factory for {@link ExitFeeInfo} record objects.
|
|
1676
|
+
*/
|
|
1677
|
+
export declare const ExitFeeInfo: Readonly<{
|
|
1678
|
+
create: (partial: Partial<ExitFeeInfo> & Required<Omit<ExitFeeInfo, never>>) => ExitFeeInfo;
|
|
1679
|
+
new: (partial: Partial<ExitFeeInfo> & Required<Omit<ExitFeeInfo, never>>) => ExitFeeInfo;
|
|
1680
|
+
defaults: () => Partial<ExitFeeInfo>;
|
|
1681
|
+
}>;
|
|
1600
1682
|
export declare enum ExitTxStatus_Tags {
|
|
1601
1683
|
VerifyInputs = "VerifyInputs",
|
|
1602
1684
|
AwaitingInputConfirmation = "AwaitingInputConfirmation",
|
|
@@ -2278,6 +2360,24 @@ export declare const ExitProgressStatus: Readonly<{
|
|
|
2278
2360
|
new: (partial: Partial<ExitProgressStatus> & Required<Omit<ExitProgressStatus, "error">>) => ExitProgressStatus;
|
|
2279
2361
|
defaults: () => Partial<ExitProgressStatus>;
|
|
2280
2362
|
}>;
|
|
2363
|
+
/**
|
|
2364
|
+
* A transaction of an exit chain, mirroring `bark::exit::TransactionInfo`.
|
|
2365
|
+
*/
|
|
2366
|
+
export type ExitTransactionInfo = {
|
|
2367
|
+
txid: string;
|
|
2368
|
+
/**
|
|
2369
|
+
* Consensus-encoded transaction, hex.
|
|
2370
|
+
*/
|
|
2371
|
+
txHex: string;
|
|
2372
|
+
};
|
|
2373
|
+
/**
|
|
2374
|
+
* Generated factory for {@link ExitTransactionInfo} record objects.
|
|
2375
|
+
*/
|
|
2376
|
+
export declare const ExitTransactionInfo: Readonly<{
|
|
2377
|
+
create: (partial: Partial<ExitTransactionInfo> & Required<Omit<ExitTransactionInfo, never>>) => ExitTransactionInfo;
|
|
2378
|
+
new: (partial: Partial<ExitTransactionInfo> & Required<Omit<ExitTransactionInfo, never>>) => ExitTransactionInfo;
|
|
2379
|
+
defaults: () => Partial<ExitTransactionInfo>;
|
|
2380
|
+
}>;
|
|
2281
2381
|
/**
|
|
2282
2382
|
* One transaction of an exit: the exit transaction itself and, once it was
|
|
2283
2383
|
* fee-bumped, the child that confirms it. A unilateral exit is a chain of
|
|
@@ -2598,12 +2698,269 @@ export declare const PendingBoard: Readonly<{
|
|
|
2598
2698
|
new: (partial: Partial<PendingBoard> & Required<Omit<PendingBoard, never>>) => PendingBoard;
|
|
2599
2699
|
defaults: () => Partial<PendingBoard>;
|
|
2600
2700
|
}>;
|
|
2701
|
+
export declare enum PresignedExitStatus_Tags {
|
|
2702
|
+
FullySigned = "FullySigned",
|
|
2703
|
+
PartiallySigned = "PartiallySigned",
|
|
2704
|
+
Unsigned = "Unsigned"
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* How much of a [`PresignedExit`]'s remaining broadcast work could be funded
|
|
2708
|
+
* and signed, mirroring `bark::exit::PresignedExitStatus`.
|
|
2709
|
+
*/
|
|
2710
|
+
export declare const PresignedExitStatus: Readonly<{
|
|
2711
|
+
instanceOf: (obj: any) => obj is PresignedExitStatus;
|
|
2712
|
+
FullySigned: {
|
|
2713
|
+
new (inner: {
|
|
2714
|
+
exitedInWave?: number;
|
|
2715
|
+
feeInfo: ExitFeeInfo;
|
|
2716
|
+
}): {
|
|
2717
|
+
readonly tag: PresignedExitStatus_Tags.FullySigned;
|
|
2718
|
+
readonly inner: Readonly<{
|
|
2719
|
+
exitedInWave?: number;
|
|
2720
|
+
feeInfo: ExitFeeInfo;
|
|
2721
|
+
}>;
|
|
2722
|
+
/**
|
|
2723
|
+
* @private
|
|
2724
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2725
|
+
*/
|
|
2726
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2727
|
+
};
|
|
2728
|
+
new(inner: {
|
|
2729
|
+
exitedInWave?: number;
|
|
2730
|
+
feeInfo: ExitFeeInfo;
|
|
2731
|
+
}): {
|
|
2732
|
+
readonly tag: PresignedExitStatus_Tags.FullySigned;
|
|
2733
|
+
readonly inner: Readonly<{
|
|
2734
|
+
exitedInWave?: number;
|
|
2735
|
+
feeInfo: ExitFeeInfo;
|
|
2736
|
+
}>;
|
|
2737
|
+
/**
|
|
2738
|
+
* @private
|
|
2739
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2740
|
+
*/
|
|
2741
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2742
|
+
};
|
|
2743
|
+
instanceOf(obj: any): obj is {
|
|
2744
|
+
readonly tag: PresignedExitStatus_Tags.FullySigned;
|
|
2745
|
+
readonly inner: Readonly<{
|
|
2746
|
+
exitedInWave?: number;
|
|
2747
|
+
feeInfo: ExitFeeInfo;
|
|
2748
|
+
}>;
|
|
2749
|
+
/**
|
|
2750
|
+
* @private
|
|
2751
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2752
|
+
*/
|
|
2753
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2754
|
+
};
|
|
2755
|
+
};
|
|
2756
|
+
PartiallySigned: {
|
|
2757
|
+
new (inner: {
|
|
2758
|
+
lastWave: number;
|
|
2759
|
+
}): {
|
|
2760
|
+
readonly tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
2761
|
+
readonly inner: Readonly<{
|
|
2762
|
+
lastWave: number;
|
|
2763
|
+
}>;
|
|
2764
|
+
/**
|
|
2765
|
+
* @private
|
|
2766
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2767
|
+
*/
|
|
2768
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2769
|
+
};
|
|
2770
|
+
new(inner: {
|
|
2771
|
+
lastWave: number;
|
|
2772
|
+
}): {
|
|
2773
|
+
readonly tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
2774
|
+
readonly inner: Readonly<{
|
|
2775
|
+
lastWave: number;
|
|
2776
|
+
}>;
|
|
2777
|
+
/**
|
|
2778
|
+
* @private
|
|
2779
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2780
|
+
*/
|
|
2781
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2782
|
+
};
|
|
2783
|
+
instanceOf(obj: any): obj is {
|
|
2784
|
+
readonly tag: PresignedExitStatus_Tags.PartiallySigned;
|
|
2785
|
+
readonly inner: Readonly<{
|
|
2786
|
+
lastWave: number;
|
|
2787
|
+
}>;
|
|
2788
|
+
/**
|
|
2789
|
+
* @private
|
|
2790
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2791
|
+
*/
|
|
2792
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2793
|
+
};
|
|
2794
|
+
};
|
|
2795
|
+
Unsigned: {
|
|
2796
|
+
new (): {
|
|
2797
|
+
readonly tag: PresignedExitStatus_Tags.Unsigned;
|
|
2798
|
+
/**
|
|
2799
|
+
* @private
|
|
2800
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2801
|
+
*/
|
|
2802
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2803
|
+
};
|
|
2804
|
+
new(): {
|
|
2805
|
+
readonly tag: PresignedExitStatus_Tags.Unsigned;
|
|
2806
|
+
/**
|
|
2807
|
+
* @private
|
|
2808
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2809
|
+
*/
|
|
2810
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2811
|
+
};
|
|
2812
|
+
instanceOf(obj: any): obj is {
|
|
2813
|
+
readonly tag: PresignedExitStatus_Tags.Unsigned;
|
|
2814
|
+
/**
|
|
2815
|
+
* @private
|
|
2816
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2817
|
+
*/
|
|
2818
|
+
readonly [uniffiTypeNameSymbol]: "PresignedExitStatus";
|
|
2819
|
+
};
|
|
2820
|
+
};
|
|
2821
|
+
}>;
|
|
2822
|
+
/**
|
|
2823
|
+
* How much of a [`PresignedExit`]'s remaining broadcast work could be funded
|
|
2824
|
+
* and signed, mirroring `bark::exit::PresignedExitStatus`.
|
|
2825
|
+
*/
|
|
2826
|
+
export type PresignedExitStatus = InstanceType<typeof PresignedExitStatus['FullySigned' | 'PartiallySigned' | 'Unsigned']>;
|
|
2827
|
+
/**
|
|
2828
|
+
* The presigned broadcast work for one VTXO, mirroring
|
|
2829
|
+
* `bark::exit::PresignedExit`.
|
|
2830
|
+
*/
|
|
2831
|
+
export type PresignedExit = {
|
|
2832
|
+
vtxoId: string;
|
|
2833
|
+
status: PresignedExitStatus;
|
|
2834
|
+
/**
|
|
2835
|
+
* The remaining tail of this exit's chain that could not be funded, in
|
|
2836
|
+
* broadcast order; its first transaction spends this exit's last signed
|
|
2837
|
+
* one. Empty when fully signed.
|
|
2838
|
+
*/
|
|
2839
|
+
unsigned: Array<ExitTransactionInfo>;
|
|
2840
|
+
};
|
|
2841
|
+
/**
|
|
2842
|
+
* Generated factory for {@link PresignedExit} record objects.
|
|
2843
|
+
*/
|
|
2844
|
+
export declare const PresignedExit: Readonly<{
|
|
2845
|
+
create: (partial: Partial<PresignedExit> & Required<Omit<PresignedExit, never>>) => PresignedExit;
|
|
2846
|
+
new: (partial: Partial<PresignedExit> & Required<Omit<PresignedExit, never>>) => PresignedExit;
|
|
2847
|
+
defaults: () => Partial<PresignedExit>;
|
|
2848
|
+
}>;
|
|
2849
|
+
/**
|
|
2850
|
+
* A signed CPFP child and the fee it commits, mirroring
|
|
2851
|
+
* `bark::exit::PresignedExitChildInfo`.
|
|
2852
|
+
*/
|
|
2853
|
+
export type PresignedExitChild = {
|
|
2854
|
+
txid: string;
|
|
2855
|
+
/**
|
|
2856
|
+
* Consensus-encoded signed transaction, hex.
|
|
2857
|
+
*/
|
|
2858
|
+
txHex: string;
|
|
2859
|
+
/**
|
|
2860
|
+
* The exit transaction is zero-fee, so this is the fee of the whole
|
|
2861
|
+
* package.
|
|
2862
|
+
*/
|
|
2863
|
+
feeInfo: ExitFeeInfo;
|
|
2864
|
+
};
|
|
2865
|
+
/**
|
|
2866
|
+
* Generated factory for {@link PresignedExitChild} record objects.
|
|
2867
|
+
*/
|
|
2868
|
+
export declare const PresignedExitChild: Readonly<{
|
|
2869
|
+
create: (partial: Partial<PresignedExitChild> & Required<Omit<PresignedExitChild, never>>) => PresignedExitChild;
|
|
2870
|
+
new: (partial: Partial<PresignedExitChild> & Required<Omit<PresignedExitChild, never>>) => PresignedExitChild;
|
|
2871
|
+
defaults: () => Partial<PresignedExitChild>;
|
|
2872
|
+
}>;
|
|
2873
|
+
/**
|
|
2874
|
+
* An `(exit, child)` transaction package, broadcast as one unit (e.g. with
|
|
2875
|
+
* `submitpackage`), mirroring `bark::exit::PresignedExitPackage`.
|
|
2876
|
+
*/
|
|
2877
|
+
export type PresignedExitPackage = {
|
|
2878
|
+
/**
|
|
2879
|
+
* The VTXO whose exit this package advances.
|
|
2880
|
+
*/
|
|
2881
|
+
vtxoId: string;
|
|
2882
|
+
/**
|
|
2883
|
+
* The zero-fee exit transaction.
|
|
2884
|
+
*/
|
|
2885
|
+
exit: ExitTransactionInfo;
|
|
2886
|
+
/**
|
|
2887
|
+
* The signed CPFP child paying for `exit`.
|
|
2888
|
+
*/
|
|
2889
|
+
child: PresignedExitChild;
|
|
2890
|
+
};
|
|
2891
|
+
/**
|
|
2892
|
+
* Generated factory for {@link PresignedExitPackage} record objects.
|
|
2893
|
+
*/
|
|
2894
|
+
export declare const PresignedExitPackage: Readonly<{
|
|
2895
|
+
create: (partial: Partial<PresignedExitPackage> & Required<Omit<PresignedExitPackage, never>>) => PresignedExitPackage;
|
|
2896
|
+
new: (partial: Partial<PresignedExitPackage> & Required<Omit<PresignedExitPackage, never>>) => PresignedExitPackage;
|
|
2897
|
+
defaults: () => Partial<PresignedExitPackage>;
|
|
2898
|
+
}>;
|
|
2899
|
+
/**
|
|
2900
|
+
* One step of a presigned broadcast plan, mirroring
|
|
2901
|
+
* `bark::exit::PresignedWave`. See [`PresignedExits`] for the rules.
|
|
2902
|
+
*/
|
|
2903
|
+
export type PresignedWave = {
|
|
2904
|
+
/**
|
|
2905
|
+
* Packages funded independently of each other, broadcast together.
|
|
2906
|
+
*/
|
|
2907
|
+
packages: Array<PresignedExitPackage>;
|
|
2908
|
+
/**
|
|
2909
|
+
* Exit transactions already in the mempool; they confirm with this wave.
|
|
2910
|
+
* Only the first wave has any.
|
|
2911
|
+
*/
|
|
2912
|
+
inMempool: Array<ExitTransactionInfo>;
|
|
2913
|
+
};
|
|
2914
|
+
/**
|
|
2915
|
+
* Generated factory for {@link PresignedWave} record objects.
|
|
2916
|
+
*/
|
|
2917
|
+
export declare const PresignedWave: Readonly<{
|
|
2918
|
+
create: (partial: Partial<PresignedWave> & Required<Omit<PresignedWave, never>>) => PresignedWave;
|
|
2919
|
+
new: (partial: Partial<PresignedWave> & Required<Omit<PresignedWave, never>>) => PresignedWave;
|
|
2920
|
+
defaults: () => Partial<PresignedWave>;
|
|
2921
|
+
}>;
|
|
2922
|
+
/**
|
|
2923
|
+
* Presigned emergency-exit chains for a set of VTXOs: a wave-by-wave
|
|
2924
|
+
* broadcast plan plus a per-VTXO summary, mirroring
|
|
2925
|
+
* `bark::exit::PresignedExits`.
|
|
2926
|
+
*
|
|
2927
|
+
* Execute the plan in wave order: broadcast all of a wave's packages
|
|
2928
|
+
* together, then wait for every one, and its `in_mempool` transactions, to
|
|
2929
|
+
* confirm before the next wave. Each wave's children spend change confirmed
|
|
2930
|
+
* by the previous wave.
|
|
2931
|
+
*
|
|
2932
|
+
* Presigning reserves no funds, so a later spend from the onchain wallet can
|
|
2933
|
+
* invalidate the remaining children. It does reveal the change addresses
|
|
2934
|
+
* those children pay to. The children are fully signed: treat the result as
|
|
2935
|
+
* sensitive and store it accordingly.
|
|
2936
|
+
*/
|
|
2937
|
+
export type PresignedExits = {
|
|
2938
|
+
/**
|
|
2939
|
+
* One entry per requested VTXO, in request order (duplicates resolve to
|
|
2940
|
+
* their first occurrence).
|
|
2941
|
+
*/
|
|
2942
|
+
exits: Array<PresignedExit>;
|
|
2943
|
+
/**
|
|
2944
|
+
* The broadcast plan. Confirmed transactions are omitted, relayed ones are
|
|
2945
|
+
* listed in [`PresignedWave::in_mempool`], and a package shared by several
|
|
2946
|
+
* exits appears once, under the first exit that references it.
|
|
2947
|
+
*/
|
|
2948
|
+
waves: Array<PresignedWave>;
|
|
2949
|
+
};
|
|
2950
|
+
/**
|
|
2951
|
+
* Generated factory for {@link PresignedExits} record objects.
|
|
2952
|
+
*/
|
|
2953
|
+
export declare const PresignedExits: Readonly<{
|
|
2954
|
+
create: (partial: Partial<PresignedExits> & Required<Omit<PresignedExits, never>>) => PresignedExits;
|
|
2955
|
+
new: (partial: Partial<PresignedExits> & Required<Omit<PresignedExits, never>>) => PresignedExits;
|
|
2956
|
+
defaults: () => Partial<PresignedExits>;
|
|
2957
|
+
}>;
|
|
2601
2958
|
/**
|
|
2602
2959
|
* One bucket of a [`RecoveryReport`].
|
|
2603
2960
|
*
|
|
2604
2961
|
* `total_sats` only sums the VTXOs whose amount is known, so it can
|
|
2605
|
-
* under-count `failed`, where a VTXO may
|
|
2606
|
-
* `vtxo_ids` is sorted
|
|
2962
|
+
* under-count `failed`, `abandoned` and `not_found`, where a VTXO may not
|
|
2963
|
+
* have been fetched. `vtxo_ids` is sorted as strings.
|
|
2607
2964
|
*/
|
|
2608
2965
|
export type RecoveryBucket = {
|
|
2609
2966
|
vtxoIds: Array<string>;
|
|
@@ -2624,8 +2981,10 @@ export declare const RecoveryBucket: Readonly<{
|
|
|
2624
2981
|
* `skipped` vs `failed` is the load-bearing distinction: a `skipped` VTXO was
|
|
2625
2982
|
* decided not to be spendable (spent, exited, or reported non-spendable),
|
|
2626
2983
|
* while a `failed` one could not be decided because of an error, so its funds
|
|
2627
|
-
* may still be missing. `failed` is
|
|
2628
|
-
*
|
|
2984
|
+
* may still be missing. `failed` is retried by every sync while a seed
|
|
2985
|
+
* recovery is in progress, and via `recover_vtxos`; an `abandoned` one was
|
|
2986
|
+
* given up on after too many attempts; a `foreign` id instead sits beyond the
|
|
2987
|
+
* key-derivation gap limit and needs a wider scan.
|
|
2629
2988
|
*/
|
|
2630
2989
|
export type RecoveryReport = {
|
|
2631
2990
|
/**
|
|
@@ -2656,7 +3015,20 @@ export type RecoveryReport = {
|
|
|
2656
3015
|
*/
|
|
2657
3016
|
exited: RecoveryBucket;
|
|
2658
3017
|
/**
|
|
2659
|
-
*
|
|
3018
|
+
* Reported unknown by the server. Recovery trusts the server, so these
|
|
3019
|
+
* are not retried.
|
|
3020
|
+
*/
|
|
3021
|
+
notFound: RecoveryBucket;
|
|
3022
|
+
/**
|
|
3023
|
+
* Given up on after `MAX_RECOVERY_ATTEMPTS` (40) attempts the server or
|
|
3024
|
+
* the chain answered without deciding. Funds may be missing. One with a
|
|
3025
|
+
* stored body stays locked, as it may be spent, and a later
|
|
3026
|
+
* `recover_vtxos` tries it again.
|
|
3027
|
+
*/
|
|
3028
|
+
abandoned: RecoveryBucket;
|
|
3029
|
+
/**
|
|
3030
|
+
* Whether the scan accounted for every VTXO: no `failed`, no `abandoned`,
|
|
3031
|
+
* no `foreign`.
|
|
2660
3032
|
*/
|
|
2661
3033
|
isComplete: boolean;
|
|
2662
3034
|
};
|
|
@@ -2668,6 +3040,51 @@ export declare const RecoveryReport: Readonly<{
|
|
|
2668
3040
|
new: (partial: Partial<RecoveryReport> & Required<Omit<RecoveryReport, never>>) => RecoveryReport;
|
|
2669
3041
|
defaults: () => Partial<RecoveryReport>;
|
|
2670
3042
|
}>;
|
|
3043
|
+
/**
|
|
3044
|
+
* The exit transactions one VTXO still needs confirmed to be exited.
|
|
3045
|
+
*/
|
|
3046
|
+
export type RemainingExit = {
|
|
3047
|
+
vtxoId: string;
|
|
3048
|
+
/**
|
|
3049
|
+
* Txids in broadcast order. Each one's transaction is in
|
|
3050
|
+
* [`RemainingExitTransactions::transactions`]. Empty when the chain is
|
|
3051
|
+
* already confirmed.
|
|
3052
|
+
*/
|
|
3053
|
+
txids: Array<string>;
|
|
3054
|
+
};
|
|
3055
|
+
/**
|
|
3056
|
+
* Generated factory for {@link RemainingExit} record objects.
|
|
3057
|
+
*/
|
|
3058
|
+
export declare const RemainingExit: Readonly<{
|
|
3059
|
+
create: (partial: Partial<RemainingExit> & Required<Omit<RemainingExit, never>>) => RemainingExit;
|
|
3060
|
+
new: (partial: Partial<RemainingExit> & Required<Omit<RemainingExit, never>>) => RemainingExit;
|
|
3061
|
+
defaults: () => Partial<RemainingExit>;
|
|
3062
|
+
}>;
|
|
3063
|
+
/**
|
|
3064
|
+
* The exit transactions of a set of VTXOs still awaiting confirmation,
|
|
3065
|
+
* mirroring `bark::exit::RemainingExitTransactions`.
|
|
3066
|
+
*/
|
|
3067
|
+
export type RemainingExitTransactions = {
|
|
3068
|
+
/**
|
|
3069
|
+
* One entry per requested VTXO, in request order (duplicates resolve to
|
|
3070
|
+
* their first occurrence). Upstream returns a map; it is a list here so
|
|
3071
|
+
* the order is stable across bindings.
|
|
3072
|
+
*/
|
|
3073
|
+
exits: Array<RemainingExit>;
|
|
3074
|
+
/**
|
|
3075
|
+
* Every transaction referenced by `exits` exactly once, parents before
|
|
3076
|
+
* children.
|
|
3077
|
+
*/
|
|
3078
|
+
transactions: Array<ExitTransactionInfo>;
|
|
3079
|
+
};
|
|
3080
|
+
/**
|
|
3081
|
+
* Generated factory for {@link RemainingExitTransactions} record objects.
|
|
3082
|
+
*/
|
|
3083
|
+
export declare const RemainingExitTransactions: Readonly<{
|
|
3084
|
+
create: (partial: Partial<RemainingExitTransactions> & Required<Omit<RemainingExitTransactions, never>>) => RemainingExitTransactions;
|
|
3085
|
+
new: (partial: Partial<RemainingExitTransactions> & Required<Omit<RemainingExitTransactions, never>>) => RemainingExitTransactions;
|
|
3086
|
+
defaults: () => Partial<RemainingExitTransactions>;
|
|
3087
|
+
}>;
|
|
2671
3088
|
/**
|
|
2672
3089
|
* Lifecycle phase of a round participation, mirroring
|
|
2673
3090
|
* `bark::round::RoundFlowKind`.
|
|
@@ -3328,7 +3745,8 @@ export declare class OnchainWallet extends UniffiAbstractObject implements Oncha
|
|
|
3328
3745
|
*/
|
|
3329
3746
|
static custom(callbacks: CustomOnchainWalletCallbacks): OnchainWalletLike;
|
|
3330
3747
|
/**
|
|
3331
|
-
* BDK-backed wallet. Opens the shared sqlite cache
|
|
3748
|
+
* BDK-backed wallet. Opens the shared sqlite cache in `datadir`, a
|
|
3749
|
+
* filesystem path or a `file://` URI.
|
|
3332
3750
|
*/
|
|
3333
3751
|
static default_(network: Network, mnemonic: string, config: Config, datadir: string, asyncOpts_?: {
|
|
3334
3752
|
signal: AbortSignal;
|
|
@@ -3408,7 +3826,8 @@ export type WalletOpenArgs = {
|
|
|
3408
3826
|
*/
|
|
3409
3827
|
runDaemon: boolean;
|
|
3410
3828
|
/**
|
|
3411
|
-
* The data directory to use for this wallet
|
|
3829
|
+
* The data directory to use for this wallet: a filesystem path or a
|
|
3830
|
+
* `file://` URI (such as Expo's `Directory.uri`)
|
|
3412
3831
|
*/
|
|
3413
3832
|
datadir: string;
|
|
3414
3833
|
/**
|
|
@@ -3430,11 +3849,12 @@ export type WalletOpenArgs = {
|
|
|
3430
3849
|
*/
|
|
3431
3850
|
createWithoutServer: boolean;
|
|
3432
3851
|
/**
|
|
3433
|
-
* Whether to skip the
|
|
3852
|
+
* Whether to skip the recovery from seed
|
|
3434
3853
|
*
|
|
3435
|
-
* The
|
|
3436
|
-
* network calls
|
|
3437
|
-
* Set this to open without
|
|
3854
|
+
* The recovery starts on the open that creates the wallet locally, makes
|
|
3855
|
+
* network calls, and resumes on every sync until it is done; its outcome
|
|
3856
|
+
* is available from `Wallet::recovery_status`. Set this to open without
|
|
3857
|
+
* it.
|
|
3438
3858
|
*
|
|
3439
3859
|
* Default: false
|
|
3440
3860
|
*/
|
|
@@ -3742,19 +4162,22 @@ export type PaymentResult = InstanceType<typeof PaymentResult['Onchain' | 'Light
|
|
|
3742
4162
|
export declare enum RecoveryStatus_Tags {
|
|
3743
4163
|
NotRun = "NotRun",
|
|
3744
4164
|
Failed = "Failed",
|
|
4165
|
+
InProgress = "InProgress",
|
|
3745
4166
|
Completed = "Completed"
|
|
3746
4167
|
}
|
|
3747
4168
|
/**
|
|
3748
|
-
* Outcome of the seed
|
|
4169
|
+
* Outcome of the seed recovery as `Wallet::open` saw it, mirroring
|
|
3749
4170
|
* `bark::RecoveryStatus`.
|
|
3750
4171
|
*
|
|
3751
|
-
* The
|
|
3752
|
-
*
|
|
3753
|
-
* `Failed` means the
|
|
3754
|
-
*
|
|
3755
|
-
*
|
|
4172
|
+
* The variants are distinguishable on purpose: `NotRun` means nothing was
|
|
4173
|
+
* attempted (wallet already existed locally without a recovery in progress,
|
|
4174
|
+
* or `skip_recovery` was set), `Failed` means the recovery could not be
|
|
4175
|
+
* started or read back so funds may be missing, `InProgress` means it stopped
|
|
4176
|
+
* before it was done and resumes on every sync, and `Completed` carries the
|
|
4177
|
+
* final report — whose `is_complete` can still be `false` for individual
|
|
4178
|
+
* VTXOs.
|
|
3756
4179
|
*
|
|
3757
|
-
* Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
|
|
4180
|
+
* Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
|
|
3758
4181
|
*/
|
|
3759
4182
|
export declare const RecoveryStatus: Readonly<{
|
|
3760
4183
|
instanceOf: (obj: any) => obj is RecoveryStatus;
|
|
@@ -3823,6 +4246,45 @@ export declare const RecoveryStatus: Readonly<{
|
|
|
3823
4246
|
readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
|
|
3824
4247
|
};
|
|
3825
4248
|
};
|
|
4249
|
+
InProgress: {
|
|
4250
|
+
new (inner: {
|
|
4251
|
+
report: RecoveryReport;
|
|
4252
|
+
}): {
|
|
4253
|
+
readonly tag: RecoveryStatus_Tags.InProgress;
|
|
4254
|
+
readonly inner: Readonly<{
|
|
4255
|
+
report: RecoveryReport;
|
|
4256
|
+
}>;
|
|
4257
|
+
/**
|
|
4258
|
+
* @private
|
|
4259
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4260
|
+
*/
|
|
4261
|
+
readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
|
|
4262
|
+
};
|
|
4263
|
+
new(inner: {
|
|
4264
|
+
report: RecoveryReport;
|
|
4265
|
+
}): {
|
|
4266
|
+
readonly tag: RecoveryStatus_Tags.InProgress;
|
|
4267
|
+
readonly inner: Readonly<{
|
|
4268
|
+
report: RecoveryReport;
|
|
4269
|
+
}>;
|
|
4270
|
+
/**
|
|
4271
|
+
* @private
|
|
4272
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4273
|
+
*/
|
|
4274
|
+
readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
|
|
4275
|
+
};
|
|
4276
|
+
instanceOf(obj: any): obj is {
|
|
4277
|
+
readonly tag: RecoveryStatus_Tags.InProgress;
|
|
4278
|
+
readonly inner: Readonly<{
|
|
4279
|
+
report: RecoveryReport;
|
|
4280
|
+
}>;
|
|
4281
|
+
/**
|
|
4282
|
+
* @private
|
|
4283
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4284
|
+
*/
|
|
4285
|
+
readonly [uniffiTypeNameSymbol]: "RecoveryStatus";
|
|
4286
|
+
};
|
|
4287
|
+
};
|
|
3826
4288
|
Completed: {
|
|
3827
4289
|
new (inner: {
|
|
3828
4290
|
report: RecoveryReport;
|
|
@@ -3864,18 +4326,20 @@ export declare const RecoveryStatus: Readonly<{
|
|
|
3864
4326
|
};
|
|
3865
4327
|
}>;
|
|
3866
4328
|
/**
|
|
3867
|
-
* Outcome of the seed
|
|
4329
|
+
* Outcome of the seed recovery as `Wallet::open` saw it, mirroring
|
|
3868
4330
|
* `bark::RecoveryStatus`.
|
|
3869
4331
|
*
|
|
3870
|
-
* The
|
|
3871
|
-
*
|
|
3872
|
-
* `Failed` means the
|
|
3873
|
-
*
|
|
3874
|
-
*
|
|
4332
|
+
* The variants are distinguishable on purpose: `NotRun` means nothing was
|
|
4333
|
+
* attempted (wallet already existed locally without a recovery in progress,
|
|
4334
|
+
* or `skip_recovery` was set), `Failed` means the recovery could not be
|
|
4335
|
+
* started or read back so funds may be missing, `InProgress` means it stopped
|
|
4336
|
+
* before it was done and resumes on every sync, and `Completed` carries the
|
|
4337
|
+
* final report — whose `is_complete` can still be `false` for individual
|
|
4338
|
+
* VTXOs.
|
|
3875
4339
|
*
|
|
3876
|
-
* Serde/TS tags: `"not-run"` | `"failed"` | `"completed"`.
|
|
4340
|
+
* Serde/TS tags: `"not-run"` | `"failed"` | `"in-progress"` | `"completed"`.
|
|
3877
4341
|
*/
|
|
3878
|
-
export type RecoveryStatus = InstanceType<typeof RecoveryStatus['NotRun' | 'Failed' | 'Completed']>;
|
|
4342
|
+
export type RecoveryStatus = InstanceType<typeof RecoveryStatus['NotRun' | 'Failed' | 'InProgress' | 'Completed']>;
|
|
3879
4343
|
export declare enum WalletNotification_Tags {
|
|
3880
4344
|
MovementCreated = "MovementCreated",
|
|
3881
4345
|
MovementUpdated = "MovementUpdated",
|
|
@@ -4100,6 +4564,17 @@ export interface CustomOnchainWalletCallbacks {
|
|
|
4100
4564
|
/**
|
|
4101
4565
|
* Create a signed P2A CPFP transaction
|
|
4102
4566
|
*
|
|
4567
|
+
* The child spends the parent's P2A anchor and pays the fee for the
|
|
4568
|
+
* whole package: at least (parent vsize + child vsize) times
|
|
4569
|
+
* `effective_fee_rate_sat_per_vb`, the parent being zero-fee.
|
|
4570
|
+
*
|
|
4571
|
+
* For `fees_type == "Rbf"` the child replaces what already spends the
|
|
4572
|
+
* anchor, so bitcoind's replacement rules apply on top. With
|
|
4573
|
+
* `replacement_vsize` the child's vsize, plus the parent's when
|
|
4574
|
+
* `parent_in_mempool` is false, the child must also pay at least:
|
|
4575
|
+
* * `replaced_fee_sats + incremental_relay_fee_sat_per_vb * replacement_vsize`
|
|
4576
|
+
* * `(replaced_fee_rate_sat_per_vb + incremental_relay_fee_sat_per_vb) * replacement_vsize`
|
|
4577
|
+
*
|
|
4103
4578
|
* # Arguments
|
|
4104
4579
|
* * `params` - CPFP transaction parameters
|
|
4105
4580
|
*
|
|
@@ -4208,6 +4683,17 @@ export declare class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObje
|
|
|
4208
4683
|
/**
|
|
4209
4684
|
* Create a signed P2A CPFP transaction
|
|
4210
4685
|
*
|
|
4686
|
+
* The child spends the parent's P2A anchor and pays the fee for the
|
|
4687
|
+
* whole package: at least (parent vsize + child vsize) times
|
|
4688
|
+
* `effective_fee_rate_sat_per_vb`, the parent being zero-fee.
|
|
4689
|
+
*
|
|
4690
|
+
* For `fees_type == "Rbf"` the child replaces what already spends the
|
|
4691
|
+
* anchor, so bitcoind's replacement rules apply on top. With
|
|
4692
|
+
* `replacement_vsize` the child's vsize, plus the parent's when
|
|
4693
|
+
* `parent_in_mempool` is false, the child must also pay at least:
|
|
4694
|
+
* * `replaced_fee_sats + incremental_relay_fee_sat_per_vb * replacement_vsize`
|
|
4695
|
+
* * `(replaced_fee_rate_sat_per_vb + incremental_relay_fee_sat_per_vb) * replacement_vsize`
|
|
4696
|
+
*
|
|
4211
4697
|
* # Arguments
|
|
4212
4698
|
* * `params` - CPFP transaction parameters
|
|
4213
4699
|
*
|
|
@@ -4382,19 +4868,57 @@ export interface WalletLike {
|
|
|
4382
4868
|
bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
|
|
4383
4869
|
signal: AbortSignal;
|
|
4384
4870
|
}): Promise<Bip321Uri>;
|
|
4385
|
-
|
|
4871
|
+
/**
|
|
4872
|
+
* Board all funds of the onchain wallet. See `board_amount` for
|
|
4873
|
+
* `expiry_height`.
|
|
4874
|
+
*/
|
|
4875
|
+
boardAll(expiryHeight: number | undefined, asyncOpts_?: {
|
|
4386
4876
|
signal: AbortSignal;
|
|
4387
4877
|
}): Promise<PendingBoard>;
|
|
4388
|
-
|
|
4878
|
+
/**
|
|
4879
|
+
* Board `amount_sats` from the onchain wallet.
|
|
4880
|
+
*
|
|
4881
|
+
* `expiry_height` sets the block height at which the board VTXO expires.
|
|
4882
|
+
* It defaults to `Config.board_lifetime` blocks from the tip, capped at
|
|
4883
|
+
* the server's VTXO lifetime; an expiry beyond that lifetime, or too
|
|
4884
|
+
* close to the tip to confirm and register in time, is refused.
|
|
4885
|
+
*/
|
|
4886
|
+
boardAmount(amountSats: bigint, expiryHeight: number | undefined, asyncOpts_?: {
|
|
4389
4887
|
signal: AbortSignal;
|
|
4390
4888
|
}): Promise<PendingBoard>;
|
|
4391
|
-
|
|
4889
|
+
/**
|
|
4890
|
+
* Derive a fresh key and return the address to fund a board with from
|
|
4891
|
+
* elsewhere, e.g. as a payjoin receiver. Persist the returned info and
|
|
4892
|
+
* pass it to `board_psbt` with the funding PSBT. See `board_amount` for
|
|
4893
|
+
* `expiry_height`.
|
|
4894
|
+
*/
|
|
4895
|
+
boardFundingAddress(expiryHeight: number | undefined, asyncOpts_?: {
|
|
4392
4896
|
signal: AbortSignal;
|
|
4393
4897
|
}): Promise<BoardFundingInfo>;
|
|
4394
|
-
|
|
4898
|
+
/**
|
|
4899
|
+
* Board from a funding PSBT paying the address of `funding`, made by
|
|
4900
|
+
* `board_funding_address`.
|
|
4901
|
+
*
|
|
4902
|
+
* A finalized PSBT is broadcast by bark; an unfinalized one leaves the
|
|
4903
|
+
* broadcast to another party and bark waits for the transaction to
|
|
4904
|
+
* appear. The board commits to the PSBT's txid, so if the other party
|
|
4905
|
+
* changes the transaction, call this again with the new PSBT and the
|
|
4906
|
+
* same `funding`.
|
|
4907
|
+
*
|
|
4908
|
+
* Fails once `funding` is too close to its expiry height; make a new
|
|
4909
|
+
* funding address then.
|
|
4910
|
+
*/
|
|
4911
|
+
boardPsbt(psbtBase64: string, funding: BoardFundingInfo, asyncOpts_?: {
|
|
4395
4912
|
signal: AbortSignal;
|
|
4396
4913
|
}): Promise<PendingBoard>;
|
|
4397
|
-
|
|
4914
|
+
/**
|
|
4915
|
+
* Create an invoice for an incoming lightning payment.
|
|
4916
|
+
*
|
|
4917
|
+
* `expiry_secs` is how long the invoice can be paid for. It defaults to,
|
|
4918
|
+
* and cannot exceed, the Ark server's invoice expiry; creating the invoice
|
|
4919
|
+
* fails if the server does not honour it. Must be at least 1.
|
|
4920
|
+
*/
|
|
4921
|
+
bolt11Invoice(amountSats: bigint, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: {
|
|
4398
4922
|
signal: AbortSignal;
|
|
4399
4923
|
}): Promise<LightningInvoice>;
|
|
4400
4924
|
/**
|
|
@@ -4412,8 +4936,10 @@ export interface WalletLike {
|
|
|
4412
4936
|
*
|
|
4413
4937
|
* A `claim_destination` owned by this wallet is claimed locally instead of
|
|
4414
4938
|
* going through its mailbox.
|
|
4939
|
+
*
|
|
4940
|
+
* `expiry_secs` works as in [`Self::bolt11_invoice`].
|
|
4415
4941
|
*/
|
|
4416
|
-
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, asyncOpts_?: {
|
|
4942
|
+
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description: string | undefined, token: string | undefined, expirySecs: bigint | undefined, asyncOpts_?: {
|
|
4417
4943
|
signal: AbortSignal;
|
|
4418
4944
|
}): Promise<LightningInvoice>;
|
|
4419
4945
|
broadcastTx(txHex: string, asyncOpts_?: {
|
|
@@ -4585,6 +5111,18 @@ export interface WalletLike {
|
|
|
4585
5111
|
isInvoicePaid(paymentHash: string, asyncOpts_?: {
|
|
4586
5112
|
signal: AbortSignal;
|
|
4587
5113
|
}): Promise<boolean>;
|
|
5114
|
+
/**
|
|
5115
|
+
* Rebuild the funding info of a funding address made before
|
|
5116
|
+
* `BoardFundingInfo` carried `user_pubkey`, from the `keypair_index` and
|
|
5117
|
+
* `expiry_height` stored alongside it.
|
|
5118
|
+
*
|
|
5119
|
+
* Only for boards funded through the old `board_funding_address`. If the
|
|
5120
|
+
* server's key or exit delta changed since, the rebuilt address won't
|
|
5121
|
+
* match and `board_psbt` refuses the PSBT.
|
|
5122
|
+
*/
|
|
5123
|
+
legacyBoardFundingAddress(keypairIndex: number, expiryHeight: number, asyncOpts_?: {
|
|
5124
|
+
signal: AbortSignal;
|
|
5125
|
+
}): Promise<BoardFundingInfo>;
|
|
4588
5126
|
/**
|
|
4589
5127
|
* Triage a payment hash: settled or in-progress. Errors if no lightning
|
|
4590
5128
|
* receive is known for this payment hash.
|
|
@@ -4733,12 +5271,46 @@ export interface WalletLike {
|
|
|
4733
5271
|
pendingLightningSends(asyncOpts_?: {
|
|
4734
5272
|
signal: AbortSignal;
|
|
4735
5273
|
}): Promise<Array<LightningSend>>;
|
|
5274
|
+
/**
|
|
5275
|
+
* The report of the recovery from seed in progress, or none once it is
|
|
5276
|
+
* done (or if none ever ran). Its `failed` VTXOs are the ones still
|
|
5277
|
+
* missing: they are kept locked until the server gives their status.
|
|
5278
|
+
*
|
|
5279
|
+
* When a recovery resumed after open is done, bark only logs its final
|
|
5280
|
+
* report; it cannot be read here. VTXOs it gave up on (`abandoned`) stay
|
|
5281
|
+
* locked, so they still show in `vtxos`.
|
|
5282
|
+
*/
|
|
5283
|
+
pendingRecovery(asyncOpts_?: {
|
|
5284
|
+
signal: AbortSignal;
|
|
5285
|
+
}): Promise<RecoveryReport | undefined>;
|
|
4736
5286
|
pendingRoundInputVtxos(asyncOpts_?: {
|
|
4737
5287
|
signal: AbortSignal;
|
|
4738
5288
|
}): Promise<Array<Vtxo>>;
|
|
4739
5289
|
pendingRoundStates(asyncOpts_?: {
|
|
4740
5290
|
signal: AbortSignal;
|
|
4741
5291
|
}): Promise<Array<RoundState>>;
|
|
5292
|
+
/**
|
|
5293
|
+
* Sign, without broadcasting, the CPFP child of every exit transaction
|
|
5294
|
+
* that still needs broadcasting to emergency-exit the given VTXOs, for as
|
|
5295
|
+
* long as confirmed onchain funds last. Mirrors bark-rest
|
|
5296
|
+
* `POST /exits/presign`.
|
|
5297
|
+
*
|
|
5298
|
+
* Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
|
|
5299
|
+
* nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
|
|
5300
|
+
* the onchain wallet and exits first.
|
|
5301
|
+
*
|
|
5302
|
+
* Execute the result wave by wave: broadcast a wave's packages together
|
|
5303
|
+
* and wait for them, and its `in_mempool` transactions, to confirm before
|
|
5304
|
+
* the next. No funds are reserved, so a later onchain spend can
|
|
5305
|
+
* invalidate the children. The children are signed: store the result
|
|
5306
|
+
* securely.
|
|
5307
|
+
*
|
|
5308
|
+
* Needs the built-in onchain wallet; with callback wallets
|
|
5309
|
+
* (`CustomOnchainWalletCallbacks`) it fails.
|
|
5310
|
+
*/
|
|
5311
|
+
presignEmergencyExit(vtxoIds: Array<string> | undefined, feeRateSatPerVb: bigint | undefined, asyncOpts_?: {
|
|
5312
|
+
signal: AbortSignal;
|
|
5313
|
+
}): Promise<PresignedExits>;
|
|
4742
5314
|
progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: {
|
|
4743
5315
|
signal: AbortSignal;
|
|
4744
5316
|
}): Promise<Array<ExitProgressStatus>>;
|
|
@@ -4751,7 +5323,10 @@ export interface WalletLike {
|
|
|
4751
5323
|
/**
|
|
4752
5324
|
* Recover the given VTXO ids from the server, importing the ones this
|
|
4753
5325
|
* wallet owns that are still spendable. Use it to retry ids a previous
|
|
4754
|
-
*
|
|
5326
|
+
* recovery reported as `failed` or `abandoned`.
|
|
5327
|
+
*
|
|
5328
|
+
* Fails while a recovery from seed is being driven, as both work on the
|
|
5329
|
+
* same locked VTXOs.
|
|
4755
5330
|
*
|
|
4756
5331
|
* `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
|
|
4757
5332
|
* decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
|
|
@@ -4761,21 +5336,23 @@ export interface WalletLike {
|
|
|
4761
5336
|
signal: AbortSignal;
|
|
4762
5337
|
}): Promise<RecoveryReport>;
|
|
4763
5338
|
/**
|
|
4764
|
-
* The report of the
|
|
4765
|
-
*
|
|
4766
|
-
* that failed apart from one that never ran.
|
|
5339
|
+
* The report of the recovery from seed as `Wallet::open` saw it, or none
|
|
5340
|
+
* if it did not run or failed. Use `recovery_status` to tell these apart.
|
|
4767
5341
|
*/
|
|
4768
5342
|
recoveryReport(): RecoveryReport | undefined;
|
|
4769
5343
|
/**
|
|
4770
|
-
* Outcome of the
|
|
5344
|
+
* Outcome of the recovery from seed as `Wallet::open` saw it. A
|
|
5345
|
+
* snapshot: it does not change after open, see `pending_recovery` for the
|
|
5346
|
+
* live state.
|
|
4771
5347
|
*
|
|
4772
|
-
* Recovery
|
|
4773
|
-
*
|
|
4774
|
-
*
|
|
4775
|
-
*
|
|
4776
|
-
*
|
|
4777
|
-
*
|
|
4778
|
-
* report
|
|
5348
|
+
* Recovery starts on the open that creates the wallet locally, unless
|
|
5349
|
+
* `WalletOpenArgs.skip_recovery` is set. A later open reports
|
|
5350
|
+
* `InProgress` while that recovery is not done, and `NotRun` otherwise.
|
|
5351
|
+
* `Failed` means the recovery could not be started or read back — bark
|
|
5352
|
+
* logs that and lets open succeed — so funds may be missing. `InProgress`
|
|
5353
|
+
* means it stopped before it was done; every sync resumes it. `Completed`
|
|
5354
|
+
* carries the final report, and `isComplete == false` there means funds
|
|
5355
|
+
* may still be missing.
|
|
4779
5356
|
*/
|
|
4780
5357
|
recoveryStatus(): RecoveryStatus;
|
|
4781
5358
|
refreshServer(asyncOpts_?: {
|
|
@@ -4796,6 +5373,19 @@ export interface WalletLike {
|
|
|
4796
5373
|
refreshVtxosScheduled(vtxoIds: Array<string>, scheduledHeight: number, asyncOpts_?: {
|
|
4797
5374
|
signal: AbortSignal;
|
|
4798
5375
|
}): Promise<RoundState | undefined>;
|
|
5376
|
+
/**
|
|
5377
|
+
* List every exit transaction of the given VTXOs still awaiting
|
|
5378
|
+
* confirmation, so anyone can broadcast the exits on the user's behalf.
|
|
5379
|
+
* Mirrors bark-rest `GET /exits/remaining`.
|
|
5380
|
+
*
|
|
5381
|
+
* Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
|
|
5382
|
+
* nothing. Read-only: signs nothing and never touches the onchain wallet,
|
|
5383
|
+
* so it works with callback wallets too. Statuses of started exits reflect
|
|
5384
|
+
* the last `sync_exits`.
|
|
5385
|
+
*/
|
|
5386
|
+
remainingExitTransactions(vtxoIds: Array<string> | undefined, asyncOpts_?: {
|
|
5387
|
+
signal: AbortSignal;
|
|
5388
|
+
}): Promise<RemainingExitTransactions>;
|
|
4799
5389
|
/**
|
|
4800
5390
|
* Start the background daemon. The onchain wallet used by the daemon is
|
|
4801
5391
|
* the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
|
|
@@ -4859,9 +5449,12 @@ export interface WalletLike {
|
|
|
4859
5449
|
signal: AbortSignal;
|
|
4860
5450
|
}): Promise<void>;
|
|
4861
5451
|
/**
|
|
4862
|
-
* Stop the background daemon and wait until
|
|
4863
|
-
*
|
|
4864
|
-
*
|
|
5452
|
+
* Stop the background daemon and wait until it has finished, e.g. before
|
|
5453
|
+
* deleting the wallet's datadir. No-op when no daemon is running.
|
|
5454
|
+
*
|
|
5455
|
+
* While another call already waits for the daemon, this returns at once
|
|
5456
|
+
* without waiting. A start made while it waits goes ahead, so the daemon
|
|
5457
|
+
* runs again after.
|
|
4865
5458
|
*/
|
|
4866
5459
|
stopDaemonWait(asyncOpts_?: {
|
|
4867
5460
|
signal: AbortSignal;
|
|
@@ -4891,6 +5484,16 @@ export interface WalletLike {
|
|
|
4891
5484
|
syncPendingBoards(asyncOpts_?: {
|
|
4892
5485
|
signal: AbortSignal;
|
|
4893
5486
|
}): Promise<void>;
|
|
5487
|
+
/**
|
|
5488
|
+
* Drive the recovery from seed in progress, if any, until it is done or
|
|
5489
|
+
* parks again. Does nothing while another drive holds its lock.
|
|
5490
|
+
*
|
|
5491
|
+
* This already runs as part of `sync`; call it to resume the recovery on
|
|
5492
|
+
* demand.
|
|
5493
|
+
*/
|
|
5494
|
+
syncPendingRecovery(asyncOpts_?: {
|
|
5495
|
+
signal: AbortSignal;
|
|
5496
|
+
}): Promise<void>;
|
|
4894
5497
|
tryClaimAllLightningReceives(wait: boolean, asyncOpts_?: {
|
|
4895
5498
|
signal: AbortSignal;
|
|
4896
5499
|
}): Promise<Array<LightningReceive>>;
|
|
@@ -5000,19 +5603,57 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5000
5603
|
bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
|
|
5001
5604
|
signal: AbortSignal;
|
|
5002
5605
|
}): Promise<Bip321Uri>;
|
|
5003
|
-
|
|
5606
|
+
/**
|
|
5607
|
+
* Board all funds of the onchain wallet. See `board_amount` for
|
|
5608
|
+
* `expiry_height`.
|
|
5609
|
+
*/
|
|
5610
|
+
boardAll(expiryHeight?: number | undefined, asyncOpts_?: {
|
|
5004
5611
|
signal: AbortSignal;
|
|
5005
5612
|
}): Promise<PendingBoard>;
|
|
5006
|
-
|
|
5613
|
+
/**
|
|
5614
|
+
* Board `amount_sats` from the onchain wallet.
|
|
5615
|
+
*
|
|
5616
|
+
* `expiry_height` sets the block height at which the board VTXO expires.
|
|
5617
|
+
* It defaults to `Config.board_lifetime` blocks from the tip, capped at
|
|
5618
|
+
* the server's VTXO lifetime; an expiry beyond that lifetime, or too
|
|
5619
|
+
* close to the tip to confirm and register in time, is refused.
|
|
5620
|
+
*/
|
|
5621
|
+
boardAmount(amountSats: bigint, expiryHeight?: number | undefined, asyncOpts_?: {
|
|
5007
5622
|
signal: AbortSignal;
|
|
5008
5623
|
}): Promise<PendingBoard>;
|
|
5009
|
-
|
|
5624
|
+
/**
|
|
5625
|
+
* Derive a fresh key and return the address to fund a board with from
|
|
5626
|
+
* elsewhere, e.g. as a payjoin receiver. Persist the returned info and
|
|
5627
|
+
* pass it to `board_psbt` with the funding PSBT. See `board_amount` for
|
|
5628
|
+
* `expiry_height`.
|
|
5629
|
+
*/
|
|
5630
|
+
boardFundingAddress(expiryHeight?: number | undefined, asyncOpts_?: {
|
|
5010
5631
|
signal: AbortSignal;
|
|
5011
5632
|
}): Promise<BoardFundingInfo>;
|
|
5012
|
-
|
|
5633
|
+
/**
|
|
5634
|
+
* Board from a funding PSBT paying the address of `funding`, made by
|
|
5635
|
+
* `board_funding_address`.
|
|
5636
|
+
*
|
|
5637
|
+
* A finalized PSBT is broadcast by bark; an unfinalized one leaves the
|
|
5638
|
+
* broadcast to another party and bark waits for the transaction to
|
|
5639
|
+
* appear. The board commits to the PSBT's txid, so if the other party
|
|
5640
|
+
* changes the transaction, call this again with the new PSBT and the
|
|
5641
|
+
* same `funding`.
|
|
5642
|
+
*
|
|
5643
|
+
* Fails once `funding` is too close to its expiry height; make a new
|
|
5644
|
+
* funding address then.
|
|
5645
|
+
*/
|
|
5646
|
+
boardPsbt(psbtBase64: string, funding: BoardFundingInfo, asyncOpts_?: {
|
|
5013
5647
|
signal: AbortSignal;
|
|
5014
5648
|
}): Promise<PendingBoard>;
|
|
5015
|
-
|
|
5649
|
+
/**
|
|
5650
|
+
* Create an invoice for an incoming lightning payment.
|
|
5651
|
+
*
|
|
5652
|
+
* `expiry_secs` is how long the invoice can be paid for. It defaults to,
|
|
5653
|
+
* and cannot exceed, the Ark server's invoice expiry; creating the invoice
|
|
5654
|
+
* fails if the server does not honour it. Must be at least 1.
|
|
5655
|
+
*/
|
|
5656
|
+
bolt11Invoice(amountSats: bigint, description: string | undefined, token?: string | undefined, expirySecs?: bigint | undefined, asyncOpts_?: {
|
|
5016
5657
|
signal: AbortSignal;
|
|
5017
5658
|
}): Promise<LightningInvoice>;
|
|
5018
5659
|
/**
|
|
@@ -5030,8 +5671,10 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5030
5671
|
*
|
|
5031
5672
|
* A `claim_destination` owned by this wallet is claimed locally instead of
|
|
5032
5673
|
* going through its mailbox.
|
|
5674
|
+
*
|
|
5675
|
+
* `expiry_secs` works as in [`Self::bolt11_invoice`].
|
|
5033
5676
|
*/
|
|
5034
|
-
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description?: string | undefined, token?: string | undefined, asyncOpts_?: {
|
|
5677
|
+
bolt11InvoiceForAddress(amountSats: bigint, claimDestination: string, description?: string | undefined, token?: string | undefined, expirySecs?: bigint | undefined, asyncOpts_?: {
|
|
5035
5678
|
signal: AbortSignal;
|
|
5036
5679
|
}): Promise<LightningInvoice>;
|
|
5037
5680
|
broadcastTx(txHex: string, asyncOpts_?: {
|
|
@@ -5203,6 +5846,18 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5203
5846
|
isInvoicePaid(paymentHash: string, asyncOpts_?: {
|
|
5204
5847
|
signal: AbortSignal;
|
|
5205
5848
|
}): Promise<boolean>;
|
|
5849
|
+
/**
|
|
5850
|
+
* Rebuild the funding info of a funding address made before
|
|
5851
|
+
* `BoardFundingInfo` carried `user_pubkey`, from the `keypair_index` and
|
|
5852
|
+
* `expiry_height` stored alongside it.
|
|
5853
|
+
*
|
|
5854
|
+
* Only for boards funded through the old `board_funding_address`. If the
|
|
5855
|
+
* server's key or exit delta changed since, the rebuilt address won't
|
|
5856
|
+
* match and `board_psbt` refuses the PSBT.
|
|
5857
|
+
*/
|
|
5858
|
+
legacyBoardFundingAddress(keypairIndex: number, expiryHeight: number, asyncOpts_?: {
|
|
5859
|
+
signal: AbortSignal;
|
|
5860
|
+
}): Promise<BoardFundingInfo>;
|
|
5206
5861
|
/**
|
|
5207
5862
|
* Triage a payment hash: settled or in-progress. Errors if no lightning
|
|
5208
5863
|
* receive is known for this payment hash.
|
|
@@ -5351,12 +6006,46 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5351
6006
|
pendingLightningSends(asyncOpts_?: {
|
|
5352
6007
|
signal: AbortSignal;
|
|
5353
6008
|
}): Promise<Array<LightningSend>>;
|
|
6009
|
+
/**
|
|
6010
|
+
* The report of the recovery from seed in progress, or none once it is
|
|
6011
|
+
* done (or if none ever ran). Its `failed` VTXOs are the ones still
|
|
6012
|
+
* missing: they are kept locked until the server gives their status.
|
|
6013
|
+
*
|
|
6014
|
+
* When a recovery resumed after open is done, bark only logs its final
|
|
6015
|
+
* report; it cannot be read here. VTXOs it gave up on (`abandoned`) stay
|
|
6016
|
+
* locked, so they still show in `vtxos`.
|
|
6017
|
+
*/
|
|
6018
|
+
pendingRecovery(asyncOpts_?: {
|
|
6019
|
+
signal: AbortSignal;
|
|
6020
|
+
}): Promise<RecoveryReport | undefined>;
|
|
5354
6021
|
pendingRoundInputVtxos(asyncOpts_?: {
|
|
5355
6022
|
signal: AbortSignal;
|
|
5356
6023
|
}): Promise<Array<Vtxo>>;
|
|
5357
6024
|
pendingRoundStates(asyncOpts_?: {
|
|
5358
6025
|
signal: AbortSignal;
|
|
5359
6026
|
}): Promise<Array<RoundState>>;
|
|
6027
|
+
/**
|
|
6028
|
+
* Sign, without broadcasting, the CPFP child of every exit transaction
|
|
6029
|
+
* that still needs broadcasting to emergency-exit the given VTXOs, for as
|
|
6030
|
+
* long as confirmed onchain funds last. Mirrors bark-rest
|
|
6031
|
+
* `POST /exits/presign`.
|
|
6032
|
+
*
|
|
6033
|
+
* Omit `vtxo_ids` to presign every spendable VTXO; an empty list presigns
|
|
6034
|
+
* nothing. `fee_rate_sat_per_vb` defaults to the chain's fast rate. Syncs
|
|
6035
|
+
* the onchain wallet and exits first.
|
|
6036
|
+
*
|
|
6037
|
+
* Execute the result wave by wave: broadcast a wave's packages together
|
|
6038
|
+
* and wait for them, and its `in_mempool` transactions, to confirm before
|
|
6039
|
+
* the next. No funds are reserved, so a later onchain spend can
|
|
6040
|
+
* invalidate the children. The children are signed: store the result
|
|
6041
|
+
* securely.
|
|
6042
|
+
*
|
|
6043
|
+
* Needs the built-in onchain wallet; with callback wallets
|
|
6044
|
+
* (`CustomOnchainWalletCallbacks`) it fails.
|
|
6045
|
+
*/
|
|
6046
|
+
presignEmergencyExit(vtxoIds?: Array<string> | undefined, feeRateSatPerVb?: bigint | undefined, asyncOpts_?: {
|
|
6047
|
+
signal: AbortSignal;
|
|
6048
|
+
}): Promise<PresignedExits>;
|
|
5360
6049
|
progressExits(feeRateSatPerVb: bigint | undefined, asyncOpts_?: {
|
|
5361
6050
|
signal: AbortSignal;
|
|
5362
6051
|
}): Promise<Array<ExitProgressStatus>>;
|
|
@@ -5369,7 +6058,10 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5369
6058
|
/**
|
|
5370
6059
|
* Recover the given VTXO ids from the server, importing the ones this
|
|
5371
6060
|
* wallet owns that are still spendable. Use it to retry ids a previous
|
|
5372
|
-
*
|
|
6061
|
+
* recovery reported as `failed` or `abandoned`.
|
|
6062
|
+
*
|
|
6063
|
+
* Fails while a recovery from seed is being driven, as both work on the
|
|
6064
|
+
* same locked VTXOs.
|
|
5373
6065
|
*
|
|
5374
6066
|
* `gap_limit` overrides `Config.vtxo_key_gap_limit` for the key scan that
|
|
5375
6067
|
* decides which of `vtxo_ids` this wallet owns. Widen it to reach ids a
|
|
@@ -5379,21 +6071,23 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5379
6071
|
signal: AbortSignal;
|
|
5380
6072
|
}): Promise<RecoveryReport>;
|
|
5381
6073
|
/**
|
|
5382
|
-
* The report of the
|
|
5383
|
-
*
|
|
5384
|
-
* that failed apart from one that never ran.
|
|
6074
|
+
* The report of the recovery from seed as `Wallet::open` saw it, or none
|
|
6075
|
+
* if it did not run or failed. Use `recovery_status` to tell these apart.
|
|
5385
6076
|
*/
|
|
5386
6077
|
recoveryReport(): RecoveryReport | undefined;
|
|
5387
6078
|
/**
|
|
5388
|
-
* Outcome of the
|
|
6079
|
+
* Outcome of the recovery from seed as `Wallet::open` saw it. A
|
|
6080
|
+
* snapshot: it does not change after open, see `pending_recovery` for the
|
|
6081
|
+
* live state.
|
|
5389
6082
|
*
|
|
5390
|
-
* Recovery
|
|
5391
|
-
*
|
|
5392
|
-
*
|
|
5393
|
-
*
|
|
5394
|
-
*
|
|
5395
|
-
*
|
|
5396
|
-
* report
|
|
6083
|
+
* Recovery starts on the open that creates the wallet locally, unless
|
|
6084
|
+
* `WalletOpenArgs.skip_recovery` is set. A later open reports
|
|
6085
|
+
* `InProgress` while that recovery is not done, and `NotRun` otherwise.
|
|
6086
|
+
* `Failed` means the recovery could not be started or read back — bark
|
|
6087
|
+
* logs that and lets open succeed — so funds may be missing. `InProgress`
|
|
6088
|
+
* means it stopped before it was done; every sync resumes it. `Completed`
|
|
6089
|
+
* carries the final report, and `isComplete == false` there means funds
|
|
6090
|
+
* may still be missing.
|
|
5397
6091
|
*/
|
|
5398
6092
|
recoveryStatus(): RecoveryStatus;
|
|
5399
6093
|
refreshServer(asyncOpts_?: {
|
|
@@ -5414,6 +6108,19 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5414
6108
|
refreshVtxosScheduled(vtxoIds: Array<string>, scheduledHeight: number, asyncOpts_?: {
|
|
5415
6109
|
signal: AbortSignal;
|
|
5416
6110
|
}): Promise<RoundState | undefined>;
|
|
6111
|
+
/**
|
|
6112
|
+
* List every exit transaction of the given VTXOs still awaiting
|
|
6113
|
+
* confirmation, so anyone can broadcast the exits on the user's behalf.
|
|
6114
|
+
* Mirrors bark-rest `GET /exits/remaining`.
|
|
6115
|
+
*
|
|
6116
|
+
* Omit `vtxo_ids` to cover every spendable VTXO; an empty list covers
|
|
6117
|
+
* nothing. Read-only: signs nothing and never touches the onchain wallet,
|
|
6118
|
+
* so it works with callback wallets too. Statuses of started exits reflect
|
|
6119
|
+
* the last `sync_exits`.
|
|
6120
|
+
*/
|
|
6121
|
+
remainingExitTransactions(vtxoIds?: Array<string> | undefined, asyncOpts_?: {
|
|
6122
|
+
signal: AbortSignal;
|
|
6123
|
+
}): Promise<RemainingExitTransactions>;
|
|
5417
6124
|
/**
|
|
5418
6125
|
* Start the background daemon. The onchain wallet used by the daemon is
|
|
5419
6126
|
* the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
|
|
@@ -5477,9 +6184,12 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5477
6184
|
signal: AbortSignal;
|
|
5478
6185
|
}): Promise<void>;
|
|
5479
6186
|
/**
|
|
5480
|
-
* Stop the background daemon and wait until
|
|
5481
|
-
*
|
|
5482
|
-
*
|
|
6187
|
+
* Stop the background daemon and wait until it has finished, e.g. before
|
|
6188
|
+
* deleting the wallet's datadir. No-op when no daemon is running.
|
|
6189
|
+
*
|
|
6190
|
+
* While another call already waits for the daemon, this returns at once
|
|
6191
|
+
* without waiting. A start made while it waits goes ahead, so the daemon
|
|
6192
|
+
* runs again after.
|
|
5483
6193
|
*/
|
|
5484
6194
|
stopDaemonWait(asyncOpts_?: {
|
|
5485
6195
|
signal: AbortSignal;
|
|
@@ -5509,6 +6219,16 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
5509
6219
|
syncPendingBoards(asyncOpts_?: {
|
|
5510
6220
|
signal: AbortSignal;
|
|
5511
6221
|
}): Promise<void>;
|
|
6222
|
+
/**
|
|
6223
|
+
* Drive the recovery from seed in progress, if any, until it is done or
|
|
6224
|
+
* parks again. Does nothing while another drive holds its lock.
|
|
6225
|
+
*
|
|
6226
|
+
* This already runs as part of `sync`; call it to resume the recovery on
|
|
6227
|
+
* demand.
|
|
6228
|
+
*/
|
|
6229
|
+
syncPendingRecovery(asyncOpts_?: {
|
|
6230
|
+
signal: AbortSignal;
|
|
6231
|
+
}): Promise<void>;
|
|
5512
6232
|
tryClaimAllLightningReceives(wait?: boolean, asyncOpts_?: {
|
|
5513
6233
|
signal: AbortSignal;
|
|
5514
6234
|
}): Promise<Array<LightningReceive>>;
|
|
@@ -5799,6 +6519,13 @@ declare const _default: Readonly<{
|
|
|
5799
6519
|
lift(value: Uint8Array): ExitClaimTransaction;
|
|
5800
6520
|
lower(value: ExitClaimTransaction, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5801
6521
|
};
|
|
6522
|
+
FfiConverterTypeExitFeeInfo: {
|
|
6523
|
+
readFromCursor(c: Cursor): ExitFeeInfo;
|
|
6524
|
+
writeIntoCursor(value: ExitFeeInfo, c: Cursor): void;
|
|
6525
|
+
allocationSize(value: ExitFeeInfo): number;
|
|
6526
|
+
lift(value: Uint8Array): ExitFeeInfo;
|
|
6527
|
+
lower(value: ExitFeeInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6528
|
+
};
|
|
5802
6529
|
FfiConverterTypeExitProgressStatus: {
|
|
5803
6530
|
readFromCursor(c: Cursor): ExitProgressStatus;
|
|
5804
6531
|
writeIntoCursor(value: ExitProgressStatus, c: Cursor): void;
|
|
@@ -5820,6 +6547,13 @@ declare const _default: Readonly<{
|
|
|
5820
6547
|
lift(value: Uint8Array): ExitStateKind;
|
|
5821
6548
|
lower(value: ExitStateKind, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5822
6549
|
};
|
|
6550
|
+
FfiConverterTypeExitTransactionInfo: {
|
|
6551
|
+
readFromCursor(c: Cursor): ExitTransactionInfo;
|
|
6552
|
+
writeIntoCursor(value: ExitTransactionInfo, c: Cursor): void;
|
|
6553
|
+
allocationSize(value: ExitTransactionInfo): number;
|
|
6554
|
+
lift(value: Uint8Array): ExitTransactionInfo;
|
|
6555
|
+
lower(value: ExitTransactionInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6556
|
+
};
|
|
5823
6557
|
FfiConverterTypeExitTransactionPackage: {
|
|
5824
6558
|
readFromCursor(c: Cursor): ExitTransactionPackage;
|
|
5825
6559
|
writeIntoCursor(value: ExitTransactionPackage, c: Cursor): void;
|
|
@@ -6032,6 +6766,48 @@ declare const _default: Readonly<{
|
|
|
6032
6766
|
lift(value: Uint8Array): PpmExpiryFeeEntry;
|
|
6033
6767
|
lower(value: PpmExpiryFeeEntry, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6034
6768
|
};
|
|
6769
|
+
FfiConverterTypePresignedExit: {
|
|
6770
|
+
readFromCursor(c: Cursor): PresignedExit;
|
|
6771
|
+
writeIntoCursor(value: PresignedExit, c: Cursor): void;
|
|
6772
|
+
allocationSize(value: PresignedExit): number;
|
|
6773
|
+
lift(value: Uint8Array): PresignedExit;
|
|
6774
|
+
lower(value: PresignedExit, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6775
|
+
};
|
|
6776
|
+
FfiConverterTypePresignedExitChild: {
|
|
6777
|
+
readFromCursor(c: Cursor): PresignedExitChild;
|
|
6778
|
+
writeIntoCursor(value: PresignedExitChild, c: Cursor): void;
|
|
6779
|
+
allocationSize(value: PresignedExitChild): number;
|
|
6780
|
+
lift(value: Uint8Array): PresignedExitChild;
|
|
6781
|
+
lower(value: PresignedExitChild, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6782
|
+
};
|
|
6783
|
+
FfiConverterTypePresignedExitPackage: {
|
|
6784
|
+
readFromCursor(c: Cursor): PresignedExitPackage;
|
|
6785
|
+
writeIntoCursor(value: PresignedExitPackage, c: Cursor): void;
|
|
6786
|
+
allocationSize(value: PresignedExitPackage): number;
|
|
6787
|
+
lift(value: Uint8Array): PresignedExitPackage;
|
|
6788
|
+
lower(value: PresignedExitPackage, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6789
|
+
};
|
|
6790
|
+
FfiConverterTypePresignedExitStatus: {
|
|
6791
|
+
readFromCursor(c: Cursor): PresignedExitStatus;
|
|
6792
|
+
writeIntoCursor(value: PresignedExitStatus, c: Cursor): void;
|
|
6793
|
+
allocationSize(value: PresignedExitStatus): number;
|
|
6794
|
+
lift(value: Uint8Array): PresignedExitStatus;
|
|
6795
|
+
lower(value: PresignedExitStatus, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6796
|
+
};
|
|
6797
|
+
FfiConverterTypePresignedExits: {
|
|
6798
|
+
readFromCursor(c: Cursor): PresignedExits;
|
|
6799
|
+
writeIntoCursor(value: PresignedExits, c: Cursor): void;
|
|
6800
|
+
allocationSize(value: PresignedExits): number;
|
|
6801
|
+
lift(value: Uint8Array): PresignedExits;
|
|
6802
|
+
lower(value: PresignedExits, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6803
|
+
};
|
|
6804
|
+
FfiConverterTypePresignedWave: {
|
|
6805
|
+
readFromCursor(c: Cursor): PresignedWave;
|
|
6806
|
+
writeIntoCursor(value: PresignedWave, c: Cursor): void;
|
|
6807
|
+
allocationSize(value: PresignedWave): number;
|
|
6808
|
+
lift(value: Uint8Array): PresignedWave;
|
|
6809
|
+
lower(value: PresignedWave, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6810
|
+
};
|
|
6035
6811
|
FfiConverterTypeRecoveryBucket: {
|
|
6036
6812
|
readFromCursor(c: Cursor): RecoveryBucket;
|
|
6037
6813
|
writeIntoCursor(value: RecoveryBucket, c: Cursor): void;
|
|
@@ -6060,6 +6836,20 @@ declare const _default: Readonly<{
|
|
|
6060
6836
|
lift(value: Uint8Array): RefreshFees;
|
|
6061
6837
|
lower(value: RefreshFees, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6062
6838
|
};
|
|
6839
|
+
FfiConverterTypeRemainingExit: {
|
|
6840
|
+
readFromCursor(c: Cursor): RemainingExit;
|
|
6841
|
+
writeIntoCursor(value: RemainingExit, c: Cursor): void;
|
|
6842
|
+
allocationSize(value: RemainingExit): number;
|
|
6843
|
+
lift(value: Uint8Array): RemainingExit;
|
|
6844
|
+
lower(value: RemainingExit, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6845
|
+
};
|
|
6846
|
+
FfiConverterTypeRemainingExitTransactions: {
|
|
6847
|
+
readFromCursor(c: Cursor): RemainingExitTransactions;
|
|
6848
|
+
writeIntoCursor(value: RemainingExitTransactions, c: Cursor): void;
|
|
6849
|
+
allocationSize(value: RemainingExitTransactions): number;
|
|
6850
|
+
lift(value: Uint8Array): RemainingExitTransactions;
|
|
6851
|
+
lower(value: RemainingExitTransactions, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6852
|
+
};
|
|
6063
6853
|
FfiConverterTypeRoundFlowKind: {
|
|
6064
6854
|
readFromCursor(c: Cursor): RoundFlowKind;
|
|
6065
6855
|
writeIntoCursor(value: RoundFlowKind, c: Cursor): void;
|