@compass-labs/api-sdk 2.1.17-rc.0 → 2.1.17-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.
- package/README.md +3 -5
- package/codeSamples_typescript.yaml +1 -7
- package/dist/commonjs/funcs/earnEarnVaults.d.ts +6 -3
- package/dist/commonjs/funcs/earnEarnVaults.d.ts.map +1 -1
- package/dist/commonjs/funcs/earnEarnVaults.js +7 -3
- package/dist/commonjs/funcs/earnEarnVaults.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -3
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -3
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/vaultinfo.d.ts +22 -110
- package/dist/commonjs/models/components/vaultinfo.d.ts.map +1 -1
- package/dist/commonjs/models/components/vaultinfo.js +19 -58
- package/dist/commonjs/models/components/vaultinfo.js.map +1 -1
- package/dist/{esm/models/components/vaultslistresponse.d.ts → commonjs/models/components/vaultsresponse.d.ts} +5 -5
- package/dist/commonjs/models/components/vaultsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/{vaultslistresponse.js → vaultsresponse.js} +6 -6
- package/dist/commonjs/models/components/vaultsresponse.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +0 -1
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -1
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/v2earnvaults.d.ts +9 -4
- package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2earnvaults.js +7 -4
- package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
- package/dist/commonjs/sdk/earn.d.ts +6 -13
- package/dist/commonjs/sdk/earn.d.ts.map +1 -1
- package/dist/commonjs/sdk/earn.js +5 -15
- package/dist/commonjs/sdk/earn.js.map +1 -1
- package/dist/esm/funcs/earnEarnVaults.d.ts +6 -3
- package/dist/esm/funcs/earnEarnVaults.d.ts.map +1 -1
- package/dist/esm/funcs/earnEarnVaults.js +7 -3
- package/dist/esm/funcs/earnEarnVaults.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -3
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -3
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/vaultinfo.d.ts +22 -110
- package/dist/esm/models/components/vaultinfo.d.ts.map +1 -1
- package/dist/esm/models/components/vaultinfo.js +19 -58
- package/dist/esm/models/components/vaultinfo.js.map +1 -1
- package/dist/{commonjs/models/components/vaultslistresponse.d.ts → esm/models/components/vaultsresponse.d.ts} +5 -5
- package/dist/esm/models/components/vaultsresponse.d.ts.map +1 -0
- package/dist/esm/models/components/{vaultslistresponse.js → vaultsresponse.js} +4 -4
- package/dist/esm/models/components/vaultsresponse.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +0 -1
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -1
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/v2earnvaults.d.ts +9 -4
- package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
- package/dist/esm/models/operations/v2earnvaults.js +6 -3
- package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
- package/dist/esm/sdk/earn.d.ts +6 -13
- package/dist/esm/sdk/earn.d.ts.map +1 -1
- package/dist/esm/sdk/earn.js +5 -15
- package/dist/esm/sdk/earn.js.map +1 -1
- package/docs/models/components/vaultinfo.md +19 -43
- package/docs/models/components/{vaultslistresponse.md → vaultsresponse.md} +15 -8
- package/docs/models/operations/direction.md +17 -0
- package/docs/models/operations/v2earnvaultsrequest.md +9 -8
- package/docs/sdks/earn/README.md +8 -91
- package/package.json +1 -1
- package/src/funcs/earnEarnVaults.ts +10 -6
- package/src/models/components/index.ts +1 -3
- package/src/models/components/vaultinfo.ts +41 -168
- package/src/models/components/{vaultslistresponse.ts → vaultsresponse.ts} +8 -8
- package/src/models/operations/index.ts +0 -1
- package/src/models/operations/v2earnvaults.ts +13 -7
- package/src/sdk/earn.ts +6 -24
- package/dist/commonjs/funcs/earnEarnMorphoVaults.d.ts +0 -22
- package/dist/commonjs/funcs/earnEarnMorphoVaults.d.ts.map +0 -1
- package/dist/commonjs/funcs/earnEarnMorphoVaults.js +0 -130
- package/dist/commonjs/funcs/earnEarnMorphoVaults.js.map +0 -1
- package/dist/commonjs/models/components/morphovaultinfo.d.ts +0 -60
- package/dist/commonjs/models/components/morphovaultinfo.d.ts.map +0 -1
- package/dist/commonjs/models/components/morphovaultinfo.js +0 -72
- package/dist/commonjs/models/components/morphovaultinfo.js.map +0 -1
- package/dist/commonjs/models/components/morphovaultsresponse.d.ts +0 -20
- package/dist/commonjs/models/components/morphovaultsresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/morphovaultsresponse.js +0 -54
- package/dist/commonjs/models/components/morphovaultsresponse.js.map +0 -1
- package/dist/commonjs/models/components/vaultslistresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/vaultslistresponse.js.map +0 -1
- package/dist/commonjs/models/operations/v2earnmorphovaults.d.ts +0 -59
- package/dist/commonjs/models/operations/v2earnmorphovaults.d.ts.map +0 -1
- package/dist/commonjs/models/operations/v2earnmorphovaults.js +0 -76
- package/dist/commonjs/models/operations/v2earnmorphovaults.js.map +0 -1
- package/dist/esm/funcs/earnEarnMorphoVaults.d.ts +0 -22
- package/dist/esm/funcs/earnEarnMorphoVaults.d.ts.map +0 -1
- package/dist/esm/funcs/earnEarnMorphoVaults.js +0 -94
- package/dist/esm/funcs/earnEarnMorphoVaults.js.map +0 -1
- package/dist/esm/models/components/morphovaultinfo.d.ts +0 -60
- package/dist/esm/models/components/morphovaultinfo.d.ts.map +0 -1
- package/dist/esm/models/components/morphovaultinfo.js +0 -35
- package/dist/esm/models/components/morphovaultinfo.js.map +0 -1
- package/dist/esm/models/components/morphovaultsresponse.d.ts +0 -20
- package/dist/esm/models/components/morphovaultsresponse.d.ts.map +0 -1
- package/dist/esm/models/components/morphovaultsresponse.js +0 -17
- package/dist/esm/models/components/morphovaultsresponse.js.map +0 -1
- package/dist/esm/models/components/vaultslistresponse.d.ts.map +0 -1
- package/dist/esm/models/components/vaultslistresponse.js.map +0 -1
- package/dist/esm/models/operations/v2earnmorphovaults.d.ts +0 -59
- package/dist/esm/models/operations/v2earnmorphovaults.d.ts.map +0 -1
- package/dist/esm/models/operations/v2earnmorphovaults.js +0 -39
- package/dist/esm/models/operations/v2earnmorphovaults.js.map +0 -1
- package/docs/models/components/morphovaultinfo.md +0 -33
- package/docs/models/components/morphovaultsresponse.md +0 -32
- package/docs/models/operations/v2earnmorphovaultschain.md +0 -15
- package/docs/models/operations/v2earnmorphovaultsdirection.md +0 -17
- package/docs/models/operations/v2earnmorphovaultsrequest.md +0 -26
- package/docs/models/operations/v2earnvaultsdirection.md +0 -17
- package/src/funcs/earnEarnMorphoVaults.ts +0 -182
- package/src/models/components/morphovaultinfo.ts +0 -103
- package/src/models/components/morphovaultsresponse.ts +0 -47
- package/src/models/operations/v2earnmorphovaults.ts +0 -101
package/docs/sdks/earn/README.md
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
### Available Operations
|
|
6
6
|
|
|
7
7
|
* [earnPositions](#earnpositions) - List earn positions
|
|
8
|
-
* [earnVaults](#earnvaults) - List
|
|
8
|
+
* [earnVaults](#earnvaults) - List Vaults
|
|
9
9
|
* [earnAaveTokenRates](#earnaavetokenrates) - Get token rates on Aave
|
|
10
|
-
* [earnMorphoVaults](#earnmorphovaults) - List Morpho vaults
|
|
11
10
|
* [earnCreateAccount](#earncreateaccount) - Create earn account
|
|
12
11
|
* [earnTransfer](#earntransfer) - Transfer tokens to/from account
|
|
13
12
|
* [earnManage](#earnmanage) - Manage earn position
|
|
@@ -98,7 +97,10 @@ run();
|
|
|
98
97
|
|
|
99
98
|
## earnVaults
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
Fetch ERC-4626 vaults from the database with TVL and APY stats.
|
|
101
|
+
|
|
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).
|
|
102
104
|
|
|
103
105
|
### Example Usage
|
|
104
106
|
|
|
@@ -112,7 +114,7 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
112
114
|
|
|
113
115
|
async function run() {
|
|
114
116
|
const result = await compassApiSDK.earn.earnVaults({
|
|
115
|
-
orderBy: "
|
|
117
|
+
orderBy: "tvl_usd",
|
|
116
118
|
direction: "desc",
|
|
117
119
|
offset: 0,
|
|
118
120
|
limit: 50,
|
|
@@ -141,7 +143,7 @@ const compassApiSDK = new CompassApiSDKCore({
|
|
|
141
143
|
|
|
142
144
|
async function run() {
|
|
143
145
|
const res = await earnEarnVaults(compassApiSDK, {
|
|
144
|
-
orderBy: "
|
|
146
|
+
orderBy: "tvl_usd",
|
|
145
147
|
direction: "desc",
|
|
146
148
|
offset: 0,
|
|
147
149
|
limit: 50,
|
|
@@ -169,7 +171,7 @@ run();
|
|
|
169
171
|
|
|
170
172
|
### Response
|
|
171
173
|
|
|
172
|
-
**Promise\<[components.
|
|
174
|
+
**Promise\<[components.VaultsResponse](../../models/components/vaultsresponse.md)\>**
|
|
173
175
|
|
|
174
176
|
### Errors
|
|
175
177
|
|
|
@@ -252,91 +254,6 @@ run();
|
|
|
252
254
|
| errors.HTTPValidationError | 422 | application/json |
|
|
253
255
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
254
256
|
|
|
255
|
-
## earnMorphoVaults
|
|
256
|
-
|
|
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).
|
|
261
|
-
|
|
262
|
-
### Example Usage
|
|
263
|
-
|
|
264
|
-
<!-- UsageSnippet language="typescript" operationID="v2_earn_morpho_vaults" method="get" path="/v2/earn/morpho_vaults" -->
|
|
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.earnMorphoVaults({
|
|
274
|
-
orderBy: "tvl_usd",
|
|
275
|
-
direction: "desc",
|
|
276
|
-
offset: 0,
|
|
277
|
-
limit: 50,
|
|
278
|
-
chain: "ethereum",
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
console.log(result);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
run();
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### Standalone function
|
|
288
|
-
|
|
289
|
-
The standalone function version of this method:
|
|
290
|
-
|
|
291
|
-
```typescript
|
|
292
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
293
|
-
import { earnEarnMorphoVaults } from "@compass-labs/api-sdk/funcs/earnEarnMorphoVaults.js";
|
|
294
|
-
|
|
295
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
296
|
-
// You can create one instance of it to use across an application.
|
|
297
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
298
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
async function run() {
|
|
302
|
-
const res = await earnEarnMorphoVaults(compassApiSDK, {
|
|
303
|
-
orderBy: "tvl_usd",
|
|
304
|
-
direction: "desc",
|
|
305
|
-
offset: 0,
|
|
306
|
-
limit: 50,
|
|
307
|
-
chain: "ethereum",
|
|
308
|
-
});
|
|
309
|
-
if (res.ok) {
|
|
310
|
-
const { value: result } = res;
|
|
311
|
-
console.log(result);
|
|
312
|
-
} else {
|
|
313
|
-
console.log("earnEarnMorphoVaults failed:", res.error);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
run();
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
### Parameters
|
|
321
|
-
|
|
322
|
-
| Parameter | Type | Required | Description |
|
|
323
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
324
|
-
| `request` | [operations.V2EarnMorphoVaultsRequest](../../models/operations/v2earnmorphovaultsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
325
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
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. |
|
|
327
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
328
|
-
|
|
329
|
-
### Response
|
|
330
|
-
|
|
331
|
-
**Promise\<[components.MorphoVaultsResponse](../../models/components/morphovaultsresponse.md)\>**
|
|
332
|
-
|
|
333
|
-
### Errors
|
|
334
|
-
|
|
335
|
-
| Error Type | Status Code | Content Type |
|
|
336
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
337
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
338
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
339
|
-
|
|
340
257
|
## earnCreateAccount
|
|
341
258
|
|
|
342
259
|
Create an Earn Account.
|
package/package.json
CHANGED
|
@@ -27,10 +27,13 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* List
|
|
30
|
+
* List Vaults
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
*
|
|
33
|
+
* Fetch ERC-4626 vaults from the database with TVL and APY stats.
|
|
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).
|
|
34
37
|
*/
|
|
35
38
|
export function earnEarnVaults(
|
|
36
39
|
client: CompassApiSDKCore,
|
|
@@ -38,7 +41,7 @@ export function earnEarnVaults(
|
|
|
38
41
|
options?: RequestOptions,
|
|
39
42
|
): APIPromise<
|
|
40
43
|
Result<
|
|
41
|
-
components.
|
|
44
|
+
components.VaultsResponse,
|
|
42
45
|
| errors.HTTPValidationError
|
|
43
46
|
| CompassAPISDKError
|
|
44
47
|
| ResponseValidationError
|
|
@@ -64,7 +67,7 @@ async function $do(
|
|
|
64
67
|
): Promise<
|
|
65
68
|
[
|
|
66
69
|
Result<
|
|
67
|
-
components.
|
|
70
|
+
components.VaultsResponse,
|
|
68
71
|
| errors.HTTPValidationError
|
|
69
72
|
| CompassAPISDKError
|
|
70
73
|
| ResponseValidationError
|
|
@@ -92,6 +95,7 @@ async function $do(
|
|
|
92
95
|
const path = pathToFunc("/v2/earn/vaults")();
|
|
93
96
|
|
|
94
97
|
const query = encodeFormQuery({
|
|
98
|
+
"asset_symbol": payload.asset_symbol,
|
|
95
99
|
"chain": payload.chain,
|
|
96
100
|
"direction": payload.direction,
|
|
97
101
|
"limit": payload.limit,
|
|
@@ -154,7 +158,7 @@ async function $do(
|
|
|
154
158
|
};
|
|
155
159
|
|
|
156
160
|
const [result] = await M.match<
|
|
157
|
-
components.
|
|
161
|
+
components.VaultsResponse,
|
|
158
162
|
| errors.HTTPValidationError
|
|
159
163
|
| CompassAPISDKError
|
|
160
164
|
| ResponseValidationError
|
|
@@ -165,7 +169,7 @@ async function $do(
|
|
|
165
169
|
| UnexpectedClientError
|
|
166
170
|
| SDKValidationError
|
|
167
171
|
>(
|
|
168
|
-
M.json(200, components.
|
|
172
|
+
M.json(200, components.VaultsResponse$inboundSchema),
|
|
169
173
|
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
170
174
|
M.fail("4XX"),
|
|
171
175
|
M.fail("5XX"),
|
|
@@ -130,8 +130,6 @@ export * from "./morphorepayrequest.js";
|
|
|
130
130
|
export * from "./morphosupplycollateralparams.js";
|
|
131
131
|
export * from "./morphosupplycollateralrequest.js";
|
|
132
132
|
export * from "./morphovault.js";
|
|
133
|
-
export * from "./morphovaultinfo.js";
|
|
134
|
-
export * from "./morphovaultsresponse.js";
|
|
135
133
|
export * from "./morphowithdrawcollateralparams.js";
|
|
136
134
|
export * from "./morphowithdrawcollateralrequest.js";
|
|
137
135
|
export * from "./morphowithdrawparams.js";
|
|
@@ -235,7 +233,7 @@ export * from "./vaultdepositparams.js";
|
|
|
235
233
|
export * from "./vaultdepositrequest.js";
|
|
236
234
|
export * from "./vaultgetvaultresponse.js";
|
|
237
235
|
export * from "./vaultinfo.js";
|
|
238
|
-
export * from "./
|
|
236
|
+
export * from "./vaultsresponse.js";
|
|
239
237
|
export * from "./vaultvenue.js";
|
|
240
238
|
export * from "./vaultwithdrawparams.js";
|
|
241
239
|
export * from "./vaultwithdrawrequest.js";
|
|
@@ -9,145 +9,57 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Information about a single
|
|
12
|
+
* Information about a single ERC-4626 vault from the database.
|
|
13
13
|
*/
|
|
14
14
|
export type VaultInfo = {
|
|
15
|
-
/**
|
|
16
|
-
* Unique vault identifier.
|
|
17
|
-
*/
|
|
18
|
-
id?: string | null | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* The name of the vault.
|
|
21
|
-
*/
|
|
22
|
-
name: string;
|
|
23
15
|
/**
|
|
24
16
|
* The vault contract address.
|
|
25
17
|
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The DeFi protocol name.
|
|
29
|
-
*/
|
|
30
|
-
protocol: string;
|
|
18
|
+
vaultAddress: string;
|
|
31
19
|
/**
|
|
32
20
|
* Blockchain name (e.g., 'ethereum', 'base').
|
|
33
21
|
*/
|
|
34
|
-
chain
|
|
35
|
-
/**
|
|
36
|
-
* Blockchain chain ID.
|
|
37
|
-
*/
|
|
38
|
-
chainId?: number | null | undefined;
|
|
22
|
+
chain: string;
|
|
39
23
|
/**
|
|
40
|
-
* The
|
|
24
|
+
* The name of the vault.
|
|
41
25
|
*/
|
|
42
|
-
|
|
26
|
+
name?: string | null | undefined;
|
|
43
27
|
/**
|
|
44
28
|
* The vault share token symbol.
|
|
45
29
|
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Whether the vault is denominated in a stablecoin.
|
|
49
|
-
*/
|
|
50
|
-
stablecoinish: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Total lifetime return as a decimal (e.g., 0.093 = 9.3%).
|
|
53
|
-
*/
|
|
54
|
-
lifetimeReturn?: string | null | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Total lifetime return after fees as a decimal.
|
|
57
|
-
*/
|
|
58
|
-
lifetimeReturnNet?: string | null | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Compound Annual Growth Rate as a decimal.
|
|
61
|
-
*/
|
|
62
|
-
cagr?: string | null | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Compound Annual Growth Rate after fees as a decimal.
|
|
65
|
-
*/
|
|
66
|
-
cagrNet?: string | null | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* 3-month returns as a decimal.
|
|
69
|
-
*/
|
|
70
|
-
threeMonthsReturns?: string | null | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* 3-month returns after fees as a decimal.
|
|
73
|
-
*/
|
|
74
|
-
threeMonthsReturnsNet?: string | null | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* 3-month CAGR as a decimal.
|
|
77
|
-
*/
|
|
78
|
-
threeMonthsCagr?: string | null | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* 3-month CAGR after fees as a decimal.
|
|
81
|
-
*/
|
|
82
|
-
threeMonthsCagrNet?: string | null | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* 3-month Sharpe ratio.
|
|
85
|
-
*/
|
|
86
|
-
threeMonthsSharpe?: string | null | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* 3-month Sharpe ratio after fees.
|
|
89
|
-
*/
|
|
90
|
-
threeMonthsSharpeNet?: string | null | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* 3-month volatility.
|
|
93
|
-
*/
|
|
94
|
-
threeMonthsVolatility?: string | null | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* 1-month returns as a decimal.
|
|
97
|
-
*/
|
|
98
|
-
oneMonthReturns?: string | null | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* 1-month returns after fees as a decimal.
|
|
101
|
-
*/
|
|
102
|
-
oneMonthReturnsNet?: string | null | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* 1-month CAGR as a decimal.
|
|
105
|
-
*/
|
|
106
|
-
oneMonthCagr?: string | null | undefined;
|
|
107
|
-
/**
|
|
108
|
-
* 1-month CAGR after fees as a decimal.
|
|
109
|
-
*/
|
|
110
|
-
oneMonthCagrNet?: string | null | undefined;
|
|
111
|
-
/**
|
|
112
|
-
* Current Net Asset Value in denomination token.
|
|
113
|
-
*/
|
|
114
|
-
currentNav?: string | null | undefined;
|
|
115
|
-
/**
|
|
116
|
-
* Peak Net Asset Value in denomination token.
|
|
117
|
-
*/
|
|
118
|
-
peakNav?: string | null | undefined;
|
|
30
|
+
symbol?: string | null | undefined;
|
|
119
31
|
/**
|
|
120
|
-
*
|
|
32
|
+
* The vault owner address.
|
|
121
33
|
*/
|
|
122
|
-
|
|
34
|
+
owner: string;
|
|
123
35
|
/**
|
|
124
|
-
*
|
|
36
|
+
* The underlying asset contract address.
|
|
125
37
|
*/
|
|
126
|
-
|
|
38
|
+
asset: string;
|
|
127
39
|
/**
|
|
128
|
-
*
|
|
40
|
+
* The name of the underlying asset.
|
|
129
41
|
*/
|
|
130
|
-
|
|
42
|
+
assetName?: string | null | undefined;
|
|
131
43
|
/**
|
|
132
|
-
*
|
|
44
|
+
* The symbol of the underlying asset (e.g., 'USDC').
|
|
133
45
|
*/
|
|
134
|
-
|
|
46
|
+
assetSymbol?: string | null | undefined;
|
|
135
47
|
/**
|
|
136
|
-
*
|
|
48
|
+
* Total Value Locked in USD.
|
|
137
49
|
*/
|
|
138
|
-
|
|
50
|
+
tvlUsd?: string | null | undefined;
|
|
139
51
|
/**
|
|
140
|
-
*
|
|
52
|
+
* 7-day APY as a percentage (e.g., 5.25 = 5.25%).
|
|
141
53
|
*/
|
|
142
|
-
|
|
54
|
+
apy7d?: string | null | undefined;
|
|
143
55
|
/**
|
|
144
|
-
*
|
|
56
|
+
* 30-day APY as a percentage.
|
|
145
57
|
*/
|
|
146
|
-
|
|
58
|
+
apy30d?: string | null | undefined;
|
|
147
59
|
/**
|
|
148
|
-
*
|
|
60
|
+
* 90-day APY as a percentage.
|
|
149
61
|
*/
|
|
150
|
-
|
|
62
|
+
apy90d?: string | null | undefined;
|
|
151
63
|
};
|
|
152
64
|
|
|
153
65
|
/** @internal */
|
|
@@ -156,66 +68,27 @@ export const VaultInfo$inboundSchema: z.ZodType<
|
|
|
156
68
|
z.ZodTypeDef,
|
|
157
69
|
unknown
|
|
158
70
|
> = z.object({
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
cagr_net: z.nullable(z.string()).optional(),
|
|
172
|
-
three_months_returns: z.nullable(z.string()).optional(),
|
|
173
|
-
three_months_returns_net: z.nullable(z.string()).optional(),
|
|
174
|
-
three_months_cagr: z.nullable(z.string()).optional(),
|
|
175
|
-
three_months_cagr_net: z.nullable(z.string()).optional(),
|
|
176
|
-
three_months_sharpe: z.nullable(z.string()).optional(),
|
|
177
|
-
three_months_sharpe_net: z.nullable(z.string()).optional(),
|
|
178
|
-
three_months_volatility: z.nullable(z.string()).optional(),
|
|
179
|
-
one_month_returns: z.nullable(z.string()).optional(),
|
|
180
|
-
one_month_returns_net: z.nullable(z.string()).optional(),
|
|
181
|
-
one_month_cagr: z.nullable(z.string()).optional(),
|
|
182
|
-
one_month_cagr_net: z.nullable(z.string()).optional(),
|
|
183
|
-
current_nav: z.nullable(z.string()).optional(),
|
|
184
|
-
peak_nav: z.nullable(z.string()).optional(),
|
|
185
|
-
fee_label: z.nullable(z.string()).optional(),
|
|
186
|
-
management_fee: z.nullable(z.string()).optional(),
|
|
187
|
-
performance_fee: z.nullable(z.string()).optional(),
|
|
188
|
-
deposit_fee: z.nullable(z.string()).optional(),
|
|
189
|
-
withdraw_fee: z.nullable(z.string()).optional(),
|
|
190
|
-
years: z.nullable(z.string()).optional(),
|
|
191
|
-
event_count: z.nullable(z.number().int()).optional(),
|
|
192
|
-
features: z.nullable(z.array(z.string())).optional(),
|
|
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(),
|
|
193
83
|
}).transform((v) => {
|
|
194
84
|
return remap$(v, {
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
"three_months_cagr": "threeMonthsCagr",
|
|
203
|
-
"three_months_cagr_net": "threeMonthsCagrNet",
|
|
204
|
-
"three_months_sharpe": "threeMonthsSharpe",
|
|
205
|
-
"three_months_sharpe_net": "threeMonthsSharpeNet",
|
|
206
|
-
"three_months_volatility": "threeMonthsVolatility",
|
|
207
|
-
"one_month_returns": "oneMonthReturns",
|
|
208
|
-
"one_month_returns_net": "oneMonthReturnsNet",
|
|
209
|
-
"one_month_cagr": "oneMonthCagr",
|
|
210
|
-
"one_month_cagr_net": "oneMonthCagrNet",
|
|
211
|
-
"current_nav": "currentNav",
|
|
212
|
-
"peak_nav": "peakNav",
|
|
213
|
-
"fee_label": "feeLabel",
|
|
214
|
-
"management_fee": "managementFee",
|
|
215
|
-
"performance_fee": "performanceFee",
|
|
216
|
-
"deposit_fee": "depositFee",
|
|
217
|
-
"withdraw_fee": "withdrawFee",
|
|
218
|
-
"event_count": "eventCount",
|
|
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",
|
|
219
92
|
});
|
|
220
93
|
});
|
|
221
94
|
|
|
@@ -9,9 +9,9 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
9
9
|
import { VaultInfo, VaultInfo$inboundSchema } from "./vaultinfo.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Response model for a paginated list of
|
|
12
|
+
* Response model for a paginated list of ERC-4626 vaults.
|
|
13
13
|
*/
|
|
14
|
-
export type
|
|
14
|
+
export type VaultsResponse = {
|
|
15
15
|
total: number;
|
|
16
16
|
offset: number;
|
|
17
17
|
limit: number;
|
|
@@ -22,8 +22,8 @@ export type VaultsListResponse = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
/** @internal */
|
|
25
|
-
export const
|
|
26
|
-
|
|
25
|
+
export const VaultsResponse$inboundSchema: z.ZodType<
|
|
26
|
+
VaultsResponse,
|
|
27
27
|
z.ZodTypeDef,
|
|
28
28
|
unknown
|
|
29
29
|
> = z.object({
|
|
@@ -33,12 +33,12 @@ export const VaultsListResponse$inboundSchema: z.ZodType<
|
|
|
33
33
|
vaults: z.array(VaultInfo$inboundSchema),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
export function
|
|
36
|
+
export function vaultsResponseFromJSON(
|
|
37
37
|
jsonString: string,
|
|
38
|
-
): SafeParseResult<
|
|
38
|
+
): SafeParseResult<VaultsResponse, SDKValidationError> {
|
|
39
39
|
return safeParse(
|
|
40
40
|
jsonString,
|
|
41
|
-
(x) =>
|
|
42
|
-
`Failed to parse '
|
|
41
|
+
(x) => VaultsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
42
|
+
`Failed to parse 'VaultsResponse' from JSON`,
|
|
43
43
|
);
|
|
44
44
|
}
|
|
@@ -42,6 +42,5 @@ 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";
|
|
46
45
|
export * from "./v2earnpositions.js";
|
|
47
46
|
export * from "./v2earnvaults.js";
|
|
@@ -9,14 +9,14 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* The direction to order the results by.
|
|
11
11
|
*/
|
|
12
|
-
export const
|
|
12
|
+
export const Direction = {
|
|
13
13
|
Asc: "asc",
|
|
14
14
|
Desc: "desc",
|
|
15
15
|
} as const;
|
|
16
16
|
/**
|
|
17
17
|
* The direction to order the results by.
|
|
18
18
|
*/
|
|
19
|
-
export type
|
|
19
|
+
export type Direction = ClosedEnum<typeof Direction>;
|
|
20
20
|
|
|
21
21
|
export const V2EarnVaultsChain = {
|
|
22
22
|
Arbitrum: "arbitrum",
|
|
@@ -33,7 +33,7 @@ export type V2EarnVaultsRequest = {
|
|
|
33
33
|
/**
|
|
34
34
|
* The direction to order the results by.
|
|
35
35
|
*/
|
|
36
|
-
direction?:
|
|
36
|
+
direction?: Direction | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* The offset of the first item to return.
|
|
39
39
|
*/
|
|
@@ -43,12 +43,15 @@ export type V2EarnVaultsRequest = {
|
|
|
43
43
|
*/
|
|
44
44
|
limit?: number | undefined;
|
|
45
45
|
chain: V2EarnVaultsChain;
|
|
46
|
+
/**
|
|
47
|
+
* Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH').
|
|
48
|
+
*/
|
|
49
|
+
assetSymbol?: string | null | undefined;
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
/** @internal */
|
|
49
|
-
export const
|
|
50
|
-
|
|
51
|
-
> = z.nativeEnum(V2EarnVaultsDirection);
|
|
53
|
+
export const Direction$outboundSchema: z.ZodNativeEnum<typeof Direction> = z
|
|
54
|
+
.nativeEnum(Direction);
|
|
52
55
|
|
|
53
56
|
/** @internal */
|
|
54
57
|
export const V2EarnVaultsChain$outboundSchema: z.ZodNativeEnum<
|
|
@@ -62,6 +65,7 @@ export type V2EarnVaultsRequest$Outbound = {
|
|
|
62
65
|
offset?: number | undefined;
|
|
63
66
|
limit?: number | undefined;
|
|
64
67
|
chain: string;
|
|
68
|
+
asset_symbol?: string | null | undefined;
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
/** @internal */
|
|
@@ -71,13 +75,15 @@ export const V2EarnVaultsRequest$outboundSchema: z.ZodType<
|
|
|
71
75
|
V2EarnVaultsRequest
|
|
72
76
|
> = z.object({
|
|
73
77
|
orderBy: z.string(),
|
|
74
|
-
direction:
|
|
78
|
+
direction: Direction$outboundSchema.optional(),
|
|
75
79
|
offset: z.number().int().optional(),
|
|
76
80
|
limit: z.number().int().optional(),
|
|
77
81
|
chain: V2EarnVaultsChain$outboundSchema,
|
|
82
|
+
assetSymbol: z.nullable(z.string()).optional(),
|
|
78
83
|
}).transform((v) => {
|
|
79
84
|
return remap$(v, {
|
|
80
85
|
orderBy: "order_by",
|
|
86
|
+
assetSymbol: "asset_symbol",
|
|
81
87
|
});
|
|
82
88
|
});
|
|
83
89
|
|
package/src/sdk/earn.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { earnEarnAaveTokenRates } from "../funcs/earnEarnAaveTokenRates.js";
|
|
|
6
6
|
import { earnEarnBundle } from "../funcs/earnEarnBundle.js";
|
|
7
7
|
import { earnEarnCreateAccount } from "../funcs/earnEarnCreateAccount.js";
|
|
8
8
|
import { earnEarnManage } from "../funcs/earnEarnManage.js";
|
|
9
|
-
import { earnEarnMorphoVaults } from "../funcs/earnEarnMorphoVaults.js";
|
|
10
9
|
import { earnEarnPositions } from "../funcs/earnEarnPositions.js";
|
|
11
10
|
import { earnEarnSwap } from "../funcs/earnEarnSwap.js";
|
|
12
11
|
import { earnEarnTransfer } from "../funcs/earnEarnTransfer.js";
|
|
@@ -35,15 +34,18 @@ export class Earn extends ClientSDK {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
|
-
* List
|
|
37
|
+
* List Vaults
|
|
39
38
|
*
|
|
40
39
|
* @remarks
|
|
41
|
-
*
|
|
40
|
+
* Fetch ERC-4626 vaults from the database with TVL and APY stats.
|
|
41
|
+
*
|
|
42
|
+
* Returns a paginated list of ERC-4626 vaults indexed from various chains, joined with
|
|
43
|
+
* their current statistics (TVL in USD, 7d/30d/90d APY).
|
|
42
44
|
*/
|
|
43
45
|
async earnVaults(
|
|
44
46
|
request: operations.V2EarnVaultsRequest,
|
|
45
47
|
options?: RequestOptions,
|
|
46
|
-
): Promise<components.
|
|
48
|
+
): Promise<components.VaultsResponse> {
|
|
47
49
|
return unwrapAsync(earnEarnVaults(
|
|
48
50
|
this,
|
|
49
51
|
request,
|
|
@@ -68,26 +70,6 @@ export class Earn extends ClientSDK {
|
|
|
68
70
|
));
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
/**
|
|
72
|
-
* List Morpho vaults
|
|
73
|
-
*
|
|
74
|
-
* @remarks
|
|
75
|
-
* Fetch Morpho vaults from the database with TVL and APY stats.
|
|
76
|
-
*
|
|
77
|
-
* Returns a paginated list of Morpho vaults indexed from various chains, joined with
|
|
78
|
-
* their current statistics (TVL in USD, 7d/30d/90d APY).
|
|
79
|
-
*/
|
|
80
|
-
async earnMorphoVaults(
|
|
81
|
-
request: operations.V2EarnMorphoVaultsRequest,
|
|
82
|
-
options?: RequestOptions,
|
|
83
|
-
): Promise<components.MorphoVaultsResponse> {
|
|
84
|
-
return unwrapAsync(earnEarnMorphoVaults(
|
|
85
|
-
this,
|
|
86
|
-
request,
|
|
87
|
-
options,
|
|
88
|
-
));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
73
|
/**
|
|
92
74
|
* Create earn account
|
|
93
75
|
*
|