@compass-labs/api-sdk 0.5.49 → 0.5.51
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 +229 -43
- package/bin/mcp-server.js.map +16 -11
- 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/components/userstate.d.ts +2 -2
- package/dist/commonjs/models/components/userstate.d.ts.map +1 -1
- package/dist/commonjs/models/components/userstate.js +2 -2
- package/dist/commonjs/models/components/userstate.js.map +1 -1
- 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/models/operations/morphomarkets.d.ts +53 -4
- package/dist/commonjs/models/operations/morphomarkets.d.ts.map +1 -1
- package/dist/commonjs/models/operations/morphomarkets.js +52 -5
- package/dist/commonjs/models/operations/morphomarkets.js.map +1 -1
- package/dist/commonjs/models/operations/morphovaults.d.ts +27 -2
- package/dist/commonjs/models/operations/morphovaults.d.ts.map +1 -1
- package/dist/commonjs/models/operations/morphovaults.js +27 -3
- package/dist/commonjs/models/operations/morphovaults.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/components/userstate.d.ts +2 -2
- package/dist/esm/models/components/userstate.d.ts.map +1 -1
- package/dist/esm/models/components/userstate.js +2 -2
- package/dist/esm/models/components/userstate.js.map +1 -1
- 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/models/operations/morphomarkets.d.ts +53 -4
- package/dist/esm/models/operations/morphomarkets.d.ts.map +1 -1
- package/dist/esm/models/operations/morphomarkets.js +47 -4
- package/dist/esm/models/operations/morphomarkets.js.map +1 -1
- package/dist/esm/models/operations/morphovaults.d.ts +27 -2
- package/dist/esm/models/operations/morphovaults.d.ts.map +1 -1
- package/dist/esm/models/operations/morphovaults.js +24 -2
- package/dist/esm/models/operations/morphovaults.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/components/userstate.ts +4 -4
- package/src/models/operations/genericsupportedchains.ts +72 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/morphomarkets.ts +117 -8
- package/src/models/operations/morphovaults.ts +58 -4
- package/src/sdk/universal.ts +18 -0
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
10
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
12
|
|
|
12
13
|
export const MorphoVaultsChain = {
|
|
@@ -15,12 +16,17 @@ export const MorphoVaultsChain = {
|
|
|
15
16
|
} as const;
|
|
16
17
|
export type MorphoVaultsChain = ClosedEnum<typeof MorphoVaultsChain>;
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Token address that will filter vaults by this deposit token.
|
|
21
|
+
*/
|
|
22
|
+
export type DepositToken = components.TokenEnum | string;
|
|
23
|
+
|
|
18
24
|
export type MorphoVaultsRequest = {
|
|
19
25
|
chain?: MorphoVaultsChain | undefined;
|
|
20
26
|
/**
|
|
21
27
|
* Token address that will filter vaults by this deposit token.
|
|
22
28
|
*/
|
|
23
|
-
depositToken?: string | null | undefined;
|
|
29
|
+
depositToken?: components.TokenEnum | string | null | undefined;
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
/** @internal */
|
|
@@ -44,6 +50,50 @@ export namespace MorphoVaultsChain$ {
|
|
|
44
50
|
export const outboundSchema = MorphoVaultsChain$outboundSchema;
|
|
45
51
|
}
|
|
46
52
|
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const DepositToken$inboundSchema: z.ZodType<
|
|
55
|
+
DepositToken,
|
|
56
|
+
z.ZodTypeDef,
|
|
57
|
+
unknown
|
|
58
|
+
> = z.union([components.TokenEnum$inboundSchema, z.string()]);
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type DepositToken$Outbound = string | string;
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const DepositToken$outboundSchema: z.ZodType<
|
|
65
|
+
DepositToken$Outbound,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
DepositToken
|
|
68
|
+
> = z.union([components.TokenEnum$outboundSchema, z.string()]);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
73
|
+
*/
|
|
74
|
+
export namespace DepositToken$ {
|
|
75
|
+
/** @deprecated use `DepositToken$inboundSchema` instead. */
|
|
76
|
+
export const inboundSchema = DepositToken$inboundSchema;
|
|
77
|
+
/** @deprecated use `DepositToken$outboundSchema` instead. */
|
|
78
|
+
export const outboundSchema = DepositToken$outboundSchema;
|
|
79
|
+
/** @deprecated use `DepositToken$Outbound` instead. */
|
|
80
|
+
export type Outbound = DepositToken$Outbound;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function depositTokenToJSON(depositToken: DepositToken): string {
|
|
84
|
+
return JSON.stringify(DepositToken$outboundSchema.parse(depositToken));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function depositTokenFromJSON(
|
|
88
|
+
jsonString: string,
|
|
89
|
+
): SafeParseResult<DepositToken, SDKValidationError> {
|
|
90
|
+
return safeParse(
|
|
91
|
+
jsonString,
|
|
92
|
+
(x) => DepositToken$inboundSchema.parse(JSON.parse(x)),
|
|
93
|
+
`Failed to parse 'DepositToken' from JSON`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
47
97
|
/** @internal */
|
|
48
98
|
export const MorphoVaultsRequest$inboundSchema: z.ZodType<
|
|
49
99
|
MorphoVaultsRequest,
|
|
@@ -51,7 +101,9 @@ export const MorphoVaultsRequest$inboundSchema: z.ZodType<
|
|
|
51
101
|
unknown
|
|
52
102
|
> = z.object({
|
|
53
103
|
chain: MorphoVaultsChain$inboundSchema.default("base:mainnet"),
|
|
54
|
-
deposit_token: z.nullable(
|
|
104
|
+
deposit_token: z.nullable(
|
|
105
|
+
z.union([components.TokenEnum$inboundSchema, z.string()]),
|
|
106
|
+
).optional(),
|
|
55
107
|
}).transform((v) => {
|
|
56
108
|
return remap$(v, {
|
|
57
109
|
"deposit_token": "depositToken",
|
|
@@ -61,7 +113,7 @@ export const MorphoVaultsRequest$inboundSchema: z.ZodType<
|
|
|
61
113
|
/** @internal */
|
|
62
114
|
export type MorphoVaultsRequest$Outbound = {
|
|
63
115
|
chain: string;
|
|
64
|
-
deposit_token?: string | null | undefined;
|
|
116
|
+
deposit_token?: string | string | null | undefined;
|
|
65
117
|
};
|
|
66
118
|
|
|
67
119
|
/** @internal */
|
|
@@ -71,7 +123,9 @@ export const MorphoVaultsRequest$outboundSchema: z.ZodType<
|
|
|
71
123
|
MorphoVaultsRequest
|
|
72
124
|
> = z.object({
|
|
73
125
|
chain: MorphoVaultsChain$outboundSchema.default("base:mainnet"),
|
|
74
|
-
depositToken: z.nullable(
|
|
126
|
+
depositToken: z.nullable(
|
|
127
|
+
z.union([components.TokenEnum$outboundSchema, z.string()]),
|
|
128
|
+
).optional(),
|
|
75
129
|
}).transform((v) => {
|
|
76
130
|
return remap$(v, {
|
|
77
131
|
depositToken: "deposit_token",
|
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
|
*
|