@voltr/vault-sdk 0.1.6 → 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 +2 -0
- package/dist/client.js +7 -7
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +3 -2
- package/dist/idl/voltr_vault.json +100 -4
- package/dist/types/vault.d.ts +1 -0
- package/dist/types/voltr_vault.d.ts +100 -4
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -637,9 +637,11 @@ export declare class VoltrClient extends AccountUtils {
|
|
|
637
637
|
vaultConfiguration: any;
|
|
638
638
|
feeConfiguration: any;
|
|
639
639
|
feeState: any;
|
|
640
|
+
highWaterMark: any;
|
|
640
641
|
lastUpdatedTs: BN;
|
|
641
642
|
version: number;
|
|
642
643
|
padding0: number[];
|
|
644
|
+
lockedProfitState: any;
|
|
643
645
|
reserved: number[];
|
|
644
646
|
}>;
|
|
645
647
|
/**
|
package/dist/client.js
CHANGED
|
@@ -428,7 +428,7 @@ class VoltrClient extends AccountUtils {
|
|
|
428
428
|
* });
|
|
429
429
|
* ```
|
|
430
430
|
*/
|
|
431
|
-
async createAddAdaptorIx({ vault, payer, admin, adaptorProgram = constants_1.
|
|
431
|
+
async createAddAdaptorIx({ vault, payer, admin, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, }) {
|
|
432
432
|
return await this.vaultProgram.methods
|
|
433
433
|
.addAdaptor()
|
|
434
434
|
.accountsPartial({
|
|
@@ -472,7 +472,7 @@ class VoltrClient extends AccountUtils {
|
|
|
472
472
|
* );
|
|
473
473
|
* ```
|
|
474
474
|
*/
|
|
475
|
-
async createInitializeStrategyIx({ instructionDiscriminator = null, additionalArgs = null, }, { payer, vault, manager, strategy, adaptorProgram = constants_1.
|
|
475
|
+
async createInitializeStrategyIx({ instructionDiscriminator = null, additionalArgs = null, }, { payer, vault, manager, strategy, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
|
|
476
476
|
return await this.vaultProgram.methods
|
|
477
477
|
.initializeStrategy(instructionDiscriminator ?? null, additionalArgs ?? null)
|
|
478
478
|
.accounts({
|
|
@@ -523,7 +523,7 @@ class VoltrClient extends AccountUtils {
|
|
|
523
523
|
* );
|
|
524
524
|
* ```
|
|
525
525
|
*/
|
|
526
|
-
async createDepositStrategyIx({ depositAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.
|
|
526
|
+
async createDepositStrategyIx({ depositAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
|
|
527
527
|
return await this.vaultProgram.methods
|
|
528
528
|
.depositStrategy(depositAmount, instructionDiscriminator, additionalArgs)
|
|
529
529
|
.accounts({
|
|
@@ -573,7 +573,7 @@ class VoltrClient extends AccountUtils {
|
|
|
573
573
|
* );
|
|
574
574
|
* ```
|
|
575
575
|
*/
|
|
576
|
-
async createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.
|
|
576
|
+
async createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator = null, additionalArgs = null, }, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
|
|
577
577
|
return await this.vaultProgram.methods
|
|
578
578
|
.withdrawStrategy(withdrawAmount, instructionDiscriminator, additionalArgs)
|
|
579
579
|
.accounts({
|
|
@@ -605,7 +605,7 @@ class VoltrClient extends AccountUtils {
|
|
|
605
605
|
* });
|
|
606
606
|
* ```
|
|
607
607
|
*/
|
|
608
|
-
async createRemoveAdaptorIx({ vault, admin, adaptorProgram = constants_1.
|
|
608
|
+
async createRemoveAdaptorIx({ vault, admin, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, }) {
|
|
609
609
|
return await this.vaultProgram.methods
|
|
610
610
|
.removeAdaptor()
|
|
611
611
|
.accountsPartial({
|
|
@@ -648,7 +648,7 @@ class VoltrClient extends AccountUtils {
|
|
|
648
648
|
* );
|
|
649
649
|
* ```
|
|
650
650
|
*/
|
|
651
|
-
async createInitializeDirectWithdrawStrategyIx({ instructionDiscriminator = null, additionalArgs = null, allowUserArgs = false, }, { payer, admin, vault, strategy, adaptorProgram = constants_1.
|
|
651
|
+
async createInitializeDirectWithdrawStrategyIx({ instructionDiscriminator = null, additionalArgs = null, allowUserArgs = false, }, { payer, admin, vault, strategy, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, }) {
|
|
652
652
|
return await this.vaultProgram.methods
|
|
653
653
|
.initializeDirectWithdrawStrategy(instructionDiscriminator, additionalArgs, allowUserArgs)
|
|
654
654
|
.accountsPartial({
|
|
@@ -699,7 +699,7 @@ class VoltrClient extends AccountUtils {
|
|
|
699
699
|
* );
|
|
700
700
|
* ```
|
|
701
701
|
*/
|
|
702
|
-
async createDirectWithdrawStrategyIx({ amount, isAmountInLp, isWithdrawAll, userArgs = null, }, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram = constants_1.
|
|
702
|
+
async createDirectWithdrawStrategyIx({ amount, isAmountInLp, isWithdrawAll, userArgs = null, }, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram = constants_1.LENDING_ADAPTOR_PROGRAM_ID, remainingAccounts, }) {
|
|
703
703
|
return await this.vaultProgram.methods
|
|
704
704
|
.directWithdrawStrategy(amount, isAmountInLp, isWithdrawAll, userArgs)
|
|
705
705
|
.accounts({
|
package/dist/constants.d.ts
CHANGED
|
@@ -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
|
|
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.
|
|
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.
|
|
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"),
|
|
@@ -2954,6 +2954,11 @@
|
|
|
2954
2954
|
"code": 6013,
|
|
2955
2955
|
"name": "AdaptorEpochInvalid",
|
|
2956
2956
|
"msg": "Adaptor epoch invalid."
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
"code": 6014,
|
|
2960
|
+
"name": "InvalidFeeConfiguration",
|
|
2961
|
+
"msg": "Fee configuration invalid."
|
|
2957
2962
|
}
|
|
2958
2963
|
],
|
|
2959
2964
|
"types": [
|
|
@@ -3188,13 +3193,71 @@
|
|
|
3188
3193
|
"type": {
|
|
3189
3194
|
"array": [
|
|
3190
3195
|
"u8",
|
|
3191
|
-
|
|
3196
|
+
24
|
|
3192
3197
|
]
|
|
3193
3198
|
}
|
|
3194
3199
|
}
|
|
3195
3200
|
]
|
|
3196
3201
|
}
|
|
3197
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
|
|
3235
|
+
]
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
]
|
|
3239
|
+
}
|
|
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
|
+
},
|
|
3198
3261
|
{
|
|
3199
3262
|
"name": "Protocol",
|
|
3200
3263
|
"serialization": "bytemuckunsafe",
|
|
@@ -3423,7 +3486,7 @@
|
|
|
3423
3486
|
{
|
|
3424
3487
|
"name": "vault_configuration",
|
|
3425
3488
|
"docs": [
|
|
3426
|
-
"The vault fee and
|
|
3489
|
+
"The vault fee, cap, and locked profit degradation duration configuration (inline nested struct)."
|
|
3427
3490
|
],
|
|
3428
3491
|
"type": {
|
|
3429
3492
|
"defined": {
|
|
@@ -3453,6 +3516,14 @@
|
|
|
3453
3516
|
}
|
|
3454
3517
|
}
|
|
3455
3518
|
},
|
|
3519
|
+
{
|
|
3520
|
+
"name": "high_water_mark",
|
|
3521
|
+
"type": {
|
|
3522
|
+
"defined": {
|
|
3523
|
+
"name": "HighWaterMark"
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
},
|
|
3456
3527
|
{
|
|
3457
3528
|
"name": "last_updated_ts",
|
|
3458
3529
|
"docs": [
|
|
@@ -3479,6 +3550,17 @@
|
|
|
3479
3550
|
]
|
|
3480
3551
|
}
|
|
3481
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
|
+
},
|
|
3482
3564
|
{
|
|
3483
3565
|
"name": "reserved",
|
|
3484
3566
|
"docs": [
|
|
@@ -3487,7 +3569,7 @@
|
|
|
3487
3569
|
"type": {
|
|
3488
3570
|
"array": [
|
|
3489
3571
|
"u8",
|
|
3490
|
-
|
|
3572
|
+
240
|
|
3491
3573
|
]
|
|
3492
3574
|
}
|
|
3493
3575
|
}
|
|
@@ -3569,6 +3651,13 @@
|
|
|
3569
3651
|
],
|
|
3570
3652
|
"type": "u64"
|
|
3571
3653
|
},
|
|
3654
|
+
{
|
|
3655
|
+
"name": "locked_profit_degradation_duration",
|
|
3656
|
+
"docs": [
|
|
3657
|
+
"The locked profit degradation duration."
|
|
3658
|
+
],
|
|
3659
|
+
"type": "u64"
|
|
3660
|
+
},
|
|
3572
3661
|
{
|
|
3573
3662
|
"name": "reserved",
|
|
3574
3663
|
"docs": [
|
|
@@ -3577,7 +3666,7 @@
|
|
|
3577
3666
|
"type": {
|
|
3578
3667
|
"array": [
|
|
3579
3668
|
"u8",
|
|
3580
|
-
|
|
3669
|
+
56
|
|
3581
3670
|
]
|
|
3582
3671
|
}
|
|
3583
3672
|
}
|
|
@@ -3630,6 +3719,13 @@
|
|
|
3630
3719
|
"Admin management fee in basis points (BPS)."
|
|
3631
3720
|
],
|
|
3632
3721
|
"type": "u16"
|
|
3722
|
+
},
|
|
3723
|
+
{
|
|
3724
|
+
"name": "locked_profit_degradation_duration",
|
|
3725
|
+
"docs": [
|
|
3726
|
+
"The locked profit degradation duration."
|
|
3727
|
+
],
|
|
3728
|
+
"type": "u64"
|
|
3633
3729
|
}
|
|
3634
3730
|
]
|
|
3635
3731
|
}
|
package/dist/types/vault.d.ts
CHANGED
|
@@ -2960,6 +2960,11 @@ export type VoltrVault = {
|
|
|
2960
2960
|
"code": 6013;
|
|
2961
2961
|
"name": "adaptorEpochInvalid";
|
|
2962
2962
|
"msg": "Adaptor epoch invalid.";
|
|
2963
|
+
},
|
|
2964
|
+
{
|
|
2965
|
+
"code": 6014;
|
|
2966
|
+
"name": "invalidFeeConfiguration";
|
|
2967
|
+
"msg": "Fee configuration invalid.";
|
|
2963
2968
|
}
|
|
2964
2969
|
];
|
|
2965
2970
|
"types": [
|
|
@@ -3194,13 +3199,71 @@ export type VoltrVault = {
|
|
|
3194
3199
|
"type": {
|
|
3195
3200
|
"array": [
|
|
3196
3201
|
"u8",
|
|
3197
|
-
|
|
3202
|
+
24
|
|
3198
3203
|
];
|
|
3199
3204
|
};
|
|
3200
3205
|
}
|
|
3201
3206
|
];
|
|
3202
3207
|
};
|
|
3203
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
|
|
3241
|
+
];
|
|
3242
|
+
};
|
|
3243
|
+
}
|
|
3244
|
+
];
|
|
3245
|
+
};
|
|
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
|
+
},
|
|
3204
3267
|
{
|
|
3205
3268
|
"name": "protocol";
|
|
3206
3269
|
"serialization": "bytemuckunsafe";
|
|
@@ -3429,7 +3492,7 @@ export type VoltrVault = {
|
|
|
3429
3492
|
{
|
|
3430
3493
|
"name": "vaultConfiguration";
|
|
3431
3494
|
"docs": [
|
|
3432
|
-
"The vault fee and
|
|
3495
|
+
"The vault fee, cap, and locked profit degradation duration configuration (inline nested struct)."
|
|
3433
3496
|
];
|
|
3434
3497
|
"type": {
|
|
3435
3498
|
"defined": {
|
|
@@ -3459,6 +3522,14 @@ export type VoltrVault = {
|
|
|
3459
3522
|
};
|
|
3460
3523
|
};
|
|
3461
3524
|
},
|
|
3525
|
+
{
|
|
3526
|
+
"name": "highWaterMark";
|
|
3527
|
+
"type": {
|
|
3528
|
+
"defined": {
|
|
3529
|
+
"name": "highWaterMark";
|
|
3530
|
+
};
|
|
3531
|
+
};
|
|
3532
|
+
},
|
|
3462
3533
|
{
|
|
3463
3534
|
"name": "lastUpdatedTs";
|
|
3464
3535
|
"docs": [
|
|
@@ -3485,6 +3556,17 @@ export type VoltrVault = {
|
|
|
3485
3556
|
];
|
|
3486
3557
|
};
|
|
3487
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
|
+
},
|
|
3488
3570
|
{
|
|
3489
3571
|
"name": "reserved";
|
|
3490
3572
|
"docs": [
|
|
@@ -3493,7 +3575,7 @@ export type VoltrVault = {
|
|
|
3493
3575
|
"type": {
|
|
3494
3576
|
"array": [
|
|
3495
3577
|
"u8",
|
|
3496
|
-
|
|
3578
|
+
240
|
|
3497
3579
|
];
|
|
3498
3580
|
};
|
|
3499
3581
|
}
|
|
@@ -3575,6 +3657,13 @@ export type VoltrVault = {
|
|
|
3575
3657
|
];
|
|
3576
3658
|
"type": "u64";
|
|
3577
3659
|
},
|
|
3660
|
+
{
|
|
3661
|
+
"name": "lockedProfitDegradationDuration";
|
|
3662
|
+
"docs": [
|
|
3663
|
+
"The locked profit degradation duration."
|
|
3664
|
+
];
|
|
3665
|
+
"type": "u64";
|
|
3666
|
+
},
|
|
3578
3667
|
{
|
|
3579
3668
|
"name": "reserved";
|
|
3580
3669
|
"docs": [
|
|
@@ -3583,7 +3672,7 @@ export type VoltrVault = {
|
|
|
3583
3672
|
"type": {
|
|
3584
3673
|
"array": [
|
|
3585
3674
|
"u8",
|
|
3586
|
-
|
|
3675
|
+
56
|
|
3587
3676
|
];
|
|
3588
3677
|
};
|
|
3589
3678
|
}
|
|
@@ -3636,6 +3725,13 @@ export type VoltrVault = {
|
|
|
3636
3725
|
"Admin management fee in basis points (BPS)."
|
|
3637
3726
|
];
|
|
3638
3727
|
"type": "u16";
|
|
3728
|
+
},
|
|
3729
|
+
{
|
|
3730
|
+
"name": "lockedProfitDegradationDuration";
|
|
3731
|
+
"docs": [
|
|
3732
|
+
"The locked profit degradation duration."
|
|
3733
|
+
];
|
|
3734
|
+
"type": "u64";
|
|
3639
3735
|
}
|
|
3640
3736
|
];
|
|
3641
3737
|
};
|