@compass-labs/api-sdk 2.1.17 → 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 (110) hide show
  1. package/README.md +5 -3
  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/funcs/earnEarnVaults.d.ts +3 -4
  8. package/dist/commonjs/funcs/earnEarnVaults.d.ts.map +1 -1
  9. package/dist/commonjs/funcs/earnEarnVaults.js +3 -4
  10. package/dist/commonjs/funcs/earnEarnVaults.js.map +1 -1
  11. package/dist/commonjs/models/components/aavemarketinfo.d.ts +28 -0
  12. package/dist/commonjs/models/components/aavemarketinfo.d.ts.map +1 -0
  13. package/dist/commonjs/models/components/aavemarketinfo.js +59 -0
  14. package/dist/commonjs/models/components/aavemarketinfo.js.map +1 -0
  15. package/dist/commonjs/models/components/chainaavemarkets.d.ts +21 -0
  16. package/dist/commonjs/models/components/chainaavemarkets.d.ts.map +1 -0
  17. package/dist/commonjs/models/components/chainaavemarkets.js +52 -0
  18. package/dist/commonjs/models/components/chainaavemarkets.js.map +1 -0
  19. package/dist/commonjs/models/components/index.d.ts +4 -0
  20. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/index.js +4 -0
  22. package/dist/commonjs/models/components/index.js.map +1 -1
  23. package/dist/commonjs/models/components/listaavemarketsresponse.d.ts +22 -0
  24. package/dist/commonjs/models/components/listaavemarketsresponse.d.ts.map +1 -0
  25. package/dist/commonjs/models/components/listaavemarketsresponse.js +58 -0
  26. package/dist/commonjs/models/components/listaavemarketsresponse.js.map +1 -0
  27. package/dist/commonjs/models/components/maxsupplyapymarket.d.ts +21 -0
  28. package/dist/commonjs/models/components/maxsupplyapymarket.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/maxsupplyapymarket.js +52 -0
  30. package/dist/commonjs/models/components/maxsupplyapymarket.js.map +1 -0
  31. package/dist/commonjs/models/operations/index.d.ts +1 -0
  32. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  33. package/dist/commonjs/models/operations/index.js +1 -0
  34. package/dist/commonjs/models/operations/index.js.map +1 -1
  35. package/dist/commonjs/models/operations/v2earnlistaavemarkets.d.ts +16 -0
  36. package/dist/commonjs/models/operations/v2earnlistaavemarkets.d.ts.map +1 -0
  37. package/dist/commonjs/models/operations/v2earnlistaavemarkets.js +50 -0
  38. package/dist/commonjs/models/operations/v2earnlistaavemarkets.js.map +1 -0
  39. package/dist/commonjs/models/operations/v2earnvaults.d.ts +6 -10
  40. package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
  41. package/dist/commonjs/models/operations/v2earnvaults.js +3 -9
  42. package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
  43. package/dist/commonjs/sdk/earn.d.ts +13 -4
  44. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  45. package/dist/commonjs/sdk/earn.js +16 -4
  46. package/dist/commonjs/sdk/earn.js.map +1 -1
  47. package/dist/esm/funcs/earnEarnListAaveMarkets.d.ts +22 -0
  48. package/dist/esm/funcs/earnEarnListAaveMarkets.d.ts.map +1 -0
  49. package/dist/esm/funcs/earnEarnListAaveMarkets.js +89 -0
  50. package/dist/esm/funcs/earnEarnListAaveMarkets.js.map +1 -0
  51. package/dist/esm/funcs/earnEarnVaults.d.ts +3 -4
  52. package/dist/esm/funcs/earnEarnVaults.d.ts.map +1 -1
  53. package/dist/esm/funcs/earnEarnVaults.js +3 -4
  54. package/dist/esm/funcs/earnEarnVaults.js.map +1 -1
  55. package/dist/esm/models/components/aavemarketinfo.d.ts +28 -0
  56. package/dist/esm/models/components/aavemarketinfo.d.ts.map +1 -0
  57. package/dist/esm/models/components/aavemarketinfo.js +22 -0
  58. package/dist/esm/models/components/aavemarketinfo.js.map +1 -0
  59. package/dist/esm/models/components/chainaavemarkets.d.ts +21 -0
  60. package/dist/esm/models/components/chainaavemarkets.d.ts.map +1 -0
  61. package/dist/esm/models/components/chainaavemarkets.js +15 -0
  62. package/dist/esm/models/components/chainaavemarkets.js.map +1 -0
  63. package/dist/esm/models/components/index.d.ts +4 -0
  64. package/dist/esm/models/components/index.d.ts.map +1 -1
  65. package/dist/esm/models/components/index.js +4 -0
  66. package/dist/esm/models/components/index.js.map +1 -1
  67. package/dist/esm/models/components/listaavemarketsresponse.d.ts +22 -0
  68. package/dist/esm/models/components/listaavemarketsresponse.d.ts.map +1 -0
  69. package/dist/esm/models/components/listaavemarketsresponse.js +21 -0
  70. package/dist/esm/models/components/listaavemarketsresponse.js.map +1 -0
  71. package/dist/esm/models/components/maxsupplyapymarket.d.ts +21 -0
  72. package/dist/esm/models/components/maxsupplyapymarket.d.ts.map +1 -0
  73. package/dist/esm/models/components/maxsupplyapymarket.js +15 -0
  74. package/dist/esm/models/components/maxsupplyapymarket.js.map +1 -0
  75. package/dist/esm/models/operations/index.d.ts +1 -0
  76. package/dist/esm/models/operations/index.d.ts.map +1 -1
  77. package/dist/esm/models/operations/index.js +1 -0
  78. package/dist/esm/models/operations/index.js.map +1 -1
  79. package/dist/esm/models/operations/v2earnlistaavemarkets.d.ts +16 -0
  80. package/dist/esm/models/operations/v2earnlistaavemarkets.d.ts.map +1 -0
  81. package/dist/esm/models/operations/v2earnlistaavemarkets.js +13 -0
  82. package/dist/esm/models/operations/v2earnlistaavemarkets.js.map +1 -0
  83. package/dist/esm/models/operations/v2earnvaults.d.ts +6 -10
  84. package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
  85. package/dist/esm/models/operations/v2earnvaults.js +2 -8
  86. package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
  87. package/dist/esm/sdk/earn.d.ts +13 -4
  88. package/dist/esm/sdk/earn.d.ts.map +1 -1
  89. package/dist/esm/sdk/earn.js +16 -4
  90. package/dist/esm/sdk/earn.js.map +1 -1
  91. package/docs/models/components/aavemarketinfo.md +25 -0
  92. package/docs/models/components/chainaavemarkets.md +21 -0
  93. package/docs/models/components/listaavemarketsresponse.md +32 -0
  94. package/docs/models/components/maxsupplyapymarket.md +26 -0
  95. package/docs/models/operations/v2earnlistaavemarketsrequest.md +15 -0
  96. package/docs/models/operations/v2earnvaultsrequest.md +8 -9
  97. package/docs/sdks/earn/README.md +77 -6
  98. package/package.json +1 -1
  99. package/src/funcs/earnEarnListAaveMarkets.ts +178 -0
  100. package/src/funcs/earnEarnVaults.ts +3 -4
  101. package/src/models/components/aavemarketinfo.ts +58 -0
  102. package/src/models/components/chainaavemarkets.ts +46 -0
  103. package/src/models/components/index.ts +4 -0
  104. package/src/models/components/listaavemarketsresponse.ts +55 -0
  105. package/src/models/components/maxsupplyapymarket.ts +46 -0
  106. package/src/models/operations/index.ts +1 -0
  107. package/src/models/operations/v2earnlistaavemarkets.ts +37 -0
  108. package/src/models/operations/v2earnvaults.ts +7 -15
  109. package/src/sdk/earn.ts +24 -4
  110. package/docs/models/operations/v2earnvaultschain.md +0 -15
@@ -4,6 +4,7 @@
4
4
  import { earnEarnAaveTokenRates } from "../funcs/earnEarnAaveTokenRates.js";
5
5
  import { earnEarnBundle } from "../funcs/earnEarnBundle.js";
6
6
  import { earnEarnCreateAccount } from "../funcs/earnEarnCreateAccount.js";
7
+ import { earnEarnListAaveMarkets } from "../funcs/earnEarnListAaveMarkets.js";
7
8
  import { earnEarnManage } from "../funcs/earnEarnManage.js";
8
9
  import { earnEarnPositions } from "../funcs/earnEarnPositions.js";
9
10
  import { earnEarnSwap } from "../funcs/earnEarnSwap.js";
@@ -22,13 +23,12 @@ export class Earn extends ClientSDK {
22
23
  return unwrapAsync(earnEarnPositions(this, request, options));
23
24
  }
24
25
  /**
25
- * List Vaults
26
+ * List vaults
26
27
  *
27
28
  * @remarks
28
- * Fetch ERC-4626 vaults from the database with TVL and APY stats.
29
+ * List information about 4626 vaults.
29
30
  *
30
- * Returns a paginated list of ERC-4626 vaults indexed from various chains, joined with
31
- * their current statistics (TVL in USD, 7d/30d/90d APY).
31
+ * These are earn opportunities for protocols like morpho.
32
32
  */
33
33
  async earnVaults(request, options) {
34
34
  return unwrapAsync(earnEarnVaults(this, request, options));
@@ -42,6 +42,18 @@ export class Earn extends ClientSDK {
42
42
  async earnAaveTokenRates(request, options) {
43
43
  return unwrapAsync(earnEarnAaveTokenRates(this, request, options));
44
44
  }
45
+ /**
46
+ * List all Aave markets with rates
47
+ *
48
+ * @remarks
49
+ * List all Aave markets with their supply and borrow rates.
50
+ *
51
+ * Returns rates for all supported tokens across Ethereum, Base, and Arbitrum.
52
+ * Optionally filter by chain. Uses batch_multicall for efficient RPC usage.
53
+ */
54
+ async earnListAaveMarkets(request, options) {
55
+ return unwrapAsync(earnEarnListAaveMarkets(this, request, options));
56
+ }
45
57
  /**
46
58
  * Create earn account
47
59
  *
@@ -1 +1 @@
1
- {"version":3,"file":"earn.js","sourceRoot":"","sources":["../../../src/sdk/earn.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WA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
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { AaveMarketInfo } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: AaveMarketInfo = {
11
+ symbol: "<value>",
12
+ address: "559 Church Road",
13
+ supplyApy: "<value>",
14
+ borrowApy: "<value>",
15
+ };
16
+ ```
17
+
18
+ ## Fields
19
+
20
+ | Field | Type | Required | Description |
21
+ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
22
+ | `symbol` | *string* | :heavy_check_mark: | Token symbol (e.g., 'USDC', 'WETH'). |
23
+ | `address` | *string* | :heavy_check_mark: | Token contract address. |
24
+ | `supplyApy` | *string* | :heavy_check_mark: | Variable rate APY for deposits. |
25
+ | `borrowApy` | *string* | :heavy_check_mark: | Variable rate APY for loans. |
@@ -0,0 +1,21 @@
1
+ # ChainAaveMarkets
2
+
3
+ Aave market data for a specific chain.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { ChainAaveMarkets } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: ChainAaveMarkets = {
11
+ chain: "<value>",
12
+ markets: [],
13
+ };
14
+ ```
15
+
16
+ ## Fields
17
+
18
+ | Field | Type | Required | Description |
19
+ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
20
+ | `chain` | *string* | :heavy_check_mark: | Chain name (ethereum, base, or arbitrum). |
21
+ | `markets` | [components.AaveMarketInfo](../../models/components/aavemarketinfo.md)[] | :heavy_check_mark: | List of all Aave markets with their rates on this chain. |
@@ -0,0 +1,32 @@
1
+ # ListAaveMarketsResponse
2
+
3
+ Response containing Aave market rates for all tokens across chains.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { ListAaveMarketsResponse } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: ListAaveMarketsResponse = {
11
+ chains: [
12
+ {
13
+ chain: "<value>",
14
+ markets: [
15
+ {
16
+ symbol: "<value>",
17
+ address: "28502 Cherry Street",
18
+ supplyApy: "<value>",
19
+ borrowApy: "<value>",
20
+ },
21
+ ],
22
+ },
23
+ ],
24
+ };
25
+ ```
26
+
27
+ ## Fields
28
+
29
+ | Field | Type | Required | Description |
30
+ | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
31
+ | `chains` | [components.ChainAaveMarkets](../../models/components/chainaavemarkets.md)[] | :heavy_check_mark: | List of chains with their Aave market data. |
32
+ | `maxSupplyApy` | [components.MaxSupplyApyMarket](../../models/components/maxsupplyapymarket.md) | :heavy_minus_sign: | The market with the highest supply APY across all queried chains. Only included when multiple chains are queried. |
@@ -0,0 +1,26 @@
1
+ # MaxSupplyApyMarket
2
+
3
+ Information about the market with the highest supply APY.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { MaxSupplyApyMarket } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: MaxSupplyApyMarket = {
11
+ chain: "<value>",
12
+ market: {
13
+ symbol: "<value>",
14
+ address: "1923 Cormier Forest",
15
+ supplyApy: "<value>",
16
+ borrowApy: "<value>",
17
+ },
18
+ };
19
+ ```
20
+
21
+ ## Fields
22
+
23
+ | Field | Type | Required | Description |
24
+ | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
25
+ | `chain` | *string* | :heavy_check_mark: | Chain name where this market exists. |
26
+ | `market` | [components.AaveMarketInfo](../../models/components/aavemarketinfo.md) | :heavy_check_mark: | Rate information for a single token on Aave. |
@@ -0,0 +1,15 @@
1
+ # V2EarnListAaveMarketsRequest
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { V2EarnListAaveMarketsRequest } from "@compass-labs/api-sdk/models/operations";
7
+
8
+ let value: V2EarnListAaveMarketsRequest = {};
9
+ ```
10
+
11
+ ## Fields
12
+
13
+ | Field | Type | Required | Description |
14
+ | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
15
+ | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns rates for all chains. |
@@ -10,17 +10,16 @@ let value: V2EarnVaultsRequest = {
10
10
  direction: "desc",
11
11
  offset: 0,
12
12
  limit: 50,
13
- chain: "ethereum",
14
13
  };
15
14
  ```
16
15
 
17
16
  ## Fields
18
17
 
19
- | Field | Type | Required | Description | Example |
20
- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
21
- | `orderBy` | *string* | :heavy_check_mark: | The field to order the results by. | tvl_usd |
22
- | `direction` | [operations.Direction](../../models/operations/direction.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
23
- | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
24
- | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
25
- | `chain` | [operations.V2EarnVaultsChain](../../models/operations/v2earnvaultschain.md) | :heavy_check_mark: | N/A | ethereum |
26
- | `assetSymbol` | *string* | :heavy_minus_sign: | Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
18
+ | Field | Type | Required | Description | Example |
19
+ | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
20
+ | `orderBy` | *string* | :heavy_check_mark: | The field to order the results by. | tvl_usd |
21
+ | `direction` | [operations.Direction](../../models/operations/direction.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
22
+ | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
23
+ | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
24
+ | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns vaults for all chains. | |
25
+ | `assetSymbol` | *string* | :heavy_minus_sign: | Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
@@ -5,8 +5,9 @@
5
5
  ### Available Operations
6
6
 
7
7
  * [earnPositions](#earnpositions) - List earn positions
8
- * [earnVaults](#earnvaults) - List Vaults
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
@@ -97,10 +98,9 @@ run();
97
98
 
98
99
  ## earnVaults
99
100
 
100
- Fetch ERC-4626 vaults from the database with TVL and APY stats.
101
+ List information about 4626 vaults.
101
102
 
102
- Returns a paginated list of ERC-4626 vaults indexed from various chains, joined with
103
- their current statistics (TVL in USD, 7d/30d/90d APY).
103
+ These are earn opportunities for protocols like morpho.
104
104
 
105
105
  ### Example Usage
106
106
 
@@ -118,7 +118,6 @@ async function run() {
118
118
  direction: "desc",
119
119
  offset: 0,
120
120
  limit: 50,
121
- chain: "ethereum",
122
121
  });
123
122
 
124
123
  console.log(result);
@@ -147,7 +146,6 @@ async function run() {
147
146
  direction: "desc",
148
147
  offset: 0,
149
148
  limit: 50,
150
- chain: "ethereum",
151
149
  });
152
150
  if (res.ok) {
153
151
  const { value: result } = res;
@@ -254,6 +252,79 @@ run();
254
252
  | errors.HTTPValidationError | 422 | application/json |
255
253
  | errors.APIError | 4XX, 5XX | \*/\* |
256
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
+
257
328
  ## earnCreateAccount
258
329
 
259
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.17",
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
+ }
@@ -27,13 +27,12 @@ import { APICall, APIPromise } from "../types/async.js";
27
27
  import { Result } from "../types/fp.js";
28
28
 
29
29
  /**
30
- * List Vaults
30
+ * List vaults
31
31
  *
32
32
  * @remarks
33
- * Fetch ERC-4626 vaults from the database with TVL and APY stats.
33
+ * List information about 4626 vaults.
34
34
  *
35
- * Returns a paginated list of ERC-4626 vaults indexed from various chains, joined with
36
- * their current statistics (TVL in USD, 7d/30d/90d APY).
35
+ * These are earn opportunities for protocols like morpho.
37
36
  */
38
37
  export function earnEarnVaults(
39
38
  client: CompassApiSDKCore,
@@ -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
+ }