@voltr/vault-sdk 0.1.1 → 0.1.3

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 CHANGED
@@ -6,10 +6,10 @@ A TypeScript SDK for interacting with the Voltr protocol on Solana.
6
6
 
7
7
  - Complete TypeScript support with type definitions
8
8
  - Comprehensive vault management functionality
9
- - Strategy handling and execution
10
- - Asset deposit and withdrawal operations
11
- - PDA (Program Derived Address) utilities
12
- - Account data fetching and parsing
9
+ - Strategy handling and execution with adaptor support
10
+ - Asset deposit and withdrawal operations with direct withdraw capability
11
+ - Account data fetching and PDA (Program Derived Address) utilities
12
+ - Position and total value tracking
13
13
 
14
14
  ## Installation
15
15
 
@@ -60,28 +60,6 @@ const ix = await client.createInitializeVaultIx(vaultParams, {
60
60
  });
61
61
  ```
62
62
 
63
- ### Deposit Assets
64
-
65
- ```typescript
66
- const depositIx = await client.createDepositIx(new BN("1000000000"), {
67
- userAuthority: userPubkey,
68
- vault: vaultPubkey,
69
- vaultAssetMint: mintPubkey,
70
- assetTokenProgram: tokenProgramPubkey,
71
- });
72
- ```
73
-
74
- ### Withdraw Assets
75
-
76
- ```typescript
77
- const withdrawIx = await client.createWithdrawIx(new BN("1000000000"), {
78
- userAuthority: userPubkey,
79
- vault: vaultPubkey,
80
- vaultAssetMint: mintPubkey,
81
- assetTokenProgram: tokenProgramPubkey,
82
- });
83
- ```
84
-
85
63
  ### Strategy Management
86
64
 
87
65
  ```typescript
@@ -89,6 +67,7 @@ const withdrawIx = await client.createWithdrawIx(new BN("1000000000"), {
89
67
  const addAdaptorIx = await client.createAddAdaptorIx({
90
68
  vault: vaultPubkey,
91
69
  payer: payerPubkey,
70
+ admin: adminPubkey,
92
71
  adaptorProgram: adaptorProgramPubkey,
93
72
  });
94
73
 
@@ -104,20 +83,58 @@ const initStrategyIx = await client.createInitializeStrategyIx(
104
83
  manager: managerPubkey,
105
84
  strategy: strategyPubkey,
106
85
  adaptorProgram: adaptorProgramPubkey,
86
+ remainingAccounts: [],
107
87
  }
108
88
  );
109
89
 
110
- // Deposit into a strategy
111
- const depositStrategyIx = await client.createDepositStrategyIx(
90
+ // Initialize direct withdraw strategy
91
+ const initDirectWithdrawIx =
92
+ await client.createInitializeDirectWithdrawStrategyIx(
93
+ {
94
+ instructionDiscriminator: null,
95
+ additionalArgs: null,
96
+ allowUserArgs: true,
97
+ },
98
+ {
99
+ payer: payerPubkey,
100
+ admin: adminPubkey,
101
+ vault: vaultPubkey,
102
+ strategy: strategyPubkey,
103
+ adaptorProgram: adaptorProgramPubkey,
104
+ }
105
+ );
106
+ ```
107
+
108
+ ### Asset Operations
109
+
110
+ ```typescript
111
+ // Deposit assets
112
+ const depositIx = await client.createDepositIx(new BN("1000000000"), {
113
+ userAuthority: userPubkey,
114
+ vault: vaultPubkey,
115
+ vaultAssetMint: mintPubkey,
116
+ assetTokenProgram: tokenProgramPubkey,
117
+ });
118
+
119
+ // Withdraw assets
120
+ const withdrawIx = await client.createWithdrawIx(new BN("1000000000"), {
121
+ userAuthority: userPubkey,
122
+ vault: vaultPubkey,
123
+ vaultAssetMint: mintPubkey,
124
+ assetTokenProgram: tokenProgramPubkey,
125
+ });
126
+
127
+ // Direct withdraw from strategy
128
+ const directWithdrawIx = await client.createDirectWithdrawStrategyIx(
112
129
  {
113
- depositAmount: new BN("1000000000"),
114
- instructionDiscriminator: null,
115
- additionalArgs: null,
130
+ withdrawAmount: new BN("1000000000"),
131
+ userArgs: null,
116
132
  },
117
133
  {
134
+ user: userPubkey,
118
135
  vault: vaultPubkey,
119
- vaultAssetMint: mintPubkey,
120
136
  strategy: strategyPubkey,
137
+ vaultAssetMint: mintPubkey,
121
138
  assetTokenProgram: tokenProgramPubkey,
122
139
  adaptorProgram: adaptorProgramPubkey,
123
140
  remainingAccounts: [],
@@ -125,53 +142,56 @@ const depositStrategyIx = await client.createDepositStrategyIx(
125
142
  );
126
143
  ```
127
144
 
128
- ## API Reference
129
-
130
- ### VoltrClient
131
-
132
- The main client class for interacting with the Voltr protocol.
133
-
134
- #### Constructor
145
+ ### Position and Value Tracking
135
146
 
136
147
  ```typescript
137
- constructor(conn: Connection, wallet?: Keypair)
148
+ // Get position and total values for a vault
149
+ const values = await client.getPositionAndTotalValuesForVault(vaultPubkey);
150
+ console.log(`Total Value: ${values.totalValue}`);
151
+ console.log("Strategy Positions:", values.strategies);
138
152
  ```
139
153
 
140
- #### Vault Management Methods
154
+ ## API Reference
155
+
156
+ ### VoltrClient Methods
157
+
158
+ #### Vault Management
141
159
 
142
- - `createInitializeVaultIx(vaultParams: VaultParams, params: InitializeParams)`
143
- - `createDepositIx(amount: BN, params: DepositParams)`
144
- - `createWithdrawIx(amount: BN, params: WithdrawParams)`
160
+ - `createInitializeVaultIx(vaultParams, params)`
161
+ - `createDepositIx(amount, params)`
162
+ - `createWithdrawIx(amount, params)`
145
163
 
146
- #### Strategy Management Methods
164
+ #### Strategy Management
147
165
 
148
- - `createAddAdaptorIx(params: AddAdaptorParams)`
149
- - `createInitializeStrategyIx(initArgs: InitializeStrategyArgs, params: InitStrategyParams)`
150
- - `createDepositStrategyIx(depositArgs: depositStrategyArgs, params: DepositStrategyParams)`
151
- - `createWithdrawStrategyIx(withdrawArgs: withdrawStrategyArgs, params: WithdrawStrategyParams)`
152
- - `createRemoveStrategyIx(params: RemoveStrategyParams)`
166
+ - `createAddAdaptorIx(params)`
167
+ - `createInitializeStrategyIx(initArgs, params)`
168
+ - `createDepositStrategyIx(depositArgs, params)`
169
+ - `createWithdrawStrategyIx(withdrawArgs, params)`
170
+ - `createInitializeDirectWithdrawStrategyIx(initArgs, params)`
171
+ - `createDirectWithdrawStrategyIx(withdrawArgs, params)`
172
+ - `createRemoveAdaptorIx(params)`
153
173
 
154
- #### Account Fetching Methods
174
+ #### Account Data
155
175
 
156
- - `fetchVaultAccount(vault: PublicKey)`
176
+ - `fetchVaultAccount(vault)`
157
177
  - `fetchAllStrategyInitReceiptAccounts()`
158
- - `fetchAllStrategyInitReceiptAccountsOfVault(vault: PublicKey)`
159
- - `fetchAllAdaptorAddReceiptAccountsOfVault(vault: PublicKey)`
160
- - `getPositionAndTotalValuesForVault(vault: PublicKey)`
178
+ - `fetchAllStrategyInitReceiptAccountsOfVault(vault)`
179
+ - `fetchAllAdaptorAddReceiptAccountsOfVault(vault)`
180
+ - `getPositionAndTotalValuesForVault(vault)`
161
181
 
162
- #### PDA Finding Methods
182
+ #### PDA Finding
163
183
 
164
- - `findVaultLpMint(vault: PublicKey)`
165
- - `findVaultAssetIdleAuth(vault: PublicKey)`
166
- - `findVaultLpFeeAuth(vault: PublicKey)`
167
- - `findVaultAddresses(vault: PublicKey)`
168
- - `findVaultStrategyAuth(vault: PublicKey, strategy: PublicKey)`
169
- - `findStrategyInitReceipt(vault: PublicKey, strategy: PublicKey)`
184
+ - `findVaultLpMint(vault)`
185
+ - `findVaultAssetIdleAuth(vault)`
186
+ - `findVaultAddresses(vault)`
187
+ - `findVaultStrategyAuth(vault, strategy)`
188
+ - `findStrategyInitReceipt(vault, strategy)`
189
+ - `findDirectWithdrawInitReceipt(vault, strategy)`
170
190
 
171
- #### Calculation Methods
191
+ #### Calculations
172
192
 
173
- - `calculateAssetsForWithdraw(vaultPk: PublicKey, lpAmount: BN)`
174
- - `calculateLpTokensForDeposit(depositAmount: BN, vaultPk: PublicKey)`
193
+ - `calculateAssetsForWithdraw(vaultPk, lpAmount)`
194
+ - `calculateLpTokensForDeposit(depositAmount, vaultPk)`
175
195
 
176
196
  ## License
177
197
 
package/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Program, AnchorProvider, Idl, BN } from "@coral-xyz/anchor";
2
2
  import { Connection, Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js";
3
- import { VaultParams, VoltrVault, InitializeStrategyArgs, DepositStrategyArgs, WithdrawStrategyArgs } from "./types";
3
+ import { VaultParams, VaultConfig, VoltrVault, InitializeStrategyArgs, DepositStrategyArgs, WithdrawStrategyArgs, InitializeDirectWithdrawStrategyArgs, DirectWithdrawStrategyArgs } from "./types";
4
4
  declare class AccountUtils {
5
5
  conn: Connection;
6
6
  constructor(conn: Connection);
@@ -53,17 +53,6 @@ export declare class VoltrClient extends AccountUtils {
53
53
  * @returns The PDA for the vault's asset idle authority
54
54
  */
55
55
  findVaultAssetIdleAuth(vault: PublicKey): PublicKey;
56
- /**
57
- * Finds the vault's LP fee authority address
58
- * @param vault - Public key of the vault
59
- * @returns The PDA for the vault's LP fee authority
60
- *
61
- * @example
62
- * ```typescript
63
- * const feeAuth = client.findVaultLpFeeAuth(vaultPubkey);
64
- * ```
65
- */
66
- findVaultLpFeeAuth(vault: PublicKey): PublicKey;
67
56
  /**
68
57
  * Finds all vault-related addresses
69
58
  * @param vault - Public key of the vault
@@ -80,7 +69,6 @@ export declare class VoltrClient extends AccountUtils {
80
69
  findVaultAddresses(vault: PublicKey): {
81
70
  vaultLpMint: PublicKey;
82
71
  vaultAssetIdleAuth: PublicKey;
83
- vaultLpFeeAuth: PublicKey;
84
72
  };
85
73
  /**
86
74
  * Finds the vault strategy auth address
@@ -106,6 +94,23 @@ export declare class VoltrClient extends AccountUtils {
106
94
  * ```
107
95
  */
108
96
  findStrategyInitReceipt(vault: PublicKey, strategy: PublicKey): PublicKey;
97
+ /**
98
+ * Finds the direct withdraw init receipt address
99
+ * @param vault - Public key of the vault
100
+ * @param strategy - Public key of the strategy
101
+ * @returns The PDA for the direct withdraw init receipt
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * const directWithdrawInitReceipt = client.findDirectWithdrawInitReceipt(vaultPubkey, strategyPubkey);
106
+ * ```
107
+ */
108
+ findDirectWithdrawInitReceipt(vault: PublicKey, strategy: PublicKey): PublicKey;
109
+ findVaultStrategyAddresses(vault: PublicKey, strategy: PublicKey): {
110
+ vaultStrategyAuth: PublicKey;
111
+ strategyInitReceipt: PublicKey;
112
+ directWithdrawInitReceipt: PublicKey;
113
+ };
109
114
  /**
110
115
  * Creates an instruction to initialize a new vault
111
116
  *
@@ -160,7 +165,40 @@ export declare class VoltrClient extends AccountUtils {
160
165
  payer: PublicKey;
161
166
  }): Promise<TransactionInstruction>;
162
167
  /**
163
- * Creates a deposit instruction
168
+ * Creates an instruction to update a vault
169
+ * @param {VaultConfig} vaultConfig - Configuration parameters for the vault
170
+ * @param {BN} vaultConfig.maxCap - Maximum capacity of the vault
171
+ * @param {BN} vaultConfig.startAtTs - Vault start timestamp in seconds
172
+ * @param {number} vaultConfig.managerManagementFee - Manager's management fee in basis points (e.g., 50 = 0.5%)
173
+ * @param {number} vaultConfig.managerPerformanceFee - Manager's performance fee in basis points (e.g., 1000 = 10%)
174
+ * @param {number} vaultConfig.adminManagementFee - Admin's management fee in basis points (e.g., 50 = 0.5%)
175
+ * @param {number} vaultConfig.adminPerformanceFee - Admin's performance fee in basis points (e.g., 1000 = 10%)
176
+ * @param {Object} params - Parameters for updating the vault
177
+ * @param {PublicKey} params.vault - Public key of the vault
178
+ * @param {PublicKey} params.admin - Public key of the vault admin
179
+ * @returns Transaction instruction for updating the vault
180
+ *
181
+ * @example
182
+ * ```typescript
183
+ * const ix = await client.createUpdateVaultIx(
184
+ * {
185
+ * maxCap: new BN('1000000000'),
186
+ * startAtTs: new BN(Math.floor(Date.now() / 1000)),
187
+ * managerManagementFee: 50,
188
+ * managerPerformanceFee: 1000,
189
+ * adminManagementFee: 50,
190
+ * adminPerformanceFee: 1000,
191
+ * },
192
+ * { vault: vaultPubkey, admin: adminPubkey }
193
+ * );
194
+ * ```
195
+ */
196
+ createUpdateVaultIx(vaultConfig: VaultConfig, { vault, admin, }: {
197
+ vault: PublicKey;
198
+ admin: PublicKey;
199
+ }): Promise<TransactionInstruction>;
200
+ /**
201
+ * Creates a deposit instruction for a vault
164
202
  *
165
203
  * @param {BN} amount - Amount of tokens to deposit
166
204
  * @param {Object} params - Deposit parameters
@@ -173,7 +211,7 @@ export declare class VoltrClient extends AccountUtils {
173
211
  *
174
212
  * @example
175
213
  * ```typescript
176
- * const ix = await client.createDepositIx(
214
+ * const ix = await client.createDepositVaultIx(
177
215
  * new BN('1000000000'),
178
216
  * {
179
217
  * userAuthority: userPubkey,
@@ -184,14 +222,14 @@ export declare class VoltrClient extends AccountUtils {
184
222
  * );
185
223
  * ```
186
224
  */
187
- createDepositIx(amount: BN, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
225
+ createDepositVaultIx(amount: BN, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
188
226
  userAuthority: PublicKey;
189
227
  vault: PublicKey;
190
228
  vaultAssetMint: PublicKey;
191
229
  assetTokenProgram: PublicKey;
192
230
  }): Promise<TransactionInstruction>;
193
231
  /**
194
- * Creates a withdraw instruction
232
+ * Creates a withdraw instruction for a vault
195
233
  *
196
234
  * @param amount - Amount of LP tokens to withdraw
197
235
  * @param {Object} params - Withdraw parameters
@@ -204,7 +242,7 @@ export declare class VoltrClient extends AccountUtils {
204
242
  * @throws {Error} If the instruction creation fails
205
243
  *
206
244
  * @example
207
- * const ix = await client.createWithdrawIx(
245
+ * const ix = await client.createWithdrawVaultIx(
208
246
  * new BN('1000000000'),
209
247
  * {
210
248
  * userAuthority: userPubkey,
@@ -214,7 +252,7 @@ export declare class VoltrClient extends AccountUtils {
214
252
  * }
215
253
  * );
216
254
  */
217
- createWithdrawIx(amount: BN, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
255
+ createWithdrawVaultIx(amount: BN, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
218
256
  userAuthority: PublicKey;
219
257
  vault: PublicKey;
220
258
  vaultAssetMint: PublicKey;
@@ -225,6 +263,7 @@ export declare class VoltrClient extends AccountUtils {
225
263
  * @param {Object} params - Parameters for adding adaptor to vault
226
264
  * @param {PublicKey} params.vault - Public key of the vault
227
265
  * @param {PublicKey} params.payer - Public key of the payer
266
+ * @param {PublicKey} params.admin - Public key of the admin
228
267
  * @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
229
268
  * @returns {Promise<TransactionInstruction>} Transaction instruction for adding adaptor to vault
230
269
  *
@@ -235,13 +274,15 @@ export declare class VoltrClient extends AccountUtils {
235
274
  * const ix = await client.createAddAdaptorIx({
236
275
  * vault: vaultPubkey,
237
276
  * payer: payerPubkey,
277
+ * admin: adminPubkey,
238
278
  * adaptorProgram: adaptorProgramPubkey
239
279
  * });
240
280
  * ```
241
281
  */
242
- createAddAdaptorIx({ vault, payer, adaptorProgram, }: {
282
+ createAddAdaptorIx({ vault, payer, admin, adaptorProgram, }: {
243
283
  vault: PublicKey;
244
284
  payer: PublicKey;
285
+ admin: PublicKey;
245
286
  adaptorProgram?: PublicKey;
246
287
  }): Promise<TransactionInstruction>;
247
288
  /**
@@ -255,6 +296,7 @@ export declare class VoltrClient extends AccountUtils {
255
296
  * @param {PublicKey} params.manager - Public key of the manager
256
297
  * @param {PublicKey} params.strategy - Public key of the strategy
257
298
  * @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
299
+ * @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
258
300
  * @returns {Promise<TransactionInstruction>} Transaction instruction for initializing strategy to vault
259
301
  * @throws {Error} If the instruction creation fails
260
302
  *
@@ -270,26 +312,33 @@ export declare class VoltrClient extends AccountUtils {
270
312
  * vault: vaultPubkey,
271
313
  * manager: managerPubkey,
272
314
  * strategy: strategyPubkey,
273
- * adaptorProgram: adaptorProgramPubkey
315
+ * adaptorProgram: adaptorProgramPubkey,
316
+ * remainingAccounts: []
274
317
  * }
275
318
  * );
276
319
  * ```
277
320
  */
278
- createInitializeStrategyIx({ instructionDiscriminator, additionalArgs, }: InitializeStrategyArgs, { payer, vault, manager, strategy, adaptorProgram, }: {
321
+ createInitializeStrategyIx({ instructionDiscriminator, additionalArgs, }: InitializeStrategyArgs, { payer, vault, manager, strategy, adaptorProgram, remainingAccounts, }: {
279
322
  payer: PublicKey;
280
323
  vault: PublicKey;
281
324
  manager: PublicKey;
282
325
  strategy: PublicKey;
283
326
  adaptorProgram?: PublicKey;
327
+ remainingAccounts: Array<{
328
+ pubkey: PublicKey;
329
+ isSigner: boolean;
330
+ isWritable: boolean;
331
+ }>;
284
332
  }): Promise<TransactionInstruction>;
285
333
  /**
286
334
  * Creates an instruction to deposit assets into a strategy
287
335
  *
288
- * @param {Object} depositArgs - Deposit arguments
336
+ * @param {DepositStrategyArgs} depositArgs - Deposit arguments
289
337
  * @param {BN} depositArgs.depositAmount - Amount of assets to deposit
290
338
  * @param {Buffer | null} [depositArgs.instructionDiscriminator] - Optional discriminator for the instruction
291
339
  * @param {Buffer | null} [depositArgs.additionalArgs] - Optional additional arguments for the instruction
292
340
  * @param {Object} params - Strategy deposit parameters
341
+ * @param {PublicKey} params.manager - Public key of the manager
293
342
  * @param {PublicKey} params.vault - Public key of the vault
294
343
  * @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
295
344
  * @param {PublicKey} params.strategy - Public key of the strategy
@@ -308,6 +357,7 @@ export declare class VoltrClient extends AccountUtils {
308
357
  * additionalArgs: Buffer.from('...')
309
358
  * },
310
359
  * {
360
+ * manager: managerPubkey,
311
361
  * vault: vaultPubkey,
312
362
  * vaultAssetMint: mintPubkey,
313
363
  * strategy: strategyPubkey,
@@ -318,7 +368,8 @@ export declare class VoltrClient extends AccountUtils {
318
368
  * );
319
369
  * ```
320
370
  */
321
- createDepositStrategyIx({ depositAmount, instructionDiscriminator, additionalArgs, }: DepositStrategyArgs, { vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
371
+ createDepositStrategyIx({ depositAmount, instructionDiscriminator, additionalArgs, }: DepositStrategyArgs, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
372
+ manager: PublicKey;
322
373
  vault: PublicKey;
323
374
  vaultAssetMint: PublicKey;
324
375
  strategy: PublicKey;
@@ -333,7 +384,7 @@ export declare class VoltrClient extends AccountUtils {
333
384
  /**
334
385
  * Creates an instruction to withdraw assets from a strategy
335
386
  *
336
- * @param {Object} withdrawArgs - Withdrawal arguments
387
+ * @param {WithdrawStrategyArgs} withdrawArgs - Withdrawal arguments
337
388
  * @param {BN} withdrawArgs.withdrawAmount - Amount of assets to withdraw
338
389
  * @param {Buffer | null} [withdrawArgs.instructionDiscriminator] - Optional discriminator for the instruction
339
390
  * @param {Buffer | null} [withdrawArgs.additionalArgs] - Optional additional arguments for the instruction
@@ -366,7 +417,8 @@ export declare class VoltrClient extends AccountUtils {
366
417
  * );
367
418
  * ```
368
419
  */
369
- createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator, additionalArgs, }: WithdrawStrategyArgs, { vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
420
+ createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator, additionalArgs, }: WithdrawStrategyArgs, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
421
+ manager: PublicKey;
370
422
  vault: PublicKey;
371
423
  vaultAssetMint: PublicKey;
372
424
  strategy: PublicKey;
@@ -382,22 +434,113 @@ export declare class VoltrClient extends AccountUtils {
382
434
  * Creates an instruction to remove a strategy from a vault
383
435
  * @param {Object} params - Parameters for removing strategy
384
436
  * @param {PublicKey} params.vault - Public key of the vault
437
+ * @param {PublicKey} params.admin - Public key of the admin
385
438
  * @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
386
- * @returns {Promise<TransactionInstruction>} Transaction instruction for removing strategy from vault
439
+ * @returns {Promise<TransactionInstruction>} Transaction instruction for removing adaptor from vault
387
440
  * @throws {Error} If instruction creation fails
388
441
  *
389
442
  * @example
390
443
  * ```typescript
391
- * const ix = await client.createRemoveStrategyIx({
444
+ * const ix = await client.createRemoveAdaptorIx({
392
445
  * vault: vaultPubkey,
446
+ * admin: adminPubkey,
393
447
  * adaptorProgram: adaptorProgramPubkey
394
448
  * });
395
449
  * ```
396
450
  */
397
- createRemoveStrategyIx({ vault, adaptorProgram, }: {
451
+ createRemoveAdaptorIx({ vault, admin, adaptorProgram, }: {
398
452
  vault: PublicKey;
453
+ admin: PublicKey;
399
454
  adaptorProgram?: PublicKey;
400
455
  }): Promise<TransactionInstruction>;
456
+ /**
457
+ * Creates an instruction to initialize a direct withdraw strategy
458
+ * @param {InitializeDirectWithdrawStrategyArgs} initArgs - Arguments for initializing direct withdraw strategy
459
+ * @param {Buffer | null} initArgs.instructionDiscriminator - Optional discriminator for the instruction
460
+ * @param {Buffer | null} initArgs.additionalArgs - Optional additional arguments for the instruction
461
+ * @param {boolean} initArgs.allowUserArgs - Whether to allow user arguments
462
+ * @param {Object} params - Parameters for initializing direct withdraw strategy
463
+ * @param {PublicKey} params.payer - Public key of the payer
464
+ * @param {PublicKey} params.admin - Public key of the admin
465
+ * @param {PublicKey} params.vault - Public key of the vault
466
+ * @param {PublicKey} params.strategy - Public key of the strategy
467
+ * @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
468
+ * @returns {Promise<TransactionInstruction>} Transaction instruction for initializing direct withdraw strategy
469
+ * @throws {Error} If instruction creation fails
470
+ *
471
+ * @example
472
+ * ```typescript
473
+ * const ix = await client.createInitializeDirectWithdrawStrategyIx(
474
+ * {
475
+ * instructionDiscriminator: Buffer.from('...'),
476
+ * additionalArgs: Buffer.from('...'),
477
+ * allowUserArgs: true
478
+ * },
479
+ * {
480
+ * payer: payerPubkey,
481
+ * admin: adminPubkey,
482
+ * vault: vaultPubkey,
483
+ * strategy: strategyPubkey,
484
+ * adaptorProgram: adaptorProgramPubkey
485
+ * }
486
+ * );
487
+ * ```
488
+ */
489
+ createInitializeDirectWithdrawStrategyIx({ instructionDiscriminator, additionalArgs, allowUserArgs, }: InitializeDirectWithdrawStrategyArgs, { payer, admin, vault, strategy, adaptorProgram, }: {
490
+ payer: PublicKey;
491
+ admin: PublicKey;
492
+ vault: PublicKey;
493
+ strategy: PublicKey;
494
+ adaptorProgram?: PublicKey;
495
+ }): Promise<TransactionInstruction>;
496
+ /**
497
+ * Creates an instruction to withdraw assets from a direct withdraw strategy
498
+ * @param {DirectWithdrawStrategyArgs} withdrawArgs - Withdrawal arguments
499
+ * @param {BN} withdrawArgs.withdrawAmount - Amount of assets to withdraw
500
+ * @param {Buffer | null} [withdrawArgs.userArgs] - Optional user arguments for the instruction
501
+ * @param {Object} params - Parameters for withdrawing assets from direct withdraw strategy
502
+ * @param {PublicKey} params.user - Public key of the user
503
+ * @param {PublicKey} params.vault - Public key of the vault
504
+ * @param {PublicKey} params.strategy - Public key of the strategy
505
+ * @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
506
+ * @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
507
+ * @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
508
+ * @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
509
+ * @returns {Promise<TransactionInstruction>} Transaction instruction for withdrawing assets from direct withdraw strategy
510
+ * @throws {Error} If instruction creation fails
511
+ *
512
+ * @example
513
+ * ```typescript
514
+ * const ix = await client.createDirectWithdrawStrategyIx(
515
+ * {
516
+ * withdrawAmount: new BN('1000000000'),
517
+ * userArgs: Buffer.from('...')
518
+ * },
519
+ * {
520
+ * user: userPubkey,
521
+ * vault: vaultPubkey,
522
+ * strategy: strategyPubkey,
523
+ * vaultAssetMint: mintPubkey,
524
+ * assetTokenProgram: tokenProgramPubkey,
525
+ * adaptorProgram: adaptorProgramPubkey,
526
+ * remainingAccounts: []
527
+ * }
528
+ * );
529
+ * ```
530
+ */
531
+ createDirectWithdrawStrategyIx({ withdrawAmount, userArgs }: DirectWithdrawStrategyArgs, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
532
+ user: PublicKey;
533
+ vault: PublicKey;
534
+ strategy: PublicKey;
535
+ vaultAssetMint: PublicKey;
536
+ assetTokenProgram: PublicKey;
537
+ adaptorProgram?: PublicKey;
538
+ remainingAccounts: Array<{
539
+ pubkey: PublicKey;
540
+ isSigner: boolean;
541
+ isWritable: boolean;
542
+ }>;
543
+ }): Promise<TransactionInstruction>;
401
544
  /**
402
545
  * Fetches all strategy init receipt accounts
403
546
  * @returns Promise resolving to an array of strategy init receipt accounts
@@ -410,6 +553,7 @@ export declare class VoltrClient extends AccountUtils {
410
553
  fetchAllStrategyInitReceiptAccounts(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
411
554
  vault: PublicKey;
412
555
  strategy: PublicKey;
556
+ adaptorProgram: PublicKey;
413
557
  positionValue: BN;
414
558
  lastUpdatedTs: BN;
415
559
  version: number;
@@ -431,6 +575,7 @@ export declare class VoltrClient extends AccountUtils {
431
575
  fetchAllStrategyInitReceiptAccountsOfVault(vault: PublicKey): Promise<import("@coral-xyz/anchor").ProgramAccount<{
432
576
  vault: PublicKey;
433
577
  strategy: PublicKey;
578
+ adaptorProgram: PublicKey;
434
579
  positionValue: BN;
435
580
  lastUpdatedTs: BN;
436
581
  version: number;
@@ -454,7 +599,9 @@ export declare class VoltrClient extends AccountUtils {
454
599
  adaptorProgram: PublicKey;
455
600
  version: number;
456
601
  bump: number;
602
+ isActive: boolean;
457
603
  padding0: number[];
604
+ lastUpdatedEpoch: BN;
458
605
  reserved: number[];
459
606
  }>[]>;
460
607
  getPositionAndTotalValuesForVault(vault: PublicKey): Promise<{
@@ -478,6 +625,7 @@ export declare class VoltrClient extends AccountUtils {
478
625
  admin: PublicKey;
479
626
  vaultConfiguration: any;
480
627
  feeConfiguration: any;
628
+ feeState: any;
481
629
  lastUpdatedTs: BN;
482
630
  version: number;
483
631
  padding0: number[];
@@ -496,6 +644,7 @@ export declare class VoltrClient extends AccountUtils {
496
644
  fetchStrategyInitReceiptAccount(strategyInitReceipt: PublicKey): Promise<{
497
645
  vault: PublicKey;
498
646
  strategy: PublicKey;
647
+ adaptorProgram: PublicKey;
499
648
  positionValue: BN;
500
649
  lastUpdatedTs: BN;
501
650
  version: number;
@@ -519,7 +668,9 @@ export declare class VoltrClient extends AccountUtils {
519
668
  adaptorProgram: PublicKey;
520
669
  version: number;
521
670
  bump: number;
671
+ isActive: boolean;
522
672
  padding0: number[];
673
+ lastUpdatedEpoch: BN;
523
674
  reserved: number[];
524
675
  }>;
525
676
  /**