@compass-labs/api-sdk 2.2.76-rc.3 → 2.2.76

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 (265) hide show
  1. package/README.md +3 -7
  2. package/codeSamples_typescript.yaml +0 -12
  3. package/dist/commonjs/models/components/aavelooprequest.d.ts +16 -16
  4. package/dist/commonjs/models/components/aavelooprequest.d.ts.map +1 -1
  5. package/dist/commonjs/models/components/aavelooprequest.js +17 -17
  6. package/dist/commonjs/models/components/aavelooprequest.js.map +1 -1
  7. package/dist/commonjs/models/components/accountsummary.d.ts +0 -4
  8. package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
  9. package/dist/commonjs/models/components/accountsummary.js.map +1 -1
  10. package/dist/commonjs/models/components/collateralposition.d.ts +0 -12
  11. package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
  12. package/dist/commonjs/models/components/collateralposition.js +0 -4
  13. package/dist/commonjs/models/components/collateralposition.js.map +1 -1
  14. package/dist/commonjs/models/components/creditborrowparams.d.ts +0 -9
  15. package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/creditborrowparams.js +0 -2
  17. package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
  18. package/dist/commonjs/models/components/creditborrowrequest.d.ts +0 -9
  19. package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/creditborrowrequest.js +0 -2
  21. package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
  22. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +0 -4
  23. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
  25. package/dist/commonjs/models/components/creditprotocol.d.ts +0 -9
  26. package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/creditprotocol.js +0 -5
  28. package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
  29. package/dist/commonjs/models/components/creditrepayparams.d.ts +0 -9
  30. package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/creditrepayparams.js +0 -2
  32. package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
  33. package/dist/commonjs/models/components/creditrepayrequest.d.ts +0 -9
  34. package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/creditrepayrequest.js +0 -2
  36. package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
  37. package/dist/commonjs/models/components/creditsupplyparams.d.ts +0 -9
  38. package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/creditsupplyparams.js +0 -2
  40. package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
  41. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +0 -9
  42. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  43. package/dist/commonjs/models/components/creditwithdrawparams.js +0 -2
  44. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  45. package/dist/commonjs/models/components/debtposition.d.ts +0 -12
  46. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  47. package/dist/commonjs/models/components/debtposition.js +0 -4
  48. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  49. package/dist/commonjs/models/components/index.d.ts +0 -6
  50. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  51. package/dist/commonjs/models/components/index.js +0 -6
  52. package/dist/commonjs/models/components/index.js.map +1 -1
  53. package/dist/commonjs/models/operations/index.d.ts +0 -1
  54. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  55. package/dist/commonjs/models/operations/index.js +0 -1
  56. package/dist/commonjs/models/operations/index.js.map +1 -1
  57. package/dist/commonjs/sdk/credit.d.ts +0 -32
  58. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  59. package/dist/commonjs/sdk/credit.js +0 -38
  60. package/dist/commonjs/sdk/credit.js.map +1 -1
  61. package/dist/esm/models/components/aavelooprequest.d.ts +16 -16
  62. package/dist/esm/models/components/aavelooprequest.d.ts.map +1 -1
  63. package/dist/esm/models/components/aavelooprequest.js +12 -12
  64. package/dist/esm/models/components/aavelooprequest.js.map +1 -1
  65. package/dist/esm/models/components/accountsummary.d.ts +0 -4
  66. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  67. package/dist/esm/models/components/accountsummary.js.map +1 -1
  68. package/dist/esm/models/components/collateralposition.d.ts +0 -12
  69. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  70. package/dist/esm/models/components/collateralposition.js +0 -4
  71. package/dist/esm/models/components/collateralposition.js.map +1 -1
  72. package/dist/esm/models/components/creditborrowparams.d.ts +0 -9
  73. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  74. package/dist/esm/models/components/creditborrowparams.js +0 -2
  75. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  76. package/dist/esm/models/components/creditborrowrequest.d.ts +0 -9
  77. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  78. package/dist/esm/models/components/creditborrowrequest.js +0 -2
  79. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  80. package/dist/esm/models/components/creditenablecollateralparams.d.ts +0 -4
  81. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  82. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  83. package/dist/esm/models/components/creditprotocol.d.ts +0 -9
  84. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  85. package/dist/esm/models/components/creditprotocol.js +0 -5
  86. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  87. package/dist/esm/models/components/creditrepayparams.d.ts +0 -9
  88. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  89. package/dist/esm/models/components/creditrepayparams.js +0 -2
  90. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  91. package/dist/esm/models/components/creditrepayrequest.d.ts +0 -9
  92. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  93. package/dist/esm/models/components/creditrepayrequest.js +0 -2
  94. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  95. package/dist/esm/models/components/creditsupplyparams.d.ts +0 -9
  96. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  97. package/dist/esm/models/components/creditsupplyparams.js +0 -2
  98. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  99. package/dist/esm/models/components/creditwithdrawparams.d.ts +0 -9
  100. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  101. package/dist/esm/models/components/creditwithdrawparams.js +0 -2
  102. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  103. package/dist/esm/models/components/debtposition.d.ts +0 -12
  104. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  105. package/dist/esm/models/components/debtposition.js +0 -4
  106. package/dist/esm/models/components/debtposition.js.map +1 -1
  107. package/dist/esm/models/components/index.d.ts +0 -6
  108. package/dist/esm/models/components/index.d.ts.map +1 -1
  109. package/dist/esm/models/components/index.js +0 -6
  110. package/dist/esm/models/components/index.js.map +1 -1
  111. package/dist/esm/models/operations/index.d.ts +0 -1
  112. package/dist/esm/models/operations/index.d.ts.map +1 -1
  113. package/dist/esm/models/operations/index.js +0 -1
  114. package/dist/esm/models/operations/index.js.map +1 -1
  115. package/dist/esm/sdk/credit.d.ts +0 -32
  116. package/dist/esm/sdk/credit.d.ts.map +1 -1
  117. package/dist/esm/sdk/credit.js +0 -38
  118. package/dist/esm/sdk/credit.js.map +1 -1
  119. package/docs/models/components/aavelooprequest.md +4 -4
  120. package/docs/models/components/accountsummary.md +10 -10
  121. package/docs/models/components/collateralposition.md +14 -16
  122. package/docs/models/components/creditborrowparams.md +9 -10
  123. package/docs/models/components/creditborrowrequest.md +19 -20
  124. package/docs/models/components/creditenablecollateralparams.md +6 -6
  125. package/docs/models/components/creditprotocol.md +1 -5
  126. package/docs/models/components/creditrepayparams.md +8 -9
  127. package/docs/models/components/creditrepayrequest.md +18 -19
  128. package/docs/models/components/creditsupplyparams.md +7 -8
  129. package/docs/models/components/creditwithdrawparams.md +7 -8
  130. package/docs/models/components/debtposition.md +13 -15
  131. package/docs/models/components/{aavelooprequestinitialcollateralamount.md → initialcollateralamount.md} +1 -1
  132. package/docs/models/components/{aavelooprequestloantovalue.md → loantovalue.md} +1 -1
  133. package/docs/models/components/{aavelooprequestmaxslippagepercent.md → maxslippagepercent.md} +1 -1
  134. package/docs/models/components/{aavelooprequestmultiplier.md → multiplier.md} +1 -1
  135. package/docs/sdks/credit/README.md +0 -186
  136. package/examples/node_modules/tsx/dist/cli.cjs +1 -1
  137. package/examples/node_modules/tsx/dist/cli.mjs +1 -1
  138. package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -1
  139. package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -1
  140. package/examples/node_modules/tsx/dist/esm/index.cjs +1 -1
  141. package/examples/node_modules/tsx/dist/esm/index.mjs +1 -1
  142. package/examples/node_modules/tsx/dist/loader.cjs +1 -1
  143. package/examples/node_modules/tsx/dist/loader.mjs +1 -1
  144. package/examples/node_modules/tsx/dist/package-BhsaYzSJ.cjs +1 -0
  145. package/examples/node_modules/tsx/dist/package-REq4Oepp.mjs +1 -0
  146. package/examples/node_modules/tsx/dist/register-BBZNEaBg.cjs +2 -0
  147. package/examples/node_modules/tsx/dist/register-tkXbOgAS.mjs +2 -0
  148. package/examples/node_modules/tsx/dist/repl.cjs +1 -1
  149. package/examples/node_modules/tsx/dist/repl.mjs +1 -1
  150. package/examples/node_modules/tsx/package.json +1 -1
  151. package/examples/package-lock.json +3 -3
  152. package/openapi_prepped_for_speakeasy.json +2 -658
  153. package/package.json +1 -1
  154. package/src/models/components/aavelooprequest.ts +30 -43
  155. package/src/models/components/accountsummary.ts +0 -4
  156. package/src/models/components/collateralposition.ts +0 -16
  157. package/src/models/components/creditborrowparams.ts +0 -11
  158. package/src/models/components/creditborrowrequest.ts +0 -11
  159. package/src/models/components/creditenablecollateralparams.ts +0 -4
  160. package/src/models/components/creditprotocol.ts +0 -9
  161. package/src/models/components/creditrepayparams.ts +0 -11
  162. package/src/models/components/creditrepayrequest.ts +0 -11
  163. package/src/models/components/creditsupplyparams.ts +0 -11
  164. package/src/models/components/creditwithdrawparams.ts +0 -11
  165. package/src/models/components/debtposition.ts +0 -16
  166. package/src/models/components/index.ts +0 -6
  167. package/src/models/operations/index.ts +0 -1
  168. package/src/sdk/credit.ts +0 -54
  169. package/dist/commonjs/funcs/creditCreditLoop.d.ts +0 -31
  170. package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +0 -1
  171. package/dist/commonjs/funcs/creditCreditLoop.js +0 -132
  172. package/dist/commonjs/funcs/creditCreditLoop.js.map +0 -1
  173. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts +0 -24
  174. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts.map +0 -1
  175. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js +0 -128
  176. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js.map +0 -1
  177. package/dist/commonjs/models/components/creditlooppreview.d.ts +0 -45
  178. package/dist/commonjs/models/components/creditlooppreview.d.ts.map +0 -1
  179. package/dist/commonjs/models/components/creditlooppreview.js +0 -68
  180. package/dist/commonjs/models/components/creditlooppreview.js.map +0 -1
  181. package/dist/commonjs/models/components/creditlooprequest.d.ts +0 -125
  182. package/dist/commonjs/models/components/creditlooprequest.d.ts.map +0 -1
  183. package/dist/commonjs/models/components/creditlooprequest.js +0 -98
  184. package/dist/commonjs/models/components/creditlooprequest.js.map +0 -1
  185. package/dist/commonjs/models/components/creditloopresponse.d.ts +0 -27
  186. package/dist/commonjs/models/components/creditloopresponse.d.ts.map +0 -1
  187. package/dist/commonjs/models/components/creditloopresponse.js +0 -61
  188. package/dist/commonjs/models/components/creditloopresponse.js.map +0 -1
  189. package/dist/commonjs/models/components/looplegpreview.d.ts +0 -24
  190. package/dist/commonjs/models/components/looplegpreview.d.ts.map +0 -1
  191. package/dist/commonjs/models/components/looplegpreview.js +0 -59
  192. package/dist/commonjs/models/components/looplegpreview.js.map +0 -1
  193. package/dist/commonjs/models/components/morpholendingmarket.d.ts +0 -80
  194. package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +0 -1
  195. package/dist/commonjs/models/components/morpholendingmarket.js +0 -82
  196. package/dist/commonjs/models/components/morpholendingmarket.js.map +0 -1
  197. package/dist/commonjs/models/components/morphomarketsresponse.d.ts +0 -21
  198. package/dist/commonjs/models/components/morphomarketsresponse.d.ts.map +0 -1
  199. package/dist/commonjs/models/components/morphomarketsresponse.js +0 -52
  200. package/dist/commonjs/models/components/morphomarketsresponse.js.map +0 -1
  201. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +0 -22
  202. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +0 -1
  203. package/dist/commonjs/models/operations/v2creditmorphomarkets.js +0 -57
  204. package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +0 -1
  205. package/dist/esm/funcs/creditCreditLoop.d.ts +0 -31
  206. package/dist/esm/funcs/creditCreditLoop.d.ts.map +0 -1
  207. package/dist/esm/funcs/creditCreditLoop.js +0 -96
  208. package/dist/esm/funcs/creditCreditLoop.js.map +0 -1
  209. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts +0 -24
  210. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts.map +0 -1
  211. package/dist/esm/funcs/creditCreditMorphoMarkets.js +0 -92
  212. package/dist/esm/funcs/creditCreditMorphoMarkets.js.map +0 -1
  213. package/dist/esm/models/components/creditlooppreview.d.ts +0 -45
  214. package/dist/esm/models/components/creditlooppreview.d.ts.map +0 -1
  215. package/dist/esm/models/components/creditlooppreview.js +0 -31
  216. package/dist/esm/models/components/creditlooppreview.js.map +0 -1
  217. package/dist/esm/models/components/creditlooprequest.d.ts +0 -125
  218. package/dist/esm/models/components/creditlooprequest.d.ts.map +0 -1
  219. package/dist/esm/models/components/creditlooprequest.js +0 -57
  220. package/dist/esm/models/components/creditlooprequest.js.map +0 -1
  221. package/dist/esm/models/components/creditloopresponse.d.ts +0 -27
  222. package/dist/esm/models/components/creditloopresponse.d.ts.map +0 -1
  223. package/dist/esm/models/components/creditloopresponse.js +0 -24
  224. package/dist/esm/models/components/creditloopresponse.js.map +0 -1
  225. package/dist/esm/models/components/looplegpreview.d.ts +0 -24
  226. package/dist/esm/models/components/looplegpreview.d.ts.map +0 -1
  227. package/dist/esm/models/components/looplegpreview.js +0 -22
  228. package/dist/esm/models/components/looplegpreview.js.map +0 -1
  229. package/dist/esm/models/components/morpholendingmarket.d.ts +0 -80
  230. package/dist/esm/models/components/morpholendingmarket.d.ts.map +0 -1
  231. package/dist/esm/models/components/morpholendingmarket.js +0 -45
  232. package/dist/esm/models/components/morpholendingmarket.js.map +0 -1
  233. package/dist/esm/models/components/morphomarketsresponse.d.ts +0 -21
  234. package/dist/esm/models/components/morphomarketsresponse.d.ts.map +0 -1
  235. package/dist/esm/models/components/morphomarketsresponse.js +0 -15
  236. package/dist/esm/models/components/morphomarketsresponse.js.map +0 -1
  237. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +0 -22
  238. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +0 -1
  239. package/dist/esm/models/operations/v2creditmorphomarkets.js +0 -20
  240. package/dist/esm/models/operations/v2creditmorphomarkets.js.map +0 -1
  241. package/docs/models/components/creditlooppreview.md +0 -33
  242. package/docs/models/components/creditlooprequest.md +0 -41
  243. package/docs/models/components/creditlooprequestinitialcollateralamount.md +0 -19
  244. package/docs/models/components/creditlooprequestloantovalue.md +0 -19
  245. package/docs/models/components/creditlooprequestmaxslippagepercent.md +0 -19
  246. package/docs/models/components/creditlooprequestmultiplier.md +0 -19
  247. package/docs/models/components/creditloopresponse.md +0 -30
  248. package/docs/models/components/looplegpreview.md +0 -21
  249. package/docs/models/components/morpholendingmarket.md +0 -49
  250. package/docs/models/components/morphomarketsresponse.md +0 -21
  251. package/docs/models/operations/v2creditmorphomarketschain.md +0 -15
  252. package/docs/models/operations/v2creditmorphomarketsrequest.md +0 -17
  253. package/examples/node_modules/tsx/dist/package-Bj47PlGH.mjs +0 -1
  254. package/examples/node_modules/tsx/dist/package-DMqO70yR.cjs +0 -1
  255. package/examples/node_modules/tsx/dist/register-CKju0f8h.cjs +0 -2
  256. package/examples/node_modules/tsx/dist/register-CqMfTiWi.mjs +0 -2
  257. package/src/funcs/creditCreditLoop.ts +0 -184
  258. package/src/funcs/creditCreditMorphoMarkets.ts +0 -182
  259. package/src/models/components/creditlooppreview.ts +0 -86
  260. package/src/models/components/creditlooprequest.ts +0 -235
  261. package/src/models/components/creditloopresponse.ts +0 -65
  262. package/src/models/components/looplegpreview.ts +0 -54
  263. package/src/models/components/morpholendingmarket.ts +0 -133
  264. package/src/models/components/morphomarketsresponse.ts +0 -46
  265. package/src/models/operations/v2creditmorphomarkets.ts +0 -49
@@ -1,86 +0,0 @@
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
- import {
11
- LoopLegPreview,
12
- LoopLegPreview$inboundSchema,
13
- } from "./looplegpreview.js";
14
-
15
- /**
16
- * Projected end state of the loop, computed on GUARANTEED swap floors.
17
- */
18
- export type CreditLoopPreview = {
19
- /**
20
- * Number of loop iterations bundled.
21
- */
22
- iterations: number;
23
- /**
24
- * Guaranteed minimum total collateral supplied (token units); actual can only be higher (swap fills above the floor become dust).
25
- */
26
- totalCollateralSupplied: string;
27
- /**
28
- * Total loan tokens borrowed across iterations.
29
- */
30
- totalBorrowed: string;
31
- /**
32
- * Guaranteed leverage floor: total_collateral_supplied / initial_collateral_amount.
33
- */
34
- achievedMultiplier: string;
35
- /**
36
- * Projected end loan-to-value in percent, at the sizing oracle prices.
37
- */
38
- projectedLtv: string;
39
- /**
40
- * Projected health factor (liquidation threshold / projected LTV). Below 1 would be liquidatable — the request is rejected long before that.
41
- */
42
- projectedHealthFactor: string;
43
- /**
44
- * Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost.
45
- */
46
- estimatedMaxDust: string;
47
- /**
48
- * Per-iteration breakdown.
49
- */
50
- legs?: Array<LoopLegPreview> | undefined;
51
- };
52
-
53
- /** @internal */
54
- export const CreditLoopPreview$inboundSchema: z.ZodType<
55
- CreditLoopPreview,
56
- z.ZodTypeDef,
57
- unknown
58
- > = z.object({
59
- iterations: z.number().int(),
60
- total_collateral_supplied: z.string(),
61
- total_borrowed: z.string(),
62
- achieved_multiplier: z.string(),
63
- projected_ltv: z.string(),
64
- projected_health_factor: z.string(),
65
- estimated_max_dust: z.string(),
66
- legs: z.array(LoopLegPreview$inboundSchema).optional(),
67
- }).transform((v) => {
68
- return remap$(v, {
69
- "total_collateral_supplied": "totalCollateralSupplied",
70
- "total_borrowed": "totalBorrowed",
71
- "achieved_multiplier": "achievedMultiplier",
72
- "projected_ltv": "projectedLtv",
73
- "projected_health_factor": "projectedHealthFactor",
74
- "estimated_max_dust": "estimatedMaxDust",
75
- });
76
- });
77
-
78
- export function creditLoopPreviewFromJSON(
79
- jsonString: string,
80
- ): SafeParseResult<CreditLoopPreview, SDKValidationError> {
81
- return safeParse(
82
- jsonString,
83
- (x) => CreditLoopPreview$inboundSchema.parse(JSON.parse(x)),
84
- `Failed to parse 'CreditLoopPreview' from JSON`,
85
- );
86
- }
@@ -1,235 +0,0 @@
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 { Chain, Chain$outboundSchema } from "./chain.js";
8
- import {
9
- CreditProtocol,
10
- CreditProtocol$outboundSchema,
11
- } from "./creditprotocol.js";
12
-
13
- /**
14
- * Collateral (in token units) already held in the Credit Account to seed the loop.
15
- */
16
- export type CreditLoopRequestInitialCollateralAmount = number | string;
17
-
18
- /**
19
- * Target leverage: total collateral exposure = multiplier × initial_collateral_amount. Must be achievable at the requested loan_to_value (max ≈ 0.9 / (1 − LTV)).
20
- */
21
- export type CreditLoopRequestMultiplier = number | string;
22
-
23
- /**
24
- * Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
25
- */
26
- export type CreditLoopRequestLoanToValue = number | string;
27
-
28
- /**
29
- * Per-swap slippage tolerance in percent. Loop dust is bounded by this per iteration, so tighter slippage means less dust.
30
- */
31
- export type CreditLoopRequestMaxSlippagePercent = number | string;
32
-
33
- /**
34
- * Open a leveraged loop: repeatedly supply collateral, borrow, and swap the
35
- *
36
- * @remarks
37
- * borrow back to collateral — all in ONE atomic transaction from the Credit
38
- * Account.
39
- */
40
- export type CreditLoopRequest = {
41
- /**
42
- * The address that owns the Credit Account.
43
- */
44
- owner: string;
45
- /**
46
- * The chain to use.
47
- */
48
- chain: Chain;
49
- /**
50
- * Which lending protocol a credit action targets.
51
- *
52
- * @remarks
53
- *
54
- * ``AAVE`` is the default so existing callers (which never send a ``protocol``
55
- * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
56
- * Euler V2 path, where the market is identified by EVK vault address(es).
57
- * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
58
- * currently read-only: positions and market discovery only — transaction
59
- * builders land with the looping work (COM-7106/7107/7108), so transact
60
- * endpoints reject it with a 422.
61
- */
62
- protocol?: CreditProtocol | undefined;
63
- /**
64
- * Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
65
- */
66
- marketId?: string | null | undefined;
67
- /**
68
- * Token supplied as collateral each iteration. Must already be in the Credit Account for the initial amount. For MORPHO it must be the market's collateral token.
69
- */
70
- collateralToken: string;
71
- /**
72
- * Token borrowed each iteration and swapped back to the collateral token. For MORPHO it must be the market's loan token.
73
- */
74
- borrowToken: string;
75
- /**
76
- * Collateral (in token units) already held in the Credit Account to seed the loop.
77
- */
78
- initialCollateralAmount: number | string;
79
- /**
80
- * Target leverage: total collateral exposure = multiplier × initial_collateral_amount. Must be achievable at the requested loan_to_value (max ≈ 0.9 / (1 − LTV)).
81
- */
82
- multiplier: number | string;
83
- /**
84
- * Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
85
- */
86
- loanToValue: number | string;
87
- /**
88
- * Per-swap slippage tolerance in percent. Loop dust is bounded by this per iteration, so tighter slippage means less dust.
89
- */
90
- maxSlippagePercent?: number | string | undefined;
91
- /**
92
- * Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated).
93
- */
94
- emodeCategory?: number | null | undefined;
95
- /**
96
- * If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.
97
- */
98
- gasSponsorship?: boolean | undefined;
99
- };
100
-
101
- /** @internal */
102
- export type CreditLoopRequestInitialCollateralAmount$Outbound = number | string;
103
-
104
- /** @internal */
105
- export const CreditLoopRequestInitialCollateralAmount$outboundSchema: z.ZodType<
106
- CreditLoopRequestInitialCollateralAmount$Outbound,
107
- z.ZodTypeDef,
108
- CreditLoopRequestInitialCollateralAmount
109
- > = z.union([z.number(), z.string()]);
110
-
111
- export function creditLoopRequestInitialCollateralAmountToJSON(
112
- creditLoopRequestInitialCollateralAmount:
113
- CreditLoopRequestInitialCollateralAmount,
114
- ): string {
115
- return JSON.stringify(
116
- CreditLoopRequestInitialCollateralAmount$outboundSchema.parse(
117
- creditLoopRequestInitialCollateralAmount,
118
- ),
119
- );
120
- }
121
-
122
- /** @internal */
123
- export type CreditLoopRequestMultiplier$Outbound = number | string;
124
-
125
- /** @internal */
126
- export const CreditLoopRequestMultiplier$outboundSchema: z.ZodType<
127
- CreditLoopRequestMultiplier$Outbound,
128
- z.ZodTypeDef,
129
- CreditLoopRequestMultiplier
130
- > = z.union([z.number(), z.string()]);
131
-
132
- export function creditLoopRequestMultiplierToJSON(
133
- creditLoopRequestMultiplier: CreditLoopRequestMultiplier,
134
- ): string {
135
- return JSON.stringify(
136
- CreditLoopRequestMultiplier$outboundSchema.parse(
137
- creditLoopRequestMultiplier,
138
- ),
139
- );
140
- }
141
-
142
- /** @internal */
143
- export type CreditLoopRequestLoanToValue$Outbound = number | string;
144
-
145
- /** @internal */
146
- export const CreditLoopRequestLoanToValue$outboundSchema: z.ZodType<
147
- CreditLoopRequestLoanToValue$Outbound,
148
- z.ZodTypeDef,
149
- CreditLoopRequestLoanToValue
150
- > = z.union([z.number(), z.string()]);
151
-
152
- export function creditLoopRequestLoanToValueToJSON(
153
- creditLoopRequestLoanToValue: CreditLoopRequestLoanToValue,
154
- ): string {
155
- return JSON.stringify(
156
- CreditLoopRequestLoanToValue$outboundSchema.parse(
157
- creditLoopRequestLoanToValue,
158
- ),
159
- );
160
- }
161
-
162
- /** @internal */
163
- export type CreditLoopRequestMaxSlippagePercent$Outbound = number | string;
164
-
165
- /** @internal */
166
- export const CreditLoopRequestMaxSlippagePercent$outboundSchema: z.ZodType<
167
- CreditLoopRequestMaxSlippagePercent$Outbound,
168
- z.ZodTypeDef,
169
- CreditLoopRequestMaxSlippagePercent
170
- > = z.union([z.number(), z.string()]);
171
-
172
- export function creditLoopRequestMaxSlippagePercentToJSON(
173
- creditLoopRequestMaxSlippagePercent: CreditLoopRequestMaxSlippagePercent,
174
- ): string {
175
- return JSON.stringify(
176
- CreditLoopRequestMaxSlippagePercent$outboundSchema.parse(
177
- creditLoopRequestMaxSlippagePercent,
178
- ),
179
- );
180
- }
181
-
182
- /** @internal */
183
- export type CreditLoopRequest$Outbound = {
184
- owner: string;
185
- chain: string;
186
- protocol?: string | undefined;
187
- market_id?: string | null | undefined;
188
- collateral_token: string;
189
- borrow_token: string;
190
- initial_collateral_amount: number | string;
191
- multiplier: number | string;
192
- loan_to_value: number | string;
193
- max_slippage_percent?: number | string | undefined;
194
- emode_category?: number | null | undefined;
195
- gas_sponsorship?: boolean | undefined;
196
- };
197
-
198
- /** @internal */
199
- export const CreditLoopRequest$outboundSchema: z.ZodType<
200
- CreditLoopRequest$Outbound,
201
- z.ZodTypeDef,
202
- CreditLoopRequest
203
- > = z.object({
204
- owner: z.string(),
205
- chain: Chain$outboundSchema,
206
- protocol: CreditProtocol$outboundSchema.optional(),
207
- marketId: z.nullable(z.string()).optional(),
208
- collateralToken: z.string(),
209
- borrowToken: z.string(),
210
- initialCollateralAmount: z.union([z.number(), z.string()]),
211
- multiplier: z.union([z.number(), z.string()]),
212
- loanToValue: z.union([z.number(), z.string()]),
213
- maxSlippagePercent: z.union([z.number(), z.string()]).optional(),
214
- emodeCategory: z.nullable(z.number().int()).optional(),
215
- gasSponsorship: z.boolean().optional(),
216
- }).transform((v) => {
217
- return remap$(v, {
218
- marketId: "market_id",
219
- collateralToken: "collateral_token",
220
- borrowToken: "borrow_token",
221
- initialCollateralAmount: "initial_collateral_amount",
222
- loanToValue: "loan_to_value",
223
- maxSlippagePercent: "max_slippage_percent",
224
- emodeCategory: "emode_category",
225
- gasSponsorship: "gas_sponsorship",
226
- });
227
- });
228
-
229
- export function creditLoopRequestToJSON(
230
- creditLoopRequest: CreditLoopRequest,
231
- ): string {
232
- return JSON.stringify(
233
- CreditLoopRequest$outboundSchema.parse(creditLoopRequest),
234
- );
235
- }
@@ -1,65 +0,0 @@
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
- import {
11
- BatchedSafeOperationsResponseOutput,
12
- BatchedSafeOperationsResponseOutput$inboundSchema,
13
- } from "./batchedsafeoperationsresponseoutput.js";
14
- import {
15
- CreditLoopPreview,
16
- CreditLoopPreview$inboundSchema,
17
- } from "./creditlooppreview.js";
18
- import {
19
- UnsignedTransaction,
20
- UnsignedTransaction$inboundSchema,
21
- } from "./unsignedtransaction.js";
22
-
23
- /**
24
- * The atomic loop transaction plus its guaranteed-floor preview.
25
- */
26
- export type CreditLoopResponse = {
27
- /**
28
- * Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false.
29
- */
30
- transaction?: UnsignedTransaction | null | undefined;
31
- /**
32
- * EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
33
- */
34
- eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
35
- /**
36
- * Projected end state of the loop, computed on GUARANTEED swap floors.
37
- */
38
- preview: CreditLoopPreview;
39
- };
40
-
41
- /** @internal */
42
- export const CreditLoopResponse$inboundSchema: z.ZodType<
43
- CreditLoopResponse,
44
- z.ZodTypeDef,
45
- unknown
46
- > = z.object({
47
- transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
48
- eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
49
- .optional(),
50
- preview: CreditLoopPreview$inboundSchema,
51
- }).transform((v) => {
52
- return remap$(v, {
53
- "eip_712": "eip712",
54
- });
55
- });
56
-
57
- export function creditLoopResponseFromJSON(
58
- jsonString: string,
59
- ): SafeParseResult<CreditLoopResponse, SDKValidationError> {
60
- return safeParse(
61
- jsonString,
62
- (x) => CreditLoopResponse$inboundSchema.parse(JSON.parse(x)),
63
- `Failed to parse 'CreditLoopResponse' from JSON`,
64
- );
65
- }
@@ -1,54 +0,0 @@
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
- }
@@ -1,133 +0,0 @@
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
- }
@@ -1,46 +0,0 @@
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
- }
@@ -1,49 +0,0 @@
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
- Ethereum: "ethereum",
12
- Tempo: "tempo",
13
- } as const;
14
- export type V2CreditMorphoMarketsChain = ClosedEnum<
15
- typeof V2CreditMorphoMarketsChain
16
- >;
17
-
18
- export type V2CreditMorphoMarketsRequest = {
19
- chain: V2CreditMorphoMarketsChain;
20
- };
21
-
22
- /** @internal */
23
- export const V2CreditMorphoMarketsChain$outboundSchema: z.ZodNativeEnum<
24
- typeof V2CreditMorphoMarketsChain
25
- > = z.nativeEnum(V2CreditMorphoMarketsChain);
26
-
27
- /** @internal */
28
- export type V2CreditMorphoMarketsRequest$Outbound = {
29
- chain: string;
30
- };
31
-
32
- /** @internal */
33
- export const V2CreditMorphoMarketsRequest$outboundSchema: z.ZodType<
34
- V2CreditMorphoMarketsRequest$Outbound,
35
- z.ZodTypeDef,
36
- V2CreditMorphoMarketsRequest
37
- > = z.object({
38
- chain: V2CreditMorphoMarketsChain$outboundSchema,
39
- });
40
-
41
- export function v2CreditMorphoMarketsRequestToJSON(
42
- v2CreditMorphoMarketsRequest: V2CreditMorphoMarketsRequest,
43
- ): string {
44
- return JSON.stringify(
45
- V2CreditMorphoMarketsRequest$outboundSchema.parse(
46
- v2CreditMorphoMarketsRequest,
47
- ),
48
- );
49
- }