@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
@@ -3,7 +3,7 @@ export type CustomError =
3
3
  | SharesIssuedAmountDoesNotMatch
4
4
  | MathOverflow
5
5
  | IntegerOverflow
6
- | CannotWithdrawZeroAmount
6
+ | WithdrawAmountBelowMinimum
7
7
  | TooMuchLiquidityToWithdraw
8
8
  | ReserveAlreadyExists
9
9
  | ReserveNotPartOfAllocations
@@ -12,8 +12,7 @@ export type CustomError =
12
12
  | ReserveAccountAndKeyMismatch
13
13
  | OutOfRangeOfReserveIndex
14
14
  | CannotFindReserveInAllocations
15
- | CannotInvestZeroAmount
16
- | SlotDecreased
15
+ | InvestAmountBelowMinimum
17
16
  | AdminAuthorityIncorrect
18
17
  | BaseVaultAuthorityIncorrect
19
18
  | BaseVaultAuthorityBumpIncorrect
@@ -22,323 +21,520 @@ export type CustomError =
22
21
  | TokenVaultIncorrect
23
22
  | SharesMintDecimalsIncorrect
24
23
  | SharesMintIncorrect
25
- | InitialAccountintIncorrect;
24
+ | InitialAccountintIncorrect
25
+ | ReserveIsStale
26
+ | NotEnoughLiquidityDisinvestedToSendToUser
27
+ | BPSValueTooBig
28
+ | DepositAmountBelowMinimum
29
+ | ReserveSpaceExhausted
30
+ | CannotWithdrawFromEmptyVault
31
+ | TokensDepositedAmountDoesNotMatch
32
+ | AmountToWithdrawDoesNotMatch
33
+ | LiquidityToWithdrawDoesNotMatch
34
+ | UserReceivedAmountDoesNotMatch
35
+ | SharesBurnedAmountDoesNotMatch
36
+ | DisinvestedLiquidityAmountDoesNotMatch
37
+ | SharesMintedAmountDoesNotMatch
38
+ | AUMDecreasedAfterInvest
39
+ | AUMBelowPendingFees
26
40
 
27
41
  export class DepositAmountsZero extends Error {
28
- static readonly code = 6000;
29
- readonly code = 6000;
30
- readonly name = 'DepositAmountsZero';
31
- readonly msg = 'DepositAmountsZero';
42
+ static readonly code = 6000
43
+ readonly code = 6000
44
+ readonly name = "DepositAmountsZero"
45
+ readonly msg = "DepositAmountsZero"
32
46
 
33
47
  constructor(readonly logs?: string[]) {
34
- super('6000: DepositAmountsZero');
48
+ super("6000: DepositAmountsZero")
35
49
  }
36
50
  }
37
51
 
38
52
  export class SharesIssuedAmountDoesNotMatch extends Error {
39
- static readonly code = 6001;
40
- readonly code = 6001;
41
- readonly name = 'SharesIssuedAmountDoesNotMatch';
42
- readonly msg = 'SharesIssuedAmountDoesNotMatch';
53
+ static readonly code = 6001
54
+ readonly code = 6001
55
+ readonly name = "SharesIssuedAmountDoesNotMatch"
56
+ readonly msg = "SharesIssuedAmountDoesNotMatch"
43
57
 
44
58
  constructor(readonly logs?: string[]) {
45
- super('6001: SharesIssuedAmountDoesNotMatch');
59
+ super("6001: SharesIssuedAmountDoesNotMatch")
46
60
  }
47
61
  }
48
62
 
49
63
  export class MathOverflow extends Error {
50
- static readonly code = 6002;
51
- readonly code = 6002;
52
- readonly name = 'MathOverflow';
53
- readonly msg = 'MathOverflow';
64
+ static readonly code = 6002
65
+ readonly code = 6002
66
+ readonly name = "MathOverflow"
67
+ readonly msg = "MathOverflow"
54
68
 
55
69
  constructor(readonly logs?: string[]) {
56
- super('6002: MathOverflow');
70
+ super("6002: MathOverflow")
57
71
  }
58
72
  }
59
73
 
60
74
  export class IntegerOverflow extends Error {
61
- static readonly code = 6003;
62
- readonly code = 6003;
63
- readonly name = 'IntegerOverflow';
64
- readonly msg = 'IntegerOverflow';
75
+ static readonly code = 6003
76
+ readonly code = 6003
77
+ readonly name = "IntegerOverflow"
78
+ readonly msg = "IntegerOverflow"
65
79
 
66
80
  constructor(readonly logs?: string[]) {
67
- super('6003: IntegerOverflow');
81
+ super("6003: IntegerOverflow")
68
82
  }
69
83
  }
70
84
 
71
- export class CannotWithdrawZeroAmount extends Error {
72
- static readonly code = 6004;
73
- readonly code = 6004;
74
- readonly name = 'CannotWithdrawZeroAmount';
75
- readonly msg = 'CannotWithdrawZeroAmount';
85
+ export class WithdrawAmountBelowMinimum extends Error {
86
+ static readonly code = 6004
87
+ readonly code = 6004
88
+ readonly name = "WithdrawAmountBelowMinimum"
89
+ readonly msg = "Withdrawn amount is below minimum"
76
90
 
77
91
  constructor(readonly logs?: string[]) {
78
- super('6004: CannotWithdrawZeroAmount');
92
+ super("6004: Withdrawn amount is below minimum")
79
93
  }
80
94
  }
81
95
 
82
96
  export class TooMuchLiquidityToWithdraw extends Error {
83
- static readonly code = 6005;
84
- readonly code = 6005;
85
- readonly name = 'TooMuchLiquidityToWithdraw';
86
- readonly msg = 'TooMuchLiquidityToWithdraw';
97
+ static readonly code = 6005
98
+ readonly code = 6005
99
+ readonly name = "TooMuchLiquidityToWithdraw"
100
+ readonly msg = "TooMuchLiquidityToWithdraw"
87
101
 
88
102
  constructor(readonly logs?: string[]) {
89
- super('6005: TooMuchLiquidityToWithdraw');
103
+ super("6005: TooMuchLiquidityToWithdraw")
90
104
  }
91
105
  }
92
106
 
93
107
  export class ReserveAlreadyExists extends Error {
94
- static readonly code = 6006;
95
- readonly code = 6006;
96
- readonly name = 'ReserveAlreadyExists';
97
- readonly msg = 'ReserveAlreadyExists';
108
+ static readonly code = 6006
109
+ readonly code = 6006
110
+ readonly name = "ReserveAlreadyExists"
111
+ readonly msg = "ReserveAlreadyExists"
98
112
 
99
113
  constructor(readonly logs?: string[]) {
100
- super('6006: ReserveAlreadyExists');
114
+ super("6006: ReserveAlreadyExists")
101
115
  }
102
116
  }
103
117
 
104
118
  export class ReserveNotPartOfAllocations extends Error {
105
- static readonly code = 6007;
106
- readonly code = 6007;
107
- readonly name = 'ReserveNotPartOfAllocations';
108
- readonly msg = 'ReserveNotPartOfAllocations';
119
+ static readonly code = 6007
120
+ readonly code = 6007
121
+ readonly name = "ReserveNotPartOfAllocations"
122
+ readonly msg = "ReserveNotPartOfAllocations"
109
123
 
110
124
  constructor(readonly logs?: string[]) {
111
- super('6007: ReserveNotPartOfAllocations');
125
+ super("6007: ReserveNotPartOfAllocations")
112
126
  }
113
127
  }
114
128
 
115
129
  export class CouldNotDeserializeAccountAsReserve extends Error {
116
- static readonly code = 6008;
117
- readonly code = 6008;
118
- readonly name = 'CouldNotDeserializeAccountAsReserve';
119
- readonly msg = 'CouldNotDeserializeAccountAsReserve';
130
+ static readonly code = 6008
131
+ readonly code = 6008
132
+ readonly name = "CouldNotDeserializeAccountAsReserve"
133
+ readonly msg = "CouldNotDeserializeAccountAsReserve"
120
134
 
121
135
  constructor(readonly logs?: string[]) {
122
- super('6008: CouldNotDeserializeAccountAsReserve');
136
+ super("6008: CouldNotDeserializeAccountAsReserve")
123
137
  }
124
138
  }
125
139
 
126
140
  export class ReserveNotProvidedInTheAccounts extends Error {
127
- static readonly code = 6009;
128
- readonly code = 6009;
129
- readonly name = 'ReserveNotProvidedInTheAccounts';
130
- readonly msg = 'ReserveNotProvidedInTheAccounts';
141
+ static readonly code = 6009
142
+ readonly code = 6009
143
+ readonly name = "ReserveNotProvidedInTheAccounts"
144
+ readonly msg = "ReserveNotProvidedInTheAccounts"
131
145
 
132
146
  constructor(readonly logs?: string[]) {
133
- super('6009: ReserveNotProvidedInTheAccounts');
147
+ super("6009: ReserveNotProvidedInTheAccounts")
134
148
  }
135
149
  }
136
150
 
137
151
  export class ReserveAccountAndKeyMismatch extends Error {
138
- static readonly code = 6010;
139
- readonly code = 6010;
140
- readonly name = 'ReserveAccountAndKeyMismatch';
141
- readonly msg = 'ReserveAccountAndKeyMismatch';
152
+ static readonly code = 6010
153
+ readonly code = 6010
154
+ readonly name = "ReserveAccountAndKeyMismatch"
155
+ readonly msg = "ReserveAccountAndKeyMismatch"
142
156
 
143
157
  constructor(readonly logs?: string[]) {
144
- super('6010: ReserveAccountAndKeyMismatch');
158
+ super("6010: ReserveAccountAndKeyMismatch")
145
159
  }
146
160
  }
147
161
 
148
162
  export class OutOfRangeOfReserveIndex extends Error {
149
- static readonly code = 6011;
150
- readonly code = 6011;
151
- readonly name = 'OutOfRangeOfReserveIndex';
152
- readonly msg = 'OutOfRangeOfReserveIndex';
163
+ static readonly code = 6011
164
+ readonly code = 6011
165
+ readonly name = "OutOfRangeOfReserveIndex"
166
+ readonly msg = "OutOfRangeOfReserveIndex"
153
167
 
154
168
  constructor(readonly logs?: string[]) {
155
- super('6011: OutOfRangeOfReserveIndex');
169
+ super("6011: OutOfRangeOfReserveIndex")
156
170
  }
157
171
  }
158
172
 
159
173
  export class CannotFindReserveInAllocations extends Error {
160
- static readonly code = 6012;
161
- readonly code = 6012;
162
- readonly name = 'CannotFindReserveInAllocations';
163
- readonly msg = 'OutOfRangeOfReserveIndex';
174
+ static readonly code = 6012
175
+ readonly code = 6012
176
+ readonly name = "CannotFindReserveInAllocations"
177
+ readonly msg = "OutOfRangeOfReserveIndex"
164
178
 
165
179
  constructor(readonly logs?: string[]) {
166
- super('6012: OutOfRangeOfReserveIndex');
180
+ super("6012: OutOfRangeOfReserveIndex")
167
181
  }
168
182
  }
169
183
 
170
- export class CannotInvestZeroAmount extends Error {
171
- static readonly code = 6013;
172
- readonly code = 6013;
173
- readonly name = 'CannotInvestZeroAmount';
174
- readonly msg = 'CannotInvestZeroAmount';
184
+ export class InvestAmountBelowMinimum extends Error {
185
+ static readonly code = 6013
186
+ readonly code = 6013
187
+ readonly name = "InvestAmountBelowMinimum"
188
+ readonly msg = "Invested amount is below minimum"
175
189
 
176
190
  constructor(readonly logs?: string[]) {
177
- super('6013: CannotInvestZeroAmount');
178
- }
179
- }
180
-
181
- export class SlotDecreased extends Error {
182
- static readonly code = 6014;
183
- readonly code = 6014;
184
- readonly name = 'SlotDecreased';
185
- readonly msg = 'SlotDecreased';
186
-
187
- constructor(readonly logs?: string[]) {
188
- super('6014: SlotDecreased');
191
+ super("6013: Invested amount is below minimum")
189
192
  }
190
193
  }
191
194
 
192
195
  export class AdminAuthorityIncorrect extends Error {
193
- static readonly code = 6015;
194
- readonly code = 6015;
195
- readonly name = 'AdminAuthorityIncorrect';
196
- readonly msg = 'AdminAuthorityIncorrect';
196
+ static readonly code = 6014
197
+ readonly code = 6014
198
+ readonly name = "AdminAuthorityIncorrect"
199
+ readonly msg = "AdminAuthorityIncorrect"
197
200
 
198
201
  constructor(readonly logs?: string[]) {
199
- super('6015: AdminAuthorityIncorrect');
202
+ super("6014: AdminAuthorityIncorrect")
200
203
  }
201
204
  }
202
205
 
203
206
  export class BaseVaultAuthorityIncorrect extends Error {
204
- static readonly code = 6016;
205
- readonly code = 6016;
206
- readonly name = 'BaseVaultAuthorityIncorrect';
207
- readonly msg = 'BaseVaultAuthorityIncorrect';
207
+ static readonly code = 6015
208
+ readonly code = 6015
209
+ readonly name = "BaseVaultAuthorityIncorrect"
210
+ readonly msg = "BaseVaultAuthorityIncorrect"
208
211
 
209
212
  constructor(readonly logs?: string[]) {
210
- super('6016: BaseVaultAuthorityIncorrect');
213
+ super("6015: BaseVaultAuthorityIncorrect")
211
214
  }
212
215
  }
213
216
 
214
217
  export class BaseVaultAuthorityBumpIncorrect extends Error {
215
- static readonly code = 6017;
216
- readonly code = 6017;
217
- readonly name = 'BaseVaultAuthorityBumpIncorrect';
218
- readonly msg = 'BaseVaultAuthorityBumpIncorrect';
218
+ static readonly code = 6016
219
+ readonly code = 6016
220
+ readonly name = "BaseVaultAuthorityBumpIncorrect"
221
+ readonly msg = "BaseVaultAuthorityBumpIncorrect"
219
222
 
220
223
  constructor(readonly logs?: string[]) {
221
- super('6017: BaseVaultAuthorityBumpIncorrect');
224
+ super("6016: BaseVaultAuthorityBumpIncorrect")
222
225
  }
223
226
  }
224
227
 
225
228
  export class TokenMintIncorrect extends Error {
226
- static readonly code = 6018;
227
- readonly code = 6018;
228
- readonly name = 'TokenMintIncorrect';
229
- readonly msg = 'TokenMintIncorrect';
229
+ static readonly code = 6017
230
+ readonly code = 6017
231
+ readonly name = "TokenMintIncorrect"
232
+ readonly msg = "TokenMintIncorrect"
230
233
 
231
234
  constructor(readonly logs?: string[]) {
232
- super('6018: TokenMintIncorrect');
235
+ super("6017: TokenMintIncorrect")
233
236
  }
234
237
  }
235
238
 
236
239
  export class TokenMintDecimalsIncorrect extends Error {
237
- static readonly code = 6019;
238
- readonly code = 6019;
239
- readonly name = 'TokenMintDecimalsIncorrect';
240
- readonly msg = 'TokenMintDecimalsIncorrect';
240
+ static readonly code = 6018
241
+ readonly code = 6018
242
+ readonly name = "TokenMintDecimalsIncorrect"
243
+ readonly msg = "TokenMintDecimalsIncorrect"
241
244
 
242
245
  constructor(readonly logs?: string[]) {
243
- super('6019: TokenMintDecimalsIncorrect');
246
+ super("6018: TokenMintDecimalsIncorrect")
244
247
  }
245
248
  }
246
249
 
247
250
  export class TokenVaultIncorrect extends Error {
248
- static readonly code = 6020;
249
- readonly code = 6020;
250
- readonly name = 'TokenVaultIncorrect';
251
- readonly msg = 'TokenVaultIncorrect';
251
+ static readonly code = 6019
252
+ readonly code = 6019
253
+ readonly name = "TokenVaultIncorrect"
254
+ readonly msg = "TokenVaultIncorrect"
252
255
 
253
256
  constructor(readonly logs?: string[]) {
254
- super('6020: TokenVaultIncorrect');
257
+ super("6019: TokenVaultIncorrect")
255
258
  }
256
259
  }
257
260
 
258
261
  export class SharesMintDecimalsIncorrect extends Error {
259
- static readonly code = 6021;
260
- readonly code = 6021;
261
- readonly name = 'SharesMintDecimalsIncorrect';
262
- readonly msg = 'SharesMintDecimalsIncorrect';
262
+ static readonly code = 6020
263
+ readonly code = 6020
264
+ readonly name = "SharesMintDecimalsIncorrect"
265
+ readonly msg = "SharesMintDecimalsIncorrect"
263
266
 
264
267
  constructor(readonly logs?: string[]) {
265
- super('6021: SharesMintDecimalsIncorrect');
268
+ super("6020: SharesMintDecimalsIncorrect")
266
269
  }
267
270
  }
268
271
 
269
272
  export class SharesMintIncorrect extends Error {
270
- static readonly code = 6022;
271
- readonly code = 6022;
272
- readonly name = 'SharesMintIncorrect';
273
- readonly msg = 'SharesMintIncorrect';
273
+ static readonly code = 6021
274
+ readonly code = 6021
275
+ readonly name = "SharesMintIncorrect"
276
+ readonly msg = "SharesMintIncorrect"
274
277
 
275
278
  constructor(readonly logs?: string[]) {
276
- super('6022: SharesMintIncorrect');
279
+ super("6021: SharesMintIncorrect")
277
280
  }
278
281
  }
279
282
 
280
283
  export class InitialAccountintIncorrect extends Error {
281
- static readonly code = 6023;
282
- readonly code = 6023;
283
- readonly name = 'InitialAccountintIncorrect';
284
- readonly msg = 'InitialAccountintIncorrect';
284
+ static readonly code = 6022
285
+ readonly code = 6022
286
+ readonly name = "InitialAccountintIncorrect"
287
+ readonly msg = "InitialAccountintIncorrect"
288
+
289
+ constructor(readonly logs?: string[]) {
290
+ super("6022: InitialAccountintIncorrect")
291
+ }
292
+ }
293
+
294
+ export class ReserveIsStale extends Error {
295
+ static readonly code = 6023
296
+ readonly code = 6023
297
+ readonly name = "ReserveIsStale"
298
+ readonly msg = "Reserve is stale and must be refreshed before any operation"
299
+
300
+ constructor(readonly logs?: string[]) {
301
+ super("6023: Reserve is stale and must be refreshed before any operation")
302
+ }
303
+ }
304
+
305
+ export class NotEnoughLiquidityDisinvestedToSendToUser extends Error {
306
+ static readonly code = 6024
307
+ readonly code = 6024
308
+ readonly name = "NotEnoughLiquidityDisinvestedToSendToUser"
309
+ readonly msg = "Not enough liquidity disinvested to send to user"
310
+
311
+ constructor(readonly logs?: string[]) {
312
+ super("6024: Not enough liquidity disinvested to send to user")
313
+ }
314
+ }
315
+
316
+ export class BPSValueTooBig extends Error {
317
+ static readonly code = 6025
318
+ readonly code = 6025
319
+ readonly name = "BPSValueTooBig"
320
+ readonly msg = "BPS value is greater than 10000"
321
+
322
+ constructor(readonly logs?: string[]) {
323
+ super("6025: BPS value is greater than 10000")
324
+ }
325
+ }
326
+
327
+ export class DepositAmountBelowMinimum extends Error {
328
+ static readonly code = 6026
329
+ readonly code = 6026
330
+ readonly name = "DepositAmountBelowMinimum"
331
+ readonly msg = "Deposited amount is below minimum"
332
+
333
+ constructor(readonly logs?: string[]) {
334
+ super("6026: Deposited amount is below minimum")
335
+ }
336
+ }
337
+
338
+ export class ReserveSpaceExhausted extends Error {
339
+ static readonly code = 6027
340
+ readonly code = 6027
341
+ readonly name = "ReserveSpaceExhausted"
342
+ readonly msg = "Vault have no space for new reserves"
343
+
344
+ constructor(readonly logs?: string[]) {
345
+ super("6027: Vault have no space for new reserves")
346
+ }
347
+ }
348
+
349
+ export class CannotWithdrawFromEmptyVault extends Error {
350
+ static readonly code = 6028
351
+ readonly code = 6028
352
+ readonly name = "CannotWithdrawFromEmptyVault"
353
+ readonly msg = "Cannot withdraw from empty vault"
354
+
355
+ constructor(readonly logs?: string[]) {
356
+ super("6028: Cannot withdraw from empty vault")
357
+ }
358
+ }
359
+
360
+ export class TokensDepositedAmountDoesNotMatch extends Error {
361
+ static readonly code = 6029
362
+ readonly code = 6029
363
+ readonly name = "TokensDepositedAmountDoesNotMatch"
364
+ readonly msg = "TokensDepositedAmountDoesNotMatch"
365
+
366
+ constructor(readonly logs?: string[]) {
367
+ super("6029: TokensDepositedAmountDoesNotMatch")
368
+ }
369
+ }
370
+
371
+ export class AmountToWithdrawDoesNotMatch extends Error {
372
+ static readonly code = 6030
373
+ readonly code = 6030
374
+ readonly name = "AmountToWithdrawDoesNotMatch"
375
+ readonly msg = "Amount to withdraw does not match"
376
+
377
+ constructor(readonly logs?: string[]) {
378
+ super("6030: Amount to withdraw does not match")
379
+ }
380
+ }
381
+
382
+ export class LiquidityToWithdrawDoesNotMatch extends Error {
383
+ static readonly code = 6031
384
+ readonly code = 6031
385
+ readonly name = "LiquidityToWithdrawDoesNotMatch"
386
+ readonly msg = "Liquidity to withdraw does not match"
387
+
388
+ constructor(readonly logs?: string[]) {
389
+ super("6031: Liquidity to withdraw does not match")
390
+ }
391
+ }
392
+
393
+ export class UserReceivedAmountDoesNotMatch extends Error {
394
+ static readonly code = 6032
395
+ readonly code = 6032
396
+ readonly name = "UserReceivedAmountDoesNotMatch"
397
+ readonly msg = "User received amount does not match"
398
+
399
+ constructor(readonly logs?: string[]) {
400
+ super("6032: User received amount does not match")
401
+ }
402
+ }
403
+
404
+ export class SharesBurnedAmountDoesNotMatch extends Error {
405
+ static readonly code = 6033
406
+ readonly code = 6033
407
+ readonly name = "SharesBurnedAmountDoesNotMatch"
408
+ readonly msg = "Shares burned amount does not match"
409
+
410
+ constructor(readonly logs?: string[]) {
411
+ super("6033: Shares burned amount does not match")
412
+ }
413
+ }
414
+
415
+ export class DisinvestedLiquidityAmountDoesNotMatch extends Error {
416
+ static readonly code = 6034
417
+ readonly code = 6034
418
+ readonly name = "DisinvestedLiquidityAmountDoesNotMatch"
419
+ readonly msg = "Disinvested liquidity amount does not match"
420
+
421
+ constructor(readonly logs?: string[]) {
422
+ super("6034: Disinvested liquidity amount does not match")
423
+ }
424
+ }
425
+
426
+ export class SharesMintedAmountDoesNotMatch extends Error {
427
+ static readonly code = 6035
428
+ readonly code = 6035
429
+ readonly name = "SharesMintedAmountDoesNotMatch"
430
+ readonly msg = "SharesMintedAmountDoesNotMatch"
431
+
432
+ constructor(readonly logs?: string[]) {
433
+ super("6035: SharesMintedAmountDoesNotMatch")
434
+ }
435
+ }
436
+
437
+ export class AUMDecreasedAfterInvest extends Error {
438
+ static readonly code = 6036
439
+ readonly code = 6036
440
+ readonly name = "AUMDecreasedAfterInvest"
441
+ readonly msg = "AUM decreased after invest"
442
+
443
+ constructor(readonly logs?: string[]) {
444
+ super("6036: AUM decreased after invest")
445
+ }
446
+ }
447
+
448
+ export class AUMBelowPendingFees extends Error {
449
+ static readonly code = 6037
450
+ readonly code = 6037
451
+ readonly name = "AUMBelowPendingFees"
452
+ readonly msg = "AUM is below pending fees"
285
453
 
286
454
  constructor(readonly logs?: string[]) {
287
- super('6023: InitialAccountintIncorrect');
455
+ super("6037: AUM is below pending fees")
288
456
  }
289
457
  }
290
458
 
291
459
  export function fromCode(code: number, logs?: string[]): CustomError | null {
292
460
  switch (code) {
293
461
  case 6000:
294
- return new DepositAmountsZero(logs);
462
+ return new DepositAmountsZero(logs)
295
463
  case 6001:
296
- return new SharesIssuedAmountDoesNotMatch(logs);
464
+ return new SharesIssuedAmountDoesNotMatch(logs)
297
465
  case 6002:
298
- return new MathOverflow(logs);
466
+ return new MathOverflow(logs)
299
467
  case 6003:
300
- return new IntegerOverflow(logs);
468
+ return new IntegerOverflow(logs)
301
469
  case 6004:
302
- return new CannotWithdrawZeroAmount(logs);
470
+ return new WithdrawAmountBelowMinimum(logs)
303
471
  case 6005:
304
- return new TooMuchLiquidityToWithdraw(logs);
472
+ return new TooMuchLiquidityToWithdraw(logs)
305
473
  case 6006:
306
- return new ReserveAlreadyExists(logs);
474
+ return new ReserveAlreadyExists(logs)
307
475
  case 6007:
308
- return new ReserveNotPartOfAllocations(logs);
476
+ return new ReserveNotPartOfAllocations(logs)
309
477
  case 6008:
310
- return new CouldNotDeserializeAccountAsReserve(logs);
478
+ return new CouldNotDeserializeAccountAsReserve(logs)
311
479
  case 6009:
312
- return new ReserveNotProvidedInTheAccounts(logs);
480
+ return new ReserveNotProvidedInTheAccounts(logs)
313
481
  case 6010:
314
- return new ReserveAccountAndKeyMismatch(logs);
482
+ return new ReserveAccountAndKeyMismatch(logs)
315
483
  case 6011:
316
- return new OutOfRangeOfReserveIndex(logs);
484
+ return new OutOfRangeOfReserveIndex(logs)
317
485
  case 6012:
318
- return new CannotFindReserveInAllocations(logs);
486
+ return new CannotFindReserveInAllocations(logs)
319
487
  case 6013:
320
- return new CannotInvestZeroAmount(logs);
488
+ return new InvestAmountBelowMinimum(logs)
321
489
  case 6014:
322
- return new SlotDecreased(logs);
490
+ return new AdminAuthorityIncorrect(logs)
323
491
  case 6015:
324
- return new AdminAuthorityIncorrect(logs);
492
+ return new BaseVaultAuthorityIncorrect(logs)
325
493
  case 6016:
326
- return new BaseVaultAuthorityIncorrect(logs);
494
+ return new BaseVaultAuthorityBumpIncorrect(logs)
327
495
  case 6017:
328
- return new BaseVaultAuthorityBumpIncorrect(logs);
496
+ return new TokenMintIncorrect(logs)
329
497
  case 6018:
330
- return new TokenMintIncorrect(logs);
498
+ return new TokenMintDecimalsIncorrect(logs)
331
499
  case 6019:
332
- return new TokenMintDecimalsIncorrect(logs);
500
+ return new TokenVaultIncorrect(logs)
333
501
  case 6020:
334
- return new TokenVaultIncorrect(logs);
502
+ return new SharesMintDecimalsIncorrect(logs)
335
503
  case 6021:
336
- return new SharesMintDecimalsIncorrect(logs);
504
+ return new SharesMintIncorrect(logs)
337
505
  case 6022:
338
- return new SharesMintIncorrect(logs);
506
+ return new InitialAccountintIncorrect(logs)
339
507
  case 6023:
340
- return new InitialAccountintIncorrect(logs);
508
+ return new ReserveIsStale(logs)
509
+ case 6024:
510
+ return new NotEnoughLiquidityDisinvestedToSendToUser(logs)
511
+ case 6025:
512
+ return new BPSValueTooBig(logs)
513
+ case 6026:
514
+ return new DepositAmountBelowMinimum(logs)
515
+ case 6027:
516
+ return new ReserveSpaceExhausted(logs)
517
+ case 6028:
518
+ return new CannotWithdrawFromEmptyVault(logs)
519
+ case 6029:
520
+ return new TokensDepositedAmountDoesNotMatch(logs)
521
+ case 6030:
522
+ return new AmountToWithdrawDoesNotMatch(logs)
523
+ case 6031:
524
+ return new LiquidityToWithdrawDoesNotMatch(logs)
525
+ case 6032:
526
+ return new UserReceivedAmountDoesNotMatch(logs)
527
+ case 6033:
528
+ return new SharesBurnedAmountDoesNotMatch(logs)
529
+ case 6034:
530
+ return new DisinvestedLiquidityAmountDoesNotMatch(logs)
531
+ case 6035:
532
+ return new SharesMintedAmountDoesNotMatch(logs)
533
+ case 6036:
534
+ return new AUMDecreasedAfterInvest(logs)
535
+ case 6037:
536
+ return new AUMBelowPendingFees(logs)
341
537
  }
342
538
 
343
- return null;
539
+ return null
344
540
  }