@kamino-finance/klend-sdk 7.4.0-beta.1 → 7.4.0-beta.3

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 (338) hide show
  1. package/dist/@codegen/klend/accounts/LendingMarket.d.ts +201 -6
  2. package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
  3. package/dist/@codegen/klend/accounts/LendingMarket.js +130 -8
  4. package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
  5. package/dist/@codegen/klend/accounts/Obligation.d.ts +24 -15
  6. package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
  7. package/dist/@codegen/klend/accounts/Obligation.js +24 -21
  8. package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
  9. package/dist/@codegen/klend/accounts/Reserve.d.ts +6 -0
  10. package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
  11. package/dist/@codegen/klend/accounts/Reserve.js +9 -2
  12. package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
  13. package/dist/@codegen/klend/accounts/UserState.d.ts +0 -75
  14. package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
  15. package/dist/@codegen/klend/accounts/UserState.js +0 -25
  16. package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
  17. package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +144 -0
  18. package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +1 -0
  19. package/dist/@codegen/klend/accounts/WithdrawTicket.js +205 -0
  20. package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +1 -0
  21. package/dist/@codegen/klend/accounts/index.d.ts +2 -0
  22. package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
  23. package/dist/@codegen/klend/accounts/index.js +3 -1
  24. package/dist/@codegen/klend/accounts/index.js.map +1 -1
  25. package/dist/@codegen/klend/errors/custom.d.ts +169 -1
  26. package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
  27. package/dist/@codegen/klend/errors/custom.js +296 -1
  28. package/dist/@codegen/klend/errors/custom.js.map +1 -1
  29. package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +62 -0
  30. package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +1 -0
  31. package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +79 -0
  32. package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +1 -0
  33. package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts +36 -0
  34. package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts.map +1 -0
  35. package/dist/@codegen/klend/instructions/fillBorrowOrder.js +49 -0
  36. package/dist/@codegen/klend/instructions/fillBorrowOrder.js.map +1 -0
  37. package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +0 -1
  38. package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
  39. package/dist/@codegen/klend/instructions/idlMissingTypes.js +0 -2
  40. package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
  41. package/dist/@codegen/klend/instructions/index.d.ts +10 -0
  42. package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
  43. package/dist/@codegen/klend/instructions/index.js +12 -1
  44. package/dist/@codegen/klend/instructions/index.js.map +1 -1
  45. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts +54 -0
  46. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +1 -0
  47. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +66 -0
  48. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +1 -0
  49. package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +33 -0
  50. package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +1 -0
  51. package/dist/@codegen/klend/instructions/setBorrowOrder.js +66 -0
  52. package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +1 -0
  53. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +66 -0
  54. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +1 -0
  55. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +41 -0
  56. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js.map +1 -0
  57. package/dist/@codegen/klend/types/BorrowOrder.d.ts +192 -0
  58. package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +1 -0
  59. package/dist/@codegen/klend/types/BorrowOrder.js +194 -0
  60. package/dist/@codegen/klend/types/BorrowOrder.js.map +1 -0
  61. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +39 -0
  62. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +1 -0
  63. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +100 -0
  64. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +1 -0
  65. package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts +145 -0
  66. package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts.map +1 -0
  67. package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js +144 -0
  68. package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js.map +1 -0
  69. package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +64 -5
  70. package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
  71. package/dist/@codegen/klend/types/ObligationLiquidity.js +32 -8
  72. package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
  73. package/dist/@codegen/klend/types/ObligationOrder.d.ts +4 -4
  74. package/dist/@codegen/klend/types/ObligationOrder.js +2 -2
  75. package/dist/@codegen/klend/types/ProgressCallbackType.d.ts +32 -0
  76. package/dist/@codegen/klend/types/ProgressCallbackType.d.ts.map +1 -0
  77. package/dist/@codegen/klend/types/{AssetTier.js → ProgressCallbackType.js} +24 -48
  78. package/dist/@codegen/klend/types/ProgressCallbackType.js.map +1 -0
  79. package/dist/@codegen/klend/types/ReserveConfig.d.ts +60 -5
  80. package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
  81. package/dist/@codegen/klend/types/ReserveConfig.js +36 -7
  82. package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
  83. package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +26 -8
  84. package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
  85. package/dist/@codegen/klend/types/ReserveLiquidity.js +14 -8
  86. package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
  87. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +40 -14
  88. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
  89. package/dist/@codegen/klend/types/UpdateConfigMode.js +72 -24
  90. package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
  91. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +130 -0
  92. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
  93. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +241 -1
  94. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
  95. package/dist/@codegen/klend/types/WithdrawQueue.d.ts +64 -0
  96. package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +1 -0
  97. package/dist/@codegen/klend/types/WithdrawQueue.js +104 -0
  98. package/dist/@codegen/klend/types/WithdrawQueue.js.map +1 -0
  99. package/dist/@codegen/klend/types/index.d.ts +27 -8
  100. package/dist/@codegen/klend/types/index.d.ts.map +1 -1
  101. package/dist/@codegen/klend/types/index.js +11 -3
  102. package/dist/@codegen/klend/types/index.js.map +1 -1
  103. package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +8 -5
  104. package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
  105. package/dist/@codegen/klend/zero_padding/ObligationZP.js +17 -14
  106. package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
  107. package/dist/@codegen/kvault/accounts/LendingMarket.d.ts +480 -0
  108. package/dist/@codegen/kvault/accounts/LendingMarket.d.ts.map +1 -0
  109. package/dist/@codegen/kvault/accounts/LendingMarket.js +480 -0
  110. package/dist/@codegen/kvault/accounts/LendingMarket.js.map +1 -0
  111. package/dist/@codegen/kvault/accounts/Obligation.d.ts +208 -0
  112. package/dist/@codegen/kvault/accounts/Obligation.d.ts.map +1 -0
  113. package/dist/@codegen/kvault/accounts/Obligation.js +298 -0
  114. package/dist/@codegen/kvault/accounts/Obligation.js.map +1 -0
  115. package/dist/@codegen/kvault/accounts/ReferrerTokenState.d.ts +51 -0
  116. package/dist/@codegen/kvault/accounts/ReferrerTokenState.d.ts.map +1 -0
  117. package/dist/@codegen/kvault/accounts/ReferrerTokenState.js +137 -0
  118. package/dist/@codegen/kvault/accounts/ReferrerTokenState.js.map +1 -0
  119. package/dist/@codegen/kvault/accounts/Reserve.d.ts +6 -0
  120. package/dist/@codegen/kvault/accounts/Reserve.d.ts.map +1 -1
  121. package/dist/@codegen/kvault/accounts/Reserve.js +9 -2
  122. package/dist/@codegen/kvault/accounts/Reserve.js.map +1 -1
  123. package/dist/@codegen/kvault/accounts/VaultState.d.ts +45 -3
  124. package/dist/@codegen/kvault/accounts/VaultState.d.ts.map +1 -1
  125. package/dist/@codegen/kvault/accounts/VaultState.js +28 -4
  126. package/dist/@codegen/kvault/accounts/VaultState.js.map +1 -1
  127. package/dist/@codegen/kvault/accounts/WithdrawTicket.d.ts +144 -0
  128. package/dist/@codegen/kvault/accounts/WithdrawTicket.d.ts.map +1 -0
  129. package/dist/@codegen/kvault/accounts/WithdrawTicket.js +205 -0
  130. package/dist/@codegen/kvault/accounts/WithdrawTicket.js.map +1 -0
  131. package/dist/@codegen/kvault/accounts/index.d.ts +8 -0
  132. package/dist/@codegen/kvault/accounts/index.d.ts.map +1 -1
  133. package/dist/@codegen/kvault/accounts/index.js +9 -1
  134. package/dist/@codegen/kvault/accounts/index.js.map +1 -1
  135. package/dist/@codegen/kvault/errors/custom.d.ts +81 -1
  136. package/dist/@codegen/kvault/errors/custom.d.ts.map +1 -1
  137. package/dist/@codegen/kvault/errors/custom.js +141 -1
  138. package/dist/@codegen/kvault/errors/custom.js.map +1 -1
  139. package/dist/@codegen/kvault/instructions/index.d.ts +4 -0
  140. package/dist/@codegen/kvault/instructions/index.d.ts.map +1 -1
  141. package/dist/@codegen/kvault/instructions/index.js +5 -1
  142. package/dist/@codegen/kvault/instructions/index.js.map +1 -1
  143. package/dist/@codegen/kvault/instructions/invest.d.ts +9 -0
  144. package/dist/@codegen/kvault/instructions/invest.d.ts.map +1 -1
  145. package/dist/@codegen/kvault/instructions/invest.js +7 -0
  146. package/dist/@codegen/kvault/instructions/invest.js.map +1 -1
  147. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.d.ts +51 -0
  148. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.d.ts.map +1 -0
  149. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.js +154 -0
  150. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.js.map +1 -0
  151. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.d.ts +54 -0
  152. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.d.ts.map +1 -0
  153. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.js +166 -0
  154. package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.js.map +1 -0
  155. package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.d.ts +1 -0
  156. package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.d.ts.map +1 -0
  157. package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.js +72 -0
  158. package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.js.map +1 -0
  159. package/dist/@codegen/kvault/instructions/updateReserveAllocation.d.ts +3 -1
  160. package/dist/@codegen/kvault/instructions/updateReserveAllocation.d.ts.map +1 -1
  161. package/dist/@codegen/kvault/instructions/updateReserveAllocation.js +3 -0
  162. package/dist/@codegen/kvault/instructions/updateReserveAllocation.js.map +1 -1
  163. package/dist/@codegen/kvault/types/BorrowOrder.d.ts +192 -0
  164. package/dist/@codegen/kvault/types/BorrowOrder.d.ts.map +1 -0
  165. package/dist/@codegen/kvault/types/BorrowOrder.js +194 -0
  166. package/dist/@codegen/kvault/types/BorrowOrder.js.map +1 -0
  167. package/dist/@codegen/kvault/types/ElevationGroup.d.ts +67 -0
  168. package/dist/@codegen/kvault/types/ElevationGroup.d.ts.map +1 -0
  169. package/dist/@codegen/kvault/types/ElevationGroup.js +137 -0
  170. package/dist/@codegen/kvault/types/ElevationGroup.js.map +1 -0
  171. package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.d.ts +145 -0
  172. package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.d.ts.map +1 -0
  173. package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.js +144 -0
  174. package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.js.map +1 -0
  175. package/dist/@codegen/kvault/types/ObligationCollateral.d.ts +72 -0
  176. package/dist/@codegen/kvault/types/ObligationCollateral.d.ts.map +1 -0
  177. package/dist/@codegen/kvault/types/ObligationCollateral.js +119 -0
  178. package/dist/@codegen/kvault/types/ObligationCollateral.js.map +1 -0
  179. package/dist/@codegen/kvault/types/ObligationLiquidity.d.ts +143 -0
  180. package/dist/@codegen/kvault/types/ObligationLiquidity.d.ts.map +1 -0
  181. package/dist/@codegen/kvault/types/ObligationLiquidity.js +165 -0
  182. package/dist/@codegen/kvault/types/ObligationLiquidity.js.map +1 -0
  183. package/dist/@codegen/kvault/types/ObligationOrder.d.ts +284 -0
  184. package/dist/@codegen/kvault/types/ObligationOrder.d.ts.map +1 -0
  185. package/dist/@codegen/kvault/types/ObligationOrder.js +205 -0
  186. package/dist/@codegen/kvault/types/ObligationOrder.js.map +1 -0
  187. package/dist/@codegen/kvault/types/ReserveConfig.d.ts +60 -5
  188. package/dist/@codegen/kvault/types/ReserveConfig.d.ts.map +1 -1
  189. package/dist/@codegen/kvault/types/ReserveConfig.js +36 -7
  190. package/dist/@codegen/kvault/types/ReserveConfig.js.map +1 -1
  191. package/dist/@codegen/kvault/types/ReserveLiquidity.d.ts +26 -8
  192. package/dist/@codegen/kvault/types/ReserveLiquidity.d.ts.map +1 -1
  193. package/dist/@codegen/kvault/types/ReserveLiquidity.js +14 -8
  194. package/dist/@codegen/kvault/types/ReserveLiquidity.js.map +1 -1
  195. package/dist/@codegen/kvault/types/ReserveType.d.ts +32 -0
  196. package/dist/@codegen/kvault/types/ReserveType.d.ts.map +1 -0
  197. package/dist/@codegen/kvault/types/ReserveType.js +108 -0
  198. package/dist/@codegen/kvault/types/ReserveType.js.map +1 -0
  199. package/dist/@codegen/kvault/types/VaultAllocation.d.ts +60 -0
  200. package/dist/@codegen/kvault/types/VaultAllocation.d.ts.map +1 -1
  201. package/dist/@codegen/kvault/types/VaultAllocation.js +38 -2
  202. package/dist/@codegen/kvault/types/VaultAllocation.js.map +1 -1
  203. package/dist/@codegen/kvault/types/WithdrawQueue.d.ts +64 -0
  204. package/dist/@codegen/kvault/types/WithdrawQueue.d.ts.map +1 -0
  205. package/dist/@codegen/kvault/types/WithdrawQueue.js +104 -0
  206. package/dist/@codegen/kvault/types/WithdrawQueue.js.map +1 -0
  207. package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.d.ts +19 -0
  208. package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.d.ts.map +1 -0
  209. package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.js +82 -0
  210. package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.js.map +1 -0
  211. package/dist/@codegen/kvault/types/index.d.ts +34 -0
  212. package/dist/@codegen/kvault/types/index.d.ts.map +1 -1
  213. package/dist/@codegen/kvault/types/index.js +19 -1
  214. package/dist/@codegen/kvault/types/index.js.map +1 -1
  215. package/dist/classes/action.d.ts +11 -0
  216. package/dist/classes/action.d.ts.map +1 -1
  217. package/dist/classes/action.js +66 -0
  218. package/dist/classes/action.js.map +1 -1
  219. package/dist/classes/actionTypes.d.ts +29 -0
  220. package/dist/classes/actionTypes.d.ts.map +1 -1
  221. package/dist/classes/manager.d.ts +1 -1
  222. package/dist/classes/manager.d.ts.map +1 -1
  223. package/dist/classes/manager.js +13 -8
  224. package/dist/classes/manager.js.map +1 -1
  225. package/dist/classes/market.d.ts +10 -5
  226. package/dist/classes/market.d.ts.map +1 -1
  227. package/dist/classes/market.js +22 -15
  228. package/dist/classes/market.js.map +1 -1
  229. package/dist/classes/obligation.d.ts +2 -2
  230. package/dist/classes/obligation.d.ts.map +1 -1
  231. package/dist/classes/obligation.js +9 -7
  232. package/dist/classes/obligation.js.map +1 -1
  233. package/dist/classes/reserve.d.ts +2 -1
  234. package/dist/classes/reserve.d.ts.map +1 -1
  235. package/dist/classes/reserve.js +48 -32
  236. package/dist/classes/reserve.js.map +1 -1
  237. package/dist/classes/utils.d.ts +2 -0
  238. package/dist/classes/utils.d.ts.map +1 -1
  239. package/dist/classes/utils.js +12 -1
  240. package/dist/classes/utils.js.map +1 -1
  241. package/dist/classes/vault.d.ts +4 -2
  242. package/dist/classes/vault.d.ts.map +1 -1
  243. package/dist/classes/vault.js +12 -2
  244. package/dist/classes/vault.js.map +1 -1
  245. package/dist/idl/klend.json +1461 -106
  246. package/dist/manager/client_kamino_manager.js +14 -11
  247. package/dist/manager/client_kamino_manager.js.map +1 -1
  248. package/dist/obligation_orders/price_based.js +5 -4
  249. package/dist/obligation_orders/price_based.js.map +1 -1
  250. package/dist/utils/managerTypes.d.ts.map +1 -1
  251. package/dist/utils/managerTypes.js +3 -1
  252. package/dist/utils/managerTypes.js.map +1 -1
  253. package/dist/utils/seeds.d.ts +24 -0
  254. package/dist/utils/seeds.d.ts.map +1 -1
  255. package/dist/utils/seeds.js +41 -1
  256. package/dist/utils/seeds.js.map +1 -1
  257. package/dist/utils/validations.d.ts +1 -0
  258. package/dist/utils/validations.d.ts.map +1 -1
  259. package/dist/utils/validations.js +5 -0
  260. package/dist/utils/validations.js.map +1 -1
  261. package/dist/utils/vault.d.ts.map +1 -1
  262. package/dist/utils/vault.js +2 -0
  263. package/dist/utils/vault.js.map +1 -1
  264. package/package.json +1 -1
  265. package/src/@codegen/klend/accounts/LendingMarket.ts +284 -12
  266. package/src/@codegen/klend/accounts/Obligation.ts +42 -31
  267. package/src/@codegen/klend/accounts/Reserve.ts +13 -2
  268. package/src/@codegen/klend/accounts/UserState.ts +0 -75
  269. package/src/@codegen/klend/accounts/WithdrawTicket.ts +280 -0
  270. package/src/@codegen/klend/accounts/index.ts +2 -0
  271. package/src/@codegen/klend/errors/custom.ts +333 -0
  272. package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +120 -0
  273. package/src/@codegen/klend/instructions/fillBorrowOrder.ts +96 -0
  274. package/src/@codegen/klend/instructions/idlMissingTypes.ts +0 -3
  275. package/src/@codegen/klend/instructions/index.ts +19 -0
  276. package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +103 -0
  277. package/src/@codegen/klend/instructions/setBorrowOrder.ts +81 -0
  278. package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +118 -0
  279. package/src/@codegen/klend/types/BorrowOrder.ts +267 -0
  280. package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +87 -0
  281. package/src/@codegen/klend/types/FixedTermBorrowRolloverConfig.ts +199 -0
  282. package/src/@codegen/klend/types/ObligationLiquidity.ts +76 -10
  283. package/src/@codegen/klend/types/ObligationOrder.ts +4 -4
  284. package/src/@codegen/klend/types/ProgressCallbackType.ts +91 -0
  285. package/src/@codegen/klend/types/ReserveConfig.ts +72 -9
  286. package/src/@codegen/klend/types/ReserveLiquidity.ts +30 -12
  287. package/src/@codegen/klend/types/UpdateConfigMode.ts +86 -26
  288. package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +300 -0
  289. package/src/@codegen/klend/types/WithdrawQueue.ts +117 -0
  290. package/src/@codegen/klend/types/index.ts +63 -16
  291. package/src/@codegen/klend/zero_padding/ObligationZP.ts +17 -14
  292. package/src/@codegen/kvault/accounts/LendingMarket.ts +837 -0
  293. package/src/@codegen/kvault/accounts/Obligation.ts +459 -0
  294. package/src/@codegen/kvault/accounts/ReferrerTokenState.ts +160 -0
  295. package/src/@codegen/kvault/accounts/Reserve.ts +13 -2
  296. package/src/@codegen/kvault/accounts/VaultState.ts +59 -7
  297. package/src/@codegen/kvault/accounts/WithdrawTicket.ts +280 -0
  298. package/src/@codegen/kvault/accounts/index.ts +11 -0
  299. package/src/@codegen/kvault/errors/custom.ts +152 -0
  300. package/src/@codegen/kvault/instructions/index.ts +10 -0
  301. package/src/@codegen/kvault/instructions/invest.ts +16 -0
  302. package/src/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.ts +189 -0
  303. package/src/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.ts +205 -0
  304. package/src/@codegen/kvault/instructions/updateKlendQueueAccounting.ts +76 -0
  305. package/src/@codegen/kvault/instructions/updateReserveAllocation.ts +4 -1
  306. package/src/@codegen/kvault/types/BorrowOrder.ts +267 -0
  307. package/src/@codegen/kvault/types/ElevationGroup.ts +134 -0
  308. package/src/@codegen/kvault/types/FixedTermBorrowRolloverConfig.ts +199 -0
  309. package/src/@codegen/kvault/types/ObligationCollateral.ts +129 -0
  310. package/src/@codegen/kvault/types/ObligationLiquidity.ts +226 -0
  311. package/src/@codegen/kvault/types/ObligationOrder.ts +348 -0
  312. package/src/@codegen/kvault/types/ReserveConfig.ts +72 -9
  313. package/src/@codegen/kvault/types/ReserveLiquidity.ts +30 -12
  314. package/src/@codegen/kvault/types/ReserveType.ts +89 -0
  315. package/src/@codegen/kvault/types/VaultAllocation.ts +74 -2
  316. package/src/@codegen/kvault/types/WithdrawQueue.ts +117 -0
  317. package/src/@codegen/kvault/types/WithdrawTicketProgressEvent.ts +59 -0
  318. package/src/@codegen/kvault/types/index.ts +52 -0
  319. package/src/classes/action.ts +115 -1
  320. package/src/classes/actionTypes.ts +31 -0
  321. package/src/classes/manager.ts +24 -27
  322. package/src/classes/market.ts +34 -17
  323. package/src/classes/obligation.ts +9 -7
  324. package/src/classes/reserve.ts +48 -45
  325. package/src/classes/utils.ts +8 -0
  326. package/src/classes/vault.ts +35 -4
  327. package/src/idl/klend.json +1461 -106
  328. package/src/idl/kvault.json +2336 -299
  329. package/src/manager/client_kamino_manager.ts +14 -12
  330. package/src/obligation_orders/price_based.ts +7 -6
  331. package/src/utils/managerTypes.ts +3 -1
  332. package/src/utils/seeds.ts +49 -0
  333. package/src/utils/validations.ts +5 -0
  334. package/src/utils/vault.ts +2 -0
  335. package/dist/@codegen/klend/types/AssetTier.d.ts +0 -45
  336. package/dist/@codegen/klend/types/AssetTier.d.ts.map +0 -1
  337. package/dist/@codegen/klend/types/AssetTier.js.map +0 -1
  338. package/src/@codegen/klend/types/AssetTier.ts +0 -119
@@ -0,0 +1,199 @@
1
+ import { address, Address } from "@solana/kit" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+ import { borshAddress } from "../utils"
6
+
7
+ export interface FixedTermBorrowRolloverConfigFields {
8
+ /**
9
+ * Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:
10
+ *
11
+ * The reserve used to re-borrow the liquidity must have:
12
+ * A) the exact same maximum borrow rate as the current one,
13
+ * B) the exact same debt term as the current one,
14
+ * C) sufficient available liquidity (including no withdraw tickets waiting in its queue).
15
+ *
16
+ * The time left until the current debt term expires must be:
17
+ * D) less than [LendingMarket::fixed_rollover_window_duration_seconds].
18
+ *
19
+ * Note: the other settings are only effective when this one is `1`.
20
+ */
21
+ autoRolloverEnabled: number
22
+ /**
23
+ * When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally
24
+ * allows to use a variable (indefinite) debt term if less than
25
+ * [LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.
26
+ *
27
+ * Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to
28
+ * `u32::MAX` (to denote a variable-rate reserve).
29
+ */
30
+ openTermAllowed: number
31
+ /** Internal alignment padding (free to reuse). */
32
+ alignmentPadding: Array<number>
33
+ /**
34
+ * A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:
35
+ * when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower
36
+ * than the given one.
37
+ */
38
+ maxBorrowRateBps: number
39
+ /**
40
+ * A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:
41
+ * when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer
42
+ * than the given one.
43
+ */
44
+ minDebtTermSeconds: BN
45
+ }
46
+
47
+ export interface FixedTermBorrowRolloverConfigJSON {
48
+ /**
49
+ * Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:
50
+ *
51
+ * The reserve used to re-borrow the liquidity must have:
52
+ * A) the exact same maximum borrow rate as the current one,
53
+ * B) the exact same debt term as the current one,
54
+ * C) sufficient available liquidity (including no withdraw tickets waiting in its queue).
55
+ *
56
+ * The time left until the current debt term expires must be:
57
+ * D) less than [LendingMarket::fixed_rollover_window_duration_seconds].
58
+ *
59
+ * Note: the other settings are only effective when this one is `1`.
60
+ */
61
+ autoRolloverEnabled: number
62
+ /**
63
+ * When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally
64
+ * allows to use a variable (indefinite) debt term if less than
65
+ * [LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.
66
+ *
67
+ * Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to
68
+ * `u32::MAX` (to denote a variable-rate reserve).
69
+ */
70
+ openTermAllowed: number
71
+ /** Internal alignment padding (free to reuse). */
72
+ alignmentPadding: Array<number>
73
+ /**
74
+ * A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:
75
+ * when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower
76
+ * than the given one.
77
+ */
78
+ maxBorrowRateBps: number
79
+ /**
80
+ * A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:
81
+ * when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer
82
+ * than the given one.
83
+ */
84
+ minDebtTermSeconds: string
85
+ }
86
+
87
+ /**
88
+ * Settings driving the auto-rollover of an [ObligationLiquidity] that uses a fixed-term [Reserve]
89
+ * and approaches the end of its [ReserveConfig::debt_term_seconds].
90
+ *
91
+ * By its nature (not a special case), the zeroed struct mean "no auto-rollover".
92
+ */
93
+ export class FixedTermBorrowRolloverConfig {
94
+ /**
95
+ * Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:
96
+ *
97
+ * The reserve used to re-borrow the liquidity must have:
98
+ * A) the exact same maximum borrow rate as the current one,
99
+ * B) the exact same debt term as the current one,
100
+ * C) sufficient available liquidity (including no withdraw tickets waiting in its queue).
101
+ *
102
+ * The time left until the current debt term expires must be:
103
+ * D) less than [LendingMarket::fixed_rollover_window_duration_seconds].
104
+ *
105
+ * Note: the other settings are only effective when this one is `1`.
106
+ */
107
+ readonly autoRolloverEnabled: number
108
+ /**
109
+ * When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally
110
+ * allows to use a variable (indefinite) debt term if less than
111
+ * [LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.
112
+ *
113
+ * Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to
114
+ * `u32::MAX` (to denote a variable-rate reserve).
115
+ */
116
+ readonly openTermAllowed: number
117
+ /** Internal alignment padding (free to reuse). */
118
+ readonly alignmentPadding: Array<number>
119
+ /**
120
+ * A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:
121
+ * when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower
122
+ * than the given one.
123
+ */
124
+ readonly maxBorrowRateBps: number
125
+ /**
126
+ * A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:
127
+ * when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer
128
+ * than the given one.
129
+ */
130
+ readonly minDebtTermSeconds: BN
131
+
132
+ constructor(fields: FixedTermBorrowRolloverConfigFields) {
133
+ this.autoRolloverEnabled = fields.autoRolloverEnabled
134
+ this.openTermAllowed = fields.openTermAllowed
135
+ this.alignmentPadding = fields.alignmentPadding
136
+ this.maxBorrowRateBps = fields.maxBorrowRateBps
137
+ this.minDebtTermSeconds = fields.minDebtTermSeconds
138
+ }
139
+
140
+ static layout(property?: string) {
141
+ return borsh.struct(
142
+ [
143
+ borsh.u8("autoRolloverEnabled"),
144
+ borsh.u8("openTermAllowed"),
145
+ borsh.array(borsh.u8(), 2, "alignmentPadding"),
146
+ borsh.u32("maxBorrowRateBps"),
147
+ borsh.u64("minDebtTermSeconds"),
148
+ ],
149
+ property
150
+ )
151
+ }
152
+
153
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
+ static fromDecoded(obj: any) {
155
+ return new FixedTermBorrowRolloverConfig({
156
+ autoRolloverEnabled: obj.autoRolloverEnabled,
157
+ openTermAllowed: obj.openTermAllowed,
158
+ alignmentPadding: obj.alignmentPadding,
159
+ maxBorrowRateBps: obj.maxBorrowRateBps,
160
+ minDebtTermSeconds: obj.minDebtTermSeconds,
161
+ })
162
+ }
163
+
164
+ static toEncodable(fields: FixedTermBorrowRolloverConfigFields) {
165
+ return {
166
+ autoRolloverEnabled: fields.autoRolloverEnabled,
167
+ openTermAllowed: fields.openTermAllowed,
168
+ alignmentPadding: fields.alignmentPadding,
169
+ maxBorrowRateBps: fields.maxBorrowRateBps,
170
+ minDebtTermSeconds: fields.minDebtTermSeconds,
171
+ }
172
+ }
173
+
174
+ toJSON(): FixedTermBorrowRolloverConfigJSON {
175
+ return {
176
+ autoRolloverEnabled: this.autoRolloverEnabled,
177
+ openTermAllowed: this.openTermAllowed,
178
+ alignmentPadding: this.alignmentPadding,
179
+ maxBorrowRateBps: this.maxBorrowRateBps,
180
+ minDebtTermSeconds: this.minDebtTermSeconds.toString(),
181
+ }
182
+ }
183
+
184
+ static fromJSON(
185
+ obj: FixedTermBorrowRolloverConfigJSON
186
+ ): FixedTermBorrowRolloverConfig {
187
+ return new FixedTermBorrowRolloverConfig({
188
+ autoRolloverEnabled: obj.autoRolloverEnabled,
189
+ openTermAllowed: obj.openTermAllowed,
190
+ alignmentPadding: obj.alignmentPadding,
191
+ maxBorrowRateBps: obj.maxBorrowRateBps,
192
+ minDebtTermSeconds: new BN(obj.minDebtTermSeconds),
193
+ })
194
+ }
195
+
196
+ toEncodable() {
197
+ return FixedTermBorrowRolloverConfig.toEncodable(this)
198
+ }
199
+ }
@@ -9,7 +9,17 @@ export interface ObligationLiquidityFields {
9
9
  borrowReserve: Address
10
10
  /** Borrow rate used for calculating interest (big scaled fraction) */
11
11
  cumulativeBorrowRateBsf: types.BigFractionBytesFields
12
- padding: BN
12
+ /**
13
+ * The timestamp at which this debt was taken.
14
+ * More specifically: when the *first* borrow operation from this reserve happened.
15
+ * This means that:
16
+ * - adding debt of the same reserve does *not* change this timestamp,
17
+ * - repaying the entire debt of this reserve *does* reset this timestamp.
18
+ *
19
+ * Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
20
+ * fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
21
+ */
22
+ firstBorrowedAtTimestamp: BN
13
23
  /** Amount of liquidity borrowed plus interest (scaled fraction) */
14
24
  borrowedAmountSf: BN
15
25
  /** Liquidity market value in quote currency (scaled fraction) */
@@ -18,6 +28,11 @@ export interface ObligationLiquidityFields {
18
28
  borrowFactorAdjustedMarketValueSf: BN
19
29
  /** Amount of liquidity borrowed outside of an elevation group */
20
30
  borrowedAmountOutsideElevationGroups: BN
31
+ /**
32
+ * The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its
33
+ * reserve has a non-zero [ReserveConfig::debt_term_seconds]).
34
+ */
35
+ fixedTermBorrowRolloverConfig: types.FixedTermBorrowRolloverConfigFields
21
36
  padding2: Array<BN>
22
37
  }
23
38
 
@@ -26,7 +41,17 @@ export interface ObligationLiquidityJSON {
26
41
  borrowReserve: string
27
42
  /** Borrow rate used for calculating interest (big scaled fraction) */
28
43
  cumulativeBorrowRateBsf: types.BigFractionBytesJSON
29
- padding: string
44
+ /**
45
+ * The timestamp at which this debt was taken.
46
+ * More specifically: when the *first* borrow operation from this reserve happened.
47
+ * This means that:
48
+ * - adding debt of the same reserve does *not* change this timestamp,
49
+ * - repaying the entire debt of this reserve *does* reset this timestamp.
50
+ *
51
+ * Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
52
+ * fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
53
+ */
54
+ firstBorrowedAtTimestamp: string
30
55
  /** Amount of liquidity borrowed plus interest (scaled fraction) */
31
56
  borrowedAmountSf: string
32
57
  /** Liquidity market value in quote currency (scaled fraction) */
@@ -35,6 +60,11 @@ export interface ObligationLiquidityJSON {
35
60
  borrowFactorAdjustedMarketValueSf: string
36
61
  /** Amount of liquidity borrowed outside of an elevation group */
37
62
  borrowedAmountOutsideElevationGroups: string
63
+ /**
64
+ * The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its
65
+ * reserve has a non-zero [ReserveConfig::debt_term_seconds]).
66
+ */
67
+ fixedTermBorrowRolloverConfig: types.FixedTermBorrowRolloverConfigJSON
38
68
  padding2: Array<string>
39
69
  }
40
70
 
@@ -44,7 +74,17 @@ export class ObligationLiquidity {
44
74
  readonly borrowReserve: Address
45
75
  /** Borrow rate used for calculating interest (big scaled fraction) */
46
76
  readonly cumulativeBorrowRateBsf: types.BigFractionBytes
47
- readonly padding: BN
77
+ /**
78
+ * The timestamp at which this debt was taken.
79
+ * More specifically: when the *first* borrow operation from this reserve happened.
80
+ * This means that:
81
+ * - adding debt of the same reserve does *not* change this timestamp,
82
+ * - repaying the entire debt of this reserve *does* reset this timestamp.
83
+ *
84
+ * Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
85
+ * fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
86
+ */
87
+ readonly firstBorrowedAtTimestamp: BN
48
88
  /** Amount of liquidity borrowed plus interest (scaled fraction) */
49
89
  readonly borrowedAmountSf: BN
50
90
  /** Liquidity market value in quote currency (scaled fraction) */
@@ -53,6 +93,11 @@ export class ObligationLiquidity {
53
93
  readonly borrowFactorAdjustedMarketValueSf: BN
54
94
  /** Amount of liquidity borrowed outside of an elevation group */
55
95
  readonly borrowedAmountOutsideElevationGroups: BN
96
+ /**
97
+ * The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its
98
+ * reserve has a non-zero [ReserveConfig::debt_term_seconds]).
99
+ */
100
+ readonly fixedTermBorrowRolloverConfig: types.FixedTermBorrowRolloverConfig
56
101
  readonly padding2: Array<BN>
57
102
 
58
103
  constructor(fields: ObligationLiquidityFields) {
@@ -60,13 +105,17 @@ export class ObligationLiquidity {
60
105
  this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
61
106
  ...fields.cumulativeBorrowRateBsf,
62
107
  })
63
- this.padding = fields.padding
108
+ this.firstBorrowedAtTimestamp = fields.firstBorrowedAtTimestamp
64
109
  this.borrowedAmountSf = fields.borrowedAmountSf
65
110
  this.marketValueSf = fields.marketValueSf
66
111
  this.borrowFactorAdjustedMarketValueSf =
67
112
  fields.borrowFactorAdjustedMarketValueSf
68
113
  this.borrowedAmountOutsideElevationGroups =
69
114
  fields.borrowedAmountOutsideElevationGroups
115
+ this.fixedTermBorrowRolloverConfig =
116
+ new types.FixedTermBorrowRolloverConfig({
117
+ ...fields.fixedTermBorrowRolloverConfig,
118
+ })
70
119
  this.padding2 = fields.padding2
71
120
  }
72
121
 
@@ -75,12 +124,15 @@ export class ObligationLiquidity {
75
124
  [
76
125
  borshAddress("borrowReserve"),
77
126
  types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
78
- borsh.u64("padding"),
127
+ borsh.u64("firstBorrowedAtTimestamp"),
79
128
  borsh.u128("borrowedAmountSf"),
80
129
  borsh.u128("marketValueSf"),
81
130
  borsh.u128("borrowFactorAdjustedMarketValueSf"),
82
131
  borsh.u64("borrowedAmountOutsideElevationGroups"),
83
- borsh.array(borsh.u64(), 7, "padding2"),
132
+ types.FixedTermBorrowRolloverConfig.layout(
133
+ "fixedTermBorrowRolloverConfig"
134
+ ),
135
+ borsh.array(borsh.u64(), 5, "padding2"),
84
136
  ],
85
137
  property
86
138
  )
@@ -93,12 +145,16 @@ export class ObligationLiquidity {
93
145
  cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(
94
146
  obj.cumulativeBorrowRateBsf
95
147
  ),
96
- padding: obj.padding,
148
+ firstBorrowedAtTimestamp: obj.firstBorrowedAtTimestamp,
97
149
  borrowedAmountSf: obj.borrowedAmountSf,
98
150
  marketValueSf: obj.marketValueSf,
99
151
  borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,
100
152
  borrowedAmountOutsideElevationGroups:
101
153
  obj.borrowedAmountOutsideElevationGroups,
154
+ fixedTermBorrowRolloverConfig:
155
+ types.FixedTermBorrowRolloverConfig.fromDecoded(
156
+ obj.fixedTermBorrowRolloverConfig
157
+ ),
102
158
  padding2: obj.padding2,
103
159
  })
104
160
  }
@@ -109,13 +165,17 @@ export class ObligationLiquidity {
109
165
  cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(
110
166
  fields.cumulativeBorrowRateBsf
111
167
  ),
112
- padding: fields.padding,
168
+ firstBorrowedAtTimestamp: fields.firstBorrowedAtTimestamp,
113
169
  borrowedAmountSf: fields.borrowedAmountSf,
114
170
  marketValueSf: fields.marketValueSf,
115
171
  borrowFactorAdjustedMarketValueSf:
116
172
  fields.borrowFactorAdjustedMarketValueSf,
117
173
  borrowedAmountOutsideElevationGroups:
118
174
  fields.borrowedAmountOutsideElevationGroups,
175
+ fixedTermBorrowRolloverConfig:
176
+ types.FixedTermBorrowRolloverConfig.toEncodable(
177
+ fields.fixedTermBorrowRolloverConfig
178
+ ),
119
179
  padding2: fields.padding2,
120
180
  }
121
181
  }
@@ -124,13 +184,15 @@ export class ObligationLiquidity {
124
184
  return {
125
185
  borrowReserve: this.borrowReserve,
126
186
  cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
127
- padding: this.padding.toString(),
187
+ firstBorrowedAtTimestamp: this.firstBorrowedAtTimestamp.toString(),
128
188
  borrowedAmountSf: this.borrowedAmountSf.toString(),
129
189
  marketValueSf: this.marketValueSf.toString(),
130
190
  borrowFactorAdjustedMarketValueSf:
131
191
  this.borrowFactorAdjustedMarketValueSf.toString(),
132
192
  borrowedAmountOutsideElevationGroups:
133
193
  this.borrowedAmountOutsideElevationGroups.toString(),
194
+ fixedTermBorrowRolloverConfig:
195
+ this.fixedTermBorrowRolloverConfig.toJSON(),
134
196
  padding2: this.padding2.map((item) => item.toString()),
135
197
  }
136
198
  }
@@ -141,7 +203,7 @@ export class ObligationLiquidity {
141
203
  cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(
142
204
  obj.cumulativeBorrowRateBsf
143
205
  ),
144
- padding: new BN(obj.padding),
206
+ firstBorrowedAtTimestamp: new BN(obj.firstBorrowedAtTimestamp),
145
207
  borrowedAmountSf: new BN(obj.borrowedAmountSf),
146
208
  marketValueSf: new BN(obj.marketValueSf),
147
209
  borrowFactorAdjustedMarketValueSf: new BN(
@@ -150,6 +212,10 @@ export class ObligationLiquidity {
150
212
  borrowedAmountOutsideElevationGroups: new BN(
151
213
  obj.borrowedAmountOutsideElevationGroups
152
214
  ),
215
+ fixedTermBorrowRolloverConfig:
216
+ types.FixedTermBorrowRolloverConfig.fromJSON(
217
+ obj.fixedTermBorrowRolloverConfig
218
+ ),
153
219
  padding2: obj.padding2.map((item) => new BN(item)),
154
220
  })
155
221
  }
@@ -77,7 +77,7 @@ export interface ObligationOrderFields {
77
77
  */
78
78
  opportunityType: number
79
79
  /**
80
- * Internal padding.
80
+ * Alignment padding.
81
81
  * The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
82
82
  * align with `u128`s.
83
83
  */
@@ -162,7 +162,7 @@ export interface ObligationOrderJSON {
162
162
  */
163
163
  opportunityType: number
164
164
  /**
165
- * Internal padding.
165
+ * Alignment padding.
166
166
  * The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
167
167
  * align with `u128`s.
168
168
  */
@@ -176,7 +176,7 @@ export interface ObligationOrderJSON {
176
176
 
177
177
  /**
178
178
  * A single obligation order.
179
- * See [Obligation::orders].
179
+ * See [Obligation::obligation_orders].
180
180
  */
181
181
  export class ObligationOrder {
182
182
  /**
@@ -251,7 +251,7 @@ export class ObligationOrder {
251
251
  */
252
252
  readonly opportunityType: number
253
253
  /**
254
- * Internal padding.
254
+ * Alignment padding.
255
255
  * The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
256
256
  * align with `u128`s.
257
257
  */
@@ -0,0 +1,91 @@
1
+ import { address, Address } from "@solana/kit" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
+ import { borshAddress } from "../utils"
6
+
7
+ export interface NoneJSON {
8
+ kind: "None"
9
+ }
10
+
11
+ export class None {
12
+ static readonly discriminator = 0
13
+ static readonly kind = "None"
14
+ readonly discriminator = 0
15
+ readonly kind = "None"
16
+
17
+ toJSON(): NoneJSON {
18
+ return {
19
+ kind: "None",
20
+ }
21
+ }
22
+
23
+ toEncodable() {
24
+ return {
25
+ None: {},
26
+ }
27
+ }
28
+ }
29
+
30
+ export interface KlendQueueAccountingHandlerOnKvaultJSON {
31
+ kind: "KlendQueueAccountingHandlerOnKvault"
32
+ }
33
+
34
+ export class KlendQueueAccountingHandlerOnKvault {
35
+ static readonly discriminator = 1
36
+ static readonly kind = "KlendQueueAccountingHandlerOnKvault"
37
+ readonly discriminator = 1
38
+ readonly kind = "KlendQueueAccountingHandlerOnKvault"
39
+
40
+ toJSON(): KlendQueueAccountingHandlerOnKvaultJSON {
41
+ return {
42
+ kind: "KlendQueueAccountingHandlerOnKvault",
43
+ }
44
+ }
45
+
46
+ toEncodable() {
47
+ return {
48
+ KlendQueueAccountingHandlerOnKvault: {},
49
+ }
50
+ }
51
+ }
52
+
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
+ export function fromDecoded(obj: any): types.ProgressCallbackTypeKind {
55
+ if (typeof obj !== "object") {
56
+ throw new Error("Invalid enum object")
57
+ }
58
+
59
+ if ("None" in obj) {
60
+ return new None()
61
+ }
62
+ if ("KlendQueueAccountingHandlerOnKvault" in obj) {
63
+ return new KlendQueueAccountingHandlerOnKvault()
64
+ }
65
+
66
+ throw new Error("Invalid enum object")
67
+ }
68
+
69
+ export function fromJSON(
70
+ obj: types.ProgressCallbackTypeJSON
71
+ ): types.ProgressCallbackTypeKind {
72
+ switch (obj.kind) {
73
+ case "None": {
74
+ return new None()
75
+ }
76
+ case "KlendQueueAccountingHandlerOnKvault": {
77
+ return new KlendQueueAccountingHandlerOnKvault()
78
+ }
79
+ }
80
+ }
81
+
82
+ export function layout(property?: string) {
83
+ const ret = borsh.rustEnum([
84
+ borsh.struct([], "None"),
85
+ borsh.struct([], "KlendQueueAccountingHandlerOnKvault"),
86
+ ])
87
+ if (property !== undefined) {
88
+ return ret.replicate(property)
89
+ }
90
+ return ret
91
+ }