@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.2.76",
3
+ "version": "2.2.77-rc.0",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -0,0 +1,184 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CompassApiSDKCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Open a leveraged loop
31
+ *
32
+ * @remarks
33
+ * Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
34
+ *
35
+ * Repeatedly supplies collateral, borrows at the requested loan-to-value, and
36
+ * swaps the borrow back to collateral. Each iteration's supply uses the swap's
37
+ * GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the
38
+ * slippage tolerance can never break a later step; any positive surplus stays
39
+ * in the Credit Account (the preview reports the bound as estimated_max_dust).
40
+ * Very large loops relative to pool depth can still exceed the slippage
41
+ * tolerance through their own cumulative price impact — size accordingly or
42
+ * raise max_slippage_percent.
43
+ *
44
+ * The Credit Account must already hold initial_collateral_amount of
45
+ * collateral_token. For protocol=MORPHO pass a market_id from
46
+ * /v2/credit/morpho_markets.
47
+ */
48
+ export function creditCreditLoop(
49
+ client: CompassApiSDKCore,
50
+ request: components.CreditLoopRequest,
51
+ options?: RequestOptions,
52
+ ): APIPromise<
53
+ Result<
54
+ components.CreditLoopResponse,
55
+ | errors.HTTPValidationError
56
+ | CompassAPISDKError
57
+ | ResponseValidationError
58
+ | ConnectionError
59
+ | RequestAbortedError
60
+ | RequestTimeoutError
61
+ | InvalidRequestError
62
+ | UnexpectedClientError
63
+ | SDKValidationError
64
+ >
65
+ > {
66
+ return new APIPromise($do(
67
+ client,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+
73
+ async function $do(
74
+ client: CompassApiSDKCore,
75
+ request: components.CreditLoopRequest,
76
+ options?: RequestOptions,
77
+ ): Promise<
78
+ [
79
+ Result<
80
+ components.CreditLoopResponse,
81
+ | errors.HTTPValidationError
82
+ | CompassAPISDKError
83
+ | ResponseValidationError
84
+ | ConnectionError
85
+ | RequestAbortedError
86
+ | RequestTimeoutError
87
+ | InvalidRequestError
88
+ | UnexpectedClientError
89
+ | SDKValidationError
90
+ >,
91
+ APICall,
92
+ ]
93
+ > {
94
+ const parsed = safeParse(
95
+ request,
96
+ (value) => components.CreditLoopRequest$outboundSchema.parse(value),
97
+ "Input validation failed",
98
+ );
99
+ if (!parsed.ok) {
100
+ return [parsed, { status: "invalid" }];
101
+ }
102
+ const payload = parsed.value;
103
+ const body = encodeJSON("body", payload, { explode: true });
104
+
105
+ const path = pathToFunc("/v2/credit/loop")();
106
+
107
+ const headers = new Headers(compactMap({
108
+ "Content-Type": "application/json",
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
113
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
114
+ const requestSecurity = resolveGlobalSecurity(securityInput);
115
+
116
+ const context = {
117
+ options: client._options,
118
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
119
+ operationID: "v2_credit_loop",
120
+ oAuth2Scopes: null,
121
+
122
+ resolvedSecurity: requestSecurity,
123
+
124
+ securitySource: client._options.apiKeyAuth,
125
+ retryConfig: options?.retries
126
+ || client._options.retryConfig
127
+ || { strategy: "none" },
128
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
+ };
130
+
131
+ const requestRes = client._createRequest(context, {
132
+ security: requestSecurity,
133
+ method: "POST",
134
+ baseURL: options?.serverURL,
135
+ path: path,
136
+ headers: headers,
137
+ body: body,
138
+ userAgent: client._options.userAgent,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ isErrorStatusCode: (statusCode: number) =>
149
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
150
+ retryConfig: context.retryConfig,
151
+ retryCodes: context.retryCodes,
152
+ });
153
+ if (!doResult.ok) {
154
+ return [doResult, { status: "request-error", request: req }];
155
+ }
156
+ const response = doResult.value;
157
+
158
+ const responseFields = {
159
+ HttpMeta: { Response: response, Request: req },
160
+ };
161
+
162
+ const [result] = await M.match<
163
+ components.CreditLoopResponse,
164
+ | errors.HTTPValidationError
165
+ | CompassAPISDKError
166
+ | ResponseValidationError
167
+ | ConnectionError
168
+ | RequestAbortedError
169
+ | RequestTimeoutError
170
+ | InvalidRequestError
171
+ | UnexpectedClientError
172
+ | SDKValidationError
173
+ >(
174
+ M.json(200, components.CreditLoopResponse$inboundSchema),
175
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
176
+ M.fail("4XX"),
177
+ M.fail("5XX"),
178
+ )(response, req, { extraFields: responseFields });
179
+ if (!result.ok) {
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
182
+
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CompassApiSDKCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * List curated Morpho markets
32
+ *
33
+ * @remarks
34
+ * List curated Morpho Blue lending markets for a chain.
35
+ *
36
+ * Morpho Blue is permissionless, so credit actions identify a market by its
37
+ * bytes32 market id. This returns the curated market set with live LLTV,
38
+ * supply/borrow APY, utilization, and available liquidity -- read on-chain per
39
+ * request -- so callers know which market_id to use and what it currently costs.
40
+ */
41
+ export function creditCreditMorphoMarkets(
42
+ client: CompassApiSDKCore,
43
+ request: operations.V2CreditMorphoMarketsRequest,
44
+ options?: RequestOptions,
45
+ ): APIPromise<
46
+ Result<
47
+ components.MorphoMarketsResponse,
48
+ | errors.HTTPValidationError
49
+ | CompassAPISDKError
50
+ | ResponseValidationError
51
+ | ConnectionError
52
+ | RequestAbortedError
53
+ | RequestTimeoutError
54
+ | InvalidRequestError
55
+ | UnexpectedClientError
56
+ | SDKValidationError
57
+ >
58
+ > {
59
+ return new APIPromise($do(
60
+ client,
61
+ request,
62
+ options,
63
+ ));
64
+ }
65
+
66
+ async function $do(
67
+ client: CompassApiSDKCore,
68
+ request: operations.V2CreditMorphoMarketsRequest,
69
+ options?: RequestOptions,
70
+ ): Promise<
71
+ [
72
+ Result<
73
+ components.MorphoMarketsResponse,
74
+ | errors.HTTPValidationError
75
+ | CompassAPISDKError
76
+ | ResponseValidationError
77
+ | ConnectionError
78
+ | RequestAbortedError
79
+ | RequestTimeoutError
80
+ | InvalidRequestError
81
+ | UnexpectedClientError
82
+ | SDKValidationError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const parsed = safeParse(
88
+ request,
89
+ (value) =>
90
+ operations.V2CreditMorphoMarketsRequest$outboundSchema.parse(value),
91
+ "Input validation failed",
92
+ );
93
+ if (!parsed.ok) {
94
+ return [parsed, { status: "invalid" }];
95
+ }
96
+ const payload = parsed.value;
97
+ const body = null;
98
+
99
+ const path = pathToFunc("/v2/credit/morpho_markets")();
100
+
101
+ const query = encodeFormQuery({
102
+ "chain": payload.chain,
103
+ });
104
+
105
+ const headers = new Headers(compactMap({
106
+ Accept: "application/json",
107
+ }));
108
+
109
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
110
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
111
+ const requestSecurity = resolveGlobalSecurity(securityInput);
112
+
113
+ const context = {
114
+ options: client._options,
115
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
116
+ operationID: "v2_credit_morpho_markets",
117
+ oAuth2Scopes: null,
118
+
119
+ resolvedSecurity: requestSecurity,
120
+
121
+ securitySource: client._options.apiKeyAuth,
122
+ retryConfig: options?.retries
123
+ || client._options.retryConfig
124
+ || { strategy: "none" },
125
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
126
+ };
127
+
128
+ const requestRes = client._createRequest(context, {
129
+ security: requestSecurity,
130
+ method: "GET",
131
+ baseURL: options?.serverURL,
132
+ path: path,
133
+ headers: headers,
134
+ query: query,
135
+ body: body,
136
+ userAgent: client._options.userAgent,
137
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
+ }, options);
139
+ if (!requestRes.ok) {
140
+ return [requestRes, { status: "invalid" }];
141
+ }
142
+ const req = requestRes.value;
143
+
144
+ const doResult = await client._do(req, {
145
+ context,
146
+ isErrorStatusCode: (statusCode: number) =>
147
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
148
+ retryConfig: context.retryConfig,
149
+ retryCodes: context.retryCodes,
150
+ });
151
+ if (!doResult.ok) {
152
+ return [doResult, { status: "request-error", request: req }];
153
+ }
154
+ const response = doResult.value;
155
+
156
+ const responseFields = {
157
+ HttpMeta: { Response: response, Request: req },
158
+ };
159
+
160
+ const [result] = await M.match<
161
+ components.MorphoMarketsResponse,
162
+ | errors.HTTPValidationError
163
+ | CompassAPISDKError
164
+ | ResponseValidationError
165
+ | ConnectionError
166
+ | RequestAbortedError
167
+ | RequestTimeoutError
168
+ | InvalidRequestError
169
+ | UnexpectedClientError
170
+ | SDKValidationError
171
+ >(
172
+ M.json(200, components.MorphoMarketsResponse$inboundSchema),
173
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
174
+ M.fail("4XX"),
175
+ M.fail("5XX"),
176
+ )(response, req, { extraFields: responseFields });
177
+ if (!result.ok) {
178
+ return [result, { status: "complete", request: req, response }];
179
+ }
180
+
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.914.0",
65
+ genVersion: "2.915.0",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.914.0 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.915.0 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -21,22 +21,22 @@ export type AaveLoopRequestChain = ClosedEnum<typeof AaveLoopRequestChain>;
21
21
  /**
22
22
  * Amount of collateral token to supply to Aave
23
23
  */
24
- export type InitialCollateralAmount = number | string;
24
+ export type AaveLoopRequestInitialCollateralAmount = number | string;
25
25
 
26
26
  /**
27
27
  * Leverage multiplier. Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`
28
28
  */
29
- export type Multiplier = number | string;
29
+ export type AaveLoopRequestMultiplier = number | string;
30
30
 
31
31
  /**
32
32
  * Maximum allowed slippage for token swaps in percentage
33
33
  */
34
- export type MaxSlippagePercent = number | string;
34
+ export type AaveLoopRequestMaxSlippagePercent = number | string;
35
35
 
36
36
  /**
37
37
  * Loan To Value percentage of the loop
38
38
  */
39
- export type LoanToValue = number | string;
39
+ export type AaveLoopRequestLoanToValue = number | string;
40
40
 
41
41
  /**
42
42
  * Request model for executing an Aave loop strategy.
@@ -99,67 +99,80 @@ export const AaveLoopRequestChain$outboundSchema: z.ZodNativeEnum<
99
99
  > = z.nativeEnum(AaveLoopRequestChain);
100
100
 
101
101
  /** @internal */
102
- export type InitialCollateralAmount$Outbound = number | string;
102
+ export type AaveLoopRequestInitialCollateralAmount$Outbound = number | string;
103
103
 
104
104
  /** @internal */
105
- export const InitialCollateralAmount$outboundSchema: z.ZodType<
106
- InitialCollateralAmount$Outbound,
105
+ export const AaveLoopRequestInitialCollateralAmount$outboundSchema: z.ZodType<
106
+ AaveLoopRequestInitialCollateralAmount$Outbound,
107
107
  z.ZodTypeDef,
108
- InitialCollateralAmount
108
+ AaveLoopRequestInitialCollateralAmount
109
109
  > = z.union([z.number(), z.string()]);
110
110
 
111
- export function initialCollateralAmountToJSON(
112
- initialCollateralAmount: InitialCollateralAmount,
111
+ export function aaveLoopRequestInitialCollateralAmountToJSON(
112
+ aaveLoopRequestInitialCollateralAmount:
113
+ AaveLoopRequestInitialCollateralAmount,
113
114
  ): string {
114
115
  return JSON.stringify(
115
- InitialCollateralAmount$outboundSchema.parse(initialCollateralAmount),
116
+ AaveLoopRequestInitialCollateralAmount$outboundSchema.parse(
117
+ aaveLoopRequestInitialCollateralAmount,
118
+ ),
116
119
  );
117
120
  }
118
121
 
119
122
  /** @internal */
120
- export type Multiplier$Outbound = number | string;
123
+ export type AaveLoopRequestMultiplier$Outbound = number | string;
121
124
 
122
125
  /** @internal */
123
- export const Multiplier$outboundSchema: z.ZodType<
124
- Multiplier$Outbound,
126
+ export const AaveLoopRequestMultiplier$outboundSchema: z.ZodType<
127
+ AaveLoopRequestMultiplier$Outbound,
125
128
  z.ZodTypeDef,
126
- Multiplier
129
+ AaveLoopRequestMultiplier
127
130
  > = z.union([z.number(), z.string()]);
128
131
 
129
- export function multiplierToJSON(multiplier: Multiplier): string {
130
- return JSON.stringify(Multiplier$outboundSchema.parse(multiplier));
132
+ export function aaveLoopRequestMultiplierToJSON(
133
+ aaveLoopRequestMultiplier: AaveLoopRequestMultiplier,
134
+ ): string {
135
+ return JSON.stringify(
136
+ AaveLoopRequestMultiplier$outboundSchema.parse(aaveLoopRequestMultiplier),
137
+ );
131
138
  }
132
139
 
133
140
  /** @internal */
134
- export type MaxSlippagePercent$Outbound = number | string;
141
+ export type AaveLoopRequestMaxSlippagePercent$Outbound = number | string;
135
142
 
136
143
  /** @internal */
137
- export const MaxSlippagePercent$outboundSchema: z.ZodType<
138
- MaxSlippagePercent$Outbound,
144
+ export const AaveLoopRequestMaxSlippagePercent$outboundSchema: z.ZodType<
145
+ AaveLoopRequestMaxSlippagePercent$Outbound,
139
146
  z.ZodTypeDef,
140
- MaxSlippagePercent
147
+ AaveLoopRequestMaxSlippagePercent
141
148
  > = z.union([z.number(), z.string()]);
142
149
 
143
- export function maxSlippagePercentToJSON(
144
- maxSlippagePercent: MaxSlippagePercent,
150
+ export function aaveLoopRequestMaxSlippagePercentToJSON(
151
+ aaveLoopRequestMaxSlippagePercent: AaveLoopRequestMaxSlippagePercent,
145
152
  ): string {
146
153
  return JSON.stringify(
147
- MaxSlippagePercent$outboundSchema.parse(maxSlippagePercent),
154
+ AaveLoopRequestMaxSlippagePercent$outboundSchema.parse(
155
+ aaveLoopRequestMaxSlippagePercent,
156
+ ),
148
157
  );
149
158
  }
150
159
 
151
160
  /** @internal */
152
- export type LoanToValue$Outbound = number | string;
161
+ export type AaveLoopRequestLoanToValue$Outbound = number | string;
153
162
 
154
163
  /** @internal */
155
- export const LoanToValue$outboundSchema: z.ZodType<
156
- LoanToValue$Outbound,
164
+ export const AaveLoopRequestLoanToValue$outboundSchema: z.ZodType<
165
+ AaveLoopRequestLoanToValue$Outbound,
157
166
  z.ZodTypeDef,
158
- LoanToValue
167
+ AaveLoopRequestLoanToValue
159
168
  > = z.union([z.number(), z.string()]);
160
169
 
161
- export function loanToValueToJSON(loanToValue: LoanToValue): string {
162
- return JSON.stringify(LoanToValue$outboundSchema.parse(loanToValue));
170
+ export function aaveLoopRequestLoanToValueToJSON(
171
+ aaveLoopRequestLoanToValue: AaveLoopRequestLoanToValue,
172
+ ): string {
173
+ return JSON.stringify(
174
+ AaveLoopRequestLoanToValue$outboundSchema.parse(aaveLoopRequestLoanToValue),
175
+ );
163
176
  }
164
177
 
165
178
  /** @internal */
@@ -30,6 +30,10 @@ export type AccountSummary = {
30
30
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
31
31
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
32
32
  * Euler V2 path, where the market is identified by EVK vault address(es).
33
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
34
+ * currently read-only: positions and market discovery only — transaction
35
+ * builders land with the looping work (COM-7106/7107/7108), so transact
36
+ * endpoints reject it with a 422.
33
37
  */
34
38
  protocol?: CreditProtocol | undefined;
35
39
  /**
@@ -33,12 +33,24 @@ export type CollateralPosition = {
33
33
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
34
34
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
35
35
  * Euler V2 path, where the market is identified by EVK vault address(es).
36
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
37
+ * currently read-only: positions and market discovery only — transaction
38
+ * builders land with the looping work (COM-7106/7107/7108), so transact
39
+ * endpoints reject it with a 422.
36
40
  */
37
41
  protocol?: CreditProtocol | undefined;
38
42
  /**
39
43
  * Euler only: the EVK collateral vault holding this position.
40
44
  */
41
45
  vault?: string | null | undefined;
46
+ /**
47
+ * Morpho only: the bytes32 id of the isolated market holding this position.
48
+ */
49
+ marketId?: string | null | undefined;
50
+ /**
51
+ * Morpho only: true when this is a loan-asset supply position (earning supply APY) rather than collateral backing borrows.
52
+ */
53
+ isPureSupply?: boolean | null | undefined;
42
54
  /**
43
55
  * Current on-chain collateral balance (the vault's underlying asset for Euler).
44
56
  */
@@ -83,6 +95,8 @@ export const CollateralPosition$inboundSchema: z.ZodType<
83
95
  symbol: z.string(),
84
96
  protocol: CreditProtocol$inboundSchema.optional(),
85
97
  vault: z.nullable(z.string()).optional(),
98
+ market_id: z.nullable(z.string()).optional(),
99
+ is_pure_supply: z.nullable(z.boolean()).optional(),
86
100
  amount_supplied: z.nullable(z.string()),
87
101
  usd_value: z.nullable(z.string()).optional(),
88
102
  supply_apy: z.nullable(z.string()).optional(),
@@ -93,6 +107,8 @@ export const CollateralPosition$inboundSchema: z.ZodType<
93
107
  events: z.array(CreditEvent$inboundSchema).optional(),
94
108
  }).transform((v) => {
95
109
  return remap$(v, {
110
+ "market_id": "marketId",
111
+ "is_pure_supply": "isPureSupply",
96
112
  "amount_supplied": "amountSupplied",
97
113
  "usd_value": "usdValue",
98
114
  "supply_apy": "supplyApy",
@@ -9,6 +9,7 @@ import { ClosedEnum } from "../../types/enums.js";
9
9
  export const CreateAccountRequestChain = {
10
10
  Arbitrum: "arbitrum",
11
11
  Base: "base",
12
+ Bsc: "bsc",
12
13
  Ethereum: "ethereum",
13
14
  Tempo: "tempo",
14
15
  } as const;
@@ -9,6 +9,7 @@ import { ClosedEnum } from "../../types/enums.js";
9
9
  export const CreateCreditAccountRequestChain = {
10
10
  Arbitrum: "arbitrum",
11
11
  Base: "base",
12
+ Bsc: "bsc",
12
13
  Ethereum: "ethereum",
13
14
  Tempo: "tempo",
14
15
  } as const;
@@ -56,12 +56,20 @@ export type CreditBorrowParams = {
56
56
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
57
57
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
58
58
  * Euler V2 path, where the market is identified by EVK vault address(es).
59
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
60
+ * currently read-only: positions and market discovery only — transaction
61
+ * builders land with the looping work (COM-7106/7107/7108), so transact
62
+ * endpoints reject it with a 422.
59
63
  */
60
64
  protocol?: CreditProtocol | undefined;
61
65
  /**
62
66
  * Euler only: the EVK vault to borrow from. Required when protocol=EULER.
63
67
  */
64
68
  borrowVault?: string | null | undefined;
69
+ /**
70
+ * Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
71
+ */
72
+ marketId?: string | null | undefined;
65
73
  };
66
74
 
67
75
  /** @internal */
@@ -91,6 +99,7 @@ export type CreditBorrowParams$Outbound = {
91
99
  fee?: CreditFee$Outbound | null | undefined;
92
100
  protocol?: string | undefined;
93
101
  borrow_vault?: string | null | undefined;
102
+ market_id?: string | null | undefined;
94
103
  };
95
104
 
96
105
  /** @internal */
@@ -106,11 +115,13 @@ export const CreditBorrowParams$outboundSchema: z.ZodType<
106
115
  fee: z.nullable(CreditFee$outboundSchema).optional(),
107
116
  protocol: CreditProtocol$outboundSchema.optional(),
108
117
  borrowVault: z.nullable(z.string()).optional(),
118
+ marketId: z.nullable(z.string()).optional(),
109
119
  }).transform((v) => {
110
120
  return remap$(v, {
111
121
  actionType: "action_type",
112
122
  interestRateMode: "interest_rate_mode",
113
123
  borrowVault: "borrow_vault",
124
+ marketId: "market_id",
114
125
  });
115
126
  });
116
127
 
@@ -51,6 +51,10 @@ export type CreditBorrowRequest = {
51
51
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
52
52
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
53
53
  * Euler V2 path, where the market is identified by EVK vault address(es).
54
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
55
+ * currently read-only: positions and market discovery only — transaction
56
+ * builders land with the looping work (COM-7106/7107/7108), so transact
57
+ * endpoints reject it with a 422.
54
58
  */
55
59
  protocol?: CreditProtocol | undefined;
56
60
  /**
@@ -61,6 +65,10 @@ export type CreditBorrowRequest = {
61
65
  * Euler only: the EVK vault to borrow from. Required when protocol=EULER.
62
66
  */
63
67
  borrowVault?: string | null | undefined;
68
+ /**
69
+ * Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
70
+ */
71
+ marketId?: string | null | undefined;
64
72
  /**
65
73
  * Token currently held in the Credit Account to use as input. If the same as collateral_token, no swap is performed. Omit together with amount_in and collateral_token to borrow against existing collateral.
66
74
  */
@@ -176,6 +184,7 @@ export type CreditBorrowRequest$Outbound = {
176
184
  protocol?: string | undefined;
177
185
  collateral_vault?: string | null | undefined;
178
186
  borrow_vault?: string | null | undefined;
187
+ market_id?: string | null | undefined;
179
188
  token_in?: string | null | undefined;
180
189
  amount_in?: number | string | null | undefined;
181
190
  collateral_token?: string | null | undefined;
@@ -201,6 +210,7 @@ export const CreditBorrowRequest$outboundSchema: z.ZodType<
201
210
  protocol: CreditProtocol$outboundSchema.optional(),
202
211
  collateralVault: z.nullable(z.string()).optional(),
203
212
  borrowVault: z.nullable(z.string()).optional(),
213
+ marketId: z.nullable(z.string()).optional(),
204
214
  tokenIn: z.nullable(z.string()).optional(),
205
215
  amountIn: z.nullable(z.union([z.number(), z.string()])).optional(),
206
216
  collateralToken: z.nullable(z.string()).optional(),
@@ -217,6 +227,7 @@ export const CreditBorrowRequest$outboundSchema: z.ZodType<
217
227
  return remap$(v, {
218
228
  collateralVault: "collateral_vault",
219
229
  borrowVault: "borrow_vault",
230
+ marketId: "market_id",
220
231
  tokenIn: "token_in",
221
232
  amountIn: "amount_in",
222
233
  collateralToken: "collateral_token",