@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.
Files changed (230) hide show
  1. package/dist/classes/manager.d.ts +38 -4
  2. package/dist/classes/manager.d.ts.map +1 -1
  3. package/dist/classes/manager.js +98 -4
  4. package/dist/classes/manager.js.map +1 -1
  5. package/dist/classes/market.d.ts.map +1 -1
  6. package/dist/classes/market.js +2 -25
  7. package/dist/classes/market.js.map +1 -1
  8. package/dist/classes/vault.d.ts +12 -8
  9. package/dist/classes/vault.d.ts.map +1 -1
  10. package/dist/classes/vault.js +94 -66
  11. package/dist/classes/vault.js.map +1 -1
  12. package/dist/client_kamino_manager.d.ts.map +1 -1
  13. package/dist/client_kamino_manager.js +14 -0
  14. package/dist/client_kamino_manager.js.map +1 -1
  15. package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts +3 -3
  16. package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts.map +1 -1
  17. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +22 -18
  18. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js.map +1 -1
  19. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts +45 -15
  20. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts.map +1 -1
  21. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +101 -39
  22. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
  23. package/dist/idl_codegen_kamino_vault/accounts/index.d.ts +4 -4
  24. package/dist/idl_codegen_kamino_vault/accounts/index.d.ts.map +1 -1
  25. package/dist/idl_codegen_kamino_vault/accounts/index.js.map +1 -1
  26. package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts.map +1 -1
  27. package/dist/idl_codegen_kamino_vault/errors/anchor.js +162 -162
  28. package/dist/idl_codegen_kamino_vault/errors/anchor.js.map +1 -1
  29. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts +144 -32
  30. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts.map +1 -1
  31. package/dist/idl_codegen_kamino_vault/errors/custom.js +305 -109
  32. package/dist/idl_codegen_kamino_vault/errors/custom.js.map +1 -1
  33. package/dist/idl_codegen_kamino_vault/errors/index.d.ts +3 -3
  34. package/dist/idl_codegen_kamino_vault/errors/index.d.ts.map +1 -1
  35. package/dist/idl_codegen_kamino_vault/errors/index.js +7 -2
  36. package/dist/idl_codegen_kamino_vault/errors/index.js.map +1 -1
  37. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +4 -2
  38. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -1
  39. package/dist/idl_codegen_kamino_vault/instructions/deposit.js +3 -1
  40. package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
  41. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.d.ts +13 -0
  42. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.d.ts.map +1 -0
  43. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js +47 -0
  44. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js.map +1 -0
  45. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts +18 -10
  46. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts.map +1 -1
  47. package/dist/idl_codegen_kamino_vault/instructions/index.js +9 -1
  48. package/dist/idl_codegen_kamino_vault/instructions/index.js.map +1 -1
  49. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts +2 -1
  50. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts.map +1 -1
  51. package/dist/idl_codegen_kamino_vault/instructions/initVault.js +1 -0
  52. package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
  53. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts +6 -2
  54. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts.map +1 -1
  55. package/dist/idl_codegen_kamino_vault/instructions/invest.js +9 -1
  56. package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
  57. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.d.ts +7 -0
  58. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.d.ts.map +1 -0
  59. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js +16 -0
  60. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js.map +1 -0
  61. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts +2 -2
  62. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts.map +1 -1
  63. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js +1 -1
  64. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js.map +1 -1
  65. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.d.ts +14 -0
  66. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.d.ts.map +1 -0
  67. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js +52 -0
  68. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js.map +1 -0
  69. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +4 -2
  70. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -1
  71. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js +8 -2
  72. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
  73. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts +23 -0
  74. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts.map +1 -0
  75. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js +51 -0
  76. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js.map +1 -0
  77. package/dist/idl_codegen_kamino_vault/programId.d.ts +1 -1
  78. package/dist/idl_codegen_kamino_vault/programId.d.ts.map +1 -1
  79. package/dist/idl_codegen_kamino_vault/programId.js +1 -1
  80. package/dist/idl_codegen_kamino_vault/programId.js.map +1 -1
  81. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts +2 -2
  82. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts.map +1 -1
  83. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js +4 -1
  84. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js.map +1 -1
  85. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts +1 -1
  86. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts.map +1 -1
  87. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js +1 -1
  88. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js.map +1 -1
  89. package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts +1 -1
  90. package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts.map +1 -1
  91. package/dist/idl_codegen_kamino_vault/types/CurvePoint.js +1 -1
  92. package/dist/idl_codegen_kamino_vault/types/CurvePoint.js.map +1 -1
  93. package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts +2 -2
  94. package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts.map +1 -1
  95. package/dist/idl_codegen_kamino_vault/types/LastUpdate.js +6 -1
  96. package/dist/idl_codegen_kamino_vault/types/LastUpdate.js.map +1 -1
  97. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts +2 -2
  98. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts.map +1 -1
  99. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js +1 -1
  100. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js.map +1 -1
  101. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts +2 -2
  102. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts.map +1 -1
  103. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js +1 -1
  104. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js.map +1 -1
  105. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts +3 -3
  106. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts.map +1 -1
  107. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js +5 -5
  108. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js.map +1 -1
  109. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +27 -24
  110. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -1
  111. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +59 -53
  112. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
  113. package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts +2 -2
  114. package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts.map +1 -1
  115. package/dist/idl_codegen_kamino_vault/types/ReserveFees.js +5 -1
  116. package/dist/idl_codegen_kamino_vault/types/ReserveFees.js.map +1 -1
  117. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts +11 -3
  118. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts.map +1 -1
  119. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js +25 -17
  120. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js.map +1 -1
  121. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts +2 -2
  122. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts.map +1 -1
  123. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js +3 -3
  124. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js.map +1 -1
  125. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts +2 -2
  126. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts.map +1 -1
  127. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js +1 -1
  128. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js.map +1 -1
  129. package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts +3 -3
  130. package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts.map +1 -1
  131. package/dist/idl_codegen_kamino_vault/types/TokenInfo.js +11 -11
  132. package/dist/idl_codegen_kamino_vault/types/TokenInfo.js.map +1 -1
  133. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts +18 -8
  134. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts.map +1 -1
  135. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js +27 -13
  136. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js.map +1 -1
  137. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts +110 -0
  138. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts.map +1 -0
  139. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js +242 -0
  140. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js.map +1 -0
  141. package/dist/idl_codegen_kamino_vault/types/index.d.ts +34 -30
  142. package/dist/idl_codegen_kamino_vault/types/index.d.ts.map +1 -1
  143. package/dist/idl_codegen_kamino_vault/types/index.js +26 -1
  144. package/dist/idl_codegen_kamino_vault/types/index.js.map +1 -1
  145. package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
  146. package/dist/lending_operations/repay_with_collateral_operations.js +6 -0
  147. package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
  148. package/dist/leverage/calcs.d.ts +28 -1
  149. package/dist/leverage/calcs.d.ts.map +1 -1
  150. package/dist/leverage/calcs.js +204 -8
  151. package/dist/leverage/calcs.js.map +1 -1
  152. package/dist/leverage/index.d.ts +1 -0
  153. package/dist/leverage/index.d.ts.map +1 -1
  154. package/dist/leverage/index.js +1 -0
  155. package/dist/leverage/index.js.map +1 -1
  156. package/dist/leverage/operations.d.ts +14 -241
  157. package/dist/leverage/operations.d.ts.map +1 -1
  158. package/dist/leverage/operations.js +508 -776
  159. package/dist/leverage/operations.js.map +1 -1
  160. package/dist/leverage/types.d.ts +173 -0
  161. package/dist/leverage/types.d.ts.map +1 -0
  162. package/dist/leverage/types.js +3 -0
  163. package/dist/leverage/types.js.map +1 -0
  164. package/dist/leverage/utils.d.ts +5 -5
  165. package/dist/leverage/utils.d.ts.map +1 -1
  166. package/dist/leverage/utils.js +68 -33
  167. package/dist/leverage/utils.js.map +1 -1
  168. package/dist/utils/constants.d.ts +1 -0
  169. package/dist/utils/constants.d.ts.map +1 -1
  170. package/dist/utils/constants.js +2 -1
  171. package/dist/utils/constants.js.map +1 -1
  172. package/dist/utils/fuzz.d.ts +3 -0
  173. package/dist/utils/fuzz.d.ts.map +1 -0
  174. package/dist/utils/fuzz.js +11 -0
  175. package/dist/utils/fuzz.js.map +1 -0
  176. package/dist/utils/index.d.ts +1 -0
  177. package/dist/utils/index.d.ts.map +1 -1
  178. package/dist/utils/index.js +1 -0
  179. package/dist/utils/index.js.map +1 -1
  180. package/dist/utils/rpc.d.ts.map +1 -1
  181. package/dist/utils/rpc.js +2 -1
  182. package/dist/utils/rpc.js.map +1 -1
  183. package/package.json +2 -1
  184. package/src/classes/manager.ts +122 -4
  185. package/src/classes/market.ts +1 -1
  186. package/src/classes/vault.ts +123 -49
  187. package/src/client_kamino_manager.ts +18 -0
  188. package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +132 -105
  189. package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +217 -124
  190. package/src/idl_codegen_kamino_vault/accounts/index.ts +4 -4
  191. package/src/idl_codegen_kamino_vault/errors/anchor.ts +335 -326
  192. package/src/idl_codegen_kamino_vault/errors/custom.ts +353 -157
  193. package/src/idl_codegen_kamino_vault/errors/index.ts +35 -22
  194. package/src/idl_codegen_kamino_vault/instructions/deposit.ts +33 -25
  195. package/src/idl_codegen_kamino_vault/instructions/giveUpPendingFees.ts +40 -0
  196. package/src/idl_codegen_kamino_vault/instructions/index.ts +27 -10
  197. package/src/idl_codegen_kamino_vault/instructions/initVault.ts +25 -20
  198. package/src/idl_codegen_kamino_vault/instructions/invest.ts +40 -25
  199. package/src/idl_codegen_kamino_vault/instructions/updateAdmin.ts +24 -0
  200. package/src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts +24 -24
  201. package/src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts +49 -0
  202. package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +45 -33
  203. package/src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts +75 -0
  204. package/src/idl_codegen_kamino_vault/programId.ts +5 -3
  205. package/src/idl_codegen_kamino_vault/types/BigFractionBytes.ts +24 -18
  206. package/src/idl_codegen_kamino_vault/types/BorrowRateCurve.ts +21 -16
  207. package/src/idl_codegen_kamino_vault/types/CurvePoint.ts +21 -18
  208. package/src/idl_codegen_kamino_vault/types/LastUpdate.ts +32 -27
  209. package/src/idl_codegen_kamino_vault/types/PriceHeuristic.ts +25 -22
  210. package/src/idl_codegen_kamino_vault/types/PythConfiguration.ts +14 -14
  211. package/src/idl_codegen_kamino_vault/types/ReserveCollateral.ts +35 -35
  212. package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +232 -191
  213. package/src/idl_codegen_kamino_vault/types/ReserveFees.ts +27 -23
  214. package/src/idl_codegen_kamino_vault/types/ReserveLiquidity.ts +116 -98
  215. package/src/idl_codegen_kamino_vault/types/ScopeConfiguration.ts +25 -25
  216. package/src/idl_codegen_kamino_vault/types/SwitchboardConfiguration.ts +21 -18
  217. package/src/idl_codegen_kamino_vault/types/TokenInfo.ts +92 -74
  218. package/src/idl_codegen_kamino_vault/types/VaultAllocation.ts +67 -49
  219. package/src/idl_codegen_kamino_vault/types/VaultConfigField.ts +270 -0
  220. package/src/idl_codegen_kamino_vault/types/index.ts +77 -30
  221. package/src/lending_operations/repay_with_collateral_operations.ts +2 -0
  222. package/src/leverage/calcs.ts +315 -8
  223. package/src/leverage/index.ts +1 -0
  224. package/src/leverage/operations.ts +1079 -1331
  225. package/src/leverage/types.ts +211 -0
  226. package/src/leverage/utils.ts +103 -64
  227. package/src/utils/constants.ts +2 -0
  228. package/src/utils/fuzz.ts +5 -0
  229. package/src/utils/index.ts +1 -0
  230. 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
- export { LastUpdate } from './LastUpdate';
2
- export type { LastUpdateFields, LastUpdateJSON } from './LastUpdate';
3
- export { BigFractionBytes } from './BigFractionBytes';
4
- export type { BigFractionBytesFields, BigFractionBytesJSON } from './BigFractionBytes';
5
- export { ReserveCollateral } from './ReserveCollateral';
6
- export type { ReserveCollateralFields, ReserveCollateralJSON } from './ReserveCollateral';
7
- export { ReserveConfig } from './ReserveConfig';
8
- export type { ReserveConfigFields, ReserveConfigJSON } from './ReserveConfig';
9
- export { ReserveFees } from './ReserveFees';
10
- export type { ReserveFeesFields, ReserveFeesJSON } from './ReserveFees';
11
- export { ReserveLiquidity } from './ReserveLiquidity';
12
- export type { ReserveLiquidityFields, ReserveLiquidityJSON } from './ReserveLiquidity';
13
- export { WithdrawalCaps } from './WithdrawalCaps';
14
- export type { WithdrawalCapsFields, WithdrawalCapsJSON } from './WithdrawalCaps';
15
- export { PriceHeuristic } from './PriceHeuristic';
16
- export type { PriceHeuristicFields, PriceHeuristicJSON } from './PriceHeuristic';
17
- export { PythConfiguration } from './PythConfiguration';
18
- export type { PythConfigurationFields, PythConfigurationJSON } from './PythConfiguration';
19
- export { ScopeConfiguration } from './ScopeConfiguration';
20
- export type { ScopeConfigurationFields, ScopeConfigurationJSON } from './ScopeConfiguration';
21
- export { SwitchboardConfiguration } from './SwitchboardConfiguration';
22
- export type { SwitchboardConfigurationFields, SwitchboardConfigurationJSON } from './SwitchboardConfiguration';
23
- export { TokenInfo } from './TokenInfo';
24
- export type { TokenInfoFields, TokenInfoJSON } from './TokenInfo';
25
- export { BorrowRateCurve } from './BorrowRateCurve';
26
- export type { BorrowRateCurveFields, BorrowRateCurveJSON } from './BorrowRateCurve';
27
- export { CurvePoint } from './CurvePoint';
28
- export type { CurvePointFields, CurvePointJSON } from './CurvePoint';
29
- export { VaultAllocation } from './VaultAllocation';
30
- export type { VaultAllocationFields, VaultAllocationJSON } from './VaultAllocation';
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,