@compass-labs/api-sdk 0.5.49 → 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/README.md +2 -0
- package/bin/mcp-server.js +199 -33
- package/bin/mcp-server.js.map +13 -8
- 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 +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- 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/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/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/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 +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/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/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 +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- 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/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/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/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 +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/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/universal/README.md +70 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- 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 +3 -1
- package/src/mcp-server/tools/universalSupportedChains.ts +37 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/protocol.ts +35 -0
- package/src/models/components/supportedchaininfo.ts +70 -0
- package/src/models/operations/genericsupportedchains.ts +72 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/universal.ts +18 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { universalSupportedChains } from "../../funcs/universalSupportedChains.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GenericSupportedChainsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$universalSupportedChains: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "universal-supported-chains",
|
|
15
|
+
description: `List Supported Chains
|
|
16
|
+
|
|
17
|
+
Get the list of supported chains by the Compass API.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await universalSupportedChains(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -116,6 +116,7 @@ export * from "./pendlesellytparams.js";
|
|
|
116
116
|
export * from "./pendlesellytrequest.js";
|
|
117
117
|
export * from "./portfolio.js";
|
|
118
118
|
export * from "./position.js";
|
|
119
|
+
export * from "./protocol.js";
|
|
119
120
|
export * from "./redeemunderlying.js";
|
|
120
121
|
export * from "./repay.js";
|
|
121
122
|
export * from "./reserve.js";
|
|
@@ -133,6 +134,7 @@ export * from "./skysellrequest.js";
|
|
|
133
134
|
export * from "./skywithdrawparams.js";
|
|
134
135
|
export * from "./skywithdrawrequest.js";
|
|
135
136
|
export * from "./supply.js";
|
|
137
|
+
export * from "./supportedchaininfo.js";
|
|
136
138
|
export * from "./swapborrowrate.js";
|
|
137
139
|
export * from "./syposition.js";
|
|
138
140
|
export * from "./tokenaddressresponse.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const Protocol = {
|
|
9
|
+
Aave: "aave",
|
|
10
|
+
Aerodrome: "aerodrome",
|
|
11
|
+
Morpho: "morpho",
|
|
12
|
+
Sky: "sky",
|
|
13
|
+
Uniswap: "uniswap",
|
|
14
|
+
Pendle: "pendle",
|
|
15
|
+
} as const;
|
|
16
|
+
export type Protocol = ClosedEnum<typeof Protocol>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Protocol$inboundSchema: z.ZodNativeEnum<typeof Protocol> = z
|
|
20
|
+
.nativeEnum(Protocol);
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const Protocol$outboundSchema: z.ZodNativeEnum<typeof Protocol> =
|
|
24
|
+
Protocol$inboundSchema;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
29
|
+
*/
|
|
30
|
+
export namespace Protocol$ {
|
|
31
|
+
/** @deprecated use `Protocol$inboundSchema` instead. */
|
|
32
|
+
export const inboundSchema = Protocol$inboundSchema;
|
|
33
|
+
/** @deprecated use `Protocol$outboundSchema` instead. */
|
|
34
|
+
export const outboundSchema = Protocol$outboundSchema;
|
|
35
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Response model for a chain.
|
|
13
|
+
*/
|
|
14
|
+
export type SupportedChainInfo = {
|
|
15
|
+
chains: Array<Chain>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const SupportedChainInfo$inboundSchema: z.ZodType<
|
|
20
|
+
SupportedChainInfo,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
chains: z.array(Chain$inboundSchema),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type SupportedChainInfo$Outbound = {
|
|
29
|
+
chains: Array<string>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const SupportedChainInfo$outboundSchema: z.ZodType<
|
|
34
|
+
SupportedChainInfo$Outbound,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
SupportedChainInfo
|
|
37
|
+
> = z.object({
|
|
38
|
+
chains: z.array(Chain$outboundSchema),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace SupportedChainInfo$ {
|
|
46
|
+
/** @deprecated use `SupportedChainInfo$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = SupportedChainInfo$inboundSchema;
|
|
48
|
+
/** @deprecated use `SupportedChainInfo$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema = SupportedChainInfo$outboundSchema;
|
|
50
|
+
/** @deprecated use `SupportedChainInfo$Outbound` instead. */
|
|
51
|
+
export type Outbound = SupportedChainInfo$Outbound;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function supportedChainInfoToJSON(
|
|
55
|
+
supportedChainInfo: SupportedChainInfo,
|
|
56
|
+
): string {
|
|
57
|
+
return JSON.stringify(
|
|
58
|
+
SupportedChainInfo$outboundSchema.parse(supportedChainInfo),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function supportedChainInfoFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<SupportedChainInfo, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => SupportedChainInfo$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'SupportedChainInfo' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 * as components from "../components/index.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type GenericSupportedChainsRequest = {
|
|
12
|
+
/**
|
|
13
|
+
* The protocol to get the supported chains for.
|
|
14
|
+
*/
|
|
15
|
+
protocol?: components.Protocol | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const GenericSupportedChainsRequest$inboundSchema: z.ZodType<
|
|
20
|
+
GenericSupportedChainsRequest,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
protocol: z.nullable(components.Protocol$inboundSchema).optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type GenericSupportedChainsRequest$Outbound = {
|
|
29
|
+
protocol?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const GenericSupportedChainsRequest$outboundSchema: z.ZodType<
|
|
34
|
+
GenericSupportedChainsRequest$Outbound,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
GenericSupportedChainsRequest
|
|
37
|
+
> = z.object({
|
|
38
|
+
protocol: z.nullable(components.Protocol$outboundSchema).optional(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace GenericSupportedChainsRequest$ {
|
|
46
|
+
/** @deprecated use `GenericSupportedChainsRequest$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = GenericSupportedChainsRequest$inboundSchema;
|
|
48
|
+
/** @deprecated use `GenericSupportedChainsRequest$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema = GenericSupportedChainsRequest$outboundSchema;
|
|
50
|
+
/** @deprecated use `GenericSupportedChainsRequest$Outbound` instead. */
|
|
51
|
+
export type Outbound = GenericSupportedChainsRequest$Outbound;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function genericSupportedChainsRequestToJSON(
|
|
55
|
+
genericSupportedChainsRequest: GenericSupportedChainsRequest,
|
|
56
|
+
): string {
|
|
57
|
+
return JSON.stringify(
|
|
58
|
+
GenericSupportedChainsRequest$outboundSchema.parse(
|
|
59
|
+
genericSupportedChainsRequest,
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function genericSupportedChainsRequestFromJSON(
|
|
65
|
+
jsonString: string,
|
|
66
|
+
): SafeParseResult<GenericSupportedChainsRequest, SDKValidationError> {
|
|
67
|
+
return safeParse(
|
|
68
|
+
jsonString,
|
|
69
|
+
(x) => GenericSupportedChainsRequest$inboundSchema.parse(JSON.parse(x)),
|
|
70
|
+
`Failed to parse 'GenericSupportedChainsRequest' from JSON`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -17,6 +17,7 @@ export * from "./aerodromeslipstreampoolprice.js";
|
|
|
17
17
|
export * from "./genericallowance.js";
|
|
18
18
|
export * from "./genericens.js";
|
|
19
19
|
export * from "./genericportfolio.js";
|
|
20
|
+
export * from "./genericsupportedchains.js";
|
|
20
21
|
export * from "./genericsupportedtokens.js";
|
|
21
22
|
export * from "./genericvisualizeportfolio.js";
|
|
22
23
|
export * from "./morphomarket.js";
|
package/src/sdk/universal.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { universalAllowance } from "../funcs/universalAllowance.js";
|
|
|
6
6
|
import { universalAllowanceSet } from "../funcs/universalAllowanceSet.js";
|
|
7
7
|
import { universalEns } from "../funcs/universalEns.js";
|
|
8
8
|
import { universalPortfolio } from "../funcs/universalPortfolio.js";
|
|
9
|
+
import { universalSupportedChains } from "../funcs/universalSupportedChains.js";
|
|
9
10
|
import { universalSupportedTokens } from "../funcs/universalSupportedTokens.js";
|
|
10
11
|
import { universalUnwrapWeth } from "../funcs/universalUnwrapWeth.js";
|
|
11
12
|
import { universalVisualizePortfolio } from "../funcs/universalVisualizePortfolio.js";
|
|
@@ -74,6 +75,23 @@ export class Universal extends ClientSDK {
|
|
|
74
75
|
));
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* List Supported Chains
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* Get the list of supported chains by the Compass API.
|
|
83
|
+
*/
|
|
84
|
+
async supportedChains(
|
|
85
|
+
request: operations.GenericSupportedChainsRequest,
|
|
86
|
+
options?: RequestOptions,
|
|
87
|
+
): Promise<components.SupportedChainInfo> {
|
|
88
|
+
return unwrapAsync(universalSupportedChains(
|
|
89
|
+
this,
|
|
90
|
+
request,
|
|
91
|
+
options,
|
|
92
|
+
));
|
|
93
|
+
}
|
|
94
|
+
|
|
77
95
|
/**
|
|
78
96
|
* Get Allowance
|
|
79
97
|
*
|