@compass-labs/api-sdk 0.0.16 → 0.0.18

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 (237) hide show
  1. package/README.md +2 -0
  2. package/bin/mcp-server.js +898 -447
  3. package/bin/mcp-server.js.map +29 -13
  4. package/dist/commonjs/funcs/aaveV3HistoricalTransactions.d.ts +23 -0
  5. package/dist/commonjs/funcs/aaveV3HistoricalTransactions.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/aaveV3HistoricalTransactions.js +128 -0
  7. package/dist/commonjs/funcs/aaveV3HistoricalTransactions.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/server.js +3 -1
  13. package/dist/commonjs/mcp-server/server.js.map +1 -1
  14. package/dist/commonjs/mcp-server/tools/aaveV3HistoricalTransactions.d.ts +8 -0
  15. package/dist/commonjs/mcp-server/tools/aaveV3HistoricalTransactions.d.ts.map +1 -0
  16. package/dist/commonjs/mcp-server/tools/aaveV3HistoricalTransactions.js +69 -0
  17. package/dist/commonjs/mcp-server/tools/aaveV3HistoricalTransactions.js.map +1 -0
  18. package/dist/commonjs/models/components/aavehistoricaltransactionbase.d.ts +57 -0
  19. package/dist/commonjs/models/components/aavehistoricaltransactionbase.d.ts.map +1 -0
  20. package/dist/commonjs/models/components/aavehistoricaltransactionbase.js +97 -0
  21. package/dist/commonjs/models/components/aavehistoricaltransactionbase.js.map +1 -0
  22. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.d.ts +39 -0
  23. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.d.ts.map +1 -0
  24. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.js +76 -0
  25. package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.js.map +1 -0
  26. package/dist/commonjs/models/components/action.d.ts +43 -0
  27. package/dist/commonjs/models/components/action.d.ts.map +1 -0
  28. package/dist/commonjs/models/components/action.js +66 -0
  29. package/dist/commonjs/models/components/action.js.map +1 -0
  30. package/dist/commonjs/models/components/borrow.d.ts +42 -0
  31. package/dist/commonjs/models/components/borrow.d.ts.map +1 -0
  32. package/dist/commonjs/models/components/borrow.js +83 -0
  33. package/dist/commonjs/models/components/borrow.js.map +1 -0
  34. package/dist/commonjs/models/components/collateralreserve.d.ts +31 -0
  35. package/dist/commonjs/models/components/collateralreserve.d.ts.map +1 -0
  36. package/dist/commonjs/models/components/collateralreserve.js +71 -0
  37. package/dist/commonjs/models/components/collateralreserve.js.map +1 -0
  38. package/dist/commonjs/models/components/index.d.ts +13 -0
  39. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  40. package/dist/commonjs/models/components/index.js +13 -0
  41. package/dist/commonjs/models/components/index.js.map +1 -1
  42. package/dist/commonjs/models/components/liquidationcall.d.ts +41 -0
  43. package/dist/commonjs/models/components/liquidationcall.d.ts.map +1 -0
  44. package/dist/commonjs/models/components/liquidationcall.js +81 -0
  45. package/dist/commonjs/models/components/liquidationcall.js.map +1 -0
  46. package/dist/commonjs/models/components/multicallauthorizationrequest.d.ts +2 -0
  47. package/dist/commonjs/models/components/multicallauthorizationrequest.d.ts.map +1 -1
  48. package/dist/commonjs/models/components/multicallauthorizationrequest.js.map +1 -1
  49. package/dist/commonjs/models/components/principalreserve.d.ts +31 -0
  50. package/dist/commonjs/models/components/principalreserve.d.ts.map +1 -0
  51. package/dist/commonjs/models/components/principalreserve.js +71 -0
  52. package/dist/commonjs/models/components/principalreserve.js.map +1 -0
  53. package/dist/commonjs/models/components/redeemunderlying.d.ts +34 -0
  54. package/dist/commonjs/models/components/redeemunderlying.d.ts.map +1 -0
  55. package/dist/commonjs/models/components/redeemunderlying.js +74 -0
  56. package/dist/commonjs/models/components/redeemunderlying.js.map +1 -0
  57. package/dist/commonjs/models/components/repay.d.ts +34 -0
  58. package/dist/commonjs/models/components/repay.d.ts.map +1 -0
  59. package/dist/commonjs/models/components/repay.js +75 -0
  60. package/dist/commonjs/models/components/repay.js.map +1 -0
  61. package/dist/commonjs/models/components/reserve.d.ts +31 -0
  62. package/dist/commonjs/models/components/reserve.d.ts.map +1 -0
  63. package/dist/commonjs/models/components/reserve.js +71 -0
  64. package/dist/commonjs/models/components/reserve.js.map +1 -0
  65. package/dist/commonjs/models/components/supply.d.ts +34 -0
  66. package/dist/commonjs/models/components/supply.d.ts.map +1 -0
  67. package/dist/commonjs/models/components/supply.js +75 -0
  68. package/dist/commonjs/models/components/supply.js.map +1 -0
  69. package/dist/commonjs/models/components/swapborrowrate.d.ts +38 -0
  70. package/dist/commonjs/models/components/swapborrowrate.d.ts.map +1 -0
  71. package/dist/commonjs/models/components/swapborrowrate.js +78 -0
  72. package/dist/commonjs/models/components/swapborrowrate.js.map +1 -0
  73. package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts +3 -27
  74. package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
  75. package/dist/commonjs/models/components/uniswapbuyexactlyparams.js +5 -28
  76. package/dist/commonjs/models/components/uniswapbuyexactlyparams.js.map +1 -1
  77. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts +3 -27
  78. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
  79. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js +5 -28
  80. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js.map +1 -1
  81. package/dist/commonjs/models/components/uniswapsellexactlyparams.d.ts +18 -42
  82. package/dist/commonjs/models/components/uniswapsellexactlyparams.d.ts.map +1 -1
  83. package/dist/commonjs/models/components/uniswapsellexactlyparams.js +22 -47
  84. package/dist/commonjs/models/components/uniswapsellexactlyparams.js.map +1 -1
  85. package/dist/commonjs/models/components/uniswapsellexactlyrequest.d.ts +18 -42
  86. package/dist/commonjs/models/components/uniswapsellexactlyrequest.d.ts.map +1 -1
  87. package/dist/commonjs/models/components/uniswapsellexactlyrequest.js +22 -47
  88. package/dist/commonjs/models/components/uniswapsellexactlyrequest.js.map +1 -1
  89. package/dist/commonjs/models/components/usageascollateral.d.ts +34 -0
  90. package/dist/commonjs/models/components/usageascollateral.d.ts.map +1 -0
  91. package/dist/commonjs/models/components/usageascollateral.js +74 -0
  92. package/dist/commonjs/models/components/usageascollateral.js.map +1 -0
  93. package/dist/commonjs/models/operations/aavehistoricaltransactions.d.ts +73 -0
  94. package/dist/commonjs/models/operations/aavehistoricaltransactions.d.ts.map +1 -0
  95. package/dist/commonjs/models/operations/aavehistoricaltransactions.js +107 -0
  96. package/dist/commonjs/models/operations/aavehistoricaltransactions.js.map +1 -0
  97. package/dist/commonjs/models/operations/index.d.ts +1 -0
  98. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  99. package/dist/commonjs/models/operations/index.js +1 -0
  100. package/dist/commonjs/models/operations/index.js.map +1 -1
  101. package/dist/commonjs/sdk/aavev3.d.ts +12 -0
  102. package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
  103. package/dist/commonjs/sdk/aavev3.js +15 -0
  104. package/dist/commonjs/sdk/aavev3.js.map +1 -1
  105. package/dist/esm/funcs/aaveV3HistoricalTransactions.d.ts +23 -0
  106. package/dist/esm/funcs/aaveV3HistoricalTransactions.d.ts.map +1 -0
  107. package/dist/esm/funcs/aaveV3HistoricalTransactions.js +92 -0
  108. package/dist/esm/funcs/aaveV3HistoricalTransactions.js.map +1 -0
  109. package/dist/esm/lib/config.d.ts +2 -2
  110. package/dist/esm/lib/config.js +2 -2
  111. package/dist/esm/mcp-server/mcp-server.js +1 -1
  112. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  113. package/dist/esm/mcp-server/server.js +3 -1
  114. package/dist/esm/mcp-server/server.js.map +1 -1
  115. package/dist/esm/mcp-server/tools/aaveV3HistoricalTransactions.d.ts +8 -0
  116. package/dist/esm/mcp-server/tools/aaveV3HistoricalTransactions.d.ts.map +1 -0
  117. package/dist/esm/mcp-server/tools/aaveV3HistoricalTransactions.js +33 -0
  118. package/dist/esm/mcp-server/tools/aaveV3HistoricalTransactions.js.map +1 -0
  119. package/dist/esm/models/components/aavehistoricaltransactionbase.d.ts +57 -0
  120. package/dist/esm/models/components/aavehistoricaltransactionbase.d.ts.map +1 -0
  121. package/dist/esm/models/components/aavehistoricaltransactionbase.js +59 -0
  122. package/dist/esm/models/components/aavehistoricaltransactionbase.js.map +1 -0
  123. package/dist/esm/models/components/aavehistoricaltransactionsresponse.d.ts +39 -0
  124. package/dist/esm/models/components/aavehistoricaltransactionsresponse.d.ts.map +1 -0
  125. package/dist/esm/models/components/aavehistoricaltransactionsresponse.js +38 -0
  126. package/dist/esm/models/components/aavehistoricaltransactionsresponse.js.map +1 -0
  127. package/dist/esm/models/components/action.d.ts +43 -0
  128. package/dist/esm/models/components/action.d.ts.map +1 -0
  129. package/dist/esm/models/components/action.js +30 -0
  130. package/dist/esm/models/components/action.js.map +1 -0
  131. package/dist/esm/models/components/borrow.d.ts +42 -0
  132. package/dist/esm/models/components/borrow.d.ts.map +1 -0
  133. package/dist/esm/models/components/borrow.js +45 -0
  134. package/dist/esm/models/components/borrow.js.map +1 -0
  135. package/dist/esm/models/components/collateralreserve.d.ts +31 -0
  136. package/dist/esm/models/components/collateralreserve.d.ts.map +1 -0
  137. package/dist/esm/models/components/collateralreserve.js +33 -0
  138. package/dist/esm/models/components/collateralreserve.js.map +1 -0
  139. package/dist/esm/models/components/index.d.ts +13 -0
  140. package/dist/esm/models/components/index.d.ts.map +1 -1
  141. package/dist/esm/models/components/index.js +13 -0
  142. package/dist/esm/models/components/index.js.map +1 -1
  143. package/dist/esm/models/components/liquidationcall.d.ts +41 -0
  144. package/dist/esm/models/components/liquidationcall.d.ts.map +1 -0
  145. package/dist/esm/models/components/liquidationcall.js +43 -0
  146. package/dist/esm/models/components/liquidationcall.js.map +1 -0
  147. package/dist/esm/models/components/multicallauthorizationrequest.d.ts +2 -0
  148. package/dist/esm/models/components/multicallauthorizationrequest.d.ts.map +1 -1
  149. package/dist/esm/models/components/multicallauthorizationrequest.js.map +1 -1
  150. package/dist/esm/models/components/principalreserve.d.ts +31 -0
  151. package/dist/esm/models/components/principalreserve.d.ts.map +1 -0
  152. package/dist/esm/models/components/principalreserve.js +33 -0
  153. package/dist/esm/models/components/principalreserve.js.map +1 -0
  154. package/dist/esm/models/components/redeemunderlying.d.ts +34 -0
  155. package/dist/esm/models/components/redeemunderlying.d.ts.map +1 -0
  156. package/dist/esm/models/components/redeemunderlying.js +36 -0
  157. package/dist/esm/models/components/redeemunderlying.js.map +1 -0
  158. package/dist/esm/models/components/repay.d.ts +34 -0
  159. package/dist/esm/models/components/repay.d.ts.map +1 -0
  160. package/dist/esm/models/components/repay.js +37 -0
  161. package/dist/esm/models/components/repay.js.map +1 -0
  162. package/dist/esm/models/components/reserve.d.ts +31 -0
  163. package/dist/esm/models/components/reserve.d.ts.map +1 -0
  164. package/dist/esm/models/components/reserve.js +33 -0
  165. package/dist/esm/models/components/reserve.js.map +1 -0
  166. package/dist/esm/models/components/supply.d.ts +34 -0
  167. package/dist/esm/models/components/supply.d.ts.map +1 -0
  168. package/dist/esm/models/components/supply.js +37 -0
  169. package/dist/esm/models/components/supply.js.map +1 -0
  170. package/dist/esm/models/components/swapborrowrate.d.ts +38 -0
  171. package/dist/esm/models/components/swapborrowrate.d.ts.map +1 -0
  172. package/dist/esm/models/components/swapborrowrate.js +40 -0
  173. package/dist/esm/models/components/swapborrowrate.js.map +1 -0
  174. package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts +3 -27
  175. package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
  176. package/dist/esm/models/components/uniswapbuyexactlyparams.js +4 -25
  177. package/dist/esm/models/components/uniswapbuyexactlyparams.js.map +1 -1
  178. package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts +3 -27
  179. package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
  180. package/dist/esm/models/components/uniswapbuyexactlyrequest.js +4 -25
  181. package/dist/esm/models/components/uniswapbuyexactlyrequest.js.map +1 -1
  182. package/dist/esm/models/components/uniswapsellexactlyparams.d.ts +18 -42
  183. package/dist/esm/models/components/uniswapsellexactlyparams.d.ts.map +1 -1
  184. package/dist/esm/models/components/uniswapsellexactlyparams.js +19 -42
  185. package/dist/esm/models/components/uniswapsellexactlyparams.js.map +1 -1
  186. package/dist/esm/models/components/uniswapsellexactlyrequest.d.ts +18 -42
  187. package/dist/esm/models/components/uniswapsellexactlyrequest.d.ts.map +1 -1
  188. package/dist/esm/models/components/uniswapsellexactlyrequest.js +19 -42
  189. package/dist/esm/models/components/uniswapsellexactlyrequest.js.map +1 -1
  190. package/dist/esm/models/components/usageascollateral.d.ts +34 -0
  191. package/dist/esm/models/components/usageascollateral.d.ts.map +1 -0
  192. package/dist/esm/models/components/usageascollateral.js +36 -0
  193. package/dist/esm/models/components/usageascollateral.js.map +1 -0
  194. package/dist/esm/models/operations/aavehistoricaltransactions.d.ts +73 -0
  195. package/dist/esm/models/operations/aavehistoricaltransactions.d.ts.map +1 -0
  196. package/dist/esm/models/operations/aavehistoricaltransactions.js +69 -0
  197. package/dist/esm/models/operations/aavehistoricaltransactions.js.map +1 -0
  198. package/dist/esm/models/operations/index.d.ts +1 -0
  199. package/dist/esm/models/operations/index.d.ts.map +1 -1
  200. package/dist/esm/models/operations/index.js +1 -0
  201. package/dist/esm/models/operations/index.js.map +1 -1
  202. package/dist/esm/sdk/aavev3.d.ts +12 -0
  203. package/dist/esm/sdk/aavev3.d.ts.map +1 -1
  204. package/dist/esm/sdk/aavev3.js +15 -0
  205. package/dist/esm/sdk/aavev3.js.map +1 -1
  206. package/docs/sdks/aavev3/README.md +85 -0
  207. package/docs/sdks/transactionbatching/README.md +2 -2
  208. package/docs/sdks/uniswapv3/README.md +6 -6
  209. package/jsr.json +1 -1
  210. package/package.json +1 -1
  211. package/src/funcs/aaveV3HistoricalTransactions.ts +177 -0
  212. package/src/lib/config.ts +2 -2
  213. package/src/mcp-server/mcp-server.ts +1 -1
  214. package/src/mcp-server/server.ts +3 -1
  215. package/src/mcp-server/tools/aaveV3HistoricalTransactions.ts +42 -0
  216. package/src/models/components/aavehistoricaltransactionbase.ts +155 -0
  217. package/src/models/components/aavehistoricaltransactionsresponse.ts +91 -0
  218. package/src/models/components/action.ts +36 -0
  219. package/src/models/components/borrow.ts +89 -0
  220. package/src/models/components/collateralreserve.ts +70 -0
  221. package/src/models/components/index.ts +13 -0
  222. package/src/models/components/liquidationcall.ts +96 -0
  223. package/src/models/components/multicallauthorizationrequest.ts +2 -0
  224. package/src/models/components/principalreserve.ts +70 -0
  225. package/src/models/components/redeemunderlying.ts +80 -0
  226. package/src/models/components/repay.ts +73 -0
  227. package/src/models/components/reserve.ts +63 -0
  228. package/src/models/components/supply.ts +73 -0
  229. package/src/models/components/swapborrowrate.ts +84 -0
  230. package/src/models/components/uniswapbuyexactlyparams.ts +7 -66
  231. package/src/models/components/uniswapbuyexactlyrequest.ts +7 -71
  232. package/src/models/components/uniswapsellexactlyparams.ts +33 -99
  233. package/src/models/components/uniswapsellexactlyrequest.ts +33 -103
  234. package/src/models/components/usageascollateral.ts +80 -0
  235. package/src/models/operations/aavehistoricaltransactions.ts +136 -0
  236. package/src/models/operations/index.ts +1 -0
  237. package/src/sdk/aavev3.ts +23 -0
@@ -9,6 +9,7 @@
9
9
  * [liquidityChange](#liquiditychange) - Liquidity index
10
10
  * [userPositionSummary](#userpositionsummary) - Positions - total
11
11
  * [userPositionPerToken](#userpositionpertoken) - Positions - per token
12
+ * [historicalTransactions](#historicaltransactions) - Historical transactions
12
13
  * [supply](#supply) - Supply/Lend
13
14
  * [borrow](#borrow) - Borrow
14
15
  * [repay](#repay) - Repay loans
@@ -368,6 +369,90 @@ run();
368
369
  | errors.HTTPValidationError | 422 | application/json |
369
370
  | errors.APIError | 4XX, 5XX | \*/\* |
370
371
 
372
+ ## historicalTransactions
373
+
374
+ This endpoint retrieves historical transactions for a user on the AAVE platform.
375
+
376
+ It returns a list of transactions including deposits, withdrawals, borrows, and
377
+ repayments. Each transaction includes details such as the token, amount, timestamp,
378
+ and transaction type. This provides a comprehensive view of the user's historical
379
+ activity within the AAVE protocol.
380
+
381
+ ### Example Usage
382
+
383
+ ```typescript
384
+ import { CompassApiSDK } from "@compass-labs/api-sdk";
385
+
386
+ const compassApiSDK = new CompassApiSDK({
387
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
388
+ });
389
+
390
+ async function run() {
391
+ const result = await compassApiSDK.aaveV3.historicalTransactions({
392
+ chain: "arbitrum:mainnet",
393
+ userAddress: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
394
+ });
395
+
396
+ // Handle the result
397
+ console.log(result);
398
+ }
399
+
400
+ run();
401
+ ```
402
+
403
+ ### Standalone function
404
+
405
+ The standalone function version of this method:
406
+
407
+ ```typescript
408
+ import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
409
+ import { aaveV3HistoricalTransactions } from "@compass-labs/api-sdk/funcs/aaveV3HistoricalTransactions.js";
410
+
411
+ // Use `CompassApiSDKCore` for best tree-shaking performance.
412
+ // You can create one instance of it to use across an application.
413
+ const compassApiSDK = new CompassApiSDKCore({
414
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
415
+ });
416
+
417
+ async function run() {
418
+ const res = await aaveV3HistoricalTransactions(compassApiSDK, {
419
+ chain: "arbitrum:mainnet",
420
+ userAddress: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
421
+ });
422
+
423
+ if (!res.ok) {
424
+ throw res.error;
425
+ }
426
+
427
+ const { value: result } = res;
428
+
429
+ // Handle the result
430
+ console.log(result);
431
+ }
432
+
433
+ run();
434
+ ```
435
+
436
+ ### Parameters
437
+
438
+ | Parameter | Type | Required | Description |
439
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
440
+ | `request` | [operations.AaveHistoricalTransactionsRequest](../../models/operations/aavehistoricaltransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
441
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
442
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
443
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
444
+
445
+ ### Response
446
+
447
+ **Promise\<[components.AaveHistoricalTransactionsResponse](../../models/components/aavehistoricaltransactionsresponse.md)\>**
448
+
449
+ ### Errors
450
+
451
+ | Error Type | Status Code | Content Type |
452
+ | -------------------------- | -------------------------- | -------------------------- |
453
+ | errors.HTTPValidationError | 422 | application/json |
454
+ | errors.APIError | 4XX, 5XX | \*/\* |
455
+
371
456
  ## supply
372
457
 
373
458
  By supplying assets, users can earn interest on their deposits.
@@ -130,7 +130,7 @@ async function run() {
130
130
  tokenOut: "USDC",
131
131
  fee: "0.01",
132
132
  amountOut: 1.5,
133
- amountInMaximum: 1.6,
133
+ maxSlippagePercent: 0.5,
134
134
  wrapEth: true,
135
135
  },
136
136
  },
@@ -178,7 +178,7 @@ async function run() {
178
178
  tokenOut: "USDC",
179
179
  fee: "0.01",
180
180
  amountOut: 1.5,
181
- amountInMaximum: 1.6,
181
+ maxSlippagePercent: 0.5,
182
182
  wrapEth: true,
183
183
  },
184
184
  },
@@ -473,7 +473,7 @@ async function run() {
473
473
  tokenOut: "cbETH",
474
474
  fee: "1.0",
475
475
  amountOut: 1.5,
476
- amountInMaximum: 1.6,
476
+ maxSlippagePercent: 0.5,
477
477
  chain: "ethereum:mainnet",
478
478
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
479
479
  });
@@ -505,7 +505,7 @@ async function run() {
505
505
  tokenOut: "cbETH",
506
506
  fee: "1.0",
507
507
  amountOut: 1.5,
508
- amountInMaximum: 1.6,
508
+ maxSlippagePercent: 0.5,
509
509
  chain: "ethereum:mainnet",
510
510
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
511
511
  });
@@ -567,8 +567,8 @@ async function run() {
567
567
  tokenIn: "FXS",
568
568
  tokenOut: "LUSD",
569
569
  fee: "0.05",
570
- amountIn: 1.5,
571
- amountOutMinimum: 1.4,
570
+ amount: 1.5,
571
+ maxSlippagePercent: 0.5,
572
572
  chain: "arbitrum:mainnet",
573
573
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
574
574
  });
@@ -599,8 +599,8 @@ async function run() {
599
599
  tokenIn: "FXS",
600
600
  tokenOut: "LUSD",
601
601
  fee: "0.05",
602
- amountIn: 1.5,
603
- amountOutMinimum: 1.4,
602
+ amount: 1.5,
603
+ maxSlippagePercent: 0.5,
604
604
  chain: "arbitrum:mainnet",
605
605
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
606
606
  });
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@compass-labs/api-sdk",
5
- "version": "0.0.16",
5
+ "version": "0.0.18",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,177 @@
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 * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import { APIError } from "../models/errors/apierror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Historical transactions
30
+ *
31
+ * @remarks
32
+ * This endpoint retrieves historical transactions for a user on the AAVE platform.
33
+ *
34
+ * It returns a list of transactions including deposits, withdrawals, borrows, and
35
+ * repayments. Each transaction includes details such as the token, amount, timestamp,
36
+ * and transaction type. This provides a comprehensive view of the user's historical
37
+ * activity within the AAVE protocol.
38
+ */
39
+ export function aaveV3HistoricalTransactions(
40
+ client: CompassApiSDKCore,
41
+ request: operations.AaveHistoricalTransactionsRequest,
42
+ options?: RequestOptions,
43
+ ): APIPromise<
44
+ Result<
45
+ components.AaveHistoricalTransactionsResponse,
46
+ | errors.HTTPValidationError
47
+ | APIError
48
+ | SDKValidationError
49
+ | UnexpectedClientError
50
+ | InvalidRequestError
51
+ | RequestAbortedError
52
+ | RequestTimeoutError
53
+ | ConnectionError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: CompassApiSDKCore,
65
+ request: operations.AaveHistoricalTransactionsRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ components.AaveHistoricalTransactionsResponse,
71
+ | errors.HTTPValidationError
72
+ | APIError
73
+ | SDKValidationError
74
+ | UnexpectedClientError
75
+ | InvalidRequestError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | ConnectionError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) =>
86
+ operations.AaveHistoricalTransactionsRequest$outboundSchema.parse(value),
87
+ "Input validation failed",
88
+ );
89
+ if (!parsed.ok) {
90
+ return [parsed, { status: "invalid" }];
91
+ }
92
+ const payload = parsed.value;
93
+ const body = null;
94
+
95
+ const path = pathToFunc("/v0/aave/historical_transactions/get")();
96
+
97
+ const query = encodeFormQuery({
98
+ "chain": payload.chain,
99
+ "limit": payload.limit,
100
+ "offset": payload.offset,
101
+ "user_address": payload.user_address,
102
+ });
103
+
104
+ const headers = new Headers(compactMap({
105
+ Accept: "application/json",
106
+ }));
107
+
108
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
109
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
110
+ const requestSecurity = resolveGlobalSecurity(securityInput);
111
+
112
+ const context = {
113
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
114
+ operationID: "aave_historical_transactions",
115
+ oAuth2Scopes: [],
116
+
117
+ resolvedSecurity: requestSecurity,
118
+
119
+ securitySource: client._options.apiKeyAuth,
120
+ retryConfig: options?.retries
121
+ || client._options.retryConfig
122
+ || { strategy: "none" },
123
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
124
+ };
125
+
126
+ const requestRes = client._createRequest(context, {
127
+ security: requestSecurity,
128
+ method: "GET",
129
+ baseURL: options?.serverURL,
130
+ path: path,
131
+ headers: headers,
132
+ query: query,
133
+ body: body,
134
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
135
+ }, options);
136
+ if (!requestRes.ok) {
137
+ return [requestRes, { status: "invalid" }];
138
+ }
139
+ const req = requestRes.value;
140
+
141
+ const doResult = await client._do(req, {
142
+ context,
143
+ errorCodes: ["422", "4XX", "5XX"],
144
+ retryConfig: context.retryConfig,
145
+ retryCodes: context.retryCodes,
146
+ });
147
+ if (!doResult.ok) {
148
+ return [doResult, { status: "request-error", request: req }];
149
+ }
150
+ const response = doResult.value;
151
+
152
+ const responseFields = {
153
+ HttpMeta: { Response: response, Request: req },
154
+ };
155
+
156
+ const [result] = await M.match<
157
+ components.AaveHistoricalTransactionsResponse,
158
+ | errors.HTTPValidationError
159
+ | APIError
160
+ | SDKValidationError
161
+ | UnexpectedClientError
162
+ | InvalidRequestError
163
+ | RequestAbortedError
164
+ | RequestTimeoutError
165
+ | ConnectionError
166
+ >(
167
+ M.json(200, components.AaveHistoricalTransactionsResponse$inboundSchema),
168
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
169
+ M.fail("4XX"),
170
+ M.fail("5XX"),
171
+ )(response, { extraFields: responseFields });
172
+ if (!result.ok) {
173
+ return [result, { status: "complete", request: req, response }];
174
+ }
175
+
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
package/src/lib/config.ts CHANGED
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
57
57
  export const SDK_METADATA = {
58
58
  language: "typescript",
59
59
  openapiDocVersion: "0.0.1",
60
- sdkVersion: "0.0.16",
60
+ sdkVersion: "0.0.18",
61
61
  genVersion: "2.597.9",
62
62
  userAgent:
63
- "speakeasy-sdk/typescript 0.0.16 2.597.9 0.0.1 @compass-labs/api-sdk",
63
+ "speakeasy-sdk/typescript 0.0.18 2.597.9 0.0.1 @compass-labs/api-sdk",
64
64
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.0.16",
22
+ currentVersion: "0.0.18",
23
23
  },
24
24
  });
25
25
 
@@ -14,6 +14,7 @@ import {
14
14
  import { MCPScope } from "./scopes.js";
15
15
  import { createRegisterTool } from "./tools.js";
16
16
  import { tool$aaveV3Borrow } from "./tools/aaveV3Borrow.js";
17
+ import { tool$aaveV3HistoricalTransactions } from "./tools/aaveV3HistoricalTransactions.js";
17
18
  import { tool$aaveV3LiquidityChange } from "./tools/aaveV3LiquidityChange.js";
18
19
  import { tool$aaveV3Repay } from "./tools/aaveV3Repay.js";
19
20
  import { tool$aaveV3Supply } from "./tools/aaveV3Supply.js";
@@ -79,7 +80,7 @@ export function createMCPServer(deps: {
79
80
  }) {
80
81
  const server = new McpServer({
81
82
  name: "CompassApiSDK",
82
- version: "0.0.16",
83
+ version: "0.0.18",
83
84
  });
84
85
 
85
86
  const client = new CompassApiSDKCore({
@@ -113,6 +114,7 @@ export function createMCPServer(deps: {
113
114
  tool(tool$aaveV3LiquidityChange);
114
115
  tool(tool$aaveV3UserPositionSummary);
115
116
  tool(tool$aaveV3UserPositionPerToken);
117
+ tool(tool$aaveV3HistoricalTransactions);
116
118
  tool(tool$aaveV3Supply);
117
119
  tool(tool$aaveV3Borrow);
118
120
  tool(tool$aaveV3Repay);
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { aaveV3HistoricalTransactions } from "../../funcs/aaveV3HistoricalTransactions.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.AaveHistoricalTransactionsRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$aaveV3HistoricalTransactions: ToolDefinition<typeof args> = {
14
+ name: "aave-v3-historical-transactions",
15
+ description: `Historical transactions
16
+
17
+ This endpoint retrieves historical transactions for a user on the AAVE platform.
18
+
19
+ It returns a list of transactions including deposits, withdrawals, borrows, and
20
+ repayments. Each transaction includes details such as the token, amount, timestamp,
21
+ and transaction type. This provides a comprehensive view of the user's historical
22
+ activity within the AAVE protocol.`,
23
+ args,
24
+ tool: async (client, args, ctx) => {
25
+ const [result, apiCall] = await aaveV3HistoricalTransactions(
26
+ client,
27
+ args.request,
28
+ { fetchOptions: { signal: ctx.signal } },
29
+ ).$inspect();
30
+
31
+ if (!result.ok) {
32
+ return {
33
+ content: [{ type: "text", text: result.error.message }],
34
+ isError: true,
35
+ };
36
+ }
37
+
38
+ const value = result.value;
39
+
40
+ return formatResult(value, apiCall);
41
+ },
42
+ };
@@ -0,0 +1,155 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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
+ Action,
11
+ Action$inboundSchema,
12
+ Action$outboundSchema,
13
+ } from "./action.js";
14
+ import {
15
+ Borrow,
16
+ Borrow$inboundSchema,
17
+ Borrow$Outbound,
18
+ Borrow$outboundSchema,
19
+ } from "./borrow.js";
20
+ import {
21
+ LiquidationCall,
22
+ LiquidationCall$inboundSchema,
23
+ LiquidationCall$Outbound,
24
+ LiquidationCall$outboundSchema,
25
+ } from "./liquidationcall.js";
26
+ import {
27
+ RedeemUnderlying,
28
+ RedeemUnderlying$inboundSchema,
29
+ RedeemUnderlying$Outbound,
30
+ RedeemUnderlying$outboundSchema,
31
+ } from "./redeemunderlying.js";
32
+ import {
33
+ Repay,
34
+ Repay$inboundSchema,
35
+ Repay$Outbound,
36
+ Repay$outboundSchema,
37
+ } from "./repay.js";
38
+ import {
39
+ Supply,
40
+ Supply$inboundSchema,
41
+ Supply$Outbound,
42
+ Supply$outboundSchema,
43
+ } from "./supply.js";
44
+ import {
45
+ SwapBorrowRate,
46
+ SwapBorrowRate$inboundSchema,
47
+ SwapBorrowRate$Outbound,
48
+ SwapBorrowRate$outboundSchema,
49
+ } from "./swapborrowrate.js";
50
+ import {
51
+ UsageAsCollateral,
52
+ UsageAsCollateral$inboundSchema,
53
+ UsageAsCollateral$Outbound,
54
+ UsageAsCollateral$outboundSchema,
55
+ } from "./usageascollateral.js";
56
+
57
+ export type AaveHistoricalTransactionBase = {
58
+ id: string;
59
+ timestamp: number;
60
+ txHash: string;
61
+ action: Action;
62
+ supply?: Supply | null | undefined;
63
+ redeemUnderlying?: RedeemUnderlying | null | undefined;
64
+ borrow?: Borrow | null | undefined;
65
+ usageAsCollateral?: UsageAsCollateral | null | undefined;
66
+ repay?: Repay | null | undefined;
67
+ swapBorrowRate?: SwapBorrowRate | null | undefined;
68
+ liquidationCall?: LiquidationCall | null | undefined;
69
+ };
70
+
71
+ /** @internal */
72
+ export const AaveHistoricalTransactionBase$inboundSchema: z.ZodType<
73
+ AaveHistoricalTransactionBase,
74
+ z.ZodTypeDef,
75
+ unknown
76
+ > = z.object({
77
+ id: z.string(),
78
+ timestamp: z.number().int(),
79
+ txHash: z.string(),
80
+ action: Action$inboundSchema,
81
+ supply: z.nullable(Supply$inboundSchema).optional(),
82
+ redeemUnderlying: z.nullable(RedeemUnderlying$inboundSchema).optional(),
83
+ borrow: z.nullable(Borrow$inboundSchema).optional(),
84
+ usageAsCollateral: z.nullable(UsageAsCollateral$inboundSchema).optional(),
85
+ repay: z.nullable(Repay$inboundSchema).optional(),
86
+ swapBorrowRate: z.nullable(SwapBorrowRate$inboundSchema).optional(),
87
+ liquidationCall: z.nullable(LiquidationCall$inboundSchema).optional(),
88
+ });
89
+
90
+ /** @internal */
91
+ export type AaveHistoricalTransactionBase$Outbound = {
92
+ id: string;
93
+ timestamp: number;
94
+ txHash: string;
95
+ action: string;
96
+ supply?: Supply$Outbound | null | undefined;
97
+ redeemUnderlying?: RedeemUnderlying$Outbound | null | undefined;
98
+ borrow?: Borrow$Outbound | null | undefined;
99
+ usageAsCollateral?: UsageAsCollateral$Outbound | null | undefined;
100
+ repay?: Repay$Outbound | null | undefined;
101
+ swapBorrowRate?: SwapBorrowRate$Outbound | null | undefined;
102
+ liquidationCall?: LiquidationCall$Outbound | null | undefined;
103
+ };
104
+
105
+ /** @internal */
106
+ export const AaveHistoricalTransactionBase$outboundSchema: z.ZodType<
107
+ AaveHistoricalTransactionBase$Outbound,
108
+ z.ZodTypeDef,
109
+ AaveHistoricalTransactionBase
110
+ > = z.object({
111
+ id: z.string(),
112
+ timestamp: z.number().int(),
113
+ txHash: z.string(),
114
+ action: Action$outboundSchema,
115
+ supply: z.nullable(Supply$outboundSchema).optional(),
116
+ redeemUnderlying: z.nullable(RedeemUnderlying$outboundSchema).optional(),
117
+ borrow: z.nullable(Borrow$outboundSchema).optional(),
118
+ usageAsCollateral: z.nullable(UsageAsCollateral$outboundSchema).optional(),
119
+ repay: z.nullable(Repay$outboundSchema).optional(),
120
+ swapBorrowRate: z.nullable(SwapBorrowRate$outboundSchema).optional(),
121
+ liquidationCall: z.nullable(LiquidationCall$outboundSchema).optional(),
122
+ });
123
+
124
+ /**
125
+ * @internal
126
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
127
+ */
128
+ export namespace AaveHistoricalTransactionBase$ {
129
+ /** @deprecated use `AaveHistoricalTransactionBase$inboundSchema` instead. */
130
+ export const inboundSchema = AaveHistoricalTransactionBase$inboundSchema;
131
+ /** @deprecated use `AaveHistoricalTransactionBase$outboundSchema` instead. */
132
+ export const outboundSchema = AaveHistoricalTransactionBase$outboundSchema;
133
+ /** @deprecated use `AaveHistoricalTransactionBase$Outbound` instead. */
134
+ export type Outbound = AaveHistoricalTransactionBase$Outbound;
135
+ }
136
+
137
+ export function aaveHistoricalTransactionBaseToJSON(
138
+ aaveHistoricalTransactionBase: AaveHistoricalTransactionBase,
139
+ ): string {
140
+ return JSON.stringify(
141
+ AaveHistoricalTransactionBase$outboundSchema.parse(
142
+ aaveHistoricalTransactionBase,
143
+ ),
144
+ );
145
+ }
146
+
147
+ export function aaveHistoricalTransactionBaseFromJSON(
148
+ jsonString: string,
149
+ ): SafeParseResult<AaveHistoricalTransactionBase, SDKValidationError> {
150
+ return safeParse(
151
+ jsonString,
152
+ (x) => AaveHistoricalTransactionBase$inboundSchema.parse(JSON.parse(x)),
153
+ `Failed to parse 'AaveHistoricalTransactionBase' from JSON`,
154
+ );
155
+ }