@elemental-stv-core/sdk 0.9.2 → 0.11.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 +40 -4
- package/dist/p-stv-core/accounts.js +97 -4
- package/dist/p-stv-core/constants.d.ts +39 -3
- package/dist/p-stv-core/constants.js +42 -4
- package/dist/p-stv-core/events.js +50 -7
- package/dist/p-stv-core/instructions.d.ts +245 -2
- package/dist/p-stv-core/instructions.js +226 -13
- 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 +78 -1
- package/package.json +1 -1
|
@@ -7,14 +7,20 @@ exports.createRequestWithdrawIx = createRequestWithdrawIx;
|
|
|
7
7
|
exports.createClaimWithdrawIx = createClaimWithdrawIx;
|
|
8
8
|
exports.createOverrideClaimWithdrawIx = createOverrideClaimWithdrawIx;
|
|
9
9
|
exports.createProcessEpochIx = createProcessEpochIx;
|
|
10
|
+
exports.createProcessDelayedDepositIx = createProcessDelayedDepositIx;
|
|
10
11
|
exports.createDepositToStrategyIx = createDepositToStrategyIx;
|
|
11
12
|
exports.createWithdrawFromStrategyIx = createWithdrawFromStrategyIx;
|
|
12
13
|
exports.createCloseStvIx = createCloseStvIx;
|
|
13
14
|
exports.createAddManagerIx = createAddManagerIx;
|
|
14
15
|
exports.createRemoveManagerIx = createRemoveManagerIx;
|
|
15
16
|
exports.createMigrateLendIx = createMigrateLendIx;
|
|
17
|
+
exports.createMigrateRequestIx = createMigrateRequestIx;
|
|
18
|
+
exports.createMigrateExecuteIx = createMigrateExecuteIx;
|
|
16
19
|
exports.buildLendRemainingAccounts = buildLendRemainingAccounts;
|
|
20
|
+
exports.buildMigrateRemainingAccounts = buildMigrateRemainingAccounts;
|
|
17
21
|
exports.buildStrategyRemainingAccounts = buildStrategyRemainingAccounts;
|
|
22
|
+
exports.createInstantWithdrawIx = createInstantWithdrawIx;
|
|
23
|
+
exports.createSeedStvIx = createSeedStvIx;
|
|
18
24
|
const web3_js_1 = require("@solana/web3.js");
|
|
19
25
|
const spl_token_1 = require("@solana/spl-token");
|
|
20
26
|
const buffer_1 = require("../common/buffer");
|
|
@@ -36,7 +42,7 @@ function createInitOrUpdateConfigIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
36
42
|
});
|
|
37
43
|
}
|
|
38
44
|
function createInitOrUpdateStvIx(args, programId = constants_1.PROGRAM_ID) {
|
|
39
|
-
const { admin, payer, config, stv, evMint, baseMint, vaultAta, tokenProgram, ataProgram = spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, systemProgram = web3_js_1.SystemProgram.programId, vaultId, stvBump, evMintBump, feeReceiver, strategy, epochSec, mgmtFeeBps, perfFeeBps, vaultCapacity, minDeposit, flags, addStrategy, removeStrategy, lendProgram, dailyWithdrawLimitBps, remainingAccounts = [], } = args;
|
|
45
|
+
const { admin, payer, config, stv, evMint, baseMint, vaultAta, feeReceiverEvAta, tokenProgram, ataProgram = spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, systemProgram = web3_js_1.SystemProgram.programId, vaultId, stvBump, evMintBump, feeReceiver, strategy, epochSec, mgmtFeeBps, perfFeeBps, vaultCapacity, minDeposit, flags, addStrategy, removeStrategy, lendProgram, dailyWithdrawLimitBps, depositFeeBps, withdrawalFeeBps, withdrawalMode, remainingAccounts = [], } = args;
|
|
40
46
|
const data = [constants_1.IX_INIT_OR_UPDATE_STV];
|
|
41
47
|
(0, buffer_1.writeU64)(data, vaultId);
|
|
42
48
|
data.push(stvBump & 0xff);
|
|
@@ -53,6 +59,12 @@ function createInitOrUpdateStvIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
53
59
|
(0, buffer_1.writeOptionalPubkey)(data, removeStrategy);
|
|
54
60
|
(0, buffer_1.writeOptionalPubkey)(data, lendProgram);
|
|
55
61
|
(0, buffer_1.writeOptionalU16)(data, dailyWithdrawLimitBps);
|
|
62
|
+
(0, buffer_1.writeOptionalU16)(data, depositFeeBps);
|
|
63
|
+
(0, buffer_1.writeOptionalU16)(data, withdrawalFeeBps);
|
|
64
|
+
if (withdrawalMode != null && (withdrawalMode < 0 || withdrawalMode > 2)) {
|
|
65
|
+
throw new Error(`withdrawalMode must be 0 (instant), 1 (X) or 2 (X+1); got ${withdrawalMode}`);
|
|
66
|
+
}
|
|
67
|
+
(0, buffer_1.writeOptionalU8)(data, withdrawalMode);
|
|
56
68
|
return new web3_js_1.TransactionInstruction({
|
|
57
69
|
keys: [
|
|
58
70
|
{ pubkey: admin, isSigner: true, isWritable: false },
|
|
@@ -62,6 +74,7 @@ function createInitOrUpdateStvIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
62
74
|
{ pubkey: evMint, isSigner: false, isWritable: true },
|
|
63
75
|
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
64
76
|
{ pubkey: vaultAta, isSigner: false, isWritable: true },
|
|
77
|
+
{ pubkey: feeReceiverEvAta, isSigner: false, isWritable: false },
|
|
65
78
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
66
79
|
{ pubkey: ataProgram, isSigner: false, isWritable: false },
|
|
67
80
|
{ pubkey: systemProgram, isSigner: false, isWritable: false },
|
|
@@ -72,12 +85,24 @@ function createInitOrUpdateStvIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
72
85
|
});
|
|
73
86
|
}
|
|
74
87
|
function createDepositIx(args, programId = constants_1.PROGRAM_ID) {
|
|
75
|
-
const { user, config, stv, vaultAta, userBaseAta, userEvAta, evMint, feeReceiverEvAta, baseMint, tokenProgram, amount, minShares, protocolAumCount = 0, autoRouteCount = 0, remainingAccounts = [], } = args;
|
|
88
|
+
const { user, config, stv, vaultAta, userBaseAta, userEvAta, evMint, feeReceiverEvAta, baseMint, tokenProgram, amount, minShares, protocolAumCount = 0, autoRouteCount = 0, delayedDepositRequest, delayedDepositBump, systemProgram = web3_js_1.SystemProgram.programId, remainingAccounts = [], } = args;
|
|
76
89
|
const data = [constants_1.IX_DEPOSIT];
|
|
77
90
|
(0, buffer_1.writeU64)(data, amount);
|
|
78
91
|
(0, buffer_1.writeU64)(data, minShares);
|
|
79
92
|
data.push(protocolAumCount & 0xff);
|
|
80
93
|
data.push(autoRouteCount & 0xff);
|
|
94
|
+
if (delayedDepositRequest) {
|
|
95
|
+
if (delayedDepositBump == null) {
|
|
96
|
+
throw new Error("delayedDepositBump is required when delayedDepositRequest is provided");
|
|
97
|
+
}
|
|
98
|
+
data.push(delayedDepositBump & 0xff);
|
|
99
|
+
}
|
|
100
|
+
const delayedAccounts = delayedDepositRequest
|
|
101
|
+
? [
|
|
102
|
+
{ pubkey: delayedDepositRequest, isSigner: false, isWritable: true },
|
|
103
|
+
{ pubkey: systemProgram, isSigner: false, isWritable: false },
|
|
104
|
+
]
|
|
105
|
+
: [];
|
|
81
106
|
return new web3_js_1.TransactionInstruction({
|
|
82
107
|
keys: [
|
|
83
108
|
{ pubkey: user, isSigner: true, isWritable: true },
|
|
@@ -90,6 +115,7 @@ function createDepositIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
90
115
|
{ pubkey: feeReceiverEvAta, isSigner: false, isWritable: true },
|
|
91
116
|
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
92
117
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
118
|
+
...delayedAccounts,
|
|
93
119
|
...remainingAccounts,
|
|
94
120
|
],
|
|
95
121
|
programId,
|
|
@@ -118,11 +144,10 @@ function createRequestWithdrawIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
118
144
|
});
|
|
119
145
|
}
|
|
120
146
|
function createClaimWithdrawIx(args, programId = constants_1.PROGRAM_ID) {
|
|
121
|
-
const { user, config, stv, withdrawRequest, vaultAta, userBaseAta, baseMint, tokenProgram, remainingAccounts = [], autoUnrouteCount = 0, } = args;
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
const data = Buffer.from([constants_1.IX_CLAIM_WITHDRAW, autoUnrouteCount & 0xff]);
|
|
147
|
+
const { user, config, stv, withdrawRequest, vaultAta, userBaseAta, feeReceiverBaseAta, baseMint, tokenProgram, remainingAccounts = [], autoUnrouteCount = 0, protocolAumCount = 0, } = args;
|
|
148
|
+
// Data: auto_unroute_count(1) + protocol_aum_count(1). Both always serialized —
|
|
149
|
+
// the on-chain handler reads data[0] and data[1].
|
|
150
|
+
const data = Buffer.from([constants_1.IX_CLAIM_WITHDRAW, autoUnrouteCount & 0xff, protocolAumCount & 0xff]);
|
|
126
151
|
return new web3_js_1.TransactionInstruction({
|
|
127
152
|
keys: [
|
|
128
153
|
{ pubkey: user, isSigner: true, isWritable: true },
|
|
@@ -131,6 +156,7 @@ function createClaimWithdrawIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
131
156
|
{ pubkey: withdrawRequest, isSigner: false, isWritable: true },
|
|
132
157
|
{ pubkey: vaultAta, isSigner: false, isWritable: true },
|
|
133
158
|
{ pubkey: userBaseAta, isSigner: false, isWritable: true },
|
|
159
|
+
{ pubkey: feeReceiverBaseAta, isSigner: false, isWritable: true },
|
|
134
160
|
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
135
161
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
136
162
|
...remainingAccounts,
|
|
@@ -140,10 +166,10 @@ function createClaimWithdrawIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
140
166
|
});
|
|
141
167
|
}
|
|
142
168
|
function createOverrideClaimWithdrawIx(args, programId = constants_1.PROGRAM_ID) {
|
|
143
|
-
const { manager, managerRole, config, user, stv, withdrawRequest, vaultAta, userBaseAta, baseMint, tokenProgram, remainingAccounts = [], autoUnrouteCount = 0, } = args;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
169
|
+
const { manager, managerRole, config, user, stv, withdrawRequest, vaultAta, userBaseAta, feeReceiverBaseAta, baseMint, tokenProgram, remainingAccounts = [], autoUnrouteCount = 0, protocolAumCount = 0, } = args;
|
|
170
|
+
// Data: auto_unroute_count(1) + protocol_aum_count(1) — protocol_aum_count is data[1],
|
|
171
|
+
// so always serialize both bytes (handler reads data[0]/data[1]).
|
|
172
|
+
const data = Buffer.from([constants_1.IX_OVERRIDE_CLAIM_WITHDRAW, autoUnrouteCount & 0xff, protocolAumCount & 0xff]);
|
|
147
173
|
return new web3_js_1.TransactionInstruction({
|
|
148
174
|
keys: [
|
|
149
175
|
{ pubkey: manager, isSigner: true, isWritable: false },
|
|
@@ -154,6 +180,7 @@ function createOverrideClaimWithdrawIx(args, programId = constants_1.PROGRAM_ID)
|
|
|
154
180
|
{ pubkey: withdrawRequest, isSigner: false, isWritable: true },
|
|
155
181
|
{ pubkey: vaultAta, isSigner: false, isWritable: true },
|
|
156
182
|
{ pubkey: userBaseAta, isSigner: false, isWritable: true },
|
|
183
|
+
{ pubkey: feeReceiverBaseAta, isSigner: false, isWritable: true },
|
|
157
184
|
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
158
185
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
159
186
|
...remainingAccounts,
|
|
@@ -180,6 +207,26 @@ function createProcessEpochIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
180
207
|
data: Buffer.from([constants_1.IX_PROCESS_EPOCH, advanceEpoch ? 1 : 0, protocolAumCount & 0xff]),
|
|
181
208
|
});
|
|
182
209
|
}
|
|
210
|
+
function createProcessDelayedDepositIx(args, programId = constants_1.PROGRAM_ID) {
|
|
211
|
+
const { payer, config, stv, delayedDepositRequest, user, vaultAta, userEvAta, evMint, feeReceiverEvAta, tokenProgram, protocolAumCount = 0, remainingAccounts = [], } = args;
|
|
212
|
+
return new web3_js_1.TransactionInstruction({
|
|
213
|
+
keys: [
|
|
214
|
+
{ pubkey: payer, isSigner: true, isWritable: false },
|
|
215
|
+
{ pubkey: config, isSigner: false, isWritable: false },
|
|
216
|
+
{ pubkey: stv, isSigner: false, isWritable: true },
|
|
217
|
+
{ pubkey: delayedDepositRequest, isSigner: false, isWritable: true },
|
|
218
|
+
{ pubkey: user, isSigner: false, isWritable: true },
|
|
219
|
+
{ pubkey: vaultAta, isSigner: false, isWritable: true },
|
|
220
|
+
{ pubkey: userEvAta, isSigner: false, isWritable: true },
|
|
221
|
+
{ pubkey: evMint, isSigner: false, isWritable: true },
|
|
222
|
+
{ pubkey: feeReceiverEvAta, isSigner: false, isWritable: true },
|
|
223
|
+
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
224
|
+
...remainingAccounts,
|
|
225
|
+
],
|
|
226
|
+
programId,
|
|
227
|
+
data: Buffer.from([constants_1.IX_PROCESS_DELAYED_DEPOSIT, protocolAumCount & 0xff]),
|
|
228
|
+
});
|
|
229
|
+
}
|
|
183
230
|
function createDepositToStrategyIx(args, programId = constants_1.PROGRAM_ID) {
|
|
184
231
|
const { manager, managerRole, config, stv, vaultAta, baseMint, strategyProgram, strategyState, stvPosition, strategyBaseAta, tokenProgram, amount, minShares, protocolAumCount, autoUnrouteCount = 0, remainingAccounts = [], } = args;
|
|
185
232
|
const data = [constants_1.IX_DEPOSIT_TO_STRATEGY];
|
|
@@ -211,9 +258,11 @@ function createDepositToStrategyIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
211
258
|
});
|
|
212
259
|
}
|
|
213
260
|
function createWithdrawFromStrategyIx(args, programId = constants_1.PROGRAM_ID) {
|
|
214
|
-
const { manager, managerRole, config, stv, vaultAta, baseMint, strategyProgram, strategyState, stvPosition, strategyBaseAta, tokenProgram, shares, remainingAccounts = [], } = args;
|
|
261
|
+
const { manager, managerRole, config, stv, vaultAta, baseMint, strategyProgram, strategyState, stvPosition, strategyBaseAta, tokenProgram, shares, protocolAumCount = 0, remainingAccounts = [], } = args;
|
|
262
|
+
// Data: shares(8) + protocol_aum_count(1).
|
|
215
263
|
const data = [constants_1.IX_WITHDRAW_FROM_STRATEGY];
|
|
216
264
|
(0, buffer_1.writeU64)(data, shares);
|
|
265
|
+
data.push(protocolAumCount & 0xff);
|
|
217
266
|
return new web3_js_1.TransactionInstruction({
|
|
218
267
|
keys: [
|
|
219
268
|
{ pubkey: manager, isSigner: true, isWritable: true },
|
|
@@ -280,12 +329,15 @@ function createRemoveManagerIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
280
329
|
});
|
|
281
330
|
}
|
|
282
331
|
function createMigrateLendIx(args, programId = constants_1.PROGRAM_ID) {
|
|
283
|
-
const { admin, payer, config, stv, vaultAta, baseMint, tokenProgram, systemProgram = web3_js_1.SystemProgram.programId, oldLendProgram, newLendProgram, protocolAumCount, autoUnrouteCount, remainingAccounts = [], } = args;
|
|
332
|
+
const { admin, payer, config, stv, vaultAta, baseMint, tokenProgram, systemProgram = web3_js_1.SystemProgram.programId, oldLendProgram, newLendProgram, protocolAumCount, autoUnrouteCount, newProtocolAumCount = 0, remainingAccounts = [], } = args;
|
|
333
|
+
// Data: old_lend(32) + new_lend(32) + protocol_aum_count(1) + auto_unroute_count(1)
|
|
334
|
+
// + new_protocol_aum_count(1).
|
|
284
335
|
const data = [constants_1.IX_MIGRATE_LEND];
|
|
285
336
|
data.push(...oldLendProgram.toBuffer());
|
|
286
337
|
data.push(...newLendProgram.toBuffer());
|
|
287
338
|
data.push(protocolAumCount & 0xff);
|
|
288
339
|
data.push(autoUnrouteCount & 0xff);
|
|
340
|
+
data.push(newProtocolAumCount & 0xff);
|
|
289
341
|
return new web3_js_1.TransactionInstruction({
|
|
290
342
|
keys: [
|
|
291
343
|
{ pubkey: admin, isSigner: true, isWritable: false },
|
|
@@ -302,6 +354,73 @@ function createMigrateLendIx(args, programId = constants_1.PROGRAM_ID) {
|
|
|
302
354
|
data: Buffer.from(data),
|
|
303
355
|
});
|
|
304
356
|
}
|
|
357
|
+
/**
|
|
358
|
+
* Instruction data layout (17 bytes, after the 1-byte disc is stripped by the
|
|
359
|
+
* dispatcher): shares(u64 LE) + wr_bump(u8) + min_dest_shares(u64 LE).
|
|
360
|
+
* Confirmed against migrate_request.rs:53-66.
|
|
361
|
+
*/
|
|
362
|
+
function createMigrateRequestIx(args, programId = constants_1.PROGRAM_ID) {
|
|
363
|
+
const { user, config, sourceStv, destStv, evMint, userEvAta, escrowEvAta, migrateRequest, tokenProgram, systemProgram = web3_js_1.SystemProgram.programId, shares, wrBump, minDestShares, } = args;
|
|
364
|
+
const data = [constants_1.IX_MIGRATE_REQUEST];
|
|
365
|
+
(0, buffer_1.writeU64)(data, shares);
|
|
366
|
+
data.push(wrBump & 0xff);
|
|
367
|
+
(0, buffer_1.writeU64)(data, minDestShares);
|
|
368
|
+
return new web3_js_1.TransactionInstruction({
|
|
369
|
+
keys: [
|
|
370
|
+
{ pubkey: user, isSigner: true, isWritable: true },
|
|
371
|
+
{ pubkey: config, isSigner: false, isWritable: false },
|
|
372
|
+
{ pubkey: sourceStv, isSigner: false, isWritable: true },
|
|
373
|
+
{ pubkey: destStv, isSigner: false, isWritable: false },
|
|
374
|
+
{ pubkey: evMint, isSigner: false, isWritable: false },
|
|
375
|
+
{ pubkey: userEvAta, isSigner: false, isWritable: true },
|
|
376
|
+
{ pubkey: escrowEvAta, isSigner: false, isWritable: true },
|
|
377
|
+
{ pubkey: migrateRequest, isSigner: false, isWritable: true },
|
|
378
|
+
{ pubkey: systemProgram, isSigner: false, isWritable: false },
|
|
379
|
+
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
380
|
+
],
|
|
381
|
+
programId,
|
|
382
|
+
data: Buffer.from(data),
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* 15 fixed accounts confirmed against migrate_execute.rs:87-91 (destructure)
|
|
387
|
+
* and the doc header at lines 29-52. Slot 14 = wrUserAccount (writable; must
|
|
388
|
+
* equal wr.user). Instruction data (4 bytes): src_protocol_aum_count,
|
|
389
|
+
* dst_protocol_aum_count, src_auto_unroute_count, dst_auto_route_count
|
|
390
|
+
* (migrate_execute.rs:94-100).
|
|
391
|
+
*/
|
|
392
|
+
function createMigrateExecuteIx(args, programId = constants_1.PROGRAM_ID) {
|
|
393
|
+
const { manager, managerRole, config, sourceStv, destStv, wrAccount, sourceVaultAta, destVaultAta, destEvMint, userDestEvAta, sourceFeeRecvAta, destFeeRecvEvAta, baseMint, tokenProgram, wrUserAccount, srcProtocolAumCount, dstProtocolAumCount, srcAutoUnrouteCount, dstAutoRouteCount, remainingAccounts = [], } = args;
|
|
394
|
+
const data = Buffer.from([
|
|
395
|
+
constants_1.IX_MIGRATE_EXECUTE,
|
|
396
|
+
srcProtocolAumCount & 0xff,
|
|
397
|
+
dstProtocolAumCount & 0xff,
|
|
398
|
+
srcAutoUnrouteCount & 0xff,
|
|
399
|
+
dstAutoRouteCount & 0xff,
|
|
400
|
+
]);
|
|
401
|
+
return new web3_js_1.TransactionInstruction({
|
|
402
|
+
keys: [
|
|
403
|
+
{ pubkey: manager, isSigner: true, isWritable: false },
|
|
404
|
+
{ pubkey: managerRole, isSigner: false, isWritable: false },
|
|
405
|
+
{ pubkey: config, isSigner: false, isWritable: false },
|
|
406
|
+
{ pubkey: sourceStv, isSigner: false, isWritable: true },
|
|
407
|
+
{ pubkey: destStv, isSigner: false, isWritable: true },
|
|
408
|
+
{ pubkey: wrAccount, isSigner: false, isWritable: true },
|
|
409
|
+
{ pubkey: sourceVaultAta, isSigner: false, isWritable: true },
|
|
410
|
+
{ pubkey: destVaultAta, isSigner: false, isWritable: true },
|
|
411
|
+
{ pubkey: destEvMint, isSigner: false, isWritable: true },
|
|
412
|
+
{ pubkey: userDestEvAta, isSigner: false, isWritable: true },
|
|
413
|
+
{ pubkey: sourceFeeRecvAta, isSigner: false, isWritable: true },
|
|
414
|
+
{ pubkey: destFeeRecvEvAta, isSigner: false, isWritable: true },
|
|
415
|
+
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
416
|
+
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
417
|
+
{ pubkey: wrUserAccount, isSigner: false, isWritable: true },
|
|
418
|
+
...remainingAccounts,
|
|
419
|
+
],
|
|
420
|
+
programId,
|
|
421
|
+
data,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
305
424
|
// ---------------------------------------------------------------------------
|
|
306
425
|
// Remaining Accounts Helpers
|
|
307
426
|
// ---------------------------------------------------------------------------
|
|
@@ -313,6 +432,50 @@ function buildLendRemainingAccounts(lend) {
|
|
|
313
432
|
{ pubkey: lend.lendBaseAta, isSigner: false, isWritable: true },
|
|
314
433
|
];
|
|
315
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Assemble the migrate_execute remaining_accounts in the exact order
|
|
437
|
+
* parse_lend_accounts expects (migrate_execute.rs:298-338):
|
|
438
|
+
*
|
|
439
|
+
* [ source-lend section ] src.lend(4 fixed) + src.protocolAum(P_src)
|
|
440
|
+
* [ source auto-unroute ] src.autoUnroute (U accounts)
|
|
441
|
+
* [ dest-lend section ] dst.lend(4 fixed) + dst.protocolAum(P_dst)
|
|
442
|
+
* [ dest strategy + route] dst.strategy(0 or 2) + dst.autoRoute (R accounts)
|
|
443
|
+
*
|
|
444
|
+
* Pass `undefined` for a `lend` side whose STV has no lend_program (the 4
|
|
445
|
+
* fixed accounts + protocol AUM are omitted, matching the early return in
|
|
446
|
+
* parse_lend_accounts when lend_program_key == default).
|
|
447
|
+
*
|
|
448
|
+
* The 4 fixed lend accounts mirror `buildLendRemainingAccounts`:
|
|
449
|
+
* [lendProgram(ro), lendStrategyState(w), lendStvPosition(w), lendBaseAta(w)]
|
|
450
|
+
* `protocolAum` / `autoUnroute` / `autoRoute` / `strategy` accounts are passed
|
|
451
|
+
* through verbatim; the caller sets their writable flags per protocol.
|
|
452
|
+
*/
|
|
453
|
+
function buildMigrateRemainingAccounts(opts) {
|
|
454
|
+
const out = [];
|
|
455
|
+
// ---- source-lend section ----
|
|
456
|
+
if (opts.source.lend) {
|
|
457
|
+
out.push(...buildLendRemainingAccounts(opts.source.lend));
|
|
458
|
+
if (opts.source.protocolAum)
|
|
459
|
+
out.push(...opts.source.protocolAum);
|
|
460
|
+
}
|
|
461
|
+
// ---- source auto-unroute ----
|
|
462
|
+
if (opts.source.autoUnroute)
|
|
463
|
+
out.push(...opts.source.autoUnroute);
|
|
464
|
+
// ---- dest-lend section ----
|
|
465
|
+
if (opts.dest.lend) {
|
|
466
|
+
out.push(...buildLendRemainingAccounts(opts.dest.lend));
|
|
467
|
+
if (opts.dest.protocolAum)
|
|
468
|
+
out.push(...opts.dest.protocolAum);
|
|
469
|
+
}
|
|
470
|
+
// ---- dest strategy pair (writable state, read-only position) ----
|
|
471
|
+
if (opts.dest.strategy) {
|
|
472
|
+
out.push({ pubkey: opts.dest.strategy.strategyState, isSigner: false, isWritable: true }, { pubkey: opts.dest.strategy.stvPosition, isSigner: false, isWritable: false });
|
|
473
|
+
}
|
|
474
|
+
// ---- dest auto-route ----
|
|
475
|
+
if (opts.dest.autoRoute)
|
|
476
|
+
out.push(...opts.dest.autoRoute);
|
|
477
|
+
return out;
|
|
478
|
+
}
|
|
316
479
|
function buildStrategyRemainingAccounts(strategies) {
|
|
317
480
|
const accounts = [];
|
|
318
481
|
for (const s of strategies) {
|
|
@@ -320,3 +483,53 @@ function buildStrategyRemainingAccounts(strategies) {
|
|
|
320
483
|
}
|
|
321
484
|
return accounts;
|
|
322
485
|
}
|
|
486
|
+
function createInstantWithdrawIx(args, programId = constants_1.PROGRAM_ID) {
|
|
487
|
+
const { user, config, stv, vaultAta, userBaseAta, feeReceiverBaseAta, feeReceiverEvAta, baseMint, evMint, userEvAta, tokenProgram, shares, minBaseOut, protocolAumCount = 0, autoUnrouteCount = 0, remainingAccounts = [], } = args;
|
|
488
|
+
// Data: shares(8) + min_base_out(8) + protocol_aum_count(1) + auto_unroute_count(1) = 18.
|
|
489
|
+
const data = [constants_1.IX_INSTANT_WITHDRAW];
|
|
490
|
+
(0, buffer_1.writeU64)(data, shares);
|
|
491
|
+
(0, buffer_1.writeU64)(data, minBaseOut);
|
|
492
|
+
data.push(protocolAumCount & 0xff);
|
|
493
|
+
data.push(autoUnrouteCount & 0xff);
|
|
494
|
+
return new web3_js_1.TransactionInstruction({
|
|
495
|
+
keys: [
|
|
496
|
+
{ pubkey: user, isSigner: true, isWritable: true },
|
|
497
|
+
{ pubkey: config, isSigner: false, isWritable: false },
|
|
498
|
+
{ pubkey: stv, isSigner: false, isWritable: true },
|
|
499
|
+
{ pubkey: vaultAta, isSigner: false, isWritable: true },
|
|
500
|
+
{ pubkey: userBaseAta, isSigner: false, isWritable: true },
|
|
501
|
+
{ pubkey: feeReceiverBaseAta, isSigner: false, isWritable: true },
|
|
502
|
+
{ pubkey: feeReceiverEvAta, isSigner: false, isWritable: true },
|
|
503
|
+
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
504
|
+
{ pubkey: evMint, isSigner: false, isWritable: true },
|
|
505
|
+
{ pubkey: userEvAta, isSigner: false, isWritable: true },
|
|
506
|
+
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
507
|
+
...remainingAccounts,
|
|
508
|
+
],
|
|
509
|
+
programId,
|
|
510
|
+
data: Buffer.from(data),
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
function createSeedStvIx(args, programId = constants_1.PROGRAM_ID) {
|
|
514
|
+
const { admin, config, stv, evMint, escrowEvAta, vaultAta, adminBaseAta, baseMint, tokenProgram, ataProgram = spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, systemProgram = web3_js_1.SystemProgram.programId, amount, } = args;
|
|
515
|
+
// Data: amount(8).
|
|
516
|
+
const data = [constants_1.IX_SEED_STV];
|
|
517
|
+
(0, buffer_1.writeU64)(data, amount);
|
|
518
|
+
return new web3_js_1.TransactionInstruction({
|
|
519
|
+
keys: [
|
|
520
|
+
{ pubkey: admin, isSigner: true, isWritable: true },
|
|
521
|
+
{ pubkey: config, isSigner: false, isWritable: false },
|
|
522
|
+
{ pubkey: stv, isSigner: false, isWritable: true },
|
|
523
|
+
{ pubkey: evMint, isSigner: false, isWritable: true },
|
|
524
|
+
{ pubkey: escrowEvAta, isSigner: false, isWritable: true },
|
|
525
|
+
{ pubkey: vaultAta, isSigner: false, isWritable: true },
|
|
526
|
+
{ pubkey: adminBaseAta, isSigner: false, isWritable: true },
|
|
527
|
+
{ pubkey: baseMint, isSigner: false, isWritable: false },
|
|
528
|
+
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
529
|
+
{ pubkey: ataProgram, isSigner: false, isWritable: false },
|
|
530
|
+
{ pubkey: systemProgram, isSigner: false, isWritable: false },
|
|
531
|
+
],
|
|
532
|
+
programId,
|
|
533
|
+
data: Buffer.from(data),
|
|
534
|
+
});
|
|
535
|
+
}
|
package/dist/p-stv-core/pda.d.ts
CHANGED
|
@@ -4,6 +4,21 @@ export declare function findConfigPda(programId?: PublicKey): [PublicKey, number
|
|
|
4
4
|
export declare function findStvPda(vaultId: number | BN, programId?: PublicKey): [PublicKey, number];
|
|
5
5
|
export declare function findEvMintPda(vaultId: number | BN, programId?: PublicKey): [PublicKey, number];
|
|
6
6
|
export declare function findWithdrawRequestPda(stv: PublicKey, user: PublicKey, epochId: number, programId?: PublicKey): [PublicKey, number];
|
|
7
|
+
/**
|
|
8
|
+
* Derive the migrate-kind WithdrawRequest PDA.
|
|
9
|
+
* Seeds: `["migrate_request", stv, user, epoch_id_le4]`.
|
|
10
|
+
*
|
|
11
|
+
* Distinct prefix from `findWithdrawRequestPda` so a user can hold both a
|
|
12
|
+
* withdraw and a migrate request for the same (stv, user, epoch) without
|
|
13
|
+
* a PDA collision. `stv` is the SOURCE STV; `epochId` is the source STV's
|
|
14
|
+
* `currentEpochId` at request time.
|
|
15
|
+
*/
|
|
16
|
+
export declare function findMigrateRequestPda(stv: PublicKey, user: PublicKey, epochId: number, programId?: PublicKey): [PublicKey, number];
|
|
17
|
+
/**
|
|
18
|
+
* Derive the per-user delayed deposit request PDA.
|
|
19
|
+
* Seeds: `["delayed_deposit", stv, user, epoch_id_le4]`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function findDelayedDepositRequestPda(stv: PublicKey, user: PublicKey, epochId: number, programId?: PublicKey): [PublicKey, number];
|
|
7
22
|
/**
|
|
8
23
|
* Derive the per-STV `ManagerRole` PDA for p-STV Core.
|
|
9
24
|
* Seeds: `["manager", stv, manager]`.
|
package/dist/p-stv-core/pda.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.findConfigPda = findConfigPda;
|
|
|
7
7
|
exports.findStvPda = findStvPda;
|
|
8
8
|
exports.findEvMintPda = findEvMintPda;
|
|
9
9
|
exports.findWithdrawRequestPda = findWithdrawRequestPda;
|
|
10
|
+
exports.findMigrateRequestPda = findMigrateRequestPda;
|
|
11
|
+
exports.findDelayedDepositRequestPda = findDelayedDepositRequestPda;
|
|
10
12
|
exports.findStvManagerRolePda = findStvManagerRolePda;
|
|
11
13
|
const web3_js_1 = require("@solana/web3.js");
|
|
12
14
|
const bn_js_1 = __importDefault(require("bn.js"));
|
|
@@ -27,6 +29,29 @@ function findWithdrawRequestPda(stv, user, epochId, programId = constants_1.PROG
|
|
|
27
29
|
epochBuf.writeUInt32LE(epochId, 0);
|
|
28
30
|
return web3_js_1.PublicKey.findProgramAddressSync([constants_1.WITHDRAW_REQUEST_SEED, stv.toBuffer(), user.toBuffer(), epochBuf], programId);
|
|
29
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Derive the migrate-kind WithdrawRequest PDA.
|
|
34
|
+
* Seeds: `["migrate_request", stv, user, epoch_id_le4]`.
|
|
35
|
+
*
|
|
36
|
+
* Distinct prefix from `findWithdrawRequestPda` so a user can hold both a
|
|
37
|
+
* withdraw and a migrate request for the same (stv, user, epoch) without
|
|
38
|
+
* a PDA collision. `stv` is the SOURCE STV; `epochId` is the source STV's
|
|
39
|
+
* `currentEpochId` at request time.
|
|
40
|
+
*/
|
|
41
|
+
function findMigrateRequestPda(stv, user, epochId, programId = constants_1.PROGRAM_ID) {
|
|
42
|
+
const epochBuf = Buffer.alloc(4);
|
|
43
|
+
epochBuf.writeUInt32LE(epochId, 0);
|
|
44
|
+
return web3_js_1.PublicKey.findProgramAddressSync([constants_1.MIGRATE_REQUEST_SEED, stv.toBuffer(), user.toBuffer(), epochBuf], programId);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Derive the per-user delayed deposit request PDA.
|
|
48
|
+
* Seeds: `["delayed_deposit", stv, user, epoch_id_le4]`.
|
|
49
|
+
*/
|
|
50
|
+
function findDelayedDepositRequestPda(stv, user, epochId, programId = constants_1.PROGRAM_ID) {
|
|
51
|
+
const epochBuf = Buffer.alloc(4);
|
|
52
|
+
epochBuf.writeUInt32LE(epochId, 0);
|
|
53
|
+
return web3_js_1.PublicKey.findProgramAddressSync([constants_1.DELAYED_DEPOSIT_SEED, stv.toBuffer(), user.toBuffer(), epochBuf], programId);
|
|
54
|
+
}
|
|
30
55
|
/**
|
|
31
56
|
* Derive the per-STV `ManagerRole` PDA for p-STV Core.
|
|
32
57
|
* Seeds: `["manager", stv, manager]`.
|
|
@@ -29,6 +29,9 @@ export interface DepositContext {
|
|
|
29
29
|
export interface ClaimWithdrawContext {
|
|
30
30
|
remainingAccounts: AccountMeta[];
|
|
31
31
|
autoUnrouteCount: number;
|
|
32
|
+
/** Protocol-AUM accounts placed between the 4 fixed lend accounts and auto-unroute,
|
|
33
|
+
* feeding the pre-unsweep update_aum refresh. Pass to createClaimWithdrawIx.protocolAumCount. */
|
|
34
|
+
protocolAumCount: number;
|
|
32
35
|
/**
|
|
33
36
|
* Pre-instructions to add before the claim_withdraw ix.
|
|
34
37
|
* Currently always empty — see DepositContext.preInstructions.
|
|
@@ -72,7 +75,7 @@ export declare function buildDepositContext(connection: SolanaConnection, vault:
|
|
|
72
75
|
* - If lend is active, derives lend PDAs
|
|
73
76
|
* - If USDC + Jupiter Lend, appends auto-unroute accounts
|
|
74
77
|
*/
|
|
75
|
-
export declare function buildClaimWithdrawContext(vault: VaultInfo): Promise<ClaimWithdrawContext>;
|
|
78
|
+
export declare function buildClaimWithdrawContext(connection: SolanaConnection, vault: VaultInfo): Promise<ClaimWithdrawContext>;
|
|
76
79
|
/**
|
|
77
80
|
* Build the complete remaining_accounts for a deposit_to_strategy instruction.
|
|
78
81
|
*
|
|
@@ -144,13 +144,28 @@ async function buildDepositContext(connection, vault, payer) {
|
|
|
144
144
|
* - If lend is active, derives lend PDAs
|
|
145
145
|
* - If USDC + Jupiter Lend, appends auto-unroute accounts
|
|
146
146
|
*/
|
|
147
|
-
async function buildClaimWithdrawContext(vault) {
|
|
147
|
+
async function buildClaimWithdrawContext(connection, vault) {
|
|
148
148
|
const remainingAccounts = [];
|
|
149
149
|
const preInstructions = [];
|
|
150
150
|
let autoUnrouteCount = 0;
|
|
151
|
+
let protocolAumCount = 0;
|
|
151
152
|
if (!isDefault(vault.lendProgram)) {
|
|
152
153
|
const { accounts: lendAccounts, lendStrategyState } = buildFixedLendAccounts(vault.lendProgram, vault.baseMint, vault.address);
|
|
153
154
|
remainingAccounts.push(...lendAccounts);
|
|
155
|
+
// Protocol-AUM accounts (between fixed lend and auto-unroute) — feed the
|
|
156
|
+
// pre-unsweep update_aum refresh. The on-chain lend update_aum rejects an
|
|
157
|
+
// incomplete tail, so these MUST cover the strategy's full protocol set.
|
|
158
|
+
const lendState = await (0, accounts_1.fetchLendStrategyState)(connection, vault.baseMint, vault.lendProgram).catch(() => null);
|
|
159
|
+
if (lendState) {
|
|
160
|
+
try {
|
|
161
|
+
const protocolAccounts = await (0, accounts_1.buildProtocolAccountsForAum)(connection, lendState, lendStrategyState, TOKEN_PROGRAM);
|
|
162
|
+
protocolAumCount = protocolAccounts.length;
|
|
163
|
+
remainingAccounts.push(...protocolAccounts);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
// Skip protocol accounts if resolution fails (no-protocol lend → 0).
|
|
167
|
+
}
|
|
168
|
+
}
|
|
154
169
|
// Auto-unroute from Jupiter Lend (for any asset with a configured pool)
|
|
155
170
|
const jupPoolForUnroute = jupiter_lend_1.JUP_LEND_POOLS[vault.baseMint.toBase58()];
|
|
156
171
|
if (jupPoolForUnroute) {
|
|
@@ -166,7 +181,7 @@ async function buildClaimWithdrawContext(vault) {
|
|
|
166
181
|
}
|
|
167
182
|
}
|
|
168
183
|
}
|
|
169
|
-
return { remainingAccounts, autoUnrouteCount, preInstructions };
|
|
184
|
+
return { remainingAccounts, autoUnrouteCount, protocolAumCount, preInstructions };
|
|
170
185
|
}
|
|
171
186
|
/**
|
|
172
187
|
* Build the complete remaining_accounts for a deposit_to_strategy instruction.
|
|
@@ -12,7 +12,11 @@ export interface Stv {
|
|
|
12
12
|
evMint: PublicKey;
|
|
13
13
|
strategy: PublicKey;
|
|
14
14
|
feeReceiver: PublicKey;
|
|
15
|
+
/** Pinned canonical ATA for feeReceiver + evMint. */
|
|
16
|
+
feeReceiverEvAta: PublicKey;
|
|
15
17
|
lendProgram: PublicKey;
|
|
18
|
+
/** Canonical ATA for (stv_pda, base_mint, token_program). Set at init. */
|
|
19
|
+
vaultAta: PublicKey;
|
|
16
20
|
childVaults: BN[];
|
|
17
21
|
vaultId: BN;
|
|
18
22
|
reservedBase: BN;
|
|
@@ -38,6 +42,18 @@ export interface Stv {
|
|
|
38
42
|
childVaultCount: number;
|
|
39
43
|
version: number;
|
|
40
44
|
bump: number;
|
|
45
|
+
/** Fee (BPS) charged on migrate-in when FLAG_DEPOSIT_FEE_ON_MIGRATE is set. Max MAX_FEE_BPS. */
|
|
46
|
+
depositFeeBps: number;
|
|
47
|
+
/** Fee (BPS) charged on migrate-out when FLAG_WITHDRAWAL_FEE_ON_MIGRATE is set. Max MAX_FEE_BPS. */
|
|
48
|
+
withdrawalFeeBps: number;
|
|
49
|
+
/** Gross base from delayed deposits not yet minted into evX. */
|
|
50
|
+
pendingDepositBase: BN;
|
|
51
|
+
/** Number of open DelayedDepositRequest accounts. */
|
|
52
|
+
pendingDepositCount: number;
|
|
53
|
+
/** C-1 supply floor (seed shares) — set by seed_stv, redeemed only via close_stv. */
|
|
54
|
+
lockedSeedShares: BN;
|
|
55
|
+
/** Withdrawal mode: 0=instant, 1=X, 2=X+1. Create-only/immutable. */
|
|
56
|
+
withdrawalMode: number;
|
|
41
57
|
}
|
|
42
58
|
export interface ManagerRole {
|
|
43
59
|
stv: PublicKey;
|
|
@@ -52,6 +68,20 @@ export interface WithdrawRequest {
|
|
|
52
68
|
epochId: number;
|
|
53
69
|
claimAvailableAfter: number;
|
|
54
70
|
bump: number;
|
|
71
|
+
/** Request kind flags. bit0 (WR_FLAG_MIGRATE): 0 = withdraw, 1 = migrate. */
|
|
72
|
+
requestFlags: number;
|
|
73
|
+
/** Migrate kind: destination STV vault_id. Withdraw kind: 0. */
|
|
74
|
+
destVaultId: BN;
|
|
75
|
+
/** Migrate kind: minimum dest shares (slippage protection). Withdraw kind: 0. */
|
|
76
|
+
minDestShares: BN;
|
|
77
|
+
}
|
|
78
|
+
export interface DelayedDepositRequest {
|
|
79
|
+
stv: PublicKey;
|
|
80
|
+
user: PublicKey;
|
|
81
|
+
amount: BN;
|
|
82
|
+
epochId: number;
|
|
83
|
+
bump: number;
|
|
84
|
+
version: number;
|
|
55
85
|
}
|
|
56
86
|
export interface ConfigInitializedEvent {
|
|
57
87
|
name: "ConfigInitialized";
|
|
@@ -92,6 +122,8 @@ export interface DepositedEvent {
|
|
|
92
122
|
user: PublicKey;
|
|
93
123
|
amount: BN;
|
|
94
124
|
sharesMinted: BN;
|
|
125
|
+
/** Fee shares credited to fee receiver (new field; on-chain offset 57). */
|
|
126
|
+
depositFeeShares: BN;
|
|
95
127
|
pps: BN;
|
|
96
128
|
}
|
|
97
129
|
export interface WithdrawRequestedEvent {
|
|
@@ -115,6 +147,7 @@ export interface WithdrawClaimedEvent {
|
|
|
115
147
|
user: PublicKey;
|
|
116
148
|
shares: BN;
|
|
117
149
|
baseAmount: BN;
|
|
150
|
+
withdrawalFeeBase: BN;
|
|
118
151
|
epochId: number;
|
|
119
152
|
}
|
|
120
153
|
export interface DepositedToStrategyEvent {
|
|
@@ -174,6 +207,7 @@ export interface WithdrawOverrideClaimedEvent {
|
|
|
174
207
|
user: PublicKey;
|
|
175
208
|
shares: BN;
|
|
176
209
|
baseAmount: BN;
|
|
210
|
+
withdrawalFeeBase: BN;
|
|
177
211
|
epochId: number;
|
|
178
212
|
dailyWithdrawnBase: BN;
|
|
179
213
|
dailyLimit: BN;
|
|
@@ -186,4 +220,47 @@ export interface LendMigratedEvent {
|
|
|
186
220
|
sharesWithdrawn: BN;
|
|
187
221
|
baseMigrated: BN;
|
|
188
222
|
}
|
|
189
|
-
export
|
|
223
|
+
export interface MigrateRequestedEvent {
|
|
224
|
+
name: "MigrateRequested";
|
|
225
|
+
srcVaultId: BN;
|
|
226
|
+
destVaultId: BN;
|
|
227
|
+
user: PublicKey;
|
|
228
|
+
shares: BN;
|
|
229
|
+
epochId: number;
|
|
230
|
+
}
|
|
231
|
+
export interface MigrateExecutedEvent {
|
|
232
|
+
name: "MigrateExecuted";
|
|
233
|
+
srcVaultId: BN;
|
|
234
|
+
destVaultId: BN;
|
|
235
|
+
user: PublicKey;
|
|
236
|
+
sharesBurned: BN;
|
|
237
|
+
baseMoved: BN;
|
|
238
|
+
withdrawalFeeBase: BN;
|
|
239
|
+
depositFeeBase: BN;
|
|
240
|
+
userDestShares: BN;
|
|
241
|
+
epochId: number;
|
|
242
|
+
}
|
|
243
|
+
export interface DelayedDepositProcessedEvent {
|
|
244
|
+
name: "DelayedDepositProcessed";
|
|
245
|
+
vaultId: BN;
|
|
246
|
+
user: PublicKey;
|
|
247
|
+
amount: BN;
|
|
248
|
+
sharesMinted: BN;
|
|
249
|
+
depositFeeShares: BN;
|
|
250
|
+
pps: BN;
|
|
251
|
+
requestEpochId: number;
|
|
252
|
+
}
|
|
253
|
+
export interface InstantWithdrawnEvent {
|
|
254
|
+
name: "InstantWithdrawn";
|
|
255
|
+
vaultId: BN;
|
|
256
|
+
user: PublicKey;
|
|
257
|
+
shares: BN;
|
|
258
|
+
netBase: BN;
|
|
259
|
+
withdrawalFeeBase: BN;
|
|
260
|
+
}
|
|
261
|
+
export interface StvSeededEvent {
|
|
262
|
+
name: "StvSeeded";
|
|
263
|
+
vaultId: BN;
|
|
264
|
+
amount: BN;
|
|
265
|
+
}
|
|
266
|
+
export type StvEvent = ConfigInitializedEvent | ConfigUpdatedEvent | StvCreatedEvent | StvUpdatedEvent | DepositedEvent | WithdrawRequestedEvent | WithdrawRequestIncreasedEvent | WithdrawClaimedEvent | DepositedToStrategyEvent | WithdrawnFromStrategyEvent | EpochProcessedEvent | EpochAdvancedEvent | FeesSettledEvent | StvClosedEvent | ManagerAddedEvent | ManagerRemovedEvent | WithdrawOverrideClaimedEvent | LendMigratedEvent | MigrateRequestedEvent | MigrateExecutedEvent | DelayedDepositProcessedEvent | InstantWithdrawnEvent | StvSeededEvent;
|