@compass-labs/api-sdk 2.1.18-rc.0 → 2.1.18-rc.1

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 (101) hide show
  1. package/README.md +3 -1
  2. package/codeSamples_typescript.yaml +7 -1
  3. package/dist/commonjs/funcs/earnEarnListAaveMarkets.d.ts +22 -0
  4. package/dist/commonjs/funcs/earnEarnListAaveMarkets.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/earnEarnListAaveMarkets.js +125 -0
  6. package/dist/commonjs/funcs/earnEarnListAaveMarkets.js.map +1 -0
  7. package/dist/commonjs/models/components/aavemarketinfo.d.ts +28 -0
  8. package/dist/commonjs/models/components/aavemarketinfo.d.ts.map +1 -0
  9. package/dist/commonjs/models/components/aavemarketinfo.js +59 -0
  10. package/dist/commonjs/models/components/aavemarketinfo.js.map +1 -0
  11. package/dist/commonjs/models/components/chainaavemarkets.d.ts +21 -0
  12. package/dist/commonjs/models/components/chainaavemarkets.d.ts.map +1 -0
  13. package/dist/commonjs/models/components/chainaavemarkets.js +52 -0
  14. package/dist/commonjs/models/components/chainaavemarkets.js.map +1 -0
  15. package/dist/commonjs/models/components/index.d.ts +4 -0
  16. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/index.js +4 -0
  18. package/dist/commonjs/models/components/index.js.map +1 -1
  19. package/dist/commonjs/models/components/listaavemarketsresponse.d.ts +22 -0
  20. package/dist/commonjs/models/components/listaavemarketsresponse.d.ts.map +1 -0
  21. package/dist/commonjs/models/components/listaavemarketsresponse.js +58 -0
  22. package/dist/commonjs/models/components/listaavemarketsresponse.js.map +1 -0
  23. package/dist/commonjs/models/components/maxsupplyapymarket.d.ts +21 -0
  24. package/dist/commonjs/models/components/maxsupplyapymarket.d.ts.map +1 -0
  25. package/dist/commonjs/models/components/maxsupplyapymarket.js +52 -0
  26. package/dist/commonjs/models/components/maxsupplyapymarket.js.map +1 -0
  27. package/dist/commonjs/models/operations/index.d.ts +1 -0
  28. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/index.js +1 -0
  30. package/dist/commonjs/models/operations/index.js.map +1 -1
  31. package/dist/commonjs/models/operations/v2earnlistaavemarkets.d.ts +16 -0
  32. package/dist/commonjs/models/operations/v2earnlistaavemarkets.d.ts.map +1 -0
  33. package/dist/commonjs/models/operations/v2earnlistaavemarkets.js +50 -0
  34. package/dist/commonjs/models/operations/v2earnlistaavemarkets.js.map +1 -0
  35. package/dist/commonjs/models/operations/v2earnvaults.d.ts +6 -10
  36. package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
  37. package/dist/commonjs/models/operations/v2earnvaults.js +3 -9
  38. package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
  39. package/dist/commonjs/sdk/earn.d.ts +10 -0
  40. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  41. package/dist/commonjs/sdk/earn.js +13 -0
  42. package/dist/commonjs/sdk/earn.js.map +1 -1
  43. package/dist/esm/funcs/earnEarnListAaveMarkets.d.ts +22 -0
  44. package/dist/esm/funcs/earnEarnListAaveMarkets.d.ts.map +1 -0
  45. package/dist/esm/funcs/earnEarnListAaveMarkets.js +89 -0
  46. package/dist/esm/funcs/earnEarnListAaveMarkets.js.map +1 -0
  47. package/dist/esm/models/components/aavemarketinfo.d.ts +28 -0
  48. package/dist/esm/models/components/aavemarketinfo.d.ts.map +1 -0
  49. package/dist/esm/models/components/aavemarketinfo.js +22 -0
  50. package/dist/esm/models/components/aavemarketinfo.js.map +1 -0
  51. package/dist/esm/models/components/chainaavemarkets.d.ts +21 -0
  52. package/dist/esm/models/components/chainaavemarkets.d.ts.map +1 -0
  53. package/dist/esm/models/components/chainaavemarkets.js +15 -0
  54. package/dist/esm/models/components/chainaavemarkets.js.map +1 -0
  55. package/dist/esm/models/components/index.d.ts +4 -0
  56. package/dist/esm/models/components/index.d.ts.map +1 -1
  57. package/dist/esm/models/components/index.js +4 -0
  58. package/dist/esm/models/components/index.js.map +1 -1
  59. package/dist/esm/models/components/listaavemarketsresponse.d.ts +22 -0
  60. package/dist/esm/models/components/listaavemarketsresponse.d.ts.map +1 -0
  61. package/dist/esm/models/components/listaavemarketsresponse.js +21 -0
  62. package/dist/esm/models/components/listaavemarketsresponse.js.map +1 -0
  63. package/dist/esm/models/components/maxsupplyapymarket.d.ts +21 -0
  64. package/dist/esm/models/components/maxsupplyapymarket.d.ts.map +1 -0
  65. package/dist/esm/models/components/maxsupplyapymarket.js +15 -0
  66. package/dist/esm/models/components/maxsupplyapymarket.js.map +1 -0
  67. package/dist/esm/models/operations/index.d.ts +1 -0
  68. package/dist/esm/models/operations/index.d.ts.map +1 -1
  69. package/dist/esm/models/operations/index.js +1 -0
  70. package/dist/esm/models/operations/index.js.map +1 -1
  71. package/dist/esm/models/operations/v2earnlistaavemarkets.d.ts +16 -0
  72. package/dist/esm/models/operations/v2earnlistaavemarkets.d.ts.map +1 -0
  73. package/dist/esm/models/operations/v2earnlistaavemarkets.js +13 -0
  74. package/dist/esm/models/operations/v2earnlistaavemarkets.js.map +1 -0
  75. package/dist/esm/models/operations/v2earnvaults.d.ts +6 -10
  76. package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
  77. package/dist/esm/models/operations/v2earnvaults.js +2 -8
  78. package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
  79. package/dist/esm/sdk/earn.d.ts +10 -0
  80. package/dist/esm/sdk/earn.d.ts.map +1 -1
  81. package/dist/esm/sdk/earn.js +13 -0
  82. package/dist/esm/sdk/earn.js.map +1 -1
  83. package/docs/models/components/aavemarketinfo.md +25 -0
  84. package/docs/models/components/chainaavemarkets.md +21 -0
  85. package/docs/models/components/listaavemarketsresponse.md +32 -0
  86. package/docs/models/components/maxsupplyapymarket.md +26 -0
  87. package/docs/models/operations/v2earnlistaavemarketsrequest.md +15 -0
  88. package/docs/models/operations/v2earnvaultsrequest.md +8 -9
  89. package/docs/sdks/earn/README.md +74 -2
  90. package/package.json +1 -1
  91. package/src/funcs/earnEarnListAaveMarkets.ts +178 -0
  92. package/src/models/components/aavemarketinfo.ts +58 -0
  93. package/src/models/components/chainaavemarkets.ts +46 -0
  94. package/src/models/components/index.ts +4 -0
  95. package/src/models/components/listaavemarketsresponse.ts +55 -0
  96. package/src/models/components/maxsupplyapymarket.ts +46 -0
  97. package/src/models/operations/index.ts +1 -0
  98. package/src/models/operations/v2earnlistaavemarkets.ts +37 -0
  99. package/src/models/operations/v2earnvaults.ts +7 -15
  100. package/src/sdk/earn.ts +21 -0
  101. package/docs/models/operations/v2earnvaultschain.md +0 -15
@@ -7,6 +7,7 @@
7
7
  * [earnPositions](#earnpositions) - List earn positions
8
8
  * [earnVaults](#earnvaults) - List vaults
9
9
  * [earnAaveTokenRates](#earnaavetokenrates) - Get token rates on Aave
10
+ * [earnListAaveMarkets](#earnlistaavemarkets) - List all Aave markets with rates
10
11
  * [earnCreateAccount](#earncreateaccount) - Create earn account
11
12
  * [earnTransfer](#earntransfer) - Transfer tokens to/from account
12
13
  * [earnManage](#earnmanage) - Manage earn position
@@ -117,7 +118,6 @@ async function run() {
117
118
  direction: "desc",
118
119
  offset: 0,
119
120
  limit: 50,
120
- chain: "ethereum",
121
121
  });
122
122
 
123
123
  console.log(result);
@@ -146,7 +146,6 @@ async function run() {
146
146
  direction: "desc",
147
147
  offset: 0,
148
148
  limit: 50,
149
- chain: "ethereum",
150
149
  });
151
150
  if (res.ok) {
152
151
  const { value: result } = res;
@@ -253,6 +252,79 @@ run();
253
252
  | errors.HTTPValidationError | 422 | application/json |
254
253
  | errors.APIError | 4XX, 5XX | \*/\* |
255
254
 
255
+ ## earnListAaveMarkets
256
+
257
+ List all Aave markets with their supply and borrow rates.
258
+
259
+ Returns rates for all supported tokens across Ethereum, Base, and Arbitrum.
260
+ Optionally filter by chain. Uses batch_multicall for efficient RPC usage.
261
+
262
+ ### Example Usage
263
+
264
+ <!-- UsageSnippet language="typescript" operationID="v2_earn_list_aave_markets" method="get" path="/v2/earn/list_aave_markets" -->
265
+ ```typescript
266
+ import { CompassApiSDK } from "@compass-labs/api-sdk";
267
+
268
+ const compassApiSDK = new CompassApiSDK({
269
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
270
+ });
271
+
272
+ async function run() {
273
+ const result = await compassApiSDK.earn.earnListAaveMarkets({});
274
+
275
+ console.log(result);
276
+ }
277
+
278
+ run();
279
+ ```
280
+
281
+ ### Standalone function
282
+
283
+ The standalone function version of this method:
284
+
285
+ ```typescript
286
+ import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
287
+ import { earnEarnListAaveMarkets } from "@compass-labs/api-sdk/funcs/earnEarnListAaveMarkets.js";
288
+
289
+ // Use `CompassApiSDKCore` for best tree-shaking performance.
290
+ // You can create one instance of it to use across an application.
291
+ const compassApiSDK = new CompassApiSDKCore({
292
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
293
+ });
294
+
295
+ async function run() {
296
+ const res = await earnEarnListAaveMarkets(compassApiSDK, {});
297
+ if (res.ok) {
298
+ const { value: result } = res;
299
+ console.log(result);
300
+ } else {
301
+ console.log("earnEarnListAaveMarkets failed:", res.error);
302
+ }
303
+ }
304
+
305
+ run();
306
+ ```
307
+
308
+ ### Parameters
309
+
310
+ | Parameter | Type | Required | Description |
311
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
312
+ | `request` | [operations.V2EarnListAaveMarketsRequest](../../models/operations/v2earnlistaavemarketsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
313
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
314
+ | `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. |
315
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
316
+
317
+ ### Response
318
+
319
+ **Promise\<[components.ListAaveMarketsResponse](../../models/components/listaavemarketsresponse.md)\>**
320
+
321
+ ### Errors
322
+
323
+ | Error Type | Status Code | Content Type |
324
+ | -------------------------- | -------------------------- | -------------------------- |
325
+ | errors.HTTPValidationError | 422 | application/json |
326
+ | errors.APIError | 4XX, 5XX | \*/\* |
327
+
256
328
  ## earnCreateAccount
257
329
 
258
330
  Create an Earn Account.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.1.18-rc.0",
3
+ "version": "2.1.18-rc.1",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -0,0 +1,178 @@
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 { CompassAPISDKError } from "../models/errors/compassapisdkerror.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List all Aave markets with rates
31
+ *
32
+ * @remarks
33
+ * List all Aave markets with their supply and borrow rates.
34
+ *
35
+ * Returns rates for all supported tokens across Ethereum, Base, and Arbitrum.
36
+ * Optionally filter by chain. Uses batch_multicall for efficient RPC usage.
37
+ */
38
+ export function earnEarnListAaveMarkets(
39
+ client: CompassApiSDKCore,
40
+ request: operations.V2EarnListAaveMarketsRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ components.ListAaveMarketsResponse,
45
+ | errors.HTTPValidationError
46
+ | CompassAPISDKError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
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.V2EarnListAaveMarketsRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ components.ListAaveMarketsResponse,
71
+ | errors.HTTPValidationError
72
+ | CompassAPISDKError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const parsed = safeParse(
85
+ request,
86
+ (value) =>
87
+ operations.V2EarnListAaveMarketsRequest$outboundSchema.parse(value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const path = pathToFunc("/v2/earn/list_aave_markets")();
97
+
98
+ const query = encodeFormQuery({
99
+ "chain": payload.chain,
100
+ });
101
+
102
+ const headers = new Headers(compactMap({
103
+ Accept: "application/json",
104
+ }));
105
+
106
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
107
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
108
+ const requestSecurity = resolveGlobalSecurity(securityInput);
109
+
110
+ const context = {
111
+ options: client._options,
112
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
113
+ operationID: "v2_earn_list_aave_markets",
114
+ oAuth2Scopes: null,
115
+
116
+ resolvedSecurity: requestSecurity,
117
+
118
+ securitySource: client._options.apiKeyAuth,
119
+ retryConfig: options?.retries
120
+ || client._options.retryConfig
121
+ || { strategy: "none" },
122
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
+ };
124
+
125
+ const requestRes = client._createRequest(context, {
126
+ security: requestSecurity,
127
+ method: "GET",
128
+ baseURL: options?.serverURL,
129
+ path: path,
130
+ headers: headers,
131
+ query: query,
132
+ body: body,
133
+ userAgent: client._options.userAgent,
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.ListAaveMarketsResponse,
158
+ | errors.HTTPValidationError
159
+ | CompassAPISDKError
160
+ | ResponseValidationError
161
+ | ConnectionError
162
+ | RequestAbortedError
163
+ | RequestTimeoutError
164
+ | InvalidRequestError
165
+ | UnexpectedClientError
166
+ | SDKValidationError
167
+ >(
168
+ M.json(200, components.ListAaveMarketsResponse$inboundSchema),
169
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
170
+ M.fail("4XX"),
171
+ M.fail("5XX"),
172
+ )(response, req, { extraFields: responseFields });
173
+ if (!result.ok) {
174
+ return [result, { status: "complete", request: req, response }];
175
+ }
176
+
177
+ return [result, { status: "complete", request: req, response }];
178
+ }
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Rate information for a single token on Aave.
13
+ */
14
+ export type AaveMarketInfo = {
15
+ /**
16
+ * Token symbol (e.g., 'USDC', 'WETH').
17
+ */
18
+ symbol: string;
19
+ /**
20
+ * Token contract address.
21
+ */
22
+ address: string;
23
+ /**
24
+ * Variable rate APY for deposits.
25
+ */
26
+ supplyApy: string;
27
+ /**
28
+ * Variable rate APY for loans.
29
+ */
30
+ borrowApy: string;
31
+ };
32
+
33
+ /** @internal */
34
+ export const AaveMarketInfo$inboundSchema: z.ZodType<
35
+ AaveMarketInfo,
36
+ z.ZodTypeDef,
37
+ unknown
38
+ > = z.object({
39
+ symbol: z.string(),
40
+ address: z.string(),
41
+ supply_apy: z.string(),
42
+ borrow_apy: z.string(),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ "supply_apy": "supplyApy",
46
+ "borrow_apy": "borrowApy",
47
+ });
48
+ });
49
+
50
+ export function aaveMarketInfoFromJSON(
51
+ jsonString: string,
52
+ ): SafeParseResult<AaveMarketInfo, SDKValidationError> {
53
+ return safeParse(
54
+ jsonString,
55
+ (x) => AaveMarketInfo$inboundSchema.parse(JSON.parse(x)),
56
+ `Failed to parse 'AaveMarketInfo' from JSON`,
57
+ );
58
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AaveMarketInfo,
11
+ AaveMarketInfo$inboundSchema,
12
+ } from "./aavemarketinfo.js";
13
+
14
+ /**
15
+ * Aave market data for a specific chain.
16
+ */
17
+ export type ChainAaveMarkets = {
18
+ /**
19
+ * Chain name (ethereum, base, or arbitrum).
20
+ */
21
+ chain: string;
22
+ /**
23
+ * List of all Aave markets with their rates on this chain.
24
+ */
25
+ markets: Array<AaveMarketInfo>;
26
+ };
27
+
28
+ /** @internal */
29
+ export const ChainAaveMarkets$inboundSchema: z.ZodType<
30
+ ChainAaveMarkets,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ chain: z.string(),
35
+ markets: z.array(AaveMarketInfo$inboundSchema),
36
+ });
37
+
38
+ export function chainAaveMarketsFromJSON(
39
+ jsonString: string,
40
+ ): SafeParseResult<ChainAaveMarkets, SDKValidationError> {
41
+ return safeParse(
42
+ jsonString,
43
+ (x) => ChainAaveMarkets$inboundSchema.parse(JSON.parse(x)),
44
+ `Failed to parse 'ChainAaveMarkets' from JSON`,
45
+ );
46
+ }
@@ -8,6 +8,7 @@ export * from "./aaveborrowrequest.js";
8
8
  export * from "./aavehistoricaltransactionsresponse.js";
9
9
  export * from "./aaveliquiditychangeresponse.js";
10
10
  export * from "./aavelooprequest.js";
11
+ export * from "./aavemarketinfo.js";
11
12
  export * from "./aaveposition.js";
12
13
  export * from "./aaverateresponse.js";
13
14
  export * from "./aaverepayparams.js";
@@ -49,6 +50,7 @@ export * from "./batcheduseroperationsresponse.js";
49
50
  export * from "./borrow.js";
50
51
  export * from "./bundlertransactionresponse.js";
51
52
  export * from "./chain.js";
53
+ export * from "./chainaavemarkets.js";
52
54
  export * from "./chaininfo.js";
53
55
  export * from "./chainratedata.js";
54
56
  export * from "./compassapibackendv1modelsgenericreadresponseportfoliotokenbalance.js";
@@ -106,11 +108,13 @@ export * from "./fee.js";
106
108
  export * from "./feeenum.js";
107
109
  export * from "./interestratemode.js";
108
110
  export * from "./liquidationcall.js";
111
+ export * from "./listaavemarketsresponse.js";
109
112
  export * from "./lpbalance.js";
110
113
  export * from "./market.js";
111
114
  export * from "./marketposition.js";
112
115
  export * from "./markettokens.js";
113
116
  export * from "./maxsupplyapydata.js";
117
+ export * from "./maxsupplyapymarket.js";
114
118
  export * from "./mintpreparecompletedresponse.js";
115
119
  export * from "./mintpreparependingresponse.js";
116
120
  export * from "./mintpreparereadyresponse.js";
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ ChainAaveMarkets,
12
+ ChainAaveMarkets$inboundSchema,
13
+ } from "./chainaavemarkets.js";
14
+ import {
15
+ MaxSupplyApyMarket,
16
+ MaxSupplyApyMarket$inboundSchema,
17
+ } from "./maxsupplyapymarket.js";
18
+
19
+ /**
20
+ * Response containing Aave market rates for all tokens across chains.
21
+ */
22
+ export type ListAaveMarketsResponse = {
23
+ /**
24
+ * List of chains with their Aave market data.
25
+ */
26
+ chains: Array<ChainAaveMarkets>;
27
+ /**
28
+ * The market with the highest supply APY across all queried chains. Only included when multiple chains are queried.
29
+ */
30
+ maxSupplyApy?: MaxSupplyApyMarket | null | undefined;
31
+ };
32
+
33
+ /** @internal */
34
+ export const ListAaveMarketsResponse$inboundSchema: z.ZodType<
35
+ ListAaveMarketsResponse,
36
+ z.ZodTypeDef,
37
+ unknown
38
+ > = z.object({
39
+ chains: z.array(ChainAaveMarkets$inboundSchema),
40
+ max_supply_apy: z.nullable(MaxSupplyApyMarket$inboundSchema).optional(),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "max_supply_apy": "maxSupplyApy",
44
+ });
45
+ });
46
+
47
+ export function listAaveMarketsResponseFromJSON(
48
+ jsonString: string,
49
+ ): SafeParseResult<ListAaveMarketsResponse, SDKValidationError> {
50
+ return safeParse(
51
+ jsonString,
52
+ (x) => ListAaveMarketsResponse$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'ListAaveMarketsResponse' from JSON`,
54
+ );
55
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AaveMarketInfo,
11
+ AaveMarketInfo$inboundSchema,
12
+ } from "./aavemarketinfo.js";
13
+
14
+ /**
15
+ * Information about the market with the highest supply APY.
16
+ */
17
+ export type MaxSupplyApyMarket = {
18
+ /**
19
+ * Chain name where this market exists.
20
+ */
21
+ chain: string;
22
+ /**
23
+ * Rate information for a single token on Aave.
24
+ */
25
+ market: AaveMarketInfo;
26
+ };
27
+
28
+ /** @internal */
29
+ export const MaxSupplyApyMarket$inboundSchema: z.ZodType<
30
+ MaxSupplyApyMarket,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ chain: z.string(),
35
+ market: AaveMarketInfo$inboundSchema,
36
+ });
37
+
38
+ export function maxSupplyApyMarketFromJSON(
39
+ jsonString: string,
40
+ ): SafeParseResult<MaxSupplyApyMarket, SDKValidationError> {
41
+ return safeParse(
42
+ jsonString,
43
+ (x) => MaxSupplyApyMarket$inboundSchema.parse(JSON.parse(x)),
44
+ `Failed to parse 'MaxSupplyApyMarket' from JSON`,
45
+ );
46
+ }
@@ -42,5 +42,6 @@ export * from "./v1vaultsvault.js";
42
42
  export * from "./v1wildcatmarket.js";
43
43
  export * from "./v2cctpmint.js";
44
44
  export * from "./v2earnaavetokenrates.js";
45
+ export * from "./v2earnlistaavemarkets.js";
45
46
  export * from "./v2earnpositions.js";
46
47
  export * from "./v2earnvaults.js";
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as components from "../components/index.js";
7
+
8
+ export type V2EarnListAaveMarketsRequest = {
9
+ /**
10
+ * Optional chain filter. If not provided, returns rates for all chains.
11
+ */
12
+ chain?: components.Chain | null | undefined;
13
+ };
14
+
15
+ /** @internal */
16
+ export type V2EarnListAaveMarketsRequest$Outbound = {
17
+ chain?: string | null | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const V2EarnListAaveMarketsRequest$outboundSchema: z.ZodType<
22
+ V2EarnListAaveMarketsRequest$Outbound,
23
+ z.ZodTypeDef,
24
+ V2EarnListAaveMarketsRequest
25
+ > = z.object({
26
+ chain: z.nullable(components.Chain$outboundSchema).optional(),
27
+ });
28
+
29
+ export function v2EarnListAaveMarketsRequestToJSON(
30
+ v2EarnListAaveMarketsRequest: V2EarnListAaveMarketsRequest,
31
+ ): string {
32
+ return JSON.stringify(
33
+ V2EarnListAaveMarketsRequest$outboundSchema.parse(
34
+ v2EarnListAaveMarketsRequest,
35
+ ),
36
+ );
37
+ }
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { ClosedEnum } from "../../types/enums.js";
8
+ import * as components from "../components/index.js";
8
9
 
9
10
  /**
10
11
  * The direction to order the results by.
@@ -18,13 +19,6 @@ export const Direction = {
18
19
  */
19
20
  export type Direction = ClosedEnum<typeof Direction>;
20
21
 
21
- export const V2EarnVaultsChain = {
22
- Arbitrum: "arbitrum",
23
- Base: "base",
24
- Ethereum: "ethereum",
25
- } as const;
26
- export type V2EarnVaultsChain = ClosedEnum<typeof V2EarnVaultsChain>;
27
-
28
22
  export type V2EarnVaultsRequest = {
29
23
  /**
30
24
  * The field to order the results by.
@@ -42,7 +36,10 @@ export type V2EarnVaultsRequest = {
42
36
  * The number of items to return.
43
37
  */
44
38
  limit?: number | undefined;
45
- chain: V2EarnVaultsChain;
39
+ /**
40
+ * Optional chain filter. If not provided, returns vaults for all chains.
41
+ */
42
+ chain?: components.Chain | null | undefined;
46
43
  /**
47
44
  * Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH').
48
45
  */
@@ -53,18 +50,13 @@ export type V2EarnVaultsRequest = {
53
50
  export const Direction$outboundSchema: z.ZodNativeEnum<typeof Direction> = z
54
51
  .nativeEnum(Direction);
55
52
 
56
- /** @internal */
57
- export const V2EarnVaultsChain$outboundSchema: z.ZodNativeEnum<
58
- typeof V2EarnVaultsChain
59
- > = z.nativeEnum(V2EarnVaultsChain);
60
-
61
53
  /** @internal */
62
54
  export type V2EarnVaultsRequest$Outbound = {
63
55
  order_by: string;
64
56
  direction?: string | undefined;
65
57
  offset?: number | undefined;
66
58
  limit?: number | undefined;
67
- chain: string;
59
+ chain?: string | null | undefined;
68
60
  asset_symbol?: string | null | undefined;
69
61
  };
70
62
 
@@ -78,7 +70,7 @@ export const V2EarnVaultsRequest$outboundSchema: z.ZodType<
78
70
  direction: Direction$outboundSchema.optional(),
79
71
  offset: z.number().int().optional(),
80
72
  limit: z.number().int().optional(),
81
- chain: V2EarnVaultsChain$outboundSchema,
73
+ chain: z.nullable(components.Chain$outboundSchema).optional(),
82
74
  assetSymbol: z.nullable(z.string()).optional(),
83
75
  }).transform((v) => {
84
76
  return remap$(v, {
package/src/sdk/earn.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  import { earnEarnAaveTokenRates } from "../funcs/earnEarnAaveTokenRates.js";
6
6
  import { earnEarnBundle } from "../funcs/earnEarnBundle.js";
7
7
  import { earnEarnCreateAccount } from "../funcs/earnEarnCreateAccount.js";
8
+ import { earnEarnListAaveMarkets } from "../funcs/earnEarnListAaveMarkets.js";
8
9
  import { earnEarnManage } from "../funcs/earnEarnManage.js";
9
10
  import { earnEarnPositions } from "../funcs/earnEarnPositions.js";
10
11
  import { earnEarnSwap } from "../funcs/earnEarnSwap.js";
@@ -69,6 +70,26 @@ export class Earn extends ClientSDK {
69
70
  ));
70
71
  }
71
72
 
73
+ /**
74
+ * List all Aave markets with rates
75
+ *
76
+ * @remarks
77
+ * List all Aave markets with their supply and borrow rates.
78
+ *
79
+ * Returns rates for all supported tokens across Ethereum, Base, and Arbitrum.
80
+ * Optionally filter by chain. Uses batch_multicall for efficient RPC usage.
81
+ */
82
+ async earnListAaveMarkets(
83
+ request: operations.V2EarnListAaveMarketsRequest,
84
+ options?: RequestOptions,
85
+ ): Promise<components.ListAaveMarketsResponse> {
86
+ return unwrapAsync(earnEarnListAaveMarkets(
87
+ this,
88
+ request,
89
+ options,
90
+ ));
91
+ }
92
+
72
93
  /**
73
94
  * Create earn account
74
95
  *
@@ -1,15 +0,0 @@
1
- # V2EarnVaultsChain
2
-
3
- ## Example Usage
4
-
5
- ```typescript
6
- import { V2EarnVaultsChain } from "@compass-labs/api-sdk/models/operations";
7
-
8
- let value: V2EarnVaultsChain = "ethereum";
9
- ```
10
-
11
- ## Values
12
-
13
- ```typescript
14
- "arbitrum" | "base" | "ethereum"
15
- ```