@elemental-stv-core/sdk 0.9.3 → 0.12.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/dist/common/buffer.d.ts +3 -0
- package/dist/common/buffer.js +19 -0
- package/dist/elemental-lend/instructions.d.ts +14 -0
- package/dist/elemental-lend/instructions.js +18 -6
- package/dist/elemental-lend/protocol-actions.d.ts +6 -0
- package/dist/elemental-lend/protocol-actions.js +21 -10
- package/dist/jlpd-strategy/accounts.d.ts +4 -1
- package/dist/jlpd-strategy/accounts.js +6 -1
- package/dist/jlpd-strategy/adapter.d.ts +16 -6
- package/dist/jlpd-strategy/adapter.js +21 -9
- package/dist/jlpd-strategy/base-to-base-swap.d.ts +74 -0
- package/dist/jlpd-strategy/base-to-base-swap.js +199 -0
- package/dist/jlpd-strategy/constants.d.ts +11 -3
- package/dist/jlpd-strategy/constants.js +19 -10
- package/dist/jlpd-strategy/index.d.ts +1 -0
- package/dist/jlpd-strategy/index.js +1 -0
- package/dist/jlpd-strategy/instructions.d.ts +49 -0
- package/dist/jlpd-strategy/instructions.js +55 -0
- package/dist/jlpd-strategy/jlp-data.d.ts +11 -0
- package/dist/jlpd-strategy/jlp-data.js +15 -0
- package/dist/jlpd-strategy/settle-yield.d.ts +20 -1
- package/dist/jlpd-strategy/settle-yield.js +9 -6
- package/dist/jlpd-strategy/swap-jlp.d.ts +26 -0
- package/dist/jlpd-strategy/swap-jlp.js +74 -10
- package/dist/jlpd-strategy/types.d.ts +3 -1
- package/dist/p-stv-core/accounts.d.ts +74 -34
- package/dist/p-stv-core/accounts.js +163 -56
- package/dist/p-stv-core/constants.d.ts +49 -4
- package/dist/p-stv-core/constants.js +52 -5
- package/dist/p-stv-core/events.js +63 -9
- package/dist/p-stv-core/instructions.d.ts +302 -3
- package/dist/p-stv-core/instructions.js +277 -15
- package/dist/p-stv-core/pda.d.ts +15 -0
- package/dist/p-stv-core/pda.js +25 -0
- package/dist/p-stv-core/remaining-accounts.d.ts +4 -1
- package/dist/p-stv-core/remaining-accounts.js +17 -2
- package/dist/p-stv-core/types.d.ts +104 -4
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ export interface InitOrUpdateStvArgs {
|
|
|
18
18
|
evMint: PublicKey;
|
|
19
19
|
baseMint: PublicKey;
|
|
20
20
|
vaultAta: PublicKey;
|
|
21
|
+
/** Canonical ATA for feeReceiver + evMint, pinned on STV. */
|
|
22
|
+
feeReceiverEvAta: PublicKey;
|
|
21
23
|
tokenProgram: PublicKey;
|
|
22
24
|
ataProgram?: PublicKey;
|
|
23
25
|
systemProgram?: PublicKey;
|
|
@@ -37,6 +39,36 @@ export interface InitOrUpdateStvArgs {
|
|
|
37
39
|
lendProgram?: PublicKey;
|
|
38
40
|
/** Max % of AUM claimable per epoch window (BPS, 0 = unlimited, max 10000) */
|
|
39
41
|
dailyWithdrawLimitBps?: number;
|
|
42
|
+
/** Migrate-in fee (BPS, max MAX_FEE_BPS=1000). Applied when FLAG_DEPOSIT_FEE_ON_MIGRATE set. */
|
|
43
|
+
depositFeeBps?: number;
|
|
44
|
+
/** Migrate-out fee (BPS, max MAX_FEE_BPS=1000). Applied when FLAG_WITHDRAWAL_FEE_ON_MIGRATE set. */
|
|
45
|
+
withdrawalFeeBps?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Withdrawal mode: 0=instant, 1=X, 2=X+1. CREATE-ONLY — immutable after the STV
|
|
48
|
+
* exists (the handler rejects a change on update). Instant (0) additionally
|
|
49
|
+
* requires a C-1 seed floor and a non-allocator vault.
|
|
50
|
+
*/
|
|
51
|
+
withdrawalMode?: number;
|
|
52
|
+
/**
|
|
53
|
+
* CREATE path (STV does not yet exist): REQUIRED. Per-vault admin pubkey. Must be
|
|
54
|
+
* nonzero — the handler rejects zero / None. The global admin is the signer here;
|
|
55
|
+
* vaultAdmin can be a different key (e.g. a Squads multi-sig vault PDA).
|
|
56
|
+
*
|
|
57
|
+
* Wire encoding: `0x01 + 32 bytes` (Some(nonzero)). The handler will reject
|
|
58
|
+
* `None` (0x00) and `Some([0;32])` with `InvalidParameter`.
|
|
59
|
+
*/
|
|
60
|
+
vaultAdmin?: PublicKey;
|
|
61
|
+
/**
|
|
62
|
+
* UPDATE path (STV already exists): three-value encoding matching the handler:
|
|
63
|
+
* undefined / not provided → None → no change to pending rotation
|
|
64
|
+
* PublicKey.default ([0u8;32]) → Some([0;32]) → cancel pending rotation
|
|
65
|
+
* any nonzero PublicKey → Some(nonzero) → start/replace rotation; emits AdminRotationStarted
|
|
66
|
+
*
|
|
67
|
+
* Wire encoding: `0x00` (None) or `0x01 + 32 bytes` (Some).
|
|
68
|
+
* ONLY `accept_vault_admin` may change `stv.admin` post-create/migration.
|
|
69
|
+
* A pending admin has ZERO authority before accept.
|
|
70
|
+
*/
|
|
71
|
+
pendingAdmin?: PublicKey;
|
|
40
72
|
remainingAccounts?: AccountMeta[];
|
|
41
73
|
}
|
|
42
74
|
export declare function createInitOrUpdateStvIx(args: InitOrUpdateStvArgs, programId?: PublicKey): TransactionInstruction;
|
|
@@ -58,6 +90,12 @@ export interface DepositArgs {
|
|
|
58
90
|
protocolAumCount?: number;
|
|
59
91
|
/** Number of auto-route accounts in remaining_accounts (after strategy pairs) */
|
|
60
92
|
autoRouteCount?: number;
|
|
93
|
+
/** DelayedDepositRequest PDA. Required when the STV has FLAG_DELAYED_DEPOSIT set. */
|
|
94
|
+
delayedDepositRequest?: PublicKey;
|
|
95
|
+
/** PDA bump for delayedDepositRequest. Required when delayedDepositRequest is passed. */
|
|
96
|
+
delayedDepositBump?: number;
|
|
97
|
+
/** System program. Required for delayed deposits because the request PDA may be created. */
|
|
98
|
+
systemProgram?: PublicKey;
|
|
61
99
|
remainingAccounts?: AccountMeta[];
|
|
62
100
|
}
|
|
63
101
|
export declare function createDepositIx(args: DepositArgs, programId?: PublicKey): TransactionInstruction;
|
|
@@ -84,11 +122,21 @@ export interface ClaimWithdrawArgs {
|
|
|
84
122
|
withdrawRequest: PublicKey;
|
|
85
123
|
vaultAta: PublicKey;
|
|
86
124
|
userBaseAta: PublicKey;
|
|
125
|
+
/** Fee receiver's base-mint ATA. Required even when withdrawalFeeBps == 0. */
|
|
126
|
+
feeReceiverBaseAta: PublicKey;
|
|
87
127
|
baseMint: PublicKey;
|
|
88
128
|
tokenProgram: PublicKey;
|
|
89
129
|
remainingAccounts?: AccountMeta[];
|
|
90
130
|
/** Number of auto-unroute accounts appended after lend accounts (0 = no auto-unroute) */
|
|
91
131
|
autoUnrouteCount?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Number of protocol-AUM accounts (kVault 2 / Jupiter 3 per protocol) placed in
|
|
134
|
+
* remainingAccounts AFTER the 4 fixed lend accounts and BEFORE the auto-unroute
|
|
135
|
+
* accounts. Feeds the pre-unsweep update_aum refresh. MUST equal the lend strategy's
|
|
136
|
+
* live protocol set when lend has protocols (lend reverts an incomplete tail);
|
|
137
|
+
* pass 0 only when the lend strategy has no protocols.
|
|
138
|
+
*/
|
|
139
|
+
protocolAumCount?: number;
|
|
92
140
|
}
|
|
93
141
|
export declare function createClaimWithdrawIx(args: ClaimWithdrawArgs, programId?: PublicKey): TransactionInstruction;
|
|
94
142
|
export interface OverrideClaimWithdrawArgs {
|
|
@@ -101,10 +149,14 @@ export interface OverrideClaimWithdrawArgs {
|
|
|
101
149
|
withdrawRequest: PublicKey;
|
|
102
150
|
vaultAta: PublicKey;
|
|
103
151
|
userBaseAta: PublicKey;
|
|
152
|
+
/** Fee receiver's base-mint ATA. Required even when withdrawalFeeBps == 0. */
|
|
153
|
+
feeReceiverBaseAta: PublicKey;
|
|
104
154
|
baseMint: PublicKey;
|
|
105
155
|
tokenProgram: PublicKey;
|
|
106
156
|
remainingAccounts?: AccountMeta[];
|
|
107
157
|
autoUnrouteCount?: number;
|
|
158
|
+
/** Protocol-AUM accounts count for the pre-unsweep refresh — see ClaimWithdrawArgs. */
|
|
159
|
+
protocolAumCount?: number;
|
|
108
160
|
}
|
|
109
161
|
export declare function createOverrideClaimWithdrawIx(args: OverrideClaimWithdrawArgs, programId?: PublicKey): TransactionInstruction;
|
|
110
162
|
export interface ProcessEpochArgs {
|
|
@@ -123,6 +175,24 @@ export interface ProcessEpochArgs {
|
|
|
123
175
|
remainingAccounts?: AccountMeta[];
|
|
124
176
|
}
|
|
125
177
|
export declare function createProcessEpochIx(args: ProcessEpochArgs, programId?: PublicKey): TransactionInstruction;
|
|
178
|
+
export interface ProcessDelayedDepositArgs {
|
|
179
|
+
payer: PublicKey;
|
|
180
|
+
/** GlobalConfig PDA — checked for CFG_FLAG_GLOBAL_PAUSED */
|
|
181
|
+
config: PublicKey;
|
|
182
|
+
stv: PublicKey;
|
|
183
|
+
delayedDepositRequest: PublicKey;
|
|
184
|
+
/** User account stored on the delayed deposit request; receives closed-account rent. */
|
|
185
|
+
user: PublicKey;
|
|
186
|
+
vaultAta: PublicKey;
|
|
187
|
+
userEvAta: PublicKey;
|
|
188
|
+
evMint: PublicKey;
|
|
189
|
+
feeReceiverEvAta: PublicKey;
|
|
190
|
+
tokenProgram: PublicKey;
|
|
191
|
+
/** Number of protocol AUM accounts in remaining_accounts (after 4 lend accounts) */
|
|
192
|
+
protocolAumCount?: number;
|
|
193
|
+
remainingAccounts?: AccountMeta[];
|
|
194
|
+
}
|
|
195
|
+
export declare function createProcessDelayedDepositIx(args: ProcessDelayedDepositArgs, programId?: PublicKey): TransactionInstruction;
|
|
126
196
|
export interface DepositToStrategyArgs {
|
|
127
197
|
manager: PublicKey;
|
|
128
198
|
managerRole: PublicKey;
|
|
@@ -163,6 +233,12 @@ export interface WithdrawFromStrategyArgs {
|
|
|
163
233
|
strategyBaseAta: PublicKey;
|
|
164
234
|
tokenProgram: PublicKey;
|
|
165
235
|
shares: BN | number;
|
|
236
|
+
/**
|
|
237
|
+
* remainingAccounts when lend is active: [4 fixed lend, protocolAumCount protocol-AUM
|
|
238
|
+
* accounts]. The protocol-AUM accounts feed the pre-sweep update_aum refresh so the
|
|
239
|
+
* swept base mints lend shares at a fresh pps. Pass 0 only when lend has no protocols.
|
|
240
|
+
*/
|
|
241
|
+
protocolAumCount?: number;
|
|
166
242
|
remainingAccounts?: AccountMeta[];
|
|
167
243
|
}
|
|
168
244
|
export declare function createWithdrawFromStrategyIx(args: WithdrawFromStrategyArgs, programId?: PublicKey): TransactionInstruction;
|
|
@@ -188,9 +264,11 @@ export interface AddManagerArgs {
|
|
|
188
264
|
}
|
|
189
265
|
export declare function createAddManagerIx(args: AddManagerArgs, programId?: PublicKey): TransactionInstruction;
|
|
190
266
|
export interface RemoveManagerArgs {
|
|
267
|
+
/** Must be the per-vault admin (stv.admin). NOT the global config admin. */
|
|
191
268
|
admin: PublicKey;
|
|
192
269
|
payer: PublicKey;
|
|
193
|
-
|
|
270
|
+
/** STV PDA — required for vault-admin auth check (stv.admin == admin). */
|
|
271
|
+
stv: PublicKey;
|
|
194
272
|
managerRole: PublicKey;
|
|
195
273
|
}
|
|
196
274
|
export declare function createRemoveManagerIx(args: RemoveManagerArgs, programId?: PublicKey): TransactionInstruction;
|
|
@@ -211,24 +289,245 @@ export interface MigrateLendArgs {
|
|
|
211
289
|
protocolAumCount: number;
|
|
212
290
|
/** Auto-unroute accounts for old lend withdraw. */
|
|
213
291
|
autoUnrouteCount: number;
|
|
292
|
+
/**
|
|
293
|
+
* Protocol-AUM accounts for the NEW lend's pre-sweep update_aum refresh, trailing
|
|
294
|
+
* the 4 fixed new-lend accounts in the new section. Pass 0 when deactivating lend or
|
|
295
|
+
* when the new lend has no protocols (else lend reverts an incomplete tail).
|
|
296
|
+
*/
|
|
297
|
+
newProtocolAumCount?: number;
|
|
214
298
|
/**
|
|
215
299
|
* remaining_accounts layout:
|
|
216
300
|
* Old section (4 + protocolAumCount + autoUnrouteCount):
|
|
217
301
|
* [oldLendProgram, oldStrategyState, oldStvPosition, oldBaseAta,
|
|
218
302
|
* ...protocolAumAccounts, ...autoUnrouteAccounts]
|
|
219
|
-
* New section (if newLendProgram != default
|
|
220
|
-
* [newLendProgram, newStrategyState, newPositionPda, newBaseAta
|
|
303
|
+
* New section (if newLendProgram != default):
|
|
304
|
+
* [newLendProgram, newStrategyState, newPositionPda, newBaseAta,
|
|
305
|
+
* ...newProtocolAumAccounts (count = newProtocolAumCount, for the pre-sweep refresh)]
|
|
221
306
|
*/
|
|
222
307
|
remainingAccounts?: AccountMeta[];
|
|
223
308
|
}
|
|
224
309
|
export declare function createMigrateLendIx(args: MigrateLendArgs, programId?: PublicKey): TransactionInstruction;
|
|
310
|
+
export interface MigrateRequestArgs {
|
|
311
|
+
/** The LP migrating (signer, writable). */
|
|
312
|
+
user: PublicKey;
|
|
313
|
+
/** GlobalConfig PDA — checked for CFG_FLAG_GLOBAL_PAUSED. */
|
|
314
|
+
config: PublicKey;
|
|
315
|
+
/** STV migrating FROM (writable). */
|
|
316
|
+
sourceStv: PublicKey;
|
|
317
|
+
/** STV migrating TO (read-only; base_mint must match source). */
|
|
318
|
+
destStv: PublicKey;
|
|
319
|
+
/** Source STV's evX mint. */
|
|
320
|
+
evMint: PublicKey;
|
|
321
|
+
/** User's source evX token account (writable). */
|
|
322
|
+
userEvAta: PublicKey;
|
|
323
|
+
/** Source STV escrow evX account, owner = source_stv PDA (writable). */
|
|
324
|
+
escrowEvAta: PublicKey;
|
|
325
|
+
/** Migrate-kind WithdrawRequest PDA to initialize — use findMigrateRequestPda. */
|
|
326
|
+
migrateRequest: PublicKey;
|
|
327
|
+
tokenProgram: PublicKey;
|
|
328
|
+
systemProgram?: PublicKey;
|
|
329
|
+
/** evX shares to migrate. */
|
|
330
|
+
shares: BN | number;
|
|
331
|
+
/** Bump for the migrate_request PDA (findMigrateRequestPda[1]). */
|
|
332
|
+
wrBump: number;
|
|
333
|
+
/** Minimum dest shares accepted at execute time (slippage floor; 0 = none). */
|
|
334
|
+
minDestShares: BN | number;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Instruction data layout (17 bytes, after the 1-byte disc is stripped by the
|
|
338
|
+
* dispatcher): shares(u64 LE) + wr_bump(u8) + min_dest_shares(u64 LE).
|
|
339
|
+
* Confirmed against migrate_request.rs:53-66.
|
|
340
|
+
*/
|
|
341
|
+
export declare function createMigrateRequestIx(args: MigrateRequestArgs, programId?: PublicKey): TransactionInstruction;
|
|
342
|
+
export interface MigrateExecuteArgs {
|
|
343
|
+
manager: PublicKey;
|
|
344
|
+
/** ManagerRole PDA for (sourceStv, manager). */
|
|
345
|
+
managerRole: PublicKey;
|
|
346
|
+
/** GlobalConfig PDA — checked for CFG_FLAG_GLOBAL_PAUSED. */
|
|
347
|
+
config: PublicKey;
|
|
348
|
+
sourceStv: PublicKey;
|
|
349
|
+
destStv: PublicKey;
|
|
350
|
+
/** Migrate-kind WithdrawRequest PDA (writable, program-owned). */
|
|
351
|
+
wrAccount: PublicKey;
|
|
352
|
+
sourceVaultAta: PublicKey;
|
|
353
|
+
destVaultAta: PublicKey;
|
|
354
|
+
destEvMint: PublicKey;
|
|
355
|
+
/** WR user's dest evX ATA (mint = dest ev_mint, owner = wr.user). */
|
|
356
|
+
userDestEvAta: PublicKey;
|
|
357
|
+
/** Source fee receiver's base ATA (withdrawal fee). */
|
|
358
|
+
sourceFeeRecvAta: PublicKey;
|
|
359
|
+
/** Dest fee receiver's evX ATA (deposit fee). */
|
|
360
|
+
destFeeRecvEvAta: PublicKey;
|
|
361
|
+
baseMint: PublicKey;
|
|
362
|
+
tokenProgram: PublicKey;
|
|
363
|
+
/** Account that receives the WR rent on close — must equal wr.user (slot 14). */
|
|
364
|
+
wrUserAccount: PublicKey;
|
|
365
|
+
/** Source-lend protocol AUM account count for update_aum. */
|
|
366
|
+
srcProtocolAumCount: number;
|
|
367
|
+
/** Dest-lend protocol AUM account count for update_aum. */
|
|
368
|
+
dstProtocolAumCount: number;
|
|
369
|
+
/** Source-lend auto-unroute account count (withdraw deficit). */
|
|
370
|
+
srcAutoUnrouteCount: number;
|
|
371
|
+
/** Dest-lend auto-route account count (sweep). */
|
|
372
|
+
dstAutoRouteCount: number;
|
|
373
|
+
/**
|
|
374
|
+
* remaining_accounts (assemble with buildMigrateRemainingAccounts):
|
|
375
|
+
* src lend fixed(4) + src protocol AUM(srcProtocolAumCount)
|
|
376
|
+
* + src auto-unroute(srcAutoUnrouteCount)
|
|
377
|
+
* + dst lend fixed(4) + dst protocol AUM(dstProtocolAumCount)
|
|
378
|
+
* + dst strategy pairs(0 or 2) + dst auto-route(dstAutoRouteCount)
|
|
379
|
+
* Omit a lend section entirely when that side's lend_program is unset.
|
|
380
|
+
*/
|
|
381
|
+
remainingAccounts?: AccountMeta[];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* 15 fixed accounts confirmed against migrate_execute.rs:87-91 (destructure)
|
|
385
|
+
* and the doc header at lines 29-52. Slot 14 = wrUserAccount (writable; must
|
|
386
|
+
* equal wr.user). Instruction data (4 bytes): src_protocol_aum_count,
|
|
387
|
+
* dst_protocol_aum_count, src_auto_unroute_count, dst_auto_route_count
|
|
388
|
+
* (migrate_execute.rs:94-100).
|
|
389
|
+
*/
|
|
390
|
+
export declare function createMigrateExecuteIx(args: MigrateExecuteArgs, programId?: PublicKey): TransactionInstruction;
|
|
225
391
|
export declare function buildLendRemainingAccounts(lend: {
|
|
226
392
|
lendProgram: PublicKey;
|
|
227
393
|
lendStrategyState: PublicKey;
|
|
228
394
|
lendStvPosition: PublicKey;
|
|
229
395
|
lendBaseAta: PublicKey;
|
|
230
396
|
}): AccountMeta[];
|
|
397
|
+
/**
|
|
398
|
+
* Assemble the migrate_execute remaining_accounts in the exact order
|
|
399
|
+
* parse_lend_accounts expects (migrate_execute.rs:298-338):
|
|
400
|
+
*
|
|
401
|
+
* [ source-lend section ] src.lend(4 fixed) + src.protocolAum(P_src)
|
|
402
|
+
* [ source auto-unroute ] src.autoUnroute (U accounts)
|
|
403
|
+
* [ dest-lend section ] dst.lend(4 fixed) + dst.protocolAum(P_dst)
|
|
404
|
+
* [ dest strategy + route] dst.strategy(0 or 2) + dst.autoRoute (R accounts)
|
|
405
|
+
*
|
|
406
|
+
* Pass `undefined` for a `lend` side whose STV has no lend_program (the 4
|
|
407
|
+
* fixed accounts + protocol AUM are omitted, matching the early return in
|
|
408
|
+
* parse_lend_accounts when lend_program_key == default).
|
|
409
|
+
*
|
|
410
|
+
* The 4 fixed lend accounts mirror `buildLendRemainingAccounts`:
|
|
411
|
+
* [lendProgram(ro), lendStrategyState(w), lendStvPosition(w), lendBaseAta(w)]
|
|
412
|
+
* `protocolAum` / `autoUnroute` / `autoRoute` / `strategy` accounts are passed
|
|
413
|
+
* through verbatim; the caller sets their writable flags per protocol.
|
|
414
|
+
*/
|
|
415
|
+
export declare function buildMigrateRemainingAccounts(opts: {
|
|
416
|
+
source: {
|
|
417
|
+
lend?: {
|
|
418
|
+
lendProgram: PublicKey;
|
|
419
|
+
lendStrategyState: PublicKey;
|
|
420
|
+
lendStvPosition: PublicKey;
|
|
421
|
+
lendBaseAta: PublicKey;
|
|
422
|
+
};
|
|
423
|
+
protocolAum?: AccountMeta[];
|
|
424
|
+
autoUnroute?: AccountMeta[];
|
|
425
|
+
};
|
|
426
|
+
dest: {
|
|
427
|
+
lend?: {
|
|
428
|
+
lendProgram: PublicKey;
|
|
429
|
+
lendStrategyState: PublicKey;
|
|
430
|
+
lendStvPosition: PublicKey;
|
|
431
|
+
lendBaseAta: PublicKey;
|
|
432
|
+
};
|
|
433
|
+
protocolAum?: AccountMeta[];
|
|
434
|
+
/** Dest strategy pair [strategyState(w), stvPosition(ro)] when dest has a strategy. */
|
|
435
|
+
strategy?: {
|
|
436
|
+
strategyState: PublicKey;
|
|
437
|
+
stvPosition: PublicKey;
|
|
438
|
+
};
|
|
439
|
+
autoRoute?: AccountMeta[];
|
|
440
|
+
};
|
|
441
|
+
}): AccountMeta[];
|
|
231
442
|
export declare function buildStrategyRemainingAccounts(strategies: {
|
|
232
443
|
strategyState: PublicKey;
|
|
233
444
|
stvPosition: PublicKey;
|
|
234
445
|
}[]): AccountMeta[];
|
|
446
|
+
export interface InstantWithdrawArgs {
|
|
447
|
+
user: PublicKey;
|
|
448
|
+
/** GlobalConfig PDA — checked for CFG_FLAG_GLOBAL_PAUSED */
|
|
449
|
+
config: PublicKey;
|
|
450
|
+
stv: PublicKey;
|
|
451
|
+
/** canonical ATA(stv, base_mint) */
|
|
452
|
+
vaultAta: PublicKey;
|
|
453
|
+
/** ATA(user, base_mint) — receives net_base */
|
|
454
|
+
userBaseAta: PublicKey;
|
|
455
|
+
/** ATA(stv.fee_receiver, base_mint) */
|
|
456
|
+
feeReceiverBaseAta: PublicKey;
|
|
457
|
+
/** pinned fee-receiver evX ATA — settle_fees mints fee shares here */
|
|
458
|
+
feeReceiverEvAta: PublicKey;
|
|
459
|
+
baseMint: PublicKey;
|
|
460
|
+
evMint: PublicKey;
|
|
461
|
+
/** source of the user-signed burn — ATA(user, ev_mint) */
|
|
462
|
+
userEvAta: PublicKey;
|
|
463
|
+
tokenProgram: PublicKey;
|
|
464
|
+
/** evX shares to redeem */
|
|
465
|
+
shares: BN | number;
|
|
466
|
+
/** minimum net base out (slippage floor) — must be > 0 */
|
|
467
|
+
minBaseOut: BN | number;
|
|
468
|
+
/** number of protocol AUM accounts after the 4 fixed lend accounts (0 = none) */
|
|
469
|
+
protocolAumCount?: number;
|
|
470
|
+
/** number of auto-unroute accounts appended after the lend section (0 = none) */
|
|
471
|
+
autoUnrouteCount?: number;
|
|
472
|
+
/**
|
|
473
|
+
* Trailing accounts after token_program, in order:
|
|
474
|
+
* [4 fixed lend + protocolAumCount][strategy_state, stv_position,
|
|
475
|
+
* strategy_program, strategy_base_ata (only if stv.strategy != 0)][auto_unroute]
|
|
476
|
+
*/
|
|
477
|
+
remainingAccounts?: AccountMeta[];
|
|
478
|
+
}
|
|
479
|
+
export declare function createInstantWithdrawIx(args: InstantWithdrawArgs, programId?: PublicKey): TransactionInstruction;
|
|
480
|
+
export interface SeedStvArgs {
|
|
481
|
+
/** config.admin; pays escrow-ATA rent */
|
|
482
|
+
admin: PublicKey;
|
|
483
|
+
config: PublicKey;
|
|
484
|
+
stv: PublicKey;
|
|
485
|
+
evMint: PublicKey;
|
|
486
|
+
/** canonical ATA(stv_pda, ev_mint) — created idempotently */
|
|
487
|
+
escrowEvAta: PublicKey;
|
|
488
|
+
/** canonical ATA(stv_pda, base_mint) */
|
|
489
|
+
vaultAta: PublicKey;
|
|
490
|
+
/** ATA(admin, base_mint) — source of the seed base */
|
|
491
|
+
adminBaseAta: PublicKey;
|
|
492
|
+
baseMint: PublicKey;
|
|
493
|
+
tokenProgram: PublicKey;
|
|
494
|
+
ataProgram?: PublicKey;
|
|
495
|
+
systemProgram?: PublicKey;
|
|
496
|
+
/** base to seed; with any pre-donated base, sets the minted seed-share floor */
|
|
497
|
+
amount: BN | number;
|
|
498
|
+
}
|
|
499
|
+
export declare function createSeedStvIx(args: SeedStvArgs, programId?: PublicKey): TransactionInstruction;
|
|
500
|
+
export interface MigrateStvLayoutArgs {
|
|
501
|
+
/** Must match GlobalConfig.admin. */
|
|
502
|
+
admin: PublicKey;
|
|
503
|
+
/** GlobalConfig PDA. */
|
|
504
|
+
config: PublicKey;
|
|
505
|
+
/** The v1-shaped STV account to migrate (writable). */
|
|
506
|
+
stv: PublicKey;
|
|
507
|
+
/**
|
|
508
|
+
* Expected vault_id from the v1 account (guards against passing the wrong STV
|
|
509
|
+
* for a given arg set — the handler hard-reverts on mismatch).
|
|
510
|
+
*/
|
|
511
|
+
expectedVaultId: BN | number;
|
|
512
|
+
/**
|
|
513
|
+
* Expected withdrawal_mode byte at the v1 offset (416). The handler validates
|
|
514
|
+
* this before the shuffle. Guards against stale ops scripts.
|
|
515
|
+
*/
|
|
516
|
+
expectedOldWithdrawalMode: number;
|
|
517
|
+
/**
|
|
518
|
+
* Optional withdrawal_mode backfill. When provided, the handler applies
|
|
519
|
+
* queue-empty guards and instant-mode restrictions before writing the new mode
|
|
520
|
+
* at the v2 offset (464). When undefined/omitted, the shuffled v1 byte is preserved.
|
|
521
|
+
*
|
|
522
|
+
* Values: 0=instant, 1=X, 2=X+1.
|
|
523
|
+
*/
|
|
524
|
+
newWithdrawalMode?: number;
|
|
525
|
+
}
|
|
526
|
+
export declare function createMigrateStvLayoutIx(args: MigrateStvLayoutArgs, programId?: PublicKey): TransactionInstruction;
|
|
527
|
+
export interface AcceptVaultAdminArgs {
|
|
528
|
+
/** Must equal stv.pending_admin on-chain. Signer proves the new key is live. */
|
|
529
|
+
pendingAdmin: PublicKey;
|
|
530
|
+
/** STV account (writable). */
|
|
531
|
+
stv: PublicKey;
|
|
532
|
+
}
|
|
533
|
+
export declare function createAcceptVaultAdminIx(args: AcceptVaultAdminArgs, programId?: PublicKey): TransactionInstruction;
|