@kamino-finance/klend-sdk 5.10.15 → 5.10.17
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/classes/manager.d.ts +14 -3
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +19 -6
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/vault.d.ts +11 -6
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +22 -17
- package/dist/classes/vault.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +2 -2
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +2 -2
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/index.js +1 -1
- package/dist/idl_codegen_kamino_vault/errors/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initVault.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/invest.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateSharesMetadata.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateSharesMetadata.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/programId.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/programId.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/programId.js +3 -1
- package/dist/idl_codegen_kamino_vault/programId.js.map +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +4 -1
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/manager.ts +31 -8
- package/src/classes/vault.ts +32 -18
- package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +1 -1
- package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +1 -1
- package/src/idl_codegen_kamino_vault/errors/index.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/deposit.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/giveUpPendingFees.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/initVault.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/invest.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/updateAdmin.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/updateSharesMetadata.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.ts +1 -1
- package/src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts +1 -1
- package/src/idl_codegen_kamino_vault/programId.ts +2 -0
- package/src/lib.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateReserveAllocation.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,0DAoCC;AA7DD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,
|
|
1
|
+
{"version":3,"file":"updateReserveAllocation.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,0DAoCC;AA7DD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAmB5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAE3E,SAAgB,uBAAuB,CACrC,IAAiC,EACjC,QAAyC,EACzC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QACrE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,KAA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AAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -43,7 +43,7 @@ exports.layout = borsh.struct([
|
|
|
43
43
|
borsh.str("symbol"),
|
|
44
44
|
borsh.str("uri"),
|
|
45
45
|
]);
|
|
46
|
-
function updateSharesMetadata(args, accounts, programId = programId_1.
|
|
46
|
+
function updateSharesMetadata(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
47
47
|
const keys = [
|
|
48
48
|
{ pubkey: accounts.adminAuthority, isSigner: true, isWritable: true },
|
|
49
49
|
{ pubkey: accounts.vaultState, isSigner: false, isWritable: false },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateSharesMetadata.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/updateSharesMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,oDAyBC;AAnDD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,
|
|
1
|
+
{"version":3,"file":"updateSharesMetadata.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/updateSharesMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,oDAyBC;AAnDD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAgB5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;IACjB,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;IACnB,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;CACjB,CAAC,CAAA;AAEF,SAAgB,oBAAoB,CAClC,IAA8B,EAC9B,Q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AAA;AACX,CAAC"}
|
|
@@ -43,7 +43,7 @@ exports.layout = borsh.struct([
|
|
|
43
43
|
types.VaultConfigField.layout("entry"),
|
|
44
44
|
borsh.vecU8("data"),
|
|
45
45
|
]);
|
|
46
|
-
function updateVaultConfig(args, accounts, programId = programId_1.
|
|
46
|
+
function updateVaultConfig(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
47
47
|
const keys = [
|
|
48
48
|
{ pubkey: accounts.adminAuthority, isSigner: true, isWritable: false },
|
|
49
49
|
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateVaultConfig.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,8CA0BC;AAhDD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAClG,gDAAiC,CAAC,wDAAwD;AAC1F,
|
|
1
|
+
{"version":3,"file":"updateVaultConfig.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,8CA0BC;AAhDD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAClG,gDAAiC,CAAC,wDAAwD;AAC1F,4CAAyC;AAa5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC;IACtC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;CACpB,CAAC,CAAA;AAEF,SAAgB,iBAAiB,CAC/B,IAA2B,EAC3B,QAAmC,EACnC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QAClE,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;KACtE,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;IACrE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;QAC/B,IAAI,EAAE,MAAM,CAAC,IAAI,CACf,IAAI,CAAC,IAAI,CAAC,MAAM,EAChB,IAAI,CAAC,IAAI,CAAC,UAAU,EACpB,IAAI,CAAC,IAAI,CAAC,MAAM,CACjB;KACF,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -39,7 +39,7 @@ const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript
|
|
|
39
39
|
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
40
40
|
const programId_1 = require("../programId");
|
|
41
41
|
exports.layout = borsh.struct([borsh.u64("sharesAmount")]);
|
|
42
|
-
function withdraw(args, accounts, programId = programId_1.
|
|
42
|
+
function withdraw(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
43
43
|
const keys = [
|
|
44
44
|
{
|
|
45
45
|
pubkey: accounts.withdrawFromAvailable.user,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/withdraw.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,4BAuHC;AA9JD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,
|
|
1
|
+
{"version":3,"file":"withdraw.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/withdraw.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,4BAuHC;AA9JD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAiC5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA;AAE/D,SAAgB,QAAQ,CACtB,IAAkB,EAClB,QAA0B,EAC1B,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B;YACE,MAAM,EAAE,QAAQ,CAAC,qBAAqB,CAAC,IAAI;YAC3C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,qBAAqB,CAAC,UAAU;YACjD,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,qBAAqB,CAAC,UAAU;YACjD,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ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AA;AACX,CAAC"}
|
|
@@ -39,7 +39,7 @@ const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript
|
|
|
39
39
|
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
40
40
|
const programId_1 = require("../programId");
|
|
41
41
|
exports.layout = borsh.struct([borsh.u64("sharesAmount")]);
|
|
42
|
-
function withdrawFromAvailable(args, accounts, programId = programId_1.
|
|
42
|
+
function withdrawFromAvailable(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
43
43
|
const keys = [
|
|
44
44
|
{ pubkey: accounts.user, isSigner: true, isWritable: true },
|
|
45
45
|
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawFromAvailable.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,sDA6BC;AAvDD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,
|
|
1
|
+
{"version":3,"file":"withdrawFromAvailable.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,sDA6BC;AAvDD,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAoB5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA;AAE/D,SAAgB,qBAAqB,CACnC,IAA+B,EAC/B,QAAuC,EACvC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,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M,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,YAAY,EAAE,IAAI,CAAC,YAAY;KAChC,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withdrawPendingFees = withdrawPendingFees;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
5
|
const programId_1 = require("../programId");
|
|
6
|
-
function withdrawPendingFees(accounts, programId = programId_1.
|
|
6
|
+
function withdrawPendingFees(accounts, programId = programId_1.PROGRAM_ID) {
|
|
7
7
|
const keys = [
|
|
8
8
|
{ pubkey: accounts.adminAuthority, isSigner: true, isWritable: true },
|
|
9
9
|
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawPendingFees.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts"],"names":[],"mappings":";;AA0BA,kDA8CC;AAxED,6CAAgF,CAAC,wDAAwD;AAIzI,
|
|
1
|
+
{"version":3,"file":"withdrawPendingFees.js","sourceRoot":"","sources":["../../../src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts"],"names":[],"mappings":";;AA0BA,kDA8CC;AAxED,6CAAgF,CAAC,wDAAwD;AAIzI,4CAAyC;AAsBzC,SAAgB,mBAAmB,CACjC,QAA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;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACrE,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACrE;YACE,MAAM,EAAE,QAAQ,CAAC,6BAA6B;YAC9C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,wBAAwB;YACzC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;KACF,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;IACxE,MAAM,IAAI,GAAG,UAAU,CAAA;IACvB,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
2
|
export declare const KVAULTS_PROGRAM_ID_CLI: PublicKey;
|
|
3
3
|
export declare let KVAULTS_PROGRAM_ID: PublicKey;
|
|
4
|
+
export declare let PROGRAM_ID: PublicKey;
|
|
4
5
|
export declare const setKVaultsProgramId: (programId: PublicKey) => void;
|
|
5
6
|
//# sourceMappingURL=programId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programId.d.ts","sourceRoot":"","sources":["../../src/idl_codegen_kamino_vault/programId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,eAAO,MAAM,sBAAsB,WAElC,CAAA;AAGD,eAAO,IAAI,kBAAkB,EAAE,SAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"programId.d.ts","sourceRoot":"","sources":["../../src/idl_codegen_kamino_vault/programId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,eAAO,MAAM,sBAAsB,WAElC,CAAA;AAGD,eAAO,IAAI,kBAAkB,EAAE,SAAkC,CAAA;AACjE,eAAO,IAAI,UAAU,EAAE,SAAkC,CAAA;AAEzD,eAAO,MAAM,mBAAmB,cAAe,SAAS,SAGvD,CAAA"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setKVaultsProgramId = exports.KVAULTS_PROGRAM_ID = exports.KVAULTS_PROGRAM_ID_CLI = void 0;
|
|
3
|
+
exports.setKVaultsProgramId = exports.PROGRAM_ID = exports.KVAULTS_PROGRAM_ID = exports.KVAULTS_PROGRAM_ID_CLI = void 0;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
5
|
// Program ID passed with the cli --program-id flag when running the code generator. Do not edit, it will get overwritten.
|
|
6
6
|
exports.KVAULTS_PROGRAM_ID_CLI = new web3_js_1.PublicKey("kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr");
|
|
7
7
|
// This constant will not get overwritten on subsequent code generations and it's safe to modify it's value.
|
|
8
8
|
exports.KVAULTS_PROGRAM_ID = exports.KVAULTS_PROGRAM_ID_CLI;
|
|
9
|
+
exports.PROGRAM_ID = exports.KVAULTS_PROGRAM_ID_CLI;
|
|
9
10
|
const setKVaultsProgramId = (programId) => {
|
|
10
11
|
exports.KVAULTS_PROGRAM_ID = programId;
|
|
12
|
+
exports.PROGRAM_ID = programId;
|
|
11
13
|
};
|
|
12
14
|
exports.setKVaultsProgramId = setKVaultsProgramId;
|
|
13
15
|
//# sourceMappingURL=programId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programId.js","sourceRoot":"","sources":["../../src/idl_codegen_kamino_vault/programId.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,0HAA0H;AAC7G,QAAA,sBAAsB,GAAG,IAAI,mBAAS,CACjD,6CAA6C,CAC9C,CAAA;AAED,4GAA4G;AACjG,QAAA,kBAAkB,GAAc,8BAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"programId.js","sourceRoot":"","sources":["../../src/idl_codegen_kamino_vault/programId.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,0HAA0H;AAC7G,QAAA,sBAAsB,GAAG,IAAI,mBAAS,CACjD,6CAA6C,CAC9C,CAAA;AAED,4GAA4G;AACjG,QAAA,kBAAkB,GAAc,8BAAsB,CAAA;AACtD,QAAA,UAAU,GAAc,8BAAsB,CAAA;AAElD,MAAM,mBAAmB,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC1D,0BAAkB,GAAG,SAAS,CAAC;IAC/B,kBAAU,GAAG,SAAS,CAAC;AACzB,CAAC,CAAA;AAHY,QAAA,mBAAmB,uBAG/B"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './idl_codegen/zero_padding';
|
|
|
5
5
|
export * from './idl_codegen_kamino_vault/instructions';
|
|
6
6
|
export * from './idl_codegen_kamino_vault/accounts/VaultState';
|
|
7
7
|
export * from './idl_codegen_kamino_vault/types';
|
|
8
|
-
export
|
|
8
|
+
export { KVAULTS_PROGRAM_ID, setKVaultsProgramId } from './idl_codegen_kamino_vault/programId';
|
|
9
9
|
export * from './classes';
|
|
10
10
|
export * from './utils';
|
|
11
11
|
export * from './leverage';
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,yCAAyC,CAAC;AAExD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kCAAkC,CAAC;AACjD,
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,yCAAyC,CAAC;AAExD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE/F,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC"}
|
package/dist/lib.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.setKVaultsProgramId = exports.KVAULTS_PROGRAM_ID = void 0;
|
|
17
18
|
__exportStar(require("./idl_codegen/instructions"), exports);
|
|
18
19
|
__exportStar(require("./idl_codegen/accounts"), exports);
|
|
19
20
|
__exportStar(require("./idl_codegen/programId"), exports);
|
|
@@ -22,7 +23,9 @@ __exportStar(require("./idl_codegen_kamino_vault/instructions"), exports);
|
|
|
22
23
|
// only export vault state, do not export Reserve as it's the same one in main klend /idl_codegen/accounts
|
|
23
24
|
__exportStar(require("./idl_codegen_kamino_vault/accounts/VaultState"), exports);
|
|
24
25
|
__exportStar(require("./idl_codegen_kamino_vault/types"), exports);
|
|
25
|
-
|
|
26
|
+
var programId_1 = require("./idl_codegen_kamino_vault/programId");
|
|
27
|
+
Object.defineProperty(exports, "KVAULTS_PROGRAM_ID", { enumerable: true, get: function () { return programId_1.KVAULTS_PROGRAM_ID; } });
|
|
28
|
+
Object.defineProperty(exports, "setKVaultsProgramId", { enumerable: true, get: function () { return programId_1.setKVaultsProgramId; } });
|
|
26
29
|
__exportStar(require("./classes"), exports);
|
|
27
30
|
__exportStar(require("./utils"), exports);
|
|
28
31
|
__exportStar(require("./leverage"), exports);
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAE3C,0EAAwD;AACxD,0GAA0G;AAC1G,iFAA+D;AAC/D,mEAAiD;AACjD,kEAA+F;AAAtF,+GAAA,kBAAkB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAEhD,4CAA0B;AAC1B,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B;AAC5B,uDAAqC"}
|
package/package.json
CHANGED
package/src/classes/manager.ts
CHANGED
|
@@ -674,15 +674,17 @@ export class KaminoManager {
|
|
|
674
674
|
* @param price - the price of the token in the vault (e.g. USDC)
|
|
675
675
|
* @param [slot] - the slot for which to calculate the holdings. Optional. If not provided the function will fetch the current slot
|
|
676
676
|
* @param [vaultReservesMap] - hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
677
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
677
678
|
* @returns an VaultHoldingsWithUSDValue object with details about the tokens available and invested in the vault, denominated in tokens and USD
|
|
678
679
|
*/
|
|
679
680
|
async getVaultHoldingsWithPrice(
|
|
680
681
|
vault: VaultState,
|
|
681
682
|
price: Decimal,
|
|
682
683
|
slot?: number,
|
|
683
|
-
vaultReserves?: PubkeyHashMap<PublicKey, KaminoReserve
|
|
684
|
+
vaultReserves?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
685
|
+
currentSlot?: number
|
|
684
686
|
): Promise<VaultHoldingsWithUSDValue> {
|
|
685
|
-
return this._vaultClient.getVaultHoldingsWithPrice(vault, price, slot, vaultReserves);
|
|
687
|
+
return this._vaultClient.getVaultHoldingsWithPrice(vault, price, slot, vaultReserves, currentSlot);
|
|
686
688
|
}
|
|
687
689
|
|
|
688
690
|
/**
|
|
@@ -692,6 +694,7 @@ export class KaminoManager {
|
|
|
692
694
|
* @param [slot] - the slot for which to retrieve the vault overview for. Optional. If not provided the function will fetch the current slot
|
|
693
695
|
* @param [vaultReservesMap] - hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
694
696
|
* @param [kaminoMarkets] - a list of all kamino markets. Optional. If provided the function will be significantly faster as it will not have to fetch the markets
|
|
697
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
695
698
|
* @returns an VaultOverview object with details about the tokens available and invested in the vault, denominated in tokens and USD
|
|
696
699
|
*/
|
|
697
700
|
async getVaultOverview(
|
|
@@ -699,9 +702,10 @@ export class KaminoManager {
|
|
|
699
702
|
price: Decimal,
|
|
700
703
|
slot?: number,
|
|
701
704
|
vaultReserves?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
702
|
-
kaminoMarkets?: KaminoMarket[]
|
|
705
|
+
kaminoMarkets?: KaminoMarket[],
|
|
706
|
+
currentSlot?: number
|
|
703
707
|
): Promise<VaultOverview> {
|
|
704
|
-
return this._vaultClient.getVaultOverview(vault, price, slot, vaultReserves, kaminoMarkets);
|
|
708
|
+
return this._vaultClient.getVaultOverview(vault, price, slot, vaultReserves, kaminoMarkets, currentSlot);
|
|
705
709
|
}
|
|
706
710
|
|
|
707
711
|
/**
|
|
@@ -774,22 +778,41 @@ export class KaminoManager {
|
|
|
774
778
|
* @param [vaultReservesMap] - hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
775
779
|
* @param [currentSlot] - the current slot. Optional. If not provided it will fetch the current slot
|
|
776
780
|
* @param [previousTotalAUM] - the previous AUM of the vault to compute the earned interest relative to this value. Optional. If not provided the function will estimate the total AUM at the slot of the last state update on chain
|
|
781
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
777
782
|
* @returns a struct of simulated vault holdings and earned interest
|
|
778
783
|
*/
|
|
779
784
|
async calculateSimulatedHoldingsWithInterest(
|
|
780
785
|
vaultState: VaultState,
|
|
781
786
|
vaultReserves?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
782
|
-
|
|
783
|
-
previousTotalAUM?: Decimal
|
|
787
|
+
slot?: number,
|
|
788
|
+
previousTotalAUM?: Decimal,
|
|
789
|
+
currentSlot?: number
|
|
784
790
|
): Promise<SimulatedVaultHoldingsWithEarnedInterest> {
|
|
785
791
|
return this._vaultClient.calculateSimulatedHoldingsWithInterest(
|
|
786
792
|
vaultState,
|
|
787
793
|
vaultReserves,
|
|
788
|
-
|
|
789
|
-
previousTotalAUM
|
|
794
|
+
slot,
|
|
795
|
+
previousTotalAUM,
|
|
796
|
+
currentSlot
|
|
790
797
|
);
|
|
791
798
|
}
|
|
792
799
|
|
|
800
|
+
/** Read the total holdings of a vault and the reserve weights and returns a map from each reserve to how many tokens should be deposited.
|
|
801
|
+
* @param vaultState - the vault state to calculate the allocation for
|
|
802
|
+
* @param [slot] - the slot for which to calculate the allocation. Optional. If not provided the function will fetch the current slot
|
|
803
|
+
* @param [vaultReserves] - a hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
804
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
805
|
+
* @returns - a map from each reserve to how many tokens should be invested into
|
|
806
|
+
*/
|
|
807
|
+
async getVaultComputedReservesAllocation(
|
|
808
|
+
vaultState: VaultState,
|
|
809
|
+
slot?: number,
|
|
810
|
+
vaultReserves?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
811
|
+
currentSlot?: number
|
|
812
|
+
): Promise<PubkeyHashMap<PublicKey, Decimal>> {
|
|
813
|
+
return this._vaultClient.getVaultComputedReservesAllocation(vaultState, slot, vaultReserves, currentSlot);
|
|
814
|
+
}
|
|
815
|
+
|
|
793
816
|
/**
|
|
794
817
|
* Simulate the current holdings and compute the fees that would be charged
|
|
795
818
|
* @param vaultState the kamino vault state to get simulated fees for
|
package/src/classes/vault.ts
CHANGED
|
@@ -151,7 +151,7 @@ export class KaminoVaultClient {
|
|
|
151
151
|
const vaultName = this.decodeVaultName(vault.name);
|
|
152
152
|
const slot = await this.getConnection().getSlot('confirmed');
|
|
153
153
|
const tokensPerShare = await this.getTokensPerShareSingleVault(kaminoVault, slot);
|
|
154
|
-
const holdings = await this.getVaultHoldings(vault);
|
|
154
|
+
const holdings = await this.getVaultHoldings(vault, slot);
|
|
155
155
|
|
|
156
156
|
const sharesIssued = new Decimal(vault.sharesIssued.toString()!).div(
|
|
157
157
|
new Decimal(vault.sharesMintDecimals.toString())
|
|
@@ -1482,10 +1482,18 @@ export class KaminoVaultClient {
|
|
|
1482
1482
|
|
|
1483
1483
|
/** Read the total holdings of a vault and the reserve weights and returns a map from each reserve to how many tokens should be deposited.
|
|
1484
1484
|
* @param vaultState - the vault state to calculate the allocation for
|
|
1485
|
+
* @param [slot] - the slot for which to calculate the allocation. Optional. If not provided the function will fetch the current slot
|
|
1486
|
+
* @param [vaultReserves] - a hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
1487
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
1485
1488
|
* @returns - a map from each reserve to how many tokens should be invested into
|
|
1486
1489
|
*/
|
|
1487
|
-
async getVaultComputedReservesAllocation(
|
|
1488
|
-
|
|
1490
|
+
async getVaultComputedReservesAllocation(
|
|
1491
|
+
vaultState: VaultState,
|
|
1492
|
+
slot?: number,
|
|
1493
|
+
vaultReserves?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
1494
|
+
currentSlot?: number
|
|
1495
|
+
): Promise<PubkeyHashMap<PublicKey, Decimal>> {
|
|
1496
|
+
const holdings = await this.getVaultHoldings(vaultState, slot, vaultReserves, currentSlot);
|
|
1489
1497
|
const initialVaultAllocations = this.getVaultAllocations(vaultState);
|
|
1490
1498
|
|
|
1491
1499
|
const allReserves = this.getVaultReserves(vaultState);
|
|
@@ -2096,16 +2104,17 @@ export class KaminoVaultClient {
|
|
|
2096
2104
|
* @param price - the price of the token in the vault (e.g. USDC)
|
|
2097
2105
|
* @param [slot] - the slot for which to retrieve the vault overview for. Optional. If not provided the function will fetch the current slot
|
|
2098
2106
|
* @param [vaultReservesMap] - hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
2099
|
-
* @param [
|
|
2107
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
2100
2108
|
* @returns an VaultOverview object with details about the tokens available and invested in the vault, denominated in tokens and USD
|
|
2101
2109
|
*/
|
|
2102
2110
|
async getVaultHoldingsWithPrice(
|
|
2103
2111
|
vault: VaultState,
|
|
2104
2112
|
price: Decimal,
|
|
2105
2113
|
slot?: number,
|
|
2106
|
-
vaultReservesMap?: PubkeyHashMap<PublicKey, KaminoReserve
|
|
2114
|
+
vaultReservesMap?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
2115
|
+
currentSlot?: number
|
|
2107
2116
|
): Promise<VaultHoldingsWithUSDValue> {
|
|
2108
|
-
const holdings = await this.getVaultHoldings(vault, slot, vaultReservesMap);
|
|
2117
|
+
const holdings = await this.getVaultHoldings(vault, slot, vaultReservesMap, currentSlot);
|
|
2109
2118
|
|
|
2110
2119
|
const investedInReservesUSD = new PubkeyHashMap<PublicKey, Decimal>();
|
|
2111
2120
|
holdings.investedInReserves.forEach((amount, reserve) => {
|
|
@@ -2128,6 +2137,7 @@ export class KaminoVaultClient {
|
|
|
2128
2137
|
* @param [slot] - the slot for which to retrieve the vault overview for. Optional. If not provided the function will fetch the current slot
|
|
2129
2138
|
* @param [vaultReservesMap] - hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
2130
2139
|
* @param [kaminoMarkets] - a list of all kamino markets. Optional. If provided the function will be significantly faster as it will not have to fetch the markets
|
|
2140
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
2131
2141
|
* @returns an VaultOverview object with details about the tokens available and invested in the vault, denominated in tokens and USD
|
|
2132
2142
|
*/
|
|
2133
2143
|
async getVaultOverview(
|
|
@@ -2135,7 +2145,8 @@ export class KaminoVaultClient {
|
|
|
2135
2145
|
price: Decimal,
|
|
2136
2146
|
slot?: number,
|
|
2137
2147
|
vaultReservesMap?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
2138
|
-
kaminoMarkets?: KaminoMarket[]
|
|
2148
|
+
kaminoMarkets?: KaminoMarket[],
|
|
2149
|
+
currentSlot?: number
|
|
2139
2150
|
): Promise<VaultOverview> {
|
|
2140
2151
|
const vaultReservesState = vaultReservesMap ? vaultReservesMap : await this.loadVaultReserves(vault);
|
|
2141
2152
|
|
|
@@ -2143,24 +2154,25 @@ export class KaminoVaultClient {
|
|
|
2143
2154
|
vault,
|
|
2144
2155
|
price,
|
|
2145
2156
|
slot,
|
|
2146
|
-
vaultReservesState
|
|
2157
|
+
vaultReservesState,
|
|
2158
|
+
currentSlot
|
|
2147
2159
|
);
|
|
2148
2160
|
|
|
2149
|
-
const
|
|
2161
|
+
const slotForOverview = slot ? slot : await this.getConnection().getSlot();
|
|
2150
2162
|
|
|
2151
|
-
const vaultTheoreticalAPYPromise = await this.getVaultTheoreticalAPY(vault,
|
|
2163
|
+
const vaultTheoreticalAPYPromise = await this.getVaultTheoreticalAPY(vault, slotForOverview, vaultReservesState);
|
|
2152
2164
|
const totalInvestedAndBorrowedPromise = await this.getTotalBorrowedAndInvested(
|
|
2153
2165
|
vault,
|
|
2154
|
-
|
|
2166
|
+
slotForOverview,
|
|
2155
2167
|
vaultReservesState
|
|
2156
2168
|
);
|
|
2157
2169
|
const vaultCollateralsPromise = await this.getVaultCollaterals(
|
|
2158
2170
|
vault,
|
|
2159
|
-
|
|
2171
|
+
slotForOverview,
|
|
2160
2172
|
vaultReservesState,
|
|
2161
2173
|
kaminoMarkets
|
|
2162
2174
|
);
|
|
2163
|
-
const reservesOverviewPromise = await this.getVaultReservesDetails(vault,
|
|
2175
|
+
const reservesOverviewPromise = await this.getVaultReservesDetails(vault, slotForOverview, vaultReservesState);
|
|
2164
2176
|
|
|
2165
2177
|
// all the async part of the functions above just read the vaultReservesState which is read beforehand, so excepting vaultCollateralsPromise they should do no additional network calls
|
|
2166
2178
|
const [
|
|
@@ -2349,14 +2361,16 @@ export class KaminoVaultClient {
|
|
|
2349
2361
|
* @param vaultState the kamino vault state to get simulated holdings and earnings for
|
|
2350
2362
|
* @param [vaultReservesMap] - hashmap from each reserve pubkey to the reserve state. Optional. If provided the function will be significantly faster as it will not have to fetch the reserves
|
|
2351
2363
|
* @param [currentSlot] - the current slot. Optional. If not provided it will fetch the current slot
|
|
2352
|
-
* @param [
|
|
2364
|
+
* @param [previousNetAUM] - the previous AUM of the vault to compute the earned interest relative to this value. Optional. If not provided the function will estimate the total AUM at the slot of the last state update on chain
|
|
2365
|
+
* @param [currentSlot] - the latest confirmed slot. Optional. If provided the function will be faster as it will not have to fetch the latest slot
|
|
2353
2366
|
* @returns a struct of simulated vault holdings and earned interest
|
|
2354
2367
|
*/
|
|
2355
2368
|
async calculateSimulatedHoldingsWithInterest(
|
|
2356
2369
|
vaultState: VaultState,
|
|
2357
2370
|
vaultReservesMap?: PubkeyHashMap<PublicKey, KaminoReserve>,
|
|
2358
|
-
|
|
2359
|
-
previousNetAUM?: Decimal
|
|
2371
|
+
slot?: number,
|
|
2372
|
+
previousNetAUM?: Decimal,
|
|
2373
|
+
currentSlot?: number
|
|
2360
2374
|
): Promise<SimulatedVaultHoldingsWithEarnedInterest> {
|
|
2361
2375
|
let prevAUM: Decimal;
|
|
2362
2376
|
let pendingFees = ZERO;
|
|
@@ -2369,9 +2383,9 @@ export class KaminoVaultClient {
|
|
|
2369
2383
|
pendingFees = lamportsToDecimal(new Fraction(vaultState.pendingFeesSf).toDecimal(), tokenDecimals);
|
|
2370
2384
|
}
|
|
2371
2385
|
|
|
2372
|
-
const
|
|
2386
|
+
const latestSlot = slot ? slot : await this.getConnection().getSlot('confirmed');
|
|
2373
2387
|
|
|
2374
|
-
const currentHoldings = await this.getVaultHoldings(vaultState,
|
|
2388
|
+
const currentHoldings = await this.getVaultHoldings(vaultState, latestSlot, vaultReservesMap, currentSlot);
|
|
2375
2389
|
const earnedInterest = currentHoldings.totalAUMIncludingFees.sub(prevAUM).sub(pendingFees);
|
|
2376
2390
|
|
|
2377
2391
|
return {
|
|
@@ -2,7 +2,7 @@ import { PublicKey, Connection } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface ReserveFields {
|
|
8
8
|
/** Version of the reserve */
|
|
@@ -2,7 +2,7 @@ import { PublicKey, Connection } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface VaultStateFields {
|
|
8
8
|
adminAuthority: PublicKey
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface DepositArgs {
|
|
8
8
|
maxAmount: BN
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface GiveUpPendingFeesArgs {
|
|
8
8
|
maxAmountToGiveUp: BN
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface InitVaultAccounts {
|
|
8
8
|
adminAuthority: PublicKey
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface InitializeSharesMetadataArgs {
|
|
8
8
|
name: string
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface InvestAccounts {
|
|
8
8
|
payer: PublicKey
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface UpdateAdminAccounts {
|
|
8
8
|
pendingAdmin: PublicKey
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface UpdateReserveAllocationArgs {
|
|
8
8
|
weight: BN
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface UpdateSharesMetadataArgs {
|
|
8
8
|
name: string
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface UpdateVaultConfigArgs {
|
|
8
8
|
entry: types.VaultConfigFieldKind
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface WithdrawArgs {
|
|
8
8
|
sharesAmount: BN
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface WithdrawFromAvailableArgs {
|
|
8
8
|
sharesAmount: BN
|
|
@@ -2,7 +2,7 @@ import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js"
|
|
|
2
2
|
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import {
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
6
|
|
|
7
7
|
export interface WithdrawPendingFeesAccounts {
|
|
8
8
|
adminAuthority: PublicKey
|
|
@@ -7,7 +7,9 @@ export const KVAULTS_PROGRAM_ID_CLI = new PublicKey(
|
|
|
7
7
|
|
|
8
8
|
// This constant will not get overwritten on subsequent code generations and it's safe to modify it's value.
|
|
9
9
|
export let KVAULTS_PROGRAM_ID: PublicKey = KVAULTS_PROGRAM_ID_CLI
|
|
10
|
+
export let PROGRAM_ID: PublicKey = KVAULTS_PROGRAM_ID_CLI
|
|
10
11
|
|
|
11
12
|
export const setKVaultsProgramId = (programId: PublicKey) => {
|
|
12
13
|
KVAULTS_PROGRAM_ID = programId;
|
|
14
|
+
PROGRAM_ID = programId;
|
|
13
15
|
}
|