@compass-labs/api-sdk 2.2.76 → 2.2.77-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/README.md +7 -3
  2. package/codeSamples_typescript.yaml +12 -0
  3. package/dist/commonjs/funcs/creditCreditLoop.d.ts +31 -0
  4. package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/creditCreditLoop.js +132 -0
  6. package/dist/commonjs/funcs/creditCreditLoop.js.map +1 -0
  7. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts +24 -0
  8. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
  9. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js +128 -0
  10. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js.map +1 -0
  11. package/dist/commonjs/lib/config.d.ts +2 -2
  12. package/dist/commonjs/lib/config.js +2 -2
  13. package/dist/commonjs/models/components/aavelooprequest.d.ts +16 -16
  14. package/dist/commonjs/models/components/aavelooprequest.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/aavelooprequest.js +17 -17
  16. package/dist/commonjs/models/components/aavelooprequest.js.map +1 -1
  17. package/dist/commonjs/models/components/accountsummary.d.ts +4 -0
  18. package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/accountsummary.js.map +1 -1
  20. package/dist/commonjs/models/components/collateralposition.d.ts +12 -0
  21. package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/collateralposition.js +4 -0
  23. package/dist/commonjs/models/components/collateralposition.js.map +1 -1
  24. package/dist/commonjs/models/components/createaccountrequest.d.ts +1 -0
  25. package/dist/commonjs/models/components/createaccountrequest.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/createaccountrequest.js +1 -0
  27. package/dist/commonjs/models/components/createaccountrequest.js.map +1 -1
  28. package/dist/commonjs/models/components/createcreditaccountrequest.d.ts +1 -0
  29. package/dist/commonjs/models/components/createcreditaccountrequest.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/createcreditaccountrequest.js +1 -0
  31. package/dist/commonjs/models/components/createcreditaccountrequest.js.map +1 -1
  32. package/dist/commonjs/models/components/creditborrowparams.d.ts +9 -0
  33. package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/creditborrowparams.js +2 -0
  35. package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
  36. package/dist/commonjs/models/components/creditborrowrequest.d.ts +9 -0
  37. package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/creditborrowrequest.js +2 -0
  39. package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
  40. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +4 -0
  41. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
  43. package/dist/commonjs/models/components/creditlooppreview.d.ts +45 -0
  44. package/dist/commonjs/models/components/creditlooppreview.d.ts.map +1 -0
  45. package/dist/commonjs/models/components/creditlooppreview.js +68 -0
  46. package/dist/commonjs/models/components/creditlooppreview.js.map +1 -0
  47. package/dist/commonjs/models/components/creditlooprequest.d.ts +125 -0
  48. package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/creditlooprequest.js +98 -0
  50. package/dist/commonjs/models/components/creditlooprequest.js.map +1 -0
  51. package/dist/commonjs/models/components/creditloopresponse.d.ts +27 -0
  52. package/dist/commonjs/models/components/creditloopresponse.d.ts.map +1 -0
  53. package/dist/commonjs/models/components/creditloopresponse.js +61 -0
  54. package/dist/commonjs/models/components/creditloopresponse.js.map +1 -0
  55. package/dist/commonjs/models/components/creditprotocol.d.ts +9 -0
  56. package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/creditprotocol.js +5 -0
  58. package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
  59. package/dist/commonjs/models/components/creditrepayparams.d.ts +9 -0
  60. package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
  61. package/dist/commonjs/models/components/creditrepayparams.js +2 -0
  62. package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
  63. package/dist/commonjs/models/components/creditrepayrequest.d.ts +9 -0
  64. package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
  65. package/dist/commonjs/models/components/creditrepayrequest.js +2 -0
  66. package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
  67. package/dist/commonjs/models/components/creditsupplyparams.d.ts +9 -0
  68. package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
  69. package/dist/commonjs/models/components/creditsupplyparams.js +2 -0
  70. package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
  71. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +9 -0
  72. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/creditwithdrawparams.js +2 -0
  74. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  75. package/dist/commonjs/models/components/debtposition.d.ts +12 -0
  76. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  77. package/dist/commonjs/models/components/debtposition.js +4 -0
  78. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  79. package/dist/commonjs/models/components/index.d.ts +6 -0
  80. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  81. package/dist/commonjs/models/components/index.js +6 -0
  82. package/dist/commonjs/models/components/index.js.map +1 -1
  83. package/dist/commonjs/models/components/looplegpreview.d.ts +24 -0
  84. package/dist/commonjs/models/components/looplegpreview.d.ts.map +1 -0
  85. package/dist/commonjs/models/components/looplegpreview.js +59 -0
  86. package/dist/commonjs/models/components/looplegpreview.js.map +1 -0
  87. package/dist/commonjs/models/components/morpholendingmarket.d.ts +80 -0
  88. package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +1 -0
  89. package/dist/commonjs/models/components/morpholendingmarket.js +82 -0
  90. package/dist/commonjs/models/components/morpholendingmarket.js.map +1 -0
  91. package/dist/commonjs/models/components/morphomarketsresponse.d.ts +21 -0
  92. package/dist/commonjs/models/components/morphomarketsresponse.d.ts.map +1 -0
  93. package/dist/commonjs/models/components/morphomarketsresponse.js +52 -0
  94. package/dist/commonjs/models/components/morphomarketsresponse.js.map +1 -0
  95. package/dist/commonjs/models/operations/index.d.ts +1 -0
  96. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  97. package/dist/commonjs/models/operations/index.js +1 -0
  98. package/dist/commonjs/models/operations/index.js.map +1 -1
  99. package/dist/commonjs/models/operations/v2creditbalances.d.ts +1 -0
  100. package/dist/commonjs/models/operations/v2creditbalances.d.ts.map +1 -1
  101. package/dist/commonjs/models/operations/v2creditbalances.js +1 -0
  102. package/dist/commonjs/models/operations/v2creditbalances.js.map +1 -1
  103. package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts +1 -0
  104. package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts.map +1 -1
  105. package/dist/commonjs/models/operations/v2crediteulermarkets.js +1 -0
  106. package/dist/commonjs/models/operations/v2crediteulermarkets.js.map +1 -1
  107. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +23 -0
  108. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
  109. package/dist/commonjs/models/operations/v2creditmorphomarkets.js +58 -0
  110. package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +1 -0
  111. package/dist/commonjs/models/operations/v2creditpositions.d.ts +1 -0
  112. package/dist/commonjs/models/operations/v2creditpositions.d.ts.map +1 -1
  113. package/dist/commonjs/models/operations/v2creditpositions.js +1 -0
  114. package/dist/commonjs/models/operations/v2creditpositions.js.map +1 -1
  115. package/dist/commonjs/models/operations/v2earnbalances.d.ts +1 -0
  116. package/dist/commonjs/models/operations/v2earnbalances.d.ts.map +1 -1
  117. package/dist/commonjs/models/operations/v2earnbalances.js +1 -0
  118. package/dist/commonjs/models/operations/v2earnbalances.js.map +1 -1
  119. package/dist/commonjs/models/operations/v2earnpositions.d.ts +1 -0
  120. package/dist/commonjs/models/operations/v2earnpositions.d.ts.map +1 -1
  121. package/dist/commonjs/models/operations/v2earnpositions.js +1 -0
  122. package/dist/commonjs/models/operations/v2earnpositions.js.map +1 -1
  123. package/dist/commonjs/sdk/credit.d.ts +32 -0
  124. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  125. package/dist/commonjs/sdk/credit.js +38 -0
  126. package/dist/commonjs/sdk/credit.js.map +1 -1
  127. package/dist/esm/funcs/creditCreditLoop.d.ts +31 -0
  128. package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -0
  129. package/dist/esm/funcs/creditCreditLoop.js +96 -0
  130. package/dist/esm/funcs/creditCreditLoop.js.map +1 -0
  131. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts +24 -0
  132. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
  133. package/dist/esm/funcs/creditCreditMorphoMarkets.js +92 -0
  134. package/dist/esm/funcs/creditCreditMorphoMarkets.js.map +1 -0
  135. package/dist/esm/lib/config.d.ts +2 -2
  136. package/dist/esm/lib/config.js +2 -2
  137. package/dist/esm/models/components/aavelooprequest.d.ts +16 -16
  138. package/dist/esm/models/components/aavelooprequest.d.ts.map +1 -1
  139. package/dist/esm/models/components/aavelooprequest.js +12 -12
  140. package/dist/esm/models/components/aavelooprequest.js.map +1 -1
  141. package/dist/esm/models/components/accountsummary.d.ts +4 -0
  142. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  143. package/dist/esm/models/components/accountsummary.js.map +1 -1
  144. package/dist/esm/models/components/collateralposition.d.ts +12 -0
  145. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  146. package/dist/esm/models/components/collateralposition.js +4 -0
  147. package/dist/esm/models/components/collateralposition.js.map +1 -1
  148. package/dist/esm/models/components/createaccountrequest.d.ts +1 -0
  149. package/dist/esm/models/components/createaccountrequest.d.ts.map +1 -1
  150. package/dist/esm/models/components/createaccountrequest.js +1 -0
  151. package/dist/esm/models/components/createaccountrequest.js.map +1 -1
  152. package/dist/esm/models/components/createcreditaccountrequest.d.ts +1 -0
  153. package/dist/esm/models/components/createcreditaccountrequest.d.ts.map +1 -1
  154. package/dist/esm/models/components/createcreditaccountrequest.js +1 -0
  155. package/dist/esm/models/components/createcreditaccountrequest.js.map +1 -1
  156. package/dist/esm/models/components/creditborrowparams.d.ts +9 -0
  157. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  158. package/dist/esm/models/components/creditborrowparams.js +2 -0
  159. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  160. package/dist/esm/models/components/creditborrowrequest.d.ts +9 -0
  161. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  162. package/dist/esm/models/components/creditborrowrequest.js +2 -0
  163. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  164. package/dist/esm/models/components/creditenablecollateralparams.d.ts +4 -0
  165. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  166. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  167. package/dist/esm/models/components/creditlooppreview.d.ts +45 -0
  168. package/dist/esm/models/components/creditlooppreview.d.ts.map +1 -0
  169. package/dist/esm/models/components/creditlooppreview.js +31 -0
  170. package/dist/esm/models/components/creditlooppreview.js.map +1 -0
  171. package/dist/esm/models/components/creditlooprequest.d.ts +125 -0
  172. package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -0
  173. package/dist/esm/models/components/creditlooprequest.js +57 -0
  174. package/dist/esm/models/components/creditlooprequest.js.map +1 -0
  175. package/dist/esm/models/components/creditloopresponse.d.ts +27 -0
  176. package/dist/esm/models/components/creditloopresponse.d.ts.map +1 -0
  177. package/dist/esm/models/components/creditloopresponse.js +24 -0
  178. package/dist/esm/models/components/creditloopresponse.js.map +1 -0
  179. package/dist/esm/models/components/creditprotocol.d.ts +9 -0
  180. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  181. package/dist/esm/models/components/creditprotocol.js +5 -0
  182. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  183. package/dist/esm/models/components/creditrepayparams.d.ts +9 -0
  184. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  185. package/dist/esm/models/components/creditrepayparams.js +2 -0
  186. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  187. package/dist/esm/models/components/creditrepayrequest.d.ts +9 -0
  188. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  189. package/dist/esm/models/components/creditrepayrequest.js +2 -0
  190. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  191. package/dist/esm/models/components/creditsupplyparams.d.ts +9 -0
  192. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  193. package/dist/esm/models/components/creditsupplyparams.js +2 -0
  194. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  195. package/dist/esm/models/components/creditwithdrawparams.d.ts +9 -0
  196. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  197. package/dist/esm/models/components/creditwithdrawparams.js +2 -0
  198. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  199. package/dist/esm/models/components/debtposition.d.ts +12 -0
  200. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  201. package/dist/esm/models/components/debtposition.js +4 -0
  202. package/dist/esm/models/components/debtposition.js.map +1 -1
  203. package/dist/esm/models/components/index.d.ts +6 -0
  204. package/dist/esm/models/components/index.d.ts.map +1 -1
  205. package/dist/esm/models/components/index.js +6 -0
  206. package/dist/esm/models/components/index.js.map +1 -1
  207. package/dist/esm/models/components/looplegpreview.d.ts +24 -0
  208. package/dist/esm/models/components/looplegpreview.d.ts.map +1 -0
  209. package/dist/esm/models/components/looplegpreview.js +22 -0
  210. package/dist/esm/models/components/looplegpreview.js.map +1 -0
  211. package/dist/esm/models/components/morpholendingmarket.d.ts +80 -0
  212. package/dist/esm/models/components/morpholendingmarket.d.ts.map +1 -0
  213. package/dist/esm/models/components/morpholendingmarket.js +45 -0
  214. package/dist/esm/models/components/morpholendingmarket.js.map +1 -0
  215. package/dist/esm/models/components/morphomarketsresponse.d.ts +21 -0
  216. package/dist/esm/models/components/morphomarketsresponse.d.ts.map +1 -0
  217. package/dist/esm/models/components/morphomarketsresponse.js +15 -0
  218. package/dist/esm/models/components/morphomarketsresponse.js.map +1 -0
  219. package/dist/esm/models/operations/index.d.ts +1 -0
  220. package/dist/esm/models/operations/index.d.ts.map +1 -1
  221. package/dist/esm/models/operations/index.js +1 -0
  222. package/dist/esm/models/operations/index.js.map +1 -1
  223. package/dist/esm/models/operations/v2creditbalances.d.ts +1 -0
  224. package/dist/esm/models/operations/v2creditbalances.d.ts.map +1 -1
  225. package/dist/esm/models/operations/v2creditbalances.js +1 -0
  226. package/dist/esm/models/operations/v2creditbalances.js.map +1 -1
  227. package/dist/esm/models/operations/v2crediteulermarkets.d.ts +1 -0
  228. package/dist/esm/models/operations/v2crediteulermarkets.d.ts.map +1 -1
  229. package/dist/esm/models/operations/v2crediteulermarkets.js +1 -0
  230. package/dist/esm/models/operations/v2crediteulermarkets.js.map +1 -1
  231. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +23 -0
  232. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
  233. package/dist/esm/models/operations/v2creditmorphomarkets.js +21 -0
  234. package/dist/esm/models/operations/v2creditmorphomarkets.js.map +1 -0
  235. package/dist/esm/models/operations/v2creditpositions.d.ts +1 -0
  236. package/dist/esm/models/operations/v2creditpositions.d.ts.map +1 -1
  237. package/dist/esm/models/operations/v2creditpositions.js +1 -0
  238. package/dist/esm/models/operations/v2creditpositions.js.map +1 -1
  239. package/dist/esm/models/operations/v2earnbalances.d.ts +1 -0
  240. package/dist/esm/models/operations/v2earnbalances.d.ts.map +1 -1
  241. package/dist/esm/models/operations/v2earnbalances.js +1 -0
  242. package/dist/esm/models/operations/v2earnbalances.js.map +1 -1
  243. package/dist/esm/models/operations/v2earnpositions.d.ts +1 -0
  244. package/dist/esm/models/operations/v2earnpositions.d.ts.map +1 -1
  245. package/dist/esm/models/operations/v2earnpositions.js +1 -0
  246. package/dist/esm/models/operations/v2earnpositions.js.map +1 -1
  247. package/dist/esm/sdk/credit.d.ts +32 -0
  248. package/dist/esm/sdk/credit.d.ts.map +1 -1
  249. package/dist/esm/sdk/credit.js +38 -0
  250. package/dist/esm/sdk/credit.js.map +1 -1
  251. package/docs/models/components/aavelooprequest.md +4 -4
  252. package/docs/models/components/{initialcollateralamount.md → aavelooprequestinitialcollateralamount.md} +1 -1
  253. package/docs/models/components/{loantovalue.md → aavelooprequestloantovalue.md} +1 -1
  254. package/docs/models/components/{maxslippagepercent.md → aavelooprequestmaxslippagepercent.md} +1 -1
  255. package/docs/models/components/{multiplier.md → aavelooprequestmultiplier.md} +1 -1
  256. package/docs/models/components/accountsummary.md +10 -10
  257. package/docs/models/components/collateralposition.md +16 -14
  258. package/docs/models/components/createaccountrequestchain.md +1 -1
  259. package/docs/models/components/createcreditaccountrequestchain.md +1 -1
  260. package/docs/models/components/creditborrowparams.md +10 -9
  261. package/docs/models/components/creditborrowrequest.md +20 -19
  262. package/docs/models/components/creditenablecollateralparams.md +6 -6
  263. package/docs/models/components/creditlooppreview.md +33 -0
  264. package/docs/models/components/creditlooprequest.md +41 -0
  265. package/docs/models/components/creditlooprequestinitialcollateralamount.md +19 -0
  266. package/docs/models/components/creditlooprequestloantovalue.md +19 -0
  267. package/docs/models/components/creditlooprequestmaxslippagepercent.md +19 -0
  268. package/docs/models/components/creditlooprequestmultiplier.md +19 -0
  269. package/docs/models/components/creditloopresponse.md +30 -0
  270. package/docs/models/components/creditprotocol.md +5 -1
  271. package/docs/models/components/creditrepayparams.md +9 -8
  272. package/docs/models/components/creditrepayrequest.md +19 -18
  273. package/docs/models/components/creditsupplyparams.md +8 -7
  274. package/docs/models/components/creditwithdrawparams.md +8 -7
  275. package/docs/models/components/debtposition.md +15 -13
  276. package/docs/models/components/looplegpreview.md +21 -0
  277. package/docs/models/components/morpholendingmarket.md +49 -0
  278. package/docs/models/components/morphomarketsresponse.md +21 -0
  279. package/docs/models/operations/v2creditbalanceschain.md +1 -1
  280. package/docs/models/operations/v2crediteulermarketschain.md +1 -1
  281. package/docs/models/operations/v2creditmorphomarketschain.md +15 -0
  282. package/docs/models/operations/v2creditmorphomarketsrequest.md +17 -0
  283. package/docs/models/operations/v2creditpositionschain.md +1 -1
  284. package/docs/models/operations/v2earnbalanceschain.md +1 -1
  285. package/docs/models/operations/v2earnpositionschain.md +1 -1
  286. package/docs/sdks/credit/README.md +186 -0
  287. package/openapi_prepped_for_speakeasy.json +666 -2
  288. package/package.json +1 -1
  289. package/src/funcs/creditCreditLoop.ts +184 -0
  290. package/src/funcs/creditCreditMorphoMarkets.ts +182 -0
  291. package/src/lib/config.ts +2 -2
  292. package/src/models/components/aavelooprequest.ts +43 -30
  293. package/src/models/components/accountsummary.ts +4 -0
  294. package/src/models/components/collateralposition.ts +16 -0
  295. package/src/models/components/createaccountrequest.ts +1 -0
  296. package/src/models/components/createcreditaccountrequest.ts +1 -0
  297. package/src/models/components/creditborrowparams.ts +11 -0
  298. package/src/models/components/creditborrowrequest.ts +11 -0
  299. package/src/models/components/creditenablecollateralparams.ts +4 -0
  300. package/src/models/components/creditlooppreview.ts +86 -0
  301. package/src/models/components/creditlooprequest.ts +235 -0
  302. package/src/models/components/creditloopresponse.ts +65 -0
  303. package/src/models/components/creditprotocol.ts +9 -0
  304. package/src/models/components/creditrepayparams.ts +11 -0
  305. package/src/models/components/creditrepayrequest.ts +11 -0
  306. package/src/models/components/creditsupplyparams.ts +11 -0
  307. package/src/models/components/creditwithdrawparams.ts +11 -0
  308. package/src/models/components/debtposition.ts +16 -0
  309. package/src/models/components/index.ts +6 -0
  310. package/src/models/components/looplegpreview.ts +54 -0
  311. package/src/models/components/morpholendingmarket.ts +133 -0
  312. package/src/models/components/morphomarketsresponse.ts +46 -0
  313. package/src/models/operations/index.ts +1 -0
  314. package/src/models/operations/v2creditbalances.ts +1 -0
  315. package/src/models/operations/v2crediteulermarkets.ts +1 -0
  316. package/src/models/operations/v2creditmorphomarkets.ts +50 -0
  317. package/src/models/operations/v2creditpositions.ts +1 -0
  318. package/src/models/operations/v2earnbalances.ts +1 -0
  319. package/src/models/operations/v2earnpositions.ts +1 -0
  320. package/src/sdk/credit.ts +54 -0
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * One planned loop iteration.
13
+ */
14
+ export type LoopLegPreview = {
15
+ /**
16
+ * Collateral supplied this iteration (token units).
17
+ */
18
+ supplyAmount: string | null;
19
+ /**
20
+ * Loan borrowed this iteration; null on the final supply-only iteration.
21
+ */
22
+ borrowAmount?: string | null | undefined;
23
+ /**
24
+ * Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return.
25
+ */
26
+ minSwapOut?: string | null | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export const LoopLegPreview$inboundSchema: z.ZodType<
31
+ LoopLegPreview,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ supply_amount: z.nullable(z.string()),
36
+ borrow_amount: z.nullable(z.string()).optional(),
37
+ min_swap_out: z.nullable(z.string()).optional(),
38
+ }).transform((v) => {
39
+ return remap$(v, {
40
+ "supply_amount": "supplyAmount",
41
+ "borrow_amount": "borrowAmount",
42
+ "min_swap_out": "minSwapOut",
43
+ });
44
+ });
45
+
46
+ export function loopLegPreviewFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<LoopLegPreview, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) => LoopLegPreview$inboundSchema.parse(JSON.parse(x)),
52
+ `Failed to parse 'LoopLegPreview' from JSON`,
53
+ );
54
+ }
@@ -0,0 +1,133 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * A Morpho Blue lending market: one isolated (collateral, loan) pair.
13
+ */
14
+ export type MorphoLendingMarket = {
15
+ /**
16
+ * Morpho Blue market id — the bytes32 keccak of the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Pass this to the Morpho credit actions to identify the market.
17
+ */
18
+ marketId: string;
19
+ /**
20
+ * Token that is supplied and borrowed in this market.
21
+ */
22
+ loanToken: string;
23
+ /**
24
+ * Symbol of the loan token (e.g. USDC).
25
+ */
26
+ loanTokenSymbol: string;
27
+ /**
28
+ * Decimals of the loan token.
29
+ */
30
+ loanTokenDecimals: number;
31
+ /**
32
+ * Token accepted as collateral in this market.
33
+ */
34
+ collateralToken: string;
35
+ /**
36
+ * Symbol of the collateral token (e.g. wstETH).
37
+ */
38
+ collateralTokenSymbol: string;
39
+ /**
40
+ * Decimals of the collateral token.
41
+ */
42
+ collateralTokenDecimals: number;
43
+ /**
44
+ * Oracle pricing the collateral in loan-token terms for this market.
45
+ */
46
+ oracle: string;
47
+ /**
48
+ * Interest rate model contract of this market.
49
+ */
50
+ irm: string;
51
+ /**
52
+ * Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value).
53
+ */
54
+ lltv: string;
55
+ /**
56
+ * Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable.
57
+ */
58
+ supplyApy?: string | null | undefined;
59
+ /**
60
+ * Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable.
61
+ */
62
+ borrowApy?: string | null | undefined;
63
+ /**
64
+ * Borrowed share of supplied assets, in percentage 0-100.
65
+ */
66
+ utilization: string;
67
+ /**
68
+ * Total loan tokens supplied to the market, in token units.
69
+ */
70
+ totalSupplyAssets: string;
71
+ /**
72
+ * Total loan tokens borrowed from the market, in token units.
73
+ */
74
+ totalBorrowAssets: string;
75
+ /**
76
+ * Loan tokens available to borrow or withdraw (supplied - borrowed), in token units.
77
+ */
78
+ availableLiquidity: string;
79
+ /**
80
+ * Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee).
81
+ */
82
+ fee: string;
83
+ };
84
+
85
+ /** @internal */
86
+ export const MorphoLendingMarket$inboundSchema: z.ZodType<
87
+ MorphoLendingMarket,
88
+ z.ZodTypeDef,
89
+ unknown
90
+ > = z.object({
91
+ market_id: z.string(),
92
+ loan_token: z.string(),
93
+ loan_token_symbol: z.string(),
94
+ loan_token_decimals: z.number().int(),
95
+ collateral_token: z.string(),
96
+ collateral_token_symbol: z.string(),
97
+ collateral_token_decimals: z.number().int(),
98
+ oracle: z.string(),
99
+ irm: z.string(),
100
+ lltv: z.string(),
101
+ supply_apy: z.nullable(z.string()).optional(),
102
+ borrow_apy: z.nullable(z.string()).optional(),
103
+ utilization: z.string(),
104
+ total_supply_assets: z.string(),
105
+ total_borrow_assets: z.string(),
106
+ available_liquidity: z.string(),
107
+ fee: z.string(),
108
+ }).transform((v) => {
109
+ return remap$(v, {
110
+ "market_id": "marketId",
111
+ "loan_token": "loanToken",
112
+ "loan_token_symbol": "loanTokenSymbol",
113
+ "loan_token_decimals": "loanTokenDecimals",
114
+ "collateral_token": "collateralToken",
115
+ "collateral_token_symbol": "collateralTokenSymbol",
116
+ "collateral_token_decimals": "collateralTokenDecimals",
117
+ "supply_apy": "supplyApy",
118
+ "borrow_apy": "borrowApy",
119
+ "total_supply_assets": "totalSupplyAssets",
120
+ "total_borrow_assets": "totalBorrowAssets",
121
+ "available_liquidity": "availableLiquidity",
122
+ });
123
+ });
124
+
125
+ export function morphoLendingMarketFromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<MorphoLendingMarket, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => MorphoLendingMarket$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'MorphoLendingMarket' from JSON`,
132
+ );
133
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ MorphoLendingMarket,
11
+ MorphoLendingMarket$inboundSchema,
12
+ } from "./morpholendingmarket.js";
13
+
14
+ /**
15
+ * Curated Morpho Blue lending markets, read on-chain per request.
16
+ */
17
+ export type MorphoMarketsResponse = {
18
+ /**
19
+ * Morpho Blue singleton contract the markets were read from.
20
+ */
21
+ morpho: string;
22
+ /**
23
+ * Curated lending markets with live LLTV, APYs, utilization, and liquidity.
24
+ */
25
+ markets?: Array<MorphoLendingMarket> | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const MorphoMarketsResponse$inboundSchema: z.ZodType<
30
+ MorphoMarketsResponse,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ morpho: z.string(),
35
+ markets: z.array(MorphoLendingMarket$inboundSchema).optional(),
36
+ });
37
+
38
+ export function morphoMarketsResponseFromJSON(
39
+ jsonString: string,
40
+ ): SafeParseResult<MorphoMarketsResponse, SDKValidationError> {
41
+ return safeParse(
42
+ jsonString,
43
+ (x) => MorphoMarketsResponse$inboundSchema.parse(JSON.parse(x)),
44
+ `Failed to parse 'MorphoMarketsResponse' from JSON`,
45
+ );
46
+ }
@@ -43,6 +43,7 @@ export * from "./v1wildcatmarket.js";
43
43
  export * from "./v2cctpmint.js";
44
44
  export * from "./v2creditbalances.js";
45
45
  export * from "./v2crediteulermarkets.js";
46
+ export * from "./v2creditmorphomarkets.js";
46
47
  export * from "./v2creditpositions.js";
47
48
  export * from "./v2earnaavemarkets.js";
48
49
  export * from "./v2earnbalances.js";
@@ -8,6 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
8
8
  export const V2CreditBalancesChain = {
9
9
  Arbitrum: "arbitrum",
10
10
  Base: "base",
11
+ Bsc: "bsc",
11
12
  Ethereum: "ethereum",
12
13
  Tempo: "tempo",
13
14
  } as const;
@@ -8,6 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
8
8
  export const V2CreditEulerMarketsChain = {
9
9
  Arbitrum: "arbitrum",
10
10
  Base: "base",
11
+ Bsc: "bsc",
11
12
  Ethereum: "ethereum",
12
13
  Tempo: "tempo",
13
14
  } as const;
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const V2CreditMorphoMarketsChain = {
9
+ Arbitrum: "arbitrum",
10
+ Base: "base",
11
+ Bsc: "bsc",
12
+ Ethereum: "ethereum",
13
+ Tempo: "tempo",
14
+ } as const;
15
+ export type V2CreditMorphoMarketsChain = ClosedEnum<
16
+ typeof V2CreditMorphoMarketsChain
17
+ >;
18
+
19
+ export type V2CreditMorphoMarketsRequest = {
20
+ chain: V2CreditMorphoMarketsChain;
21
+ };
22
+
23
+ /** @internal */
24
+ export const V2CreditMorphoMarketsChain$outboundSchema: z.ZodNativeEnum<
25
+ typeof V2CreditMorphoMarketsChain
26
+ > = z.nativeEnum(V2CreditMorphoMarketsChain);
27
+
28
+ /** @internal */
29
+ export type V2CreditMorphoMarketsRequest$Outbound = {
30
+ chain: string;
31
+ };
32
+
33
+ /** @internal */
34
+ export const V2CreditMorphoMarketsRequest$outboundSchema: z.ZodType<
35
+ V2CreditMorphoMarketsRequest$Outbound,
36
+ z.ZodTypeDef,
37
+ V2CreditMorphoMarketsRequest
38
+ > = z.object({
39
+ chain: V2CreditMorphoMarketsChain$outboundSchema,
40
+ });
41
+
42
+ export function v2CreditMorphoMarketsRequestToJSON(
43
+ v2CreditMorphoMarketsRequest: V2CreditMorphoMarketsRequest,
44
+ ): string {
45
+ return JSON.stringify(
46
+ V2CreditMorphoMarketsRequest$outboundSchema.parse(
47
+ v2CreditMorphoMarketsRequest,
48
+ ),
49
+ );
50
+ }
@@ -8,6 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
8
8
  export const V2CreditPositionsChain = {
9
9
  Arbitrum: "arbitrum",
10
10
  Base: "base",
11
+ Bsc: "bsc",
11
12
  Ethereum: "ethereum",
12
13
  Tempo: "tempo",
13
14
  } as const;
@@ -8,6 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
8
8
  export const V2EarnBalancesChain = {
9
9
  Arbitrum: "arbitrum",
10
10
  Base: "base",
11
+ Bsc: "bsc",
11
12
  Ethereum: "ethereum",
12
13
  Tempo: "tempo",
13
14
  } as const;
@@ -8,6 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
8
8
  export const V2EarnPositionsChain = {
9
9
  Arbitrum: "arbitrum",
10
10
  Base: "base",
11
+ Bsc: "bsc",
11
12
  Ethereum: "ethereum",
12
13
  Tempo: "tempo",
13
14
  } as const;
package/src/sdk/credit.ts CHANGED
@@ -7,6 +7,8 @@ import { creditCreditBorrow } from "../funcs/creditCreditBorrow.js";
7
7
  import { creditCreditBundle } from "../funcs/creditCreditBundle.js";
8
8
  import { creditCreditCreateAccount } from "../funcs/creditCreditCreateAccount.js";
9
9
  import { creditCreditEulerMarkets } from "../funcs/creditCreditEulerMarkets.js";
10
+ import { creditCreditLoop } from "../funcs/creditCreditLoop.js";
11
+ import { creditCreditMorphoMarkets } from "../funcs/creditCreditMorphoMarkets.js";
10
12
  import { creditCreditPositions } from "../funcs/creditCreditPositions.js";
11
13
  import { creditCreditRepay } from "../funcs/creditCreditRepay.js";
12
14
  import { creditCreditTransfer } from "../funcs/creditCreditTransfer.js";
@@ -78,6 +80,28 @@ export class Credit extends ClientSDK {
78
80
  ));
79
81
  }
80
82
 
83
+ /**
84
+ * List curated Morpho markets
85
+ *
86
+ * @remarks
87
+ * List curated Morpho Blue lending markets for a chain.
88
+ *
89
+ * Morpho Blue is permissionless, so credit actions identify a market by its
90
+ * bytes32 market id. This returns the curated market set with live LLTV,
91
+ * supply/borrow APY, utilization, and available liquidity -- read on-chain per
92
+ * request -- so callers know which market_id to use and what it currently costs.
93
+ */
94
+ async creditMorphoMarkets(
95
+ request: operations.V2CreditMorphoMarketsRequest,
96
+ options?: RequestOptions,
97
+ ): Promise<components.MorphoMarketsResponse> {
98
+ return unwrapAsync(creditCreditMorphoMarkets(
99
+ this,
100
+ request,
101
+ options,
102
+ ));
103
+ }
104
+
81
105
  /**
82
106
  * Create credit account
83
107
  *
@@ -127,6 +151,36 @@ export class Credit extends ClientSDK {
127
151
  ));
128
152
  }
129
153
 
154
+ /**
155
+ * Open a leveraged loop
156
+ *
157
+ * @remarks
158
+ * Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
159
+ *
160
+ * Repeatedly supplies collateral, borrows at the requested loan-to-value, and
161
+ * swaps the borrow back to collateral. Each iteration's supply uses the swap's
162
+ * GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the
163
+ * slippage tolerance can never break a later step; any positive surplus stays
164
+ * in the Credit Account (the preview reports the bound as estimated_max_dust).
165
+ * Very large loops relative to pool depth can still exceed the slippage
166
+ * tolerance through their own cumulative price impact — size accordingly or
167
+ * raise max_slippage_percent.
168
+ *
169
+ * The Credit Account must already hold initial_collateral_amount of
170
+ * collateral_token. For protocol=MORPHO pass a market_id from
171
+ * /v2/credit/morpho_markets.
172
+ */
173
+ async creditLoop(
174
+ request: components.CreditLoopRequest,
175
+ options?: RequestOptions,
176
+ ): Promise<components.CreditLoopResponse> {
177
+ return unwrapAsync(creditCreditLoop(
178
+ this,
179
+ request,
180
+ options,
181
+ ));
182
+ }
183
+
130
184
  /**
131
185
  * Transfer tokens to/from Credit Account
132
186
  *