@compass-labs/api-sdk 2.1.16 → 2.1.17-rc.0

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 (116) hide show
  1. package/README.md +2 -2
  2. package/codeSamples_typescript.yaml +4 -4
  3. package/dist/commonjs/funcs/{earnEarnPositionsPositionId.d.ts → earnEarnMorphoVaults.d.ts} +7 -4
  4. package/dist/commonjs/funcs/earnEarnMorphoVaults.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/{earnEarnPositionsPositionId.js → earnEarnMorphoVaults.js} +18 -17
  6. package/dist/commonjs/funcs/earnEarnMorphoVaults.js.map +1 -0
  7. package/dist/commonjs/lib/config.d.ts +2 -2
  8. package/dist/commonjs/lib/config.js +2 -2
  9. package/dist/commonjs/models/components/index.d.ts +2 -1
  10. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  11. package/dist/commonjs/models/components/index.js +2 -1
  12. package/dist/commonjs/models/components/index.js.map +1 -1
  13. package/dist/commonjs/models/components/morphovaultinfo.d.ts +60 -0
  14. package/dist/commonjs/models/components/morphovaultinfo.d.ts.map +1 -0
  15. package/dist/commonjs/models/components/{earnpositionresponse.js → morphovaultinfo.js} +29 -21
  16. package/dist/commonjs/models/components/morphovaultinfo.js.map +1 -0
  17. package/dist/commonjs/models/components/morphovaultsresponse.d.ts +20 -0
  18. package/dist/commonjs/models/components/morphovaultsresponse.d.ts.map +1 -0
  19. package/dist/commonjs/models/{operations/v2earnpositionspositionid.js → components/morphovaultsresponse.js} +12 -15
  20. package/dist/commonjs/models/components/morphovaultsresponse.js.map +1 -0
  21. package/dist/commonjs/models/operations/index.d.ts +1 -1
  22. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  23. package/dist/commonjs/models/operations/index.js +1 -1
  24. package/dist/commonjs/models/operations/index.js.map +1 -1
  25. package/dist/commonjs/models/operations/v2earnmorphovaults.d.ts +59 -0
  26. package/dist/commonjs/models/operations/v2earnmorphovaults.d.ts.map +1 -0
  27. package/dist/commonjs/models/operations/v2earnmorphovaults.js +76 -0
  28. package/dist/commonjs/models/operations/v2earnmorphovaults.js.map +1 -0
  29. package/dist/commonjs/models/operations/v2earnvaults.d.ts +4 -4
  30. package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
  31. package/dist/commonjs/models/operations/v2earnvaults.js +4 -5
  32. package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
  33. package/dist/commonjs/sdk/earn.d.ts +10 -7
  34. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  35. package/dist/commonjs/sdk/earn.js +13 -10
  36. package/dist/commonjs/sdk/earn.js.map +1 -1
  37. package/dist/esm/funcs/{earnEarnPositionsPositionId.d.ts → earnEarnMorphoVaults.d.ts} +7 -4
  38. package/dist/esm/funcs/earnEarnMorphoVaults.d.ts.map +1 -0
  39. package/dist/esm/funcs/{earnEarnPositionsPositionId.js → earnEarnMorphoVaults.js} +18 -17
  40. package/dist/esm/funcs/earnEarnMorphoVaults.js.map +1 -0
  41. package/dist/esm/lib/config.d.ts +2 -2
  42. package/dist/esm/lib/config.js +2 -2
  43. package/dist/esm/models/components/index.d.ts +2 -1
  44. package/dist/esm/models/components/index.d.ts.map +1 -1
  45. package/dist/esm/models/components/index.js +2 -1
  46. package/dist/esm/models/components/index.js.map +1 -1
  47. package/dist/esm/models/components/morphovaultinfo.d.ts +60 -0
  48. package/dist/esm/models/components/morphovaultinfo.d.ts.map +1 -0
  49. package/dist/esm/models/components/morphovaultinfo.js +35 -0
  50. package/dist/esm/models/components/morphovaultinfo.js.map +1 -0
  51. package/dist/esm/models/components/morphovaultsresponse.d.ts +20 -0
  52. package/dist/esm/models/components/morphovaultsresponse.d.ts.map +1 -0
  53. package/dist/esm/models/components/morphovaultsresponse.js +17 -0
  54. package/dist/esm/models/components/morphovaultsresponse.js.map +1 -0
  55. package/dist/esm/models/operations/index.d.ts +1 -1
  56. package/dist/esm/models/operations/index.d.ts.map +1 -1
  57. package/dist/esm/models/operations/index.js +1 -1
  58. package/dist/esm/models/operations/index.js.map +1 -1
  59. package/dist/esm/models/operations/v2earnmorphovaults.d.ts +59 -0
  60. package/dist/esm/models/operations/v2earnmorphovaults.d.ts.map +1 -0
  61. package/dist/esm/models/operations/v2earnmorphovaults.js +39 -0
  62. package/dist/esm/models/operations/v2earnmorphovaults.js.map +1 -0
  63. package/dist/esm/models/operations/v2earnvaults.d.ts +4 -4
  64. package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
  65. package/dist/esm/models/operations/v2earnvaults.js +3 -4
  66. package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
  67. package/dist/esm/sdk/earn.d.ts +10 -7
  68. package/dist/esm/sdk/earn.d.ts.map +1 -1
  69. package/dist/esm/sdk/earn.js +13 -10
  70. package/dist/esm/sdk/earn.js.map +1 -1
  71. package/docs/models/components/morphovaultinfo.md +33 -0
  72. package/docs/models/components/morphovaultsresponse.md +32 -0
  73. package/docs/models/operations/v2earnmorphovaultschain.md +15 -0
  74. package/docs/models/operations/v2earnmorphovaultsdirection.md +17 -0
  75. package/docs/models/operations/v2earnmorphovaultsrequest.md +26 -0
  76. package/docs/models/operations/v2earnvaultsdirection.md +17 -0
  77. package/docs/models/operations/v2earnvaultsrequest.md +7 -7
  78. package/docs/sdks/earn/README.md +53 -46
  79. package/examples/node_modules/@types/node/README.md +1 -1
  80. package/examples/node_modules/@types/node/package.json +2 -2
  81. package/examples/node_modules/@types/node/process.d.ts +5 -0
  82. package/examples/package-lock.json +3 -3
  83. package/package.json +1 -1
  84. package/src/funcs/{earnEarnPositionsPositionId.ts → earnEarnMorphoVaults.ts} +22 -23
  85. package/src/lib/config.ts +2 -2
  86. package/src/models/components/index.ts +2 -1
  87. package/src/models/components/morphovaultinfo.ts +103 -0
  88. package/src/models/components/morphovaultsresponse.ts +47 -0
  89. package/src/models/operations/index.ts +1 -1
  90. package/src/models/operations/v2earnmorphovaults.ts +101 -0
  91. package/src/models/operations/v2earnvaults.ts +7 -6
  92. package/src/sdk/earn.ts +21 -18
  93. package/dist/commonjs/funcs/earnEarnPositionsPositionId.d.ts.map +0 -1
  94. package/dist/commonjs/funcs/earnEarnPositionsPositionId.js.map +0 -1
  95. package/dist/commonjs/models/components/earnpositionresponse.d.ts +0 -25
  96. package/dist/commonjs/models/components/earnpositionresponse.d.ts.map +0 -1
  97. package/dist/commonjs/models/components/earnpositionresponse.js.map +0 -1
  98. package/dist/commonjs/models/operations/v2earnpositionspositionid.d.ts +0 -25
  99. package/dist/commonjs/models/operations/v2earnpositionspositionid.d.ts.map +0 -1
  100. package/dist/commonjs/models/operations/v2earnpositionspositionid.js.map +0 -1
  101. package/dist/esm/funcs/earnEarnPositionsPositionId.d.ts.map +0 -1
  102. package/dist/esm/funcs/earnEarnPositionsPositionId.js.map +0 -1
  103. package/dist/esm/models/components/earnpositionresponse.d.ts +0 -25
  104. package/dist/esm/models/components/earnpositionresponse.d.ts.map +0 -1
  105. package/dist/esm/models/components/earnpositionresponse.js +0 -26
  106. package/dist/esm/models/components/earnpositionresponse.js.map +0 -1
  107. package/dist/esm/models/operations/v2earnpositionspositionid.d.ts +0 -25
  108. package/dist/esm/models/operations/v2earnpositionspositionid.d.ts.map +0 -1
  109. package/dist/esm/models/operations/v2earnpositionspositionid.js +0 -20
  110. package/dist/esm/models/operations/v2earnpositionspositionid.js.map +0 -1
  111. package/docs/models/components/earnpositionresponse.md +0 -26
  112. package/docs/models/components/positionunion.md +0 -32
  113. package/docs/models/operations/direction.md +0 -17
  114. package/docs/models/operations/v2earnpositionspositionidrequest.md +0 -21
  115. package/src/models/components/earnpositionresponse.ts +0 -74
  116. package/src/models/operations/v2earnpositionspositionid.ts +0 -54
@@ -5,9 +5,9 @@
5
5
  ### Available Operations
6
6
 
7
7
  * [earnPositions](#earnpositions) - List earn positions
8
- * [earnPositionsPositionId](#earnpositionspositionid) - Get earn position
9
8
  * [earnVaults](#earnvaults) - List vaults
10
9
  * [earnAaveTokenRates](#earnaavetokenrates) - Get token rates on Aave
10
+ * [earnMorphoVaults](#earnmorphovaults) - List Morpho vaults
11
11
  * [earnCreateAccount](#earncreateaccount) - Create earn account
12
12
  * [earnTransfer](#earntransfer) - Transfer tokens to/from account
13
13
  * [earnManage](#earnmanage) - Manage earn position
@@ -96,13 +96,13 @@ run();
96
96
  | errors.HTTPValidationError | 422 | application/json |
97
97
  | errors.APIError | 4XX, 5XX | \*/\* |
98
98
 
99
- ## earnPositionsPositionId
99
+ ## earnVaults
100
100
 
101
- This endpoint fetches a single Compass Earn position by its encoded ID.
101
+ This endpoint fetches a curated list of DeFi vaults.
102
102
 
103
103
  ### Example Usage
104
104
 
105
- <!-- UsageSnippet language="typescript" operationID="v2_earn_positions_{position_id}" method="get" path="/v2/earn/positions/{position_id}" -->
105
+ <!-- UsageSnippet language="typescript" operationID="v2_earn_vaults" method="get" path="/v2/earn/vaults" -->
106
106
  ```typescript
107
107
  import { CompassApiSDK } from "@compass-labs/api-sdk";
108
108
 
@@ -111,10 +111,12 @@ const compassApiSDK = new CompassApiSDK({
111
111
  });
112
112
 
113
113
  async function run() {
114
- const result = await compassApiSDK.earn.earnPositionsPositionId({
115
- positionId: "<id>",
116
- userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
117
- days: 100,
114
+ const result = await compassApiSDK.earn.earnVaults({
115
+ orderBy: "lifetime_return",
116
+ direction: "desc",
117
+ offset: 0,
118
+ limit: 50,
119
+ chain: "ethereum",
118
120
  });
119
121
 
120
122
  console.log(result);
@@ -129,7 +131,7 @@ The standalone function version of this method:
129
131
 
130
132
  ```typescript
131
133
  import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
132
- import { earnEarnPositionsPositionId } from "@compass-labs/api-sdk/funcs/earnEarnPositionsPositionId.js";
134
+ import { earnEarnVaults } from "@compass-labs/api-sdk/funcs/earnEarnVaults.js";
133
135
 
134
136
  // Use `CompassApiSDKCore` for best tree-shaking performance.
135
137
  // You can create one instance of it to use across an application.
@@ -138,16 +140,18 @@ const compassApiSDK = new CompassApiSDKCore({
138
140
  });
139
141
 
140
142
  async function run() {
141
- const res = await earnEarnPositionsPositionId(compassApiSDK, {
142
- positionId: "<id>",
143
- userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
144
- days: 100,
143
+ const res = await earnEarnVaults(compassApiSDK, {
144
+ orderBy: "lifetime_return",
145
+ direction: "desc",
146
+ offset: 0,
147
+ limit: 50,
148
+ chain: "ethereum",
145
149
  });
146
150
  if (res.ok) {
147
151
  const { value: result } = res;
148
152
  console.log(result);
149
153
  } else {
150
- console.log("earnEarnPositionsPositionId failed:", res.error);
154
+ console.log("earnEarnVaults failed:", res.error);
151
155
  }
152
156
  }
153
157
 
@@ -158,14 +162,14 @@ run();
158
162
 
159
163
  | Parameter | Type | Required | Description |
160
164
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
161
- | `request` | [operations.V2EarnPositionsPositionIdRequest](../../models/operations/v2earnpositionspositionidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
165
+ | `request` | [operations.V2EarnVaultsRequest](../../models/operations/v2earnvaultsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
162
166
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
163
167
  | `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. |
164
168
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
165
169
 
166
170
  ### Response
167
171
 
168
- **Promise\<[components.EarnPositionResponse](../../models/components/earnpositionresponse.md)\>**
172
+ **Promise\<[components.VaultsListResponse](../../models/components/vaultslistresponse.md)\>**
169
173
 
170
174
  ### Errors
171
175
 
@@ -174,13 +178,13 @@ run();
174
178
  | errors.HTTPValidationError | 422 | application/json |
175
179
  | errors.APIError | 4XX, 5XX | \*/\* |
176
180
 
177
- ## earnVaults
181
+ ## earnAaveTokenRates
178
182
 
179
- This endpoint fetches a curated list of DeFi vaults.
183
+ This endpoint fetches token rates on Aave across Ethereum, Base, and Arbitrum.
180
184
 
181
185
  ### Example Usage
182
186
 
183
- <!-- UsageSnippet language="typescript" operationID="v2_earn_vaults" method="get" path="/v2/earn/vaults" -->
187
+ <!-- UsageSnippet language="typescript" operationID="v2_earn_aave_token_rates" method="get" path="/v2/earn/aave_token_rates" -->
184
188
  ```typescript
185
189
  import { CompassApiSDK } from "@compass-labs/api-sdk";
186
190
 
@@ -189,12 +193,8 @@ const compassApiSDK = new CompassApiSDK({
189
193
  });
190
194
 
191
195
  async function run() {
192
- const result = await compassApiSDK.earn.earnVaults({
193
- orderBy: "lifetime_return",
194
- direction: "desc",
195
- offset: 0,
196
- limit: 50,
197
- chain: "ethereum",
196
+ const result = await compassApiSDK.earn.earnAaveTokenRates({
197
+ token: "USDC",
198
198
  });
199
199
 
200
200
  console.log(result);
@@ -209,7 +209,7 @@ The standalone function version of this method:
209
209
 
210
210
  ```typescript
211
211
  import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
212
- import { earnEarnVaults } from "@compass-labs/api-sdk/funcs/earnEarnVaults.js";
212
+ import { earnEarnAaveTokenRates } from "@compass-labs/api-sdk/funcs/earnEarnAaveTokenRates.js";
213
213
 
214
214
  // Use `CompassApiSDKCore` for best tree-shaking performance.
215
215
  // You can create one instance of it to use across an application.
@@ -218,18 +218,14 @@ const compassApiSDK = new CompassApiSDKCore({
218
218
  });
219
219
 
220
220
  async function run() {
221
- const res = await earnEarnVaults(compassApiSDK, {
222
- orderBy: "lifetime_return",
223
- direction: "desc",
224
- offset: 0,
225
- limit: 50,
226
- chain: "ethereum",
221
+ const res = await earnEarnAaveTokenRates(compassApiSDK, {
222
+ token: "USDC",
227
223
  });
228
224
  if (res.ok) {
229
225
  const { value: result } = res;
230
226
  console.log(result);
231
227
  } else {
232
- console.log("earnEarnVaults failed:", res.error);
228
+ console.log("earnEarnAaveTokenRates failed:", res.error);
233
229
  }
234
230
  }
235
231
 
@@ -240,14 +236,14 @@ run();
240
236
 
241
237
  | Parameter | Type | Required | Description |
242
238
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
243
- | `request` | [operations.V2EarnVaultsRequest](../../models/operations/v2earnvaultsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
239
+ | `request` | [operations.V2EarnAaveTokenRatesRequest](../../models/operations/v2earnaavetokenratesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
244
240
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
245
241
  | `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. |
246
242
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
247
243
 
248
244
  ### Response
249
245
 
250
- **Promise\<[components.VaultsListResponse](../../models/components/vaultslistresponse.md)\>**
246
+ **Promise\<[components.AaveUsdcRatesResponse](../../models/components/aaveusdcratesresponse.md)\>**
251
247
 
252
248
  ### Errors
253
249
 
@@ -256,13 +252,16 @@ run();
256
252
  | errors.HTTPValidationError | 422 | application/json |
257
253
  | errors.APIError | 4XX, 5XX | \*/\* |
258
254
 
259
- ## earnAaveTokenRates
255
+ ## earnMorphoVaults
260
256
 
261
- This endpoint fetches token rates on Aave across Ethereum, Base, and Arbitrum.
257
+ Fetch Morpho vaults from the database with TVL and APY stats.
258
+
259
+ Returns a paginated list of Morpho vaults indexed from various chains, joined with
260
+ their current statistics (TVL in USD, 7d/30d/90d APY).
262
261
 
263
262
  ### Example Usage
264
263
 
265
- <!-- UsageSnippet language="typescript" operationID="v2_earn_aave_token_rates" method="get" path="/v2/earn/aave_token_rates" -->
264
+ <!-- UsageSnippet language="typescript" operationID="v2_earn_morpho_vaults" method="get" path="/v2/earn/morpho_vaults" -->
266
265
  ```typescript
267
266
  import { CompassApiSDK } from "@compass-labs/api-sdk";
268
267
 
@@ -271,8 +270,12 @@ const compassApiSDK = new CompassApiSDK({
271
270
  });
272
271
 
273
272
  async function run() {
274
- const result = await compassApiSDK.earn.earnAaveTokenRates({
275
- token: "USDC",
273
+ const result = await compassApiSDK.earn.earnMorphoVaults({
274
+ orderBy: "tvl_usd",
275
+ direction: "desc",
276
+ offset: 0,
277
+ limit: 50,
278
+ chain: "ethereum",
276
279
  });
277
280
 
278
281
  console.log(result);
@@ -287,7 +290,7 @@ The standalone function version of this method:
287
290
 
288
291
  ```typescript
289
292
  import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
290
- import { earnEarnAaveTokenRates } from "@compass-labs/api-sdk/funcs/earnEarnAaveTokenRates.js";
293
+ import { earnEarnMorphoVaults } from "@compass-labs/api-sdk/funcs/earnEarnMorphoVaults.js";
291
294
 
292
295
  // Use `CompassApiSDKCore` for best tree-shaking performance.
293
296
  // You can create one instance of it to use across an application.
@@ -296,14 +299,18 @@ const compassApiSDK = new CompassApiSDKCore({
296
299
  });
297
300
 
298
301
  async function run() {
299
- const res = await earnEarnAaveTokenRates(compassApiSDK, {
300
- token: "USDC",
302
+ const res = await earnEarnMorphoVaults(compassApiSDK, {
303
+ orderBy: "tvl_usd",
304
+ direction: "desc",
305
+ offset: 0,
306
+ limit: 50,
307
+ chain: "ethereum",
301
308
  });
302
309
  if (res.ok) {
303
310
  const { value: result } = res;
304
311
  console.log(result);
305
312
  } else {
306
- console.log("earnEarnAaveTokenRates failed:", res.error);
313
+ console.log("earnEarnMorphoVaults failed:", res.error);
307
314
  }
308
315
  }
309
316
 
@@ -314,14 +321,14 @@ run();
314
321
 
315
322
  | Parameter | Type | Required | Description |
316
323
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
317
- | `request` | [operations.V2EarnAaveTokenRatesRequest](../../models/operations/v2earnaavetokenratesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
324
+ | `request` | [operations.V2EarnMorphoVaultsRequest](../../models/operations/v2earnmorphovaultsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
318
325
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
319
326
  | `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. |
320
327
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
321
328
 
322
329
  ### Response
323
330
 
324
- **Promise\<[components.AaveUsdcRatesResponse](../../models/components/aaveusdcratesresponse.md)\>**
331
+ **Promise\<[components.MorphoVaultsResponse](../../models/components/morphovaultsresponse.md)\>**
325
332
 
326
333
  ### Errors
327
334
 
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 08 Dec 2025 22:36:14 GMT
11
+ * Last updated: Sun, 14 Dec 2025 00:04:32 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.19.26",
3
+ "version": "20.19.27",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -135,6 +135,6 @@
135
135
  "undici-types": "~6.21.0"
136
136
  },
137
137
  "peerDependencies": {},
138
- "typesPublisherContentHash": "a27fb254f16db0b1806ad224d41a68cf2a520cc90b9aabca9e3abd67586b2c43",
138
+ "typesPublisherContentHash": "93de83e3adc7c983f95cd1ea65338fc0705267f2e83738d75488fe33f636fcd1",
139
139
  "typeScriptVersion": "5.2"
140
140
  }
@@ -1637,6 +1637,11 @@ declare module "process" {
1637
1637
  * @param args Additional arguments to pass when invoking the `callback`
1638
1638
  */
1639
1639
  nextTick(callback: Function, ...args: any[]): void;
1640
+ /**
1641
+ * The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process.
1642
+ * See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior.
1643
+ */
1644
+ noDeprecation?: boolean;
1640
1645
  /**
1641
1646
  * This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-permission) flag.
1642
1647
  *
@@ -478,9 +478,9 @@
478
478
  }
479
479
  },
480
480
  "node_modules/@types/node": {
481
- "version": "20.19.26",
482
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.26.tgz",
483
- "integrity": "sha512-0l6cjgF0XnihUpndDhk+nyD3exio3iKaYROSgvh/qSevPXax3L8p5DBRFjbvalnwatGgHEQn2R88y2fA3g4irg==",
481
+ "version": "20.19.27",
482
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.27.tgz",
483
+ "integrity": "sha512-N2clP5pJhB2YnZJ3PIHFk5RkygRX5WO/5f0WC08tp0wd+sv0rsJk3MqWn3CbNmT2J505a5336jaQj4ph1AdMug==",
484
484
  "dev": true,
485
485
  "license": "MIT",
486
486
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.1.16",
3
+ "version": "2.1.17-rc.0",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { CompassApiSDKCore } from "../core.js";
6
- import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
7
  import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
@@ -27,18 +27,21 @@ import { APICall, APIPromise } from "../types/async.js";
27
27
  import { Result } from "../types/fp.js";
28
28
 
29
29
  /**
30
- * Get earn position
30
+ * List Morpho vaults
31
31
  *
32
32
  * @remarks
33
- * This endpoint fetches a single Compass Earn position by its encoded ID.
33
+ * Fetch Morpho vaults from the database with TVL and APY stats.
34
+ *
35
+ * Returns a paginated list of Morpho vaults indexed from various chains, joined with
36
+ * their current statistics (TVL in USD, 7d/30d/90d APY).
34
37
  */
35
- export function earnEarnPositionsPositionId(
38
+ export function earnEarnMorphoVaults(
36
39
  client: CompassApiSDKCore,
37
- request: operations.V2EarnPositionsPositionIdRequest,
40
+ request: operations.V2EarnMorphoVaultsRequest,
38
41
  options?: RequestOptions,
39
42
  ): APIPromise<
40
43
  Result<
41
- components.EarnPositionResponse,
44
+ components.MorphoVaultsResponse,
42
45
  | errors.HTTPValidationError
43
46
  | CompassAPISDKError
44
47
  | ResponseValidationError
@@ -59,12 +62,12 @@ export function earnEarnPositionsPositionId(
59
62
 
60
63
  async function $do(
61
64
  client: CompassApiSDKCore,
62
- request: operations.V2EarnPositionsPositionIdRequest,
65
+ request: operations.V2EarnMorphoVaultsRequest,
63
66
  options?: RequestOptions,
64
67
  ): Promise<
65
68
  [
66
69
  Result<
67
- components.EarnPositionResponse,
70
+ components.MorphoVaultsResponse,
68
71
  | errors.HTTPValidationError
69
72
  | CompassAPISDKError
70
73
  | ResponseValidationError
@@ -80,8 +83,7 @@ async function $do(
80
83
  > {
81
84
  const parsed = safeParse(
82
85
  request,
83
- (value) =>
84
- operations.V2EarnPositionsPositionIdRequest$outboundSchema.parse(value),
86
+ (value) => operations.V2EarnMorphoVaultsRequest$outboundSchema.parse(value),
85
87
  "Input validation failed",
86
88
  );
87
89
  if (!parsed.ok) {
@@ -90,18 +92,15 @@ async function $do(
90
92
  const payload = parsed.value;
91
93
  const body = null;
92
94
 
93
- const pathParams = {
94
- position_id: encodeSimple("position_id", payload.position_id, {
95
- explode: false,
96
- charEncoding: "percent",
97
- }),
98
- };
99
-
100
- const path = pathToFunc("/v2/earn/positions/{position_id}")(pathParams);
95
+ const path = pathToFunc("/v2/earn/morpho_vaults")();
101
96
 
102
97
  const query = encodeFormQuery({
103
- "days": payload.days,
104
- "user_address": payload.user_address,
98
+ "asset_symbol": payload.asset_symbol,
99
+ "chain": payload.chain,
100
+ "direction": payload.direction,
101
+ "limit": payload.limit,
102
+ "offset": payload.offset,
103
+ "order_by": payload.order_by,
105
104
  });
106
105
 
107
106
  const headers = new Headers(compactMap({
@@ -115,7 +114,7 @@ async function $do(
115
114
  const context = {
116
115
  options: client._options,
117
116
  baseURL: options?.serverURL ?? client._baseURL ?? "",
118
- operationID: "v2_earn_positions_{position_id}",
117
+ operationID: "v2_earn_morpho_vaults",
119
118
  oAuth2Scopes: null,
120
119
 
121
120
  resolvedSecurity: requestSecurity,
@@ -159,7 +158,7 @@ async function $do(
159
158
  };
160
159
 
161
160
  const [result] = await M.match<
162
- components.EarnPositionResponse,
161
+ components.MorphoVaultsResponse,
163
162
  | errors.HTTPValidationError
164
163
  | CompassAPISDKError
165
164
  | ResponseValidationError
@@ -170,7 +169,7 @@ async function $do(
170
169
  | UnexpectedClientError
171
170
  | SDKValidationError
172
171
  >(
173
- M.json(200, components.EarnPositionResponse$inboundSchema),
172
+ M.json(200, components.MorphoVaultsResponse$inboundSchema),
174
173
  M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
175
174
  M.fail("4XX"),
176
175
  M.fail("5XX"),
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.776.1",
65
+ genVersion: "2.781.2",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.776.1 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.781.2 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -84,7 +84,6 @@ export * from "./details.js";
84
84
  export * from "./earnmanageparams.js";
85
85
  export * from "./earnmanagerequest.js";
86
86
  export * from "./earnmanageresponse.js";
87
- export * from "./earnpositionresponse.js";
88
87
  export * from "./earnpositionsresponse.js";
89
88
  export * from "./earnswapparams.js";
90
89
  export * from "./earnswaprequest.js";
@@ -131,6 +130,8 @@ export * from "./morphorepayrequest.js";
131
130
  export * from "./morphosupplycollateralparams.js";
132
131
  export * from "./morphosupplycollateralrequest.js";
133
132
  export * from "./morphovault.js";
133
+ export * from "./morphovaultinfo.js";
134
+ export * from "./morphovaultsresponse.js";
134
135
  export * from "./morphowithdrawcollateralparams.js";
135
136
  export * from "./morphowithdrawcollateralrequest.js";
136
137
  export * from "./morphowithdrawparams.js";
@@ -0,0 +1,103 @@
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
+ * Information about a single Morpho vault from the database.
13
+ */
14
+ export type MorphoVaultInfo = {
15
+ /**
16
+ * The vault contract address.
17
+ */
18
+ vaultAddress: string;
19
+ /**
20
+ * Blockchain name (e.g., 'ethereum', 'base').
21
+ */
22
+ chain: string;
23
+ /**
24
+ * The name of the vault.
25
+ */
26
+ name?: string | null | undefined;
27
+ /**
28
+ * The vault share token symbol.
29
+ */
30
+ symbol?: string | null | undefined;
31
+ /**
32
+ * The vault owner address.
33
+ */
34
+ owner: string;
35
+ /**
36
+ * The underlying asset contract address.
37
+ */
38
+ asset: string;
39
+ /**
40
+ * The name of the underlying asset.
41
+ */
42
+ assetName?: string | null | undefined;
43
+ /**
44
+ * The symbol of the underlying asset (e.g., 'USDC').
45
+ */
46
+ assetSymbol?: string | null | undefined;
47
+ /**
48
+ * Total Value Locked in USD.
49
+ */
50
+ tvlUsd?: string | null | undefined;
51
+ /**
52
+ * 7-day APY as a percentage (e.g., 5.25 = 5.25%).
53
+ */
54
+ apy7d?: string | null | undefined;
55
+ /**
56
+ * 30-day APY as a percentage.
57
+ */
58
+ apy30d?: string | null | undefined;
59
+ /**
60
+ * 90-day APY as a percentage.
61
+ */
62
+ apy90d?: string | null | undefined;
63
+ };
64
+
65
+ /** @internal */
66
+ export const MorphoVaultInfo$inboundSchema: z.ZodType<
67
+ MorphoVaultInfo,
68
+ z.ZodTypeDef,
69
+ unknown
70
+ > = z.object({
71
+ vault_address: z.string(),
72
+ chain: z.string(),
73
+ name: z.nullable(z.string()).optional(),
74
+ symbol: z.nullable(z.string()).optional(),
75
+ owner: z.string(),
76
+ asset: z.string(),
77
+ asset_name: z.nullable(z.string()).optional(),
78
+ asset_symbol: z.nullable(z.string()).optional(),
79
+ tvl_usd: z.nullable(z.string()).optional(),
80
+ apy_7d: z.nullable(z.string()).optional(),
81
+ apy_30d: z.nullable(z.string()).optional(),
82
+ apy_90d: z.nullable(z.string()).optional(),
83
+ }).transform((v) => {
84
+ return remap$(v, {
85
+ "vault_address": "vaultAddress",
86
+ "asset_name": "assetName",
87
+ "asset_symbol": "assetSymbol",
88
+ "tvl_usd": "tvlUsd",
89
+ "apy_7d": "apy7d",
90
+ "apy_30d": "apy30d",
91
+ "apy_90d": "apy90d",
92
+ });
93
+ });
94
+
95
+ export function morphoVaultInfoFromJSON(
96
+ jsonString: string,
97
+ ): SafeParseResult<MorphoVaultInfo, SDKValidationError> {
98
+ return safeParse(
99
+ jsonString,
100
+ (x) => MorphoVaultInfo$inboundSchema.parse(JSON.parse(x)),
101
+ `Failed to parse 'MorphoVaultInfo' from JSON`,
102
+ );
103
+ }
@@ -0,0 +1,47 @@
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
+ MorphoVaultInfo,
11
+ MorphoVaultInfo$inboundSchema,
12
+ } from "./morphovaultinfo.js";
13
+
14
+ /**
15
+ * Response model for a paginated list of Morpho vaults.
16
+ */
17
+ export type MorphoVaultsResponse = {
18
+ total: number;
19
+ offset: number;
20
+ limit: number;
21
+ /**
22
+ * A list of Morpho vault information objects.
23
+ */
24
+ vaults: Array<MorphoVaultInfo>;
25
+ };
26
+
27
+ /** @internal */
28
+ export const MorphoVaultsResponse$inboundSchema: z.ZodType<
29
+ MorphoVaultsResponse,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ total: z.number().int(),
34
+ offset: z.number().int(),
35
+ limit: z.number().int(),
36
+ vaults: z.array(MorphoVaultInfo$inboundSchema),
37
+ });
38
+
39
+ export function morphoVaultsResponseFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<MorphoVaultsResponse, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => MorphoVaultsResponse$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'MorphoVaultsResponse' from JSON`,
46
+ );
47
+ }
@@ -42,6 +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 "./v2earnmorphovaults.js";
45
46
  export * from "./v2earnpositions.js";
46
- export * from "./v2earnpositionspositionid.js";
47
47
  export * from "./v2earnvaults.js";