@voltr/vault-sdk 0.1.5 → 0.2.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/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, VaultConfig, VoltrVault, InitializeStrategyArgs, DepositStrategyArgs, WithdrawStrategyArgs, InitializeDirectWithdrawStrategyArgs, DirectWithdrawStrategyArgs } from "./types";
3
+ import { VaultParams, VaultConfig, VoltrVault, InitializeStrategyArgs, DepositStrategyArgs, WithdrawStrategyArgs, InitializeDirectWithdrawStrategyArgs, DirectWithdrawStrategyArgs, WithdrawVaultArgs } from "./types";
4
4
  declare class AccountUtils {
5
5
  conn: Connection;
6
6
  constructor(conn: Connection);
@@ -231,7 +231,10 @@ export declare class VoltrClient extends AccountUtils {
231
231
  /**
232
232
  * Creates a withdraw instruction for a vault
233
233
  *
234
- * @param amount - Amount of LP tokens to withdraw
234
+ * @param {WithdrawVaultArgs} obj - Arguments for withdrawing from the vault
235
+ * @param {BN} obj.amount - Amount of LP tokens to withdraw
236
+ * @param {boolean} obj.isAmountInLp - Whether the amount is in LP tokens
237
+ * @param {boolean} obj.isWithdrawAll - Whether to withdraw all assets
235
238
  * @param {Object} params - Withdraw parameters
236
239
  * @param {PublicKey} params.userAuthority - Public key of the user authority
237
240
  * @param {PublicKey} params.vault - Public key of the vault
@@ -243,7 +246,11 @@ export declare class VoltrClient extends AccountUtils {
243
246
  *
244
247
  * @example
245
248
  * const ix = await client.createWithdrawVaultIx(
246
- * new BN('1000000000'),
249
+ * {
250
+ * amount: new BN('1000000000'),
251
+ * isAmountInLp: true,
252
+ * isWithdrawAll: false,
253
+ * },
247
254
  * {
248
255
  * userAuthority: userPubkey,
249
256
  * vault: vaultPubkey,
@@ -252,7 +259,7 @@ export declare class VoltrClient extends AccountUtils {
252
259
  * }
253
260
  * );
254
261
  */
255
- createWithdrawVaultIx(amount: BN, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
262
+ createWithdrawVaultIx({ amount, isAmountInLp, isWithdrawAll }: WithdrawVaultArgs, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
256
263
  userAuthority: PublicKey;
257
264
  vault: PublicKey;
258
265
  vaultAssetMint: PublicKey;
@@ -495,9 +502,11 @@ export declare class VoltrClient extends AccountUtils {
495
502
  }): Promise<TransactionInstruction>;
496
503
  /**
497
504
  * 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
505
+ * @param {DirectWithdrawStrategyArgs} directWithdrawArgs - Withdrawal arguments
506
+ * @param {BN} directWithdrawArgs.amount - Amount of assets to withdraw
507
+ * @param {boolean} directWithdrawArgs.isAmountInLp - Whether the amount is in LP tokens
508
+ * @param {boolean} directWithdrawArgs.isWithdrawAll - Whether to withdraw all assets
509
+ * @param {Buffer | null} [directWithdrawArgs.userArgs] - Optional user arguments for the instruction
501
510
  * @param {Object} params - Parameters for withdrawing assets from direct withdraw strategy
502
511
  * @param {PublicKey} params.user - Public key of the user
503
512
  * @param {PublicKey} params.vault - Public key of the vault
@@ -513,7 +522,9 @@ export declare class VoltrClient extends AccountUtils {
513
522
  * ```typescript
514
523
  * const ix = await client.createDirectWithdrawStrategyIx(
515
524
  * {
516
- * withdrawAmount: new BN('1000000000'),
525
+ * amount: new BN('1000000000'),
526
+ * isAmountInLp: true,
527
+ * isWithdrawAll: false,
517
528
  * userArgs: Buffer.from('...')
518
529
  * },
519
530
  * {
@@ -528,7 +539,7 @@ export declare class VoltrClient extends AccountUtils {
528
539
  * );
529
540
  * ```
530
541
  */
531
- createDirectWithdrawStrategyIx({ withdrawAmount, userArgs }: DirectWithdrawStrategyArgs, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
542
+ createDirectWithdrawStrategyIx({ amount, isAmountInLp, isWithdrawAll, userArgs, }: DirectWithdrawStrategyArgs, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
532
543
  user: PublicKey;
533
544
  vault: PublicKey;
534
545
  strategy: PublicKey;
@@ -626,9 +637,11 @@ export declare class VoltrClient extends AccountUtils {
626
637
  vaultConfiguration: any;
627
638
  feeConfiguration: any;
628
639
  feeState: any;
640
+ highWaterMark: any;
629
641
  lastUpdatedTs: BN;
630
642
  version: number;
631
643
  padding0: number[];
644
+ lockedProfitState: any;
632
645
  reserved: number[];
633
646
  }>;
634
647
  /**
package/dist/client.js CHANGED
@@ -367,7 +367,10 @@ class VoltrClient extends AccountUtils {
367
367
  /**
368
368
  * Creates a withdraw instruction for a vault
369
369
  *
370
- * @param amount - Amount of LP tokens to withdraw
370
+ * @param {WithdrawVaultArgs} obj - Arguments for withdrawing from the vault
371
+ * @param {BN} obj.amount - Amount of LP tokens to withdraw
372
+ * @param {boolean} obj.isAmountInLp - Whether the amount is in LP tokens
373
+ * @param {boolean} obj.isWithdrawAll - Whether to withdraw all assets
371
374
  * @param {Object} params - Withdraw parameters
372
375
  * @param {PublicKey} params.userAuthority - Public key of the user authority
373
376
  * @param {PublicKey} params.vault - Public key of the vault
@@ -379,7 +382,11 @@ class VoltrClient extends AccountUtils {
379
382
  *
380
383
  * @example
381
384
  * const ix = await client.createWithdrawVaultIx(
382
- * new BN('1000000000'),
385
+ * {
386
+ * amount: new BN('1000000000'),
387
+ * isAmountInLp: true,
388
+ * isWithdrawAll: false,
389
+ * },
383
390
  * {
384
391
  * userAuthority: userPubkey,
385
392
  * vault: vaultPubkey,
@@ -388,9 +395,9 @@ class VoltrClient extends AccountUtils {
388
395
  * }
389
396
  * );
390
397
  */
391
- async createWithdrawVaultIx(amount, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }) {
398
+ async createWithdrawVaultIx({ amount, isAmountInLp, isWithdrawAll }, { userAuthority, vault, vaultAssetMint, assetTokenProgram, }) {
392
399
  return await this.vaultProgram.methods
393
- .withdrawVault(amount)
400
+ .withdrawVault(amount, isAmountInLp, isWithdrawAll)
394
401
  .accounts({
395
402
  userTransferAuthority: userAuthority,
396
403
  vault,
@@ -421,7 +428,7 @@ class VoltrClient extends AccountUtils {
421
428
  * });
422
429
  * ```
423
430
  */
424
- async createAddAdaptorIx({ vault, payer, admin, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, }) {
431
+ async createAddAdaptorIx({ vault, payer, admin, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, }) {
425
432
  return await this.vaultProgram.methods
426
433
  .addAdaptor()
427
434
  .accountsPartial({
@@ -465,7 +472,7 @@ class VoltrClient extends AccountUtils {
465
472
  * );
466
473
  * ```
467
474
  */
468
- async createInitializeStrategyIx({ instructionDiscriminator = null, additionalArgs = null, }, { payer, vault, manager, strategy, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
475
+ async createInitializeStrategyIx({ instructionDiscriminator = null, additionalArgs = null, }, { payer, vault, manager, strategy, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
469
476
  return await this.vaultProgram.methods
470
477
  .initializeStrategy(instructionDiscriminator ?? null, additionalArgs ?? null)
471
478
  .accounts({
@@ -516,7 +523,7 @@ class VoltrClient extends AccountUtils {
516
523
  * );
517
524
  * ```
518
525
  */
519
- async createDepositStrategyIx({ depositAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
526
+ async createDepositStrategyIx({ depositAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
520
527
  return await this.vaultProgram.methods
521
528
  .depositStrategy(depositAmount, instructionDiscriminator, additionalArgs)
522
529
  .accounts({
@@ -566,7 +573,7 @@ class VoltrClient extends AccountUtils {
566
573
  * );
567
574
  * ```
568
575
  */
569
- async createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
576
+ async createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
570
577
  return await this.vaultProgram.methods
571
578
  .withdrawStrategy(withdrawAmount, instructionDiscriminator, additionalArgs)
572
579
  .accounts({
@@ -598,7 +605,7 @@ class VoltrClient extends AccountUtils {
598
605
  * });
599
606
  * ```
600
607
  */
601
- async createRemoveAdaptorIx({ vault, admin, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, }) {
608
+ async createRemoveAdaptorIx({ vault, admin, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, }) {
602
609
  return await this.vaultProgram.methods
603
610
  .removeAdaptor()
604
611
  .accountsPartial({
@@ -641,7 +648,7 @@ class VoltrClient extends AccountUtils {
641
648
  * );
642
649
  * ```
643
650
  */
644
- async createInitializeDirectWithdrawStrategyIx({ instructionDiscriminator = null, additionalArgs = null, allowUserArgs = false, }, { payer, admin, vault, strategy, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, }) {
651
+ async createInitializeDirectWithdrawStrategyIx({ instructionDiscriminator = null, additionalArgs = null, allowUserArgs = false, }, { payer, admin, vault, strategy, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, }) {
645
652
  return await this.vaultProgram.methods
646
653
  .initializeDirectWithdrawStrategy(instructionDiscriminator, additionalArgs, allowUserArgs)
647
654
  .accountsPartial({
@@ -655,9 +662,11 @@ class VoltrClient extends AccountUtils {
655
662
  }
656
663
  /**
657
664
  * Creates an instruction to withdraw assets from a direct withdraw strategy
658
- * @param {DirectWithdrawStrategyArgs} withdrawArgs - Withdrawal arguments
659
- * @param {BN} withdrawArgs.withdrawAmount - Amount of assets to withdraw
660
- * @param {Buffer | null} [withdrawArgs.userArgs] - Optional user arguments for the instruction
665
+ * @param {DirectWithdrawStrategyArgs} directWithdrawArgs - Withdrawal arguments
666
+ * @param {BN} directWithdrawArgs.amount - Amount of assets to withdraw
667
+ * @param {boolean} directWithdrawArgs.isAmountInLp - Whether the amount is in LP tokens
668
+ * @param {boolean} directWithdrawArgs.isWithdrawAll - Whether to withdraw all assets
669
+ * @param {Buffer | null} [directWithdrawArgs.userArgs] - Optional user arguments for the instruction
661
670
  * @param {Object} params - Parameters for withdrawing assets from direct withdraw strategy
662
671
  * @param {PublicKey} params.user - Public key of the user
663
672
  * @param {PublicKey} params.vault - Public key of the vault
@@ -673,7 +682,9 @@ class VoltrClient extends AccountUtils {
673
682
  * ```typescript
674
683
  * const ix = await client.createDirectWithdrawStrategyIx(
675
684
  * {
676
- * withdrawAmount: new BN('1000000000'),
685
+ * amount: new BN('1000000000'),
686
+ * isAmountInLp: true,
687
+ * isWithdrawAll: false,
677
688
  * userArgs: Buffer.from('...')
678
689
  * },
679
690
  * {
@@ -688,9 +699,9 @@ class VoltrClient extends AccountUtils {
688
699
  * );
689
700
  * ```
690
701
  */
691
- async createDirectWithdrawStrategyIx({ withdrawAmount, userArgs = null }, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram = constants_1.DEFAULT_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
702
+ async createDirectWithdrawStrategyIx({ amount, isAmountInLp, isWithdrawAll, userArgs = null, }, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
692
703
  return await this.vaultProgram.methods
693
- .directWithdrawStrategy(withdrawAmount, userArgs)
704
+ .directWithdrawStrategy(amount, isAmountInLp, isWithdrawAll, userArgs)
694
705
  .accounts({
695
706
  userTransferAuthority: user,
696
707
  strategy,
@@ -1,6 +1,7 @@
1
1
  import { PublicKey } from "@solana/web3.js";
2
2
  export declare const VAULT_PROGRAM_ID: PublicKey;
3
- export declare const DEFAULT_ADAPTOR_PROGRAM_ID: PublicKey;
3
+ export declare const LENDING_ADAPTOR_PROGRAM_ID: PublicKey;
4
+ export declare const DRIFT_ADAPTOR_PROGRAM_ID: PublicKey;
4
5
  export declare const REDEMPTION_FEE_PERCENTAGE_BPS = 10;
5
6
  export declare const SEEDS: {
6
7
  VAULT_LP_MINT: Buffer<ArrayBuffer>;
package/dist/constants.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEEDS = exports.REDEMPTION_FEE_PERCENTAGE_BPS = exports.DEFAULT_ADAPTOR_PROGRAM_ID = exports.VAULT_PROGRAM_ID = void 0;
3
+ exports.SEEDS = exports.REDEMPTION_FEE_PERCENTAGE_BPS = exports.DRIFT_ADAPTOR_PROGRAM_ID = exports.LENDING_ADAPTOR_PROGRAM_ID = exports.VAULT_PROGRAM_ID = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.VAULT_PROGRAM_ID = new web3_js_1.PublicKey("vVoLTRjQmtFpiYoegx285Ze4gsLJ8ZxgFKVcuvmG1a8");
6
- exports.DEFAULT_ADAPTOR_PROGRAM_ID = new web3_js_1.PublicKey("aVoLTRCRt3NnnchvLYH6rMYehJHwM5m45RmLBZq7PGz");
6
+ exports.LENDING_ADAPTOR_PROGRAM_ID = new web3_js_1.PublicKey("aVoLTRCRt3NnnchvLYH6rMYehJHwM5m45RmLBZq7PGz");
7
+ exports.DRIFT_ADAPTOR_PROGRAM_ID = new web3_js_1.PublicKey("EBN93eXs5fHGBABuajQqdsKRkCgaqtJa8vEFD6vKXiP");
7
8
  exports.REDEMPTION_FEE_PERCENTAGE_BPS = 10;
8
9
  exports.SEEDS = {
9
10
  VAULT_LP_MINT: Buffer.from("vault_lp_mint"),
@@ -1280,6 +1280,14 @@
1280
1280
  "name": "amount",
1281
1281
  "type": "u64"
1282
1282
  },
1283
+ {
1284
+ "name": "is_amount_in_lp",
1285
+ "type": "bool"
1286
+ },
1287
+ {
1288
+ "name": "is_withdraw_all",
1289
+ "type": "bool"
1290
+ },
1283
1291
  {
1284
1292
  "name": "user_args",
1285
1293
  "type": {
@@ -2797,6 +2805,14 @@
2797
2805
  {
2798
2806
  "name": "amount",
2799
2807
  "type": "u64"
2808
+ },
2809
+ {
2810
+ "name": "amount_in_lp",
2811
+ "type": "bool"
2812
+ },
2813
+ {
2814
+ "name": "withdraw_all",
2815
+ "type": "bool"
2800
2816
  }
2801
2817
  ]
2802
2818
  }
@@ -2938,6 +2954,11 @@
2938
2954
  "code": 6013,
2939
2955
  "name": "AdaptorEpochInvalid",
2940
2956
  "msg": "Adaptor epoch invalid."
2957
+ },
2958
+ {
2959
+ "code": 6014,
2960
+ "name": "InvalidFeeConfiguration",
2961
+ "msg": "Fee configuration invalid."
2941
2962
  }
2942
2963
  ],
2943
2964
  "types": [
@@ -3172,13 +3193,71 @@
3172
3193
  "type": {
3173
3194
  "array": [
3174
3195
  "u8",
3175
- 56
3196
+ 24
3197
+ ]
3198
+ }
3199
+ }
3200
+ ]
3201
+ }
3202
+ },
3203
+ {
3204
+ "name": "HighWaterMark",
3205
+ "serialization": "bytemuckunsafe",
3206
+ "repr": {
3207
+ "kind": "c"
3208
+ },
3209
+ "type": {
3210
+ "kind": "struct",
3211
+ "fields": [
3212
+ {
3213
+ "name": "highest_asset_per_lp",
3214
+ "docs": [
3215
+ "The highest recorded total asset value per share"
3216
+ ],
3217
+ "type": "u128"
3218
+ },
3219
+ {
3220
+ "name": "last_updated_ts",
3221
+ "docs": [
3222
+ "The timestamp when the high water mark was last updated"
3223
+ ],
3224
+ "type": "u64"
3225
+ },
3226
+ {
3227
+ "name": "reserved",
3228
+ "docs": [
3229
+ "Reserved for future use"
3230
+ ],
3231
+ "type": {
3232
+ "array": [
3233
+ "u8",
3234
+ 8
3176
3235
  ]
3177
3236
  }
3178
3237
  }
3179
3238
  ]
3180
3239
  }
3181
3240
  },
3241
+ {
3242
+ "name": "LockedProfitState",
3243
+ "serialization": "bytemuckunsafe",
3244
+ "repr": {
3245
+ "kind": "c"
3246
+ },
3247
+ "type": {
3248
+ "kind": "struct",
3249
+ "fields": [
3250
+ {
3251
+ "name": "last_updated_locked_profit",
3252
+ "type": "u64"
3253
+ },
3254
+ {
3255
+ "name": "last_report",
3256
+ "type": "u64"
3257
+ }
3258
+ ]
3259
+ }
3260
+ },
3182
3261
  {
3183
3262
  "name": "Protocol",
3184
3263
  "serialization": "bytemuckunsafe",
@@ -3407,7 +3486,7 @@
3407
3486
  {
3408
3487
  "name": "vault_configuration",
3409
3488
  "docs": [
3410
- "The vault fee and cap configuration (inline nested struct)."
3489
+ "The vault fee, cap, and locked profit degradation duration configuration (inline nested struct)."
3411
3490
  ],
3412
3491
  "type": {
3413
3492
  "defined": {
@@ -3437,6 +3516,14 @@
3437
3516
  }
3438
3517
  }
3439
3518
  },
3519
+ {
3520
+ "name": "high_water_mark",
3521
+ "type": {
3522
+ "defined": {
3523
+ "name": "HighWaterMark"
3524
+ }
3525
+ }
3526
+ },
3440
3527
  {
3441
3528
  "name": "last_updated_ts",
3442
3529
  "docs": [
@@ -3463,6 +3550,17 @@
3463
3550
  ]
3464
3551
  }
3465
3552
  },
3553
+ {
3554
+ "name": "locked_profit_state",
3555
+ "docs": [
3556
+ "The locked profit state of the vault."
3557
+ ],
3558
+ "type": {
3559
+ "defined": {
3560
+ "name": "LockedProfitState"
3561
+ }
3562
+ }
3563
+ },
3466
3564
  {
3467
3565
  "name": "reserved",
3468
3566
  "docs": [
@@ -3471,7 +3569,7 @@
3471
3569
  "type": {
3472
3570
  "array": [
3473
3571
  "u8",
3474
- 256
3572
+ 240
3475
3573
  ]
3476
3574
  }
3477
3575
  }
@@ -3553,6 +3651,13 @@
3553
3651
  ],
3554
3652
  "type": "u64"
3555
3653
  },
3654
+ {
3655
+ "name": "locked_profit_degradation_duration",
3656
+ "docs": [
3657
+ "The locked profit degradation duration."
3658
+ ],
3659
+ "type": "u64"
3660
+ },
3556
3661
  {
3557
3662
  "name": "reserved",
3558
3663
  "docs": [
@@ -3561,7 +3666,7 @@
3561
3666
  "type": {
3562
3667
  "array": [
3563
3668
  "u8",
3564
- 64
3669
+ 56
3565
3670
  ]
3566
3671
  }
3567
3672
  }
@@ -3614,6 +3719,13 @@
3614
3719
  "Admin management fee in basis points (BPS)."
3615
3720
  ],
3616
3721
  "type": "u16"
3722
+ },
3723
+ {
3724
+ "name": "locked_profit_degradation_duration",
3725
+ "docs": [
3726
+ "The locked profit degradation duration."
3727
+ ],
3728
+ "type": "u64"
3617
3729
  }
3618
3730
  ]
3619
3731
  }
@@ -2,6 +2,7 @@ import { BN } from "@coral-xyz/anchor";
2
2
  export interface VaultConfig {
3
3
  maxCap: BN;
4
4
  startAtTs: BN;
5
+ lockedProfitDegradationDuration: BN;
5
6
  managerManagementFee: number;
6
7
  managerPerformanceFee: number;
7
8
  adminManagementFee: number;
@@ -25,7 +26,11 @@ export interface WithdrawStrategyArgs extends InitializeStrategyArgs {
25
26
  export interface InitializeDirectWithdrawStrategyArgs extends InitializeStrategyArgs {
26
27
  allowUserArgs?: boolean;
27
28
  }
28
- export interface DirectWithdrawStrategyArgs {
29
- withdrawAmount: BN;
29
+ export interface WithdrawVaultArgs {
30
+ amount: BN;
31
+ isAmountInLp: boolean;
32
+ isWithdrawAll: boolean;
33
+ }
34
+ export interface DirectWithdrawStrategyArgs extends WithdrawVaultArgs {
30
35
  userArgs?: Buffer | null;
31
36
  }
@@ -1286,6 +1286,14 @@ export type VoltrVault = {
1286
1286
  "name": "amount";
1287
1287
  "type": "u64";
1288
1288
  },
1289
+ {
1290
+ "name": "isAmountInLp";
1291
+ "type": "bool";
1292
+ },
1293
+ {
1294
+ "name": "isWithdrawAll";
1295
+ "type": "bool";
1296
+ },
1289
1297
  {
1290
1298
  "name": "userArgs";
1291
1299
  "type": {
@@ -2803,6 +2811,14 @@ export type VoltrVault = {
2803
2811
  {
2804
2812
  "name": "amount";
2805
2813
  "type": "u64";
2814
+ },
2815
+ {
2816
+ "name": "amountInLp";
2817
+ "type": "bool";
2818
+ },
2819
+ {
2820
+ "name": "withdrawAll";
2821
+ "type": "bool";
2806
2822
  }
2807
2823
  ];
2808
2824
  }
@@ -2944,6 +2960,11 @@ export type VoltrVault = {
2944
2960
  "code": 6013;
2945
2961
  "name": "adaptorEpochInvalid";
2946
2962
  "msg": "Adaptor epoch invalid.";
2963
+ },
2964
+ {
2965
+ "code": 6014;
2966
+ "name": "invalidFeeConfiguration";
2967
+ "msg": "Fee configuration invalid.";
2947
2968
  }
2948
2969
  ];
2949
2970
  "types": [
@@ -3178,13 +3199,71 @@ export type VoltrVault = {
3178
3199
  "type": {
3179
3200
  "array": [
3180
3201
  "u8",
3181
- 56
3202
+ 24
3203
+ ];
3204
+ };
3205
+ }
3206
+ ];
3207
+ };
3208
+ },
3209
+ {
3210
+ "name": "highWaterMark";
3211
+ "serialization": "bytemuckunsafe";
3212
+ "repr": {
3213
+ "kind": "c";
3214
+ };
3215
+ "type": {
3216
+ "kind": "struct";
3217
+ "fields": [
3218
+ {
3219
+ "name": "highestAssetPerLp";
3220
+ "docs": [
3221
+ "The highest recorded total asset value per share"
3222
+ ];
3223
+ "type": "u128";
3224
+ },
3225
+ {
3226
+ "name": "lastUpdatedTs";
3227
+ "docs": [
3228
+ "The timestamp when the high water mark was last updated"
3229
+ ];
3230
+ "type": "u64";
3231
+ },
3232
+ {
3233
+ "name": "reserved";
3234
+ "docs": [
3235
+ "Reserved for future use"
3236
+ ];
3237
+ "type": {
3238
+ "array": [
3239
+ "u8",
3240
+ 8
3182
3241
  ];
3183
3242
  };
3184
3243
  }
3185
3244
  ];
3186
3245
  };
3187
3246
  },
3247
+ {
3248
+ "name": "lockedProfitState";
3249
+ "serialization": "bytemuckunsafe";
3250
+ "repr": {
3251
+ "kind": "c";
3252
+ };
3253
+ "type": {
3254
+ "kind": "struct";
3255
+ "fields": [
3256
+ {
3257
+ "name": "lastUpdatedLockedProfit";
3258
+ "type": "u64";
3259
+ },
3260
+ {
3261
+ "name": "lastReport";
3262
+ "type": "u64";
3263
+ }
3264
+ ];
3265
+ };
3266
+ },
3188
3267
  {
3189
3268
  "name": "protocol";
3190
3269
  "serialization": "bytemuckunsafe";
@@ -3413,7 +3492,7 @@ export type VoltrVault = {
3413
3492
  {
3414
3493
  "name": "vaultConfiguration";
3415
3494
  "docs": [
3416
- "The vault fee and cap configuration (inline nested struct)."
3495
+ "The vault fee, cap, and locked profit degradation duration configuration (inline nested struct)."
3417
3496
  ];
3418
3497
  "type": {
3419
3498
  "defined": {
@@ -3443,6 +3522,14 @@ export type VoltrVault = {
3443
3522
  };
3444
3523
  };
3445
3524
  },
3525
+ {
3526
+ "name": "highWaterMark";
3527
+ "type": {
3528
+ "defined": {
3529
+ "name": "highWaterMark";
3530
+ };
3531
+ };
3532
+ },
3446
3533
  {
3447
3534
  "name": "lastUpdatedTs";
3448
3535
  "docs": [
@@ -3469,6 +3556,17 @@ export type VoltrVault = {
3469
3556
  ];
3470
3557
  };
3471
3558
  },
3559
+ {
3560
+ "name": "lockedProfitState";
3561
+ "docs": [
3562
+ "The locked profit state of the vault."
3563
+ ];
3564
+ "type": {
3565
+ "defined": {
3566
+ "name": "lockedProfitState";
3567
+ };
3568
+ };
3569
+ },
3472
3570
  {
3473
3571
  "name": "reserved";
3474
3572
  "docs": [
@@ -3477,7 +3575,7 @@ export type VoltrVault = {
3477
3575
  "type": {
3478
3576
  "array": [
3479
3577
  "u8",
3480
- 256
3578
+ 240
3481
3579
  ];
3482
3580
  };
3483
3581
  }
@@ -3559,6 +3657,13 @@ export type VoltrVault = {
3559
3657
  ];
3560
3658
  "type": "u64";
3561
3659
  },
3660
+ {
3661
+ "name": "lockedProfitDegradationDuration";
3662
+ "docs": [
3663
+ "The locked profit degradation duration."
3664
+ ];
3665
+ "type": "u64";
3666
+ },
3562
3667
  {
3563
3668
  "name": "reserved";
3564
3669
  "docs": [
@@ -3567,7 +3672,7 @@ export type VoltrVault = {
3567
3672
  "type": {
3568
3673
  "array": [
3569
3674
  "u8",
3570
- 64
3675
+ 56
3571
3676
  ];
3572
3677
  };
3573
3678
  }
@@ -3620,6 +3725,13 @@ export type VoltrVault = {
3620
3725
  "Admin management fee in basis points (BPS)."
3621
3726
  ];
3622
3727
  "type": "u16";
3728
+ },
3729
+ {
3730
+ "name": "lockedProfitDegradationDuration";
3731
+ "docs": [
3732
+ "The locked profit degradation duration."
3733
+ ];
3734
+ "type": "u64";
3623
3735
  }
3624
3736
  ];
3625
3737
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltr/vault-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "SDK for interacting with Voltr Protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",