@compass-labs/api-sdk 0.0.20 → 0.0.22

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 (208) hide show
  1. package/FUNCTIONS.md +2 -2
  2. package/README.md +9 -7
  3. package/bin/mcp-server.js +668 -892
  4. package/bin/mcp-server.js.map +18 -21
  5. package/dist/commonjs/funcs/aaveV3Rate.d.ts +31 -0
  6. package/dist/commonjs/funcs/aaveV3Rate.d.ts.map +1 -0
  7. package/dist/commonjs/funcs/aaveV3Rate.js +134 -0
  8. package/dist/commonjs/funcs/aaveV3Rate.js.map +1 -0
  9. package/dist/commonjs/funcs/skyBuy.d.ts +6 -2
  10. package/dist/commonjs/funcs/skyBuy.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/skyBuy.js +6 -2
  12. package/dist/commonjs/funcs/skyBuy.js.map +1 -1
  13. package/dist/commonjs/funcs/skySell.d.ts +6 -2
  14. package/dist/commonjs/funcs/skySell.d.ts.map +1 -1
  15. package/dist/commonjs/funcs/skySell.js +6 -2
  16. package/dist/commonjs/funcs/skySell.js.map +1 -1
  17. package/dist/commonjs/lib/config.d.ts +2 -2
  18. package/dist/commonjs/lib/config.js +2 -2
  19. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  20. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  21. package/dist/commonjs/mcp-server/server.js +3 -1
  22. package/dist/commonjs/mcp-server/server.js.map +1 -1
  23. package/dist/commonjs/mcp-server/tools/aaveV3Rate.d.ts +8 -0
  24. package/dist/commonjs/mcp-server/tools/aaveV3Rate.d.ts.map +1 -0
  25. package/dist/commonjs/mcp-server/tools/aaveV3Rate.js +77 -0
  26. package/dist/commonjs/mcp-server/tools/aaveV3Rate.js.map +1 -0
  27. package/dist/commonjs/mcp-server/tools/skyBuy.d.ts.map +1 -1
  28. package/dist/commonjs/mcp-server/tools/skyBuy.js +6 -2
  29. package/dist/commonjs/mcp-server/tools/skyBuy.js.map +1 -1
  30. package/dist/commonjs/mcp-server/tools/skySell.d.ts.map +1 -1
  31. package/dist/commonjs/mcp-server/tools/skySell.js +6 -2
  32. package/dist/commonjs/mcp-server/tools/skySell.js.map +1 -1
  33. package/dist/commonjs/models/components/aaverateresponse.d.ts +57 -0
  34. package/dist/commonjs/models/components/aaverateresponse.d.ts.map +1 -0
  35. package/dist/commonjs/models/components/aaverateresponse.js +98 -0
  36. package/dist/commonjs/models/components/aaverateresponse.js.map +1 -0
  37. package/dist/commonjs/models/components/index.d.ts +1 -7
  38. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/index.js +1 -7
  40. package/dist/commonjs/models/components/index.js.map +1 -1
  41. package/dist/commonjs/models/components/multicallaction.d.ts +4 -11
  42. package/dist/commonjs/models/components/multicallaction.d.ts.map +1 -1
  43. package/dist/commonjs/models/components/multicallaction.js +0 -35
  44. package/dist/commonjs/models/components/multicallaction.js.map +1 -1
  45. package/dist/commonjs/models/components/multicallactiontype.d.ts +0 -21
  46. package/dist/commonjs/models/components/multicallactiontype.d.ts.map +1 -1
  47. package/dist/commonjs/models/components/multicallactiontype.js +0 -7
  48. package/dist/commonjs/models/components/multicallactiontype.js.map +1 -1
  49. package/dist/commonjs/models/operations/aaverate.d.ts +244 -0
  50. package/dist/commonjs/models/operations/aaverate.d.ts.map +1 -0
  51. package/dist/commonjs/models/operations/aaverate.js +163 -0
  52. package/dist/commonjs/models/operations/aaverate.js.map +1 -0
  53. package/dist/commonjs/models/operations/index.d.ts +1 -0
  54. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  55. package/dist/commonjs/models/operations/index.js +1 -0
  56. package/dist/commonjs/models/operations/index.js.map +1 -1
  57. package/dist/commonjs/sdk/aavev3.d.ts +20 -0
  58. package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
  59. package/dist/commonjs/sdk/aavev3.js +23 -0
  60. package/dist/commonjs/sdk/aavev3.js.map +1 -1
  61. package/dist/commonjs/sdk/sky.d.ts +12 -4
  62. package/dist/commonjs/sdk/sky.d.ts.map +1 -1
  63. package/dist/commonjs/sdk/sky.js +12 -4
  64. package/dist/commonjs/sdk/sky.js.map +1 -1
  65. package/dist/esm/funcs/aaveV3Rate.d.ts +31 -0
  66. package/dist/esm/funcs/aaveV3Rate.d.ts.map +1 -0
  67. package/dist/esm/funcs/aaveV3Rate.js +98 -0
  68. package/dist/esm/funcs/aaveV3Rate.js.map +1 -0
  69. package/dist/esm/funcs/skyBuy.d.ts +6 -2
  70. package/dist/esm/funcs/skyBuy.d.ts.map +1 -1
  71. package/dist/esm/funcs/skyBuy.js +6 -2
  72. package/dist/esm/funcs/skyBuy.js.map +1 -1
  73. package/dist/esm/funcs/skySell.d.ts +6 -2
  74. package/dist/esm/funcs/skySell.d.ts.map +1 -1
  75. package/dist/esm/funcs/skySell.js +6 -2
  76. package/dist/esm/funcs/skySell.js.map +1 -1
  77. package/dist/esm/lib/config.d.ts +2 -2
  78. package/dist/esm/lib/config.js +2 -2
  79. package/dist/esm/mcp-server/mcp-server.js +1 -1
  80. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  81. package/dist/esm/mcp-server/server.js +3 -1
  82. package/dist/esm/mcp-server/server.js.map +1 -1
  83. package/dist/esm/mcp-server/tools/aaveV3Rate.d.ts +8 -0
  84. package/dist/esm/mcp-server/tools/aaveV3Rate.d.ts.map +1 -0
  85. package/dist/esm/mcp-server/tools/aaveV3Rate.js +41 -0
  86. package/dist/esm/mcp-server/tools/aaveV3Rate.js.map +1 -0
  87. package/dist/esm/mcp-server/tools/skyBuy.d.ts.map +1 -1
  88. package/dist/esm/mcp-server/tools/skyBuy.js +6 -2
  89. package/dist/esm/mcp-server/tools/skyBuy.js.map +1 -1
  90. package/dist/esm/mcp-server/tools/skySell.d.ts.map +1 -1
  91. package/dist/esm/mcp-server/tools/skySell.js +6 -2
  92. package/dist/esm/mcp-server/tools/skySell.js.map +1 -1
  93. package/dist/esm/models/components/aaverateresponse.d.ts +57 -0
  94. package/dist/esm/models/components/aaverateresponse.d.ts.map +1 -0
  95. package/dist/esm/models/components/aaverateresponse.js +60 -0
  96. package/dist/esm/models/components/aaverateresponse.js.map +1 -0
  97. package/dist/esm/models/components/index.d.ts +1 -7
  98. package/dist/esm/models/components/index.d.ts.map +1 -1
  99. package/dist/esm/models/components/index.js +1 -7
  100. package/dist/esm/models/components/index.js.map +1 -1
  101. package/dist/esm/models/components/multicallaction.d.ts +4 -11
  102. package/dist/esm/models/components/multicallaction.d.ts.map +1 -1
  103. package/dist/esm/models/components/multicallaction.js +0 -35
  104. package/dist/esm/models/components/multicallaction.js.map +1 -1
  105. package/dist/esm/models/components/multicallactiontype.d.ts +0 -21
  106. package/dist/esm/models/components/multicallactiontype.d.ts.map +1 -1
  107. package/dist/esm/models/components/multicallactiontype.js +0 -7
  108. package/dist/esm/models/components/multicallactiontype.js.map +1 -1
  109. package/dist/esm/models/operations/aaverate.d.ts +244 -0
  110. package/dist/esm/models/operations/aaverate.d.ts.map +1 -0
  111. package/dist/esm/models/operations/aaverate.js +125 -0
  112. package/dist/esm/models/operations/aaverate.js.map +1 -0
  113. package/dist/esm/models/operations/index.d.ts +1 -0
  114. package/dist/esm/models/operations/index.d.ts.map +1 -1
  115. package/dist/esm/models/operations/index.js +1 -0
  116. package/dist/esm/models/operations/index.js.map +1 -1
  117. package/dist/esm/sdk/aavev3.d.ts +20 -0
  118. package/dist/esm/sdk/aavev3.d.ts.map +1 -1
  119. package/dist/esm/sdk/aavev3.js +23 -0
  120. package/dist/esm/sdk/aavev3.js.map +1 -1
  121. package/dist/esm/sdk/sky.d.ts +12 -4
  122. package/dist/esm/sdk/sky.d.ts.map +1 -1
  123. package/dist/esm/sdk/sky.js +12 -4
  124. package/dist/esm/sdk/sky.js.map +1 -1
  125. package/docs/sdks/aavev3/README.md +93 -0
  126. package/docs/sdks/sky/README.md +12 -4
  127. package/jsr.json +1 -1
  128. package/package.json +1 -1
  129. package/src/funcs/aaveV3Rate.ts +182 -0
  130. package/src/funcs/skyBuy.ts +6 -2
  131. package/src/funcs/skySell.ts +6 -2
  132. package/src/lib/config.ts +2 -2
  133. package/src/mcp-server/mcp-server.ts +1 -1
  134. package/src/mcp-server/server.ts +3 -1
  135. package/src/mcp-server/tools/aaveV3Rate.ts +50 -0
  136. package/src/mcp-server/tools/skyBuy.ts +6 -2
  137. package/src/mcp-server/tools/skySell.ts +6 -2
  138. package/src/models/components/aaverateresponse.ts +123 -0
  139. package/src/models/components/index.ts +1 -7
  140. package/src/models/components/multicallaction.ts +0 -98
  141. package/src/models/components/multicallactiontype.ts +0 -7
  142. package/src/models/operations/aaverate.ts +199 -0
  143. package/src/models/operations/index.ts +1 -0
  144. package/src/sdk/aavev3.ts +31 -0
  145. package/src/sdk/sky.ts +12 -4
  146. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.d.ts +0 -177
  147. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.d.ts.map +0 -1
  148. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.js +0 -191
  149. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.js.map +0 -1
  150. package/dist/commonjs/models/components/aerodromeaddliquidityparams.d.ts +0 -186
  151. package/dist/commonjs/models/components/aerodromeaddliquidityparams.d.ts.map +0 -1
  152. package/dist/commonjs/models/components/aerodromeaddliquidityparams.js +0 -197
  153. package/dist/commonjs/models/components/aerodromeaddliquidityparams.js.map +0 -1
  154. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.d.ts +0 -151
  155. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.d.ts.map +0 -1
  156. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.js +0 -167
  157. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.js.map +0 -1
  158. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.d.ts +0 -161
  159. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.d.ts.map +0 -1
  160. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.js +0 -173
  161. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.js.map +0 -1
  162. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.d.ts +0 -109
  163. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.d.ts.map +0 -1
  164. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.js +0 -137
  165. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.js.map +0 -1
  166. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.d.ts +0 -109
  167. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.d.ts.map +0 -1
  168. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.js +0 -137
  169. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.js.map +0 -1
  170. package/dist/commonjs/models/components/aerodromeswaptokensparams.d.ts +0 -128
  171. package/dist/commonjs/models/components/aerodromeswaptokensparams.d.ts.map +0 -1
  172. package/dist/commonjs/models/components/aerodromeswaptokensparams.js +0 -141
  173. package/dist/commonjs/models/components/aerodromeswaptokensparams.js.map +0 -1
  174. package/dist/esm/models/components/aerodromeaddliquidityethparams.d.ts +0 -177
  175. package/dist/esm/models/components/aerodromeaddliquidityethparams.d.ts.map +0 -1
  176. package/dist/esm/models/components/aerodromeaddliquidityethparams.js +0 -145
  177. package/dist/esm/models/components/aerodromeaddliquidityethparams.js.map +0 -1
  178. package/dist/esm/models/components/aerodromeaddliquidityparams.d.ts +0 -186
  179. package/dist/esm/models/components/aerodromeaddliquidityparams.d.ts.map +0 -1
  180. package/dist/esm/models/components/aerodromeaddliquidityparams.js +0 -151
  181. package/dist/esm/models/components/aerodromeaddliquidityparams.js.map +0 -1
  182. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.d.ts +0 -151
  183. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.d.ts.map +0 -1
  184. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.js +0 -123
  185. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.js.map +0 -1
  186. package/dist/esm/models/components/aerodromeremoveliquidityrequest.d.ts +0 -161
  187. package/dist/esm/models/components/aerodromeremoveliquidityrequest.d.ts.map +0 -1
  188. package/dist/esm/models/components/aerodromeremoveliquidityrequest.js +0 -129
  189. package/dist/esm/models/components/aerodromeremoveliquidityrequest.js.map +0 -1
  190. package/dist/esm/models/components/aerodromeswapethfortokenparams.d.ts +0 -109
  191. package/dist/esm/models/components/aerodromeswapethfortokenparams.d.ts.map +0 -1
  192. package/dist/esm/models/components/aerodromeswapethfortokenparams.js +0 -95
  193. package/dist/esm/models/components/aerodromeswapethfortokenparams.js.map +0 -1
  194. package/dist/esm/models/components/aerodromeswaptokenforethparams.d.ts +0 -109
  195. package/dist/esm/models/components/aerodromeswaptokenforethparams.d.ts.map +0 -1
  196. package/dist/esm/models/components/aerodromeswaptokenforethparams.js +0 -95
  197. package/dist/esm/models/components/aerodromeswaptokenforethparams.js.map +0 -1
  198. package/dist/esm/models/components/aerodromeswaptokensparams.d.ts +0 -128
  199. package/dist/esm/models/components/aerodromeswaptokensparams.d.ts.map +0 -1
  200. package/dist/esm/models/components/aerodromeswaptokensparams.js +0 -99
  201. package/dist/esm/models/components/aerodromeswaptokensparams.js.map +0 -1
  202. package/src/models/components/aerodromeaddliquidityethparams.ts +0 -392
  203. package/src/models/components/aerodromeaddliquidityparams.ts +0 -382
  204. package/src/models/components/aerodromeremoveliquidityethrequest.ts +0 -357
  205. package/src/models/components/aerodromeremoveliquidityrequest.ts +0 -363
  206. package/src/models/components/aerodromeswapethfortokenparams.ts +0 -249
  207. package/src/models/components/aerodromeswaptokenforethparams.ts +0 -249
  208. package/src/models/components/aerodromeswaptokensparams.ts +0 -260
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CompassApiSDKCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * 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
+ * Interest rates
30
+ *
31
+ * @remarks
32
+ * Returns the latest APY and APR rates for a specified token on Aave, for both
33
+ * deposits and loans.
34
+ *
35
+ * **Annual percentage yield (APY)** is the yearly return/cost after continuous
36
+ * compounding of the per-second rate stored on-chain. This value is the same value as
37
+ * seen the on [app.aave.com](
38
+ * https://app.aave.com/)
39
+ * but more up-to-date as it is taken directly from the
40
+ * blockchain every time this endpoint is called.
41
+ *
42
+ * **Annual percentage rate (APR)** is the yearly simple interest rate (no
43
+ * compounding).
44
+ *
45
+ * For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.
46
+ */
47
+ export function aaveV3Rate(
48
+ client: CompassApiSDKCore,
49
+ request: operations.AaveRateRequest,
50
+ options?: RequestOptions,
51
+ ): APIPromise<
52
+ Result<
53
+ components.AaveRateResponse,
54
+ | errors.HTTPValidationError
55
+ | APIError
56
+ | SDKValidationError
57
+ | UnexpectedClientError
58
+ | InvalidRequestError
59
+ | RequestAbortedError
60
+ | RequestTimeoutError
61
+ | ConnectionError
62
+ >
63
+ > {
64
+ return new APIPromise($do(
65
+ client,
66
+ request,
67
+ options,
68
+ ));
69
+ }
70
+
71
+ async function $do(
72
+ client: CompassApiSDKCore,
73
+ request: operations.AaveRateRequest,
74
+ options?: RequestOptions,
75
+ ): Promise<
76
+ [
77
+ Result<
78
+ components.AaveRateResponse,
79
+ | errors.HTTPValidationError
80
+ | APIError
81
+ | SDKValidationError
82
+ | UnexpectedClientError
83
+ | InvalidRequestError
84
+ | RequestAbortedError
85
+ | RequestTimeoutError
86
+ | ConnectionError
87
+ >,
88
+ APICall,
89
+ ]
90
+ > {
91
+ const parsed = safeParse(
92
+ request,
93
+ (value) => operations.AaveRateRequest$outboundSchema.parse(value),
94
+ "Input validation failed",
95
+ );
96
+ if (!parsed.ok) {
97
+ return [parsed, { status: "invalid" }];
98
+ }
99
+ const payload = parsed.value;
100
+ const body = null;
101
+
102
+ const path = pathToFunc("/v0/aave/rate/get")();
103
+
104
+ const query = encodeFormQuery({
105
+ "chain": payload.chain,
106
+ "token": payload.token,
107
+ });
108
+
109
+ const headers = new Headers(compactMap({
110
+ Accept: "application/json",
111
+ }));
112
+
113
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
114
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
115
+ const requestSecurity = resolveGlobalSecurity(securityInput);
116
+
117
+ const context = {
118
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
119
+ operationID: "aave_rate",
120
+ oAuth2Scopes: [],
121
+
122
+ resolvedSecurity: requestSecurity,
123
+
124
+ securitySource: client._options.apiKeyAuth,
125
+ retryConfig: options?.retries
126
+ || client._options.retryConfig
127
+ || { strategy: "none" },
128
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
+ };
130
+
131
+ const requestRes = client._createRequest(context, {
132
+ security: requestSecurity,
133
+ method: "GET",
134
+ baseURL: options?.serverURL,
135
+ path: path,
136
+ headers: headers,
137
+ query: query,
138
+ body: body,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ errorCodes: ["422", "4XX", "5XX"],
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const responseFields = {
158
+ HttpMeta: { Response: response, Request: req },
159
+ };
160
+
161
+ const [result] = await M.match<
162
+ components.AaveRateResponse,
163
+ | errors.HTTPValidationError
164
+ | APIError
165
+ | SDKValidationError
166
+ | UnexpectedClientError
167
+ | InvalidRequestError
168
+ | RequestAbortedError
169
+ | RequestTimeoutError
170
+ | ConnectionError
171
+ >(
172
+ M.json(200, components.AaveRateResponse$inboundSchema),
173
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
174
+ M.fail("4XX"),
175
+ M.fail("5XX"),
176
+ )(response, { extraFields: responseFields });
177
+ if (!result.ok) {
178
+ return [result, { status: "complete", request: req, response }];
179
+ }
180
+
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
@@ -28,9 +28,13 @@ import { Result } from "../types/fp.js";
28
28
  * Buy USDS
29
29
  *
30
30
  * @remarks
31
- * Buy USDS with DAI or USDC on a 1:1 basis.
31
+ * Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
32
32
  *
33
- * There are no fees.
33
+ * If buying with DAI, user will need to set an allowance on the DAI contract for the
34
+ * 'SkyDaiUsdsConverter' contract beforehand.
35
+ *
36
+ * If buying with USDC, user will need to set an allowance on the USDC contract for the
37
+ * 'SkyDaiUsdsConverter' contract beforehand.
34
38
  */
35
39
  export function skyBuy(
36
40
  client: CompassApiSDKCore,
@@ -28,9 +28,13 @@ import { Result } from "../types/fp.js";
28
28
  * Sell USDS
29
29
  *
30
30
  * @remarks
31
- * Sell USDS for DAI or USDC on a 1:1 basis.
31
+ * Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
32
32
  *
33
- * There are no fees.
33
+ * If swapping to DAI, user will need to set an allowance on the USDS contract for the
34
+ * 'SkyDaiUsdsConverter' contract beforehand.
35
+ *
36
+ * If swapping to USDC, user will need to set an allowance on the USDS contract for the
37
+ * 'SkyUsdcUsdsConverter' contract beforehand.
34
38
  */
35
39
  export function skySell(
36
40
  client: CompassApiSDKCore,
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.20",
60
+ sdkVersion: "0.0.22",
61
61
  genVersion: "2.598.22",
62
62
  userAgent:
63
- "speakeasy-sdk/typescript 0.0.20 2.598.22 0.0.1 @compass-labs/api-sdk",
63
+ "speakeasy-sdk/typescript 0.0.22 2.598.22 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.20",
22
+ currentVersion: "0.0.22",
23
23
  },
24
24
  });
25
25
 
@@ -16,6 +16,7 @@ import { createRegisterTool } from "./tools.js";
16
16
  import { tool$aaveV3Borrow } from "./tools/aaveV3Borrow.js";
17
17
  import { tool$aaveV3HistoricalTransactions } from "./tools/aaveV3HistoricalTransactions.js";
18
18
  import { tool$aaveV3LiquidityChange } from "./tools/aaveV3LiquidityChange.js";
19
+ import { tool$aaveV3Rate } from "./tools/aaveV3Rate.js";
19
20
  import { tool$aaveV3Repay } from "./tools/aaveV3Repay.js";
20
21
  import { tool$aaveV3Supply } from "./tools/aaveV3Supply.js";
21
22
  import { tool$aaveV3TokenPrice } from "./tools/aaveV3TokenPrice.js";
@@ -80,7 +81,7 @@ export function createMCPServer(deps: {
80
81
  }) {
81
82
  const server = new McpServer({
82
83
  name: "CompassApiSDK",
83
- version: "0.0.20",
84
+ version: "0.0.22",
84
85
  });
85
86
 
86
87
  const client = new CompassApiSDKCore({
@@ -110,6 +111,7 @@ export function createMCPServer(deps: {
110
111
  const register = { tool, resource, resourceTemplate, prompt };
111
112
  void register; // suppress unused warnings
112
113
 
114
+ tool(tool$aaveV3Rate);
113
115
  tool(tool$aaveV3TokenPrice);
114
116
  tool(tool$aaveV3LiquidityChange);
115
117
  tool(tool$aaveV3UserPositionSummary);
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { aaveV3Rate } from "../../funcs/aaveV3Rate.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.AaveRateRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$aaveV3Rate: ToolDefinition<typeof args> = {
14
+ name: "aave-v3-rate",
15
+ description: `Interest rates
16
+
17
+ Returns the latest APY and APR rates for a specified token on Aave, for both
18
+ deposits and loans.
19
+
20
+ **Annual percentage yield (APY)** is the yearly return/cost after continuous
21
+ compounding of the per-second rate stored on-chain. This value is the same value as
22
+ seen the on [app.aave.com](
23
+ https://app.aave.com/)
24
+ but more up-to-date as it is taken directly from the
25
+ blockchain every time this endpoint is called.
26
+
27
+ **Annual percentage rate (APR)** is the yearly simple interest rate (no
28
+ compounding).
29
+
30
+ For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.`,
31
+ args,
32
+ tool: async (client, args, ctx) => {
33
+ const [result, apiCall] = await aaveV3Rate(
34
+ client,
35
+ args.request,
36
+ { fetchOptions: { signal: ctx.signal } },
37
+ ).$inspect();
38
+
39
+ if (!result.ok) {
40
+ return {
41
+ content: [{ type: "text", text: result.error.message }],
42
+ isError: true,
43
+ };
44
+ }
45
+
46
+ const value = result.value;
47
+
48
+ return formatResult(value, apiCall);
49
+ },
50
+ };
@@ -14,9 +14,13 @@ export const tool$skyBuy: ToolDefinition<typeof args> = {
14
14
  name: "sky-buy",
15
15
  description: `Buy USDS
16
16
 
17
- Buy USDS with DAI or USDC on a 1:1 basis.
17
+ Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
18
18
 
19
- There are no fees.`,
19
+ If buying with DAI, user will need to set an allowance on the DAI contract for the
20
+ 'SkyDaiUsdsConverter' contract beforehand.
21
+
22
+ If buying with USDC, user will need to set an allowance on the USDC contract for the
23
+ 'SkyDaiUsdsConverter' contract beforehand.`,
20
24
  args,
21
25
  tool: async (client, args, ctx) => {
22
26
  const [result, apiCall] = await skyBuy(
@@ -14,9 +14,13 @@ export const tool$skySell: ToolDefinition<typeof args> = {
14
14
  name: "sky-sell",
15
15
  description: `Sell USDS
16
16
 
17
- Sell USDS for DAI or USDC on a 1:1 basis.
17
+ Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
18
18
 
19
- There are no fees.`,
19
+ If swapping to DAI, user will need to set an allowance on the USDS contract for the
20
+ 'SkyDaiUsdsConverter' contract beforehand.
21
+
22
+ If swapping to USDC, user will need to set an allowance on the USDS contract for the
23
+ 'SkyUsdcUsdsConverter' contract beforehand.`,
20
24
  args,
21
25
  tool: async (client, args, ctx) => {
22
26
  const [result, apiCall] = await skySell(
@@ -0,0 +1,123 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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
+ export type AaveRateResponse = {
12
+ /**
13
+ * Variable rate APY for deposits.
14
+ */
15
+ supplyApyVariableRate: string;
16
+ /**
17
+ * Variable rate APR for deposits.
18
+ */
19
+ supplyAprVariableRate: string;
20
+ /**
21
+ * Variable rate APY for loans.
22
+ */
23
+ borrowApyVariableRate: string;
24
+ /**
25
+ * Variable rate APR for loans.
26
+ */
27
+ borrowAprVariableRate: string;
28
+ /**
29
+ * Fixed rate APY for loans.
30
+ */
31
+ borrowApyFixedRate: string;
32
+ /**
33
+ * Fixed rate APR for loans.
34
+ */
35
+ borrowAprFixedRate: string;
36
+ };
37
+
38
+ /** @internal */
39
+ export const AaveRateResponse$inboundSchema: z.ZodType<
40
+ AaveRateResponse,
41
+ z.ZodTypeDef,
42
+ unknown
43
+ > = z.object({
44
+ supply_apy_variable_rate: z.string(),
45
+ supply_apr_variable_rate: z.string(),
46
+ borrow_apy_variable_rate: z.string(),
47
+ borrow_apr_variable_rate: z.string(),
48
+ borrow_apy_fixed_rate: z.string(),
49
+ borrow_apr_fixed_rate: z.string(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ "supply_apy_variable_rate": "supplyApyVariableRate",
53
+ "supply_apr_variable_rate": "supplyAprVariableRate",
54
+ "borrow_apy_variable_rate": "borrowApyVariableRate",
55
+ "borrow_apr_variable_rate": "borrowAprVariableRate",
56
+ "borrow_apy_fixed_rate": "borrowApyFixedRate",
57
+ "borrow_apr_fixed_rate": "borrowAprFixedRate",
58
+ });
59
+ });
60
+
61
+ /** @internal */
62
+ export type AaveRateResponse$Outbound = {
63
+ supply_apy_variable_rate: string;
64
+ supply_apr_variable_rate: string;
65
+ borrow_apy_variable_rate: string;
66
+ borrow_apr_variable_rate: string;
67
+ borrow_apy_fixed_rate: string;
68
+ borrow_apr_fixed_rate: string;
69
+ };
70
+
71
+ /** @internal */
72
+ export const AaveRateResponse$outboundSchema: z.ZodType<
73
+ AaveRateResponse$Outbound,
74
+ z.ZodTypeDef,
75
+ AaveRateResponse
76
+ > = z.object({
77
+ supplyApyVariableRate: z.string(),
78
+ supplyAprVariableRate: z.string(),
79
+ borrowApyVariableRate: z.string(),
80
+ borrowAprVariableRate: z.string(),
81
+ borrowApyFixedRate: z.string(),
82
+ borrowAprFixedRate: z.string(),
83
+ }).transform((v) => {
84
+ return remap$(v, {
85
+ supplyApyVariableRate: "supply_apy_variable_rate",
86
+ supplyAprVariableRate: "supply_apr_variable_rate",
87
+ borrowApyVariableRate: "borrow_apy_variable_rate",
88
+ borrowAprVariableRate: "borrow_apr_variable_rate",
89
+ borrowApyFixedRate: "borrow_apy_fixed_rate",
90
+ borrowAprFixedRate: "borrow_apr_fixed_rate",
91
+ });
92
+ });
93
+
94
+ /**
95
+ * @internal
96
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
97
+ */
98
+ export namespace AaveRateResponse$ {
99
+ /** @deprecated use `AaveRateResponse$inboundSchema` instead. */
100
+ export const inboundSchema = AaveRateResponse$inboundSchema;
101
+ /** @deprecated use `AaveRateResponse$outboundSchema` instead. */
102
+ export const outboundSchema = AaveRateResponse$outboundSchema;
103
+ /** @deprecated use `AaveRateResponse$Outbound` instead. */
104
+ export type Outbound = AaveRateResponse$Outbound;
105
+ }
106
+
107
+ export function aaveRateResponseToJSON(
108
+ aaveRateResponse: AaveRateResponse,
109
+ ): string {
110
+ return JSON.stringify(
111
+ AaveRateResponse$outboundSchema.parse(aaveRateResponse),
112
+ );
113
+ }
114
+
115
+ export function aaveRateResponseFromJSON(
116
+ jsonString: string,
117
+ ): SafeParseResult<AaveRateResponse, SDKValidationError> {
118
+ return safeParse(
119
+ jsonString,
120
+ (x) => AaveRateResponse$inboundSchema.parse(JSON.parse(x)),
121
+ `Failed to parse 'AaveRateResponse' from JSON`,
122
+ );
123
+ }
@@ -7,6 +7,7 @@ export * from "./aaveborrowrequest.js";
7
7
  export * from "./aavehistoricaltransactionbase.js";
8
8
  export * from "./aavehistoricaltransactionsresponse.js";
9
9
  export * from "./aaveliquiditychangeresponse.js";
10
+ export * from "./aaverateresponse.js";
10
11
  export * from "./aaverepayparams.js";
11
12
  export * from "./aaverepayrequest.js";
12
13
  export * from "./aavesupplyparams.js";
@@ -17,12 +18,8 @@ export * from "./aaveuserpositionsummaryresponse.js";
17
18
  export * from "./aavewithdrawparams.js";
18
19
  export * from "./aavewithdrawrequest.js";
19
20
  export * from "./action.js";
20
- export * from "./aerodromeaddliquidityethparams.js";
21
- export * from "./aerodromeaddliquidityparams.js";
22
21
  export * from "./aerodromelppositionsresponse.js";
23
22
  export * from "./aerodromeposition.js";
24
- export * from "./aerodromeremoveliquidityethrequest.js";
25
- export * from "./aerodromeremoveliquidityrequest.js";
26
23
  export * from "./aerodromeslipstreambuyexactlyparams.js";
27
24
  export * from "./aerodromeslipstreambuyexactlyrequest.js";
28
25
  export * from "./aerodromeslipstreamincreaseliquidityprovisionparams.js";
@@ -34,9 +31,6 @@ export * from "./aerodromeslipstreamsellexactlyparams.js";
34
31
  export * from "./aerodromeslipstreamsellexactlyrequest.js";
35
32
  export * from "./aerodromeslipstreamwithdrawliquidityprovisionparams.js";
36
33
  export * from "./aerodromeslipstreamwithdrawliquidityprovisionrequest.js";
37
- export * from "./aerodromeswapethfortokenparams.js";
38
- export * from "./aerodromeswaptokenforethparams.js";
39
- export * from "./aerodromeswaptokensparams.js";
40
34
  export * from "./allowanceinforesponse.js";
41
35
  export * from "./borrow.js";
42
36
  export * from "./chain.js";