@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 @@
1
+ {"version":3,"file":"LastUpdate.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/LastUpdate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;AAsBzC,wBAAwB;AACxB,MAAa,UAAU;IASrB,YAAY,MAAwB;QAClC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;QACzB,IAAI,CAAC,WAAW,GAAG,MA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AK,EAAE,GAAG,CAAC,KAAK;YAChB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;SAC7B,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;CACF;AApED,gCAoEC","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 LastUpdateFields {\n /** Last slot when updated */\n slot: BN\n /** True when marked stale, false when slot updated */\n stale: number\n /** Status of the prices used to calculate the last update */\n priceStatus: number\n placeholder: Array<number>\n}\n\nexport interface LastUpdateJSON {\n /** Last slot when updated */\n slot: string\n /** True when marked stale, false when slot updated */\n stale: number\n /** Status of the prices used to calculate the last update */\n priceStatus: number\n placeholder: Array<number>\n}\n\n/** Last update state */\nexport class LastUpdate {\n /** Last slot when updated */\n readonly slot: BN\n /** True when marked stale, false when slot updated */\n readonly stale: number\n /** Status of the prices used to calculate the last update */\n readonly priceStatus: number\n readonly placeholder: Array<number>\n\n constructor(fields: LastUpdateFields) {\n this.slot = fields.slot\n this.stale = fields.stale\n this.priceStatus = fields.priceStatus\n this.placeholder = fields.placeholder\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.u64(\"slot\"),\n borsh.u8(\"stale\"),\n borsh.u8(\"priceStatus\"),\n borsh.array(borsh.u8(), 6, \"placeholder\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new LastUpdate({\n slot: obj.slot,\n stale: obj.stale,\n priceStatus: obj.priceStatus,\n placeholder: obj.placeholder,\n })\n }\n\n static toEncodable(fields: LastUpdateFields) {\n return {\n slot: fields.slot,\n stale: fields.stale,\n priceStatus: fields.priceStatus,\n placeholder: fields.placeholder,\n }\n }\n\n toJSON(): LastUpdateJSON {\n return {\n slot: this.slot.toString(),\n stale: this.stale,\n priceStatus: this.priceStatus,\n placeholder: this.placeholder,\n }\n }\n\n static fromJSON(obj: LastUpdateJSON): LastUpdate {\n return new LastUpdate({\n slot: new BN(obj.slot),\n stale: obj.stale,\n priceStatus: obj.priceStatus,\n placeholder: obj.placeholder,\n })\n }\n\n toEncodable() {\n return LastUpdate.toEncodable(this)\n }\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import BN from "bn.js";
3
+ import * as types from "../types";
4
+ export interface ObligationCollateralFields {
5
+ /** Reserve collateral is deposited to */
6
+ depositReserve: PublicKey;
7
+ /** Amount of collateral deposited */
8
+ depositedAmount: BN;
9
+ /** Collateral market value in quote currency (scaled fraction) */
10
+ marketValueSf: BN;
11
+ padding: Array<BN>;
12
+ }
13
+ export interface ObligationCollateralJSON {
14
+ /** Reserve collateral is deposited to */
15
+ depositReserve: string;
16
+ /** Amount of collateral deposited */
17
+ depositedAmount: string;
18
+ /** Collateral market value in quote currency (scaled fraction) */
19
+ marketValueSf: string;
20
+ padding: Array<string>;
21
+ }
22
+ /** Obligation collateral state */
23
+ export declare class ObligationCollateral {
24
+ /** Reserve collateral is deposited to */
25
+ readonly depositReserve: PublicKey;
26
+ /** Amount of collateral deposited */
27
+ readonly depositedAmount: BN;
28
+ /** Collateral market value in quote currency (scaled fraction) */
29
+ readonly marketValueSf: BN;
30
+ readonly padding: Array<BN>;
31
+ constructor(fields: ObligationCollateralFields);
32
+ static layout(property?: string): any;
33
+ static fromDecoded(obj: any): types.ObligationCollateral;
34
+ static toEncodable(fields: ObligationCollateralFields): {
35
+ depositReserve: PublicKey;
36
+ depositedAmount: BN;
37
+ marketValueSf: BN;
38
+ padding: BN[];
39
+ };
40
+ toJSON(): ObligationCollateralJSON;
41
+ static fromJSON(obj: ObligationCollateralJSON): ObligationCollateral;
42
+ toEncodable(): {
43
+ depositReserve: PublicKey;
44
+ depositedAmount: BN;
45
+ marketValueSf: BN;
46
+ padding: BN[];
47
+ };
48
+ }
@@ -0,0 +1,87 @@
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.ObligationCollateral = void 0;
30
+ const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
31
+ const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
32
+ const borsh = __importStar(require("@coral-xyz/borsh"));
33
+ /** Obligation collateral state */
34
+ class ObligationCollateral {
35
+ constructor(fields) {
36
+ this.depositReserve = fields.depositReserve;
37
+ this.depositedAmount = fields.depositedAmount;
38
+ this.marketValueSf = fields.marketValueSf;
39
+ this.padding = fields.padding;
40
+ }
41
+ static layout(property) {
42
+ return borsh.struct([
43
+ borsh.publicKey("depositReserve"),
44
+ borsh.u64("depositedAmount"),
45
+ borsh.u128("marketValueSf"),
46
+ borsh.array(borsh.u64(), 10, "padding"),
47
+ ], property);
48
+ }
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ static fromDecoded(obj) {
51
+ return new ObligationCollateral({
52
+ depositReserve: obj.depositReserve,
53
+ depositedAmount: obj.depositedAmount,
54
+ marketValueSf: obj.marketValueSf,
55
+ padding: obj.padding,
56
+ });
57
+ }
58
+ static toEncodable(fields) {
59
+ return {
60
+ depositReserve: fields.depositReserve,
61
+ depositedAmount: fields.depositedAmount,
62
+ marketValueSf: fields.marketValueSf,
63
+ padding: fields.padding,
64
+ };
65
+ }
66
+ toJSON() {
67
+ return {
68
+ depositReserve: this.depositReserve.toString(),
69
+ depositedAmount: this.depositedAmount.toString(),
70
+ marketValueSf: this.marketValueSf.toString(),
71
+ padding: this.padding.map((item) => item.toString()),
72
+ };
73
+ }
74
+ static fromJSON(obj) {
75
+ return new ObligationCollateral({
76
+ depositReserve: new web3_js_1.PublicKey(obj.depositReserve),
77
+ depositedAmount: new bn_js_1.default(obj.depositedAmount),
78
+ marketValueSf: new bn_js_1.default(obj.marketValueSf),
79
+ padding: obj.padding.map((item) => new bn_js_1.default(item)),
80
+ });
81
+ }
82
+ toEncodable() {
83
+ return ObligationCollateral.toEncodable(this);
84
+ }
85
+ }
86
+ exports.ObligationCollateral = ObligationCollateral;
87
+ //# sourceMappingURL=ObligationCollateral.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObligationCollateral.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ObligationCollateral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AACpG,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;AAsBzC,kCAAkC;AAClC,MAAa,oBAAo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AC,QAAQ,EAAE;YAC5C,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;SACrD,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAA6B;QAC3C,OAAO,IAAI,oBAAoB,CAAC;YAC9B,cAAc,EAAE,IAAI,mBAAS,CAAC,GAAG,CAAC,cAAc,CAAC;YACjD,eAAe,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,eAAe,CAAC;YAC5C,aAAa,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,aAAa,CAAC;YACxC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACjD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;CACF;AApED,oDAoEC","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 ObligationCollateralFields {\n /** Reserve collateral is deposited to */\n depositReserve: PublicKey\n /** Amount of collateral deposited */\n depositedAmount: BN\n /** Collateral market value in quote currency (scaled fraction) */\n marketValueSf: BN\n padding: Array<BN>\n}\n\nexport interface ObligationCollateralJSON {\n /** Reserve collateral is deposited to */\n depositReserve: string\n /** Amount of collateral deposited */\n depositedAmount: string\n /** Collateral market value in quote currency (scaled fraction) */\n marketValueSf: string\n padding: Array<string>\n}\n\n/** Obligation collateral state */\nexport class ObligationCollateral {\n /** Reserve collateral is deposited to */\n readonly depositReserve: PublicKey\n /** Amount of collateral deposited */\n readonly depositedAmount: BN\n /** Collateral market value in quote currency (scaled fraction) */\n readonly marketValueSf: BN\n readonly padding: Array<BN>\n\n constructor(fields: ObligationCollateralFields) {\n this.depositReserve = fields.depositReserve\n this.depositedAmount = fields.depositedAmount\n this.marketValueSf = fields.marketValueSf\n this.padding = fields.padding\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.publicKey(\"depositReserve\"),\n borsh.u64(\"depositedAmount\"),\n borsh.u128(\"marketValueSf\"),\n borsh.array(borsh.u64(), 10, \"padding\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ObligationCollateral({\n depositReserve: obj.depositReserve,\n depositedAmount: obj.depositedAmount,\n marketValueSf: obj.marketValueSf,\n padding: obj.padding,\n })\n }\n\n static toEncodable(fields: ObligationCollateralFields) {\n return {\n depositReserve: fields.depositReserve,\n depositedAmount: fields.depositedAmount,\n marketValueSf: fields.marketValueSf,\n padding: fields.padding,\n }\n }\n\n toJSON(): ObligationCollateralJSON {\n return {\n depositReserve: this.depositReserve.toString(),\n depositedAmount: this.depositedAmount.toString(),\n marketValueSf: this.marketValueSf.toString(),\n padding: this.padding.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: ObligationCollateralJSON): ObligationCollateral {\n return new ObligationCollateral({\n depositReserve: new PublicKey(obj.depositReserve),\n depositedAmount: new BN(obj.depositedAmount),\n marketValueSf: new BN(obj.marketValueSf),\n padding: obj.padding.map((item) => new BN(item)),\n })\n }\n\n toEncodable() {\n return ObligationCollateral.toEncodable(this)\n }\n}\n"]}
@@ -0,0 +1,75 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import BN from "bn.js";
3
+ import * as types from "../types";
4
+ export interface ObligationLiquidityFields {
5
+ /** Reserve liquidity is borrowed from */
6
+ borrowReserve: PublicKey;
7
+ /** Borrow rate used for calculating interest (big scaled fraction) */
8
+ cumulativeBorrowRateBsf: types.BigFractionBytesFields;
9
+ padding: BN;
10
+ /** Amount of liquidity borrowed plus interest (scaled fraction) */
11
+ borrowedAmountSf: BN;
12
+ /** Liquidity market value in quote currency (scaled fraction) */
13
+ marketValueSf: BN;
14
+ /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
15
+ borrowFactorAdjustedMarketValueSf: BN;
16
+ padding2: Array<BN>;
17
+ }
18
+ export interface ObligationLiquidityJSON {
19
+ /** Reserve liquidity is borrowed from */
20
+ borrowReserve: string;
21
+ /** Borrow rate used for calculating interest (big scaled fraction) */
22
+ cumulativeBorrowRateBsf: types.BigFractionBytesJSON;
23
+ padding: string;
24
+ /** Amount of liquidity borrowed plus interest (scaled fraction) */
25
+ borrowedAmountSf: string;
26
+ /** Liquidity market value in quote currency (scaled fraction) */
27
+ marketValueSf: string;
28
+ /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
29
+ borrowFactorAdjustedMarketValueSf: string;
30
+ padding2: Array<string>;
31
+ }
32
+ /** Obligation liquidity state */
33
+ export declare class ObligationLiquidity {
34
+ /** Reserve liquidity is borrowed from */
35
+ readonly borrowReserve: PublicKey;
36
+ /** Borrow rate used for calculating interest (big scaled fraction) */
37
+ readonly cumulativeBorrowRateBsf: types.BigFractionBytes;
38
+ readonly padding: BN;
39
+ /** Amount of liquidity borrowed plus interest (scaled fraction) */
40
+ readonly borrowedAmountSf: BN;
41
+ /** Liquidity market value in quote currency (scaled fraction) */
42
+ readonly marketValueSf: BN;
43
+ /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
44
+ readonly borrowFactorAdjustedMarketValueSf: BN;
45
+ readonly padding2: Array<BN>;
46
+ constructor(fields: ObligationLiquidityFields);
47
+ static layout(property?: string): any;
48
+ static fromDecoded(obj: any): types.ObligationLiquidity;
49
+ static toEncodable(fields: ObligationLiquidityFields): {
50
+ borrowReserve: PublicKey;
51
+ cumulativeBorrowRateBsf: {
52
+ value: BN[];
53
+ padding: BN[];
54
+ };
55
+ padding: BN;
56
+ borrowedAmountSf: BN;
57
+ marketValueSf: BN;
58
+ borrowFactorAdjustedMarketValueSf: BN;
59
+ padding2: BN[];
60
+ };
61
+ toJSON(): ObligationLiquidityJSON;
62
+ static fromJSON(obj: ObligationLiquidityJSON): ObligationLiquidity;
63
+ toEncodable(): {
64
+ borrowReserve: PublicKey;
65
+ cumulativeBorrowRateBsf: {
66
+ value: BN[];
67
+ padding: BN[];
68
+ };
69
+ padding: BN;
70
+ borrowedAmountSf: BN;
71
+ marketValueSf: BN;
72
+ borrowFactorAdjustedMarketValueSf: BN;
73
+ padding2: BN[];
74
+ };
75
+ }
@@ -0,0 +1,107 @@
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.ObligationLiquidity = void 0;
30
+ const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
31
+ const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
32
+ const types = __importStar(require("../types")); // eslint-disable-line @typescript-eslint/no-unused-vars
33
+ const borsh = __importStar(require("@coral-xyz/borsh"));
34
+ /** Obligation liquidity state */
35
+ class ObligationLiquidity {
36
+ constructor(fields) {
37
+ this.borrowReserve = fields.borrowReserve;
38
+ this.cumulativeBorrowRateBsf = new types.BigFractionBytes(Object.assign({}, fields.cumulativeBorrowRateBsf));
39
+ this.padding = fields.padding;
40
+ this.borrowedAmountSf = fields.borrowedAmountSf;
41
+ this.marketValueSf = fields.marketValueSf;
42
+ this.borrowFactorAdjustedMarketValueSf =
43
+ fields.borrowFactorAdjustedMarketValueSf;
44
+ this.padding2 = fields.padding2;
45
+ }
46
+ static layout(property) {
47
+ return borsh.struct([
48
+ borsh.publicKey("borrowReserve"),
49
+ types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
50
+ borsh.u64("padding"),
51
+ borsh.u128("borrowedAmountSf"),
52
+ borsh.u128("marketValueSf"),
53
+ borsh.u128("borrowFactorAdjustedMarketValueSf"),
54
+ borsh.array(borsh.u64(), 8, "padding2"),
55
+ ], property);
56
+ }
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
+ static fromDecoded(obj) {
59
+ return new ObligationLiquidity({
60
+ borrowReserve: obj.borrowReserve,
61
+ cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(obj.cumulativeBorrowRateBsf),
62
+ padding: obj.padding,
63
+ borrowedAmountSf: obj.borrowedAmountSf,
64
+ marketValueSf: obj.marketValueSf,
65
+ borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,
66
+ padding2: obj.padding2,
67
+ });
68
+ }
69
+ static toEncodable(fields) {
70
+ return {
71
+ borrowReserve: fields.borrowReserve,
72
+ cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(fields.cumulativeBorrowRateBsf),
73
+ padding: fields.padding,
74
+ borrowedAmountSf: fields.borrowedAmountSf,
75
+ marketValueSf: fields.marketValueSf,
76
+ borrowFactorAdjustedMarketValueSf: fields.borrowFactorAdjustedMarketValueSf,
77
+ padding2: fields.padding2,
78
+ };
79
+ }
80
+ toJSON() {
81
+ return {
82
+ borrowReserve: this.borrowReserve.toString(),
83
+ cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
84
+ padding: this.padding.toString(),
85
+ borrowedAmountSf: this.borrowedAmountSf.toString(),
86
+ marketValueSf: this.marketValueSf.toString(),
87
+ borrowFactorAdjustedMarketValueSf: this.borrowFactorAdjustedMarketValueSf.toString(),
88
+ padding2: this.padding2.map((item) => item.toString()),
89
+ };
90
+ }
91
+ static fromJSON(obj) {
92
+ return new ObligationLiquidity({
93
+ borrowReserve: new web3_js_1.PublicKey(obj.borrowReserve),
94
+ cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(obj.cumulativeBorrowRateBsf),
95
+ padding: new bn_js_1.default(obj.padding),
96
+ borrowedAmountSf: new bn_js_1.default(obj.borrowedAmountSf),
97
+ marketValueSf: new bn_js_1.default(obj.marketValueSf),
98
+ borrowFactorAdjustedMarketValueSf: new bn_js_1.default(obj.borrowFactorAdjustedMarketValueSf),
99
+ padding2: obj.padding2.map((item) => new bn_js_1.default(item)),
100
+ });
101
+ }
102
+ toEncodable() {
103
+ return ObligationLiquidity.toEncodable(this);
104
+ }
105
+ }
106
+ exports.ObligationLiquidity = ObligationLiquidity;
107
+ //# sourceMappingURL=ObligationLiquidity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObligationLiquidity.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ObligationLiquidity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AACpG,kDAAsB,CAAC,wDAAwD;AAC/E,gDAAiC,CAAC,wDAAwD;AAC1F,wDAAyC;AAgCzC,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,CAAC,gBAAgB,CAAC,QAAQ,CACtD,GAAG,CAAC,uBAAuB,CAC5B;YACD,OAAO,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,OAAO,CAAC;YAC5B,gBAAgB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC9C,aAAa,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,aAAa,CAAC;YACxC,iCAAiC,EAAE,IAAI,eAAE,CACvC,GAAG,CAAC,iCAAiC,CACtC;YACD,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACnD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF;AAxGD,kDAwGC","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 ObligationLiquidityFields {\n /** Reserve liquidity is borrowed from */\n borrowReserve: PublicKey\n /** Borrow rate used for calculating interest (big scaled fraction) */\n cumulativeBorrowRateBsf: types.BigFractionBytesFields\n padding: BN\n /** Amount of liquidity borrowed plus interest (scaled fraction) */\n borrowedAmountSf: BN\n /** Liquidity market value in quote currency (scaled fraction) */\n marketValueSf: BN\n /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */\n borrowFactorAdjustedMarketValueSf: BN\n padding2: Array<BN>\n}\n\nexport interface ObligationLiquidityJSON {\n /** Reserve liquidity is borrowed from */\n borrowReserve: string\n /** Borrow rate used for calculating interest (big scaled fraction) */\n cumulativeBorrowRateBsf: types.BigFractionBytesJSON\n padding: string\n /** Amount of liquidity borrowed plus interest (scaled fraction) */\n borrowedAmountSf: string\n /** Liquidity market value in quote currency (scaled fraction) */\n marketValueSf: string\n /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */\n borrowFactorAdjustedMarketValueSf: string\n padding2: Array<string>\n}\n\n/** Obligation liquidity state */\nexport class ObligationLiquidity {\n /** Reserve liquidity is borrowed from */\n readonly borrowReserve: PublicKey\n /** Borrow rate used for calculating interest (big scaled fraction) */\n readonly cumulativeBorrowRateBsf: types.BigFractionBytes\n readonly padding: BN\n /** Amount of liquidity borrowed plus interest (scaled fraction) */\n readonly borrowedAmountSf: BN\n /** Liquidity market value in quote currency (scaled fraction) */\n readonly marketValueSf: BN\n /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */\n readonly borrowFactorAdjustedMarketValueSf: BN\n readonly padding2: Array<BN>\n\n constructor(fields: ObligationLiquidityFields) {\n this.borrowReserve = fields.borrowReserve\n this.cumulativeBorrowRateBsf = new types.BigFractionBytes({\n ...fields.cumulativeBorrowRateBsf,\n })\n this.padding = fields.padding\n this.borrowedAmountSf = fields.borrowedAmountSf\n this.marketValueSf = fields.marketValueSf\n this.borrowFactorAdjustedMarketValueSf =\n fields.borrowFactorAdjustedMarketValueSf\n this.padding2 = fields.padding2\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.publicKey(\"borrowReserve\"),\n types.BigFractionBytes.layout(\"cumulativeBorrowRateBsf\"),\n borsh.u64(\"padding\"),\n borsh.u128(\"borrowedAmountSf\"),\n borsh.u128(\"marketValueSf\"),\n borsh.u128(\"borrowFactorAdjustedMarketValueSf\"),\n borsh.array(borsh.u64(), 8, \"padding2\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ObligationLiquidity({\n borrowReserve: obj.borrowReserve,\n cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(\n obj.cumulativeBorrowRateBsf\n ),\n padding: obj.padding,\n borrowedAmountSf: obj.borrowedAmountSf,\n marketValueSf: obj.marketValueSf,\n borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,\n padding2: obj.padding2,\n })\n }\n\n static toEncodable(fields: ObligationLiquidityFields) {\n return {\n borrowReserve: fields.borrowReserve,\n cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(\n fields.cumulativeBorrowRateBsf\n ),\n padding: fields.padding,\n borrowedAmountSf: fields.borrowedAmountSf,\n marketValueSf: fields.marketValueSf,\n borrowFactorAdjustedMarketValueSf:\n fields.borrowFactorAdjustedMarketValueSf,\n padding2: fields.padding2,\n }\n }\n\n toJSON(): ObligationLiquidityJSON {\n return {\n borrowReserve: this.borrowReserve.toString(),\n cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),\n padding: this.padding.toString(),\n borrowedAmountSf: this.borrowedAmountSf.toString(),\n marketValueSf: this.marketValueSf.toString(),\n borrowFactorAdjustedMarketValueSf:\n this.borrowFactorAdjustedMarketValueSf.toString(),\n padding2: this.padding2.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: ObligationLiquidityJSON): ObligationLiquidity {\n return new ObligationLiquidity({\n borrowReserve: new PublicKey(obj.borrowReserve),\n cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(\n obj.cumulativeBorrowRateBsf\n ),\n padding: new BN(obj.padding),\n borrowedAmountSf: new BN(obj.borrowedAmountSf),\n marketValueSf: new BN(obj.marketValueSf),\n borrowFactorAdjustedMarketValueSf: new BN(\n obj.borrowFactorAdjustedMarketValueSf\n ),\n padding2: obj.padding2.map((item) => new BN(item)),\n })\n }\n\n toEncodable() {\n return ObligationLiquidity.toEncodable(this)\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import BN from "bn.js";
2
+ import * as types from "../types";
3
+ export interface PriceHeuristicFields {
4
+ /** Lower value of acceptable price */
5
+ lower: BN;
6
+ /** Upper value of acceptable price */
7
+ upper: BN;
8
+ /** Number of decimals of the previously defined values */
9
+ exp: BN;
10
+ }
11
+ export interface PriceHeuristicJSON {
12
+ /** Lower value of acceptable price */
13
+ lower: string;
14
+ /** Upper value of acceptable price */
15
+ upper: string;
16
+ /** Number of decimals of the previously defined values */
17
+ exp: string;
18
+ }
19
+ export declare class PriceHeuristic {
20
+ /** Lower value of acceptable price */
21
+ readonly lower: BN;
22
+ /** Upper value of acceptable price */
23
+ readonly upper: BN;
24
+ /** Number of decimals of the previously defined values */
25
+ readonly exp: BN;
26
+ constructor(fields: PriceHeuristicFields);
27
+ static layout(property?: string): any;
28
+ static fromDecoded(obj: any): types.PriceHeuristic;
29
+ static toEncodable(fields: PriceHeuristicFields): {
30
+ lower: BN;
31
+ upper: BN;
32
+ exp: BN;
33
+ };
34
+ toJSON(): PriceHeuristicJSON;
35
+ static fromJSON(obj: PriceHeuristicJSON): PriceHeuristic;
36
+ toEncodable(): {
37
+ lower: BN;
38
+ upper: BN;
39
+ exp: BN;
40
+ };
41
+ }
@@ -0,0 +1,75 @@
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.PriceHeuristic = 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
+ class PriceHeuristic {
33
+ constructor(fields) {
34
+ this.lower = fields.lower;
35
+ this.upper = fields.upper;
36
+ this.exp = fields.exp;
37
+ }
38
+ static layout(property) {
39
+ return borsh.struct([borsh.u64("lower"), borsh.u64("upper"), borsh.u64("exp")], property);
40
+ }
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ static fromDecoded(obj) {
43
+ return new PriceHeuristic({
44
+ lower: obj.lower,
45
+ upper: obj.upper,
46
+ exp: obj.exp,
47
+ });
48
+ }
49
+ static toEncodable(fields) {
50
+ return {
51
+ lower: fields.lower,
52
+ upper: fields.upper,
53
+ exp: fields.exp,
54
+ };
55
+ }
56
+ toJSON() {
57
+ return {
58
+ lower: this.lower.toString(),
59
+ upper: this.upper.toString(),
60
+ exp: this.exp.toString(),
61
+ };
62
+ }
63
+ static fromJSON(obj) {
64
+ return new PriceHeuristic({
65
+ lower: new bn_js_1.default(obj.lower),
66
+ upper: new bn_js_1.default(obj.upper),
67
+ exp: new bn_js_1.default(obj.exp),
68
+ });
69
+ }
70
+ toEncodable() {
71
+ return PriceHeuristic.toEncodable(this);
72
+ }
73
+ }
74
+ exports.PriceHeuristic = PriceHeuristic;
75
+ //# sourceMappingURL=PriceHeuristic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceHeuristic.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/PriceHeuristic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;A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I,eAAE,CAAC,GAAG,CAAC,KAAK,CAAC;YACxB,GAAG,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,GAAG,CAAC;SACrB,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;CACF;AAzDD,wCAyDC","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 PriceHeuristicFields {\n /** Lower value of acceptable price */\n lower: BN\n /** Upper value of acceptable price */\n upper: BN\n /** Number of decimals of the previously defined values */\n exp: BN\n}\n\nexport interface PriceHeuristicJSON {\n /** Lower value of acceptable price */\n lower: string\n /** Upper value of acceptable price */\n upper: string\n /** Number of decimals of the previously defined values */\n exp: string\n}\n\nexport class PriceHeuristic {\n /** Lower value of acceptable price */\n readonly lower: BN\n /** Upper value of acceptable price */\n readonly upper: BN\n /** Number of decimals of the previously defined values */\n readonly exp: BN\n\n constructor(fields: PriceHeuristicFields) {\n this.lower = fields.lower\n this.upper = fields.upper\n this.exp = fields.exp\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [borsh.u64(\"lower\"), borsh.u64(\"upper\"), borsh.u64(\"exp\")],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new PriceHeuristic({\n lower: obj.lower,\n upper: obj.upper,\n exp: obj.exp,\n })\n }\n\n static toEncodable(fields: PriceHeuristicFields) {\n return {\n lower: fields.lower,\n upper: fields.upper,\n exp: fields.exp,\n }\n }\n\n toJSON(): PriceHeuristicJSON {\n return {\n lower: this.lower.toString(),\n upper: this.upper.toString(),\n exp: this.exp.toString(),\n }\n }\n\n static fromJSON(obj: PriceHeuristicJSON): PriceHeuristic {\n return new PriceHeuristic({\n lower: new BN(obj.lower),\n upper: new BN(obj.upper),\n exp: new BN(obj.exp),\n })\n }\n\n toEncodable() {\n return PriceHeuristic.toEncodable(this)\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import * as types from "../types";
3
+ export interface PythConfigurationFields {
4
+ /** Pubkey of the base price feed (disabled if `null` or `default`) */
5
+ price: PublicKey;
6
+ }
7
+ export interface PythConfigurationJSON {
8
+ /** Pubkey of the base price feed (disabled if `null` or `default`) */
9
+ price: string;
10
+ }
11
+ export declare class PythConfiguration {
12
+ /** Pubkey of the base price feed (disabled if `null` or `default`) */
13
+ readonly price: PublicKey;
14
+ constructor(fields: PythConfigurationFields);
15
+ static layout(property?: string): any;
16
+ static fromDecoded(obj: any): types.PythConfiguration;
17
+ static toEncodable(fields: PythConfigurationFields): {
18
+ price: PublicKey;
19
+ };
20
+ toJSON(): PythConfigurationJSON;
21
+ static fromJSON(obj: PythConfigurationJSON): PythConfiguration;
22
+ toEncodable(): {
23
+ price: PublicKey;
24
+ };
25
+ }
@@ -0,0 +1,62 @@
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.PythConfiguration = void 0;
27
+ const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
28
+ const borsh = __importStar(require("@coral-xyz/borsh"));
29
+ class PythConfiguration {
30
+ constructor(fields) {
31
+ this.price = fields.price;
32
+ }
33
+ static layout(property) {
34
+ return borsh.struct([borsh.publicKey("price")], property);
35
+ }
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ static fromDecoded(obj) {
38
+ return new PythConfiguration({
39
+ price: obj.price,
40
+ });
41
+ }
42
+ static toEncodable(fields) {
43
+ return {
44
+ price: fields.price,
45
+ };
46
+ }
47
+ toJSON() {
48
+ return {
49
+ price: this.price.toString(),
50
+ };
51
+ }
52
+ static fromJSON(obj) {
53
+ return new PythConfiguration({
54
+ price: new web3_js_1.PublicKey(obj.price),
55
+ });
56
+ }
57
+ toEncodable() {
58
+ return PythConfiguration.toEncodable(this);
59
+ }
60
+ }
61
+ exports.PythConfiguration = PythConfiguration;
62
+ //# sourceMappingURL=PythConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PythConfiguration.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/PythConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AAGpG,wDAAyC;AAYzC,MAAa,iBAAiB;IAI5B,YAAY,MAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;IAC3B,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,QAAiB;QAC7B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC3D,CAAC;IAED,8DAA8D;IAC9D,MAAM,CAAC,WAAW,CAAC,GAAQ;QACzB,OAAO,IAAI,iBAAiB,CAAC;YAC3B,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,MAA+B;QAChD,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;SAC7B,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAA0B;QACxC,OAAO,IAAI,iBAAiB,CAAC;YAC3B,KAAK,EAAE,IAAI,mBAAS,CAAC,GAAG,CAAC,KAAK,CAAC;SAChC,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF;AAxCD,8CAwCC","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 PythConfigurationFields {\n /** Pubkey of the base price feed (disabled if `null` or `default`) */\n price: PublicKey\n}\n\nexport interface PythConfigurationJSON {\n /** Pubkey of the base price feed (disabled if `null` or `default`) */\n price: string\n}\n\nexport class PythConfiguration {\n /** Pubkey of the base price feed (disabled if `null` or `default`) */\n readonly price: PublicKey\n\n constructor(fields: PythConfigurationFields) {\n this.price = fields.price\n }\n\n static layout(property?: string) {\n return borsh.struct([borsh.publicKey(\"price\")], property)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new PythConfiguration({\n price: obj.price,\n })\n }\n\n static toEncodable(fields: PythConfigurationFields) {\n return {\n price: fields.price,\n }\n }\n\n toJSON(): PythConfigurationJSON {\n return {\n price: this.price.toString(),\n }\n }\n\n static fromJSON(obj: PythConfigurationJSON): PythConfiguration {\n return new PythConfiguration({\n price: new PublicKey(obj.price),\n })\n }\n\n toEncodable() {\n return PythConfiguration.toEncodable(this)\n }\n}\n"]}
@@ -0,0 +1,53 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import BN from "bn.js";
3
+ import * as types from "../types";
4
+ export interface ReserveCollateralFields {
5
+ /** Reserve collateral mint address */
6
+ mintPubkey: PublicKey;
7
+ /** Reserve collateral mint supply, used for exchange rate */
8
+ mintTotalSupply: BN;
9
+ /** Reserve collateral supply address */
10
+ supplyVault: PublicKey;
11
+ padding1: Array<BN>;
12
+ padding2: Array<BN>;
13
+ }
14
+ export interface ReserveCollateralJSON {
15
+ /** Reserve collateral mint address */
16
+ mintPubkey: string;
17
+ /** Reserve collateral mint supply, used for exchange rate */
18
+ mintTotalSupply: string;
19
+ /** Reserve collateral supply address */
20
+ supplyVault: string;
21
+ padding1: Array<string>;
22
+ padding2: Array<string>;
23
+ }
24
+ /** Reserve collateral */
25
+ export declare class ReserveCollateral {
26
+ /** Reserve collateral mint address */
27
+ readonly mintPubkey: PublicKey;
28
+ /** Reserve collateral mint supply, used for exchange rate */
29
+ readonly mintTotalSupply: BN;
30
+ /** Reserve collateral supply address */
31
+ readonly supplyVault: PublicKey;
32
+ readonly padding1: Array<BN>;
33
+ readonly padding2: Array<BN>;
34
+ constructor(fields: ReserveCollateralFields);
35
+ static layout(property?: string): any;
36
+ static fromDecoded(obj: any): types.ReserveCollateral;
37
+ static toEncodable(fields: ReserveCollateralFields): {
38
+ mintPubkey: PublicKey;
39
+ mintTotalSupply: BN;
40
+ supplyVault: PublicKey;
41
+ padding1: BN[];
42
+ padding2: BN[];
43
+ };
44
+ toJSON(): ReserveCollateralJSON;
45
+ static fromJSON(obj: ReserveCollateralJSON): ReserveCollateral;
46
+ toEncodable(): {
47
+ mintPubkey: PublicKey;
48
+ mintTotalSupply: BN;
49
+ supplyVault: PublicKey;
50
+ padding1: BN[];
51
+ padding2: BN[];
52
+ };
53
+ }