@kamino-finance/klend-sdk 5.0.3 → 5.0.5
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 +38 -4
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +98 -4
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +2 -25
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/vault.d.ts +12 -8
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +94 -66
- package/dist/classes/vault.js.map +1 -1
- package/dist/client_kamino_manager.d.ts.map +1 -1
- package/dist/client_kamino_manager.js +14 -0
- package/dist/client_kamino_manager.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts +3 -3
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +22 -18
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts +45 -15
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +101 -39
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/index.d.ts +4 -4
- package/dist/idl_codegen_kamino_vault/accounts/index.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/anchor.js +162 -162
- package/dist/idl_codegen_kamino_vault/errors/anchor.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/custom.d.ts +144 -32
- package/dist/idl_codegen_kamino_vault/errors/custom.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/custom.js +305 -109
- package/dist/idl_codegen_kamino_vault/errors/custom.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/index.d.ts +3 -3
- package/dist/idl_codegen_kamino_vault/errors/index.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/index.js +7 -2
- package/dist/idl_codegen_kamino_vault/errors/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +4 -2
- package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js +3 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.d.ts +13 -0
- package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js +47 -0
- package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/index.d.ts +18 -10
- package/dist/idl_codegen_kamino_vault/instructions/index.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/index.js +9 -1
- package/dist/idl_codegen_kamino_vault/instructions/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts +2 -1
- package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initVault.js +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts +6 -2
- package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/invest.js +9 -1
- package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.d.ts +7 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js +16 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts.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/updateVaultConfig.d.ts +14 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js +52 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +4 -2
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js +8 -2
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts +23 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js +51 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js.map +1 -0
- package/dist/idl_codegen_kamino_vault/programId.d.ts +1 -1
- package/dist/idl_codegen_kamino_vault/programId.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/programId.js +1 -1
- package/dist/idl_codegen_kamino_vault/programId.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js +4 -1
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts +1 -1
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js +1 -1
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts +1 -1
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.js +1 -1
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.js +6 -1
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js +1 -1
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js +1 -1
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts +3 -3
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js +5 -5
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +27 -24
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +59 -53
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.js +5 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts +11 -3
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js +25 -17
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js +3 -3
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts +2 -2
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js +1 -1
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts +3 -3
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.js +11 -11
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts +18 -8
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js +27 -13
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts +110 -0
- package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js +242 -0
- package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/index.d.ts +34 -30
- package/dist/idl_codegen_kamino_vault/types/index.d.ts.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/index.js +26 -1
- package/dist/idl_codegen_kamino_vault/types/index.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js +6 -0
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/leverage/calcs.d.ts +28 -1
- package/dist/leverage/calcs.d.ts.map +1 -1
- package/dist/leverage/calcs.js +204 -8
- package/dist/leverage/calcs.js.map +1 -1
- package/dist/leverage/index.d.ts +1 -0
- package/dist/leverage/index.d.ts.map +1 -1
- package/dist/leverage/index.js +1 -0
- package/dist/leverage/index.js.map +1 -1
- package/dist/leverage/operations.d.ts +14 -241
- package/dist/leverage/operations.d.ts.map +1 -1
- package/dist/leverage/operations.js +508 -776
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/types.d.ts +173 -0
- package/dist/leverage/types.d.ts.map +1 -0
- package/dist/leverage/types.js +3 -0
- package/dist/leverage/types.js.map +1 -0
- package/dist/leverage/utils.d.ts +5 -5
- package/dist/leverage/utils.d.ts.map +1 -1
- package/dist/leverage/utils.js +68 -33
- package/dist/leverage/utils.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +2 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/fuzz.d.ts +3 -0
- package/dist/utils/fuzz.d.ts.map +1 -0
- package/dist/utils/fuzz.js +11 -0
- package/dist/utils/fuzz.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/rpc.d.ts.map +1 -1
- package/dist/utils/rpc.js +2 -1
- package/dist/utils/rpc.js.map +1 -1
- package/package.json +2 -1
- package/src/classes/manager.ts +122 -4
- package/src/classes/market.ts +1 -1
- package/src/classes/vault.ts +123 -49
- package/src/client_kamino_manager.ts +18 -0
- package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +132 -105
- package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +217 -124
- package/src/idl_codegen_kamino_vault/accounts/index.ts +4 -4
- package/src/idl_codegen_kamino_vault/errors/anchor.ts +335 -326
- package/src/idl_codegen_kamino_vault/errors/custom.ts +353 -157
- package/src/idl_codegen_kamino_vault/errors/index.ts +35 -22
- package/src/idl_codegen_kamino_vault/instructions/deposit.ts +33 -25
- package/src/idl_codegen_kamino_vault/instructions/giveUpPendingFees.ts +40 -0
- package/src/idl_codegen_kamino_vault/instructions/index.ts +27 -10
- package/src/idl_codegen_kamino_vault/instructions/initVault.ts +25 -20
- package/src/idl_codegen_kamino_vault/instructions/invest.ts +40 -25
- package/src/idl_codegen_kamino_vault/instructions/updateAdmin.ts +24 -0
- package/src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts +24 -24
- package/src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts +49 -0
- package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +45 -33
- package/src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts +75 -0
- package/src/idl_codegen_kamino_vault/programId.ts +5 -3
- package/src/idl_codegen_kamino_vault/types/BigFractionBytes.ts +24 -18
- package/src/idl_codegen_kamino_vault/types/BorrowRateCurve.ts +21 -16
- package/src/idl_codegen_kamino_vault/types/CurvePoint.ts +21 -18
- package/src/idl_codegen_kamino_vault/types/LastUpdate.ts +32 -27
- package/src/idl_codegen_kamino_vault/types/PriceHeuristic.ts +25 -22
- package/src/idl_codegen_kamino_vault/types/PythConfiguration.ts +14 -14
- package/src/idl_codegen_kamino_vault/types/ReserveCollateral.ts +35 -35
- package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +232 -191
- package/src/idl_codegen_kamino_vault/types/ReserveFees.ts +27 -23
- package/src/idl_codegen_kamino_vault/types/ReserveLiquidity.ts +116 -98
- package/src/idl_codegen_kamino_vault/types/ScopeConfiguration.ts +25 -25
- package/src/idl_codegen_kamino_vault/types/SwitchboardConfiguration.ts +21 -18
- package/src/idl_codegen_kamino_vault/types/TokenInfo.ts +92 -74
- package/src/idl_codegen_kamino_vault/types/VaultAllocation.ts +67 -49
- package/src/idl_codegen_kamino_vault/types/VaultConfigField.ts +270 -0
- package/src/idl_codegen_kamino_vault/types/index.ts +77 -30
- package/src/lending_operations/repay_with_collateral_operations.ts +2 -0
- package/src/leverage/calcs.ts +315 -8
- package/src/leverage/index.ts +1 -0
- package/src/leverage/operations.ts +1079 -1331
- package/src/leverage/types.ts +211 -0
- package/src/leverage/utils.ts +103 -64
- package/src/utils/constants.ts +2 -0
- package/src/utils/fuzz.ts +5 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/rpc.ts +2 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as borsh from "@coral-xyz/borsh"
|
|
5
|
+
|
|
6
|
+
export interface PerformanceFeeBpsJSON {
|
|
7
|
+
kind: "PerformanceFeeBps"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class PerformanceFeeBps {
|
|
11
|
+
static readonly discriminator = 0
|
|
12
|
+
static readonly kind = "PerformanceFeeBps"
|
|
13
|
+
readonly discriminator = 0
|
|
14
|
+
readonly kind = "PerformanceFeeBps"
|
|
15
|
+
|
|
16
|
+
toJSON(): PerformanceFeeBpsJSON {
|
|
17
|
+
return {
|
|
18
|
+
kind: "PerformanceFeeBps",
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toEncodable() {
|
|
23
|
+
return {
|
|
24
|
+
PerformanceFeeBps: {},
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ManagementFeeBpsJSON {
|
|
30
|
+
kind: "ManagementFeeBps"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class ManagementFeeBps {
|
|
34
|
+
static readonly discriminator = 1
|
|
35
|
+
static readonly kind = "ManagementFeeBps"
|
|
36
|
+
readonly discriminator = 1
|
|
37
|
+
readonly kind = "ManagementFeeBps"
|
|
38
|
+
|
|
39
|
+
toJSON(): ManagementFeeBpsJSON {
|
|
40
|
+
return {
|
|
41
|
+
kind: "ManagementFeeBps",
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
toEncodable() {
|
|
46
|
+
return {
|
|
47
|
+
ManagementFeeBps: {},
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface MinDepositAmountJSON {
|
|
53
|
+
kind: "MinDepositAmount"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class MinDepositAmount {
|
|
57
|
+
static readonly discriminator = 2
|
|
58
|
+
static readonly kind = "MinDepositAmount"
|
|
59
|
+
readonly discriminator = 2
|
|
60
|
+
readonly kind = "MinDepositAmount"
|
|
61
|
+
|
|
62
|
+
toJSON(): MinDepositAmountJSON {
|
|
63
|
+
return {
|
|
64
|
+
kind: "MinDepositAmount",
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
toEncodable() {
|
|
69
|
+
return {
|
|
70
|
+
MinDepositAmount: {},
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface MinWithdrawAmountJSON {
|
|
76
|
+
kind: "MinWithdrawAmount"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export class MinWithdrawAmount {
|
|
80
|
+
static readonly discriminator = 3
|
|
81
|
+
static readonly kind = "MinWithdrawAmount"
|
|
82
|
+
readonly discriminator = 3
|
|
83
|
+
readonly kind = "MinWithdrawAmount"
|
|
84
|
+
|
|
85
|
+
toJSON(): MinWithdrawAmountJSON {
|
|
86
|
+
return {
|
|
87
|
+
kind: "MinWithdrawAmount",
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
toEncodable() {
|
|
92
|
+
return {
|
|
93
|
+
MinWithdrawAmount: {},
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface MintInvestAmountJSON {
|
|
99
|
+
kind: "MintInvestAmount"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export class MintInvestAmount {
|
|
103
|
+
static readonly discriminator = 4
|
|
104
|
+
static readonly kind = "MintInvestAmount"
|
|
105
|
+
readonly discriminator = 4
|
|
106
|
+
readonly kind = "MintInvestAmount"
|
|
107
|
+
|
|
108
|
+
toJSON(): MintInvestAmountJSON {
|
|
109
|
+
return {
|
|
110
|
+
kind: "MintInvestAmount",
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
toEncodable() {
|
|
115
|
+
return {
|
|
116
|
+
MintInvestAmount: {},
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface MinInvestDelaySlotsJSON {
|
|
122
|
+
kind: "MinInvestDelaySlots"
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export class MinInvestDelaySlots {
|
|
126
|
+
static readonly discriminator = 5
|
|
127
|
+
static readonly kind = "MinInvestDelaySlots"
|
|
128
|
+
readonly discriminator = 5
|
|
129
|
+
readonly kind = "MinInvestDelaySlots"
|
|
130
|
+
|
|
131
|
+
toJSON(): MinInvestDelaySlotsJSON {
|
|
132
|
+
return {
|
|
133
|
+
kind: "MinInvestDelaySlots",
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
toEncodable() {
|
|
138
|
+
return {
|
|
139
|
+
MinInvestDelaySlots: {},
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface CrankFundFeePerReserveJSON {
|
|
145
|
+
kind: "CrankFundFeePerReserve"
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class CrankFundFeePerReserve {
|
|
149
|
+
static readonly discriminator = 6
|
|
150
|
+
static readonly kind = "CrankFundFeePerReserve"
|
|
151
|
+
readonly discriminator = 6
|
|
152
|
+
readonly kind = "CrankFundFeePerReserve"
|
|
153
|
+
|
|
154
|
+
toJSON(): CrankFundFeePerReserveJSON {
|
|
155
|
+
return {
|
|
156
|
+
kind: "CrankFundFeePerReserve",
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
toEncodable() {
|
|
161
|
+
return {
|
|
162
|
+
CrankFundFeePerReserve: {},
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface PendingVaultAdminJSON {
|
|
168
|
+
kind: "PendingVaultAdmin"
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export class PendingVaultAdmin {
|
|
172
|
+
static readonly discriminator = 7
|
|
173
|
+
static readonly kind = "PendingVaultAdmin"
|
|
174
|
+
readonly discriminator = 7
|
|
175
|
+
readonly kind = "PendingVaultAdmin"
|
|
176
|
+
|
|
177
|
+
toJSON(): PendingVaultAdminJSON {
|
|
178
|
+
return {
|
|
179
|
+
kind: "PendingVaultAdmin",
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
toEncodable() {
|
|
184
|
+
return {
|
|
185
|
+
PendingVaultAdmin: {},
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
191
|
+
export function fromDecoded(obj: any): types.VaultConfigFieldKind {
|
|
192
|
+
if (typeof obj !== "object") {
|
|
193
|
+
throw new Error("Invalid enum object")
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if ("PerformanceFeeBps" in obj) {
|
|
197
|
+
return new PerformanceFeeBps()
|
|
198
|
+
}
|
|
199
|
+
if ("ManagementFeeBps" in obj) {
|
|
200
|
+
return new ManagementFeeBps()
|
|
201
|
+
}
|
|
202
|
+
if ("MinDepositAmount" in obj) {
|
|
203
|
+
return new MinDepositAmount()
|
|
204
|
+
}
|
|
205
|
+
if ("MinWithdrawAmount" in obj) {
|
|
206
|
+
return new MinWithdrawAmount()
|
|
207
|
+
}
|
|
208
|
+
if ("MintInvestAmount" in obj) {
|
|
209
|
+
return new MintInvestAmount()
|
|
210
|
+
}
|
|
211
|
+
if ("MinInvestDelaySlots" in obj) {
|
|
212
|
+
return new MinInvestDelaySlots()
|
|
213
|
+
}
|
|
214
|
+
if ("CrankFundFeePerReserve" in obj) {
|
|
215
|
+
return new CrankFundFeePerReserve()
|
|
216
|
+
}
|
|
217
|
+
if ("PendingVaultAdmin" in obj) {
|
|
218
|
+
return new PendingVaultAdmin()
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
throw new Error("Invalid enum object")
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function fromJSON(
|
|
225
|
+
obj: types.VaultConfigFieldJSON
|
|
226
|
+
): types.VaultConfigFieldKind {
|
|
227
|
+
switch (obj.kind) {
|
|
228
|
+
case "PerformanceFeeBps": {
|
|
229
|
+
return new PerformanceFeeBps()
|
|
230
|
+
}
|
|
231
|
+
case "ManagementFeeBps": {
|
|
232
|
+
return new ManagementFeeBps()
|
|
233
|
+
}
|
|
234
|
+
case "MinDepositAmount": {
|
|
235
|
+
return new MinDepositAmount()
|
|
236
|
+
}
|
|
237
|
+
case "MinWithdrawAmount": {
|
|
238
|
+
return new MinWithdrawAmount()
|
|
239
|
+
}
|
|
240
|
+
case "MintInvestAmount": {
|
|
241
|
+
return new MintInvestAmount()
|
|
242
|
+
}
|
|
243
|
+
case "MinInvestDelaySlots": {
|
|
244
|
+
return new MinInvestDelaySlots()
|
|
245
|
+
}
|
|
246
|
+
case "CrankFundFeePerReserve": {
|
|
247
|
+
return new CrankFundFeePerReserve()
|
|
248
|
+
}
|
|
249
|
+
case "PendingVaultAdmin": {
|
|
250
|
+
return new PendingVaultAdmin()
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function layout(property?: string) {
|
|
256
|
+
const ret = borsh.rustEnum([
|
|
257
|
+
borsh.struct([], "PerformanceFeeBps"),
|
|
258
|
+
borsh.struct([], "ManagementFeeBps"),
|
|
259
|
+
borsh.struct([], "MinDepositAmount"),
|
|
260
|
+
borsh.struct([], "MinWithdrawAmount"),
|
|
261
|
+
borsh.struct([], "MintInvestAmount"),
|
|
262
|
+
borsh.struct([], "MinInvestDelaySlots"),
|
|
263
|
+
borsh.struct([], "CrankFundFeePerReserve"),
|
|
264
|
+
borsh.struct([], "PendingVaultAdmin"),
|
|
265
|
+
])
|
|
266
|
+
if (property !== undefined) {
|
|
267
|
+
return ret.replicate(property)
|
|
268
|
+
}
|
|
269
|
+
return ret
|
|
270
|
+
}
|
|
@@ -1,30 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
export type {
|
|
17
|
-
export {
|
|
18
|
-
export type {
|
|
19
|
-
export {
|
|
20
|
-
export type {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
export {
|
|
26
|
-
export
|
|
27
|
-
export {
|
|
28
|
-
export
|
|
29
|
-
export {
|
|
30
|
-
|
|
1
|
+
import * as VaultConfigField from "./VaultConfigField"
|
|
2
|
+
|
|
3
|
+
export { LastUpdate } from "./LastUpdate"
|
|
4
|
+
export type { LastUpdateFields, LastUpdateJSON } from "./LastUpdate"
|
|
5
|
+
export { BigFractionBytes } from "./BigFractionBytes"
|
|
6
|
+
export type {
|
|
7
|
+
BigFractionBytesFields,
|
|
8
|
+
BigFractionBytesJSON,
|
|
9
|
+
} from "./BigFractionBytes"
|
|
10
|
+
export { ReserveCollateral } from "./ReserveCollateral"
|
|
11
|
+
export type {
|
|
12
|
+
ReserveCollateralFields,
|
|
13
|
+
ReserveCollateralJSON,
|
|
14
|
+
} from "./ReserveCollateral"
|
|
15
|
+
export { ReserveConfig } from "./ReserveConfig"
|
|
16
|
+
export type { ReserveConfigFields, ReserveConfigJSON } from "./ReserveConfig"
|
|
17
|
+
export { ReserveFees } from "./ReserveFees"
|
|
18
|
+
export type { ReserveFeesFields, ReserveFeesJSON } from "./ReserveFees"
|
|
19
|
+
export { ReserveLiquidity } from "./ReserveLiquidity"
|
|
20
|
+
export type {
|
|
21
|
+
ReserveLiquidityFields,
|
|
22
|
+
ReserveLiquidityJSON,
|
|
23
|
+
} from "./ReserveLiquidity"
|
|
24
|
+
export { WithdrawalCaps } from "./WithdrawalCaps"
|
|
25
|
+
export type { WithdrawalCapsFields, WithdrawalCapsJSON } from "./WithdrawalCaps"
|
|
26
|
+
export { PriceHeuristic } from "./PriceHeuristic"
|
|
27
|
+
export type { PriceHeuristicFields, PriceHeuristicJSON } from "./PriceHeuristic"
|
|
28
|
+
export { PythConfiguration } from "./PythConfiguration"
|
|
29
|
+
export type {
|
|
30
|
+
PythConfigurationFields,
|
|
31
|
+
PythConfigurationJSON,
|
|
32
|
+
} from "./PythConfiguration"
|
|
33
|
+
export { ScopeConfiguration } from "./ScopeConfiguration"
|
|
34
|
+
export type {
|
|
35
|
+
ScopeConfigurationFields,
|
|
36
|
+
ScopeConfigurationJSON,
|
|
37
|
+
} from "./ScopeConfiguration"
|
|
38
|
+
export { SwitchboardConfiguration } from "./SwitchboardConfiguration"
|
|
39
|
+
export type {
|
|
40
|
+
SwitchboardConfigurationFields,
|
|
41
|
+
SwitchboardConfigurationJSON,
|
|
42
|
+
} from "./SwitchboardConfiguration"
|
|
43
|
+
export { TokenInfo } from "./TokenInfo"
|
|
44
|
+
export type { TokenInfoFields, TokenInfoJSON } from "./TokenInfo"
|
|
45
|
+
export { BorrowRateCurve } from "./BorrowRateCurve"
|
|
46
|
+
export type {
|
|
47
|
+
BorrowRateCurveFields,
|
|
48
|
+
BorrowRateCurveJSON,
|
|
49
|
+
} from "./BorrowRateCurve"
|
|
50
|
+
export { CurvePoint } from "./CurvePoint"
|
|
51
|
+
export type { CurvePointFields, CurvePointJSON } from "./CurvePoint"
|
|
52
|
+
export { VaultConfigField }
|
|
53
|
+
|
|
54
|
+
export type VaultConfigFieldKind =
|
|
55
|
+
| VaultConfigField.PerformanceFeeBps
|
|
56
|
+
| VaultConfigField.ManagementFeeBps
|
|
57
|
+
| VaultConfigField.MinDepositAmount
|
|
58
|
+
| VaultConfigField.MinWithdrawAmount
|
|
59
|
+
| VaultConfigField.MintInvestAmount
|
|
60
|
+
| VaultConfigField.MinInvestDelaySlots
|
|
61
|
+
| VaultConfigField.CrankFundFeePerReserve
|
|
62
|
+
| VaultConfigField.PendingVaultAdmin
|
|
63
|
+
export type VaultConfigFieldJSON =
|
|
64
|
+
| VaultConfigField.PerformanceFeeBpsJSON
|
|
65
|
+
| VaultConfigField.ManagementFeeBpsJSON
|
|
66
|
+
| VaultConfigField.MinDepositAmountJSON
|
|
67
|
+
| VaultConfigField.MinWithdrawAmountJSON
|
|
68
|
+
| VaultConfigField.MintInvestAmountJSON
|
|
69
|
+
| VaultConfigField.MinInvestDelaySlotsJSON
|
|
70
|
+
| VaultConfigField.CrankFundFeePerReserveJSON
|
|
71
|
+
| VaultConfigField.PendingVaultAdminJSON
|
|
72
|
+
|
|
73
|
+
export { VaultAllocation } from "./VaultAllocation"
|
|
74
|
+
export type {
|
|
75
|
+
VaultAllocationFields,
|
|
76
|
+
VaultAllocationJSON,
|
|
77
|
+
} from "./VaultAllocation"
|
|
@@ -107,6 +107,7 @@ export async function getRepayWithCollSwapInputs<QuoteResponse>({
|
|
|
107
107
|
inputAmountLamports: withdrawableCollLamports,
|
|
108
108
|
inputMint: collTokenMint,
|
|
109
109
|
outputMint: debtTokenMint,
|
|
110
|
+
amountDebtAtaBalance: new Decimal(0), // only used for kTokens
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
// Build the repay & withdraw collateral tx to get the number of accounts
|
|
@@ -143,6 +144,7 @@ export async function getRepayWithCollSwapInputs<QuoteResponse>({
|
|
|
143
144
|
inputAmountLamports: collSwapInLamports,
|
|
144
145
|
inputMint: collTokenMint,
|
|
145
146
|
outputMint: debtTokenMint,
|
|
147
|
+
amountDebtAtaBalance: new Decimal(0), // only used for kTokens
|
|
146
148
|
},
|
|
147
149
|
initialInputs: {
|
|
148
150
|
debtRepayAmountLamports: repayAmountLamports,
|