@compass-labs/api-sdk 0.5.48 → 0.5.50
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/FUNCTIONS.md +3 -3
- package/README.md +10 -6
- package/bin/mcp-server.js +916 -552
- package/bin/mcp-server.js.map +18 -8
- package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.d.ts +25 -0
- package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.d.ts.map +1 -0
- package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.js +129 -0
- package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.js.map +1 -0
- package/dist/commonjs/funcs/universalSupportedChains.d.ts +19 -0
- package/dist/commonjs/funcs/universalSupportedChains.d.ts.map +1 -0
- package/dist/commonjs/funcs/universalSupportedChains.js +122 -0
- package/dist/commonjs/funcs/universalSupportedChains.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.js +70 -0
- package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/universalSupportedChains.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/universalSupportedChains.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/universalSupportedChains.js +64 -0
- package/dist/commonjs/mcp-server/tools/universalSupportedChains.js.map +1 -0
- package/dist/commonjs/models/components/aavesupportedtokenmetadata.d.ts +47 -0
- package/dist/commonjs/models/components/aavesupportedtokenmetadata.d.ts.map +1 -0
- package/dist/commonjs/models/components/aavesupportedtokenmetadata.js +86 -0
- package/dist/commonjs/models/components/aavesupportedtokenmetadata.js.map +1 -0
- package/dist/commonjs/models/components/aavesupportedtokensresponse.d.ts +33 -0
- package/dist/commonjs/models/components/aavesupportedtokensresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/aavesupportedtokensresponse.js +70 -0
- package/dist/commonjs/models/components/aavesupportedtokensresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +4 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/protocol.d.ts +40 -0
- package/dist/commonjs/models/components/protocol.d.ts.map +1 -0
- package/dist/commonjs/models/components/protocol.js +65 -0
- package/dist/commonjs/models/components/protocol.js.map +1 -0
- package/dist/commonjs/models/components/supportedchaininfo.d.ts +33 -0
- package/dist/commonjs/models/components/supportedchaininfo.d.ts.map +1 -0
- package/dist/commonjs/models/components/supportedchaininfo.js +70 -0
- package/dist/commonjs/models/components/supportedchaininfo.js.map +1 -0
- package/dist/commonjs/models/operations/aaveaavesupportedtokens.d.ts +72 -0
- package/dist/commonjs/models/operations/aaveaavesupportedtokens.d.ts.map +1 -0
- package/dist/commonjs/models/operations/aaveaavesupportedtokens.js +94 -0
- package/dist/commonjs/models/operations/aaveaavesupportedtokens.js.map +1 -0
- package/dist/commonjs/models/operations/genericsupportedchains.d.ts +33 -0
- package/dist/commonjs/models/operations/genericsupportedchains.d.ts.map +1 -0
- package/dist/commonjs/models/operations/genericsupportedchains.js +70 -0
- package/dist/commonjs/models/operations/genericsupportedchains.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/sdk/aavev3.d.ts +13 -0
- package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
- package/dist/commonjs/sdk/aavev3.js +16 -0
- package/dist/commonjs/sdk/aavev3.js.map +1 -1
- package/dist/commonjs/sdk/universal.d.ts +7 -0
- package/dist/commonjs/sdk/universal.d.ts.map +1 -1
- package/dist/commonjs/sdk/universal.js +10 -0
- package/dist/commonjs/sdk/universal.js.map +1 -1
- package/dist/esm/funcs/aaveV3AaveSupportedTokens.d.ts +25 -0
- package/dist/esm/funcs/aaveV3AaveSupportedTokens.d.ts.map +1 -0
- package/dist/esm/funcs/aaveV3AaveSupportedTokens.js +93 -0
- package/dist/esm/funcs/aaveV3AaveSupportedTokens.js.map +1 -0
- package/dist/esm/funcs/universalSupportedChains.d.ts +19 -0
- package/dist/esm/funcs/universalSupportedChains.d.ts.map +1 -0
- package/dist/esm/funcs/universalSupportedChains.js +86 -0
- package/dist/esm/funcs/universalSupportedChains.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts +8 -0
- package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.js +34 -0
- package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.js.map +1 -0
- package/dist/esm/mcp-server/tools/universalSupportedChains.d.ts +8 -0
- package/dist/esm/mcp-server/tools/universalSupportedChains.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/universalSupportedChains.js +28 -0
- package/dist/esm/mcp-server/tools/universalSupportedChains.js.map +1 -0
- package/dist/esm/models/components/aavesupportedtokenmetadata.d.ts +47 -0
- package/dist/esm/models/components/aavesupportedtokenmetadata.d.ts.map +1 -0
- package/dist/esm/models/components/aavesupportedtokenmetadata.js +48 -0
- package/dist/esm/models/components/aavesupportedtokenmetadata.js.map +1 -0
- package/dist/esm/models/components/aavesupportedtokensresponse.d.ts +33 -0
- package/dist/esm/models/components/aavesupportedtokensresponse.d.ts.map +1 -0
- package/dist/esm/models/components/aavesupportedtokensresponse.js +32 -0
- package/dist/esm/models/components/aavesupportedtokensresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +4 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/protocol.d.ts +40 -0
- package/dist/esm/models/components/protocol.d.ts.map +1 -0
- package/dist/esm/models/components/protocol.js +29 -0
- package/dist/esm/models/components/protocol.js.map +1 -0
- package/dist/esm/models/components/supportedchaininfo.d.ts +33 -0
- package/dist/esm/models/components/supportedchaininfo.d.ts.map +1 -0
- package/dist/esm/models/components/supportedchaininfo.js +32 -0
- package/dist/esm/models/components/supportedchaininfo.js.map +1 -0
- package/dist/esm/models/operations/aaveaavesupportedtokens.d.ts +72 -0
- package/dist/esm/models/operations/aaveaavesupportedtokens.d.ts.map +1 -0
- package/dist/esm/models/operations/aaveaavesupportedtokens.js +56 -0
- package/dist/esm/models/operations/aaveaavesupportedtokens.js.map +1 -0
- package/dist/esm/models/operations/genericsupportedchains.d.ts +33 -0
- package/dist/esm/models/operations/genericsupportedchains.d.ts.map +1 -0
- package/dist/esm/models/operations/genericsupportedchains.js +32 -0
- package/dist/esm/models/operations/genericsupportedchains.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/sdk/aavev3.d.ts +13 -0
- package/dist/esm/sdk/aavev3.d.ts.map +1 -1
- package/dist/esm/sdk/aavev3.js +16 -0
- package/dist/esm/sdk/aavev3.js.map +1 -1
- package/dist/esm/sdk/universal.d.ts +7 -0
- package/dist/esm/sdk/universal.d.ts.map +1 -1
- package/dist/esm/sdk/universal.js +10 -0
- package/dist/esm/sdk/universal.js.map +1 -1
- package/docs/sdks/aavev3/README.md +76 -0
- package/docs/sdks/universal/README.md +70 -0
- package/examples/{aaveV3Rate.example.ts → aaveV3AaveSupportedTokens.example.ts} +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/aaveV3AaveSupportedTokens.ts +182 -0
- package/src/funcs/universalSupportedChains.ts +175 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/aaveV3AaveSupportedTokens.ts +43 -0
- package/src/mcp-server/tools/universalSupportedChains.ts +37 -0
- package/src/models/components/aavesupportedtokenmetadata.ts +101 -0
- package/src/models/components/aavesupportedtokensresponse.ts +77 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/protocol.ts +35 -0
- package/src/models/components/supportedchaininfo.ts +70 -0
- package/src/models/operations/aaveaavesupportedtokens.ts +117 -0
- package/src/models/operations/genericsupportedchains.ts +72 -0
- package/src/models/operations/index.ts +2 -0
- package/src/sdk/aavev3.ts +24 -0
- package/src/sdk/universal.ts +18 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
+
* [aaveSupportedTokens](#aavesupportedtokens) - Aave Supported Tokens
|
|
8
9
|
* [rate](#rate) - Interest Rates
|
|
9
10
|
* [avgRate](#avgrate) - Interest Rates: Time Average
|
|
10
11
|
* [stdRate](#stdrate) - Interest Rates: Standard Deviation
|
|
@@ -19,6 +20,81 @@
|
|
|
19
20
|
* [repay](#repay) - Repay Loans
|
|
20
21
|
* [withdraw](#withdraw) - Unstake
|
|
21
22
|
|
|
23
|
+
## aaveSupportedTokens
|
|
24
|
+
|
|
25
|
+
Returns the list of supported tokens on Aave for the specified network, along
|
|
26
|
+
with key metadata.
|
|
27
|
+
|
|
28
|
+
For each token, the response includes:
|
|
29
|
+
- The symbol and contract address.
|
|
30
|
+
- Whether the token is currently enabled for supplying (depositing).
|
|
31
|
+
- Whether it is enabled for borrowing.
|
|
32
|
+
|
|
33
|
+
### Example Usage
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
37
|
+
|
|
38
|
+
const compassApiSDK = new CompassApiSDK({
|
|
39
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
async function run() {
|
|
43
|
+
const result = await compassApiSDK.aaveV3.aaveSupportedTokens({});
|
|
44
|
+
|
|
45
|
+
console.log(result);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
run();
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Standalone function
|
|
52
|
+
|
|
53
|
+
The standalone function version of this method:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
57
|
+
import { aaveV3AaveSupportedTokens } from "@compass-labs/api-sdk/funcs/aaveV3AaveSupportedTokens.js";
|
|
58
|
+
|
|
59
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
60
|
+
// You can create one instance of it to use across an application.
|
|
61
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
62
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
async function run() {
|
|
66
|
+
const res = await aaveV3AaveSupportedTokens(compassApiSDK, {});
|
|
67
|
+
if (res.ok) {
|
|
68
|
+
const { value: result } = res;
|
|
69
|
+
console.log(result);
|
|
70
|
+
} else {
|
|
71
|
+
console.log("aaveV3AaveSupportedTokens failed:", res.error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
run();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Parameters
|
|
79
|
+
|
|
80
|
+
| Parameter | Type | Required | Description |
|
|
81
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
82
|
+
| `request` | [operations.AaveAaveSupportedTokensRequest](../../models/operations/aaveaavesupportedtokensrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
83
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
84
|
+
| `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. |
|
|
85
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
86
|
+
|
|
87
|
+
### Response
|
|
88
|
+
|
|
89
|
+
**Promise\<[components.AaveSupportedTokensResponse](../../models/components/aavesupportedtokensresponse.md)\>**
|
|
90
|
+
|
|
91
|
+
### Errors
|
|
92
|
+
|
|
93
|
+
| Error Type | Status Code | Content Type |
|
|
94
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
95
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
96
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
97
|
+
|
|
22
98
|
## rate
|
|
23
99
|
|
|
24
100
|
Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* [portfolio](#portfolio) - List User Portfolio
|
|
9
9
|
* [visualizePortfolio](#visualizeportfolio) - Visualize User Portfolio
|
|
10
10
|
* [supportedTokens](#supportedtokens) - List Supported Tokens
|
|
11
|
+
* [supportedChains](#supportedchains) - List Supported Chains
|
|
11
12
|
* [allowance](#allowance) - Get Allowance
|
|
12
13
|
* [ens](#ens) - Resolve ENS
|
|
13
14
|
* [wrapEth](#wrapeth) - Wrap ETH
|
|
@@ -228,6 +229,75 @@ run();
|
|
|
228
229
|
| errors.HTTPValidationError | 422 | application/json |
|
|
229
230
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
230
231
|
|
|
232
|
+
## supportedChains
|
|
233
|
+
|
|
234
|
+
Get the list of supported chains by the Compass API.
|
|
235
|
+
|
|
236
|
+
### Example Usage
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
240
|
+
|
|
241
|
+
const compassApiSDK = new CompassApiSDK({
|
|
242
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
async function run() {
|
|
246
|
+
const result = await compassApiSDK.universal.supportedChains({});
|
|
247
|
+
|
|
248
|
+
console.log(result);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
run();
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Standalone function
|
|
255
|
+
|
|
256
|
+
The standalone function version of this method:
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
260
|
+
import { universalSupportedChains } from "@compass-labs/api-sdk/funcs/universalSupportedChains.js";
|
|
261
|
+
|
|
262
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
263
|
+
// You can create one instance of it to use across an application.
|
|
264
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
265
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
async function run() {
|
|
269
|
+
const res = await universalSupportedChains(compassApiSDK, {});
|
|
270
|
+
if (res.ok) {
|
|
271
|
+
const { value: result } = res;
|
|
272
|
+
console.log(result);
|
|
273
|
+
} else {
|
|
274
|
+
console.log("universalSupportedChains failed:", res.error);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
run();
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Parameters
|
|
282
|
+
|
|
283
|
+
| Parameter | Type | Required | Description |
|
|
284
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
285
|
+
| `request` | [operations.GenericSupportedChainsRequest](../../models/operations/genericsupportedchainsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
286
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
287
|
+
| `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. |
|
|
288
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
289
|
+
|
|
290
|
+
### Response
|
|
291
|
+
|
|
292
|
+
**Promise\<[components.SupportedChainInfo](../../models/components/supportedchaininfo.md)\>**
|
|
293
|
+
|
|
294
|
+
### Errors
|
|
295
|
+
|
|
296
|
+
| Error Type | Status Code | Content Type |
|
|
297
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
298
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
299
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
300
|
+
|
|
231
301
|
## allowance
|
|
232
302
|
|
|
233
303
|
In decentralized finance (DeFi) protocols such as Uniswap or AAVE, users must set
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Example usage of the @compass-labs/api-sdk SDK
|
|
7
7
|
*
|
|
8
8
|
* To run this example from the examples directory:
|
|
9
|
-
* npm run build && npx tsx
|
|
9
|
+
* npm run build && npx tsx aaveV3AaveSupportedTokens.ts
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
@@ -16,7 +16,7 @@ const compassApiSDK = new CompassApiSDK({
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
async function main() {
|
|
19
|
-
const result = await compassApiSDK.
|
|
19
|
+
const result = await compassApiSDK.aaveSupportedTokens({});
|
|
20
20
|
|
|
21
21
|
console.log(result);
|
|
22
22
|
}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import { 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
|
+
* Aave Supported Tokens
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns the list of supported tokens on Aave for the specified network, along
|
|
34
|
+
* with key metadata.
|
|
35
|
+
*
|
|
36
|
+
* For each token, the response includes:
|
|
37
|
+
* - The symbol and contract address.
|
|
38
|
+
* - Whether the token is currently enabled for supplying (depositing).
|
|
39
|
+
* - Whether it is enabled for borrowing.
|
|
40
|
+
*/
|
|
41
|
+
export function aaveV3AaveSupportedTokens(
|
|
42
|
+
client: CompassApiSDKCore,
|
|
43
|
+
request: operations.AaveAaveSupportedTokensRequest,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<
|
|
46
|
+
Result<
|
|
47
|
+
components.AaveSupportedTokensResponse,
|
|
48
|
+
| errors.HTTPValidationError
|
|
49
|
+
| CompassAPISDKError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: CompassApiSDKCore,
|
|
68
|
+
request: operations.AaveAaveSupportedTokensRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
components.AaveSupportedTokensResponse,
|
|
74
|
+
| errors.HTTPValidationError
|
|
75
|
+
| CompassAPISDKError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) =>
|
|
90
|
+
operations.AaveAaveSupportedTokensRequest$outboundSchema.parse(value),
|
|
91
|
+
"Input validation failed",
|
|
92
|
+
);
|
|
93
|
+
if (!parsed.ok) {
|
|
94
|
+
return [parsed, { status: "invalid" }];
|
|
95
|
+
}
|
|
96
|
+
const payload = parsed.value;
|
|
97
|
+
const body = null;
|
|
98
|
+
|
|
99
|
+
const path = pathToFunc("/v0/aave/aave_supported_tokens/get")();
|
|
100
|
+
|
|
101
|
+
const query = encodeFormQuery({
|
|
102
|
+
"block": payload.block,
|
|
103
|
+
"chain": payload.chain,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const headers = new Headers(compactMap({
|
|
107
|
+
Accept: "application/json",
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
111
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
112
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
113
|
+
|
|
114
|
+
const context = {
|
|
115
|
+
options: client._options,
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "aave_aave_supported_tokens",
|
|
118
|
+
oAuth2Scopes: [],
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: client._options.apiKeyAuth,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "GET",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
query: query,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
components.AaveSupportedTokensResponse,
|
|
162
|
+
| errors.HTTPValidationError
|
|
163
|
+
| CompassAPISDKError
|
|
164
|
+
| ResponseValidationError
|
|
165
|
+
| ConnectionError
|
|
166
|
+
| RequestAbortedError
|
|
167
|
+
| RequestTimeoutError
|
|
168
|
+
| InvalidRequestError
|
|
169
|
+
| UnexpectedClientError
|
|
170
|
+
| SDKValidationError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, components.AaveSupportedTokensResponse$inboundSchema),
|
|
173
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
174
|
+
M.fail("4XX"),
|
|
175
|
+
M.fail("5XX"),
|
|
176
|
+
)(response, req, { extraFields: responseFields });
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
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 Supported Chains
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Get the list of supported chains by the Compass API.
|
|
34
|
+
*/
|
|
35
|
+
export function universalSupportedChains(
|
|
36
|
+
client: CompassApiSDKCore,
|
|
37
|
+
request: operations.GenericSupportedChainsRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.SupportedChainInfo,
|
|
42
|
+
| errors.HTTPValidationError
|
|
43
|
+
| CompassAPISDKError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: CompassApiSDKCore,
|
|
62
|
+
request: operations.GenericSupportedChainsRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
components.SupportedChainInfo,
|
|
68
|
+
| errors.HTTPValidationError
|
|
69
|
+
| CompassAPISDKError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
operations.GenericSupportedChainsRequest$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = null;
|
|
92
|
+
|
|
93
|
+
const path = pathToFunc("/v0/generic/supported_chains/get")();
|
|
94
|
+
|
|
95
|
+
const query = encodeFormQuery({
|
|
96
|
+
"protocol": payload.protocol,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const headers = new Headers(compactMap({
|
|
100
|
+
Accept: "application/json",
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
104
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
105
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
|
+
|
|
107
|
+
const context = {
|
|
108
|
+
options: client._options,
|
|
109
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
110
|
+
operationID: "generic_supported_chains",
|
|
111
|
+
oAuth2Scopes: [],
|
|
112
|
+
|
|
113
|
+
resolvedSecurity: requestSecurity,
|
|
114
|
+
|
|
115
|
+
securitySource: client._options.apiKeyAuth,
|
|
116
|
+
retryConfig: options?.retries
|
|
117
|
+
|| client._options.retryConfig
|
|
118
|
+
|| { strategy: "none" },
|
|
119
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const requestRes = client._createRequest(context, {
|
|
123
|
+
security: requestSecurity,
|
|
124
|
+
method: "GET",
|
|
125
|
+
baseURL: options?.serverURL,
|
|
126
|
+
path: path,
|
|
127
|
+
headers: headers,
|
|
128
|
+
query: query,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
141
|
+
retryConfig: context.retryConfig,
|
|
142
|
+
retryCodes: context.retryCodes,
|
|
143
|
+
});
|
|
144
|
+
if (!doResult.ok) {
|
|
145
|
+
return [doResult, { status: "request-error", request: req }];
|
|
146
|
+
}
|
|
147
|
+
const response = doResult.value;
|
|
148
|
+
|
|
149
|
+
const responseFields = {
|
|
150
|
+
HttpMeta: { Response: response, Request: req },
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const [result] = await M.match<
|
|
154
|
+
components.SupportedChainInfo,
|
|
155
|
+
| errors.HTTPValidationError
|
|
156
|
+
| CompassAPISDKError
|
|
157
|
+
| ResponseValidationError
|
|
158
|
+
| ConnectionError
|
|
159
|
+
| RequestAbortedError
|
|
160
|
+
| RequestTimeoutError
|
|
161
|
+
| InvalidRequestError
|
|
162
|
+
| UnexpectedClientError
|
|
163
|
+
| SDKValidationError
|
|
164
|
+
>(
|
|
165
|
+
M.json(200, components.SupportedChainInfo$inboundSchema),
|
|
166
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
167
|
+
M.fail("4XX"),
|
|
168
|
+
M.fail("5XX"),
|
|
169
|
+
)(response, req, { extraFields: responseFields });
|
|
170
|
+
if (!result.ok) {
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
175
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.1",
|
|
64
|
-
sdkVersion: "0.5.
|
|
64
|
+
sdkVersion: "0.5.50",
|
|
65
65
|
genVersion: "2.657.1",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.5.
|
|
67
|
+
"speakeasy-sdk/typescript 0.5.50 2.657.1 0.0.1 @compass-labs/api-sdk",
|
|
68
68
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "./resources.js";
|
|
14
14
|
import { MCPScope } from "./scopes.js";
|
|
15
15
|
import { createRegisterTool } from "./tools.js";
|
|
16
|
+
import { tool$aaveV3AaveSupportedTokens } from "./tools/aaveV3AaveSupportedTokens.js";
|
|
16
17
|
import { tool$aaveV3AvgRate } from "./tools/aaveV3AvgRate.js";
|
|
17
18
|
import { tool$aaveV3Borrow } from "./tools/aaveV3Borrow.js";
|
|
18
19
|
import { tool$aaveV3HistoricalTransactions } from "./tools/aaveV3HistoricalTransactions.js";
|
|
@@ -87,6 +88,7 @@ import { tool$universalAllowance } from "./tools/universalAllowance.js";
|
|
|
87
88
|
import { tool$universalAllowanceSet } from "./tools/universalAllowanceSet.js";
|
|
88
89
|
import { tool$universalEns } from "./tools/universalEns.js";
|
|
89
90
|
import { tool$universalPortfolio } from "./tools/universalPortfolio.js";
|
|
91
|
+
import { tool$universalSupportedChains } from "./tools/universalSupportedChains.js";
|
|
90
92
|
import { tool$universalSupportedTokens } from "./tools/universalSupportedTokens.js";
|
|
91
93
|
import { tool$universalUnwrapWeth } from "./tools/universalUnwrapWeth.js";
|
|
92
94
|
import { tool$universalVisualizePortfolio } from "./tools/universalVisualizePortfolio.js";
|
|
@@ -102,7 +104,7 @@ export function createMCPServer(deps: {
|
|
|
102
104
|
}) {
|
|
103
105
|
const server = new McpServer({
|
|
104
106
|
name: "CompassApiSDK",
|
|
105
|
-
version: "0.5.
|
|
107
|
+
version: "0.5.50",
|
|
106
108
|
});
|
|
107
109
|
|
|
108
110
|
const client = new CompassApiSDKCore({
|
|
@@ -132,6 +134,7 @@ export function createMCPServer(deps: {
|
|
|
132
134
|
const register = { tool, resource, resourceTemplate, prompt };
|
|
133
135
|
void register; // suppress unused warnings
|
|
134
136
|
|
|
137
|
+
tool(tool$aaveV3AaveSupportedTokens);
|
|
135
138
|
tool(tool$aaveV3Rate);
|
|
136
139
|
tool(tool$aaveV3AvgRate);
|
|
137
140
|
tool(tool$aaveV3StdRate);
|
|
@@ -186,6 +189,7 @@ export function createMCPServer(deps: {
|
|
|
186
189
|
tool(tool$universalPortfolio);
|
|
187
190
|
tool(tool$universalVisualizePortfolio);
|
|
188
191
|
tool(tool$universalSupportedTokens);
|
|
192
|
+
tool(tool$universalSupportedChains);
|
|
189
193
|
tool(tool$universalAllowance);
|
|
190
194
|
tool(tool$universalEns);
|
|
191
195
|
tool(tool$universalWrapEth);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { aaveV3AaveSupportedTokens } from "../../funcs/aaveV3AaveSupportedTokens.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.AaveAaveSupportedTokensRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$aaveV3AaveSupportedTokens: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "aave-v3-aave-supported-tokens",
|
|
15
|
+
description: `Aave Supported Tokens
|
|
16
|
+
|
|
17
|
+
Returns the list of supported tokens on Aave for the specified network, along
|
|
18
|
+
with key metadata.
|
|
19
|
+
|
|
20
|
+
For each token, the response includes:
|
|
21
|
+
- The symbol and contract address.
|
|
22
|
+
- Whether the token is currently enabled for supplying (depositing).
|
|
23
|
+
- Whether it is enabled for borrowing.`,
|
|
24
|
+
args,
|
|
25
|
+
tool: async (client, args, ctx) => {
|
|
26
|
+
const [result, apiCall] = await aaveV3AaveSupportedTokens(
|
|
27
|
+
client,
|
|
28
|
+
args.request,
|
|
29
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
30
|
+
).$inspect();
|
|
31
|
+
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: result.error.message }],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const value = result.value;
|
|
40
|
+
|
|
41
|
+
return formatResult(value, apiCall);
|
|
42
|
+
},
|
|
43
|
+
};
|