@kamino-finance/klend-sdk 3.2.26 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (725) hide show
  1. package/dist/classes/action.d.ts +1 -0
  2. package/dist/classes/action.d.ts.map +1 -0
  3. package/dist/classes/action.js +1130 -1186
  4. package/dist/classes/action.js.map +1 -1
  5. package/dist/classes/curve.d.ts +1 -0
  6. package/dist/classes/curve.d.ts.map +1 -0
  7. package/dist/classes/curve.js +1 -1
  8. package/dist/classes/curve.js.map +1 -1
  9. package/dist/classes/fraction.d.ts +1 -0
  10. package/dist/classes/fraction.d.ts.map +1 -0
  11. package/dist/classes/fraction.js +7 -6
  12. package/dist/classes/fraction.js.map +1 -1
  13. package/dist/classes/index.d.ts +1 -0
  14. package/dist/classes/index.d.ts.map +1 -0
  15. package/dist/classes/index.js.map +1 -1
  16. package/dist/classes/jupiterPerps.d.ts +1 -0
  17. package/dist/classes/jupiterPerps.d.ts.map +1 -0
  18. package/dist/classes/jupiterPerps.js +7 -18
  19. package/dist/classes/jupiterPerps.js.map +1 -1
  20. package/dist/classes/manager.d.ts +1 -0
  21. package/dist/classes/manager.d.ts.map +1 -0
  22. package/dist/classes/manager.js +131 -158
  23. package/dist/classes/manager.js.map +1 -1
  24. package/dist/classes/market.d.ts +1 -0
  25. package/dist/classes/market.d.ts.map +1 -0
  26. package/dist/classes/market.js +620 -714
  27. package/dist/classes/market.js.map +1 -1
  28. package/dist/classes/obligation.d.ts +1 -0
  29. package/dist/classes/obligation.d.ts.map +1 -0
  30. package/dist/classes/obligation.js +60 -62
  31. package/dist/classes/obligation.js.map +1 -1
  32. package/dist/classes/reserve.d.ts +1 -0
  33. package/dist/classes/reserve.d.ts.map +1 -0
  34. package/dist/classes/reserve.js +120 -129
  35. package/dist/classes/reserve.js.map +1 -1
  36. package/dist/classes/shared.d.ts +1 -0
  37. package/dist/classes/shared.d.ts.map +1 -0
  38. package/dist/classes/shared.js.map +1 -1
  39. package/dist/classes/utils.d.ts +1 -0
  40. package/dist/classes/utils.d.ts.map +1 -0
  41. package/dist/classes/utils.js +3 -3
  42. package/dist/classes/utils.js.map +1 -1
  43. package/dist/classes/vault.d.ts +1 -0
  44. package/dist/classes/vault.d.ts.map +1 -0
  45. package/dist/classes/vault.js +334 -354
  46. package/dist/classes/vault.js.map +1 -1
  47. package/dist/client_kamino_manager.d.ts +1 -0
  48. package/dist/client_kamino_manager.d.ts.map +1 -0
  49. package/dist/client_kamino_manager.js +323 -326
  50. package/dist/client_kamino_manager.js.map +1 -1
  51. package/dist/idl_codegen/accounts/LendingMarket.d.ts +1 -0
  52. package/dist/idl_codegen/accounts/LendingMarket.d.ts.map +1 -0
  53. package/dist/idl_codegen/accounts/LendingMarket.js +89 -55
  54. package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -1
  55. package/dist/idl_codegen/accounts/Obligation.d.ts +1 -0
  56. package/dist/idl_codegen/accounts/Obligation.d.ts.map +1 -0
  57. package/dist/idl_codegen/accounts/Obligation.js +87 -56
  58. package/dist/idl_codegen/accounts/Obligation.js.map +1 -1
  59. package/dist/idl_codegen/accounts/ReferrerState.d.ts +1 -0
  60. package/dist/idl_codegen/accounts/ReferrerState.d.ts.map +1 -0
  61. package/dist/idl_codegen/accounts/ReferrerState.js +22 -33
  62. package/dist/idl_codegen/accounts/ReferrerState.js.map +1 -1
  63. package/dist/idl_codegen/accounts/ReferrerTokenState.d.ts +1 -0
  64. package/dist/idl_codegen/accounts/ReferrerTokenState.d.ts.map +1 -0
  65. package/dist/idl_codegen/accounts/ReferrerTokenState.js +35 -37
  66. package/dist/idl_codegen/accounts/ReferrerTokenState.js.map +1 -1
  67. package/dist/idl_codegen/accounts/Reserve.d.ts +1 -0
  68. package/dist/idl_codegen/accounts/Reserve.d.ts.map +1 -0
  69. package/dist/idl_codegen/accounts/Reserve.js +60 -49
  70. package/dist/idl_codegen/accounts/Reserve.js.map +1 -1
  71. package/dist/idl_codegen/accounts/ShortUrl.d.ts +1 -0
  72. package/dist/idl_codegen/accounts/ShortUrl.d.ts.map +1 -0
  73. package/dist/idl_codegen/accounts/ShortUrl.js +22 -33
  74. package/dist/idl_codegen/accounts/ShortUrl.js.map +1 -1
  75. package/dist/idl_codegen/accounts/UserMetadata.d.ts +1 -0
  76. package/dist/idl_codegen/accounts/UserMetadata.d.ts.map +1 -0
  77. package/dist/idl_codegen/accounts/UserMetadata.js +34 -37
  78. package/dist/idl_codegen/accounts/UserMetadata.js.map +1 -1
  79. package/dist/idl_codegen/accounts/UserState.d.ts +1 -0
  80. package/dist/idl_codegen/accounts/UserState.d.ts.map +1 -0
  81. package/dist/idl_codegen/accounts/UserState.js +77 -48
  82. package/dist/idl_codegen/accounts/UserState.js.map +1 -1
  83. package/dist/idl_codegen/accounts/index.d.ts +1 -0
  84. package/dist/idl_codegen/accounts/index.d.ts.map +1 -0
  85. package/dist/idl_codegen/accounts/index.js.map +1 -1
  86. package/dist/idl_codegen/errors/anchor.d.ts +1 -0
  87. package/dist/idl_codegen/errors/anchor.d.ts.map +1 -0
  88. package/dist/idl_codegen/errors/anchor.js +270 -216
  89. package/dist/idl_codegen/errors/anchor.js.map +1 -1
  90. package/dist/idl_codegen/errors/custom.d.ts +1 -0
  91. package/dist/idl_codegen/errors/custom.d.ts.map +1 -0
  92. package/dist/idl_codegen/errors/custom.js +560 -448
  93. package/dist/idl_codegen/errors/custom.js.map +1 -1
  94. package/dist/idl_codegen/errors/index.d.ts +1 -0
  95. package/dist/idl_codegen/errors/index.d.ts.map +1 -0
  96. package/dist/idl_codegen/errors/index.js.map +1 -1
  97. package/dist/idl_codegen/instructions/borrowObligationLiquidity.d.ts +1 -0
  98. package/dist/idl_codegen/instructions/borrowObligationLiquidity.d.ts.map +1 -0
  99. package/dist/idl_codegen/instructions/borrowObligationLiquidity.js.map +1 -1
  100. package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.d.ts +1 -0
  101. package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.d.ts.map +1 -0
  102. package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.js.map +1 -1
  103. package/dist/idl_codegen/instructions/depositObligationCollateral.d.ts +1 -0
  104. package/dist/idl_codegen/instructions/depositObligationCollateral.d.ts.map +1 -0
  105. package/dist/idl_codegen/instructions/depositObligationCollateral.js.map +1 -1
  106. package/dist/idl_codegen/instructions/depositReserveLiquidity.d.ts +1 -0
  107. package/dist/idl_codegen/instructions/depositReserveLiquidity.d.ts.map +1 -0
  108. package/dist/idl_codegen/instructions/depositReserveLiquidity.js.map +1 -1
  109. package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.d.ts +1 -0
  110. package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.d.ts.map +1 -0
  111. package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.js.map +1 -1
  112. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts +1 -0
  113. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts.map +1 -0
  114. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js.map +1 -1
  115. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts +1 -0
  116. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts.map +1 -0
  117. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js.map +1 -1
  118. package/dist/idl_codegen/instructions/idlMissingTypes.d.ts +1 -0
  119. package/dist/idl_codegen/instructions/idlMissingTypes.d.ts.map +1 -0
  120. package/dist/idl_codegen/instructions/idlMissingTypes.js.map +1 -1
  121. package/dist/idl_codegen/instructions/index.d.ts +1 -0
  122. package/dist/idl_codegen/instructions/index.d.ts.map +1 -0
  123. package/dist/idl_codegen/instructions/index.js.map +1 -1
  124. package/dist/idl_codegen/instructions/initFarmsForReserve.d.ts +1 -0
  125. package/dist/idl_codegen/instructions/initFarmsForReserve.d.ts.map +1 -0
  126. package/dist/idl_codegen/instructions/initFarmsForReserve.js.map +1 -1
  127. package/dist/idl_codegen/instructions/initLendingMarket.d.ts +1 -0
  128. package/dist/idl_codegen/instructions/initLendingMarket.d.ts.map +1 -0
  129. package/dist/idl_codegen/instructions/initLendingMarket.js.map +1 -1
  130. package/dist/idl_codegen/instructions/initObligation.d.ts +1 -0
  131. package/dist/idl_codegen/instructions/initObligation.d.ts.map +1 -0
  132. package/dist/idl_codegen/instructions/initObligation.js.map +1 -1
  133. package/dist/idl_codegen/instructions/initObligationFarmsForReserve.d.ts +1 -0
  134. package/dist/idl_codegen/instructions/initObligationFarmsForReserve.d.ts.map +1 -0
  135. package/dist/idl_codegen/instructions/initObligationFarmsForReserve.js.map +1 -1
  136. package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.d.ts +1 -0
  137. package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.d.ts.map +1 -0
  138. package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.js.map +1 -1
  139. package/dist/idl_codegen/instructions/initReferrerTokenState.d.ts +1 -0
  140. package/dist/idl_codegen/instructions/initReferrerTokenState.d.ts.map +1 -0
  141. package/dist/idl_codegen/instructions/initReferrerTokenState.js.map +1 -1
  142. package/dist/idl_codegen/instructions/initReserve.d.ts +1 -0
  143. package/dist/idl_codegen/instructions/initReserve.d.ts.map +1 -0
  144. package/dist/idl_codegen/instructions/initReserve.js.map +1 -1
  145. package/dist/idl_codegen/instructions/initUserMetadata.d.ts +1 -0
  146. package/dist/idl_codegen/instructions/initUserMetadata.d.ts.map +1 -0
  147. package/dist/idl_codegen/instructions/initUserMetadata.js.map +1 -1
  148. package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts +1 -0
  149. package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts.map +1 -0
  150. package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -1
  151. package/dist/idl_codegen/instructions/redeemFees.d.ts +1 -0
  152. package/dist/idl_codegen/instructions/redeemFees.d.ts.map +1 -0
  153. package/dist/idl_codegen/instructions/redeemFees.js.map +1 -1
  154. package/dist/idl_codegen/instructions/redeemReserveCollateral.d.ts +1 -0
  155. package/dist/idl_codegen/instructions/redeemReserveCollateral.d.ts.map +1 -0
  156. package/dist/idl_codegen/instructions/redeemReserveCollateral.js.map +1 -1
  157. package/dist/idl_codegen/instructions/refreshObligation.d.ts +1 -0
  158. package/dist/idl_codegen/instructions/refreshObligation.d.ts.map +1 -0
  159. package/dist/idl_codegen/instructions/refreshObligation.js.map +1 -1
  160. package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.d.ts +1 -0
  161. package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.d.ts.map +1 -0
  162. package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.js.map +1 -1
  163. package/dist/idl_codegen/instructions/refreshReserve.d.ts +1 -0
  164. package/dist/idl_codegen/instructions/refreshReserve.d.ts.map +1 -0
  165. package/dist/idl_codegen/instructions/refreshReserve.js.map +1 -1
  166. package/dist/idl_codegen/instructions/refreshReservesBatch.d.ts +1 -0
  167. package/dist/idl_codegen/instructions/refreshReservesBatch.d.ts.map +1 -0
  168. package/dist/idl_codegen/instructions/refreshReservesBatch.js.map +1 -1
  169. package/dist/idl_codegen/instructions/repayObligationLiquidity.d.ts +1 -0
  170. package/dist/idl_codegen/instructions/repayObligationLiquidity.d.ts.map +1 -0
  171. package/dist/idl_codegen/instructions/repayObligationLiquidity.js.map +1 -1
  172. package/dist/idl_codegen/instructions/requestElevationGroup.d.ts +1 -0
  173. package/dist/idl_codegen/instructions/requestElevationGroup.d.ts.map +1 -0
  174. package/dist/idl_codegen/instructions/requestElevationGroup.js.map +1 -1
  175. package/dist/idl_codegen/instructions/socializeLoss.d.ts +1 -0
  176. package/dist/idl_codegen/instructions/socializeLoss.d.ts.map +1 -0
  177. package/dist/idl_codegen/instructions/socializeLoss.js.map +1 -1
  178. package/dist/idl_codegen/instructions/updateEntireReserveConfig.d.ts +1 -0
  179. package/dist/idl_codegen/instructions/updateEntireReserveConfig.d.ts.map +1 -0
  180. package/dist/idl_codegen/instructions/updateEntireReserveConfig.js.map +1 -1
  181. package/dist/idl_codegen/instructions/updateLendingMarket.d.ts +1 -0
  182. package/dist/idl_codegen/instructions/updateLendingMarket.d.ts.map +1 -0
  183. package/dist/idl_codegen/instructions/updateLendingMarket.js.map +1 -1
  184. package/dist/idl_codegen/instructions/updateLendingMarketOwner.d.ts +1 -0
  185. package/dist/idl_codegen/instructions/updateLendingMarketOwner.d.ts.map +1 -0
  186. package/dist/idl_codegen/instructions/updateLendingMarketOwner.js.map +1 -1
  187. package/dist/idl_codegen/instructions/updateReserveConfig.d.ts +1 -0
  188. package/dist/idl_codegen/instructions/updateReserveConfig.d.ts.map +1 -0
  189. package/dist/idl_codegen/instructions/updateReserveConfig.js.map +1 -1
  190. package/dist/idl_codegen/instructions/updateSingleReserveConfig.d.ts +1 -0
  191. package/dist/idl_codegen/instructions/updateSingleReserveConfig.d.ts.map +1 -0
  192. package/dist/idl_codegen/instructions/updateSingleReserveConfig.js.map +1 -1
  193. package/dist/idl_codegen/instructions/withdrawObligationCollateral.d.ts +1 -0
  194. package/dist/idl_codegen/instructions/withdrawObligationCollateral.d.ts.map +1 -0
  195. package/dist/idl_codegen/instructions/withdrawObligationCollateral.js.map +1 -1
  196. package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts +1 -0
  197. package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts.map +1 -0
  198. package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -1
  199. package/dist/idl_codegen/instructions/withdrawProtocolFee.d.ts +1 -0
  200. package/dist/idl_codegen/instructions/withdrawProtocolFee.d.ts.map +1 -0
  201. package/dist/idl_codegen/instructions/withdrawProtocolFee.js.map +1 -1
  202. package/dist/idl_codegen/instructions/withdrawReferrerFees.d.ts +1 -0
  203. package/dist/idl_codegen/instructions/withdrawReferrerFees.d.ts.map +1 -0
  204. package/dist/idl_codegen/instructions/withdrawReferrerFees.js.map +1 -1
  205. package/dist/idl_codegen/programId.d.ts +1 -0
  206. package/dist/idl_codegen/programId.d.ts.map +1 -0
  207. package/dist/idl_codegen/programId.js.map +1 -1
  208. package/dist/idl_codegen/types/AssetTier.d.ts +1 -0
  209. package/dist/idl_codegen/types/AssetTier.d.ts.map +1 -0
  210. package/dist/idl_codegen/types/AssetTier.js +12 -18
  211. package/dist/idl_codegen/types/AssetTier.js.map +1 -1
  212. package/dist/idl_codegen/types/BigFractionBytes.d.ts +1 -0
  213. package/dist/idl_codegen/types/BigFractionBytes.d.ts.map +1 -0
  214. package/dist/idl_codegen/types/BigFractionBytes.js +2 -0
  215. package/dist/idl_codegen/types/BigFractionBytes.js.map +1 -1
  216. package/dist/idl_codegen/types/BorrowRateCurve.d.ts +1 -0
  217. package/dist/idl_codegen/types/BorrowRateCurve.d.ts.map +1 -0
  218. package/dist/idl_codegen/types/BorrowRateCurve.js +2 -1
  219. package/dist/idl_codegen/types/BorrowRateCurve.js.map +1 -1
  220. package/dist/idl_codegen/types/CurvePoint.d.ts +1 -0
  221. package/dist/idl_codegen/types/CurvePoint.d.ts.map +1 -0
  222. package/dist/idl_codegen/types/CurvePoint.js +2 -0
  223. package/dist/idl_codegen/types/CurvePoint.js.map +1 -1
  224. package/dist/idl_codegen/types/ElevationGroup.d.ts +1 -0
  225. package/dist/idl_codegen/types/ElevationGroup.d.ts.map +1 -0
  226. package/dist/idl_codegen/types/ElevationGroup.js +10 -0
  227. package/dist/idl_codegen/types/ElevationGroup.js.map +1 -1
  228. package/dist/idl_codegen/types/FeeCalculation.d.ts +1 -0
  229. package/dist/idl_codegen/types/FeeCalculation.d.ts.map +1 -0
  230. package/dist/idl_codegen/types/FeeCalculation.js +8 -12
  231. package/dist/idl_codegen/types/FeeCalculation.js.map +1 -1
  232. package/dist/idl_codegen/types/InitObligationArgs.d.ts +1 -0
  233. package/dist/idl_codegen/types/InitObligationArgs.d.ts.map +1 -0
  234. package/dist/idl_codegen/types/InitObligationArgs.js +2 -0
  235. package/dist/idl_codegen/types/InitObligationArgs.js.map +1 -1
  236. package/dist/idl_codegen/types/LastUpdate.d.ts +1 -0
  237. package/dist/idl_codegen/types/LastUpdate.d.ts.map +1 -0
  238. package/dist/idl_codegen/types/LastUpdate.js +7 -0
  239. package/dist/idl_codegen/types/LastUpdate.js.map +1 -1
  240. package/dist/idl_codegen/types/ObligationCollateral.d.ts +1 -0
  241. package/dist/idl_codegen/types/ObligationCollateral.d.ts.map +1 -0
  242. package/dist/idl_codegen/types/ObligationCollateral.js +14 -0
  243. package/dist/idl_codegen/types/ObligationCollateral.js.map +1 -1
  244. package/dist/idl_codegen/types/ObligationLiquidity.d.ts +1 -0
  245. package/dist/idl_codegen/types/ObligationLiquidity.d.ts.map +1 -0
  246. package/dist/idl_codegen/types/ObligationLiquidity.js +17 -1
  247. package/dist/idl_codegen/types/ObligationLiquidity.js.map +1 -1
  248. package/dist/idl_codegen/types/PriceHeuristic.d.ts +1 -0
  249. package/dist/idl_codegen/types/PriceHeuristic.d.ts.map +1 -0
  250. package/dist/idl_codegen/types/PriceHeuristic.js +6 -0
  251. package/dist/idl_codegen/types/PriceHeuristic.js.map +1 -1
  252. package/dist/idl_codegen/types/PythConfiguration.d.ts +1 -0
  253. package/dist/idl_codegen/types/PythConfiguration.d.ts.map +1 -0
  254. package/dist/idl_codegen/types/PythConfiguration.js +2 -0
  255. package/dist/idl_codegen/types/PythConfiguration.js.map +1 -1
  256. package/dist/idl_codegen/types/ReserveCollateral.d.ts +1 -0
  257. package/dist/idl_codegen/types/ReserveCollateral.d.ts.map +1 -0
  258. package/dist/idl_codegen/types/ReserveCollateral.js +8 -0
  259. package/dist/idl_codegen/types/ReserveCollateral.js.map +1 -1
  260. package/dist/idl_codegen/types/ReserveConfig.d.ts +1 -0
  261. package/dist/idl_codegen/types/ReserveConfig.d.ts.map +1 -0
  262. package/dist/idl_codegen/types/ReserveConfig.js +78 -5
  263. package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
  264. package/dist/idl_codegen/types/ReserveFarmKind.d.ts +1 -0
  265. package/dist/idl_codegen/types/ReserveFarmKind.d.ts.map +1 -0
  266. package/dist/idl_codegen/types/ReserveFarmKind.js +8 -12
  267. package/dist/idl_codegen/types/ReserveFarmKind.js.map +1 -1
  268. package/dist/idl_codegen/types/ReserveFees.d.ts +1 -0
  269. package/dist/idl_codegen/types/ReserveFees.d.ts.map +1 -0
  270. package/dist/idl_codegen/types/ReserveFees.js +16 -0
  271. package/dist/idl_codegen/types/ReserveFees.js.map +1 -1
  272. package/dist/idl_codegen/types/ReserveLiquidity.d.ts +1 -0
  273. package/dist/idl_codegen/types/ReserveLiquidity.d.ts.map +1 -0
  274. package/dist/idl_codegen/types/ReserveLiquidity.js +43 -1
  275. package/dist/idl_codegen/types/ReserveLiquidity.js.map +1 -1
  276. package/dist/idl_codegen/types/ReserveStatus.d.ts +1 -0
  277. package/dist/idl_codegen/types/ReserveStatus.d.ts.map +1 -0
  278. package/dist/idl_codegen/types/ReserveStatus.js +12 -18
  279. package/dist/idl_codegen/types/ReserveStatus.js.map +1 -1
  280. package/dist/idl_codegen/types/ScopeConfiguration.d.ts +1 -0
  281. package/dist/idl_codegen/types/ScopeConfiguration.d.ts.map +1 -0
  282. package/dist/idl_codegen/types/ScopeConfiguration.js +6 -0
  283. package/dist/idl_codegen/types/ScopeConfiguration.js.map +1 -1
  284. package/dist/idl_codegen/types/SwitchboardConfiguration.d.ts +1 -0
  285. package/dist/idl_codegen/types/SwitchboardConfiguration.d.ts.map +1 -0
  286. package/dist/idl_codegen/types/SwitchboardConfiguration.js +3 -0
  287. package/dist/idl_codegen/types/SwitchboardConfiguration.js.map +1 -1
  288. package/dist/idl_codegen/types/TokenInfo.d.ts +1 -0
  289. package/dist/idl_codegen/types/TokenInfo.d.ts.map +1 -0
  290. package/dist/idl_codegen/types/TokenInfo.js +27 -4
  291. package/dist/idl_codegen/types/TokenInfo.js.map +1 -1
  292. package/dist/idl_codegen/types/UpdateConfigMode.d.ts +1 -0
  293. package/dist/idl_codegen/types/UpdateConfigMode.d.ts.map +1 -0
  294. package/dist/idl_codegen/types/UpdateConfigMode.js +188 -282
  295. package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
  296. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts +1 -0
  297. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts.map +1 -0
  298. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js +41 -33
  299. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js.map +1 -1
  300. package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +1 -0
  301. package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts.map +1 -0
  302. package/dist/idl_codegen/types/UpdateLendingMarketMode.js +72 -108
  303. package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -1
  304. package/dist/idl_codegen/types/WithdrawalCaps.d.ts +1 -0
  305. package/dist/idl_codegen/types/WithdrawalCaps.d.ts.map +1 -0
  306. package/dist/idl_codegen/types/WithdrawalCaps.js +4 -0
  307. package/dist/idl_codegen/types/WithdrawalCaps.js.map +1 -1
  308. package/dist/idl_codegen/types/index.d.ts +1 -0
  309. package/dist/idl_codegen/types/index.d.ts.map +1 -0
  310. package/dist/idl_codegen/types/index.js.map +1 -1
  311. package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +1 -0
  312. package/dist/idl_codegen/zero_padding/ObligationZP.d.ts.map +1 -0
  313. package/dist/idl_codegen/zero_padding/ObligationZP.js +83 -54
  314. package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -1
  315. package/dist/idl_codegen/zero_padding/index.d.ts +1 -0
  316. package/dist/idl_codegen/zero_padding/index.d.ts.map +1 -0
  317. package/dist/idl_codegen/zero_padding/index.js.map +1 -1
  318. package/dist/idl_codegen_jupiter_perps/accounts/Pool.d.ts +1 -0
  319. package/dist/idl_codegen_jupiter_perps/accounts/Pool.d.ts.map +1 -0
  320. package/dist/idl_codegen_jupiter_perps/accounts/Pool.js +39 -42
  321. package/dist/idl_codegen_jupiter_perps/accounts/Pool.js.map +1 -1
  322. package/dist/idl_codegen_jupiter_perps/accounts/index.d.ts +1 -0
  323. package/dist/idl_codegen_jupiter_perps/accounts/index.d.ts.map +1 -0
  324. package/dist/idl_codegen_jupiter_perps/accounts/index.js.map +1 -1
  325. package/dist/idl_codegen_jupiter_perps/programId.d.ts +1 -0
  326. package/dist/idl_codegen_jupiter_perps/programId.d.ts.map +1 -0
  327. package/dist/idl_codegen_jupiter_perps/programId.js.map +1 -1
  328. package/dist/idl_codegen_jupiter_perps/types/Fees.d.ts +1 -0
  329. package/dist/idl_codegen_jupiter_perps/types/Fees.d.ts.map +1 -0
  330. package/dist/idl_codegen_jupiter_perps/types/Fees.js +9 -0
  331. package/dist/idl_codegen_jupiter_perps/types/Fees.js.map +1 -1
  332. package/dist/idl_codegen_jupiter_perps/types/Limit.d.ts +1 -0
  333. package/dist/idl_codegen_jupiter_perps/types/Limit.d.ts.map +1 -0
  334. package/dist/idl_codegen_jupiter_perps/types/Limit.js +3 -0
  335. package/dist/idl_codegen_jupiter_perps/types/Limit.js.map +1 -1
  336. package/dist/idl_codegen_jupiter_perps/types/PoolApr.d.ts +1 -0
  337. package/dist/idl_codegen_jupiter_perps/types/PoolApr.d.ts.map +1 -0
  338. package/dist/idl_codegen_jupiter_perps/types/PoolApr.js +3 -0
  339. package/dist/idl_codegen_jupiter_perps/types/PoolApr.js.map +1 -1
  340. package/dist/idl_codegen_jupiter_perps/types/index.d.ts +1 -0
  341. package/dist/idl_codegen_jupiter_perps/types/index.d.ts.map +1 -0
  342. package/dist/idl_codegen_jupiter_perps/types/index.js.map +1 -1
  343. package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts +1 -0
  344. package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts.map +1 -0
  345. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +58 -47
  346. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js.map +1 -1
  347. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts +1 -0
  348. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts.map +1 -0
  349. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +51 -47
  350. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
  351. package/dist/idl_codegen_kamino_vault/accounts/index.d.ts +1 -0
  352. package/dist/idl_codegen_kamino_vault/accounts/index.d.ts.map +1 -0
  353. package/dist/idl_codegen_kamino_vault/accounts/index.js.map +1 -1
  354. package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts +1 -0
  355. package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts.map +1 -0
  356. package/dist/idl_codegen_kamino_vault/errors/anchor.js +270 -216
  357. package/dist/idl_codegen_kamino_vault/errors/anchor.js.map +1 -1
  358. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts +1 -0
  359. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts.map +1 -0
  360. package/dist/idl_codegen_kamino_vault/errors/custom.js +120 -96
  361. package/dist/idl_codegen_kamino_vault/errors/custom.js.map +1 -1
  362. package/dist/idl_codegen_kamino_vault/errors/index.d.ts +1 -0
  363. package/dist/idl_codegen_kamino_vault/errors/index.d.ts.map +1 -0
  364. package/dist/idl_codegen_kamino_vault/errors/index.js.map +1 -1
  365. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +1 -0
  366. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -0
  367. package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
  368. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts +1 -0
  369. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts.map +1 -0
  370. package/dist/idl_codegen_kamino_vault/instructions/index.js.map +1 -1
  371. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts +1 -0
  372. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts.map +1 -0
  373. package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
  374. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts +1 -0
  375. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts.map +1 -0
  376. package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
  377. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts +1 -0
  378. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts.map +1 -0
  379. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js.map +1 -1
  380. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +1 -0
  381. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -0
  382. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
  383. package/dist/idl_codegen_kamino_vault/programId.d.ts +1 -0
  384. package/dist/idl_codegen_kamino_vault/programId.d.ts.map +1 -0
  385. package/dist/idl_codegen_kamino_vault/programId.js.map +1 -1
  386. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts +1 -0
  387. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts.map +1 -0
  388. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js +2 -0
  389. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js.map +1 -1
  390. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts +1 -0
  391. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts.map +1 -0
  392. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js +2 -1
  393. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js.map +1 -1
  394. package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts +1 -0
  395. package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts.map +1 -0
  396. package/dist/idl_codegen_kamino_vault/types/CurvePoint.js +2 -0
  397. package/dist/idl_codegen_kamino_vault/types/CurvePoint.js.map +1 -1
  398. package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts +1 -0
  399. package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts.map +1 -0
  400. package/dist/idl_codegen_kamino_vault/types/LastUpdate.js +7 -0
  401. package/dist/idl_codegen_kamino_vault/types/LastUpdate.js.map +1 -1
  402. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts +1 -0
  403. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts.map +1 -0
  404. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js +6 -0
  405. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js.map +1 -1
  406. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts +1 -0
  407. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts.map +1 -0
  408. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js +2 -0
  409. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js.map +1 -1
  410. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts +1 -0
  411. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts.map +1 -0
  412. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js +8 -0
  413. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js.map +1 -1
  414. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +1 -0
  415. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -0
  416. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +77 -5
  417. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
  418. package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts +1 -0
  419. package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts.map +1 -0
  420. package/dist/idl_codegen_kamino_vault/types/ReserveFees.js +16 -0
  421. package/dist/idl_codegen_kamino_vault/types/ReserveFees.js.map +1 -1
  422. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts +1 -0
  423. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts.map +1 -0
  424. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js +41 -1
  425. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js.map +1 -1
  426. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts +1 -0
  427. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts.map +1 -0
  428. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js +6 -0
  429. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js.map +1 -1
  430. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts +1 -0
  431. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts.map +1 -0
  432. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js +3 -0
  433. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js.map +1 -1
  434. package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts +1 -0
  435. package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts.map +1 -0
  436. package/dist/idl_codegen_kamino_vault/types/TokenInfo.js +27 -4
  437. package/dist/idl_codegen_kamino_vault/types/TokenInfo.js.map +1 -1
  438. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts +1 -0
  439. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts.map +1 -0
  440. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js +8 -0
  441. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js.map +1 -1
  442. package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.d.ts +1 -0
  443. package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.d.ts.map +1 -0
  444. package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.js +4 -0
  445. package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.js.map +1 -1
  446. package/dist/idl_codegen_kamino_vault/types/index.d.ts +1 -0
  447. package/dist/idl_codegen_kamino_vault/types/index.d.ts.map +1 -0
  448. package/dist/idl_codegen_kamino_vault/types/index.js.map +1 -1
  449. package/dist/index.d.ts +1 -0
  450. package/dist/index.d.ts.map +1 -0
  451. package/dist/index.js.map +1 -1
  452. package/dist/lending_operations/index.d.ts +1 -0
  453. package/dist/lending_operations/index.d.ts.map +1 -0
  454. package/dist/lending_operations/index.js.map +1 -1
  455. package/dist/lending_operations/repay_with_collateral_calcs.d.ts +1 -0
  456. package/dist/lending_operations/repay_with_collateral_calcs.d.ts.map +1 -0
  457. package/dist/lending_operations/repay_with_collateral_calcs.js +1 -1
  458. package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -1
  459. package/dist/lending_operations/repay_with_collateral_operations.d.ts +1 -0
  460. package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -0
  461. package/dist/lending_operations/repay_with_collateral_operations.js +15 -24
  462. package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
  463. package/dist/leverage/calcs.d.ts +1 -0
  464. package/dist/leverage/calcs.d.ts.map +1 -0
  465. package/dist/leverage/calcs.js +119 -132
  466. package/dist/leverage/calcs.js.map +1 -1
  467. package/dist/leverage/index.d.ts +1 -0
  468. package/dist/leverage/index.d.ts.map +1 -0
  469. package/dist/leverage/index.js.map +1 -1
  470. package/dist/leverage/instructions.d.ts +1 -0
  471. package/dist/leverage/instructions.d.ts.map +1 -0
  472. package/dist/leverage/instructions.js.map +1 -1
  473. package/dist/leverage/operations.d.ts +1 -0
  474. package/dist/leverage/operations.d.ts.map +1 -0
  475. package/dist/leverage/operations.js +75 -84
  476. package/dist/leverage/operations.js.map +1 -1
  477. package/dist/leverage/utils.d.ts +1 -0
  478. package/dist/leverage/utils.d.ts.map +1 -0
  479. package/dist/leverage/utils.js +73 -88
  480. package/dist/leverage/utils.js.map +1 -1
  481. package/dist/lib.d.ts +1 -0
  482. package/dist/lib.d.ts.map +1 -0
  483. package/dist/lib.js.map +1 -1
  484. package/dist/referrals/index.d.ts +1 -0
  485. package/dist/referrals/index.d.ts.map +1 -0
  486. package/dist/referrals/index.js.map +1 -1
  487. package/dist/referrals/instructions.d.ts +1 -0
  488. package/dist/referrals/instructions.d.ts.map +1 -0
  489. package/dist/referrals/instructions.js +8 -17
  490. package/dist/referrals/instructions.js.map +1 -1
  491. package/dist/referrals/operations.d.ts +2 -1
  492. package/dist/referrals/operations.d.ts.map +1 -0
  493. package/dist/referrals/operations.js +119 -143
  494. package/dist/referrals/operations.js.map +1 -1
  495. package/dist/utils/ObligationType.d.ts +1 -0
  496. package/dist/utils/ObligationType.d.ts.map +1 -0
  497. package/dist/utils/ObligationType.js +16 -7
  498. package/dist/utils/ObligationType.js.map +1 -1
  499. package/dist/utils/api.d.ts +1 -0
  500. package/dist/utils/api.d.ts.map +1 -0
  501. package/dist/utils/api.js +10 -21
  502. package/dist/utils/api.js.map +1 -1
  503. package/dist/utils/ata.d.ts +1 -0
  504. package/dist/utils/ata.d.ts.map +1 -0
  505. package/dist/utils/ata.js +25 -38
  506. package/dist/utils/ata.js.map +1 -1
  507. package/dist/utils/constants.d.ts +1 -0
  508. package/dist/utils/constants.d.ts.map +1 -0
  509. package/dist/utils/constants.js +1 -1
  510. package/dist/utils/constants.js.map +1 -1
  511. package/dist/utils/idl.d.ts +1 -0
  512. package/dist/utils/idl.d.ts.map +1 -0
  513. package/dist/utils/idl.js.map +1 -1
  514. package/dist/utils/index.d.ts +1 -0
  515. package/dist/utils/index.d.ts.map +1 -0
  516. package/dist/utils/index.js.map +1 -1
  517. package/dist/utils/instruction.d.ts +1 -0
  518. package/dist/utils/instruction.d.ts.map +1 -0
  519. package/dist/utils/instruction.js +116 -143
  520. package/dist/utils/instruction.js.map +1 -1
  521. package/dist/utils/kamino.d.ts +1 -0
  522. package/dist/utils/kamino.d.ts.map +1 -0
  523. package/dist/utils/kamino.js +4 -15
  524. package/dist/utils/kamino.js.map +1 -1
  525. package/dist/utils/layout.d.ts +1 -0
  526. package/dist/utils/layout.d.ts.map +1 -0
  527. package/dist/utils/layout.js.map +1 -1
  528. package/dist/utils/lookupTable.d.ts +1 -0
  529. package/dist/utils/lookupTable.d.ts.map +1 -0
  530. package/dist/utils/lookupTable.js +14 -27
  531. package/dist/utils/lookupTable.js.map +1 -1
  532. package/dist/utils/managerTypes.d.ts +1 -0
  533. package/dist/utils/managerTypes.d.ts.map +1 -0
  534. package/dist/utils/managerTypes.js +31 -2
  535. package/dist/utils/managerTypes.js.map +1 -1
  536. package/dist/utils/oracle.d.ts +1 -0
  537. package/dist/utils/oracle.d.ts.map +1 -0
  538. package/dist/utils/oracle.js +70 -83
  539. package/dist/utils/oracle.js.map +1 -1
  540. package/dist/utils/pubkey.d.ts +1 -0
  541. package/dist/utils/pubkey.d.ts.map +1 -0
  542. package/dist/utils/pubkey.js +7 -9
  543. package/dist/utils/pubkey.js.map +1 -1
  544. package/dist/utils/rpc.d.ts +1 -0
  545. package/dist/utils/rpc.d.ts.map +1 -0
  546. package/dist/utils/rpc.js +48 -70
  547. package/dist/utils/rpc.js.map +1 -1
  548. package/dist/utils/seeds.d.ts +1 -0
  549. package/dist/utils/seeds.d.ts.map +1 -0
  550. package/dist/utils/seeds.js.map +1 -1
  551. package/dist/utils/sendTransactionsUtils.d.ts +1 -0
  552. package/dist/utils/sendTransactionsUtils.d.ts.map +1 -0
  553. package/dist/utils/sendTransactionsUtils.js +82 -82
  554. package/dist/utils/sendTransactionsUtils.js.map +1 -1
  555. package/dist/utils/slots.d.ts +1 -0
  556. package/dist/utils/slots.d.ts.map +1 -0
  557. package/dist/utils/slots.js.map +1 -1
  558. package/dist/utils/syncNative.d.ts +1 -0
  559. package/dist/utils/syncNative.d.ts.map +1 -0
  560. package/dist/utils/syncNative.js.map +1 -1
  561. package/dist/utils/userMetadata.d.ts +1 -0
  562. package/dist/utils/userMetadata.d.ts.map +1 -0
  563. package/dist/utils/userMetadata.js +40 -52
  564. package/dist/utils/userMetadata.js.map +1 -1
  565. package/package.json +9 -3
  566. package/src/classes/action.ts +2884 -0
  567. package/src/classes/curve.ts +29 -0
  568. package/src/classes/fraction.ts +65 -0
  569. package/src/classes/index.ts +10 -0
  570. package/src/classes/jupiterPerps.ts +14 -0
  571. package/src/classes/manager.ts +746 -0
  572. package/src/classes/market.ts +1459 -0
  573. package/src/classes/obligation.ts +1315 -0
  574. package/src/classes/reserve.ts +1980 -0
  575. package/src/classes/shared.ts +57 -0
  576. package/src/classes/utils.ts +192 -0
  577. package/src/classes/vault.ts +808 -0
  578. package/src/client.ts +446 -0
  579. package/src/client_kamino_manager.ts +791 -0
  580. package/src/global.d.ts +1 -0
  581. package/src/idl_codegen/accounts/LendingMarket.ts +364 -0
  582. package/src/idl_codegen/accounts/Obligation.ts +349 -0
  583. package/src/idl_codegen/accounts/ReferrerState.ts +97 -0
  584. package/src/idl_codegen/accounts/ReferrerTokenState.ts +145 -0
  585. package/src/idl_codegen/accounts/Reserve.ts +248 -0
  586. package/src/idl_codegen/accounts/ShortUrl.ts +97 -0
  587. package/src/idl_codegen/accounts/UserMetadata.ts +142 -0
  588. package/src/idl_codegen/accounts/UserState.ts +301 -0
  589. package/src/idl_codegen/accounts/index.ts +19 -0
  590. package/src/idl_codegen/errors/anchor.ts +773 -0
  591. package/src/idl_codegen/errors/custom.ts +1633 -0
  592. package/src/idl_codegen/errors/index.ts +62 -0
  593. package/src/idl_codegen/instructions/borrowObligationLiquidity.ts +82 -0
  594. package/src/idl_codegen/instructions/deleteReferrerStateAndShortUrl.ts +30 -0
  595. package/src/idl_codegen/instructions/depositObligationCollateral.ts +62 -0
  596. package/src/idl_codegen/instructions/depositReserveLiquidity.ts +90 -0
  597. package/src/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.ts +98 -0
  598. package/src/idl_codegen/instructions/flashBorrowReserveLiquidity.ts +82 -0
  599. package/src/idl_codegen/instructions/flashRepayReserveLiquidity.ts +83 -0
  600. package/src/idl_codegen/instructions/idlMissingTypes.ts +62 -0
  601. package/src/idl_codegen/instructions/index.ts +138 -0
  602. package/src/idl_codegen/instructions/initFarmsForReserve.ts +62 -0
  603. package/src/idl_codegen/instructions/initLendingMarket.ts +50 -0
  604. package/src/idl_codegen/instructions/initObligation.ts +52 -0
  605. package/src/idl_codegen/instructions/initObligationFarmsForReserve.ts +60 -0
  606. package/src/idl_codegen/instructions/initReferrerStateAndShortUrl.ts +50 -0
  607. package/src/idl_codegen/instructions/initReferrerTokenState.ts +46 -0
  608. package/src/idl_codegen/instructions/initReserve.ts +74 -0
  609. package/src/idl_codegen/instructions/initUserMetadata.ts +50 -0
  610. package/src/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.ts +139 -0
  611. package/src/idl_codegen/instructions/redeemFees.ts +50 -0
  612. package/src/idl_codegen/instructions/redeemReserveCollateral.ts +94 -0
  613. package/src/idl_codegen/instructions/refreshObligation.ts +24 -0
  614. package/src/idl_codegen/instructions/refreshObligationFarmsForReserve.ts +62 -0
  615. package/src/idl_codegen/instructions/refreshReserve.ts +40 -0
  616. package/src/idl_codegen/instructions/refreshReservesBatch.ts +29 -0
  617. package/src/idl_codegen/instructions/repayObligationLiquidity.ts +64 -0
  618. package/src/idl_codegen/instructions/requestElevationGroup.ts +40 -0
  619. package/src/idl_codegen/instructions/socializeLoss.ts +48 -0
  620. package/src/idl_codegen/instructions/updateEntireReserveConfig.ts +45 -0
  621. package/src/idl_codegen/instructions/updateLendingMarket.ts +43 -0
  622. package/src/idl_codegen/instructions/updateLendingMarketOwner.ts +28 -0
  623. package/src/idl_codegen/instructions/updateReserveConfig.ts +52 -0
  624. package/src/idl_codegen/instructions/updateSingleReserveConfig.ts +48 -0
  625. package/src/idl_codegen/instructions/withdrawObligationCollateral.ts +68 -0
  626. package/src/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.ts +102 -0
  627. package/src/idl_codegen/instructions/withdrawProtocolFee.ts +62 -0
  628. package/src/idl_codegen/instructions/withdrawReferrerFees.ts +54 -0
  629. package/src/idl_codegen/programId.ts +13 -0
  630. package/src/idl_codegen/types/AssetTier.ts +118 -0
  631. package/src/idl_codegen/types/BigFractionBytes.ts +67 -0
  632. package/src/idl_codegen/types/BorrowRateCurve.ts +60 -0
  633. package/src/idl_codegen/types/CurvePoint.ts +64 -0
  634. package/src/idl_codegen/types/ElevationGroup.ts +133 -0
  635. package/src/idl_codegen/types/FeeCalculation.ts +90 -0
  636. package/src/idl_codegen/types/InitObligationArgs.ts +61 -0
  637. package/src/idl_codegen/types/LastUpdate.ts +95 -0
  638. package/src/idl_codegen/types/ObligationCollateral.ts +128 -0
  639. package/src/idl_codegen/types/ObligationLiquidity.ts +159 -0
  640. package/src/idl_codegen/types/PriceHeuristic.ts +81 -0
  641. package/src/idl_codegen/types/PythConfiguration.ts +56 -0
  642. package/src/idl_codegen/types/ReserveCollateral.ts +104 -0
  643. package/src/idl_codegen/types/ReserveConfig.ts +467 -0
  644. package/src/idl_codegen/types/ReserveFarmKind.ts +90 -0
  645. package/src/idl_codegen/types/ReserveFees.ts +122 -0
  646. package/src/idl_codegen/types/ReserveLiquidity.ts +286 -0
  647. package/src/idl_codegen/types/ReserveStatus.ts +120 -0
  648. package/src/idl_codegen/types/ScopeConfiguration.ts +85 -0
  649. package/src/idl_codegen/types/SwitchboardConfiguration.ts +67 -0
  650. package/src/idl_codegen/types/TokenInfo.ts +190 -0
  651. package/src/idl_codegen/types/UpdateConfigMode.ts +1440 -0
  652. package/src/idl_codegen/types/UpdateLendingMarketConfigValue.ts +376 -0
  653. package/src/idl_codegen/types/UpdateLendingMarketMode.ts +570 -0
  654. package/src/idl_codegen/types/WithdrawalCaps.ts +86 -0
  655. package/src/idl_codegen/types/index.ts +276 -0
  656. package/src/idl_codegen/zero_padding/ObligationZP.ts +186 -0
  657. package/src/idl_codegen/zero_padding/index.ts +1 -0
  658. package/src/idl_codegen_jupiter_perps/accounts/Pool.ts +155 -0
  659. package/src/idl_codegen_jupiter_perps/accounts/index.ts +2 -0
  660. package/src/idl_codegen_jupiter_perps/programId.ts +7 -0
  661. package/src/idl_codegen_jupiter_perps/types/Fees.ts +130 -0
  662. package/src/idl_codegen_jupiter_perps/types/Limit.ts +72 -0
  663. package/src/idl_codegen_jupiter_perps/types/PoolApr.ts +69 -0
  664. package/src/idl_codegen_jupiter_perps/types/index.ts +6 -0
  665. package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +221 -0
  666. package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +214 -0
  667. package/src/idl_codegen_kamino_vault/accounts/index.ts +4 -0
  668. package/src/idl_codegen_kamino_vault/errors/anchor.ts +764 -0
  669. package/src/idl_codegen_kamino_vault/errors/custom.ts +344 -0
  670. package/src/idl_codegen_kamino_vault/errors/index.ts +49 -0
  671. package/src/idl_codegen_kamino_vault/instructions/deposit.ts +54 -0
  672. package/src/idl_codegen_kamino_vault/instructions/index.ts +10 -0
  673. package/src/idl_codegen_kamino_vault/instructions/initVault.ts +35 -0
  674. package/src/idl_codegen_kamino_vault/instructions/invest.ts +60 -0
  675. package/src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts +58 -0
  676. package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +81 -0
  677. package/src/idl_codegen_kamino_vault/programId.ts +7 -0
  678. package/src/idl_codegen_kamino_vault/types/BigFractionBytes.ts +61 -0
  679. package/src/idl_codegen_kamino_vault/types/BorrowRateCurve.ts +55 -0
  680. package/src/idl_codegen_kamino_vault/types/CurvePoint.ts +61 -0
  681. package/src/idl_codegen_kamino_vault/types/LastUpdate.ts +90 -0
  682. package/src/idl_codegen_kamino_vault/types/PriceHeuristic.ts +78 -0
  683. package/src/idl_codegen_kamino_vault/types/PythConfiguration.ts +56 -0
  684. package/src/idl_codegen_kamino_vault/types/ReserveCollateral.ts +104 -0
  685. package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +426 -0
  686. package/src/idl_codegen_kamino_vault/types/ReserveFees.ts +118 -0
  687. package/src/idl_codegen_kamino_vault/types/ReserveLiquidity.ts +268 -0
  688. package/src/idl_codegen_kamino_vault/types/ScopeConfiguration.ts +85 -0
  689. package/src/idl_codegen_kamino_vault/types/SwitchboardConfiguration.ts +64 -0
  690. package/src/idl_codegen_kamino_vault/types/TokenInfo.ts +172 -0
  691. package/src/idl_codegen_kamino_vault/types/VaultAllocation.ts +115 -0
  692. package/src/idl_codegen_kamino_vault/types/WithdrawalCaps.ts +86 -0
  693. package/src/idl_codegen_kamino_vault/types/index.ts +30 -0
  694. package/src/index.ts +1 -0
  695. package/src/lending_operations/index.ts +2 -0
  696. package/src/lending_operations/repay_with_collateral_calcs.ts +71 -0
  697. package/src/lending_operations/repay_with_collateral_operations.ts +318 -0
  698. package/src/leverage/calcs.ts +465 -0
  699. package/src/leverage/index.ts +4 -0
  700. package/src/leverage/instructions.ts +144 -0
  701. package/src/leverage/operations.ts +1814 -0
  702. package/src/leverage/utils.ts +273 -0
  703. package/src/lib.ts +9 -0
  704. package/src/referrals/index.ts +2 -0
  705. package/src/referrals/instructions.ts +114 -0
  706. package/src/referrals/operations.ts +325 -0
  707. package/src/utils/ObligationType.ts +171 -0
  708. package/src/utils/api.ts +59 -0
  709. package/src/utils/ata.ts +195 -0
  710. package/src/utils/constants.ts +81 -0
  711. package/src/utils/idl.ts +4 -0
  712. package/src/utils/index.ts +16 -0
  713. package/src/utils/instruction.ts +258 -0
  714. package/src/utils/kamino.ts +12 -0
  715. package/src/utils/layout.ts +118 -0
  716. package/src/utils/lookupTable.ts +55 -0
  717. package/src/utils/managerTypes.ts +456 -0
  718. package/src/utils/oracle.ts +338 -0
  719. package/src/utils/pubkey.ts +261 -0
  720. package/src/utils/rpc.ts +108 -0
  721. package/src/utils/seeds.ts +183 -0
  722. package/src/utils/sendTransactionsUtils.ts +207 -0
  723. package/src/utils/slots.ts +28 -0
  724. package/src/utils/syncNative.ts +22 -0
  725. package/src/utils/userMetadata.ts +401 -0
@@ -0,0 +1,286 @@
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 ReserveLiquidityFields {
7
+ /** Reserve liquidity mint address */
8
+ mintPubkey: PublicKey
9
+ /** Reserve liquidity supply address */
10
+ supplyVault: PublicKey
11
+ /** Reserve liquidity fee collection address */
12
+ feeVault: PublicKey
13
+ /** Reserve liquidity available */
14
+ availableAmount: BN
15
+ /** Reserve liquidity borrowed (scaled fraction) */
16
+ borrowedAmountSf: BN
17
+ /** Reserve liquidity market price in quote currency (scaled fraction) */
18
+ marketPriceSf: BN
19
+ /** Unix timestamp of the market price (from the oracle) */
20
+ marketPriceLastUpdatedTs: BN
21
+ /** Reserve liquidity mint decimals */
22
+ mintDecimals: BN
23
+ /**
24
+ * Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
25
+ * If the threshold is not crossed, then the timestamp is set to 0
26
+ */
27
+ depositLimitCrossedSlot: BN
28
+ /**
29
+ * Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
30
+ * If the threshold is not crossed, then the timestamp is set to 0
31
+ */
32
+ borrowLimitCrossedSlot: BN
33
+ /** Reserve liquidity cumulative borrow rate (scaled fraction) */
34
+ cumulativeBorrowRateBsf: types.BigFractionBytesFields
35
+ /** Reserve cumulative protocol fees (scaled fraction) */
36
+ accumulatedProtocolFeesSf: BN
37
+ /** Reserve cumulative referrer fees (scaled fraction) */
38
+ accumulatedReferrerFeesSf: BN
39
+ /** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
40
+ pendingReferrerFeesSf: BN
41
+ /** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
42
+ absoluteReferralRateSf: BN
43
+ /** Token program of the liquidity mint */
44
+ tokenProgram: PublicKey
45
+ padding2: Array<BN>
46
+ padding3: Array<BN>
47
+ }
48
+
49
+ export interface ReserveLiquidityJSON {
50
+ /** Reserve liquidity mint address */
51
+ mintPubkey: string
52
+ /** Reserve liquidity supply address */
53
+ supplyVault: string
54
+ /** Reserve liquidity fee collection address */
55
+ feeVault: string
56
+ /** Reserve liquidity available */
57
+ availableAmount: string
58
+ /** Reserve liquidity borrowed (scaled fraction) */
59
+ borrowedAmountSf: string
60
+ /** Reserve liquidity market price in quote currency (scaled fraction) */
61
+ marketPriceSf: string
62
+ /** Unix timestamp of the market price (from the oracle) */
63
+ marketPriceLastUpdatedTs: string
64
+ /** Reserve liquidity mint decimals */
65
+ mintDecimals: string
66
+ /**
67
+ * Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
68
+ * If the threshold is not crossed, then the timestamp is set to 0
69
+ */
70
+ depositLimitCrossedSlot: string
71
+ /**
72
+ * Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
73
+ * If the threshold is not crossed, then the timestamp is set to 0
74
+ */
75
+ borrowLimitCrossedSlot: string
76
+ /** Reserve liquidity cumulative borrow rate (scaled fraction) */
77
+ cumulativeBorrowRateBsf: types.BigFractionBytesJSON
78
+ /** Reserve cumulative protocol fees (scaled fraction) */
79
+ accumulatedProtocolFeesSf: string
80
+ /** Reserve cumulative referrer fees (scaled fraction) */
81
+ accumulatedReferrerFeesSf: string
82
+ /** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
83
+ pendingReferrerFeesSf: string
84
+ /** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
85
+ absoluteReferralRateSf: string
86
+ /** Token program of the liquidity mint */
87
+ tokenProgram: string
88
+ padding2: Array<string>
89
+ padding3: Array<string>
90
+ }
91
+
92
+ /** Reserve liquidity */
93
+ export class ReserveLiquidity {
94
+ /** Reserve liquidity mint address */
95
+ readonly mintPubkey: PublicKey
96
+ /** Reserve liquidity supply address */
97
+ readonly supplyVault: PublicKey
98
+ /** Reserve liquidity fee collection address */
99
+ readonly feeVault: PublicKey
100
+ /** Reserve liquidity available */
101
+ readonly availableAmount: BN
102
+ /** Reserve liquidity borrowed (scaled fraction) */
103
+ readonly borrowedAmountSf: BN
104
+ /** Reserve liquidity market price in quote currency (scaled fraction) */
105
+ readonly marketPriceSf: BN
106
+ /** Unix timestamp of the market price (from the oracle) */
107
+ readonly marketPriceLastUpdatedTs: BN
108
+ /** Reserve liquidity mint decimals */
109
+ readonly mintDecimals: BN
110
+ /**
111
+ * Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
112
+ * If the threshold is not crossed, then the timestamp is set to 0
113
+ */
114
+ readonly depositLimitCrossedSlot: BN
115
+ /**
116
+ * Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
117
+ * If the threshold is not crossed, then the timestamp is set to 0
118
+ */
119
+ readonly borrowLimitCrossedSlot: BN
120
+ /** Reserve liquidity cumulative borrow rate (scaled fraction) */
121
+ readonly cumulativeBorrowRateBsf: types.BigFractionBytes
122
+ /** Reserve cumulative protocol fees (scaled fraction) */
123
+ readonly accumulatedProtocolFeesSf: BN
124
+ /** Reserve cumulative referrer fees (scaled fraction) */
125
+ readonly accumulatedReferrerFeesSf: BN
126
+ /** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
127
+ readonly pendingReferrerFeesSf: BN
128
+ /** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
129
+ readonly absoluteReferralRateSf: BN
130
+ /** Token program of the liquidity mint */
131
+ readonly tokenProgram: PublicKey
132
+ readonly padding2: Array<BN>
133
+ readonly padding3: Array<BN>
134
+
135
+ constructor(fields: ReserveLiquidityFields) {
136
+ this.mintPubkey = fields.mintPubkey
137
+ this.supplyVault = fields.supplyVault
138
+ this.feeVault = fields.feeVault
139
+ this.availableAmount = fields.availableAmount
140
+ this.borrowedAmountSf = fields.borrowedAmountSf
141
+ this.marketPriceSf = fields.marketPriceSf
142
+ this.marketPriceLastUpdatedTs = fields.marketPriceLastUpdatedTs
143
+ this.mintDecimals = fields.mintDecimals
144
+ this.depositLimitCrossedSlot = fields.depositLimitCrossedSlot
145
+ this.borrowLimitCrossedSlot = fields.borrowLimitCrossedSlot
146
+ this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
147
+ ...fields.cumulativeBorrowRateBsf,
148
+ })
149
+ this.accumulatedProtocolFeesSf = fields.accumulatedProtocolFeesSf
150
+ this.accumulatedReferrerFeesSf = fields.accumulatedReferrerFeesSf
151
+ this.pendingReferrerFeesSf = fields.pendingReferrerFeesSf
152
+ this.absoluteReferralRateSf = fields.absoluteReferralRateSf
153
+ this.tokenProgram = fields.tokenProgram
154
+ this.padding2 = fields.padding2
155
+ this.padding3 = fields.padding3
156
+ }
157
+
158
+ static layout(property?: string) {
159
+ return borsh.struct(
160
+ [
161
+ borsh.publicKey("mintPubkey"),
162
+ borsh.publicKey("supplyVault"),
163
+ borsh.publicKey("feeVault"),
164
+ borsh.u64("availableAmount"),
165
+ borsh.u128("borrowedAmountSf"),
166
+ borsh.u128("marketPriceSf"),
167
+ borsh.u64("marketPriceLastUpdatedTs"),
168
+ borsh.u64("mintDecimals"),
169
+ borsh.u64("depositLimitCrossedSlot"),
170
+ borsh.u64("borrowLimitCrossedSlot"),
171
+ types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
172
+ borsh.u128("accumulatedProtocolFeesSf"),
173
+ borsh.u128("accumulatedReferrerFeesSf"),
174
+ borsh.u128("pendingReferrerFeesSf"),
175
+ borsh.u128("absoluteReferralRateSf"),
176
+ borsh.publicKey("tokenProgram"),
177
+ borsh.array(borsh.u64(), 51, "padding2"),
178
+ borsh.array(borsh.u128(), 32, "padding3"),
179
+ ],
180
+ property
181
+ )
182
+ }
183
+
184
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
185
+ static fromDecoded(obj: any) {
186
+ return new ReserveLiquidity({
187
+ mintPubkey: obj.mintPubkey,
188
+ supplyVault: obj.supplyVault,
189
+ feeVault: obj.feeVault,
190
+ availableAmount: obj.availableAmount,
191
+ borrowedAmountSf: obj.borrowedAmountSf,
192
+ marketPriceSf: obj.marketPriceSf,
193
+ marketPriceLastUpdatedTs: obj.marketPriceLastUpdatedTs,
194
+ mintDecimals: obj.mintDecimals,
195
+ depositLimitCrossedSlot: obj.depositLimitCrossedSlot,
196
+ borrowLimitCrossedSlot: obj.borrowLimitCrossedSlot,
197
+ cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(
198
+ obj.cumulativeBorrowRateBsf
199
+ ),
200
+ accumulatedProtocolFeesSf: obj.accumulatedProtocolFeesSf,
201
+ accumulatedReferrerFeesSf: obj.accumulatedReferrerFeesSf,
202
+ pendingReferrerFeesSf: obj.pendingReferrerFeesSf,
203
+ absoluteReferralRateSf: obj.absoluteReferralRateSf,
204
+ tokenProgram: obj.tokenProgram,
205
+ padding2: obj.padding2,
206
+ padding3: obj.padding3,
207
+ })
208
+ }
209
+
210
+ static toEncodable(fields: ReserveLiquidityFields) {
211
+ return {
212
+ mintPubkey: fields.mintPubkey,
213
+ supplyVault: fields.supplyVault,
214
+ feeVault: fields.feeVault,
215
+ availableAmount: fields.availableAmount,
216
+ borrowedAmountSf: fields.borrowedAmountSf,
217
+ marketPriceSf: fields.marketPriceSf,
218
+ marketPriceLastUpdatedTs: fields.marketPriceLastUpdatedTs,
219
+ mintDecimals: fields.mintDecimals,
220
+ depositLimitCrossedSlot: fields.depositLimitCrossedSlot,
221
+ borrowLimitCrossedSlot: fields.borrowLimitCrossedSlot,
222
+ cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(
223
+ fields.cumulativeBorrowRateBsf
224
+ ),
225
+ accumulatedProtocolFeesSf: fields.accumulatedProtocolFeesSf,
226
+ accumulatedReferrerFeesSf: fields.accumulatedReferrerFeesSf,
227
+ pendingReferrerFeesSf: fields.pendingReferrerFeesSf,
228
+ absoluteReferralRateSf: fields.absoluteReferralRateSf,
229
+ tokenProgram: fields.tokenProgram,
230
+ padding2: fields.padding2,
231
+ padding3: fields.padding3,
232
+ }
233
+ }
234
+
235
+ toJSON(): ReserveLiquidityJSON {
236
+ return {
237
+ mintPubkey: this.mintPubkey.toString(),
238
+ supplyVault: this.supplyVault.toString(),
239
+ feeVault: this.feeVault.toString(),
240
+ availableAmount: this.availableAmount.toString(),
241
+ borrowedAmountSf: this.borrowedAmountSf.toString(),
242
+ marketPriceSf: this.marketPriceSf.toString(),
243
+ marketPriceLastUpdatedTs: this.marketPriceLastUpdatedTs.toString(),
244
+ mintDecimals: this.mintDecimals.toString(),
245
+ depositLimitCrossedSlot: this.depositLimitCrossedSlot.toString(),
246
+ borrowLimitCrossedSlot: this.borrowLimitCrossedSlot.toString(),
247
+ cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
248
+ accumulatedProtocolFeesSf: this.accumulatedProtocolFeesSf.toString(),
249
+ accumulatedReferrerFeesSf: this.accumulatedReferrerFeesSf.toString(),
250
+ pendingReferrerFeesSf: this.pendingReferrerFeesSf.toString(),
251
+ absoluteReferralRateSf: this.absoluteReferralRateSf.toString(),
252
+ tokenProgram: this.tokenProgram.toString(),
253
+ padding2: this.padding2.map((item) => item.toString()),
254
+ padding3: this.padding3.map((item) => item.toString()),
255
+ }
256
+ }
257
+
258
+ static fromJSON(obj: ReserveLiquidityJSON): ReserveLiquidity {
259
+ return new ReserveLiquidity({
260
+ mintPubkey: new PublicKey(obj.mintPubkey),
261
+ supplyVault: new PublicKey(obj.supplyVault),
262
+ feeVault: new PublicKey(obj.feeVault),
263
+ availableAmount: new BN(obj.availableAmount),
264
+ borrowedAmountSf: new BN(obj.borrowedAmountSf),
265
+ marketPriceSf: new BN(obj.marketPriceSf),
266
+ marketPriceLastUpdatedTs: new BN(obj.marketPriceLastUpdatedTs),
267
+ mintDecimals: new BN(obj.mintDecimals),
268
+ depositLimitCrossedSlot: new BN(obj.depositLimitCrossedSlot),
269
+ borrowLimitCrossedSlot: new BN(obj.borrowLimitCrossedSlot),
270
+ cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(
271
+ obj.cumulativeBorrowRateBsf
272
+ ),
273
+ accumulatedProtocolFeesSf: new BN(obj.accumulatedProtocolFeesSf),
274
+ accumulatedReferrerFeesSf: new BN(obj.accumulatedReferrerFeesSf),
275
+ pendingReferrerFeesSf: new BN(obj.pendingReferrerFeesSf),
276
+ absoluteReferralRateSf: new BN(obj.absoluteReferralRateSf),
277
+ tokenProgram: new PublicKey(obj.tokenProgram),
278
+ padding2: obj.padding2.map((item) => new BN(item)),
279
+ padding3: obj.padding3.map((item) => new BN(item)),
280
+ })
281
+ }
282
+
283
+ toEncodable() {
284
+ return ReserveLiquidity.toEncodable(this)
285
+ }
286
+ }
@@ -0,0 +1,120 @@
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 ActiveJSON {
7
+ kind: "Active"
8
+ }
9
+
10
+ export class Active {
11
+ static readonly discriminator = 0
12
+ static readonly kind = "Active"
13
+ readonly discriminator = 0
14
+ readonly kind = "Active"
15
+
16
+ toJSON(): ActiveJSON {
17
+ return {
18
+ kind: "Active",
19
+ }
20
+ }
21
+
22
+ toEncodable() {
23
+ return {
24
+ Active: {},
25
+ }
26
+ }
27
+ }
28
+
29
+ export interface ObsoleteJSON {
30
+ kind: "Obsolete"
31
+ }
32
+
33
+ export class Obsolete {
34
+ static readonly discriminator = 1
35
+ static readonly kind = "Obsolete"
36
+ readonly discriminator = 1
37
+ readonly kind = "Obsolete"
38
+
39
+ toJSON(): ObsoleteJSON {
40
+ return {
41
+ kind: "Obsolete",
42
+ }
43
+ }
44
+
45
+ toEncodable() {
46
+ return {
47
+ Obsolete: {},
48
+ }
49
+ }
50
+ }
51
+
52
+ export interface HiddenJSON {
53
+ kind: "Hidden"
54
+ }
55
+
56
+ export class Hidden {
57
+ static readonly discriminator = 2
58
+ static readonly kind = "Hidden"
59
+ readonly discriminator = 2
60
+ readonly kind = "Hidden"
61
+
62
+ toJSON(): HiddenJSON {
63
+ return {
64
+ kind: "Hidden",
65
+ }
66
+ }
67
+
68
+ toEncodable() {
69
+ return {
70
+ Hidden: {},
71
+ }
72
+ }
73
+ }
74
+
75
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
+ export function fromDecoded(obj: any): types.ReserveStatusKind {
77
+ if (typeof obj !== "object") {
78
+ throw new Error("Invalid enum object")
79
+ }
80
+
81
+ if ("Active" in obj) {
82
+ return new Active()
83
+ }
84
+ if ("Obsolete" in obj) {
85
+ return new Obsolete()
86
+ }
87
+ if ("Hidden" in obj) {
88
+ return new Hidden()
89
+ }
90
+
91
+ throw new Error("Invalid enum object")
92
+ }
93
+
94
+ export function fromJSON(
95
+ obj: types.ReserveStatusJSON
96
+ ): types.ReserveStatusKind {
97
+ switch (obj.kind) {
98
+ case "Active": {
99
+ return new Active()
100
+ }
101
+ case "Obsolete": {
102
+ return new Obsolete()
103
+ }
104
+ case "Hidden": {
105
+ return new Hidden()
106
+ }
107
+ }
108
+ }
109
+
110
+ export function layout(property?: string) {
111
+ const ret = borsh.rustEnum([
112
+ borsh.struct([], "Active"),
113
+ borsh.struct([], "Obsolete"),
114
+ borsh.struct([], "Hidden"),
115
+ ])
116
+ if (property !== undefined) {
117
+ return ret.replicate(property)
118
+ }
119
+ return ret
120
+ }
@@ -0,0 +1,85 @@
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 ScopeConfigurationFields {
7
+ /** Pubkey of the scope price feed (disabled if `null` or `default`) */
8
+ priceFeed: PublicKey
9
+ /** This is the scope_id price chain that results in a price for the token */
10
+ priceChain: Array<number>
11
+ /** This is the scope_id price chain for the twap */
12
+ twapChain: Array<number>
13
+ }
14
+
15
+ export interface ScopeConfigurationJSON {
16
+ /** Pubkey of the scope price feed (disabled if `null` or `default`) */
17
+ priceFeed: string
18
+ /** This is the scope_id price chain that results in a price for the token */
19
+ priceChain: Array<number>
20
+ /** This is the scope_id price chain for the twap */
21
+ twapChain: Array<number>
22
+ }
23
+
24
+ export class ScopeConfiguration {
25
+ /** Pubkey of the scope price feed (disabled if `null` or `default`) */
26
+ readonly priceFeed: PublicKey
27
+ /** This is the scope_id price chain that results in a price for the token */
28
+ readonly priceChain: Array<number>
29
+ /** This is the scope_id price chain for the twap */
30
+ readonly twapChain: Array<number>
31
+
32
+ constructor(fields: ScopeConfigurationFields) {
33
+ this.priceFeed = fields.priceFeed
34
+ this.priceChain = fields.priceChain
35
+ this.twapChain = fields.twapChain
36
+ }
37
+
38
+ static layout(property?: string) {
39
+ return borsh.struct(
40
+ [
41
+ borsh.publicKey("priceFeed"),
42
+ borsh.array(borsh.u16(), 4, "priceChain"),
43
+ borsh.array(borsh.u16(), 4, "twapChain"),
44
+ ],
45
+ property
46
+ )
47
+ }
48
+
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ static fromDecoded(obj: any) {
51
+ return new ScopeConfiguration({
52
+ priceFeed: obj.priceFeed,
53
+ priceChain: obj.priceChain,
54
+ twapChain: obj.twapChain,
55
+ })
56
+ }
57
+
58
+ static toEncodable(fields: ScopeConfigurationFields) {
59
+ return {
60
+ priceFeed: fields.priceFeed,
61
+ priceChain: fields.priceChain,
62
+ twapChain: fields.twapChain,
63
+ }
64
+ }
65
+
66
+ toJSON(): ScopeConfigurationJSON {
67
+ return {
68
+ priceFeed: this.priceFeed.toString(),
69
+ priceChain: this.priceChain,
70
+ twapChain: this.twapChain,
71
+ }
72
+ }
73
+
74
+ static fromJSON(obj: ScopeConfigurationJSON): ScopeConfiguration {
75
+ return new ScopeConfiguration({
76
+ priceFeed: new PublicKey(obj.priceFeed),
77
+ priceChain: obj.priceChain,
78
+ twapChain: obj.twapChain,
79
+ })
80
+ }
81
+
82
+ toEncodable() {
83
+ return ScopeConfiguration.toEncodable(this)
84
+ }
85
+ }
@@ -0,0 +1,67 @@
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 SwitchboardConfigurationFields {
7
+ /** Pubkey of the base price feed (disabled if `null` or `default`) */
8
+ priceAggregator: PublicKey
9
+ twapAggregator: PublicKey
10
+ }
11
+
12
+ export interface SwitchboardConfigurationJSON {
13
+ /** Pubkey of the base price feed (disabled if `null` or `default`) */
14
+ priceAggregator: string
15
+ twapAggregator: string
16
+ }
17
+
18
+ export class SwitchboardConfiguration {
19
+ /** Pubkey of the base price feed (disabled if `null` or `default`) */
20
+ readonly priceAggregator: PublicKey
21
+ readonly twapAggregator: PublicKey
22
+
23
+ constructor(fields: SwitchboardConfigurationFields) {
24
+ this.priceAggregator = fields.priceAggregator
25
+ this.twapAggregator = fields.twapAggregator
26
+ }
27
+
28
+ static layout(property?: string) {
29
+ return borsh.struct(
30
+ [borsh.publicKey("priceAggregator"), borsh.publicKey("twapAggregator")],
31
+ property
32
+ )
33
+ }
34
+
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ static fromDecoded(obj: any) {
37
+ return new SwitchboardConfiguration({
38
+ priceAggregator: obj.priceAggregator,
39
+ twapAggregator: obj.twapAggregator,
40
+ })
41
+ }
42
+
43
+ static toEncodable(fields: SwitchboardConfigurationFields) {
44
+ return {
45
+ priceAggregator: fields.priceAggregator,
46
+ twapAggregator: fields.twapAggregator,
47
+ }
48
+ }
49
+
50
+ toJSON(): SwitchboardConfigurationJSON {
51
+ return {
52
+ priceAggregator: this.priceAggregator.toString(),
53
+ twapAggregator: this.twapAggregator.toString(),
54
+ }
55
+ }
56
+
57
+ static fromJSON(obj: SwitchboardConfigurationJSON): SwitchboardConfiguration {
58
+ return new SwitchboardConfiguration({
59
+ priceAggregator: new PublicKey(obj.priceAggregator),
60
+ twapAggregator: new PublicKey(obj.twapAggregator),
61
+ })
62
+ }
63
+
64
+ toEncodable() {
65
+ return SwitchboardConfiguration.toEncodable(this)
66
+ }
67
+ }