@kamino-finance/klend-sdk 2.10.6

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 (369) hide show
  1. package/README.md +85 -0
  2. package/dist/classes/action.d.ts +154 -0
  3. package/dist/classes/action.js +1505 -0
  4. package/dist/classes/action.js.map +1 -0
  5. package/dist/classes/curve.d.ts +15 -0
  6. package/dist/classes/curve.js +32 -0
  7. package/dist/classes/curve.js.map +1 -0
  8. package/dist/classes/fraction.d.ts +23 -0
  9. package/dist/classes/fraction.js +60 -0
  10. package/dist/classes/fraction.js.map +1 -0
  11. package/dist/classes/index.d.ts +8 -0
  12. package/dist/classes/index.js +25 -0
  13. package/dist/classes/index.js.map +1 -0
  14. package/dist/classes/jupiterPerps.d.ts +2 -0
  15. package/dist/classes/jupiterPerps.js +25 -0
  16. package/dist/classes/jupiterPerps.js.map +1 -0
  17. package/dist/classes/market.d.ts +140 -0
  18. package/dist/classes/market.js +901 -0
  19. package/dist/classes/market.js.map +1 -0
  20. package/dist/classes/obligation.d.ts +170 -0
  21. package/dist/classes/obligation.js +610 -0
  22. package/dist/classes/obligation.js.map +1 -0
  23. package/dist/classes/reserve.d.ts +161 -0
  24. package/dist/classes/reserve.js +474 -0
  25. package/dist/classes/reserve.js.map +1 -0
  26. package/dist/classes/shared.d.ts +41 -0
  27. package/dist/classes/shared.js +10 -0
  28. package/dist/classes/shared.js.map +1 -0
  29. package/dist/classes/utils.d.ts +40 -0
  30. package/dist/classes/utils.js +129 -0
  31. package/dist/classes/utils.js.map +1 -0
  32. package/dist/idl.json +4102 -0
  33. package/dist/idl_codegen/accounts/LendingMarket.d.ts +153 -0
  34. package/dist/idl_codegen/accounts/LendingMarket.js +204 -0
  35. package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -0
  36. package/dist/idl_codegen/accounts/Obligation.d.ts +139 -0
  37. package/dist/idl_codegen/accounts/Obligation.js +193 -0
  38. package/dist/idl_codegen/accounts/Obligation.js.map +1 -0
  39. package/dist/idl_codegen/accounts/ReferrerState.d.ts +22 -0
  40. package/dist/idl_codegen/accounts/ReferrerState.js +101 -0
  41. package/dist/idl_codegen/accounts/ReferrerState.js.map +1 -0
  42. package/dist/idl_codegen/accounts/ReferrerTokenState.d.ts +51 -0
  43. package/dist/idl_codegen/accounts/ReferrerTokenState.js +126 -0
  44. package/dist/idl_codegen/accounts/ReferrerTokenState.js.map +1 -0
  45. package/dist/idl_codegen/accounts/Reserve.d.ts +72 -0
  46. package/dist/idl_codegen/accounts/Reserve.js +156 -0
  47. package/dist/idl_codegen/accounts/Reserve.js.map +1 -0
  48. package/dist/idl_codegen/accounts/ShortUrl.d.ts +22 -0
  49. package/dist/idl_codegen/accounts/ShortUrl.js +101 -0
  50. package/dist/idl_codegen/accounts/ShortUrl.js.map +1 -0
  51. package/dist/idl_codegen/accounts/UserMetadata.d.ts +48 -0
  52. package/dist/idl_codegen/accounts/UserMetadata.js +126 -0
  53. package/dist/idl_codegen/accounts/UserMetadata.js.map +1 -0
  54. package/dist/idl_codegen/accounts/UserState.d.ts +143 -0
  55. package/dist/idl_codegen/accounts/UserState.js +180 -0
  56. package/dist/idl_codegen/accounts/UserState.js.map +1 -0
  57. package/dist/idl_codegen/accounts/index.d.ts +16 -0
  58. package/dist/idl_codegen/accounts/index.js +20 -0
  59. package/dist/idl_codegen/accounts/index.js.map +1 -0
  60. package/dist/idl_codegen/errors/anchor.d.ts +434 -0
  61. package/dist/idl_codegen/errors/anchor.js +713 -0
  62. package/dist/idl_codegen/errors/anchor.js.map +1 -0
  63. package/dist/idl_codegen/errors/custom.d.ts +730 -0
  64. package/dist/idl_codegen/errors/custom.js +1194 -0
  65. package/dist/idl_codegen/errors/custom.js.map +1 -0
  66. package/dist/idl_codegen/errors/index.d.ts +5 -0
  67. package/dist/idl_codegen/errors/index.js +71 -0
  68. package/dist/idl_codegen/errors/index.js.map +1 -0
  69. package/dist/idl_codegen/instructions/borrowObligationLiquidity.d.ts +20 -0
  70. package/dist/idl_codegen/instructions/borrowObligationLiquidity.js +75 -0
  71. package/dist/idl_codegen/instructions/borrowObligationLiquidity.js.map +1 -0
  72. package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.d.ts +9 -0
  73. package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.js +20 -0
  74. package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.js.map +1 -0
  75. package/dist/idl_codegen/instructions/depositObligationCollateral.d.ts +17 -0
  76. package/dist/idl_codegen/instructions/depositObligationCollateral.js +64 -0
  77. package/dist/idl_codegen/instructions/depositObligationCollateral.js.map +1 -0
  78. package/dist/idl_codegen/instructions/depositReserveLiquidity.d.ts +19 -0
  79. package/dist/idl_codegen/instructions/depositReserveLiquidity.js +74 -0
  80. package/dist/idl_codegen/instructions/depositReserveLiquidity.js.map +1 -0
  81. package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.d.ts +21 -0
  82. package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.js +80 -0
  83. package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.js.map +1 -0
  84. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts +20 -0
  85. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js +75 -0
  86. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js.map +1 -0
  87. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts +21 -0
  88. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js +75 -0
  89. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js.map +1 -0
  90. package/dist/idl_codegen/instructions/idlMissingTypes.d.ts +18 -0
  91. package/dist/idl_codegen/instructions/idlMissingTypes.js +62 -0
  92. package/dist/idl_codegen/instructions/idlMissingTypes.js.map +1 -0
  93. package/dist/idl_codegen/instructions/index.d.ts +66 -0
  94. package/dist/idl_codegen/instructions/index.js +70 -0
  95. package/dist/idl_codegen/instructions/index.js.map +1 -0
  96. package/dist/idl_codegen/instructions/initFarmsForReserve.d.ts +19 -0
  97. package/dist/idl_codegen/instructions/initFarmsForReserve.js +63 -0
  98. package/dist/idl_codegen/instructions/initFarmsForReserve.js.map +1 -0
  99. package/dist/idl_codegen/instructions/initLendingMarket.d.ts +13 -0
  100. package/dist/idl_codegen/instructions/initLendingMarket.js +55 -0
  101. package/dist/idl_codegen/instructions/initLendingMarket.js.map +1 -0
  102. package/dist/idl_codegen/instructions/initObligation.d.ts +19 -0
  103. package/dist/idl_codegen/instructions/initObligation.js +55 -0
  104. package/dist/idl_codegen/instructions/initObligation.js.map +1 -0
  105. package/dist/idl_codegen/instructions/initObligationFarmsForReserve.d.ts +20 -0
  106. package/dist/idl_codegen/instructions/initObligationFarmsForReserve.js +60 -0
  107. package/dist/idl_codegen/instructions/initObligationFarmsForReserve.js.map +1 -0
  108. package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.d.ts +14 -0
  109. package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.js +54 -0
  110. package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.js.map +1 -0
  111. package/dist/idl_codegen/instructions/initReferrerTokenState.d.ts +14 -0
  112. package/dist/idl_codegen/instructions/initReferrerTokenState.js +50 -0
  113. package/dist/idl_codegen/instructions/initReferrerTokenState.js.map +1 -0
  114. package/dist/idl_codegen/instructions/initReserve.d.ts +16 -0
  115. package/dist/idl_codegen/instructions/initReserve.js +47 -0
  116. package/dist/idl_codegen/instructions/initReserve.js.map +1 -0
  117. package/dist/idl_codegen/instructions/initUserMetadata.d.ts +14 -0
  118. package/dist/idl_codegen/instructions/initUserMetadata.js +54 -0
  119. package/dist/idl_codegen/instructions/initUserMetadata.js.map +1 -0
  120. package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts +27 -0
  121. package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js +102 -0
  122. package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -0
  123. package/dist/idl_codegen/instructions/redeemFees.d.ts +10 -0
  124. package/dist/idl_codegen/instructions/redeemFees.js +33 -0
  125. package/dist/idl_codegen/instructions/redeemFees.js.map +1 -0
  126. package/dist/idl_codegen/instructions/redeemReserveCollateral.d.ts +19 -0
  127. package/dist/idl_codegen/instructions/redeemReserveCollateral.js +78 -0
  128. package/dist/idl_codegen/instructions/redeemReserveCollateral.js.map +1 -0
  129. package/dist/idl_codegen/instructions/refreshObligation.d.ts +6 -0
  130. package/dist/idl_codegen/instructions/refreshObligation.js +17 -0
  131. package/dist/idl_codegen/instructions/refreshObligation.js.map +1 -0
  132. package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.d.ts +19 -0
  133. package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.js +63 -0
  134. package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.js.map +1 -0
  135. package/dist/idl_codegen/instructions/refreshReserve.d.ts +10 -0
  136. package/dist/idl_codegen/instructions/refreshReserve.js +29 -0
  137. package/dist/idl_codegen/instructions/refreshReserve.js.map +1 -0
  138. package/dist/idl_codegen/instructions/repayObligationLiquidity.d.ts +17 -0
  139. package/dist/idl_codegen/instructions/repayObligationLiquidity.js +60 -0
  140. package/dist/idl_codegen/instructions/repayObligationLiquidity.js.map +1 -0
  141. package/dist/idl_codegen/instructions/requestElevationGroup.d.ts +11 -0
  142. package/dist/idl_codegen/instructions/requestElevationGroup.js +47 -0
  143. package/dist/idl_codegen/instructions/requestElevationGroup.js.map +1 -0
  144. package/dist/idl_codegen/instructions/socializeLoss.d.ts +14 -0
  145. package/dist/idl_codegen/instructions/socializeLoss.js +53 -0
  146. package/dist/idl_codegen/instructions/socializeLoss.js.map +1 -0
  147. package/dist/idl_codegen/instructions/updateEntireReserveConfig.d.ts +13 -0
  148. package/dist/idl_codegen/instructions/updateEntireReserveConfig.js +51 -0
  149. package/dist/idl_codegen/instructions/updateEntireReserveConfig.js.map +1 -0
  150. package/dist/idl_codegen/instructions/updateLendingMarket.d.ts +12 -0
  151. package/dist/idl_codegen/instructions/updateLendingMarket.js +50 -0
  152. package/dist/idl_codegen/instructions/updateLendingMarket.js.map +1 -0
  153. package/dist/idl_codegen/instructions/updateLendingMarketOwner.d.ts +6 -0
  154. package/dist/idl_codegen/instructions/updateLendingMarketOwner.js +21 -0
  155. package/dist/idl_codegen/instructions/updateLendingMarketOwner.js.map +1 -0
  156. package/dist/idl_codegen/instructions/updateReserveConfig.d.ts +13 -0
  157. package/dist/idl_codegen/instructions/updateReserveConfig.js +51 -0
  158. package/dist/idl_codegen/instructions/updateReserveConfig.js.map +1 -0
  159. package/dist/idl_codegen/instructions/updateSingleReserveConfig.d.ts +13 -0
  160. package/dist/idl_codegen/instructions/updateSingleReserveConfig.js +51 -0
  161. package/dist/idl_codegen/instructions/updateSingleReserveConfig.js.map +1 -0
  162. package/dist/idl_codegen/instructions/withdrawObligationCollateral.d.ts +18 -0
  163. package/dist/idl_codegen/instructions/withdrawObligationCollateral.js +69 -0
  164. package/dist/idl_codegen/instructions/withdrawObligationCollateral.js.map +1 -0
  165. package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts +21 -0
  166. package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js +84 -0
  167. package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -0
  168. package/dist/idl_codegen/instructions/withdrawProtocolFee.d.ts +16 -0
  169. package/dist/idl_codegen/instructions/withdrawProtocolFee.js +59 -0
  170. package/dist/idl_codegen/instructions/withdrawProtocolFee.js.map +1 -0
  171. package/dist/idl_codegen/instructions/withdrawReferrerFees.d.ts +12 -0
  172. package/dist/idl_codegen/instructions/withdrawReferrerFees.js +35 -0
  173. package/dist/idl_codegen/instructions/withdrawReferrerFees.js.map +1 -0
  174. package/dist/idl_codegen/programId.d.ts +4 -0
  175. package/dist/idl_codegen/programId.js +13 -0
  176. package/dist/idl_codegen/programId.js.map +1 -0
  177. package/dist/idl_codegen/types/AssetTier.d.ts +44 -0
  178. package/dist/idl_codegen/types/AssetTier.js +128 -0
  179. package/dist/idl_codegen/types/AssetTier.js.map +1 -0
  180. package/dist/idl_codegen/types/BigFractionBytes.d.ts +27 -0
  181. package/dist/idl_codegen/types/BigFractionBytes.js +73 -0
  182. package/dist/idl_codegen/types/BigFractionBytes.js.map +1 -0
  183. package/dist/idl_codegen/types/BorrowRateCurve.d.ts +27 -0
  184. package/dist/idl_codegen/types/BorrowRateCurve.js +62 -0
  185. package/dist/idl_codegen/types/BorrowRateCurve.js.map +1 -0
  186. package/dist/idl_codegen/types/CurvePoint.d.ts +26 -0
  187. package/dist/idl_codegen/types/CurvePoint.js +66 -0
  188. package/dist/idl_codegen/types/CurvePoint.js.map +1 -0
  189. package/dist/idl_codegen/types/ElevationGroup.d.ts +52 -0
  190. package/dist/idl_codegen/types/ElevationGroup.js +103 -0
  191. package/dist/idl_codegen/types/ElevationGroup.js.map +1 -0
  192. package/dist/idl_codegen/types/FeeCalculation.d.ts +31 -0
  193. package/dist/idl_codegen/types/FeeCalculation.js +102 -0
  194. package/dist/idl_codegen/types/FeeCalculation.js.map +1 -0
  195. package/dist/idl_codegen/types/InitObligationArgs.d.ts +26 -0
  196. package/dist/idl_codegen/types/InitObligationArgs.js +66 -0
  197. package/dist/idl_codegen/types/InitObligationArgs.js.map +1 -0
  198. package/dist/idl_codegen/types/LastUpdate.d.ts +47 -0
  199. package/dist/idl_codegen/types/LastUpdate.js +86 -0
  200. package/dist/idl_codegen/types/LastUpdate.js.map +1 -0
  201. package/dist/idl_codegen/types/ObligationCollateral.d.ts +48 -0
  202. package/dist/idl_codegen/types/ObligationCollateral.js +87 -0
  203. package/dist/idl_codegen/types/ObligationCollateral.js.map +1 -0
  204. package/dist/idl_codegen/types/ObligationLiquidity.d.ts +75 -0
  205. package/dist/idl_codegen/types/ObligationLiquidity.js +107 -0
  206. package/dist/idl_codegen/types/ObligationLiquidity.js.map +1 -0
  207. package/dist/idl_codegen/types/PriceHeuristic.d.ts +41 -0
  208. package/dist/idl_codegen/types/PriceHeuristic.js +75 -0
  209. package/dist/idl_codegen/types/PriceHeuristic.js.map +1 -0
  210. package/dist/idl_codegen/types/PythConfiguration.d.ts +25 -0
  211. package/dist/idl_codegen/types/PythConfiguration.js +62 -0
  212. package/dist/idl_codegen/types/PythConfiguration.js.map +1 -0
  213. package/dist/idl_codegen/types/ReserveCollateral.d.ts +53 -0
  214. package/dist/idl_codegen/types/ReserveCollateral.js +93 -0
  215. package/dist/idl_codegen/types/ReserveCollateral.js.map +1 -0
  216. package/dist/idl_codegen/types/ReserveConfig.d.ts +304 -0
  217. package/dist/idl_codegen/types/ReserveConfig.js +209 -0
  218. package/dist/idl_codegen/types/ReserveConfig.js.map +1 -0
  219. package/dist/idl_codegen/types/ReserveFarmKind.d.ts +31 -0
  220. package/dist/idl_codegen/types/ReserveFarmKind.js +102 -0
  221. package/dist/idl_codegen/types/ReserveFarmKind.js.map +1 -0
  222. package/dist/idl_codegen/types/ReserveFees.d.ts +78 -0
  223. package/dist/idl_codegen/types/ReserveFees.js +86 -0
  224. package/dist/idl_codegen/types/ReserveFees.js.map +1 -0
  225. package/dist/idl_codegen/types/ReserveLiquidity.d.ts +173 -0
  226. package/dist/idl_codegen/types/ReserveLiquidity.js +166 -0
  227. package/dist/idl_codegen/types/ReserveLiquidity.js.map +1 -0
  228. package/dist/idl_codegen/types/ReserveStatus.d.ts +44 -0
  229. package/dist/idl_codegen/types/ReserveStatus.js +128 -0
  230. package/dist/idl_codegen/types/ReserveStatus.js.map +1 -0
  231. package/dist/idl_codegen/types/ScopeConfiguration.d.ts +41 -0
  232. package/dist/idl_codegen/types/ScopeConfiguration.js +76 -0
  233. package/dist/idl_codegen/types/ScopeConfiguration.js.map +1 -0
  234. package/dist/idl_codegen/types/SwitchboardConfiguration.d.ts +30 -0
  235. package/dist/idl_codegen/types/SwitchboardConfiguration.js +67 -0
  236. package/dist/idl_codegen/types/SwitchboardConfiguration.js.map +1 -0
  237. package/dist/idl_codegen/types/TokenInfo.d.ts +109 -0
  238. package/dist/idl_codegen/types/TokenInfo.js +116 -0
  239. package/dist/idl_codegen/types/TokenInfo.js.map +1 -0
  240. package/dist/idl_codegen/types/UpdateConfigMode.d.ts +538 -0
  241. package/dist/idl_codegen/types/UpdateConfigMode.js +1116 -0
  242. package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -0
  243. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts +155 -0
  244. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js +273 -0
  245. package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js.map +1 -0
  246. package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +200 -0
  247. package/dist/idl_codegen/types/UpdateLendingMarketMode.js +440 -0
  248. package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -0
  249. package/dist/idl_codegen/types/WithdrawalCaps.d.ts +38 -0
  250. package/dist/idl_codegen/types/WithdrawalCaps.js +86 -0
  251. package/dist/idl_codegen/types/WithdrawalCaps.js.map +1 -0
  252. package/dist/idl_codegen/types/index.d.ts +65 -0
  253. package/dist/idl_codegen/types/index.js +77 -0
  254. package/dist/idl_codegen/types/index.js.map +1 -0
  255. package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +53 -0
  256. package/dist/idl_codegen/zero_padding/ObligationZP.js +140 -0
  257. package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -0
  258. package/dist/idl_codegen/zero_padding/index.d.ts +1 -0
  259. package/dist/idl_codegen/zero_padding/index.js +6 -0
  260. package/dist/idl_codegen/zero_padding/index.js.map +1 -0
  261. package/dist/idl_codegen_jupiter_perps/accounts/Pool.d.ts +48 -0
  262. package/dist/idl_codegen_jupiter_perps/accounts/Pool.js +144 -0
  263. package/dist/idl_codegen_jupiter_perps/accounts/Pool.js.map +1 -0
  264. package/dist/idl_codegen_jupiter_perps/accounts/index.d.ts +2 -0
  265. package/dist/idl_codegen_jupiter_perps/accounts/index.js +6 -0
  266. package/dist/idl_codegen_jupiter_perps/accounts/index.js.map +1 -0
  267. package/dist/idl_codegen_jupiter_perps/programId.d.ts +3 -0
  268. package/dist/idl_codegen_jupiter_perps/programId.js +9 -0
  269. package/dist/idl_codegen_jupiter_perps/programId.js.map +1 -0
  270. package/dist/idl_codegen_jupiter_perps/types/Fees.d.ts +62 -0
  271. package/dist/idl_codegen_jupiter_perps/types/Fees.js +115 -0
  272. package/dist/idl_codegen_jupiter_perps/types/Fees.js.map +1 -0
  273. package/dist/idl_codegen_jupiter_perps/types/Limit.d.ts +32 -0
  274. package/dist/idl_codegen_jupiter_perps/types/Limit.js +75 -0
  275. package/dist/idl_codegen_jupiter_perps/types/Limit.js.map +1 -0
  276. package/dist/idl_codegen_jupiter_perps/types/PoolApr.d.ts +32 -0
  277. package/dist/idl_codegen_jupiter_perps/types/PoolApr.js +75 -0
  278. package/dist/idl_codegen_jupiter_perps/types/PoolApr.js.map +1 -0
  279. package/dist/idl_codegen_jupiter_perps/types/index.d.ts +6 -0
  280. package/dist/idl_codegen_jupiter_perps/types/index.js +10 -0
  281. package/dist/idl_codegen_jupiter_perps/types/index.js.map +1 -0
  282. package/dist/index.d.ts +1 -0
  283. package/dist/index.js +18 -0
  284. package/dist/index.js.map +1 -0
  285. package/dist/lending_operations/index.d.ts +2 -0
  286. package/dist/lending_operations/index.js +19 -0
  287. package/dist/lending_operations/index.js.map +1 -0
  288. package/dist/lending_operations/repay_with_collateral_calcs.d.ts +5 -0
  289. package/dist/lending_operations/repay_with_collateral_calcs.js +26 -0
  290. package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -0
  291. package/dist/lending_operations/repay_with_collateral_operations.d.ts +47 -0
  292. package/dist/lending_operations/repay_with_collateral_operations.js +163 -0
  293. package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -0
  294. package/dist/leverage/calcs.d.ts +132 -0
  295. package/dist/leverage/calcs.js +291 -0
  296. package/dist/leverage/calcs.js.map +1 -0
  297. package/dist/leverage/index.d.ts +4 -0
  298. package/dist/leverage/index.js +21 -0
  299. package/dist/leverage/index.js.map +1 -0
  300. package/dist/leverage/instructions.d.ts +43 -0
  301. package/dist/leverage/instructions.js +103 -0
  302. package/dist/leverage/instructions.js.map +1 -0
  303. package/dist/leverage/operations.d.ts +231 -0
  304. package/dist/leverage/operations.js +1058 -0
  305. package/dist/leverage/operations.js.map +1 -0
  306. package/dist/leverage/utils.d.ts +22 -0
  307. package/dist/leverage/utils.js +144 -0
  308. package/dist/leverage/utils.js.map +1 -0
  309. package/dist/lib.d.ts +9 -0
  310. package/dist/lib.js +26 -0
  311. package/dist/lib.js.map +1 -0
  312. package/dist/referrals/index.d.ts +2 -0
  313. package/dist/referrals/index.js +19 -0
  314. package/dist/referrals/index.js.map +1 -0
  315. package/dist/referrals/instructions.d.ts +16 -0
  316. package/dist/referrals/instructions.js +76 -0
  317. package/dist/referrals/instructions.js.map +1 -0
  318. package/dist/referrals/operations.d.ts +97 -0
  319. package/dist/referrals/operations.js +258 -0
  320. package/dist/referrals/operations.js.map +1 -0
  321. package/dist/utils/ObligationType.d.ts +49 -0
  322. package/dist/utils/ObligationType.js +129 -0
  323. package/dist/utils/ObligationType.js.map +1 -0
  324. package/dist/utils/api.d.ts +6 -0
  325. package/dist/utils/api.js +61 -0
  326. package/dist/utils/api.js.map +1 -0
  327. package/dist/utils/ata.d.ts +25 -0
  328. package/dist/utils/ata.js +155 -0
  329. package/dist/utils/ata.js.map +1 -0
  330. package/dist/utils/constants.d.ts +48 -0
  331. package/dist/utils/constants.js +75 -0
  332. package/dist/utils/constants.js.map +1 -0
  333. package/dist/utils/idl.d.ts +2 -0
  334. package/dist/utils/idl.js +9 -0
  335. package/dist/utils/idl.js.map +1 -0
  336. package/dist/utils/index.d.ts +14 -0
  337. package/dist/utils/index.js +31 -0
  338. package/dist/utils/index.js.map +1 -0
  339. package/dist/utils/instruction.d.ts +22 -0
  340. package/dist/utils/instruction.js +202 -0
  341. package/dist/utils/instruction.js.map +1 -0
  342. package/dist/utils/kamino.d.ts +3 -0
  343. package/dist/utils/kamino.js +45 -0
  344. package/dist/utils/kamino.js.map +1 -0
  345. package/dist/utils/layout.d.ts +13 -0
  346. package/dist/utils/layout.js +123 -0
  347. package/dist/utils/layout.js.map +1 -0
  348. package/dist/utils/lookupTable.d.ts +5 -0
  349. package/dist/utils/lookupTable.js +57 -0
  350. package/dist/utils/lookupTable.js.map +1 -0
  351. package/dist/utils/oracle.d.ts +51 -0
  352. package/dist/utils/oracle.js +295 -0
  353. package/dist/utils/oracle.js.map +1 -0
  354. package/dist/utils/pubkey.d.ts +74 -0
  355. package/dist/utils/pubkey.js +229 -0
  356. package/dist/utils/pubkey.js.map +1 -0
  357. package/dist/utils/seeds.d.ts +122 -0
  358. package/dist/utils/seeds.js +153 -0
  359. package/dist/utils/seeds.js.map +1 -0
  360. package/dist/utils/slots.d.ts +18 -0
  361. package/dist/utils/slots.js +32 -0
  362. package/dist/utils/slots.js.map +1 -0
  363. package/dist/utils/syncNative.d.ts +10 -0
  364. package/dist/utils/syncNative.js +46 -0
  365. package/dist/utils/syncNative.js.map +1 -0
  366. package/dist/utils/userMetadata.d.ts +15 -0
  367. package/dist/utils/userMetadata.js +259 -0
  368. package/dist/utils/userMetadata.js.map +1 -0
  369. package/package.json +94 -0
@@ -0,0 +1,38 @@
1
+ import BN from "bn.js";
2
+ import * as types from "../types";
3
+ export interface WithdrawalCapsFields {
4
+ configCapacity: BN;
5
+ currentTotal: BN;
6
+ lastIntervalStartTimestamp: BN;
7
+ configIntervalLengthSeconds: BN;
8
+ }
9
+ export interface WithdrawalCapsJSON {
10
+ configCapacity: string;
11
+ currentTotal: string;
12
+ lastIntervalStartTimestamp: string;
13
+ configIntervalLengthSeconds: string;
14
+ }
15
+ /** Reserve Withdrawal Caps State */
16
+ export declare class WithdrawalCaps {
17
+ readonly configCapacity: BN;
18
+ readonly currentTotal: BN;
19
+ readonly lastIntervalStartTimestamp: BN;
20
+ readonly configIntervalLengthSeconds: BN;
21
+ constructor(fields: WithdrawalCapsFields);
22
+ static layout(property?: string): any;
23
+ static fromDecoded(obj: any): types.WithdrawalCaps;
24
+ static toEncodable(fields: WithdrawalCapsFields): {
25
+ configCapacity: BN;
26
+ currentTotal: BN;
27
+ lastIntervalStartTimestamp: BN;
28
+ configIntervalLengthSeconds: BN;
29
+ };
30
+ toJSON(): WithdrawalCapsJSON;
31
+ static fromJSON(obj: WithdrawalCapsJSON): WithdrawalCaps;
32
+ toEncodable(): {
33
+ configCapacity: BN;
34
+ currentTotal: BN;
35
+ lastIntervalStartTimestamp: BN;
36
+ configIntervalLengthSeconds: BN;
37
+ };
38
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.WithdrawalCaps = void 0;
30
+ const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
31
+ const borsh = __importStar(require("@coral-xyz/borsh"));
32
+ /** Reserve Withdrawal Caps State */
33
+ class WithdrawalCaps {
34
+ constructor(fields) {
35
+ this.configCapacity = fields.configCapacity;
36
+ this.currentTotal = fields.currentTotal;
37
+ this.lastIntervalStartTimestamp = fields.lastIntervalStartTimestamp;
38
+ this.configIntervalLengthSeconds = fields.configIntervalLengthSeconds;
39
+ }
40
+ static layout(property) {
41
+ return borsh.struct([
42
+ borsh.i64("configCapacity"),
43
+ borsh.i64("currentTotal"),
44
+ borsh.u64("lastIntervalStartTimestamp"),
45
+ borsh.u64("configIntervalLengthSeconds"),
46
+ ], property);
47
+ }
48
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
+ static fromDecoded(obj) {
50
+ return new WithdrawalCaps({
51
+ configCapacity: obj.configCapacity,
52
+ currentTotal: obj.currentTotal,
53
+ lastIntervalStartTimestamp: obj.lastIntervalStartTimestamp,
54
+ configIntervalLengthSeconds: obj.configIntervalLengthSeconds,
55
+ });
56
+ }
57
+ static toEncodable(fields) {
58
+ return {
59
+ configCapacity: fields.configCapacity,
60
+ currentTotal: fields.currentTotal,
61
+ lastIntervalStartTimestamp: fields.lastIntervalStartTimestamp,
62
+ configIntervalLengthSeconds: fields.configIntervalLengthSeconds,
63
+ };
64
+ }
65
+ toJSON() {
66
+ return {
67
+ configCapacity: this.configCapacity.toString(),
68
+ currentTotal: this.currentTotal.toString(),
69
+ lastIntervalStartTimestamp: this.lastIntervalStartTimestamp.toString(),
70
+ configIntervalLengthSeconds: this.configIntervalLengthSeconds.toString(),
71
+ };
72
+ }
73
+ static fromJSON(obj) {
74
+ return new WithdrawalCaps({
75
+ configCapacity: new bn_js_1.default(obj.configCapacity),
76
+ currentTotal: new bn_js_1.default(obj.currentTotal),
77
+ lastIntervalStartTimestamp: new bn_js_1.default(obj.lastIntervalStartTimestamp),
78
+ configIntervalLengthSeconds: new bn_js_1.default(obj.configIntervalLengthSeconds),
79
+ });
80
+ }
81
+ toEncodable() {
82
+ return WithdrawalCaps.toEncodable(this);
83
+ }
84
+ }
85
+ exports.WithdrawalCaps = WithdrawalCaps;
86
+ //# sourceMappingURL=WithdrawalCaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawalCaps.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/WithdrawalCaps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;AAgBzC,oCAAoC;AACpC,MAAa,cAAc;IAMzB,YAAY,MAA4B;QACtC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;QACvC,IAAI,CAAC,0BAA0B,GAAG,MAAM,CAAC,0BAA0B,CAAA;QACnE,IAAI,CAAC,2BAA2B,GAAG,MAAM,CAAC,2BAA2B,CAAA;IACvE,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,QAAiB;QAC7B,OAAO,KAAK,CAAC,MAAM,CACjB;YACE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC3B,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC;YACzB,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC;YACvC,KAAK,CAAC,GAAG,CAAC,6BAA6B,CAAC;SACzC,EACD,QAAQ,CACT,CAAA;IACH,CAAC;IAED,8DAA8D;IAC9D,MAAM,CAAC,WAAW,CAAC,GAAQ;QACzB,OAAO,IAAI,cAAc,CAAC;YACxB,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,0BAA0B,EAAE,GAAG,CAAC,0BAA0B;YAC1D,2BAA2B,EAAE,GAAG,CAAC,2BAA2B;SAC7D,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,MAA4B;QAC7C,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,0BAA0B,EAAE,MAAM,CAAC,0BAA0B;YAC7D,2BAA2B,EAAE,MAAM,CAAC,2BAA2B;SAChE,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;YAC9C,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YAC1C,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC,QAAQ,EAAE;YACtE,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC,QAAQ,EAAE;SACzE,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAuB;QACrC,OAAO,IAAI,cAAc,CAAC;YACxB,cAAc,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,cAAc,CAAC;YAC1C,YAAY,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,YAAY,CAAC;YACtC,0BAA0B,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,0BAA0B,CAAC;YAClE,2BAA2B,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,2BAA2B,CAAC;SACrE,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;CACF;AAjED,wCAiEC","sourcesContent":["import { PublicKey } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\"\n\nexport interface WithdrawalCapsFields {\n configCapacity: BN\n currentTotal: BN\n lastIntervalStartTimestamp: BN\n configIntervalLengthSeconds: BN\n}\n\nexport interface WithdrawalCapsJSON {\n configCapacity: string\n currentTotal: string\n lastIntervalStartTimestamp: string\n configIntervalLengthSeconds: string\n}\n\n/** Reserve Withdrawal Caps State */\nexport class WithdrawalCaps {\n readonly configCapacity: BN\n readonly currentTotal: BN\n readonly lastIntervalStartTimestamp: BN\n readonly configIntervalLengthSeconds: BN\n\n constructor(fields: WithdrawalCapsFields) {\n this.configCapacity = fields.configCapacity\n this.currentTotal = fields.currentTotal\n this.lastIntervalStartTimestamp = fields.lastIntervalStartTimestamp\n this.configIntervalLengthSeconds = fields.configIntervalLengthSeconds\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.i64(\"configCapacity\"),\n borsh.i64(\"currentTotal\"),\n borsh.u64(\"lastIntervalStartTimestamp\"),\n borsh.u64(\"configIntervalLengthSeconds\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new WithdrawalCaps({\n configCapacity: obj.configCapacity,\n currentTotal: obj.currentTotal,\n lastIntervalStartTimestamp: obj.lastIntervalStartTimestamp,\n configIntervalLengthSeconds: obj.configIntervalLengthSeconds,\n })\n }\n\n static toEncodable(fields: WithdrawalCapsFields) {\n return {\n configCapacity: fields.configCapacity,\n currentTotal: fields.currentTotal,\n lastIntervalStartTimestamp: fields.lastIntervalStartTimestamp,\n configIntervalLengthSeconds: fields.configIntervalLengthSeconds,\n }\n }\n\n toJSON(): WithdrawalCapsJSON {\n return {\n configCapacity: this.configCapacity.toString(),\n currentTotal: this.currentTotal.toString(),\n lastIntervalStartTimestamp: this.lastIntervalStartTimestamp.toString(),\n configIntervalLengthSeconds: this.configIntervalLengthSeconds.toString(),\n }\n }\n\n static fromJSON(obj: WithdrawalCapsJSON): WithdrawalCaps {\n return new WithdrawalCaps({\n configCapacity: new BN(obj.configCapacity),\n currentTotal: new BN(obj.currentTotal),\n lastIntervalStartTimestamp: new BN(obj.lastIntervalStartTimestamp),\n configIntervalLengthSeconds: new BN(obj.configIntervalLengthSeconds),\n })\n }\n\n toEncodable() {\n return WithdrawalCaps.toEncodable(this)\n }\n}\n"]}
@@ -0,0 +1,65 @@
1
+ import * as UpdateConfigMode from "./UpdateConfigMode";
2
+ import * as UpdateLendingMarketConfigValue from "./UpdateLendingMarketConfigValue";
3
+ import * as UpdateLendingMarketMode from "./UpdateLendingMarketMode";
4
+ import * as AssetTier from "./AssetTier";
5
+ import * as FeeCalculation from "./FeeCalculation";
6
+ import * as ReserveFarmKind from "./ReserveFarmKind";
7
+ import * as ReserveStatus from "./ReserveStatus";
8
+ export { UpdateConfigMode };
9
+ export type UpdateConfigModeKind = UpdateConfigMode.UpdateLoanToValuePct | UpdateConfigMode.UpdateMaxLiquidationBonusBps | UpdateConfigMode.UpdateLiquidationThresholdPct | UpdateConfigMode.UpdateProtocolLiquidationFee | UpdateConfigMode.UpdateProtocolTakeRate | UpdateConfigMode.UpdateFeesBorrowFee | UpdateConfigMode.UpdateFeesFlashLoanFee | UpdateConfigMode.UpdateFeesReferralFeeBps | UpdateConfigMode.UpdateDepositLimit | UpdateConfigMode.UpdateBorrowLimit | UpdateConfigMode.UpdateTokenInfoLowerHeuristic | UpdateConfigMode.UpdateTokenInfoUpperHeuristic | UpdateConfigMode.UpdateTokenInfoExpHeuristic | UpdateConfigMode.UpdateTokenInfoTwapDivergence | UpdateConfigMode.UpdateTokenInfoScopeTwap | UpdateConfigMode.UpdateTokenInfoScopeChain | UpdateConfigMode.UpdateTokenInfoName | UpdateConfigMode.UpdateTokenInfoPriceMaxAge | UpdateConfigMode.UpdateTokenInfoTwapMaxAge | UpdateConfigMode.UpdateScopePriceFeed | UpdateConfigMode.UpdatePythPrice | UpdateConfigMode.UpdateSwitchboardFeed | UpdateConfigMode.UpdateSwitchboardTwapFeed | UpdateConfigMode.UpdateBorrowRateCurve | UpdateConfigMode.UpdateEntireReserveConfig | UpdateConfigMode.UpdateDebtWithdrawalCap | UpdateConfigMode.UpdateDepositWithdrawalCap | UpdateConfigMode.UpdateDebtWithdrawalCapCurrentTotal | UpdateConfigMode.UpdateDepositWithdrawalCapCurrentTotal | UpdateConfigMode.UpdateBadDebtLiquidationBonusBps | UpdateConfigMode.UpdateMinLiquidationBonusBps | UpdateConfigMode.DeleveragingMarginCallPeriod | UpdateConfigMode.UpdateBorrowFactor | UpdateConfigMode.UpdateAssetTier | UpdateConfigMode.UpdateElevationGroup | UpdateConfigMode.DeleveragingThresholdSlotsPerBps | UpdateConfigMode.UpdateMultiplierSideBoost | UpdateConfigMode.UpdateMultiplierTagBoost | UpdateConfigMode.UpdateReserveStatus | UpdateConfigMode.UpdateFarmCollateral | UpdateConfigMode.UpdateFarmDebt;
10
+ export type UpdateConfigModeJSON = UpdateConfigMode.UpdateLoanToValuePctJSON | UpdateConfigMode.UpdateMaxLiquidationBonusBpsJSON | UpdateConfigMode.UpdateLiquidationThresholdPctJSON | UpdateConfigMode.UpdateProtocolLiquidationFeeJSON | UpdateConfigMode.UpdateProtocolTakeRateJSON | UpdateConfigMode.UpdateFeesBorrowFeeJSON | UpdateConfigMode.UpdateFeesFlashLoanFeeJSON | UpdateConfigMode.UpdateFeesReferralFeeBpsJSON | UpdateConfigMode.UpdateDepositLimitJSON | UpdateConfigMode.UpdateBorrowLimitJSON | UpdateConfigMode.UpdateTokenInfoLowerHeuristicJSON | UpdateConfigMode.UpdateTokenInfoUpperHeuristicJSON | UpdateConfigMode.UpdateTokenInfoExpHeuristicJSON | UpdateConfigMode.UpdateTokenInfoTwapDivergenceJSON | UpdateConfigMode.UpdateTokenInfoScopeTwapJSON | UpdateConfigMode.UpdateTokenInfoScopeChainJSON | UpdateConfigMode.UpdateTokenInfoNameJSON | UpdateConfigMode.UpdateTokenInfoPriceMaxAgeJSON | UpdateConfigMode.UpdateTokenInfoTwapMaxAgeJSON | UpdateConfigMode.UpdateScopePriceFeedJSON | UpdateConfigMode.UpdatePythPriceJSON | UpdateConfigMode.UpdateSwitchboardFeedJSON | UpdateConfigMode.UpdateSwitchboardTwapFeedJSON | UpdateConfigMode.UpdateBorrowRateCurveJSON | UpdateConfigMode.UpdateEntireReserveConfigJSON | UpdateConfigMode.UpdateDebtWithdrawalCapJSON | UpdateConfigMode.UpdateDepositWithdrawalCapJSON | UpdateConfigMode.UpdateDebtWithdrawalCapCurrentTotalJSON | UpdateConfigMode.UpdateDepositWithdrawalCapCurrentTotalJSON | UpdateConfigMode.UpdateBadDebtLiquidationBonusBpsJSON | UpdateConfigMode.UpdateMinLiquidationBonusBpsJSON | UpdateConfigMode.DeleveragingMarginCallPeriodJSON | UpdateConfigMode.UpdateBorrowFactorJSON | UpdateConfigMode.UpdateAssetTierJSON | UpdateConfigMode.UpdateElevationGroupJSON | UpdateConfigMode.DeleveragingThresholdSlotsPerBpsJSON | UpdateConfigMode.UpdateMultiplierSideBoostJSON | UpdateConfigMode.UpdateMultiplierTagBoostJSON | UpdateConfigMode.UpdateReserveStatusJSON | UpdateConfigMode.UpdateFarmCollateralJSON | UpdateConfigMode.UpdateFarmDebtJSON;
11
+ export { UpdateLendingMarketConfigValue };
12
+ export type UpdateLendingMarketConfigValueKind = UpdateLendingMarketConfigValue.Bool | UpdateLendingMarketConfigValue.U8 | UpdateLendingMarketConfigValue.U8Array | UpdateLendingMarketConfigValue.U16 | UpdateLendingMarketConfigValue.U64 | UpdateLendingMarketConfigValue.Pubkey | UpdateLendingMarketConfigValue.ElevationGroup;
13
+ export type UpdateLendingMarketConfigValueJSON = UpdateLendingMarketConfigValue.BoolJSON | UpdateLendingMarketConfigValue.U8JSON | UpdateLendingMarketConfigValue.U8ArrayJSON | UpdateLendingMarketConfigValue.U16JSON | UpdateLendingMarketConfigValue.U64JSON | UpdateLendingMarketConfigValue.PubkeyJSON | UpdateLendingMarketConfigValue.ElevationGroupJSON;
14
+ export { UpdateLendingMarketMode };
15
+ export type UpdateLendingMarketModeKind = UpdateLendingMarketMode.UpdateOwner | UpdateLendingMarketMode.UpdateEmergencyMode | UpdateLendingMarketMode.UpdateLiquidationCloseFactor | UpdateLendingMarketMode.UpdateLiquidationMaxValue | UpdateLendingMarketMode.UpdateGlobalUnhealthyBorrow | UpdateLendingMarketMode.UpdateGlobalAllowedBorrow | UpdateLendingMarketMode.UpdateRiskCouncil | UpdateLendingMarketMode.UpdateMinFullLiquidationThreshold | UpdateLendingMarketMode.UpdateInsolvencyRiskLtv | UpdateLendingMarketMode.UpdateElevationGroup | UpdateLendingMarketMode.UpdateReferralFeeBps | UpdateLendingMarketMode.UpdateMultiplierPoints | UpdateLendingMarketMode.UpdatePriceRefreshTriggerToMaxAgePct | UpdateLendingMarketMode.UpdateAutodeleverageEnabled | UpdateLendingMarketMode.UpdateBorrowingDisabled;
16
+ export type UpdateLendingMarketModeJSON = UpdateLendingMarketMode.UpdateOwnerJSON | UpdateLendingMarketMode.UpdateEmergencyModeJSON | UpdateLendingMarketMode.UpdateLiquidationCloseFactorJSON | UpdateLendingMarketMode.UpdateLiquidationMaxValueJSON | UpdateLendingMarketMode.UpdateGlobalUnhealthyBorrowJSON | UpdateLendingMarketMode.UpdateGlobalAllowedBorrowJSON | UpdateLendingMarketMode.UpdateRiskCouncilJSON | UpdateLendingMarketMode.UpdateMinFullLiquidationThresholdJSON | UpdateLendingMarketMode.UpdateInsolvencyRiskLtvJSON | UpdateLendingMarketMode.UpdateElevationGroupJSON | UpdateLendingMarketMode.UpdateReferralFeeBpsJSON | UpdateLendingMarketMode.UpdateMultiplierPointsJSON | UpdateLendingMarketMode.UpdatePriceRefreshTriggerToMaxAgePctJSON | UpdateLendingMarketMode.UpdateAutodeleverageEnabledJSON | UpdateLendingMarketMode.UpdateBorrowingDisabledJSON;
17
+ export { LastUpdate } from "./LastUpdate";
18
+ export type { LastUpdateFields, LastUpdateJSON } from "./LastUpdate";
19
+ export { ElevationGroup } from "./ElevationGroup";
20
+ export type { ElevationGroupFields, ElevationGroupJSON } from "./ElevationGroup";
21
+ export { InitObligationArgs } from "./InitObligationArgs";
22
+ export type { InitObligationArgsFields, InitObligationArgsJSON, } from "./InitObligationArgs";
23
+ export { ObligationCollateral } from "./ObligationCollateral";
24
+ export type { ObligationCollateralFields, ObligationCollateralJSON, } from "./ObligationCollateral";
25
+ export { ObligationLiquidity } from "./ObligationLiquidity";
26
+ export type { ObligationLiquidityFields, ObligationLiquidityJSON, } from "./ObligationLiquidity";
27
+ export { AssetTier };
28
+ export type AssetTierKind = AssetTier.Regular | AssetTier.IsolatedCollateral | AssetTier.IsolatedDebt;
29
+ export type AssetTierJSON = AssetTier.RegularJSON | AssetTier.IsolatedCollateralJSON | AssetTier.IsolatedDebtJSON;
30
+ export { BigFractionBytes } from "./BigFractionBytes";
31
+ export type { BigFractionBytesFields, BigFractionBytesJSON, } from "./BigFractionBytes";
32
+ export { FeeCalculation };
33
+ /** Calculate fees exlusive or inclusive of an amount */
34
+ export type FeeCalculationKind = FeeCalculation.Exclusive | FeeCalculation.Inclusive;
35
+ export type FeeCalculationJSON = FeeCalculation.ExclusiveJSON | FeeCalculation.InclusiveJSON;
36
+ export { ReserveCollateral } from "./ReserveCollateral";
37
+ export type { ReserveCollateralFields, ReserveCollateralJSON, } from "./ReserveCollateral";
38
+ export { ReserveConfig } from "./ReserveConfig";
39
+ export type { ReserveConfigFields, ReserveConfigJSON } from "./ReserveConfig";
40
+ export { ReserveFarmKind };
41
+ export type ReserveFarmKindKind = ReserveFarmKind.Collateral | ReserveFarmKind.Debt;
42
+ export type ReserveFarmKindJSON = ReserveFarmKind.CollateralJSON | ReserveFarmKind.DebtJSON;
43
+ export { ReserveFees } from "./ReserveFees";
44
+ export type { ReserveFeesFields, ReserveFeesJSON } from "./ReserveFees";
45
+ export { ReserveLiquidity } from "./ReserveLiquidity";
46
+ export type { ReserveLiquidityFields, ReserveLiquidityJSON, } from "./ReserveLiquidity";
47
+ export { ReserveStatus };
48
+ export type ReserveStatusKind = ReserveStatus.Active | ReserveStatus.Obsolete | ReserveStatus.Hidden;
49
+ export type ReserveStatusJSON = ReserveStatus.ActiveJSON | ReserveStatus.ObsoleteJSON | ReserveStatus.HiddenJSON;
50
+ export { WithdrawalCaps } from "./WithdrawalCaps";
51
+ export type { WithdrawalCapsFields, WithdrawalCapsJSON } from "./WithdrawalCaps";
52
+ export { PriceHeuristic } from "./PriceHeuristic";
53
+ export type { PriceHeuristicFields, PriceHeuristicJSON } from "./PriceHeuristic";
54
+ export { PythConfiguration } from "./PythConfiguration";
55
+ export type { PythConfigurationFields, PythConfigurationJSON, } from "./PythConfiguration";
56
+ export { ScopeConfiguration } from "./ScopeConfiguration";
57
+ export type { ScopeConfigurationFields, ScopeConfigurationJSON, } from "./ScopeConfiguration";
58
+ export { SwitchboardConfiguration } from "./SwitchboardConfiguration";
59
+ export type { SwitchboardConfigurationFields, SwitchboardConfigurationJSON, } from "./SwitchboardConfiguration";
60
+ export { TokenInfo } from "./TokenInfo";
61
+ export type { TokenInfoFields, TokenInfoJSON } from "./TokenInfo";
62
+ export { BorrowRateCurve } from "./BorrowRateCurve";
63
+ export type { BorrowRateCurveFields, BorrowRateCurveJSON, } from "./BorrowRateCurve";
64
+ export { CurvePoint } from "./CurvePoint";
65
+ export type { CurvePointFields, CurvePointJSON } from "./CurvePoint";
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CurvePoint = exports.BorrowRateCurve = exports.TokenInfo = exports.SwitchboardConfiguration = exports.ScopeConfiguration = exports.PythConfiguration = exports.PriceHeuristic = exports.WithdrawalCaps = exports.ReserveStatus = exports.ReserveLiquidity = exports.ReserveFees = exports.ReserveFarmKind = exports.ReserveConfig = exports.ReserveCollateral = exports.FeeCalculation = exports.BigFractionBytes = exports.AssetTier = exports.ObligationLiquidity = exports.ObligationCollateral = exports.InitObligationArgs = exports.ElevationGroup = exports.LastUpdate = exports.UpdateLendingMarketMode = exports.UpdateLendingMarketConfigValue = exports.UpdateConfigMode = void 0;
27
+ const UpdateConfigMode = __importStar(require("./UpdateConfigMode"));
28
+ exports.UpdateConfigMode = UpdateConfigMode;
29
+ const UpdateLendingMarketConfigValue = __importStar(require("./UpdateLendingMarketConfigValue"));
30
+ exports.UpdateLendingMarketConfigValue = UpdateLendingMarketConfigValue;
31
+ const UpdateLendingMarketMode = __importStar(require("./UpdateLendingMarketMode"));
32
+ exports.UpdateLendingMarketMode = UpdateLendingMarketMode;
33
+ const AssetTier = __importStar(require("./AssetTier"));
34
+ exports.AssetTier = AssetTier;
35
+ const FeeCalculation = __importStar(require("./FeeCalculation"));
36
+ exports.FeeCalculation = FeeCalculation;
37
+ const ReserveFarmKind = __importStar(require("./ReserveFarmKind"));
38
+ exports.ReserveFarmKind = ReserveFarmKind;
39
+ const ReserveStatus = __importStar(require("./ReserveStatus"));
40
+ exports.ReserveStatus = ReserveStatus;
41
+ var LastUpdate_1 = require("./LastUpdate");
42
+ Object.defineProperty(exports, "LastUpdate", { enumerable: true, get: function () { return LastUpdate_1.LastUpdate; } });
43
+ var ElevationGroup_1 = require("./ElevationGroup");
44
+ Object.defineProperty(exports, "ElevationGroup", { enumerable: true, get: function () { return ElevationGroup_1.ElevationGroup; } });
45
+ var InitObligationArgs_1 = require("./InitObligationArgs");
46
+ Object.defineProperty(exports, "InitObligationArgs", { enumerable: true, get: function () { return InitObligationArgs_1.InitObligationArgs; } });
47
+ var ObligationCollateral_1 = require("./ObligationCollateral");
48
+ Object.defineProperty(exports, "ObligationCollateral", { enumerable: true, get: function () { return ObligationCollateral_1.ObligationCollateral; } });
49
+ var ObligationLiquidity_1 = require("./ObligationLiquidity");
50
+ Object.defineProperty(exports, "ObligationLiquidity", { enumerable: true, get: function () { return ObligationLiquidity_1.ObligationLiquidity; } });
51
+ var BigFractionBytes_1 = require("./BigFractionBytes");
52
+ Object.defineProperty(exports, "BigFractionBytes", { enumerable: true, get: function () { return BigFractionBytes_1.BigFractionBytes; } });
53
+ var ReserveCollateral_1 = require("./ReserveCollateral");
54
+ Object.defineProperty(exports, "ReserveCollateral", { enumerable: true, get: function () { return ReserveCollateral_1.ReserveCollateral; } });
55
+ var ReserveConfig_1 = require("./ReserveConfig");
56
+ Object.defineProperty(exports, "ReserveConfig", { enumerable: true, get: function () { return ReserveConfig_1.ReserveConfig; } });
57
+ var ReserveFees_1 = require("./ReserveFees");
58
+ Object.defineProperty(exports, "ReserveFees", { enumerable: true, get: function () { return ReserveFees_1.ReserveFees; } });
59
+ var ReserveLiquidity_1 = require("./ReserveLiquidity");
60
+ Object.defineProperty(exports, "ReserveLiquidity", { enumerable: true, get: function () { return ReserveLiquidity_1.ReserveLiquidity; } });
61
+ var WithdrawalCaps_1 = require("./WithdrawalCaps");
62
+ Object.defineProperty(exports, "WithdrawalCaps", { enumerable: true, get: function () { return WithdrawalCaps_1.WithdrawalCaps; } });
63
+ var PriceHeuristic_1 = require("./PriceHeuristic");
64
+ Object.defineProperty(exports, "PriceHeuristic", { enumerable: true, get: function () { return PriceHeuristic_1.PriceHeuristic; } });
65
+ var PythConfiguration_1 = require("./PythConfiguration");
66
+ Object.defineProperty(exports, "PythConfiguration", { enumerable: true, get: function () { return PythConfiguration_1.PythConfiguration; } });
67
+ var ScopeConfiguration_1 = require("./ScopeConfiguration");
68
+ Object.defineProperty(exports, "ScopeConfiguration", { enumerable: true, get: function () { return ScopeConfiguration_1.ScopeConfiguration; } });
69
+ var SwitchboardConfiguration_1 = require("./SwitchboardConfiguration");
70
+ Object.defineProperty(exports, "SwitchboardConfiguration", { enumerable: true, get: function () { return SwitchboardConfiguration_1.SwitchboardConfiguration; } });
71
+ var TokenInfo_1 = require("./TokenInfo");
72
+ Object.defineProperty(exports, "TokenInfo", { enumerable: true, get: function () { return TokenInfo_1.TokenInfo; } });
73
+ var BorrowRateCurve_1 = require("./BorrowRateCurve");
74
+ Object.defineProperty(exports, "BorrowRateCurve", { enumerable: true, get: function () { return BorrowRateCurve_1.BorrowRateCurve; } });
75
+ var CurvePoint_1 = require("./CurvePoint");
76
+ Object.defineProperty(exports, "CurvePoint", { enumerable: true, get: function () { return CurvePoint_1.CurvePoint; } });
77
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAsD;AAQ7C,4CAAgB;AAPzB,iGAAkF;AA8FzE,wEAA8B;AA7FvC,mFAAoE;AAgH3D,0DAAuB;AA/GhC,uDAAwC;AAqK/B,8BAAS;AApKlB,iEAAkD;AAoLzC,wCAAc;AAnLvB,mEAAoD;AAoM3C,0CAAe;AAnMxB,+DAAgD;AAmNvC,sCAAa;AApEtB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAEnB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AAEvB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAK3B,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAK7B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAgB5B,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AAezB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAK1B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AAWtB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAEpB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AAgBzB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AAEvB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AAEvB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAK1B,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAK3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AAKjC,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAElB,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AAKxB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA","sourcesContent":["import * as UpdateConfigMode from \"./UpdateConfigMode\"\nimport * as UpdateLendingMarketConfigValue from \"./UpdateLendingMarketConfigValue\"\nimport * as UpdateLendingMarketMode from \"./UpdateLendingMarketMode\"\nimport * as AssetTier from \"./AssetTier\"\nimport * as FeeCalculation from \"./FeeCalculation\"\nimport * as ReserveFarmKind from \"./ReserveFarmKind\"\nimport * as ReserveStatus from \"./ReserveStatus\"\n\nexport { UpdateConfigMode }\n\nexport type UpdateConfigModeKind =\n | UpdateConfigMode.UpdateLoanToValuePct\n | UpdateConfigMode.UpdateMaxLiquidationBonusBps\n | UpdateConfigMode.UpdateLiquidationThresholdPct\n | UpdateConfigMode.UpdateProtocolLiquidationFee\n | UpdateConfigMode.UpdateProtocolTakeRate\n | UpdateConfigMode.UpdateFeesBorrowFee\n | UpdateConfigMode.UpdateFeesFlashLoanFee\n | UpdateConfigMode.UpdateFeesReferralFeeBps\n | UpdateConfigMode.UpdateDepositLimit\n | UpdateConfigMode.UpdateBorrowLimit\n | UpdateConfigMode.UpdateTokenInfoLowerHeuristic\n | UpdateConfigMode.UpdateTokenInfoUpperHeuristic\n | UpdateConfigMode.UpdateTokenInfoExpHeuristic\n | UpdateConfigMode.UpdateTokenInfoTwapDivergence\n | UpdateConfigMode.UpdateTokenInfoScopeTwap\n | UpdateConfigMode.UpdateTokenInfoScopeChain\n | UpdateConfigMode.UpdateTokenInfoName\n | UpdateConfigMode.UpdateTokenInfoPriceMaxAge\n | UpdateConfigMode.UpdateTokenInfoTwapMaxAge\n | UpdateConfigMode.UpdateScopePriceFeed\n | UpdateConfigMode.UpdatePythPrice\n | UpdateConfigMode.UpdateSwitchboardFeed\n | UpdateConfigMode.UpdateSwitchboardTwapFeed\n | UpdateConfigMode.UpdateBorrowRateCurve\n | UpdateConfigMode.UpdateEntireReserveConfig\n | UpdateConfigMode.UpdateDebtWithdrawalCap\n | UpdateConfigMode.UpdateDepositWithdrawalCap\n | UpdateConfigMode.UpdateDebtWithdrawalCapCurrentTotal\n | UpdateConfigMode.UpdateDepositWithdrawalCapCurrentTotal\n | UpdateConfigMode.UpdateBadDebtLiquidationBonusBps\n | UpdateConfigMode.UpdateMinLiquidationBonusBps\n | UpdateConfigMode.DeleveragingMarginCallPeriod\n | UpdateConfigMode.UpdateBorrowFactor\n | UpdateConfigMode.UpdateAssetTier\n | UpdateConfigMode.UpdateElevationGroup\n | UpdateConfigMode.DeleveragingThresholdSlotsPerBps\n | UpdateConfigMode.UpdateMultiplierSideBoost\n | UpdateConfigMode.UpdateMultiplierTagBoost\n | UpdateConfigMode.UpdateReserveStatus\n | UpdateConfigMode.UpdateFarmCollateral\n | UpdateConfigMode.UpdateFarmDebt\nexport type UpdateConfigModeJSON =\n | UpdateConfigMode.UpdateLoanToValuePctJSON\n | UpdateConfigMode.UpdateMaxLiquidationBonusBpsJSON\n | UpdateConfigMode.UpdateLiquidationThresholdPctJSON\n | UpdateConfigMode.UpdateProtocolLiquidationFeeJSON\n | UpdateConfigMode.UpdateProtocolTakeRateJSON\n | UpdateConfigMode.UpdateFeesBorrowFeeJSON\n | UpdateConfigMode.UpdateFeesFlashLoanFeeJSON\n | UpdateConfigMode.UpdateFeesReferralFeeBpsJSON\n | UpdateConfigMode.UpdateDepositLimitJSON\n | UpdateConfigMode.UpdateBorrowLimitJSON\n | UpdateConfigMode.UpdateTokenInfoLowerHeuristicJSON\n | UpdateConfigMode.UpdateTokenInfoUpperHeuristicJSON\n | UpdateConfigMode.UpdateTokenInfoExpHeuristicJSON\n | UpdateConfigMode.UpdateTokenInfoTwapDivergenceJSON\n | UpdateConfigMode.UpdateTokenInfoScopeTwapJSON\n | UpdateConfigMode.UpdateTokenInfoScopeChainJSON\n | UpdateConfigMode.UpdateTokenInfoNameJSON\n | UpdateConfigMode.UpdateTokenInfoPriceMaxAgeJSON\n | UpdateConfigMode.UpdateTokenInfoTwapMaxAgeJSON\n | UpdateConfigMode.UpdateScopePriceFeedJSON\n | UpdateConfigMode.UpdatePythPriceJSON\n | UpdateConfigMode.UpdateSwitchboardFeedJSON\n | UpdateConfigMode.UpdateSwitchboardTwapFeedJSON\n | UpdateConfigMode.UpdateBorrowRateCurveJSON\n | UpdateConfigMode.UpdateEntireReserveConfigJSON\n | UpdateConfigMode.UpdateDebtWithdrawalCapJSON\n | UpdateConfigMode.UpdateDepositWithdrawalCapJSON\n | UpdateConfigMode.UpdateDebtWithdrawalCapCurrentTotalJSON\n | UpdateConfigMode.UpdateDepositWithdrawalCapCurrentTotalJSON\n | UpdateConfigMode.UpdateBadDebtLiquidationBonusBpsJSON\n | UpdateConfigMode.UpdateMinLiquidationBonusBpsJSON\n | UpdateConfigMode.DeleveragingMarginCallPeriodJSON\n | UpdateConfigMode.UpdateBorrowFactorJSON\n | UpdateConfigMode.UpdateAssetTierJSON\n | UpdateConfigMode.UpdateElevationGroupJSON\n | UpdateConfigMode.DeleveragingThresholdSlotsPerBpsJSON\n | UpdateConfigMode.UpdateMultiplierSideBoostJSON\n | UpdateConfigMode.UpdateMultiplierTagBoostJSON\n | UpdateConfigMode.UpdateReserveStatusJSON\n | UpdateConfigMode.UpdateFarmCollateralJSON\n | UpdateConfigMode.UpdateFarmDebtJSON\n\nexport { UpdateLendingMarketConfigValue }\n\nexport type UpdateLendingMarketConfigValueKind =\n | UpdateLendingMarketConfigValue.Bool\n | UpdateLendingMarketConfigValue.U8\n | UpdateLendingMarketConfigValue.U8Array\n | UpdateLendingMarketConfigValue.U16\n | UpdateLendingMarketConfigValue.U64\n | UpdateLendingMarketConfigValue.Pubkey\n | UpdateLendingMarketConfigValue.ElevationGroup\nexport type UpdateLendingMarketConfigValueJSON =\n | UpdateLendingMarketConfigValue.BoolJSON\n | UpdateLendingMarketConfigValue.U8JSON\n | UpdateLendingMarketConfigValue.U8ArrayJSON\n | UpdateLendingMarketConfigValue.U16JSON\n | UpdateLendingMarketConfigValue.U64JSON\n | UpdateLendingMarketConfigValue.PubkeyJSON\n | UpdateLendingMarketConfigValue.ElevationGroupJSON\n\nexport { UpdateLendingMarketMode }\n\nexport type UpdateLendingMarketModeKind =\n | UpdateLendingMarketMode.UpdateOwner\n | UpdateLendingMarketMode.UpdateEmergencyMode\n | UpdateLendingMarketMode.UpdateLiquidationCloseFactor\n | UpdateLendingMarketMode.UpdateLiquidationMaxValue\n | UpdateLendingMarketMode.UpdateGlobalUnhealthyBorrow\n | UpdateLendingMarketMode.UpdateGlobalAllowedBorrow\n | UpdateLendingMarketMode.UpdateRiskCouncil\n | UpdateLendingMarketMode.UpdateMinFullLiquidationThreshold\n | UpdateLendingMarketMode.UpdateInsolvencyRiskLtv\n | UpdateLendingMarketMode.UpdateElevationGroup\n | UpdateLendingMarketMode.UpdateReferralFeeBps\n | UpdateLendingMarketMode.UpdateMultiplierPoints\n | UpdateLendingMarketMode.UpdatePriceRefreshTriggerToMaxAgePct\n | UpdateLendingMarketMode.UpdateAutodeleverageEnabled\n | UpdateLendingMarketMode.UpdateBorrowingDisabled\nexport type UpdateLendingMarketModeJSON =\n | UpdateLendingMarketMode.UpdateOwnerJSON\n | UpdateLendingMarketMode.UpdateEmergencyModeJSON\n | UpdateLendingMarketMode.UpdateLiquidationCloseFactorJSON\n | UpdateLendingMarketMode.UpdateLiquidationMaxValueJSON\n | UpdateLendingMarketMode.UpdateGlobalUnhealthyBorrowJSON\n | UpdateLendingMarketMode.UpdateGlobalAllowedBorrowJSON\n | UpdateLendingMarketMode.UpdateRiskCouncilJSON\n | UpdateLendingMarketMode.UpdateMinFullLiquidationThresholdJSON\n | UpdateLendingMarketMode.UpdateInsolvencyRiskLtvJSON\n | UpdateLendingMarketMode.UpdateElevationGroupJSON\n | UpdateLendingMarketMode.UpdateReferralFeeBpsJSON\n | UpdateLendingMarketMode.UpdateMultiplierPointsJSON\n | UpdateLendingMarketMode.UpdatePriceRefreshTriggerToMaxAgePctJSON\n | UpdateLendingMarketMode.UpdateAutodeleverageEnabledJSON\n | UpdateLendingMarketMode.UpdateBorrowingDisabledJSON\n\nexport { LastUpdate } from \"./LastUpdate\"\nexport type { LastUpdateFields, LastUpdateJSON } from \"./LastUpdate\"\nexport { ElevationGroup } from \"./ElevationGroup\"\nexport type { ElevationGroupFields, ElevationGroupJSON } from \"./ElevationGroup\"\nexport { InitObligationArgs } from \"./InitObligationArgs\"\nexport type {\n InitObligationArgsFields,\n InitObligationArgsJSON,\n} from \"./InitObligationArgs\"\nexport { ObligationCollateral } from \"./ObligationCollateral\"\nexport type {\n ObligationCollateralFields,\n ObligationCollateralJSON,\n} from \"./ObligationCollateral\"\nexport { ObligationLiquidity } from \"./ObligationLiquidity\"\nexport type {\n ObligationLiquidityFields,\n ObligationLiquidityJSON,\n} from \"./ObligationLiquidity\"\nexport { AssetTier }\n\nexport type AssetTierKind =\n | AssetTier.Regular\n | AssetTier.IsolatedCollateral\n | AssetTier.IsolatedDebt\nexport type AssetTierJSON =\n | AssetTier.RegularJSON\n | AssetTier.IsolatedCollateralJSON\n | AssetTier.IsolatedDebtJSON\n\nexport { BigFractionBytes } from \"./BigFractionBytes\"\nexport type {\n BigFractionBytesFields,\n BigFractionBytesJSON,\n} from \"./BigFractionBytes\"\nexport { FeeCalculation }\n\n/** Calculate fees exlusive or inclusive of an amount */\nexport type FeeCalculationKind =\n | FeeCalculation.Exclusive\n | FeeCalculation.Inclusive\nexport type FeeCalculationJSON =\n | FeeCalculation.ExclusiveJSON\n | FeeCalculation.InclusiveJSON\n\nexport { ReserveCollateral } from \"./ReserveCollateral\"\nexport type {\n ReserveCollateralFields,\n ReserveCollateralJSON,\n} from \"./ReserveCollateral\"\nexport { ReserveConfig } from \"./ReserveConfig\"\nexport type { ReserveConfigFields, ReserveConfigJSON } from \"./ReserveConfig\"\nexport { ReserveFarmKind }\n\nexport type ReserveFarmKindKind =\n | ReserveFarmKind.Collateral\n | ReserveFarmKind.Debt\nexport type ReserveFarmKindJSON =\n | ReserveFarmKind.CollateralJSON\n | ReserveFarmKind.DebtJSON\n\nexport { ReserveFees } from \"./ReserveFees\"\nexport type { ReserveFeesFields, ReserveFeesJSON } from \"./ReserveFees\"\nexport { ReserveLiquidity } from \"./ReserveLiquidity\"\nexport type {\n ReserveLiquidityFields,\n ReserveLiquidityJSON,\n} from \"./ReserveLiquidity\"\nexport { ReserveStatus }\n\nexport type ReserveStatusKind =\n | ReserveStatus.Active\n | ReserveStatus.Obsolete\n | ReserveStatus.Hidden\nexport type ReserveStatusJSON =\n | ReserveStatus.ActiveJSON\n | ReserveStatus.ObsoleteJSON\n | ReserveStatus.HiddenJSON\n\nexport { WithdrawalCaps } from \"./WithdrawalCaps\"\nexport type { WithdrawalCapsFields, WithdrawalCapsJSON } from \"./WithdrawalCaps\"\nexport { PriceHeuristic } from \"./PriceHeuristic\"\nexport type { PriceHeuristicFields, PriceHeuristicJSON } from \"./PriceHeuristic\"\nexport { PythConfiguration } from \"./PythConfiguration\"\nexport type {\n PythConfigurationFields,\n PythConfigurationJSON,\n} from \"./PythConfiguration\"\nexport { ScopeConfiguration } from \"./ScopeConfiguration\"\nexport type {\n ScopeConfigurationFields,\n ScopeConfigurationJSON,\n} from \"./ScopeConfiguration\"\nexport { SwitchboardConfiguration } from \"./SwitchboardConfiguration\"\nexport type {\n SwitchboardConfigurationFields,\n SwitchboardConfigurationJSON,\n} from \"./SwitchboardConfiguration\"\nexport { TokenInfo } from \"./TokenInfo\"\nexport type { TokenInfoFields, TokenInfoJSON } from \"./TokenInfo\"\nexport { BorrowRateCurve } from \"./BorrowRateCurve\"\nexport type {\n BorrowRateCurveFields,\n BorrowRateCurveJSON,\n} from \"./BorrowRateCurve\"\nexport { CurvePoint } from \"./CurvePoint\"\nexport type { CurvePointFields, CurvePointJSON } from \"./CurvePoint\"\n"]}
@@ -0,0 +1,53 @@
1
+ /// <reference types="node" />
2
+ import { PublicKey, Connection } from "@solana/web3.js";
3
+ import BN from "bn.js";
4
+ import * as types from "../types";
5
+ import { Obligation, ObligationFields } from '../accounts';
6
+ /** Lending market obligation state */
7
+ export declare class ObligationZP {
8
+ /** Version of the struct */
9
+ readonly tag: BN;
10
+ /** Last update to collateral, liquidity, or their market values */
11
+ readonly lastUpdate: types.LastUpdate;
12
+ /** Lending market address */
13
+ readonly lendingMarket: PublicKey;
14
+ /** Owner authority which can borrow liquidity */
15
+ readonly owner: PublicKey;
16
+ /**
17
+ * TODO: Does this break the stack size when copied onto the stack, if too big?
18
+ * Deposited collateral for the obligation, unique by deposit reserve address
19
+ */
20
+ readonly deposits: Array<types.ObligationCollateral>;
21
+ /** Worst LTV for the collaterals backing the loan, represented as a percentage */
22
+ readonly lowestReserveDepositLtv: BN;
23
+ /** Market value of deposits (scaled fraction) */
24
+ readonly depositedValueSf: BN;
25
+ /** Borrowed liquidity for the obligation, unique by borrow reserve address */
26
+ readonly borrows: Array<types.ObligationLiquidity>;
27
+ /** Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction) */
28
+ readonly borrowFactorAdjustedDebtValueSf: BN;
29
+ /** Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction) */
30
+ readonly borrowedAssetsMarketValueSf: BN;
31
+ /** The maximum borrow value at the weighted average loan to value ratio (scaled fraction) */
32
+ readonly allowedBorrowValueSf: BN;
33
+ /** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
34
+ readonly unhealthyBorrowValueSf: BN;
35
+ /** The asset tier of the deposits */
36
+ readonly depositsAssetTiers: Array<number>;
37
+ /** The asset tier of the borrows */
38
+ readonly borrowsAssetTiers: Array<number>;
39
+ /** The elevation group id the obligation opted into. */
40
+ readonly elevationGroup: number;
41
+ /** The number of deprecated reserves the obligation has a deposit */
42
+ readonly numOfObsoleteReserves: number;
43
+ /** Marked = 1 if borrows array is not empty, 0 = borrows empty */
44
+ readonly hasDebt: number;
45
+ /** Wallet address of the referrer */
46
+ readonly referrer: PublicKey;
47
+ readonly padding3: Array<BN>;
48
+ static readonly layout: any;
49
+ constructor(fields: ObligationFields);
50
+ static fetch(c: Connection, address: PublicKey, programId?: PublicKey): Promise<Obligation | null>;
51
+ static fetchMultiple(c: Connection, addresses: PublicKey[], programId?: PublicKey): Promise<Array<Obligation | null>>;
52
+ static decode(data: Buffer): Obligation;
53
+ }
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.ObligationZP = void 0;
36
+ const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
37
+ const types = __importStar(require("../types")); // eslint-disable-line @typescript-eslint/no-unused-vars
38
+ const programId_1 = require("../programId");
39
+ const accounts_1 = require("../accounts");
40
+ /** Lending market obligation state */
41
+ class ObligationZP {
42
+ constructor(fields) {
43
+ this.padding3 = new Array(0);
44
+ this.tag = fields.tag;
45
+ this.lastUpdate = new types.LastUpdate(Object.assign({}, fields.lastUpdate));
46
+ this.lendingMarket = fields.lendingMarket;
47
+ this.owner = fields.owner;
48
+ this.deposits = fields.deposits.map((item) => new types.ObligationCollateral(Object.assign({}, item)));
49
+ this.lowestReserveDepositLtv = fields.lowestReserveDepositLtv;
50
+ this.depositedValueSf = fields.depositedValueSf;
51
+ this.borrows = fields.borrows.map((item) => new types.ObligationLiquidity(Object.assign({}, item)));
52
+ this.borrowFactorAdjustedDebtValueSf =
53
+ fields.borrowFactorAdjustedDebtValueSf;
54
+ this.borrowedAssetsMarketValueSf = fields.borrowedAssetsMarketValueSf;
55
+ this.allowedBorrowValueSf = fields.allowedBorrowValueSf;
56
+ this.unhealthyBorrowValueSf = fields.unhealthyBorrowValueSf;
57
+ this.depositsAssetTiers = fields.depositsAssetTiers;
58
+ this.borrowsAssetTiers = fields.borrowsAssetTiers;
59
+ this.elevationGroup = fields.elevationGroup;
60
+ this.numOfObsoleteReserves = fields.numOfObsoleteReserves;
61
+ this.hasDebt = fields.hasDebt;
62
+ this.referrer = fields.referrer;
63
+ this.padding3 = new Array(0);
64
+ }
65
+ static fetch(c, address, programId = programId_1.PROGRAM_ID) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ const info = yield c.getAccountInfo(address);
68
+ if (info === null) {
69
+ return null;
70
+ }
71
+ if (!info.owner.equals(programId)) {
72
+ throw new Error("account doesn't belong to this program");
73
+ }
74
+ return this.decode(info.data);
75
+ });
76
+ }
77
+ static fetchMultiple(c, addresses, programId = programId_1.PROGRAM_ID) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ const infos = yield c.getMultipleAccountsInfo(addresses);
80
+ return infos.map((info) => {
81
+ if (info === null) {
82
+ return null;
83
+ }
84
+ if (!info.owner.equals(programId)) {
85
+ throw new Error("account doesn't belong to this program");
86
+ }
87
+ return this.decode(info.data);
88
+ });
89
+ });
90
+ }
91
+ static decode(data) {
92
+ if (!data.slice(0, 8).equals(accounts_1.Obligation.discriminator)) {
93
+ throw new Error("invalid account discriminator");
94
+ }
95
+ const dec = ObligationZP.layout.decode(data.slice(8));
96
+ return new accounts_1.Obligation({
97
+ tag: dec.tag,
98
+ lastUpdate: types.LastUpdate.fromDecoded(dec.lastUpdate),
99
+ lendingMarket: dec.lendingMarket,
100
+ owner: dec.owner,
101
+ deposits: dec.deposits.map((item /* eslint-disable-line @typescript-eslint/no-explicit-any */) => types.ObligationCollateral.fromDecoded(item)),
102
+ lowestReserveDepositLtv: dec.lowestReserveDepositLtv,
103
+ depositedValueSf: dec.depositedValueSf,
104
+ borrows: dec.borrows.map((item /* eslint-disable-line @typescript-eslint/no-explicit-any */) => types.ObligationLiquidity.fromDecoded(item)),
105
+ borrowFactorAdjustedDebtValueSf: dec.borrowFactorAdjustedDebtValueSf,
106
+ borrowedAssetsMarketValueSf: dec.borrowedAssetsMarketValueSf,
107
+ allowedBorrowValueSf: dec.allowedBorrowValueSf,
108
+ unhealthyBorrowValueSf: dec.unhealthyBorrowValueSf,
109
+ depositsAssetTiers: dec.depositsAssetTiers,
110
+ borrowsAssetTiers: dec.borrowsAssetTiers,
111
+ elevationGroup: dec.elevationGroup,
112
+ numOfObsoleteReserves: dec.numOfObsoleteReserves,
113
+ hasDebt: dec.hasDebt,
114
+ referrer: dec.referrer,
115
+ padding3: [],
116
+ });
117
+ }
118
+ }
119
+ exports.ObligationZP = ObligationZP;
120
+ ObligationZP.layout = borsh.struct([
121
+ borsh.u64("tag"),
122
+ types.LastUpdate.layout("lastUpdate"),
123
+ borsh.publicKey("lendingMarket"),
124
+ borsh.publicKey("owner"),
125
+ borsh.array(types.ObligationCollateral.layout(), 8, "deposits"),
126
+ borsh.u64("lowestReserveDepositLtv"),
127
+ borsh.u128("depositedValueSf"),
128
+ borsh.array(types.ObligationLiquidity.layout(), 5, "borrows"),
129
+ borsh.u128("borrowFactorAdjustedDebtValueSf"),
130
+ borsh.u128("borrowedAssetsMarketValueSf"),
131
+ borsh.u128("allowedBorrowValueSf"),
132
+ borsh.u128("unhealthyBorrowValueSf"),
133
+ borsh.array(borsh.u8(), 8, "depositsAssetTiers"),
134
+ borsh.array(borsh.u8(), 5, "borrowsAssetTiers"),
135
+ borsh.u8("elevationGroup"),
136
+ borsh.u8("numOfObsoleteReserves"),
137
+ borsh.u8("hasDebt"),
138
+ borsh.publicKey("referrer"),
139
+ ]);
140
+ //# sourceMappingURL=ObligationZP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObligationZP.js","sourceRoot":"","sources":["../../../src/idl_codegen/zero_padding/ObligationZP.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAAyC,CAAC,wDAAwD;AAClG,gDAAiC,CAAC,wDAAwD;AAC1F,4CAAyC;AACzC,0CAA2D;AAE3D,sCAAsC;AACtC,MAAa,YAAY;IA+DvB,YAAY,MAAwB;QAvB3B,aAAQ,GAAc,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAwB1C,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,CAAC,UAAU,mBAAM,MAAM,CAAC,UAAU,EAAG,CAAA;QAChE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QACzC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;QACzB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CACjC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,oBAAoB,mBAAM,IAAI,EAAG,CACtD,CAAA;QACD,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAA;QAC7D,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAA;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAC/B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,mBAAmB,mBAAM,IAAI,EAAG,CACrD,CAAA;QACD,IAAI,CAAC,+BAA+B;YAClC,MAAM,CAAC,+BAA+B,CAAA;QACxC,IAAI,CAAC,2BAA2B,GAAG,MAAM,CAAC,2BAA2B,CAAA;QACrE,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAA;QACvD,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,sBAAsB,CAAA;QAC3D,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAA;QACnD,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAA;QACzD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAK,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAO,KAAK,CAChB,CAAa,EACb,OAAkB,EAClB,YAAuB,sBAAU;;YAEjC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;YAE5C,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,OAAO,IAAI,CAAA;aACZ;YACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;gBACjC,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;aAC1D;YAED,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC/B,CAAC;KAAA;IAED,MAAM,CAAO,aAAa,CACxB,CAAa,EACb,SAAsB,EACtB,YAAuB,sBAAU;;YAEjC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAA;YAExD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACxB,IAAI,IAAI,KAAK,IAAI,EAAE;oBACjB,OAAO,IAAI,CAAA;iBACZ;gBACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;oBACjC,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;iBAC1D;gBAED,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC/B,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;IAED,MAAM,CAAC,MAAM,CAAC,IAAY;QACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,qBAAU,CAAC,aAAa,CAAC,EAAE;YACtD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;SACjD;QAED,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAErD,OAAO,IAAI,qBAAU,CAAC;YACpB,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC;YACxD,aAAa,EAAE,GAAG,CAAC,aAAa;YAChC,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CACxB,CACE,IAAS,CAAC,4DAA4D,EACtE,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,CAClD;YACD,uBAAuB,EAAE,GAAG,CAAC,uBAAuB;YACpD,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACtC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CACtB,CACE,IAAS,CAAC,4DAA4D,EACtE,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,CACjD;YACD,+BAA+B,EAAE,GAAG,CAAC,+BAA+B;YACpE,2BAA2B,EAAE,GAAG,CAAC,2BAA2B;YAC5D,oBAAoB,EAAE,GAAG,CAAC,oBAAoB;YAC9C,sBAAsB,EAAE,GAAG,CAAC,sBAAsB;YAClD,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;YAC1C,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;YACxC,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,qBAAqB,EAAE,GAAG,CAAC,qBAAqB;YAChD,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;IACJ,CAAC;;AAlKH,oCAmKC;AAzHiB,mBAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACpC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IAChB,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC;IACrC,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;IAChC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;IACxB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,CAAC;IAC/D,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC;IAC9B,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC;IAC7D,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC;IAC7C,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC;IACzC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC;IACpC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,oBAAoB,CAAC;IAChD,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,mBAAmB,CAAC;IAC/C,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC;IACjC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC;IACnB,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;CAC5B,CAAC,CAAA","sourcesContent":["import { PublicKey, Connection } from \"@solana/web3.js\"\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\nimport { Obligation, ObligationFields } from '../accounts';\n\n/** Lending market obligation state */\nexport class ObligationZP {\n /** Version of the struct */\n readonly tag: BN\n /** Last update to collateral, liquidity, or their market values */\n readonly lastUpdate: types.LastUpdate\n /** Lending market address */\n readonly lendingMarket: PublicKey\n /** Owner authority which can borrow liquidity */\n readonly owner: PublicKey\n /**\n * TODO: Does this break the stack size when copied onto the stack, if too big?\n * Deposited collateral for the obligation, unique by deposit reserve address\n */\n readonly deposits: Array<types.ObligationCollateral>\n /** Worst LTV for the collaterals backing the loan, represented as a percentage */\n readonly lowestReserveDepositLtv: BN\n /** Market value of deposits (scaled fraction) */\n readonly depositedValueSf: BN\n /** Borrowed liquidity for the obligation, unique by borrow reserve address */\n readonly borrows: Array<types.ObligationLiquidity>\n /** Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction) */\n readonly borrowFactorAdjustedDebtValueSf: BN\n /** Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction) */\n readonly borrowedAssetsMarketValueSf: BN\n /** The maximum borrow value at the weighted average loan to value ratio (scaled fraction) */\n readonly allowedBorrowValueSf: BN\n /** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */\n readonly unhealthyBorrowValueSf: BN\n /** The asset tier of the deposits */\n readonly depositsAssetTiers: Array<number>\n /** The asset tier of the borrows */\n readonly borrowsAssetTiers: Array<number>\n /** The elevation group id the obligation opted into. */\n readonly elevationGroup: number\n /** The number of deprecated reserves the obligation has a deposit */\n readonly numOfObsoleteReserves: number\n /** Marked = 1 if borrows array is not empty, 0 = borrows empty */\n readonly hasDebt: number\n /** Wallet address of the referrer */\n readonly referrer: PublicKey\n readonly padding3: Array<BN> = new Array(0);\n\n static readonly layout = borsh.struct([\n borsh.u64(\"tag\"),\n types.LastUpdate.layout(\"lastUpdate\"),\n borsh.publicKey(\"lendingMarket\"),\n borsh.publicKey(\"owner\"),\n borsh.array(types.ObligationCollateral.layout(), 8, \"deposits\"),\n borsh.u64(\"lowestReserveDepositLtv\"),\n borsh.u128(\"depositedValueSf\"),\n borsh.array(types.ObligationLiquidity.layout(), 5, \"borrows\"),\n borsh.u128(\"borrowFactorAdjustedDebtValueSf\"),\n borsh.u128(\"borrowedAssetsMarketValueSf\"),\n borsh.u128(\"allowedBorrowValueSf\"),\n borsh.u128(\"unhealthyBorrowValueSf\"),\n borsh.array(borsh.u8(), 8, \"depositsAssetTiers\"),\n borsh.array(borsh.u8(), 5, \"borrowsAssetTiers\"),\n borsh.u8(\"elevationGroup\"),\n borsh.u8(\"numOfObsoleteReserves\"),\n borsh.u8(\"hasDebt\"),\n borsh.publicKey(\"referrer\"),\n ])\n\n constructor(fields: ObligationFields) {\n this.tag = fields.tag\n this.lastUpdate = new types.LastUpdate({ ...fields.lastUpdate })\n this.lendingMarket = fields.lendingMarket\n this.owner = fields.owner\n this.deposits = fields.deposits.map(\n (item) => new types.ObligationCollateral({ ...item })\n )\n this.lowestReserveDepositLtv = fields.lowestReserveDepositLtv\n this.depositedValueSf = fields.depositedValueSf\n this.borrows = fields.borrows.map(\n (item) => new types.ObligationLiquidity({ ...item })\n )\n this.borrowFactorAdjustedDebtValueSf =\n fields.borrowFactorAdjustedDebtValueSf\n this.borrowedAssetsMarketValueSf = fields.borrowedAssetsMarketValueSf\n this.allowedBorrowValueSf = fields.allowedBorrowValueSf\n this.unhealthyBorrowValueSf = fields.unhealthyBorrowValueSf\n this.depositsAssetTiers = fields.depositsAssetTiers\n this.borrowsAssetTiers = fields.borrowsAssetTiers\n this.elevationGroup = fields.elevationGroup\n this.numOfObsoleteReserves = fields.numOfObsoleteReserves\n this.hasDebt = fields.hasDebt\n this.referrer = fields.referrer\n this.padding3 = new Array<BN>(0);\n }\n\n static async fetch(\n c: Connection,\n address: PublicKey,\n programId: PublicKey = PROGRAM_ID\n ): Promise<Obligation | null> {\n const info = await c.getAccountInfo(address)\n\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n }\n\n static async fetchMultiple(\n c: Connection,\n addresses: PublicKey[],\n programId: PublicKey = PROGRAM_ID\n ): Promise<Array<Obligation | null>> {\n const infos = await c.getMultipleAccountsInfo(addresses)\n\n return infos.map((info) => {\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n })\n }\n\n static decode(data: Buffer): Obligation {\n if (!data.slice(0, 8).equals(Obligation.discriminator)) {\n throw new Error(\"invalid account discriminator\")\n }\n\n const dec = ObligationZP.layout.decode(data.slice(8))\n\n return new Obligation({\n tag: dec.tag,\n lastUpdate: types.LastUpdate.fromDecoded(dec.lastUpdate),\n lendingMarket: dec.lendingMarket,\n owner: dec.owner,\n deposits: dec.deposits.map(\n (\n item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */\n ) => types.ObligationCollateral.fromDecoded(item)\n ),\n lowestReserveDepositLtv: dec.lowestReserveDepositLtv,\n depositedValueSf: dec.depositedValueSf,\n borrows: dec.borrows.map(\n (\n item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */\n ) => types.ObligationLiquidity.fromDecoded(item)\n ),\n borrowFactorAdjustedDebtValueSf: dec.borrowFactorAdjustedDebtValueSf,\n borrowedAssetsMarketValueSf: dec.borrowedAssetsMarketValueSf,\n allowedBorrowValueSf: dec.allowedBorrowValueSf,\n unhealthyBorrowValueSf: dec.unhealthyBorrowValueSf,\n depositsAssetTiers: dec.depositsAssetTiers,\n borrowsAssetTiers: dec.borrowsAssetTiers,\n elevationGroup: dec.elevationGroup,\n numOfObsoleteReserves: dec.numOfObsoleteReserves,\n hasDebt: dec.hasDebt,\n referrer: dec.referrer,\n padding3: [],\n })\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export { ObligationZP } from "./ObligationZP";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObligationZP = void 0;
4
+ var ObligationZP_1 = require("./ObligationZP");
5
+ Object.defineProperty(exports, "ObligationZP", { enumerable: true, get: function () { return ObligationZP_1.ObligationZP; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/idl_codegen/zero_padding/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,4GAAA,YAAY,OAAA","sourcesContent":["export { ObligationZP } from \"./ObligationZP\"\n"]}
@@ -0,0 +1,48 @@
1
+ /// <reference types="node" />
2
+ import { PublicKey, Connection } from '@solana/web3.js';
3
+ import BN from 'bn.js';
4
+ import * as types from '../types';
5
+ export interface PoolFields {
6
+ name: string;
7
+ custodies: Array<PublicKey>;
8
+ aumUsd: BN;
9
+ limit: types.LimitFields;
10
+ fees: types.FeesFields;
11
+ poolApr: types.PoolAprFields;
12
+ maxRequestExecutionSec: BN;
13
+ bump: number;
14
+ lpTokenBump: number;
15
+ inceptionTime: BN;
16
+ }
17
+ export interface PoolJSON {
18
+ name: string;
19
+ custodies: Array<string>;
20
+ aumUsd: string;
21
+ limit: types.LimitJSON;
22
+ fees: types.FeesJSON;
23
+ poolApr: types.PoolAprJSON;
24
+ maxRequestExecutionSec: string;
25
+ bump: number;
26
+ lpTokenBump: number;
27
+ inceptionTime: string;
28
+ }
29
+ export declare class Pool {
30
+ readonly name: string;
31
+ readonly custodies: Array<PublicKey>;
32
+ readonly aumUsd: BN;
33
+ readonly limit: types.Limit;
34
+ readonly fees: types.Fees;
35
+ readonly poolApr: types.PoolApr;
36
+ readonly maxRequestExecutionSec: BN;
37
+ readonly bump: number;
38
+ readonly lpTokenBump: number;
39
+ readonly inceptionTime: BN;
40
+ static readonly discriminator: Buffer;
41
+ static readonly layout: any;
42
+ constructor(fields: PoolFields);
43
+ static fetch(c: Connection, address: PublicKey, programId?: PublicKey): Promise<Pool | null>;
44
+ static fetchMultiple(c: Connection, addresses: PublicKey[], programId?: PublicKey): Promise<Array<Pool | null>>;
45
+ static decode(data: Buffer): Pool;
46
+ toJSON(): PoolJSON;
47
+ static fromJSON(obj: PoolJSON): Pool;
48
+ }