@compass-labs/api-sdk 0.0.23 → 0.0.25

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 (303) hide show
  1. package/README.md +2 -0
  2. package/bin/mcp-server.js +720 -418
  3. package/bin/mcp-server.js.map +33 -34
  4. package/dist/commonjs/funcs/transactionBatchingAaveLoop.d.ts +27 -0
  5. package/dist/commonjs/funcs/transactionBatchingAaveLoop.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/transactionBatchingAaveLoop.js +126 -0
  7. package/dist/commonjs/funcs/transactionBatchingAaveLoop.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/lib/config.js.map +1 -1
  11. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  12. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  13. package/dist/commonjs/mcp-server/server.js +3 -1
  14. package/dist/commonjs/mcp-server/server.js.map +1 -1
  15. package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.d.ts +8 -0
  16. package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.d.ts.map +1 -0
  17. package/dist/commonjs/{models/components/action.js → mcp-server/tools/transactionBatchingAaveLoop.js} +35 -27
  18. package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.js.map +1 -0
  19. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.d.ts +92 -5
  20. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.js +121 -6
  22. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.js.map +1 -1
  23. package/dist/commonjs/models/components/aavelooprequest.d.ts +109 -0
  24. package/dist/commonjs/models/components/aavelooprequest.d.ts.map +1 -0
  25. package/dist/commonjs/models/components/aavelooprequest.js +132 -0
  26. package/dist/commonjs/models/components/aavelooprequest.js.map +1 -0
  27. package/dist/commonjs/models/components/borrow.d.ts +69 -12
  28. package/dist/commonjs/models/components/borrow.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/borrow.js +39 -13
  30. package/dist/commonjs/models/components/borrow.js.map +1 -1
  31. package/dist/commonjs/models/components/index.d.ts +1 -4
  32. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/index.js +1 -4
  34. package/dist/commonjs/models/components/index.js.map +1 -1
  35. package/dist/commonjs/models/components/liquidationcall.d.ts +32 -14
  36. package/dist/commonjs/models/components/liquidationcall.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/liquidationcall.js +23 -14
  38. package/dist/commonjs/models/components/liquidationcall.js.map +1 -1
  39. package/dist/commonjs/models/components/morphoborrowrequest.d.ts +27 -5
  40. package/dist/commonjs/models/components/morphoborrowrequest.d.ts.map +1 -1
  41. package/dist/commonjs/models/components/morphoborrowrequest.js +22 -4
  42. package/dist/commonjs/models/components/morphoborrowrequest.js.map +1 -1
  43. package/dist/commonjs/models/components/morphodepositrequest.d.ts +27 -5
  44. package/dist/commonjs/models/components/morphodepositrequest.d.ts.map +1 -1
  45. package/dist/commonjs/models/components/morphodepositrequest.js +22 -4
  46. package/dist/commonjs/models/components/morphodepositrequest.js.map +1 -1
  47. package/dist/commonjs/models/components/morphorepayrequest.d.ts +27 -5
  48. package/dist/commonjs/models/components/morphorepayrequest.d.ts.map +1 -1
  49. package/dist/commonjs/models/components/morphorepayrequest.js +22 -4
  50. package/dist/commonjs/models/components/morphorepayrequest.js.map +1 -1
  51. package/dist/commonjs/models/components/morphosetvaultallowancerequest.d.ts +27 -5
  52. package/dist/commonjs/models/components/morphosetvaultallowancerequest.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/morphosetvaultallowancerequest.js +22 -4
  54. package/dist/commonjs/models/components/morphosetvaultallowancerequest.js.map +1 -1
  55. package/dist/commonjs/models/components/morphosupplycollateralrequest.d.ts +27 -5
  56. package/dist/commonjs/models/components/morphosupplycollateralrequest.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/morphosupplycollateralrequest.js +22 -4
  58. package/dist/commonjs/models/components/morphosupplycollateralrequest.js.map +1 -1
  59. package/dist/commonjs/models/components/morphowithdrawcollateralrequest.d.ts +27 -5
  60. package/dist/commonjs/models/components/morphowithdrawcollateralrequest.d.ts.map +1 -1
  61. package/dist/commonjs/models/components/morphowithdrawcollateralrequest.js +22 -4
  62. package/dist/commonjs/models/components/morphowithdrawcollateralrequest.js.map +1 -1
  63. package/dist/commonjs/models/components/morphowithdrawrequest.d.ts +27 -5
  64. package/dist/commonjs/models/components/morphowithdrawrequest.d.ts.map +1 -1
  65. package/dist/commonjs/models/components/morphowithdrawrequest.js +22 -4
  66. package/dist/commonjs/models/components/morphowithdrawrequest.js.map +1 -1
  67. package/dist/commonjs/models/components/redeemunderlying.d.ts +32 -4
  68. package/dist/commonjs/models/components/redeemunderlying.d.ts.map +1 -1
  69. package/dist/commonjs/models/components/redeemunderlying.js +14 -4
  70. package/dist/commonjs/models/components/redeemunderlying.js.map +1 -1
  71. package/dist/commonjs/models/components/repay.d.ts +29 -4
  72. package/dist/commonjs/models/components/repay.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/repay.js +14 -4
  74. package/dist/commonjs/models/components/repay.js.map +1 -1
  75. package/dist/commonjs/models/components/reserve.d.ts +25 -3
  76. package/dist/commonjs/models/components/reserve.d.ts.map +1 -1
  77. package/dist/commonjs/models/components/reserve.js +9 -4
  78. package/dist/commonjs/models/components/reserve.js.map +1 -1
  79. package/dist/commonjs/models/components/supply.d.ts +32 -4
  80. package/dist/commonjs/models/components/supply.d.ts.map +1 -1
  81. package/dist/commonjs/models/components/supply.js +14 -4
  82. package/dist/commonjs/models/components/supply.js.map +1 -1
  83. package/dist/commonjs/models/components/swapborrowrate.d.ts +27 -8
  84. package/dist/commonjs/models/components/swapborrowrate.d.ts.map +1 -1
  85. package/dist/commonjs/models/components/swapborrowrate.js +18 -8
  86. package/dist/commonjs/models/components/swapborrowrate.js.map +1 -1
  87. package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts +15 -15
  88. package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
  89. package/dist/commonjs/models/components/uniswapbuyexactlyparams.js +18 -20
  90. package/dist/commonjs/models/components/uniswapbuyexactlyparams.js.map +1 -1
  91. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts +15 -15
  92. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
  93. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js +18 -20
  94. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js.map +1 -1
  95. package/dist/commonjs/models/components/usageascollateral.d.ts +26 -4
  96. package/dist/commonjs/models/components/usageascollateral.d.ts.map +1 -1
  97. package/dist/commonjs/models/components/usageascollateral.js +14 -4
  98. package/dist/commonjs/models/components/usageascollateral.js.map +1 -1
  99. package/dist/commonjs/models/operations/morphomarketposition.d.ts +3 -15
  100. package/dist/commonjs/models/operations/morphomarketposition.d.ts.map +1 -1
  101. package/dist/commonjs/models/operations/morphomarketposition.js +1 -5
  102. package/dist/commonjs/models/operations/morphomarketposition.js.map +1 -1
  103. package/dist/commonjs/models/operations/morphomarkets.d.ts +3 -15
  104. package/dist/commonjs/models/operations/morphomarkets.d.ts.map +1 -1
  105. package/dist/commonjs/models/operations/morphomarkets.js +1 -5
  106. package/dist/commonjs/models/operations/morphomarkets.js.map +1 -1
  107. package/dist/commonjs/models/operations/morphovaultposition.d.ts +3 -15
  108. package/dist/commonjs/models/operations/morphovaultposition.d.ts.map +1 -1
  109. package/dist/commonjs/models/operations/morphovaultposition.js +1 -5
  110. package/dist/commonjs/models/operations/morphovaultposition.js.map +1 -1
  111. package/dist/commonjs/models/operations/morphovaults.d.ts +5 -17
  112. package/dist/commonjs/models/operations/morphovaults.d.ts.map +1 -1
  113. package/dist/commonjs/models/operations/morphovaults.js +3 -7
  114. package/dist/commonjs/models/operations/morphovaults.js.map +1 -1
  115. package/dist/commonjs/sdk/transactionbatching.d.ts +17 -0
  116. package/dist/commonjs/sdk/transactionbatching.d.ts.map +1 -1
  117. package/dist/commonjs/sdk/transactionbatching.js +20 -0
  118. package/dist/commonjs/sdk/transactionbatching.js.map +1 -1
  119. package/dist/esm/funcs/transactionBatchingAaveLoop.d.ts +27 -0
  120. package/dist/esm/funcs/transactionBatchingAaveLoop.d.ts.map +1 -0
  121. package/dist/esm/funcs/transactionBatchingAaveLoop.js +90 -0
  122. package/dist/esm/funcs/transactionBatchingAaveLoop.js.map +1 -0
  123. package/dist/esm/lib/config.d.ts +3 -3
  124. package/dist/esm/lib/config.js +3 -3
  125. package/dist/esm/lib/config.js.map +1 -1
  126. package/dist/esm/mcp-server/mcp-server.js +1 -1
  127. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  128. package/dist/esm/mcp-server/server.js +3 -1
  129. package/dist/esm/mcp-server/server.js.map +1 -1
  130. package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.d.ts +8 -0
  131. package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.d.ts.map +1 -0
  132. package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.js +38 -0
  133. package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.js.map +1 -0
  134. package/dist/esm/models/components/aavehistoricaltransactionsresponse.d.ts +92 -5
  135. package/dist/esm/models/components/aavehistoricaltransactionsresponse.d.ts.map +1 -1
  136. package/dist/esm/models/components/aavehistoricaltransactionsresponse.js +118 -5
  137. package/dist/esm/models/components/aavehistoricaltransactionsresponse.js.map +1 -1
  138. package/dist/esm/models/components/aavelooprequest.d.ts +109 -0
  139. package/dist/esm/models/components/aavelooprequest.d.ts.map +1 -0
  140. package/dist/esm/models/components/aavelooprequest.js +92 -0
  141. package/dist/esm/models/components/aavelooprequest.js.map +1 -0
  142. package/dist/esm/models/components/borrow.d.ts +69 -12
  143. package/dist/esm/models/components/borrow.d.ts.map +1 -1
  144. package/dist/esm/models/components/borrow.js +38 -12
  145. package/dist/esm/models/components/borrow.js.map +1 -1
  146. package/dist/esm/models/components/index.d.ts +1 -4
  147. package/dist/esm/models/components/index.d.ts.map +1 -1
  148. package/dist/esm/models/components/index.js +1 -4
  149. package/dist/esm/models/components/index.js.map +1 -1
  150. package/dist/esm/models/components/liquidationcall.d.ts +32 -14
  151. package/dist/esm/models/components/liquidationcall.d.ts.map +1 -1
  152. package/dist/esm/models/components/liquidationcall.js +23 -14
  153. package/dist/esm/models/components/liquidationcall.js.map +1 -1
  154. package/dist/esm/models/components/morphoborrowrequest.d.ts +27 -5
  155. package/dist/esm/models/components/morphoborrowrequest.d.ts.map +1 -1
  156. package/dist/esm/models/components/morphoborrowrequest.js +21 -3
  157. package/dist/esm/models/components/morphoborrowrequest.js.map +1 -1
  158. package/dist/esm/models/components/morphodepositrequest.d.ts +27 -5
  159. package/dist/esm/models/components/morphodepositrequest.d.ts.map +1 -1
  160. package/dist/esm/models/components/morphodepositrequest.js +21 -3
  161. package/dist/esm/models/components/morphodepositrequest.js.map +1 -1
  162. package/dist/esm/models/components/morphorepayrequest.d.ts +27 -5
  163. package/dist/esm/models/components/morphorepayrequest.d.ts.map +1 -1
  164. package/dist/esm/models/components/morphorepayrequest.js +21 -3
  165. package/dist/esm/models/components/morphorepayrequest.js.map +1 -1
  166. package/dist/esm/models/components/morphosetvaultallowancerequest.d.ts +27 -5
  167. package/dist/esm/models/components/morphosetvaultallowancerequest.d.ts.map +1 -1
  168. package/dist/esm/models/components/morphosetvaultallowancerequest.js +21 -3
  169. package/dist/esm/models/components/morphosetvaultallowancerequest.js.map +1 -1
  170. package/dist/esm/models/components/morphosupplycollateralrequest.d.ts +27 -5
  171. package/dist/esm/models/components/morphosupplycollateralrequest.d.ts.map +1 -1
  172. package/dist/esm/models/components/morphosupplycollateralrequest.js +21 -3
  173. package/dist/esm/models/components/morphosupplycollateralrequest.js.map +1 -1
  174. package/dist/esm/models/components/morphowithdrawcollateralrequest.d.ts +27 -5
  175. package/dist/esm/models/components/morphowithdrawcollateralrequest.d.ts.map +1 -1
  176. package/dist/esm/models/components/morphowithdrawcollateralrequest.js +21 -3
  177. package/dist/esm/models/components/morphowithdrawcollateralrequest.js.map +1 -1
  178. package/dist/esm/models/components/morphowithdrawrequest.d.ts +27 -5
  179. package/dist/esm/models/components/morphowithdrawrequest.d.ts.map +1 -1
  180. package/dist/esm/models/components/morphowithdrawrequest.js +21 -3
  181. package/dist/esm/models/components/morphowithdrawrequest.js.map +1 -1
  182. package/dist/esm/models/components/redeemunderlying.d.ts +32 -4
  183. package/dist/esm/models/components/redeemunderlying.d.ts.map +1 -1
  184. package/dist/esm/models/components/redeemunderlying.js +14 -4
  185. package/dist/esm/models/components/redeemunderlying.js.map +1 -1
  186. package/dist/esm/models/components/repay.d.ts +29 -4
  187. package/dist/esm/models/components/repay.d.ts.map +1 -1
  188. package/dist/esm/models/components/repay.js +14 -4
  189. package/dist/esm/models/components/repay.js.map +1 -1
  190. package/dist/esm/models/components/reserve.d.ts +25 -3
  191. package/dist/esm/models/components/reserve.d.ts.map +1 -1
  192. package/dist/esm/models/components/reserve.js +9 -4
  193. package/dist/esm/models/components/reserve.js.map +1 -1
  194. package/dist/esm/models/components/supply.d.ts +32 -4
  195. package/dist/esm/models/components/supply.d.ts.map +1 -1
  196. package/dist/esm/models/components/supply.js +14 -4
  197. package/dist/esm/models/components/supply.js.map +1 -1
  198. package/dist/esm/models/components/swapborrowrate.d.ts +27 -8
  199. package/dist/esm/models/components/swapborrowrate.d.ts.map +1 -1
  200. package/dist/esm/models/components/swapborrowrate.js +18 -8
  201. package/dist/esm/models/components/swapborrowrate.js.map +1 -1
  202. package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts +15 -15
  203. package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
  204. package/dist/esm/models/components/uniswapbuyexactlyparams.js +15 -17
  205. package/dist/esm/models/components/uniswapbuyexactlyparams.js.map +1 -1
  206. package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts +15 -15
  207. package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
  208. package/dist/esm/models/components/uniswapbuyexactlyrequest.js +15 -17
  209. package/dist/esm/models/components/uniswapbuyexactlyrequest.js.map +1 -1
  210. package/dist/esm/models/components/usageascollateral.d.ts +26 -4
  211. package/dist/esm/models/components/usageascollateral.d.ts.map +1 -1
  212. package/dist/esm/models/components/usageascollateral.js +14 -4
  213. package/dist/esm/models/components/usageascollateral.js.map +1 -1
  214. package/dist/esm/models/operations/morphomarketposition.d.ts +3 -15
  215. package/dist/esm/models/operations/morphomarketposition.d.ts.map +1 -1
  216. package/dist/esm/models/operations/morphomarketposition.js +1 -5
  217. package/dist/esm/models/operations/morphomarketposition.js.map +1 -1
  218. package/dist/esm/models/operations/morphomarkets.d.ts +3 -15
  219. package/dist/esm/models/operations/morphomarkets.d.ts.map +1 -1
  220. package/dist/esm/models/operations/morphomarkets.js +1 -5
  221. package/dist/esm/models/operations/morphomarkets.js.map +1 -1
  222. package/dist/esm/models/operations/morphovaultposition.d.ts +3 -15
  223. package/dist/esm/models/operations/morphovaultposition.d.ts.map +1 -1
  224. package/dist/esm/models/operations/morphovaultposition.js +1 -5
  225. package/dist/esm/models/operations/morphovaultposition.js.map +1 -1
  226. package/dist/esm/models/operations/morphovaults.d.ts +5 -17
  227. package/dist/esm/models/operations/morphovaults.d.ts.map +1 -1
  228. package/dist/esm/models/operations/morphovaults.js +3 -7
  229. package/dist/esm/models/operations/morphovaults.js.map +1 -1
  230. package/dist/esm/sdk/transactionbatching.d.ts +17 -0
  231. package/dist/esm/sdk/transactionbatching.d.ts.map +1 -1
  232. package/dist/esm/sdk/transactionbatching.js +20 -0
  233. package/dist/esm/sdk/transactionbatching.js.map +1 -1
  234. package/docs/sdks/morpho/README.md +8 -18
  235. package/docs/sdks/transactionbatching/README.md +120 -2
  236. package/docs/sdks/uniswapv3/README.md +2 -2
  237. package/jsr.json +1 -1
  238. package/package.json +1 -1
  239. package/src/funcs/transactionBatchingAaveLoop.ts +173 -0
  240. package/src/lib/config.ts +3 -3
  241. package/src/mcp-server/mcp-server.ts +1 -1
  242. package/src/mcp-server/server.ts +3 -1
  243. package/src/mcp-server/tools/transactionBatchingAaveLoop.ts +47 -0
  244. package/src/models/components/aavehistoricaltransactionsresponse.ts +275 -13
  245. package/src/models/components/aavelooprequest.ts +219 -0
  246. package/src/models/components/borrow.ts +87 -24
  247. package/src/models/components/index.ts +1 -4
  248. package/src/models/components/liquidationcall.ts +58 -35
  249. package/src/models/components/morphoborrowrequest.ts +33 -7
  250. package/src/models/components/morphodepositrequest.ts +33 -7
  251. package/src/models/components/morphorepayrequest.ts +33 -7
  252. package/src/models/components/morphosetvaultallowancerequest.ts +35 -7
  253. package/src/models/components/morphosupplycollateralrequest.ts +34 -7
  254. package/src/models/components/morphowithdrawcollateralrequest.ts +36 -7
  255. package/src/models/components/morphowithdrawrequest.ts +33 -7
  256. package/src/models/components/redeemunderlying.ts +46 -8
  257. package/src/models/components/repay.ts +43 -8
  258. package/src/models/components/reserve.ts +37 -7
  259. package/src/models/components/supply.ts +46 -8
  260. package/src/models/components/swapborrowrate.ts +45 -16
  261. package/src/models/components/uniswapbuyexactlyparams.ts +26 -28
  262. package/src/models/components/uniswapbuyexactlyrequest.ts +26 -29
  263. package/src/models/components/usageascollateral.ts +40 -8
  264. package/src/models/operations/morphomarketposition.ts +1 -11
  265. package/src/models/operations/morphomarkets.ts +1 -11
  266. package/src/models/operations/morphovaultposition.ts +1 -11
  267. package/src/models/operations/morphovaults.ts +5 -15
  268. package/src/sdk/transactionbatching.ts +28 -0
  269. package/dist/commonjs/models/components/aavehistoricaltransactionbase.d.ts +0 -57
  270. package/dist/commonjs/models/components/aavehistoricaltransactionbase.d.ts.map +0 -1
  271. package/dist/commonjs/models/components/aavehistoricaltransactionbase.js +0 -97
  272. package/dist/commonjs/models/components/aavehistoricaltransactionbase.js.map +0 -1
  273. package/dist/commonjs/models/components/action.d.ts +0 -43
  274. package/dist/commonjs/models/components/action.d.ts.map +0 -1
  275. package/dist/commonjs/models/components/action.js.map +0 -1
  276. package/dist/commonjs/models/components/collateralreserve.d.ts +0 -31
  277. package/dist/commonjs/models/components/collateralreserve.d.ts.map +0 -1
  278. package/dist/commonjs/models/components/collateralreserve.js +0 -71
  279. package/dist/commonjs/models/components/collateralreserve.js.map +0 -1
  280. package/dist/commonjs/models/components/principalreserve.d.ts +0 -31
  281. package/dist/commonjs/models/components/principalreserve.d.ts.map +0 -1
  282. package/dist/commonjs/models/components/principalreserve.js +0 -71
  283. package/dist/commonjs/models/components/principalreserve.js.map +0 -1
  284. package/dist/esm/models/components/aavehistoricaltransactionbase.d.ts +0 -57
  285. package/dist/esm/models/components/aavehistoricaltransactionbase.d.ts.map +0 -1
  286. package/dist/esm/models/components/aavehistoricaltransactionbase.js +0 -59
  287. package/dist/esm/models/components/aavehistoricaltransactionbase.js.map +0 -1
  288. package/dist/esm/models/components/action.d.ts +0 -43
  289. package/dist/esm/models/components/action.d.ts.map +0 -1
  290. package/dist/esm/models/components/action.js +0 -30
  291. package/dist/esm/models/components/action.js.map +0 -1
  292. package/dist/esm/models/components/collateralreserve.d.ts +0 -31
  293. package/dist/esm/models/components/collateralreserve.d.ts.map +0 -1
  294. package/dist/esm/models/components/collateralreserve.js +0 -33
  295. package/dist/esm/models/components/collateralreserve.js.map +0 -1
  296. package/dist/esm/models/components/principalreserve.d.ts +0 -31
  297. package/dist/esm/models/components/principalreserve.d.ts.map +0 -1
  298. package/dist/esm/models/components/principalreserve.js +0 -33
  299. package/dist/esm/models/components/principalreserve.js.map +0 -1
  300. package/src/models/components/aavehistoricaltransactionbase.ts +0 -155
  301. package/src/models/components/action.ts +0 -36
  302. package/src/models/components/collateralreserve.ts +0 -70
  303. package/src/models/components/principalreserve.ts +0 -70
@@ -5,9 +5,17 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../../types/fp.js";
9
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
- import { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
11
+
12
+ export const MorphoWithdrawRequestChain = {
13
+ EthereumMainnet: "ethereum:mainnet",
14
+ BaseMainnet: "base:mainnet",
15
+ } as const;
16
+ export type MorphoWithdrawRequestChain = ClosedEnum<
17
+ typeof MorphoWithdrawRequestChain
18
+ >;
11
19
 
12
20
  export type MorphoWithdrawRequest = {
13
21
  /**
@@ -22,16 +30,34 @@ export type MorphoWithdrawRequest = {
22
30
  * The address which will receive the tokens withdrawn. Defaults to the sender.
23
31
  */
24
32
  receiver?: string | null | undefined;
25
- /**
26
- * The chain to use.
27
- */
28
- chain: Chain;
33
+ chain: MorphoWithdrawRequestChain;
29
34
  /**
30
35
  * The address of the transaction sender.
31
36
  */
32
37
  sender: string;
33
38
  };
34
39
 
40
+ /** @internal */
41
+ export const MorphoWithdrawRequestChain$inboundSchema: z.ZodNativeEnum<
42
+ typeof MorphoWithdrawRequestChain
43
+ > = z.nativeEnum(MorphoWithdrawRequestChain);
44
+
45
+ /** @internal */
46
+ export const MorphoWithdrawRequestChain$outboundSchema: z.ZodNativeEnum<
47
+ typeof MorphoWithdrawRequestChain
48
+ > = MorphoWithdrawRequestChain$inboundSchema;
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace MorphoWithdrawRequestChain$ {
55
+ /** @deprecated use `MorphoWithdrawRequestChain$inboundSchema` instead. */
56
+ export const inboundSchema = MorphoWithdrawRequestChain$inboundSchema;
57
+ /** @deprecated use `MorphoWithdrawRequestChain$outboundSchema` instead. */
58
+ export const outboundSchema = MorphoWithdrawRequestChain$outboundSchema;
59
+ }
60
+
35
61
  /** @internal */
36
62
  export const MorphoWithdrawRequest$inboundSchema: z.ZodType<
37
63
  MorphoWithdrawRequest,
@@ -41,7 +67,7 @@ export const MorphoWithdrawRequest$inboundSchema: z.ZodType<
41
67
  vault_address: z.string(),
42
68
  amount: z.any().optional(),
43
69
  receiver: z.nullable(z.string()).optional(),
44
- chain: Chain$inboundSchema,
70
+ chain: MorphoWithdrawRequestChain$inboundSchema,
45
71
  sender: z.string(),
46
72
  }).transform((v) => {
47
73
  return remap$(v, {
@@ -67,7 +93,7 @@ export const MorphoWithdrawRequest$outboundSchema: z.ZodType<
67
93
  vaultAddress: z.string(),
68
94
  amount: z.any().optional(),
69
95
  receiver: z.nullable(z.string()).optional(),
70
- chain: Chain$outboundSchema,
96
+ chain: MorphoWithdrawRequestChain$outboundSchema,
71
97
  sender: z.string(),
72
98
  }).transform((v) => {
73
99
  return remap$(v, {
@@ -14,9 +14,32 @@ import {
14
14
  } from "./reserve.js";
15
15
 
16
16
  export type RedeemUnderlying = {
17
- amount: string;
17
+ /**
18
+ * The id of a historical transaction on aave
19
+ */
20
+ id: string;
21
+ /**
22
+ * Timestamp in unix time
23
+ */
24
+ timestamp: number;
25
+ /**
26
+ * Transaction hash. You can paste these into the search bar on etherscan
27
+ */
28
+ txHash: string;
29
+ /**
30
+ * Quantity of token
31
+ */
32
+ amount: number;
18
33
  reserve: Reserve;
19
- assetPriceUSD: string;
34
+ /**
35
+ * Price of token in USD
36
+ */
37
+ assetPriceUSD: number;
38
+ /**
39
+ * The type of transaction
40
+ */
41
+ action: string;
42
+ block: number;
20
43
  };
21
44
 
22
45
  /** @internal */
@@ -25,16 +48,26 @@ export const RedeemUnderlying$inboundSchema: z.ZodType<
25
48
  z.ZodTypeDef,
26
49
  unknown
27
50
  > = z.object({
28
- amount: z.string(),
51
+ id: z.string(),
52
+ timestamp: z.number().int(),
53
+ txHash: z.string(),
54
+ amount: z.number(),
29
55
  reserve: Reserve$inboundSchema,
30
- assetPriceUSD: z.string(),
56
+ assetPriceUSD: z.number(),
57
+ action: z.string(),
58
+ block: z.number().int(),
31
59
  });
32
60
 
33
61
  /** @internal */
34
62
  export type RedeemUnderlying$Outbound = {
35
- amount: string;
63
+ id: string;
64
+ timestamp: number;
65
+ txHash: string;
66
+ amount: number;
36
67
  reserve: Reserve$Outbound;
37
- assetPriceUSD: string;
68
+ assetPriceUSD: number;
69
+ action: string;
70
+ block: number;
38
71
  };
39
72
 
40
73
  /** @internal */
@@ -43,9 +76,14 @@ export const RedeemUnderlying$outboundSchema: z.ZodType<
43
76
  z.ZodTypeDef,
44
77
  RedeemUnderlying
45
78
  > = z.object({
46
- amount: z.string(),
79
+ id: z.string(),
80
+ timestamp: z.number().int(),
81
+ txHash: z.string(),
82
+ amount: z.number(),
47
83
  reserve: Reserve$outboundSchema,
48
- assetPriceUSD: z.string(),
84
+ assetPriceUSD: z.number(),
85
+ action: z.string(),
86
+ block: z.number().int(),
49
87
  });
50
88
 
51
89
  /**
@@ -14,24 +14,54 @@ import {
14
14
  } from "./reserve.js";
15
15
 
16
16
  export type Repay = {
17
- amount: string;
17
+ /**
18
+ * The id of a historical transaction on aave
19
+ */
20
+ id: string;
21
+ /**
22
+ * Timestamp in unix time
23
+ */
24
+ timestamp: number;
25
+ /**
26
+ * Transaction hash. You can paste these into the search bar on etherscan
27
+ */
28
+ txHash: string;
29
+ /**
30
+ * Quantity of token
31
+ */
32
+ amount: number;
18
33
  reserve: Reserve;
19
- assetPriceUSD: string;
34
+ assetPriceUSD: number;
35
+ /**
36
+ * The type of transaction
37
+ */
38
+ action?: "Repay" | undefined;
39
+ block: number;
20
40
  };
21
41
 
22
42
  /** @internal */
23
43
  export const Repay$inboundSchema: z.ZodType<Repay, z.ZodTypeDef, unknown> = z
24
44
  .object({
25
- amount: z.string(),
45
+ id: z.string(),
46
+ timestamp: z.number().int(),
47
+ txHash: z.string(),
48
+ amount: z.number(),
26
49
  reserve: Reserve$inboundSchema,
27
- assetPriceUSD: z.string(),
50
+ assetPriceUSD: z.number(),
51
+ action: z.literal("Repay").optional(),
52
+ block: z.number().int(),
28
53
  });
29
54
 
30
55
  /** @internal */
31
56
  export type Repay$Outbound = {
32
- amount: string;
57
+ id: string;
58
+ timestamp: number;
59
+ txHash: string;
60
+ amount: number;
33
61
  reserve: Reserve$Outbound;
34
- assetPriceUSD: string;
62
+ assetPriceUSD: number;
63
+ action: "Repay";
64
+ block: number;
35
65
  };
36
66
 
37
67
  /** @internal */
@@ -40,9 +70,14 @@ export const Repay$outboundSchema: z.ZodType<
40
70
  z.ZodTypeDef,
41
71
  Repay
42
72
  > = z.object({
43
- amount: z.string(),
73
+ id: z.string(),
74
+ timestamp: z.number().int(),
75
+ txHash: z.string(),
76
+ amount: z.number(),
44
77
  reserve: Reserve$outboundSchema,
45
- assetPriceUSD: z.string(),
78
+ assetPriceUSD: z.number(),
79
+ action: z.literal("Repay").default("Repay" as const),
80
+ block: z.number().int(),
46
81
  });
47
82
 
48
83
  /**
@@ -6,23 +6,51 @@ import * as z from "zod";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ TokenEnum,
11
+ TokenEnum$inboundSchema,
12
+ TokenEnum$outboundSchema,
13
+ } from "./tokenenum.js";
9
14
 
10
15
  export type Reserve = {
11
- symbol: string;
12
- decimals: number;
16
+ /**
17
+ * A class representing the token.
18
+ *
19
+ * @remarks
20
+ *
21
+ * This class is used to represent the token in the system. Notice individual
22
+ * endpoints' documentation where per chain tokens are presented.
23
+ */
24
+ symbol: TokenEnum;
25
+ /**
26
+ * Number of decimals of token.
27
+ */
28
+ decimals?: number | null | undefined;
29
+ /**
30
+ * Name of Token
31
+ */
32
+ name: string;
33
+ /**
34
+ * Checksum address of Token.
35
+ */
36
+ underlyingAsset: string;
13
37
  };
14
38
 
15
39
  /** @internal */
16
40
  export const Reserve$inboundSchema: z.ZodType<Reserve, z.ZodTypeDef, unknown> =
17
41
  z.object({
18
- symbol: z.string(),
19
- decimals: z.number().int(),
42
+ symbol: TokenEnum$inboundSchema,
43
+ decimals: z.nullable(z.number().int()).optional(),
44
+ name: z.string(),
45
+ underlyingAsset: z.string(),
20
46
  });
21
47
 
22
48
  /** @internal */
23
49
  export type Reserve$Outbound = {
24
50
  symbol: string;
25
- decimals: number;
51
+ decimals?: number | null | undefined;
52
+ name: string;
53
+ underlyingAsset: string;
26
54
  };
27
55
 
28
56
  /** @internal */
@@ -31,8 +59,10 @@ export const Reserve$outboundSchema: z.ZodType<
31
59
  z.ZodTypeDef,
32
60
  Reserve
33
61
  > = z.object({
34
- symbol: z.string(),
35
- decimals: z.number().int(),
62
+ symbol: TokenEnum$outboundSchema,
63
+ decimals: z.nullable(z.number().int()).optional(),
64
+ name: z.string(),
65
+ underlyingAsset: z.string(),
36
66
  });
37
67
 
38
68
  /**
@@ -14,24 +14,57 @@ import {
14
14
  } from "./reserve.js";
15
15
 
16
16
  export type Supply = {
17
- amount: string;
17
+ /**
18
+ * The id of a historical transaction on aave
19
+ */
20
+ id: string;
21
+ /**
22
+ * Timestamp in unix time
23
+ */
24
+ timestamp: number;
25
+ /**
26
+ * Transaction hash. You can paste these into the search bar on etherscan
27
+ */
28
+ txHash: string;
29
+ /**
30
+ * Quantity of token
31
+ */
32
+ amount: number;
18
33
  reserve: Reserve;
19
- assetPriceUSD: string;
34
+ /**
35
+ * Price of token in USD
36
+ */
37
+ assetPriceUSD: number;
38
+ /**
39
+ * The type of transaction
40
+ */
41
+ action?: "Supply" | undefined;
42
+ block: number;
20
43
  };
21
44
 
22
45
  /** @internal */
23
46
  export const Supply$inboundSchema: z.ZodType<Supply, z.ZodTypeDef, unknown> = z
24
47
  .object({
25
- amount: z.string(),
48
+ id: z.string(),
49
+ timestamp: z.number().int(),
50
+ txHash: z.string(),
51
+ amount: z.number(),
26
52
  reserve: Reserve$inboundSchema,
27
- assetPriceUSD: z.string(),
53
+ assetPriceUSD: z.number(),
54
+ action: z.literal("Supply").optional(),
55
+ block: z.number().int(),
28
56
  });
29
57
 
30
58
  /** @internal */
31
59
  export type Supply$Outbound = {
32
- amount: string;
60
+ id: string;
61
+ timestamp: number;
62
+ txHash: string;
63
+ amount: number;
33
64
  reserve: Reserve$Outbound;
34
- assetPriceUSD: string;
65
+ assetPriceUSD: number;
66
+ action: "Supply";
67
+ block: number;
35
68
  };
36
69
 
37
70
  /** @internal */
@@ -40,9 +73,14 @@ export const Supply$outboundSchema: z.ZodType<
40
73
  z.ZodTypeDef,
41
74
  Supply
42
75
  > = z.object({
43
- amount: z.string(),
76
+ id: z.string(),
77
+ timestamp: z.number().int(),
78
+ txHash: z.string(),
79
+ amount: z.number(),
44
80
  reserve: Reserve$outboundSchema,
45
- assetPriceUSD: z.string(),
81
+ assetPriceUSD: z.number(),
82
+ action: z.literal("Supply").default("Supply" as const),
83
+ block: z.number().int(),
46
84
  });
47
85
 
48
86
  /**
@@ -14,11 +14,25 @@ import {
14
14
  } from "./reserve.js";
15
15
 
16
16
  export type SwapBorrowRate = {
17
- borrowRateModeFrom: string;
18
- borrowRateModeTo: string;
19
- variableBorrowRate: string;
20
- stableBorrowRate: string;
17
+ /**
18
+ * The id of a historical transaction on aave
19
+ */
20
+ id: string;
21
+ /**
22
+ * Timestamp in unix time
23
+ */
24
+ timestamp: number;
25
+ /**
26
+ * Transaction hash. You can paste these into the search bar on etherscan
27
+ */
28
+ txHash: string;
29
+ borrowRateModeFrom: number;
30
+ borrowRateModeTo: number;
31
+ variableBorrowRate: number;
32
+ stableBorrowRate: number;
21
33
  reserve: Reserve;
34
+ action?: "SwapBorrowRate" | undefined;
35
+ block: number;
22
36
  };
23
37
 
24
38
  /** @internal */
@@ -27,20 +41,30 @@ export const SwapBorrowRate$inboundSchema: z.ZodType<
27
41
  z.ZodTypeDef,
28
42
  unknown
29
43
  > = z.object({
30
- borrowRateModeFrom: z.string(),
31
- borrowRateModeTo: z.string(),
32
- variableBorrowRate: z.string(),
33
- stableBorrowRate: z.string(),
44
+ id: z.string(),
45
+ timestamp: z.number().int(),
46
+ txHash: z.string(),
47
+ borrowRateModeFrom: z.number().int(),
48
+ borrowRateModeTo: z.number().int(),
49
+ variableBorrowRate: z.number().int(),
50
+ stableBorrowRate: z.number().int(),
34
51
  reserve: Reserve$inboundSchema,
52
+ action: z.literal("SwapBorrowRate").optional(),
53
+ block: z.number().int(),
35
54
  });
36
55
 
37
56
  /** @internal */
38
57
  export type SwapBorrowRate$Outbound = {
39
- borrowRateModeFrom: string;
40
- borrowRateModeTo: string;
41
- variableBorrowRate: string;
42
- stableBorrowRate: string;
58
+ id: string;
59
+ timestamp: number;
60
+ txHash: string;
61
+ borrowRateModeFrom: number;
62
+ borrowRateModeTo: number;
63
+ variableBorrowRate: number;
64
+ stableBorrowRate: number;
43
65
  reserve: Reserve$Outbound;
66
+ action: "SwapBorrowRate";
67
+ block: number;
44
68
  };
45
69
 
46
70
  /** @internal */
@@ -49,11 +73,16 @@ export const SwapBorrowRate$outboundSchema: z.ZodType<
49
73
  z.ZodTypeDef,
50
74
  SwapBorrowRate
51
75
  > = z.object({
52
- borrowRateModeFrom: z.string(),
53
- borrowRateModeTo: z.string(),
54
- variableBorrowRate: z.string(),
55
- stableBorrowRate: z.string(),
76
+ id: z.string(),
77
+ timestamp: z.number().int(),
78
+ txHash: z.string(),
79
+ borrowRateModeFrom: z.number().int(),
80
+ borrowRateModeTo: z.number().int(),
81
+ variableBorrowRate: z.number().int(),
82
+ stableBorrowRate: z.number().int(),
56
83
  reserve: Reserve$outboundSchema,
84
+ action: z.literal("SwapBorrowRate").default("SwapBorrowRate" as const),
85
+ block: z.number().int(),
57
86
  });
58
87
 
59
88
  /**
@@ -21,7 +21,7 @@ import {
21
21
  /**
22
22
  * The amount of the token to swap to
23
23
  */
24
- export type UniswapBuyExactlyParamsAmountOut = number | string;
24
+ export type UniswapBuyExactlyParamsAmount = number | string;
25
25
 
26
26
  export type UniswapBuyExactlyParams = {
27
27
  /**
@@ -53,7 +53,7 @@ export type UniswapBuyExactlyParams = {
53
53
  /**
54
54
  * The amount of the token to swap to
55
55
  */
56
- amountOut: number | string;
56
+ amount: number | string;
57
57
  /**
58
58
  * The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
59
59
  */
@@ -65,52 +65,52 @@ export type UniswapBuyExactlyParams = {
65
65
  };
66
66
 
67
67
  /** @internal */
68
- export const UniswapBuyExactlyParamsAmountOut$inboundSchema: z.ZodType<
69
- UniswapBuyExactlyParamsAmountOut,
68
+ export const UniswapBuyExactlyParamsAmount$inboundSchema: z.ZodType<
69
+ UniswapBuyExactlyParamsAmount,
70
70
  z.ZodTypeDef,
71
71
  unknown
72
72
  > = z.union([z.number(), z.string()]);
73
73
 
74
74
  /** @internal */
75
- export type UniswapBuyExactlyParamsAmountOut$Outbound = number | string;
75
+ export type UniswapBuyExactlyParamsAmount$Outbound = number | string;
76
76
 
77
77
  /** @internal */
78
- export const UniswapBuyExactlyParamsAmountOut$outboundSchema: z.ZodType<
79
- UniswapBuyExactlyParamsAmountOut$Outbound,
78
+ export const UniswapBuyExactlyParamsAmount$outboundSchema: z.ZodType<
79
+ UniswapBuyExactlyParamsAmount$Outbound,
80
80
  z.ZodTypeDef,
81
- UniswapBuyExactlyParamsAmountOut
81
+ UniswapBuyExactlyParamsAmount
82
82
  > = z.union([z.number(), z.string()]);
83
83
 
84
84
  /**
85
85
  * @internal
86
86
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
87
87
  */
88
- export namespace UniswapBuyExactlyParamsAmountOut$ {
89
- /** @deprecated use `UniswapBuyExactlyParamsAmountOut$inboundSchema` instead. */
90
- export const inboundSchema = UniswapBuyExactlyParamsAmountOut$inboundSchema;
91
- /** @deprecated use `UniswapBuyExactlyParamsAmountOut$outboundSchema` instead. */
92
- export const outboundSchema = UniswapBuyExactlyParamsAmountOut$outboundSchema;
93
- /** @deprecated use `UniswapBuyExactlyParamsAmountOut$Outbound` instead. */
94
- export type Outbound = UniswapBuyExactlyParamsAmountOut$Outbound;
88
+ export namespace UniswapBuyExactlyParamsAmount$ {
89
+ /** @deprecated use `UniswapBuyExactlyParamsAmount$inboundSchema` instead. */
90
+ export const inboundSchema = UniswapBuyExactlyParamsAmount$inboundSchema;
91
+ /** @deprecated use `UniswapBuyExactlyParamsAmount$outboundSchema` instead. */
92
+ export const outboundSchema = UniswapBuyExactlyParamsAmount$outboundSchema;
93
+ /** @deprecated use `UniswapBuyExactlyParamsAmount$Outbound` instead. */
94
+ export type Outbound = UniswapBuyExactlyParamsAmount$Outbound;
95
95
  }
96
96
 
97
- export function uniswapBuyExactlyParamsAmountOutToJSON(
98
- uniswapBuyExactlyParamsAmountOut: UniswapBuyExactlyParamsAmountOut,
97
+ export function uniswapBuyExactlyParamsAmountToJSON(
98
+ uniswapBuyExactlyParamsAmount: UniswapBuyExactlyParamsAmount,
99
99
  ): string {
100
100
  return JSON.stringify(
101
- UniswapBuyExactlyParamsAmountOut$outboundSchema.parse(
102
- uniswapBuyExactlyParamsAmountOut,
101
+ UniswapBuyExactlyParamsAmount$outboundSchema.parse(
102
+ uniswapBuyExactlyParamsAmount,
103
103
  ),
104
104
  );
105
105
  }
106
106
 
107
- export function uniswapBuyExactlyParamsAmountOutFromJSON(
107
+ export function uniswapBuyExactlyParamsAmountFromJSON(
108
108
  jsonString: string,
109
- ): SafeParseResult<UniswapBuyExactlyParamsAmountOut, SDKValidationError> {
109
+ ): SafeParseResult<UniswapBuyExactlyParamsAmount, SDKValidationError> {
110
110
  return safeParse(
111
111
  jsonString,
112
- (x) => UniswapBuyExactlyParamsAmountOut$inboundSchema.parse(JSON.parse(x)),
113
- `Failed to parse 'UniswapBuyExactlyParamsAmountOut' from JSON`,
112
+ (x) => UniswapBuyExactlyParamsAmount$inboundSchema.parse(JSON.parse(x)),
113
+ `Failed to parse 'UniswapBuyExactlyParamsAmount' from JSON`,
114
114
  );
115
115
  }
116
116
 
@@ -123,14 +123,13 @@ export const UniswapBuyExactlyParams$inboundSchema: z.ZodType<
123
123
  token_in: TokenEnum$inboundSchema,
124
124
  token_out: TokenEnum$inboundSchema,
125
125
  fee: FeeEnum$inboundSchema,
126
- amount_out: z.union([z.number(), z.string()]),
126
+ amount: z.union([z.number(), z.string()]),
127
127
  max_slippage_percent: z.number(),
128
128
  wrap_eth: z.boolean().default(false),
129
129
  }).transform((v) => {
130
130
  return remap$(v, {
131
131
  "token_in": "tokenIn",
132
132
  "token_out": "tokenOut",
133
- "amount_out": "amountOut",
134
133
  "max_slippage_percent": "maxSlippagePercent",
135
134
  "wrap_eth": "wrapEth",
136
135
  });
@@ -141,7 +140,7 @@ export type UniswapBuyExactlyParams$Outbound = {
141
140
  token_in: string;
142
141
  token_out: string;
143
142
  fee: string;
144
- amount_out: number | string;
143
+ amount: number | string;
145
144
  max_slippage_percent: number;
146
145
  wrap_eth: boolean;
147
146
  };
@@ -155,14 +154,13 @@ export const UniswapBuyExactlyParams$outboundSchema: z.ZodType<
155
154
  tokenIn: TokenEnum$outboundSchema,
156
155
  tokenOut: TokenEnum$outboundSchema,
157
156
  fee: FeeEnum$outboundSchema,
158
- amountOut: z.union([z.number(), z.string()]),
157
+ amount: z.union([z.number(), z.string()]),
159
158
  maxSlippagePercent: z.number(),
160
159
  wrapEth: z.boolean().default(false),
161
160
  }).transform((v) => {
162
161
  return remap$(v, {
163
162
  tokenIn: "token_in",
164
163
  tokenOut: "token_out",
165
- amountOut: "amount_out",
166
164
  maxSlippagePercent: "max_slippage_percent",
167
165
  wrapEth: "wrap_eth",
168
166
  });