@compass-labs/api-sdk 0.5.48 → 0.5.49
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 +8 -6
- package/bin/mcp-server.js +749 -551
- package/bin/mcp-server.js.map +13 -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/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 +3 -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/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 +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- 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/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -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/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/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 +3 -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/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 +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- 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/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -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/docs/sdks/aavev3/README.md +76 -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/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/aaveV3AaveSupportedTokens.ts +43 -0
- package/src/models/components/aavesupportedtokenmetadata.ts +101 -0
- package/src/models/components/aavesupportedtokensresponse.ts +77 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/operations/aaveaavesupportedtokens.ts +117 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/aavev3.ts +24 -0
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
|
+
}
|
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.49",
|
|
65
65
|
genVersion: "2.657.1",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.5.
|
|
67
|
+
"speakeasy-sdk/typescript 0.5.49 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";
|
|
@@ -102,7 +103,7 @@ export function createMCPServer(deps: {
|
|
|
102
103
|
}) {
|
|
103
104
|
const server = new McpServer({
|
|
104
105
|
name: "CompassApiSDK",
|
|
105
|
-
version: "0.5.
|
|
106
|
+
version: "0.5.49",
|
|
106
107
|
});
|
|
107
108
|
|
|
108
109
|
const client = new CompassApiSDKCore({
|
|
@@ -132,6 +133,7 @@ export function createMCPServer(deps: {
|
|
|
132
133
|
const register = { tool, resource, resourceTemplate, prompt };
|
|
133
134
|
void register; // suppress unused warnings
|
|
134
135
|
|
|
136
|
+
tool(tool$aaveV3AaveSupportedTokens);
|
|
135
137
|
tool(tool$aaveV3Rate);
|
|
136
138
|
tool(tool$aaveV3AvgRate);
|
|
137
139
|
tool(tool$aaveV3StdRate);
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
export type AaveSupportedTokenMetadata = {
|
|
12
|
+
/**
|
|
13
|
+
* Token symbol (e.g., 'WETH', 'DAI').
|
|
14
|
+
*/
|
|
15
|
+
symbol: string;
|
|
16
|
+
/**
|
|
17
|
+
* Token contract address.
|
|
18
|
+
*/
|
|
19
|
+
address: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the token can be used as collateral.
|
|
22
|
+
*/
|
|
23
|
+
supplyingEnabled: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the token can be borrowed.
|
|
26
|
+
*/
|
|
27
|
+
borrowingEnabled: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const AaveSupportedTokenMetadata$inboundSchema: z.ZodType<
|
|
32
|
+
AaveSupportedTokenMetadata,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.object({
|
|
36
|
+
symbol: z.string(),
|
|
37
|
+
address: z.string(),
|
|
38
|
+
supplying_enabled: z.boolean(),
|
|
39
|
+
borrowing_enabled: z.boolean(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"supplying_enabled": "supplyingEnabled",
|
|
43
|
+
"borrowing_enabled": "borrowingEnabled",
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export type AaveSupportedTokenMetadata$Outbound = {
|
|
49
|
+
symbol: string;
|
|
50
|
+
address: string;
|
|
51
|
+
supplying_enabled: boolean;
|
|
52
|
+
borrowing_enabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export const AaveSupportedTokenMetadata$outboundSchema: z.ZodType<
|
|
57
|
+
AaveSupportedTokenMetadata$Outbound,
|
|
58
|
+
z.ZodTypeDef,
|
|
59
|
+
AaveSupportedTokenMetadata
|
|
60
|
+
> = z.object({
|
|
61
|
+
symbol: z.string(),
|
|
62
|
+
address: z.string(),
|
|
63
|
+
supplyingEnabled: z.boolean(),
|
|
64
|
+
borrowingEnabled: z.boolean(),
|
|
65
|
+
}).transform((v) => {
|
|
66
|
+
return remap$(v, {
|
|
67
|
+
supplyingEnabled: "supplying_enabled",
|
|
68
|
+
borrowingEnabled: "borrowing_enabled",
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
75
|
+
*/
|
|
76
|
+
export namespace AaveSupportedTokenMetadata$ {
|
|
77
|
+
/** @deprecated use `AaveSupportedTokenMetadata$inboundSchema` instead. */
|
|
78
|
+
export const inboundSchema = AaveSupportedTokenMetadata$inboundSchema;
|
|
79
|
+
/** @deprecated use `AaveSupportedTokenMetadata$outboundSchema` instead. */
|
|
80
|
+
export const outboundSchema = AaveSupportedTokenMetadata$outboundSchema;
|
|
81
|
+
/** @deprecated use `AaveSupportedTokenMetadata$Outbound` instead. */
|
|
82
|
+
export type Outbound = AaveSupportedTokenMetadata$Outbound;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function aaveSupportedTokenMetadataToJSON(
|
|
86
|
+
aaveSupportedTokenMetadata: AaveSupportedTokenMetadata,
|
|
87
|
+
): string {
|
|
88
|
+
return JSON.stringify(
|
|
89
|
+
AaveSupportedTokenMetadata$outboundSchema.parse(aaveSupportedTokenMetadata),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function aaveSupportedTokenMetadataFromJSON(
|
|
94
|
+
jsonString: string,
|
|
95
|
+
): SafeParseResult<AaveSupportedTokenMetadata, SDKValidationError> {
|
|
96
|
+
return safeParse(
|
|
97
|
+
jsonString,
|
|
98
|
+
(x) => AaveSupportedTokenMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
99
|
+
`Failed to parse 'AaveSupportedTokenMetadata' from JSON`,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
AaveSupportedTokenMetadata,
|
|
11
|
+
AaveSupportedTokenMetadata$inboundSchema,
|
|
12
|
+
AaveSupportedTokenMetadata$Outbound,
|
|
13
|
+
AaveSupportedTokenMetadata$outboundSchema,
|
|
14
|
+
} from "./aavesupportedtokenmetadata.js";
|
|
15
|
+
|
|
16
|
+
export type AaveSupportedTokensResponse = {
|
|
17
|
+
/**
|
|
18
|
+
* List of supported tokens with configuration metadata for a given chain.
|
|
19
|
+
*/
|
|
20
|
+
tokens: Array<AaveSupportedTokenMetadata>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AaveSupportedTokensResponse$inboundSchema: z.ZodType<
|
|
25
|
+
AaveSupportedTokensResponse,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
tokens: z.array(AaveSupportedTokenMetadata$inboundSchema),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type AaveSupportedTokensResponse$Outbound = {
|
|
34
|
+
tokens: Array<AaveSupportedTokenMetadata$Outbound>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const AaveSupportedTokensResponse$outboundSchema: z.ZodType<
|
|
39
|
+
AaveSupportedTokensResponse$Outbound,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
AaveSupportedTokensResponse
|
|
42
|
+
> = z.object({
|
|
43
|
+
tokens: z.array(AaveSupportedTokenMetadata$outboundSchema),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
49
|
+
*/
|
|
50
|
+
export namespace AaveSupportedTokensResponse$ {
|
|
51
|
+
/** @deprecated use `AaveSupportedTokensResponse$inboundSchema` instead. */
|
|
52
|
+
export const inboundSchema = AaveSupportedTokensResponse$inboundSchema;
|
|
53
|
+
/** @deprecated use `AaveSupportedTokensResponse$outboundSchema` instead. */
|
|
54
|
+
export const outboundSchema = AaveSupportedTokensResponse$outboundSchema;
|
|
55
|
+
/** @deprecated use `AaveSupportedTokensResponse$Outbound` instead. */
|
|
56
|
+
export type Outbound = AaveSupportedTokensResponse$Outbound;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function aaveSupportedTokensResponseToJSON(
|
|
60
|
+
aaveSupportedTokensResponse: AaveSupportedTokensResponse,
|
|
61
|
+
): string {
|
|
62
|
+
return JSON.stringify(
|
|
63
|
+
AaveSupportedTokensResponse$outboundSchema.parse(
|
|
64
|
+
aaveSupportedTokensResponse,
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function aaveSupportedTokensResponseFromJSON(
|
|
70
|
+
jsonString: string,
|
|
71
|
+
): SafeParseResult<AaveSupportedTokensResponse, SDKValidationError> {
|
|
72
|
+
return safeParse(
|
|
73
|
+
jsonString,
|
|
74
|
+
(x) => AaveSupportedTokensResponse$inboundSchema.parse(JSON.parse(x)),
|
|
75
|
+
`Failed to parse 'AaveSupportedTokensResponse' from JSON`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -15,6 +15,8 @@ export * from "./aavereserveoverviewresponse.js";
|
|
|
15
15
|
export * from "./aavestdrateresponse.js";
|
|
16
16
|
export * from "./aavesupplyparams.js";
|
|
17
17
|
export * from "./aavesupplyrequest.js";
|
|
18
|
+
export * from "./aavesupportedtokenmetadata.js";
|
|
19
|
+
export * from "./aavesupportedtokensresponse.js";
|
|
18
20
|
export * from "./aavetokenpriceresponse.js";
|
|
19
21
|
export * from "./aaveuserpositionpertokenresponse.js";
|
|
20
22
|
export * from "./aaveuserpositionsummaryresponse.js";
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The chain to use.
|
|
13
|
+
*/
|
|
14
|
+
export const AaveAaveSupportedTokensChain = {
|
|
15
|
+
BaseMainnet: "base:mainnet",
|
|
16
|
+
EthereumMainnet: "ethereum:mainnet",
|
|
17
|
+
ArbitrumMainnet: "arbitrum:mainnet",
|
|
18
|
+
} as const;
|
|
19
|
+
/**
|
|
20
|
+
* The chain to use.
|
|
21
|
+
*/
|
|
22
|
+
export type AaveAaveSupportedTokensChain = ClosedEnum<
|
|
23
|
+
typeof AaveAaveSupportedTokensChain
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type AaveAaveSupportedTokensRequest = {
|
|
27
|
+
/**
|
|
28
|
+
* The chain to use.
|
|
29
|
+
*/
|
|
30
|
+
chain?: AaveAaveSupportedTokensChain | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Optional block number (defaults to latest).
|
|
33
|
+
*/
|
|
34
|
+
block?: number | null | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const AaveAaveSupportedTokensChain$inboundSchema: z.ZodNativeEnum<
|
|
39
|
+
typeof AaveAaveSupportedTokensChain
|
|
40
|
+
> = z.nativeEnum(AaveAaveSupportedTokensChain);
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const AaveAaveSupportedTokensChain$outboundSchema: z.ZodNativeEnum<
|
|
44
|
+
typeof AaveAaveSupportedTokensChain
|
|
45
|
+
> = AaveAaveSupportedTokensChain$inboundSchema;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
50
|
+
*/
|
|
51
|
+
export namespace AaveAaveSupportedTokensChain$ {
|
|
52
|
+
/** @deprecated use `AaveAaveSupportedTokensChain$inboundSchema` instead. */
|
|
53
|
+
export const inboundSchema = AaveAaveSupportedTokensChain$inboundSchema;
|
|
54
|
+
/** @deprecated use `AaveAaveSupportedTokensChain$outboundSchema` instead. */
|
|
55
|
+
export const outboundSchema = AaveAaveSupportedTokensChain$outboundSchema;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const AaveAaveSupportedTokensRequest$inboundSchema: z.ZodType<
|
|
60
|
+
AaveAaveSupportedTokensRequest,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
unknown
|
|
63
|
+
> = z.object({
|
|
64
|
+
chain: AaveAaveSupportedTokensChain$inboundSchema.default("arbitrum:mainnet"),
|
|
65
|
+
block: z.nullable(z.number().int()).optional(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type AaveAaveSupportedTokensRequest$Outbound = {
|
|
70
|
+
chain: string;
|
|
71
|
+
block?: number | null | undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const AaveAaveSupportedTokensRequest$outboundSchema: z.ZodType<
|
|
76
|
+
AaveAaveSupportedTokensRequest$Outbound,
|
|
77
|
+
z.ZodTypeDef,
|
|
78
|
+
AaveAaveSupportedTokensRequest
|
|
79
|
+
> = z.object({
|
|
80
|
+
chain: AaveAaveSupportedTokensChain$outboundSchema.default(
|
|
81
|
+
"arbitrum:mainnet",
|
|
82
|
+
),
|
|
83
|
+
block: z.nullable(z.number().int()).optional(),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
89
|
+
*/
|
|
90
|
+
export namespace AaveAaveSupportedTokensRequest$ {
|
|
91
|
+
/** @deprecated use `AaveAaveSupportedTokensRequest$inboundSchema` instead. */
|
|
92
|
+
export const inboundSchema = AaveAaveSupportedTokensRequest$inboundSchema;
|
|
93
|
+
/** @deprecated use `AaveAaveSupportedTokensRequest$outboundSchema` instead. */
|
|
94
|
+
export const outboundSchema = AaveAaveSupportedTokensRequest$outboundSchema;
|
|
95
|
+
/** @deprecated use `AaveAaveSupportedTokensRequest$Outbound` instead. */
|
|
96
|
+
export type Outbound = AaveAaveSupportedTokensRequest$Outbound;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function aaveAaveSupportedTokensRequestToJSON(
|
|
100
|
+
aaveAaveSupportedTokensRequest: AaveAaveSupportedTokensRequest,
|
|
101
|
+
): string {
|
|
102
|
+
return JSON.stringify(
|
|
103
|
+
AaveAaveSupportedTokensRequest$outboundSchema.parse(
|
|
104
|
+
aaveAaveSupportedTokensRequest,
|
|
105
|
+
),
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function aaveAaveSupportedTokensRequestFromJSON(
|
|
110
|
+
jsonString: string,
|
|
111
|
+
): SafeParseResult<AaveAaveSupportedTokensRequest, SDKValidationError> {
|
|
112
|
+
return safeParse(
|
|
113
|
+
jsonString,
|
|
114
|
+
(x) => AaveAaveSupportedTokensRequest$inboundSchema.parse(JSON.parse(x)),
|
|
115
|
+
`Failed to parse 'AaveAaveSupportedTokensRequest' from JSON`,
|
|
116
|
+
);
|
|
117
|
+
}
|
package/src/sdk/aavev3.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { aaveV3AaveSupportedTokens } from "../funcs/aaveV3AaveSupportedTokens.js";
|
|
5
6
|
import { aaveV3AvgRate } from "../funcs/aaveV3AvgRate.js";
|
|
6
7
|
import { aaveV3Borrow } from "../funcs/aaveV3Borrow.js";
|
|
7
8
|
import { aaveV3HistoricalTransactions } from "../funcs/aaveV3HistoricalTransactions.js";
|
|
@@ -21,6 +22,29 @@ import * as operations from "../models/operations/index.js";
|
|
|
21
22
|
import { unwrapAsync } from "../types/fp.js";
|
|
22
23
|
|
|
23
24
|
export class AaveV3 extends ClientSDK {
|
|
25
|
+
/**
|
|
26
|
+
* Aave Supported Tokens
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Returns the list of supported tokens on Aave for the specified network, along
|
|
30
|
+
* with key metadata.
|
|
31
|
+
*
|
|
32
|
+
* For each token, the response includes:
|
|
33
|
+
* - The symbol and contract address.
|
|
34
|
+
* - Whether the token is currently enabled for supplying (depositing).
|
|
35
|
+
* - Whether it is enabled for borrowing.
|
|
36
|
+
*/
|
|
37
|
+
async aaveSupportedTokens(
|
|
38
|
+
request: operations.AaveAaveSupportedTokensRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): Promise<components.AaveSupportedTokensResponse> {
|
|
41
|
+
return unwrapAsync(aaveV3AaveSupportedTokens(
|
|
42
|
+
this,
|
|
43
|
+
request,
|
|
44
|
+
options,
|
|
45
|
+
));
|
|
46
|
+
}
|
|
47
|
+
|
|
24
48
|
/**
|
|
25
49
|
* Interest Rates
|
|
26
50
|
*
|