@invisible-labs/sdk 0.6.0-devnet.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -0
- package/dist/chunk-7DSVN3MV.js +1145 -0
- package/dist/chunk-7DSVN3MV.js.map +1 -0
- package/dist/chunk-JNNVPZEU.js +599 -0
- package/dist/chunk-JNNVPZEU.js.map +1 -0
- package/dist/chunk-JRMKCE3S.js +50 -0
- package/dist/chunk-JRMKCE3S.js.map +1 -0
- package/dist/chunk-LBC7ALYO.js +3783 -0
- package/dist/chunk-LBC7ALYO.js.map +1 -0
- package/dist/chunk-NCY4FCYU.js +1911 -0
- package/dist/chunk-NCY4FCYU.js.map +1 -0
- package/dist/chunk-OHIM2YWU.js +126 -0
- package/dist/chunk-OHIM2YWU.js.map +1 -0
- package/dist/chunk-SZAYO2L5.js +123 -0
- package/dist/chunk-SZAYO2L5.js.map +1 -0
- package/dist/chunk-TQNNTV5F.js +17 -0
- package/dist/chunk-TQNNTV5F.js.map +1 -0
- package/dist/chunk-VR6T6OJS.js +24 -0
- package/dist/chunk-VR6T6OJS.js.map +1 -0
- package/dist/chunk-XUWBGET5.js +221 -0
- package/dist/chunk-XUWBGET5.js.map +1 -0
- package/dist/coordinator-7Y45MCCZ.js +4 -0
- package/dist/coordinator-7Y45MCCZ.js.map +1 -0
- package/dist/createSession-D3ym-Ira.d.ts +177 -0
- package/dist/dkgWorker.d.ts +2 -0
- package/dist/dkgWorker.js +61 -0
- package/dist/dkgWorker.js.map +1 -0
- package/dist/events.d.ts +54 -0
- package/dist/events.js +143 -0
- package/dist/events.js.map +1 -0
- package/dist/frostRuntime-JESDHN6O.js +4 -0
- package/dist/frostRuntime-JESDHN6O.js.map +1 -0
- package/dist/index.d.ts +499 -0
- package/dist/index.js +132 -0
- package/dist/index.js.map +1 -0
- package/dist/lp.d.ts +388 -0
- package/dist/lp.js +1711 -0
- package/dist/lp.js.map +1 -0
- package/dist/presets.d.ts +43 -0
- package/dist/presets.js +70 -0
- package/dist/presets.js.map +1 -0
- package/dist/session-DFuy54C-.d.ts +31 -0
- package/dist/stats.d.ts +47 -0
- package/dist/stats.js +21 -0
- package/dist/stats.js.map +1 -0
- package/dist/storage.d.ts +82 -0
- package/dist/storage.js +246 -0
- package/dist/storage.js.map +1 -0
- package/dist/types-ZhV7TIQY.d.ts +76 -0
- package/dist/types.generated-CHGSbmLp.d.ts +67 -0
- package/dist/user.d.ts +377 -0
- package/dist/user.js +1225 -0
- package/dist/user.js.map +1 -0
- package/package.json +82 -0
package/dist/lp.d.ts
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { S as Session } from './session-DFuy54C-.js';
|
|
2
|
+
|
|
3
|
+
declare const lpPositionCodeBrand: unique symbol;
|
|
4
|
+
type LpPositionCode = string & {
|
|
5
|
+
readonly [lpPositionCodeBrand]: "LpPositionCode";
|
|
6
|
+
};
|
|
7
|
+
type LpPositionCodeAuth = {
|
|
8
|
+
readonly code: LpPositionCode;
|
|
9
|
+
readonly lpPositionId: string;
|
|
10
|
+
readonly authPublicKey: Uint8Array;
|
|
11
|
+
readonly authPrivateKeyPkcs8: Uint8Array;
|
|
12
|
+
readonly refillPublicKey: Uint8Array;
|
|
13
|
+
readonly withdrawalCommitment: Uint8Array;
|
|
14
|
+
};
|
|
15
|
+
declare function generateLpPositionCode(lpPositionId: string): Promise<LpPositionCodeAuth>;
|
|
16
|
+
declare function deriveLpPositionCodeAuth(input: string): Promise<LpPositionCodeAuth>;
|
|
17
|
+
declare function normalizeLpPositionCode(input: string): LpPositionCode;
|
|
18
|
+
declare function bytesToHex(bytes: Uint8Array): string;
|
|
19
|
+
declare function signLpCommandBytes(auth: LpPositionCodeAuth, bytes: Uint8Array): Promise<Uint8Array>;
|
|
20
|
+
|
|
21
|
+
type SourceLiquidityUse = "not_materialized" | "available" | "locked_for_payout" | "pending_finality" | "spent" | "released";
|
|
22
|
+
type LpInventoryShard = {
|
|
23
|
+
kind: "lp";
|
|
24
|
+
lpPositionId: string;
|
|
25
|
+
shardId: string;
|
|
26
|
+
index: number;
|
|
27
|
+
address: string;
|
|
28
|
+
amountLamports: number;
|
|
29
|
+
requiredLamports?: number;
|
|
30
|
+
status: "PREGENERATED" | "FUNDING_QUEUED" | "FUNDED" | "COOLING" | "AVAILABLE" | "RESERVED" | "RETIRED" | "REDEEMED";
|
|
31
|
+
fundingTxSignature?: string;
|
|
32
|
+
payoutTxSignature?: string;
|
|
33
|
+
coolingUntilMs?: number;
|
|
34
|
+
};
|
|
35
|
+
type LpPositionView = {
|
|
36
|
+
id: string;
|
|
37
|
+
status: "dkg_pending" | "active" | "withdrawing" | "closed";
|
|
38
|
+
targetShardCount: number;
|
|
39
|
+
authPublicKey: string;
|
|
40
|
+
refillPublicKey: string;
|
|
41
|
+
withdrawalCommitment: string;
|
|
42
|
+
committedLamports: number;
|
|
43
|
+
earnedLamports: number;
|
|
44
|
+
refillThreshold: number;
|
|
45
|
+
shards: LpInventoryShard[];
|
|
46
|
+
createdAt: number;
|
|
47
|
+
actorSync?: LpActorSyncView;
|
|
48
|
+
};
|
|
49
|
+
type LpActorSyncView = {
|
|
50
|
+
lpPositionId: string;
|
|
51
|
+
status: "idle" | "settling" | "reimbursement_due";
|
|
52
|
+
sourceLiquidityUse: SourceLiquidityUse;
|
|
53
|
+
redeemableProjectionAvailable: boolean;
|
|
54
|
+
redeemablePrincipalLamports: number;
|
|
55
|
+
redeemableFeeLamports: number;
|
|
56
|
+
lifetimeEarnedLamports: number;
|
|
57
|
+
redeemablePrincipalSourceCount: number;
|
|
58
|
+
redeemableFeeSourceCount: number;
|
|
59
|
+
pendingReservationCount: number;
|
|
60
|
+
reservedPayoutLamports: number;
|
|
61
|
+
estimatedNetworkFeeLamports: number;
|
|
62
|
+
reimbursementDueCount: number;
|
|
63
|
+
reimbursementDueSourceCount: number;
|
|
64
|
+
reimbursementDuePayoutLamports: number;
|
|
65
|
+
reimbursementDueNetworkFeeLamports: number;
|
|
66
|
+
withdrawalRequestedLamports: number;
|
|
67
|
+
withdrawalLandedLamports: number;
|
|
68
|
+
withdrawalLandedFeeLamports: number;
|
|
69
|
+
withdrawalCanceledLamports: number;
|
|
70
|
+
withdrawalNetworkFeeLossLamports: number;
|
|
71
|
+
withdrawalTxHashes: string[];
|
|
72
|
+
redemptionHistory?: LpRedemptionHistoryView[];
|
|
73
|
+
redemptionHistoryHasMore?: boolean;
|
|
74
|
+
redemptionHistoryNextCursor?: string;
|
|
75
|
+
stateVersion: number;
|
|
76
|
+
updatedAtMs: number;
|
|
77
|
+
};
|
|
78
|
+
type LpRedemptionHistoryView = {
|
|
79
|
+
redemptionId: string;
|
|
80
|
+
state: "requested" | "match_requested" | "reserved" | "pending" | "confirmed" | "rejected";
|
|
81
|
+
acceptedLamports: number;
|
|
82
|
+
acceptedDepositPrincipalLamports: number;
|
|
83
|
+
acceptedEarnedFeeLamports: number;
|
|
84
|
+
landedLamports: number;
|
|
85
|
+
landedDepositPrincipalLamports: number;
|
|
86
|
+
landedEarnedFeeLamports: number;
|
|
87
|
+
canceledLamports: number;
|
|
88
|
+
canceledDepositPrincipalLamports: number;
|
|
89
|
+
canceledEarnedFeeLamports: number;
|
|
90
|
+
networkFeeLamports: number;
|
|
91
|
+
networkFeeLossLamports: number;
|
|
92
|
+
failedAttempts: number;
|
|
93
|
+
destinationAddresses: string[];
|
|
94
|
+
destinationCount: number;
|
|
95
|
+
txSignatures: string[];
|
|
96
|
+
txSignatureCount: number;
|
|
97
|
+
detailsTruncated: boolean;
|
|
98
|
+
stateVersion: number;
|
|
99
|
+
createdAtMs: number;
|
|
100
|
+
updatedAtMs: number;
|
|
101
|
+
};
|
|
102
|
+
type OpenLpPositionInput = {
|
|
103
|
+
lpPositionId: string;
|
|
104
|
+
authPublicKey: number[];
|
|
105
|
+
refillPublicKey: number[];
|
|
106
|
+
withdrawalCommitment: number[];
|
|
107
|
+
committedLamports: number;
|
|
108
|
+
shardCount: number;
|
|
109
|
+
shardAmountLamports: number;
|
|
110
|
+
refillThreshold: number;
|
|
111
|
+
addresses: string[];
|
|
112
|
+
createdAtMs: number;
|
|
113
|
+
};
|
|
114
|
+
type RefillLpPositionInput = {
|
|
115
|
+
lpPositionId: string;
|
|
116
|
+
shardCount: number;
|
|
117
|
+
shardAmountLamports: number;
|
|
118
|
+
addresses: string[];
|
|
119
|
+
authorizedAtMs: number;
|
|
120
|
+
};
|
|
121
|
+
type FundingConfirmationInput = {
|
|
122
|
+
lpPositionId: string;
|
|
123
|
+
shardId: string;
|
|
124
|
+
amountLamports: number;
|
|
125
|
+
fundingTxSignature: string;
|
|
126
|
+
};
|
|
127
|
+
type LpTopUpRequest$1 = {
|
|
128
|
+
topUpId: string;
|
|
129
|
+
positionId: string;
|
|
130
|
+
depositAddress: string;
|
|
131
|
+
expiresAtMs: number;
|
|
132
|
+
status: "watching" | "funded" | "expired";
|
|
133
|
+
};
|
|
134
|
+
type FinalizeLpDkgBatchInput = {
|
|
135
|
+
lpPositionId: string;
|
|
136
|
+
startIndex: number;
|
|
137
|
+
addresses: string[];
|
|
138
|
+
finalizedAtMs: number;
|
|
139
|
+
};
|
|
140
|
+
type LpWithdrawalExecutionView = {
|
|
141
|
+
withdrawalId: string;
|
|
142
|
+
txSignatures: string[];
|
|
143
|
+
};
|
|
144
|
+
type LpDkgClient = {
|
|
145
|
+
initDkg(input: {
|
|
146
|
+
lpPositionId: string;
|
|
147
|
+
index: number;
|
|
148
|
+
}, auth: LpPositionCodeAuth): Promise<{
|
|
149
|
+
sessionId: string;
|
|
150
|
+
}>;
|
|
151
|
+
dkgRound1(input: {
|
|
152
|
+
sessionId: string;
|
|
153
|
+
package: number[];
|
|
154
|
+
}, auth: LpPositionCodeAuth): Promise<{
|
|
155
|
+
package: Uint8Array;
|
|
156
|
+
round2ForLp: Uint8Array;
|
|
157
|
+
}>;
|
|
158
|
+
dkgRound2(input: {
|
|
159
|
+
sessionId: string;
|
|
160
|
+
package: number[];
|
|
161
|
+
delegatedShare: number[];
|
|
162
|
+
}, auth: LpPositionCodeAuth): Promise<{
|
|
163
|
+
address: string;
|
|
164
|
+
jointPubkey: Uint8Array;
|
|
165
|
+
shardId: string;
|
|
166
|
+
index: number;
|
|
167
|
+
}>;
|
|
168
|
+
};
|
|
169
|
+
type LpCoordinatorClient = LpDkgClient & {
|
|
170
|
+
openPosition(input: OpenLpPositionInput, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
171
|
+
getPosition(lpPositionId: string, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
172
|
+
finalizeDkgBatch(input: FinalizeLpDkgBatchInput, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
173
|
+
refillPosition(input: RefillLpPositionInput, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
174
|
+
reconcileFunding(lpPositionId: string, auth: LpPositionCodeAuth): Promise<LpPositionView>;
|
|
175
|
+
planFunding(input: {
|
|
176
|
+
lpPositionId: string;
|
|
177
|
+
shardCount: number;
|
|
178
|
+
nowMs: number;
|
|
179
|
+
}, auth: LpPositionCodeAuth): Promise<LpInventoryShard[]>;
|
|
180
|
+
confirmFunding(input: FundingConfirmationInput, auth: LpPositionCodeAuth): Promise<LpInventoryShard>;
|
|
181
|
+
prepareTopUp(lpPositionId: string, auth: LpPositionCodeAuth): Promise<LpTopUpRequest$1>;
|
|
182
|
+
getTopUpStatus(input: {
|
|
183
|
+
lpPositionId: string;
|
|
184
|
+
topUpId: string;
|
|
185
|
+
}, auth: LpPositionCodeAuth): Promise<LpTopUpRequest$1>;
|
|
186
|
+
makeAvailable(input: {
|
|
187
|
+
lpPositionId: string;
|
|
188
|
+
shardId: string;
|
|
189
|
+
}, auth: LpPositionCodeAuth): Promise<LpInventoryShard>;
|
|
190
|
+
executeWithdrawal(input: {
|
|
191
|
+
lpPositionId: string;
|
|
192
|
+
destinationAddresses: string[];
|
|
193
|
+
depositPrincipalLamports: number;
|
|
194
|
+
earnedFeeLamports: number;
|
|
195
|
+
requestedAtMs: number;
|
|
196
|
+
allowManyToOne?: boolean;
|
|
197
|
+
}, auth: LpPositionCodeAuth): Promise<LpWithdrawalExecutionView>;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
declare const LP_REDEMPTION_RECONCILING_MESSAGE = "LP redemption is still settling on the coordinator; it will reconcile from sync";
|
|
201
|
+
declare const LP_MISSING_POSITION_CODE_MESSAGE = "Save or recover the LP Position Code before using LP funds";
|
|
202
|
+
type LpLifecycleDkgProgress = {
|
|
203
|
+
readonly phase: "dkg";
|
|
204
|
+
readonly lpPositionId: string;
|
|
205
|
+
readonly startIndex: number;
|
|
206
|
+
readonly targetShardCount: number;
|
|
207
|
+
readonly completed: number;
|
|
208
|
+
readonly total: number;
|
|
209
|
+
};
|
|
210
|
+
interface CreatePositionArgs {
|
|
211
|
+
readonly committedLamports?: number;
|
|
212
|
+
readonly shardCount?: number;
|
|
213
|
+
readonly refillThreshold?: number;
|
|
214
|
+
readonly feePolicy?: unknown;
|
|
215
|
+
/**
|
|
216
|
+
* Called after SDK-owned code generation and before the coordinator open call.
|
|
217
|
+
* Use this to show/save the code if coordinator intake fails.
|
|
218
|
+
*/
|
|
219
|
+
readonly onPositionCode?: (code: LpGeneratedPositionCode) => void;
|
|
220
|
+
}
|
|
221
|
+
interface LpGeneratedPositionCode {
|
|
222
|
+
readonly positionId: string;
|
|
223
|
+
readonly lpPositionCode: string;
|
|
224
|
+
}
|
|
225
|
+
interface CreatePositionResult {
|
|
226
|
+
readonly positionId: string;
|
|
227
|
+
/** Shown once at onboarding; treat like a seed phrase. */
|
|
228
|
+
readonly lpPositionCode: string;
|
|
229
|
+
readonly position: LpPositionView;
|
|
230
|
+
}
|
|
231
|
+
interface CompleteDkgBatchOptions {
|
|
232
|
+
readonly onProgress?: (progress: LpLifecycleDkgProgress) => void;
|
|
233
|
+
readonly onPosition?: (position: LpPositionView) => void;
|
|
234
|
+
readonly concurrency?: number;
|
|
235
|
+
readonly workerFactory?: () => Worker;
|
|
236
|
+
}
|
|
237
|
+
interface InitialFundingPlan {
|
|
238
|
+
readonly address: string;
|
|
239
|
+
readonly requiredLamports: number;
|
|
240
|
+
readonly qrPayload: string;
|
|
241
|
+
readonly position: LpPositionView;
|
|
242
|
+
}
|
|
243
|
+
interface LpTopUpRequest {
|
|
244
|
+
readonly topUpId: string;
|
|
245
|
+
readonly positionId: string;
|
|
246
|
+
readonly depositAddress: string;
|
|
247
|
+
readonly expiresAtMs: number;
|
|
248
|
+
readonly status: "watching" | "funded" | "expired";
|
|
249
|
+
}
|
|
250
|
+
interface WithdrawPositionArgs {
|
|
251
|
+
/** Accepted LP deposit-principal bucket claim. Computed from the position when omitted. */
|
|
252
|
+
readonly depositPrincipalLamports?: number;
|
|
253
|
+
/** Accepted earned-fee bucket claim. Computed from the position when omitted. */
|
|
254
|
+
readonly earnedFeeLamports?: number;
|
|
255
|
+
readonly destinationAddresses: string[];
|
|
256
|
+
/** Required to accept a privacy-degrading single-destination withdrawal. */
|
|
257
|
+
readonly allowManyToOne?: boolean;
|
|
258
|
+
}
|
|
259
|
+
interface RefillArgs {
|
|
260
|
+
readonly shardCount?: number;
|
|
261
|
+
readonly onProgress?: (progress: LpLifecycleDkgProgress) => void;
|
|
262
|
+
readonly onPosition?: (position: LpPositionView) => void;
|
|
263
|
+
readonly workerFactory?: () => Worker;
|
|
264
|
+
}
|
|
265
|
+
interface WithdrawalExecution {
|
|
266
|
+
readonly withdrawalId: string;
|
|
267
|
+
readonly txSignatures: string[];
|
|
268
|
+
}
|
|
269
|
+
interface LpWithdrawalRecord {
|
|
270
|
+
readonly redemptionId: string;
|
|
271
|
+
readonly lpPositionId: string;
|
|
272
|
+
readonly requestedAt: number;
|
|
273
|
+
readonly status: "pending" | "reconciling" | "confirmed" | "failed";
|
|
274
|
+
readonly destinationAddresses: string[];
|
|
275
|
+
readonly destinationCount?: number;
|
|
276
|
+
readonly txSignatureCount?: number;
|
|
277
|
+
readonly detailsTruncated?: boolean;
|
|
278
|
+
readonly acceptedLamports?: number;
|
|
279
|
+
readonly requestedTargetLamports: number;
|
|
280
|
+
readonly landedBaselineLamports: number;
|
|
281
|
+
readonly landedFeeBaselineLamports?: number;
|
|
282
|
+
readonly redeemedLamports: number;
|
|
283
|
+
readonly txSignatures: string[];
|
|
284
|
+
readonly txSignatureBaseline: string[];
|
|
285
|
+
readonly coordinatorStateVersion?: number;
|
|
286
|
+
readonly error?: string;
|
|
287
|
+
}
|
|
288
|
+
interface WithdrawPositionResult {
|
|
289
|
+
readonly execution: WithdrawalExecution;
|
|
290
|
+
readonly position: LpPositionView;
|
|
291
|
+
readonly redemption: LpWithdrawalRecord;
|
|
292
|
+
}
|
|
293
|
+
interface WithdrawalConfirmation {
|
|
294
|
+
readonly withdrawalId: string;
|
|
295
|
+
readonly txSignatures: string[];
|
|
296
|
+
readonly redeemedLamports: number;
|
|
297
|
+
}
|
|
298
|
+
interface LpLifecycleRuntime {
|
|
299
|
+
readonly coordinatorClient?: LpCoordinatorClient;
|
|
300
|
+
readonly workerFactory?: () => Worker;
|
|
301
|
+
readonly useDeterministicTestAddresses?: boolean;
|
|
302
|
+
readonly nowMs?: () => number;
|
|
303
|
+
readonly idFactory?: () => string;
|
|
304
|
+
readonly sleep?: (delayMs: number) => Promise<void>;
|
|
305
|
+
readonly dkgConcurrency?: number;
|
|
306
|
+
readonly withdrawalConfirmationPollIntervalMs?: number;
|
|
307
|
+
readonly withdrawalConfirmationTimeoutMs?: number;
|
|
308
|
+
}
|
|
309
|
+
interface WaitForWithdrawalConfirmationOptions {
|
|
310
|
+
readonly onPosition?: (position: LpPositionView) => void;
|
|
311
|
+
readonly onRedemptionUpdate?: (record: LpWithdrawalRecord) => void;
|
|
312
|
+
readonly redemptionRecord?: LpWithdrawalRecord;
|
|
313
|
+
}
|
|
314
|
+
interface WaitForTopUpOptions {
|
|
315
|
+
readonly signal?: AbortSignal;
|
|
316
|
+
readonly pollIntervalMs?: number;
|
|
317
|
+
readonly positionId?: string;
|
|
318
|
+
}
|
|
319
|
+
declare function isLpRedemptionReconcilingError(error: unknown): boolean;
|
|
320
|
+
declare function isLpPositionAuthMissingError(error: unknown): boolean;
|
|
321
|
+
interface LpLifecycleClient {
|
|
322
|
+
createPosition(args?: CreatePositionArgs): Promise<CreatePositionResult>;
|
|
323
|
+
recoverPosition(args: {
|
|
324
|
+
readonly code: string;
|
|
325
|
+
}): Promise<LpPositionView>;
|
|
326
|
+
confirmPositionCodeSaved(positionId: string): void;
|
|
327
|
+
completeDkgBatch(positionId: string, options?: CompleteDkgBatchOptions): Promise<LpPositionView>;
|
|
328
|
+
refreshPosition(positionId: string): Promise<LpPositionView>;
|
|
329
|
+
refill(positionId: string, args?: RefillArgs): Promise<LpPositionView>;
|
|
330
|
+
prepareInitialFunding(positionId: string): Promise<InitialFundingPlan | null>;
|
|
331
|
+
prepareTopUp(positionId: string): Promise<LpTopUpRequest>;
|
|
332
|
+
waitForTopUp(topUpId: string, options?: WaitForTopUpOptions): Promise<LpTopUpRequest>;
|
|
333
|
+
reconcileFunding(positionId: string): Promise<LpPositionView>;
|
|
334
|
+
withdrawPosition(positionId: string, args: WithdrawPositionArgs): Promise<WithdrawPositionResult>;
|
|
335
|
+
waitForWithdrawalConfirmation(positionId: string, execution: WithdrawalExecution, options?: WaitForWithdrawalConfirmationOptions): Promise<WithdrawalConfirmation>;
|
|
336
|
+
withdrawFees(positionId: string, args: {
|
|
337
|
+
readonly destination: string;
|
|
338
|
+
}): Promise<never>;
|
|
339
|
+
listPositions(): Promise<LpPositionView[]>;
|
|
340
|
+
}
|
|
341
|
+
declare function createLpLifecycleClient(session: Session, runtime?: LpLifecycleRuntime): LpLifecycleClient;
|
|
342
|
+
declare function defaultLpLifecycleClient(session: Session): LpLifecycleClient;
|
|
343
|
+
|
|
344
|
+
declare const LP_COMMAND_REQUEST_TIMEOUT_MS = 120000;
|
|
345
|
+
declare function createLpCoordinatorClient(session: Session): LpCoordinatorClient;
|
|
346
|
+
|
|
347
|
+
type LpDkgProgress = {
|
|
348
|
+
completed: number;
|
|
349
|
+
total: number;
|
|
350
|
+
address: string;
|
|
351
|
+
};
|
|
352
|
+
type CreateLpDkgBatchInput = {
|
|
353
|
+
lpPositionId: string;
|
|
354
|
+
startIndex: number;
|
|
355
|
+
count: number;
|
|
356
|
+
auth: LpPositionCodeAuth;
|
|
357
|
+
client: LpCoordinatorClient;
|
|
358
|
+
concurrency?: number;
|
|
359
|
+
workerFactory?: () => Worker;
|
|
360
|
+
useDeterministicTestAddresses?: boolean;
|
|
361
|
+
onProgress?: (progress: LpDkgProgress) => void;
|
|
362
|
+
};
|
|
363
|
+
declare function createLpDkgBatch(input: CreateLpDkgBatchInput): Promise<string[]>;
|
|
364
|
+
|
|
365
|
+
declare function createPosition(session: Session, args?: CreatePositionArgs): Promise<CreatePositionResult>;
|
|
366
|
+
declare function recoverPosition(session: Session, args: {
|
|
367
|
+
readonly code: string;
|
|
368
|
+
}): Promise<LpPositionView>;
|
|
369
|
+
declare function confirmPositionCodeSaved(session: Session, positionId: string): void;
|
|
370
|
+
declare function completeDkgBatch(session: Session, positionId: string, opts?: CompleteDkgBatchOptions): Promise<LpPositionView>;
|
|
371
|
+
declare function refreshPosition(session: Session, positionId: string): Promise<LpPositionView>;
|
|
372
|
+
declare function refill(session: Session, positionId: string, args?: RefillArgs): Promise<LpPositionView>;
|
|
373
|
+
declare function prepareInitialFunding(session: Session, positionId: string): Promise<InitialFundingPlan | null>;
|
|
374
|
+
declare function prepareTopUp(session: Session, positionId: string): Promise<LpTopUpRequest>;
|
|
375
|
+
declare function waitForTopUp(session: Session, topUpId: string, options?: WaitForTopUpOptions): Promise<LpTopUpRequest>;
|
|
376
|
+
declare function reconcileFunding(session: Session, positionId: string): Promise<LpPositionView>;
|
|
377
|
+
declare function withdrawPosition(session: Session, positionId: string, args: WithdrawPositionArgs): Promise<WithdrawPositionResult>;
|
|
378
|
+
declare function waitForWithdrawalConfirmation(session: Session, positionId: string, execution: WithdrawalExecution, options?: WaitForWithdrawalConfirmationOptions): Promise<WithdrawalConfirmation>;
|
|
379
|
+
/**
|
|
380
|
+
* LP fee withdrawal is coordinator-pending. The SDK validates the local input
|
|
381
|
+
* and returns a typed `VERSION_NOT_SUPPORTED` routing error until advertised.
|
|
382
|
+
*/
|
|
383
|
+
declare function withdrawFees(session: Session, positionId: string, args: {
|
|
384
|
+
readonly destination: string;
|
|
385
|
+
}): Promise<never>;
|
|
386
|
+
declare function listPositions(session: Session): Promise<LpPositionView[]>;
|
|
387
|
+
|
|
388
|
+
export { type CompleteDkgBatchOptions, type CreateLpDkgBatchInput, type CreatePositionArgs, type CreatePositionResult, type FinalizeLpDkgBatchInput, type FundingConfirmationInput, type InitialFundingPlan, LP_COMMAND_REQUEST_TIMEOUT_MS, LP_MISSING_POSITION_CODE_MESSAGE, LP_REDEMPTION_RECONCILING_MESSAGE, type LpActorSyncView, type LpCoordinatorClient, type LpDkgClient, type LpDkgProgress, type LpInventoryShard, type LpLifecycleClient, type LpLifecycleDkgProgress, type LpLifecycleRuntime, type LpPositionCode, type LpPositionCodeAuth, type LpPositionView, type LpRedemptionHistoryView, type LpTopUpRequest, type LpWithdrawalExecutionView, type LpWithdrawalRecord, type OpenLpPositionInput, type RefillArgs, type RefillLpPositionInput, type SourceLiquidityUse, type WaitForTopUpOptions, type WaitForWithdrawalConfirmationOptions, type WithdrawPositionArgs, type WithdrawPositionResult, type WithdrawalConfirmation, type WithdrawalExecution, bytesToHex, completeDkgBatch, confirmPositionCodeSaved, createLpCoordinatorClient, createLpDkgBatch, createLpLifecycleClient, createPosition, defaultLpLifecycleClient, deriveLpPositionCodeAuth, generateLpPositionCode, isLpPositionAuthMissingError, isLpRedemptionReconcilingError, listPositions, normalizeLpPositionCode, prepareInitialFunding, prepareTopUp, reconcileFunding, recoverPosition, refill, refreshPosition, signLpCommandBytes, waitForTopUp, waitForWithdrawalConfirmation, withdrawFees, withdrawPosition };
|