@arkade-os/sdk 0.4.58 → 0.4.60
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 +34 -6
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-ClaVUg4e.d.cts → ark-D2_yNhfz.d.cts} +1077 -522
- package/dist/{ark-ClaVUg4e.d.ts → ark-D2_yNhfz.d.ts} +1077 -522
- package/dist/{asyncStorageTaskQueue-CnYrhpS-.d.cts → asyncStorageTaskQueue-CqijAAPG.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-Bgau-mvD.d.ts → asyncStorageTaskQueue-Vsp6uk8e.d.ts} +1 -1
- package/dist/{chunk-IPPASJE5.js → chunk-2DINXHGQ.js} +1665 -1149
- package/dist/chunk-2DINXHGQ.js.map +1 -0
- package/dist/{chunk-SYZEQF5D.cjs → chunk-2XLNQHG4.cjs} +10 -10
- package/dist/chunk-2XLNQHG4.cjs.map +1 -0
- package/dist/{chunk-AGWZXGG2.js → chunk-3Q7BBUWO.js} +4 -4
- package/dist/{chunk-AGWZXGG2.js.map → chunk-3Q7BBUWO.js.map} +1 -1
- package/dist/{chunk-D6RGHPZ5.cjs → chunk-4A4GRSTB.cjs} +86 -13
- package/dist/chunk-4A4GRSTB.cjs.map +1 -0
- package/dist/{chunk-SGWMB4W2.js → chunk-B66RYHTB.js} +5 -5
- package/dist/chunk-B66RYHTB.js.map +1 -0
- package/dist/{chunk-TV2RLVOB.js → chunk-FSKANUV4.js} +12 -5
- package/dist/chunk-FSKANUV4.js.map +1 -0
- package/dist/{chunk-I4YEGI2R.cjs → chunk-H7JCHFM6.cjs} +17 -17
- package/dist/{chunk-I4YEGI2R.cjs.map → chunk-H7JCHFM6.cjs.map} +1 -1
- package/dist/{chunk-VROHHJL4.js → chunk-JBULXTCC.js} +77 -14
- package/dist/chunk-JBULXTCC.js.map +1 -0
- package/dist/{chunk-6PY4WYXI.cjs → chunk-KNS5MTTI.cjs} +3869 -2935
- package/dist/chunk-KNS5MTTI.cjs.map +1 -0
- package/dist/{chunk-COLJARV4.cjs → chunk-MZNLCMUP.cjs} +1686 -1169
- package/dist/chunk-MZNLCMUP.cjs.map +1 -0
- package/dist/{chunk-F4C67JYB.cjs → chunk-PRFL62ID.cjs} +22 -15
- package/dist/chunk-PRFL62ID.cjs.map +1 -0
- package/dist/{chunk-S3BFUTC5.js → chunk-Y54MUBT7.js} +3512 -2593
- package/dist/chunk-Y54MUBT7.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +12 -8
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-CVrkEepn.d.cts → delegate-DNEuM_nK.d.cts} +1 -1
- package/dist/{delegate-YDYq1El_.d.ts → delegate-DidNTsKm.d.ts} +1 -1
- package/dist/{index-BmqkJBAf.d.cts → index-BP8-zniX.d.cts} +182 -26
- package/dist/{index-CuSHBkq7.d.ts → index-DzQbNQUG.d.ts} +182 -26
- package/dist/index.cjs +323 -223
- package/dist/index.d.cts +311 -51
- package/dist/index.d.ts +311 -51
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +43 -23
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +21 -9
- package/dist/repositories/realm/index.d.ts +21 -9
- package/dist/repositories/realm/index.js +29 -9
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +48 -23
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +9 -3
- package/dist/repositories/sqlite/index.d.ts +9 -3
- package/dist/repositories/sqlite/index.js +35 -10
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-CFN61bBM.d.ts → taskRunner-9gnlYEpb.d.ts} +1 -1
- package/dist/{taskRunner-CFkGkD85.d.cts → taskRunner-BEQNFEa4.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +17 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +5 -4
- package/dist/wallet/expo/index.d.ts +5 -4
- package/dist/wallet/expo/index.js +8 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-hQp2qC_M.d.cts → wallet-C_MYHyOj.d.ts} +176 -17
- package/dist/{wallet-DnK09TtT.d.ts → wallet-ipUA1XCp.d.cts} +176 -17
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +5 -5
- package/dist/worker/expo/index.d.ts +5 -5
- package/dist/worker/expo/index.js +5 -5
- package/package.json +9 -2
- package/dist/chunk-6PY4WYXI.cjs.map +0 -1
- package/dist/chunk-COLJARV4.cjs.map +0 -1
- package/dist/chunk-D6RGHPZ5.cjs.map +0 -1
- package/dist/chunk-F4C67JYB.cjs.map +0 -1
- package/dist/chunk-IPPASJE5.js.map +0 -1
- package/dist/chunk-S3BFUTC5.js.map +0 -1
- package/dist/chunk-SGWMB4W2.js.map +0 -1
- package/dist/chunk-SYZEQF5D.cjs.map +0 -1
- package/dist/chunk-TV2RLVOB.js.map +0 -1
- package/dist/chunk-VROHHJL4.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Identity, p as RelativeTimelock, J as Network, K as CSVMultisigTapscript, L as
|
|
1
|
+
import { a as Identity, p as RelativeTimelock, J as Network, K as CSVMultisigTapscript, L as BatchStartedEvent, M as TreeSigningStartedEvent, P as TxTree, Q as TreeNoncesEvent, U as BatchFinalizationEvent, X as BatchFinalizedEvent, Y as BatchFailedEvent, Z as TreeTxEvent, _ as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, $ as DescriptorProvider, f as IContractManager, a0 as IReadonlyWallet, a1 as ReadonlyIdentity, a2 as OnchainProvider, o as IndexerProvider, a3 as DelegateProvider, a4 as ReadonlyWalletConfig, x as IntentRepository, B as VirtualTxRepository, a5 as ExitCaptureMode, a6 as ExitDataSource, d as ActivityRegistry, a7 as IReadonlyAssetManager, a8 as ContractSyncState, a9 as RecipientAddressContext, n as ArkProvider, aa as NetworkName, ab as ArkInfo, ac as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, ad as ContractWithVtxos, ae as selectPendingRecoveryOutpoints, A as ArkTransaction, e as Activity, E as ExtendedCoin, af as Coin, t as ExtendedVirtualCoin, ag as ContractManager, ah as ContractManagerConfig, I as IWallet, ai as SettlementConfig, j as IAssetManager, aj as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, ak as SignerSession, al as SignedIntent, am as Intent, an as TimeHeight } from './ark-D2_yNhfz.js';
|
|
2
2
|
import { Transaction } from '@scure/btc-signer';
|
|
3
3
|
import { TransactionOutput } from '@scure/btc-signer/psbt.js';
|
|
4
4
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
5
|
-
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
+
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DidNTsKm.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Capability a wallet exposes so descriptor-blind consumers — Boltz swaps and
|
|
@@ -24,8 +24,14 @@ interface HDWalletCapable {
|
|
|
24
24
|
* Every descriptor the wallet may hold keys under, ascending by index:
|
|
25
25
|
* the allocation watermark's band plus any descriptor persisted on a
|
|
26
26
|
* contract. Empty for static wallets.
|
|
27
|
+
*
|
|
28
|
+
* `lookAhead` appends that many descriptors past the watermark without
|
|
29
|
+
* advancing it, for a restore that must probe indices no local state
|
|
30
|
+
* mentions yet.
|
|
27
31
|
*/
|
|
28
|
-
getUsedSigningDescriptors(
|
|
32
|
+
getUsedSigningDescriptors(opts?: {
|
|
33
|
+
lookAhead?: number;
|
|
34
|
+
}): Promise<string[]>;
|
|
29
35
|
/**
|
|
30
36
|
* An {@link Identity} whose keys and signatures are those of `descriptor`.
|
|
31
37
|
* Returns the wallet identity itself when the wallet has no descriptor
|
|
@@ -35,6 +41,39 @@ interface HDWalletCapable {
|
|
|
35
41
|
}
|
|
36
42
|
/** Structural type guard for {@link HDWalletCapable}. */
|
|
37
43
|
declare function isHDWalletCapable(value: unknown): value is HDWalletCapable;
|
|
44
|
+
/**
|
|
45
|
+
* Allocating a *fresh* index, which is strictly more than
|
|
46
|
+
* {@link HDWalletCapable}'s descriptor awareness.
|
|
47
|
+
*
|
|
48
|
+
* Deliberately a separate probe rather than three more methods on
|
|
49
|
+
* `HDWalletCapable`: widening that guard would silently demote every wallet
|
|
50
|
+
* implementing only its original surface — including one built by an older
|
|
51
|
+
* SDK — from HD-capable to static, which is exactly the breakage it documents
|
|
52
|
+
* itself as avoiding. Consumers that only read descriptors keep the narrow
|
|
53
|
+
* probe; anything deriving per-artifact secrets asks for this one.
|
|
54
|
+
*/
|
|
55
|
+
interface HDAllocationCapable {
|
|
56
|
+
/**
|
|
57
|
+
* Allocate the next descriptor, advancing the watermark. `undefined` for
|
|
58
|
+
* static / `auto` wallets, which cannot allocate.
|
|
59
|
+
*
|
|
60
|
+
* Distinct from {@link HDWalletCapable.getCurrentSigningDescriptor}, which
|
|
61
|
+
* peeks: two artifacts bound to a peek share a key.
|
|
62
|
+
*/
|
|
63
|
+
getNextSigningDescriptor(): Promise<string | undefined>;
|
|
64
|
+
/**
|
|
65
|
+
* Move the allocation watermark to `descriptor`'s index so later
|
|
66
|
+
* allocations cannot reissue it. Monotonic — a lower index is a no-op.
|
|
67
|
+
*
|
|
68
|
+
* Throws on a descriptor this wallet cannot derive, or one with no
|
|
69
|
+
* parseable trailing child index: silently mapping those to index 0 would
|
|
70
|
+
* move the watermark nowhere and let a restored artifact's index be handed
|
|
71
|
+
* out again.
|
|
72
|
+
*/
|
|
73
|
+
advanceSigningDescriptorWatermark(descriptor: string): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/** Structural type guard for {@link HDAllocationCapable}. */
|
|
76
|
+
declare function isHDAllocationCapable(value: unknown): value is HDAllocationCapable;
|
|
38
77
|
|
|
39
78
|
/** Wall-clock floor for `batchExpiry` outside regtest. */
|
|
40
79
|
declare const DEFAULT_MIN_BATCH_EXPIRY_SECONDS = 86400n;
|
|
@@ -86,6 +125,27 @@ declare const DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 86400n;
|
|
|
86
125
|
* 1-block attack.
|
|
87
126
|
*/
|
|
88
127
|
declare const REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 1200n;
|
|
128
|
+
/**
|
|
129
|
+
* Wall-clock floor for the checkpoint exit delay on mutinynet.
|
|
130
|
+
*
|
|
131
|
+
* The hosted mutinynet Arkade Service advertises exactly this: its
|
|
132
|
+
* `checkpointTapscript` decodes to a 4096s (8 * 512) CSV, sized for a chain
|
|
133
|
+
* that mines ~30s blocks. {@link DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS}
|
|
134
|
+
* rejects it, which left mutinynet unusable until the caller went and found
|
|
135
|
+
* `minCheckpointExitDelaySeconds` and then this number.
|
|
136
|
+
*/
|
|
137
|
+
declare const MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 4096n;
|
|
138
|
+
/**
|
|
139
|
+
* Wall-clock floor for the checkpoint exit delay on signet.
|
|
140
|
+
*
|
|
141
|
+
* The hosted signet Arkade Service advertises 86016s (168 * 512): a 24h
|
|
142
|
+
* setting rounded down to BIP-68's 512s granularity, since 86400 is not a
|
|
143
|
+
* multiple of 512 and so cannot be encoded in a seconds-typed timelock at all.
|
|
144
|
+
* That lands 384s under {@link DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS} and
|
|
145
|
+
* is rejected by it, so signet needs its own floor for the same reason
|
|
146
|
+
* mutinynet does.
|
|
147
|
+
*/
|
|
148
|
+
declare const SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 86016n;
|
|
89
149
|
/** Bounds applied to a server-supplied `ArkInfo.checkpointTapscript`. */
|
|
90
150
|
type CheckpointExitDelayPolicy = {
|
|
91
151
|
/** Minimum wall-clock delay in seconds, after normalization. */
|
|
@@ -131,17 +191,6 @@ declare function resolveCheckpointExitDelayPolicy(network: Network, overrides?:
|
|
|
131
191
|
*/
|
|
132
192
|
declare function assertValidServerUnrollScript(checkpointTapscript: string, policy: CheckpointExitDelayPolicy): CSVMultisigTapscript.Type;
|
|
133
193
|
|
|
134
|
-
declare function getRandomId(): string;
|
|
135
|
-
/**
|
|
136
|
-
* What a recipient Arkade address must match. An address failing either check
|
|
137
|
-
* belongs to another network or operator, so this wallet's operator cannot
|
|
138
|
-
* create the VTXO where the recipient's wallet expects it.
|
|
139
|
-
*/
|
|
140
|
-
type RecipientAddressContext = {
|
|
141
|
-
hrp: string;
|
|
142
|
-
signerSet: SignerSet;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
194
|
declare class ArkError extends Error {
|
|
146
195
|
readonly code: number;
|
|
147
196
|
readonly message: string;
|
|
@@ -422,6 +471,21 @@ interface ReceiveRotatorBootResult {
|
|
|
422
471
|
interface ReceiveRotatorFactory {
|
|
423
472
|
createReceiveRotator(opts: ReceiveRotatorBootOpts): Promise<ReceiveRotatorBoot | undefined>;
|
|
424
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* Parse the trailing HD child index from a materialized signing
|
|
476
|
+
* descriptor (`tr(...xpub.../0/<index>)`). Returns 0 when the
|
|
477
|
+
* descriptor is absent or carries no parseable child index — restore
|
|
478
|
+
* registers the index-0 baseline untagged, so a missing descriptor
|
|
479
|
+
* legitimately maps to 0.
|
|
480
|
+
*/
|
|
481
|
+
declare function signingDescriptorIndex(descriptor: unknown): number;
|
|
482
|
+
/**
|
|
483
|
+
* Strict sibling of {@link signingDescriptorIndex}: `undefined` instead of
|
|
484
|
+
* the 0 fallback, for callers that must tell "no parseable index" apart from
|
|
485
|
+
* index 0 — a watermark move mapped to 0 would move nothing while reporting
|
|
486
|
+
* success.
|
|
487
|
+
*/
|
|
488
|
+
declare function strictSigningDescriptorIndex(descriptor: string): number | undefined;
|
|
425
489
|
/**
|
|
426
490
|
* Minimal logging surface the rotator needs. `console` satisfies it
|
|
427
491
|
* out of the box; SDK consumers can pass a structured logger
|
|
@@ -617,6 +681,12 @@ declare class WalletReceiveRotator {
|
|
|
617
681
|
private rotate;
|
|
618
682
|
}
|
|
619
683
|
|
|
684
|
+
/**
|
|
685
|
+
* Maximum caller-requested HD descriptors materialized past the watermark by
|
|
686
|
+
* getUsedSigningDescriptors(). Bounds plugin/restore probes without changing
|
|
687
|
+
* the wallet's actual allocation watermark.
|
|
688
|
+
*/
|
|
689
|
+
declare const MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD = 1000;
|
|
620
690
|
type IncomingFunds = {
|
|
621
691
|
type: "utxo";
|
|
622
692
|
coins: Coin[];
|
|
@@ -626,6 +696,13 @@ type IncomingFunds = {
|
|
|
626
696
|
spentVtxos: ExtendedVirtualCoin[];
|
|
627
697
|
};
|
|
628
698
|
|
|
699
|
+
/**
|
|
700
|
+
* What signer classification needs of a snapshot: contract params and the coins
|
|
701
|
+
* under them. Structural rather than {@link ContractWithVtxos} so a repository-
|
|
702
|
+
* built snapshot — the worker's, whose VTXOs carry no `contractScript` — can be
|
|
703
|
+
* classified without allocating a parallel array to satisfy the nominal type.
|
|
704
|
+
*/
|
|
705
|
+
type PendingRecoverySnapshot = Parameters<typeof selectPendingRecoveryOutpoints>[0];
|
|
629
706
|
/**
|
|
630
707
|
* Boarding UTXOs grouped by the boarding address they sit on, carrying that
|
|
631
708
|
* address's signer association explicitly. Returned by
|
|
@@ -955,18 +1032,80 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
955
1032
|
/**
|
|
956
1033
|
* Return virtual outputs tracked by the wallet.
|
|
957
1034
|
*
|
|
1035
|
+
* The raw reporting/recovery read: escrowed, locked and awaiting-recovery
|
|
1036
|
+
* funds are all present. Coin selection must use
|
|
1037
|
+
* {@link getSpendableVtxos} instead — feeding this straight into
|
|
1038
|
+
* `settle({ inputs })` or `sendBitcoin({ selectedVtxos })` bypasses the
|
|
1039
|
+
* generic-spending gate.
|
|
1040
|
+
*
|
|
958
1041
|
* @param filter - Optional flags controlling whether recoverable or unrolled VTXOs are included
|
|
959
1042
|
*/
|
|
960
1043
|
getVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
|
|
1044
|
+
/** @inheritdoc */
|
|
1045
|
+
getSpendableVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Debug-log any explicit input generic selection would have excluded, for
|
|
1048
|
+
* each of the three reasons it excludes on. Explicit-input APIs stay ungated
|
|
1049
|
+
* on purpose (naming an outpoint *is* the intent the gate protects, and it
|
|
1050
|
+
* is how an escrowed deposit is recovered once generic selection stops
|
|
1051
|
+
* covering it), so this only makes the crossing visible — notably
|
|
1052
|
+
* `settle({ inputs: await wallet.getVtxos() })`, which launders the raw read
|
|
1053
|
+
* into a spend. Never throws into a spend path.
|
|
1054
|
+
*
|
|
1055
|
+
* Public so the worker handler and plugins can report their own
|
|
1056
|
+
* explicit-input crossings through the same three checks.
|
|
1057
|
+
*/
|
|
1058
|
+
logUngatedInputs(source: string, inputs: readonly {
|
|
1059
|
+
txid: string;
|
|
1060
|
+
vout: number;
|
|
1061
|
+
script?: string;
|
|
1062
|
+
}[]): Promise<void>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Contracts whose operator signer is past its rotation cutoff, as an
|
|
1065
|
+
* exclusion over scripts. The outpoint-level `pendingRecovery` set needs a
|
|
1066
|
+
* synced VTXO snapshot to also drop already-swept coins; this answers the
|
|
1067
|
+
* same question about a caller-supplied input without one, and a swept
|
|
1068
|
+
* outpoint is unspendable regardless.
|
|
1069
|
+
*/
|
|
1070
|
+
private expiredSignerExclusion;
|
|
1071
|
+
/** The intent store's lock set. Fails open, like every other read of it. */
|
|
1072
|
+
private lockedOutpoints;
|
|
1073
|
+
/**
|
|
1074
|
+
* One contract+VTXO read. `getContractsWithVtxos` opportunistically syncs
|
|
1075
|
+
* against the indexer, so every caller that needs more than one view of the
|
|
1076
|
+
* wallet's coins takes a single snapshot and derives them all from it —
|
|
1077
|
+
* otherwise the gate and the pending-recovery set answer about two different
|
|
1078
|
+
* points in time, and each read costs another sync.
|
|
1079
|
+
*/
|
|
1080
|
+
protected contractSnapshot(): Promise<ContractWithVtxos[]>;
|
|
1081
|
+
/**
|
|
1082
|
+
* The two exclusion sets the gate is made of, derived from one snapshot so
|
|
1083
|
+
* {@link getSpendableVtxos} and the balance answer about the same instant.
|
|
1084
|
+
*/
|
|
1085
|
+
private spendabilityView;
|
|
1086
|
+
/** The capability probes {@link computeOffchainBalance} needs, over one snapshot. */
|
|
1087
|
+
private balanceCapabilities;
|
|
961
1088
|
/**
|
|
962
1089
|
* Outpoints of VTXOs whose deprecated signer is past its cutoff (EXPIRED) and
|
|
963
1090
|
* which have not yet been swept — unspendable until they recover. Offline:
|
|
964
1091
|
* classifies the repo's contracts against the cached signer set (active +
|
|
965
1092
|
* {@link _deprecatedSigners}, cutoffs included). Empty fast-path when no
|
|
966
1093
|
* signer is deprecated. Consumed by {@link getBalance} (the `pendingRecovery`
|
|
967
|
-
* bucket) and
|
|
1094
|
+
* bucket) and by {@link getSpendableVtxos} so neither counts nor spends them.
|
|
1095
|
+
*
|
|
1096
|
+
* Takes a fresh {@link contractSnapshot}, which syncs against the indexer.
|
|
1097
|
+
* Callers that already hold a snapshot — or that must not sync at all, like
|
|
1098
|
+
* the worker's balance read — pass it to
|
|
1099
|
+
* {@link pendingRecoveryOutpointsIn} instead.
|
|
968
1100
|
*/
|
|
969
1101
|
pendingRecoveryOutpoints(): Promise<Set<string>>;
|
|
1102
|
+
/**
|
|
1103
|
+
* {@link pendingRecoveryOutpoints} over a snapshot the caller already has:
|
|
1104
|
+
* pure classification against the cached signer set, no repository or
|
|
1105
|
+
* network read of its own.
|
|
1106
|
+
*/
|
|
1107
|
+
pendingRecoveryOutpointsIn(snapshot: PendingRecoverySnapshot): Set<string>;
|
|
1108
|
+
private selectPendingRecovery;
|
|
970
1109
|
/**
|
|
971
1110
|
* Return wallet transaction history derived from Arkade state and boarding transactions.
|
|
972
1111
|
*/
|
|
@@ -1309,6 +1448,14 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1309
1448
|
* @see HDWalletCapable.getCurrentSigningDescriptor
|
|
1310
1449
|
*/
|
|
1311
1450
|
getCurrentSigningDescriptor(): Promise<string | undefined>;
|
|
1451
|
+
/**
|
|
1452
|
+
* @see HDWalletCapable.getNextSigningDescriptor
|
|
1453
|
+
*/
|
|
1454
|
+
getNextSigningDescriptor(): Promise<string | undefined>;
|
|
1455
|
+
/**
|
|
1456
|
+
* @see HDWalletCapable.advanceSigningDescriptorWatermark
|
|
1457
|
+
*/
|
|
1458
|
+
advanceSigningDescriptorWatermark(descriptor: string): Promise<void>;
|
|
1312
1459
|
/**
|
|
1313
1460
|
* @see HDWalletCapable.getUsedSigningDescriptors
|
|
1314
1461
|
*
|
|
@@ -1317,7 +1464,9 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1317
1464
|
* alone would miss indices allocated for something the wallet never
|
|
1318
1465
|
* persisted (a swap, an externally issued invoice).
|
|
1319
1466
|
*/
|
|
1320
|
-
getUsedSigningDescriptors(
|
|
1467
|
+
getUsedSigningDescriptors(opts?: {
|
|
1468
|
+
lookAhead?: number;
|
|
1469
|
+
}): Promise<string[]>;
|
|
1321
1470
|
/**
|
|
1322
1471
|
* @see HDWalletCapable.signerForDescriptor
|
|
1323
1472
|
*/
|
|
@@ -1458,6 +1607,13 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1458
1607
|
/**
|
|
1459
1608
|
* Settle boarding inputs and/or virtual outputs into a finalized mainnet transaction.
|
|
1460
1609
|
*
|
|
1610
|
+
* `params.inputs` is **ungated**: whatever the caller names is settled,
|
|
1611
|
+
* including VTXOs generic selection would skip. That is what makes an
|
|
1612
|
+
* escrowed or otherwise gated deposit recoverable by hand — but it also
|
|
1613
|
+
* means `settle({ inputs: await wallet.getVtxos() })` silently bypasses the
|
|
1614
|
+
* gate. Pass {@link getSpendableVtxos} instead when the intent is "settle
|
|
1615
|
+
* whatever is spendable".
|
|
1616
|
+
*
|
|
1461
1617
|
* @param params - Optional settlement inputs and outputs. When omitted, the wallet settles all eligible funds.
|
|
1462
1618
|
* @param eventCallback - Optional callback invoked for settlement stream events.
|
|
1463
1619
|
* @returns The finalized Arkade transaction id
|
|
@@ -1660,6 +1816,9 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1660
1816
|
/**
|
|
1661
1817
|
* Build an offchain transaction from the given inputs and outputs,
|
|
1662
1818
|
* sign it, submit to the Arkade provider, and finalize.
|
|
1819
|
+
*
|
|
1820
|
+
* Signs whatever it is handed, ungated — see {@link settle} for the trade.
|
|
1821
|
+
*
|
|
1663
1822
|
* @returns The Arkade transaction id and server-signed checkpoint PSBTs (for bookkeeping)
|
|
1664
1823
|
*/
|
|
1665
1824
|
buildAndSubmitOffchainTx(inputs: ExtendedVirtualCoin[], outputs: TransactionOutput[], serverUnrollScript?: CSVMultisigTapscript.Type): Promise<{
|
|
@@ -1686,4 +1845,4 @@ declare function selectVirtualCoins(coins: ExtendedVirtualCoin[], targetAmount:
|
|
|
1686
1845
|
*/
|
|
1687
1846
|
declare function waitForIncomingFunds(wallet: Wallet): Promise<IncomingFunds>;
|
|
1688
1847
|
|
|
1689
|
-
export { ArkError as A, type BatchExpiryPolicy as B, type CheckpointExitDelayPolicy as C, DEFAULT_MIN_BATCH_EXPIRY_SECONDS as D,
|
|
1848
|
+
export { ArkError as A, type BatchExpiryPolicy as B, type CheckpointExitDelayPolicy as C, DEFAULT_MIN_BATCH_EXPIRY_SECONDS as D, maybeArkError as E, resolveBatchExpiryPolicy as F, resolveCheckpointExitDelayPolicy as G, type HDWalletCapable as H, type IncomingFunds as I, selectVirtualCoins as J, signingDescriptorIndex as K, strictSigningDescriptorIndex as L, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD as M, waitForIncomingFunds as N, type ProviderConnectionState as P, ReadonlyWallet as R, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, type HDAllocationCapable as d, Batch as e, ArkErrorName as f, type ArkadeCashClaimResult as g, ArkadeCashCreateError as h, type ArkadeCashUnclaimedReason as i, type ArkadeCashUnclaimedVtxo as j, type BoardingUtxoGroup as k, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as l, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as m, type ProviderKind as n, ProviderUnavailableError as o, REGTEST_MIN_BATCH_EXPIRY_SECONDS as p, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as q, type ServerInfoSource as r, ServerResponseMismatchError as s, assertValidBatchExpiry as t, assertValidServerUnrollScript as u, defaultBatchExpiryPolicy as v, defaultCheckpointExitDelayPolicy as w, isArkError as x, isHDAllocationCapable as y, isHDWalletCapable as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Identity, p as RelativeTimelock, J as Network, K as CSVMultisigTapscript, L as
|
|
1
|
+
import { a as Identity, p as RelativeTimelock, J as Network, K as CSVMultisigTapscript, L as BatchStartedEvent, M as TreeSigningStartedEvent, P as TxTree, Q as TreeNoncesEvent, U as BatchFinalizationEvent, X as BatchFinalizedEvent, Y as BatchFailedEvent, Z as TreeTxEvent, _ as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, $ as DescriptorProvider, f as IContractManager, a0 as IReadonlyWallet, a1 as ReadonlyIdentity, a2 as OnchainProvider, o as IndexerProvider, a3 as DelegateProvider, a4 as ReadonlyWalletConfig, x as IntentRepository, B as VirtualTxRepository, a5 as ExitCaptureMode, a6 as ExitDataSource, d as ActivityRegistry, a7 as IReadonlyAssetManager, a8 as ContractSyncState, a9 as RecipientAddressContext, n as ArkProvider, aa as NetworkName, ab as ArkInfo, ac as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, ad as ContractWithVtxos, ae as selectPendingRecoveryOutpoints, A as ArkTransaction, e as Activity, E as ExtendedCoin, af as Coin, t as ExtendedVirtualCoin, ag as ContractManager, ah as ContractManagerConfig, I as IWallet, ai as SettlementConfig, j as IAssetManager, aj as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, ak as SignerSession, al as SignedIntent, am as Intent, an as TimeHeight } from './ark-D2_yNhfz.cjs';
|
|
2
2
|
import { Transaction } from '@scure/btc-signer';
|
|
3
3
|
import { TransactionOutput } from '@scure/btc-signer/psbt.js';
|
|
4
4
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
5
|
-
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
+
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DNEuM_nK.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Capability a wallet exposes so descriptor-blind consumers — Boltz swaps and
|
|
@@ -24,8 +24,14 @@ interface HDWalletCapable {
|
|
|
24
24
|
* Every descriptor the wallet may hold keys under, ascending by index:
|
|
25
25
|
* the allocation watermark's band plus any descriptor persisted on a
|
|
26
26
|
* contract. Empty for static wallets.
|
|
27
|
+
*
|
|
28
|
+
* `lookAhead` appends that many descriptors past the watermark without
|
|
29
|
+
* advancing it, for a restore that must probe indices no local state
|
|
30
|
+
* mentions yet.
|
|
27
31
|
*/
|
|
28
|
-
getUsedSigningDescriptors(
|
|
32
|
+
getUsedSigningDescriptors(opts?: {
|
|
33
|
+
lookAhead?: number;
|
|
34
|
+
}): Promise<string[]>;
|
|
29
35
|
/**
|
|
30
36
|
* An {@link Identity} whose keys and signatures are those of `descriptor`.
|
|
31
37
|
* Returns the wallet identity itself when the wallet has no descriptor
|
|
@@ -35,6 +41,39 @@ interface HDWalletCapable {
|
|
|
35
41
|
}
|
|
36
42
|
/** Structural type guard for {@link HDWalletCapable}. */
|
|
37
43
|
declare function isHDWalletCapable(value: unknown): value is HDWalletCapable;
|
|
44
|
+
/**
|
|
45
|
+
* Allocating a *fresh* index, which is strictly more than
|
|
46
|
+
* {@link HDWalletCapable}'s descriptor awareness.
|
|
47
|
+
*
|
|
48
|
+
* Deliberately a separate probe rather than three more methods on
|
|
49
|
+
* `HDWalletCapable`: widening that guard would silently demote every wallet
|
|
50
|
+
* implementing only its original surface — including one built by an older
|
|
51
|
+
* SDK — from HD-capable to static, which is exactly the breakage it documents
|
|
52
|
+
* itself as avoiding. Consumers that only read descriptors keep the narrow
|
|
53
|
+
* probe; anything deriving per-artifact secrets asks for this one.
|
|
54
|
+
*/
|
|
55
|
+
interface HDAllocationCapable {
|
|
56
|
+
/**
|
|
57
|
+
* Allocate the next descriptor, advancing the watermark. `undefined` for
|
|
58
|
+
* static / `auto` wallets, which cannot allocate.
|
|
59
|
+
*
|
|
60
|
+
* Distinct from {@link HDWalletCapable.getCurrentSigningDescriptor}, which
|
|
61
|
+
* peeks: two artifacts bound to a peek share a key.
|
|
62
|
+
*/
|
|
63
|
+
getNextSigningDescriptor(): Promise<string | undefined>;
|
|
64
|
+
/**
|
|
65
|
+
* Move the allocation watermark to `descriptor`'s index so later
|
|
66
|
+
* allocations cannot reissue it. Monotonic — a lower index is a no-op.
|
|
67
|
+
*
|
|
68
|
+
* Throws on a descriptor this wallet cannot derive, or one with no
|
|
69
|
+
* parseable trailing child index: silently mapping those to index 0 would
|
|
70
|
+
* move the watermark nowhere and let a restored artifact's index be handed
|
|
71
|
+
* out again.
|
|
72
|
+
*/
|
|
73
|
+
advanceSigningDescriptorWatermark(descriptor: string): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/** Structural type guard for {@link HDAllocationCapable}. */
|
|
76
|
+
declare function isHDAllocationCapable(value: unknown): value is HDAllocationCapable;
|
|
38
77
|
|
|
39
78
|
/** Wall-clock floor for `batchExpiry` outside regtest. */
|
|
40
79
|
declare const DEFAULT_MIN_BATCH_EXPIRY_SECONDS = 86400n;
|
|
@@ -86,6 +125,27 @@ declare const DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 86400n;
|
|
|
86
125
|
* 1-block attack.
|
|
87
126
|
*/
|
|
88
127
|
declare const REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 1200n;
|
|
128
|
+
/**
|
|
129
|
+
* Wall-clock floor for the checkpoint exit delay on mutinynet.
|
|
130
|
+
*
|
|
131
|
+
* The hosted mutinynet Arkade Service advertises exactly this: its
|
|
132
|
+
* `checkpointTapscript` decodes to a 4096s (8 * 512) CSV, sized for a chain
|
|
133
|
+
* that mines ~30s blocks. {@link DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS}
|
|
134
|
+
* rejects it, which left mutinynet unusable until the caller went and found
|
|
135
|
+
* `minCheckpointExitDelaySeconds` and then this number.
|
|
136
|
+
*/
|
|
137
|
+
declare const MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 4096n;
|
|
138
|
+
/**
|
|
139
|
+
* Wall-clock floor for the checkpoint exit delay on signet.
|
|
140
|
+
*
|
|
141
|
+
* The hosted signet Arkade Service advertises 86016s (168 * 512): a 24h
|
|
142
|
+
* setting rounded down to BIP-68's 512s granularity, since 86400 is not a
|
|
143
|
+
* multiple of 512 and so cannot be encoded in a seconds-typed timelock at all.
|
|
144
|
+
* That lands 384s under {@link DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS} and
|
|
145
|
+
* is rejected by it, so signet needs its own floor for the same reason
|
|
146
|
+
* mutinynet does.
|
|
147
|
+
*/
|
|
148
|
+
declare const SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 86016n;
|
|
89
149
|
/** Bounds applied to a server-supplied `ArkInfo.checkpointTapscript`. */
|
|
90
150
|
type CheckpointExitDelayPolicy = {
|
|
91
151
|
/** Minimum wall-clock delay in seconds, after normalization. */
|
|
@@ -131,17 +191,6 @@ declare function resolveCheckpointExitDelayPolicy(network: Network, overrides?:
|
|
|
131
191
|
*/
|
|
132
192
|
declare function assertValidServerUnrollScript(checkpointTapscript: string, policy: CheckpointExitDelayPolicy): CSVMultisigTapscript.Type;
|
|
133
193
|
|
|
134
|
-
declare function getRandomId(): string;
|
|
135
|
-
/**
|
|
136
|
-
* What a recipient Arkade address must match. An address failing either check
|
|
137
|
-
* belongs to another network or operator, so this wallet's operator cannot
|
|
138
|
-
* create the VTXO where the recipient's wallet expects it.
|
|
139
|
-
*/
|
|
140
|
-
type RecipientAddressContext = {
|
|
141
|
-
hrp: string;
|
|
142
|
-
signerSet: SignerSet;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
194
|
declare class ArkError extends Error {
|
|
146
195
|
readonly code: number;
|
|
147
196
|
readonly message: string;
|
|
@@ -422,6 +471,21 @@ interface ReceiveRotatorBootResult {
|
|
|
422
471
|
interface ReceiveRotatorFactory {
|
|
423
472
|
createReceiveRotator(opts: ReceiveRotatorBootOpts): Promise<ReceiveRotatorBoot | undefined>;
|
|
424
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* Parse the trailing HD child index from a materialized signing
|
|
476
|
+
* descriptor (`tr(...xpub.../0/<index>)`). Returns 0 when the
|
|
477
|
+
* descriptor is absent or carries no parseable child index — restore
|
|
478
|
+
* registers the index-0 baseline untagged, so a missing descriptor
|
|
479
|
+
* legitimately maps to 0.
|
|
480
|
+
*/
|
|
481
|
+
declare function signingDescriptorIndex(descriptor: unknown): number;
|
|
482
|
+
/**
|
|
483
|
+
* Strict sibling of {@link signingDescriptorIndex}: `undefined` instead of
|
|
484
|
+
* the 0 fallback, for callers that must tell "no parseable index" apart from
|
|
485
|
+
* index 0 — a watermark move mapped to 0 would move nothing while reporting
|
|
486
|
+
* success.
|
|
487
|
+
*/
|
|
488
|
+
declare function strictSigningDescriptorIndex(descriptor: string): number | undefined;
|
|
425
489
|
/**
|
|
426
490
|
* Minimal logging surface the rotator needs. `console` satisfies it
|
|
427
491
|
* out of the box; SDK consumers can pass a structured logger
|
|
@@ -617,6 +681,12 @@ declare class WalletReceiveRotator {
|
|
|
617
681
|
private rotate;
|
|
618
682
|
}
|
|
619
683
|
|
|
684
|
+
/**
|
|
685
|
+
* Maximum caller-requested HD descriptors materialized past the watermark by
|
|
686
|
+
* getUsedSigningDescriptors(). Bounds plugin/restore probes without changing
|
|
687
|
+
* the wallet's actual allocation watermark.
|
|
688
|
+
*/
|
|
689
|
+
declare const MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD = 1000;
|
|
620
690
|
type IncomingFunds = {
|
|
621
691
|
type: "utxo";
|
|
622
692
|
coins: Coin[];
|
|
@@ -626,6 +696,13 @@ type IncomingFunds = {
|
|
|
626
696
|
spentVtxos: ExtendedVirtualCoin[];
|
|
627
697
|
};
|
|
628
698
|
|
|
699
|
+
/**
|
|
700
|
+
* What signer classification needs of a snapshot: contract params and the coins
|
|
701
|
+
* under them. Structural rather than {@link ContractWithVtxos} so a repository-
|
|
702
|
+
* built snapshot — the worker's, whose VTXOs carry no `contractScript` — can be
|
|
703
|
+
* classified without allocating a parallel array to satisfy the nominal type.
|
|
704
|
+
*/
|
|
705
|
+
type PendingRecoverySnapshot = Parameters<typeof selectPendingRecoveryOutpoints>[0];
|
|
629
706
|
/**
|
|
630
707
|
* Boarding UTXOs grouped by the boarding address they sit on, carrying that
|
|
631
708
|
* address's signer association explicitly. Returned by
|
|
@@ -955,18 +1032,80 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
955
1032
|
/**
|
|
956
1033
|
* Return virtual outputs tracked by the wallet.
|
|
957
1034
|
*
|
|
1035
|
+
* The raw reporting/recovery read: escrowed, locked and awaiting-recovery
|
|
1036
|
+
* funds are all present. Coin selection must use
|
|
1037
|
+
* {@link getSpendableVtxos} instead — feeding this straight into
|
|
1038
|
+
* `settle({ inputs })` or `sendBitcoin({ selectedVtxos })` bypasses the
|
|
1039
|
+
* generic-spending gate.
|
|
1040
|
+
*
|
|
958
1041
|
* @param filter - Optional flags controlling whether recoverable or unrolled VTXOs are included
|
|
959
1042
|
*/
|
|
960
1043
|
getVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
|
|
1044
|
+
/** @inheritdoc */
|
|
1045
|
+
getSpendableVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Debug-log any explicit input generic selection would have excluded, for
|
|
1048
|
+
* each of the three reasons it excludes on. Explicit-input APIs stay ungated
|
|
1049
|
+
* on purpose (naming an outpoint *is* the intent the gate protects, and it
|
|
1050
|
+
* is how an escrowed deposit is recovered once generic selection stops
|
|
1051
|
+
* covering it), so this only makes the crossing visible — notably
|
|
1052
|
+
* `settle({ inputs: await wallet.getVtxos() })`, which launders the raw read
|
|
1053
|
+
* into a spend. Never throws into a spend path.
|
|
1054
|
+
*
|
|
1055
|
+
* Public so the worker handler and plugins can report their own
|
|
1056
|
+
* explicit-input crossings through the same three checks.
|
|
1057
|
+
*/
|
|
1058
|
+
logUngatedInputs(source: string, inputs: readonly {
|
|
1059
|
+
txid: string;
|
|
1060
|
+
vout: number;
|
|
1061
|
+
script?: string;
|
|
1062
|
+
}[]): Promise<void>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Contracts whose operator signer is past its rotation cutoff, as an
|
|
1065
|
+
* exclusion over scripts. The outpoint-level `pendingRecovery` set needs a
|
|
1066
|
+
* synced VTXO snapshot to also drop already-swept coins; this answers the
|
|
1067
|
+
* same question about a caller-supplied input without one, and a swept
|
|
1068
|
+
* outpoint is unspendable regardless.
|
|
1069
|
+
*/
|
|
1070
|
+
private expiredSignerExclusion;
|
|
1071
|
+
/** The intent store's lock set. Fails open, like every other read of it. */
|
|
1072
|
+
private lockedOutpoints;
|
|
1073
|
+
/**
|
|
1074
|
+
* One contract+VTXO read. `getContractsWithVtxos` opportunistically syncs
|
|
1075
|
+
* against the indexer, so every caller that needs more than one view of the
|
|
1076
|
+
* wallet's coins takes a single snapshot and derives them all from it —
|
|
1077
|
+
* otherwise the gate and the pending-recovery set answer about two different
|
|
1078
|
+
* points in time, and each read costs another sync.
|
|
1079
|
+
*/
|
|
1080
|
+
protected contractSnapshot(): Promise<ContractWithVtxos[]>;
|
|
1081
|
+
/**
|
|
1082
|
+
* The two exclusion sets the gate is made of, derived from one snapshot so
|
|
1083
|
+
* {@link getSpendableVtxos} and the balance answer about the same instant.
|
|
1084
|
+
*/
|
|
1085
|
+
private spendabilityView;
|
|
1086
|
+
/** The capability probes {@link computeOffchainBalance} needs, over one snapshot. */
|
|
1087
|
+
private balanceCapabilities;
|
|
961
1088
|
/**
|
|
962
1089
|
* Outpoints of VTXOs whose deprecated signer is past its cutoff (EXPIRED) and
|
|
963
1090
|
* which have not yet been swept — unspendable until they recover. Offline:
|
|
964
1091
|
* classifies the repo's contracts against the cached signer set (active +
|
|
965
1092
|
* {@link _deprecatedSigners}, cutoffs included). Empty fast-path when no
|
|
966
1093
|
* signer is deprecated. Consumed by {@link getBalance} (the `pendingRecovery`
|
|
967
|
-
* bucket) and
|
|
1094
|
+
* bucket) and by {@link getSpendableVtxos} so neither counts nor spends them.
|
|
1095
|
+
*
|
|
1096
|
+
* Takes a fresh {@link contractSnapshot}, which syncs against the indexer.
|
|
1097
|
+
* Callers that already hold a snapshot — or that must not sync at all, like
|
|
1098
|
+
* the worker's balance read — pass it to
|
|
1099
|
+
* {@link pendingRecoveryOutpointsIn} instead.
|
|
968
1100
|
*/
|
|
969
1101
|
pendingRecoveryOutpoints(): Promise<Set<string>>;
|
|
1102
|
+
/**
|
|
1103
|
+
* {@link pendingRecoveryOutpoints} over a snapshot the caller already has:
|
|
1104
|
+
* pure classification against the cached signer set, no repository or
|
|
1105
|
+
* network read of its own.
|
|
1106
|
+
*/
|
|
1107
|
+
pendingRecoveryOutpointsIn(snapshot: PendingRecoverySnapshot): Set<string>;
|
|
1108
|
+
private selectPendingRecovery;
|
|
970
1109
|
/**
|
|
971
1110
|
* Return wallet transaction history derived from Arkade state and boarding transactions.
|
|
972
1111
|
*/
|
|
@@ -1309,6 +1448,14 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1309
1448
|
* @see HDWalletCapable.getCurrentSigningDescriptor
|
|
1310
1449
|
*/
|
|
1311
1450
|
getCurrentSigningDescriptor(): Promise<string | undefined>;
|
|
1451
|
+
/**
|
|
1452
|
+
* @see HDWalletCapable.getNextSigningDescriptor
|
|
1453
|
+
*/
|
|
1454
|
+
getNextSigningDescriptor(): Promise<string | undefined>;
|
|
1455
|
+
/**
|
|
1456
|
+
* @see HDWalletCapable.advanceSigningDescriptorWatermark
|
|
1457
|
+
*/
|
|
1458
|
+
advanceSigningDescriptorWatermark(descriptor: string): Promise<void>;
|
|
1312
1459
|
/**
|
|
1313
1460
|
* @see HDWalletCapable.getUsedSigningDescriptors
|
|
1314
1461
|
*
|
|
@@ -1317,7 +1464,9 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1317
1464
|
* alone would miss indices allocated for something the wallet never
|
|
1318
1465
|
* persisted (a swap, an externally issued invoice).
|
|
1319
1466
|
*/
|
|
1320
|
-
getUsedSigningDescriptors(
|
|
1467
|
+
getUsedSigningDescriptors(opts?: {
|
|
1468
|
+
lookAhead?: number;
|
|
1469
|
+
}): Promise<string[]>;
|
|
1321
1470
|
/**
|
|
1322
1471
|
* @see HDWalletCapable.signerForDescriptor
|
|
1323
1472
|
*/
|
|
@@ -1458,6 +1607,13 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1458
1607
|
/**
|
|
1459
1608
|
* Settle boarding inputs and/or virtual outputs into a finalized mainnet transaction.
|
|
1460
1609
|
*
|
|
1610
|
+
* `params.inputs` is **ungated**: whatever the caller names is settled,
|
|
1611
|
+
* including VTXOs generic selection would skip. That is what makes an
|
|
1612
|
+
* escrowed or otherwise gated deposit recoverable by hand — but it also
|
|
1613
|
+
* means `settle({ inputs: await wallet.getVtxos() })` silently bypasses the
|
|
1614
|
+
* gate. Pass {@link getSpendableVtxos} instead when the intent is "settle
|
|
1615
|
+
* whatever is spendable".
|
|
1616
|
+
*
|
|
1461
1617
|
* @param params - Optional settlement inputs and outputs. When omitted, the wallet settles all eligible funds.
|
|
1462
1618
|
* @param eventCallback - Optional callback invoked for settlement stream events.
|
|
1463
1619
|
* @returns The finalized Arkade transaction id
|
|
@@ -1660,6 +1816,9 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
|
|
|
1660
1816
|
/**
|
|
1661
1817
|
* Build an offchain transaction from the given inputs and outputs,
|
|
1662
1818
|
* sign it, submit to the Arkade provider, and finalize.
|
|
1819
|
+
*
|
|
1820
|
+
* Signs whatever it is handed, ungated — see {@link settle} for the trade.
|
|
1821
|
+
*
|
|
1663
1822
|
* @returns The Arkade transaction id and server-signed checkpoint PSBTs (for bookkeeping)
|
|
1664
1823
|
*/
|
|
1665
1824
|
buildAndSubmitOffchainTx(inputs: ExtendedVirtualCoin[], outputs: TransactionOutput[], serverUnrollScript?: CSVMultisigTapscript.Type): Promise<{
|
|
@@ -1686,4 +1845,4 @@ declare function selectVirtualCoins(coins: ExtendedVirtualCoin[], targetAmount:
|
|
|
1686
1845
|
*/
|
|
1687
1846
|
declare function waitForIncomingFunds(wallet: Wallet): Promise<IncomingFunds>;
|
|
1688
1847
|
|
|
1689
|
-
export { ArkError as A, type BatchExpiryPolicy as B, type CheckpointExitDelayPolicy as C, DEFAULT_MIN_BATCH_EXPIRY_SECONDS as D,
|
|
1848
|
+
export { ArkError as A, type BatchExpiryPolicy as B, type CheckpointExitDelayPolicy as C, DEFAULT_MIN_BATCH_EXPIRY_SECONDS as D, maybeArkError as E, resolveBatchExpiryPolicy as F, resolveCheckpointExitDelayPolicy as G, type HDWalletCapable as H, type IncomingFunds as I, selectVirtualCoins as J, signingDescriptorIndex as K, strictSigningDescriptorIndex as L, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD as M, waitForIncomingFunds as N, type ProviderConnectionState as P, ReadonlyWallet as R, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, type HDAllocationCapable as d, Batch as e, ArkErrorName as f, type ArkadeCashClaimResult as g, ArkadeCashCreateError as h, type ArkadeCashUnclaimedReason as i, type ArkadeCashUnclaimedVtxo as j, type BoardingUtxoGroup as k, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as l, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as m, type ProviderKind as n, ProviderUnavailableError as o, REGTEST_MIN_BATCH_EXPIRY_SECONDS as p, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as q, type ServerInfoSource as r, ServerResponseMismatchError as s, assertValidBatchExpiry as t, assertValidServerUnrollScript as u, defaultBatchExpiryPolicy as v, defaultCheckpointExitDelayPolicy as w, isArkError as x, isHDAllocationCapable as y, isHDWalletCapable as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
3
|
+
var chunk2XLNQHG4_cjs = require('../../chunk-2XLNQHG4.cjs');
|
|
4
|
+
require('../../chunk-KNS5MTTI.cjs');
|
|
5
|
+
require('../../chunk-PRFL62ID.cjs');
|
|
6
|
+
require('../../chunk-MZNLCMUP.cjs');
|
|
7
|
+
require('../../chunk-4A4GRSTB.cjs');
|
|
8
8
|
require('../../chunk-5BLDMQED.cjs');
|
|
9
9
|
|
|
10
10
|
// src/worker/expo/taskQueue.ts
|
|
@@ -121,19 +121,19 @@ var AsyncStorageTaskQueue = class {
|
|
|
121
121
|
|
|
122
122
|
Object.defineProperty(exports, "CONTRACT_POLL_TASK_TYPE", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunk2XLNQHG4_cjs.CONTRACT_POLL_TASK_TYPE; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "contractPollProcessor", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunk2XLNQHG4_cjs.contractPollProcessor; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "createTaskDependencies", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunk2XLNQHG4_cjs.createTaskDependencies; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "runTasks", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunk2XLNQHG4_cjs.runTasks; }
|
|
137
137
|
});
|
|
138
138
|
exports.AsyncStorageTaskQueue = AsyncStorageTaskQueue;
|
|
139
139
|
exports.InMemoryTaskQueue = InMemoryTaskQueue;
|