@compass-labs/api-sdk 0.3.0 → 0.3.2
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 +8 -0
- package/bin/mcp-server.js +1044 -308
- package/bin/mcp-server.js.map +25 -9
- package/dist/commonjs/funcs/pendleBuyPt.d.ts +17 -0
- package/dist/commonjs/funcs/pendleBuyPt.d.ts.map +1 -0
- package/dist/commonjs/funcs/pendleBuyPt.js +118 -0
- package/dist/commonjs/funcs/pendleBuyPt.js.map +1 -0
- package/dist/commonjs/funcs/pendleBuyYt.d.ts +17 -0
- package/dist/commonjs/funcs/pendleBuyYt.d.ts.map +1 -0
- package/dist/commonjs/funcs/pendleBuyYt.js +118 -0
- package/dist/commonjs/funcs/pendleBuyYt.js.map +1 -0
- package/dist/commonjs/funcs/pendleSellPt.d.ts +17 -0
- package/dist/commonjs/funcs/pendleSellPt.d.ts.map +1 -0
- package/dist/commonjs/funcs/pendleSellPt.js +118 -0
- package/dist/commonjs/funcs/pendleSellPt.js.map +1 -0
- package/dist/commonjs/funcs/pendleSellYt.d.ts +17 -0
- package/dist/commonjs/funcs/pendleSellYt.d.ts.map +1 -0
- package/dist/commonjs/funcs/pendleSellYt.js +118 -0
- package/dist/commonjs/funcs/pendleSellYt.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 +9 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/pendleBuyPt.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyPt.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyPt.js +64 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyPt.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyYt.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyYt.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyYt.js +64 -0
- package/dist/commonjs/mcp-server/tools/pendleBuyYt.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleSellPt.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/pendleSellPt.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleSellPt.js +64 -0
- package/dist/commonjs/mcp-server/tools/pendleSellPt.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleSellYt.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/pendleSellYt.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleSellYt.js +64 -0
- package/dist/commonjs/mcp-server/tools/pendleSellYt.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +8 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +8 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/multicallactiontype.d.ts +12 -0
- package/dist/commonjs/models/components/multicallactiontype.d.ts.map +1 -1
- package/dist/commonjs/models/components/multicallactiontype.js +4 -0
- package/dist/commonjs/models/components/multicallactiontype.js.map +1 -1
- package/dist/commonjs/models/components/pendlebuyptparams.d.ts +61 -0
- package/dist/commonjs/models/components/pendlebuyptparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlebuyptparams.js +103 -0
- package/dist/commonjs/models/components/pendlebuyptparams.js.map +1 -0
- package/dist/commonjs/models/components/pendlebuyptrequest.d.ts +72 -0
- package/dist/commonjs/models/components/pendlebuyptrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlebuyptrequest.js +108 -0
- package/dist/commonjs/models/components/pendlebuyptrequest.js.map +1 -0
- package/dist/commonjs/models/components/pendlebuyytparams.d.ts +61 -0
- package/dist/commonjs/models/components/pendlebuyytparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlebuyytparams.js +103 -0
- package/dist/commonjs/models/components/pendlebuyytparams.js.map +1 -0
- package/dist/commonjs/models/components/pendlebuyytrequest.d.ts +72 -0
- package/dist/commonjs/models/components/pendlebuyytrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlebuyytrequest.js +108 -0
- package/dist/commonjs/models/components/pendlebuyytrequest.js.map +1 -0
- package/dist/commonjs/models/components/pendlesellptparams.d.ts +61 -0
- package/dist/commonjs/models/components/pendlesellptparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlesellptparams.js +103 -0
- package/dist/commonjs/models/components/pendlesellptparams.js.map +1 -0
- package/dist/commonjs/models/components/pendlesellptrequest.d.ts +72 -0
- package/dist/commonjs/models/components/pendlesellptrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlesellptrequest.js +108 -0
- package/dist/commonjs/models/components/pendlesellptrequest.js.map +1 -0
- package/dist/commonjs/models/components/pendlesellytparams.d.ts +61 -0
- package/dist/commonjs/models/components/pendlesellytparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlesellytparams.js +103 -0
- package/dist/commonjs/models/components/pendlesellytparams.js.map +1 -0
- package/dist/commonjs/models/components/pendlesellytrequest.d.ts +72 -0
- package/dist/commonjs/models/components/pendlesellytrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendlesellytrequest.js +108 -0
- package/dist/commonjs/models/components/pendlesellytrequest.js.map +1 -0
- package/dist/commonjs/models/components/useroperation.d.ts +8 -4
- package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
- package/dist/commonjs/models/components/useroperation.js +20 -0
- package/dist/commonjs/models/components/useroperation.js.map +1 -1
- package/dist/commonjs/sdk/pendle.d.ts +28 -0
- package/dist/commonjs/sdk/pendle.d.ts.map +1 -1
- package/dist/commonjs/sdk/pendle.js +40 -0
- package/dist/commonjs/sdk/pendle.js.map +1 -1
- package/dist/esm/funcs/pendleBuyPt.d.ts +17 -0
- package/dist/esm/funcs/pendleBuyPt.d.ts.map +1 -0
- package/dist/esm/funcs/pendleBuyPt.js +82 -0
- package/dist/esm/funcs/pendleBuyPt.js.map +1 -0
- package/dist/esm/funcs/pendleBuyYt.d.ts +17 -0
- package/dist/esm/funcs/pendleBuyYt.d.ts.map +1 -0
- package/dist/esm/funcs/pendleBuyYt.js +82 -0
- package/dist/esm/funcs/pendleBuyYt.js.map +1 -0
- package/dist/esm/funcs/pendleSellPt.d.ts +17 -0
- package/dist/esm/funcs/pendleSellPt.d.ts.map +1 -0
- package/dist/esm/funcs/pendleSellPt.js +82 -0
- package/dist/esm/funcs/pendleSellPt.js.map +1 -0
- package/dist/esm/funcs/pendleSellYt.d.ts +17 -0
- package/dist/esm/funcs/pendleSellYt.d.ts.map +1 -0
- package/dist/esm/funcs/pendleSellYt.js +82 -0
- package/dist/esm/funcs/pendleSellYt.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 +9 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/pendleBuyPt.d.ts +8 -0
- package/dist/esm/mcp-server/tools/pendleBuyPt.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/pendleBuyPt.js +28 -0
- package/dist/esm/mcp-server/tools/pendleBuyPt.js.map +1 -0
- package/dist/esm/mcp-server/tools/pendleBuyYt.d.ts +8 -0
- package/dist/esm/mcp-server/tools/pendleBuyYt.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/pendleBuyYt.js +28 -0
- package/dist/esm/mcp-server/tools/pendleBuyYt.js.map +1 -0
- package/dist/esm/mcp-server/tools/pendleSellPt.d.ts +8 -0
- package/dist/esm/mcp-server/tools/pendleSellPt.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/pendleSellPt.js +28 -0
- package/dist/esm/mcp-server/tools/pendleSellPt.js.map +1 -0
- package/dist/esm/mcp-server/tools/pendleSellYt.d.ts +8 -0
- package/dist/esm/mcp-server/tools/pendleSellYt.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/pendleSellYt.js +28 -0
- package/dist/esm/mcp-server/tools/pendleSellYt.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +8 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +8 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/multicallactiontype.d.ts +12 -0
- package/dist/esm/models/components/multicallactiontype.d.ts.map +1 -1
- package/dist/esm/models/components/multicallactiontype.js +4 -0
- package/dist/esm/models/components/multicallactiontype.js.map +1 -1
- package/dist/esm/models/components/pendlebuyptparams.d.ts +61 -0
- package/dist/esm/models/components/pendlebuyptparams.d.ts.map +1 -0
- package/dist/esm/models/components/pendlebuyptparams.js +63 -0
- package/dist/esm/models/components/pendlebuyptparams.js.map +1 -0
- package/dist/esm/models/components/pendlebuyptrequest.d.ts +72 -0
- package/dist/esm/models/components/pendlebuyptrequest.d.ts.map +1 -0
- package/dist/esm/models/components/pendlebuyptrequest.js +68 -0
- package/dist/esm/models/components/pendlebuyptrequest.js.map +1 -0
- package/dist/esm/models/components/pendlebuyytparams.d.ts +61 -0
- package/dist/esm/models/components/pendlebuyytparams.d.ts.map +1 -0
- package/dist/esm/models/components/pendlebuyytparams.js +63 -0
- package/dist/esm/models/components/pendlebuyytparams.js.map +1 -0
- package/dist/esm/models/components/pendlebuyytrequest.d.ts +72 -0
- package/dist/esm/models/components/pendlebuyytrequest.d.ts.map +1 -0
- package/dist/esm/models/components/pendlebuyytrequest.js +68 -0
- package/dist/esm/models/components/pendlebuyytrequest.js.map +1 -0
- package/dist/esm/models/components/pendlesellptparams.d.ts +61 -0
- package/dist/esm/models/components/pendlesellptparams.d.ts.map +1 -0
- package/dist/esm/models/components/pendlesellptparams.js +63 -0
- package/dist/esm/models/components/pendlesellptparams.js.map +1 -0
- package/dist/esm/models/components/pendlesellptrequest.d.ts +72 -0
- package/dist/esm/models/components/pendlesellptrequest.d.ts.map +1 -0
- package/dist/esm/models/components/pendlesellptrequest.js +68 -0
- package/dist/esm/models/components/pendlesellptrequest.js.map +1 -0
- package/dist/esm/models/components/pendlesellytparams.d.ts +61 -0
- package/dist/esm/models/components/pendlesellytparams.d.ts.map +1 -0
- package/dist/esm/models/components/pendlesellytparams.js +63 -0
- package/dist/esm/models/components/pendlesellytparams.js.map +1 -0
- package/dist/esm/models/components/pendlesellytrequest.d.ts +72 -0
- package/dist/esm/models/components/pendlesellytrequest.d.ts.map +1 -0
- package/dist/esm/models/components/pendlesellytrequest.js +68 -0
- package/dist/esm/models/components/pendlesellytrequest.js.map +1 -0
- package/dist/esm/models/components/useroperation.d.ts +8 -4
- package/dist/esm/models/components/useroperation.d.ts.map +1 -1
- package/dist/esm/models/components/useroperation.js +20 -0
- package/dist/esm/models/components/useroperation.js.map +1 -1
- package/dist/esm/sdk/pendle.d.ts +28 -0
- package/dist/esm/sdk/pendle.d.ts.map +1 -1
- package/dist/esm/sdk/pendle.js +40 -0
- package/dist/esm/sdk/pendle.js.map +1 -1
- package/docs/sdks/pendle/README.md +336 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/pendleBuyPt.ts +165 -0
- package/src/funcs/pendleBuyYt.ts +165 -0
- package/src/funcs/pendleSellPt.ts +165 -0
- package/src/funcs/pendleSellYt.ts +165 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +9 -1
- package/src/mcp-server/tools/pendleBuyPt.ts +37 -0
- package/src/mcp-server/tools/pendleBuyYt.ts +37 -0
- package/src/mcp-server/tools/pendleSellPt.ts +37 -0
- package/src/mcp-server/tools/pendleSellYt.ts +37 -0
- package/src/models/components/index.ts +8 -0
- package/src/models/components/multicallactiontype.ts +4 -0
- package/src/models/components/pendlebuyptparams.ts +138 -0
- package/src/models/components/pendlebuyptrequest.ts +153 -0
- package/src/models/components/pendlebuyytparams.ts +138 -0
- package/src/models/components/pendlebuyytrequest.ts +153 -0
- package/src/models/components/pendlesellptparams.ts +138 -0
- package/src/models/components/pendlesellptrequest.ts +153 -0
- package/src/models/components/pendlesellytparams.ts +138 -0
- package/src/models/components/pendlesellytrequest.ts +153 -0
- package/src/models/components/useroperation.ts +56 -0
- package/src/sdk/pendle.ts +72 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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 { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Buy Yield Token (YT)
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Buy Yield Token (YT) with market's Underlying Token.
|
|
32
|
+
*/
|
|
33
|
+
export function pendleBuyYt(
|
|
34
|
+
client: CompassApiSDKCore,
|
|
35
|
+
request: components.PendleBuyYtRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
components.TxResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| APIError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: CompassApiSDKCore,
|
|
59
|
+
request: components.PendleBuyYtRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
components.TxResponse,
|
|
65
|
+
| errors.HTTPValidationError
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => components.PendleBuyYtRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
87
|
+
|
|
88
|
+
const path = pathToFunc("/v0/pendle/buy_yt")();
|
|
89
|
+
|
|
90
|
+
const headers = new Headers(compactMap({
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
96
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
97
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
+
|
|
99
|
+
const context = {
|
|
100
|
+
options: client._options,
|
|
101
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
102
|
+
operationID: "pendle_buy_yt",
|
|
103
|
+
oAuth2Scopes: [],
|
|
104
|
+
|
|
105
|
+
resolvedSecurity: requestSecurity,
|
|
106
|
+
|
|
107
|
+
securitySource: client._options.apiKeyAuth,
|
|
108
|
+
retryConfig: options?.retries
|
|
109
|
+
|| client._options.retryConfig
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client._createRequest(context, {
|
|
115
|
+
security: requestSecurity,
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
body: body,
|
|
121
|
+
userAgent: client._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
123
|
+
}, options);
|
|
124
|
+
if (!requestRes.ok) {
|
|
125
|
+
return [requestRes, { status: "invalid" }];
|
|
126
|
+
}
|
|
127
|
+
const req = requestRes.value;
|
|
128
|
+
|
|
129
|
+
const doResult = await client._do(req, {
|
|
130
|
+
context,
|
|
131
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
132
|
+
retryConfig: context.retryConfig,
|
|
133
|
+
retryCodes: context.retryCodes,
|
|
134
|
+
});
|
|
135
|
+
if (!doResult.ok) {
|
|
136
|
+
return [doResult, { status: "request-error", request: req }];
|
|
137
|
+
}
|
|
138
|
+
const response = doResult.value;
|
|
139
|
+
|
|
140
|
+
const responseFields = {
|
|
141
|
+
HttpMeta: { Response: response, Request: req },
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const [result] = await M.match<
|
|
145
|
+
components.TxResponse,
|
|
146
|
+
| errors.HTTPValidationError
|
|
147
|
+
| APIError
|
|
148
|
+
| SDKValidationError
|
|
149
|
+
| UnexpectedClientError
|
|
150
|
+
| InvalidRequestError
|
|
151
|
+
| RequestAbortedError
|
|
152
|
+
| RequestTimeoutError
|
|
153
|
+
| ConnectionError
|
|
154
|
+
>(
|
|
155
|
+
M.json(200, components.TxResponse$inboundSchema),
|
|
156
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
157
|
+
M.fail("4XX"),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, { extraFields: responseFields });
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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 { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sell Princpal Token (PT)
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Sell Principal Token (PT) for the market's Underlying Token.
|
|
32
|
+
*/
|
|
33
|
+
export function pendleSellPt(
|
|
34
|
+
client: CompassApiSDKCore,
|
|
35
|
+
request: components.PendleSellPtRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
components.TxResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| APIError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: CompassApiSDKCore,
|
|
59
|
+
request: components.PendleSellPtRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
components.TxResponse,
|
|
65
|
+
| errors.HTTPValidationError
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => components.PendleSellPtRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
87
|
+
|
|
88
|
+
const path = pathToFunc("/v0/pendle/sell_pt")();
|
|
89
|
+
|
|
90
|
+
const headers = new Headers(compactMap({
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
96
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
97
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
+
|
|
99
|
+
const context = {
|
|
100
|
+
options: client._options,
|
|
101
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
102
|
+
operationID: "pendle_sell_pt",
|
|
103
|
+
oAuth2Scopes: [],
|
|
104
|
+
|
|
105
|
+
resolvedSecurity: requestSecurity,
|
|
106
|
+
|
|
107
|
+
securitySource: client._options.apiKeyAuth,
|
|
108
|
+
retryConfig: options?.retries
|
|
109
|
+
|| client._options.retryConfig
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client._createRequest(context, {
|
|
115
|
+
security: requestSecurity,
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
body: body,
|
|
121
|
+
userAgent: client._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
123
|
+
}, options);
|
|
124
|
+
if (!requestRes.ok) {
|
|
125
|
+
return [requestRes, { status: "invalid" }];
|
|
126
|
+
}
|
|
127
|
+
const req = requestRes.value;
|
|
128
|
+
|
|
129
|
+
const doResult = await client._do(req, {
|
|
130
|
+
context,
|
|
131
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
132
|
+
retryConfig: context.retryConfig,
|
|
133
|
+
retryCodes: context.retryCodes,
|
|
134
|
+
});
|
|
135
|
+
if (!doResult.ok) {
|
|
136
|
+
return [doResult, { status: "request-error", request: req }];
|
|
137
|
+
}
|
|
138
|
+
const response = doResult.value;
|
|
139
|
+
|
|
140
|
+
const responseFields = {
|
|
141
|
+
HttpMeta: { Response: response, Request: req },
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const [result] = await M.match<
|
|
145
|
+
components.TxResponse,
|
|
146
|
+
| errors.HTTPValidationError
|
|
147
|
+
| APIError
|
|
148
|
+
| SDKValidationError
|
|
149
|
+
| UnexpectedClientError
|
|
150
|
+
| InvalidRequestError
|
|
151
|
+
| RequestAbortedError
|
|
152
|
+
| RequestTimeoutError
|
|
153
|
+
| ConnectionError
|
|
154
|
+
>(
|
|
155
|
+
M.json(200, components.TxResponse$inboundSchema),
|
|
156
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
157
|
+
M.fail("4XX"),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, { extraFields: responseFields });
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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 { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sell Yield Token (YT)
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Sell Yield Token (YT) for the market's Underlying Token.
|
|
32
|
+
*/
|
|
33
|
+
export function pendleSellYt(
|
|
34
|
+
client: CompassApiSDKCore,
|
|
35
|
+
request: components.PendleSellYtRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
components.TxResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| APIError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: CompassApiSDKCore,
|
|
59
|
+
request: components.PendleSellYtRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
components.TxResponse,
|
|
65
|
+
| errors.HTTPValidationError
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => components.PendleSellYtRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
87
|
+
|
|
88
|
+
const path = pathToFunc("/v0/pendle/sell_yt")();
|
|
89
|
+
|
|
90
|
+
const headers = new Headers(compactMap({
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
96
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
97
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
+
|
|
99
|
+
const context = {
|
|
100
|
+
options: client._options,
|
|
101
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
102
|
+
operationID: "pendle_sell_yt",
|
|
103
|
+
oAuth2Scopes: [],
|
|
104
|
+
|
|
105
|
+
resolvedSecurity: requestSecurity,
|
|
106
|
+
|
|
107
|
+
securitySource: client._options.apiKeyAuth,
|
|
108
|
+
retryConfig: options?.retries
|
|
109
|
+
|| client._options.retryConfig
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client._createRequest(context, {
|
|
115
|
+
security: requestSecurity,
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
body: body,
|
|
121
|
+
userAgent: client._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
123
|
+
}, options);
|
|
124
|
+
if (!requestRes.ok) {
|
|
125
|
+
return [requestRes, { status: "invalid" }];
|
|
126
|
+
}
|
|
127
|
+
const req = requestRes.value;
|
|
128
|
+
|
|
129
|
+
const doResult = await client._do(req, {
|
|
130
|
+
context,
|
|
131
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
132
|
+
retryConfig: context.retryConfig,
|
|
133
|
+
retryCodes: context.retryCodes,
|
|
134
|
+
});
|
|
135
|
+
if (!doResult.ok) {
|
|
136
|
+
return [doResult, { status: "request-error", request: req }];
|
|
137
|
+
}
|
|
138
|
+
const response = doResult.value;
|
|
139
|
+
|
|
140
|
+
const responseFields = {
|
|
141
|
+
HttpMeta: { Response: response, Request: req },
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const [result] = await M.match<
|
|
145
|
+
components.TxResponse,
|
|
146
|
+
| errors.HTTPValidationError
|
|
147
|
+
| APIError
|
|
148
|
+
| SDKValidationError
|
|
149
|
+
| UnexpectedClientError
|
|
150
|
+
| InvalidRequestError
|
|
151
|
+
| RequestAbortedError
|
|
152
|
+
| RequestTimeoutError
|
|
153
|
+
| ConnectionError
|
|
154
|
+
>(
|
|
155
|
+
M.json(200, components.TxResponse$inboundSchema),
|
|
156
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
157
|
+
M.fail("4XX"),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, { extraFields: responseFields });
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
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.3.
|
|
64
|
+
sdkVersion: "0.3.2",
|
|
65
65
|
genVersion: "2.616.1",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.3.
|
|
67
|
+
"speakeasy-sdk/typescript 0.3.2 2.616.1 0.0.1 @compass-labs/api-sdk",
|
|
68
68
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -47,10 +47,14 @@ import { tool$morphoVaultPosition } from "./tools/morphoVaultPosition.js";
|
|
|
47
47
|
import { tool$morphoVaults } from "./tools/morphoVaults.js";
|
|
48
48
|
import { tool$morphoWithdraw } from "./tools/morphoWithdraw.js";
|
|
49
49
|
import { tool$morphoWithdrawCollateral } from "./tools/morphoWithdrawCollateral.js";
|
|
50
|
+
import { tool$pendleBuyPt } from "./tools/pendleBuyPt.js";
|
|
51
|
+
import { tool$pendleBuyYt } from "./tools/pendleBuyYt.js";
|
|
50
52
|
import { tool$pendleMarket } from "./tools/pendleMarket.js";
|
|
51
53
|
import { tool$pendleMarkets } from "./tools/pendleMarkets.js";
|
|
52
54
|
import { tool$pendlePosition } from "./tools/pendlePosition.js";
|
|
53
55
|
import { tool$pendlePositions } from "./tools/pendlePositions.js";
|
|
56
|
+
import { tool$pendleSellPt } from "./tools/pendleSellPt.js";
|
|
57
|
+
import { tool$pendleSellYt } from "./tools/pendleSellYt.js";
|
|
54
58
|
import { tool$skyBuy } from "./tools/skyBuy.js";
|
|
55
59
|
import { tool$skyDeposit } from "./tools/skyDeposit.js";
|
|
56
60
|
import { tool$skyPosition } from "./tools/skyPosition.js";
|
|
@@ -93,7 +97,7 @@ export function createMCPServer(deps: {
|
|
|
93
97
|
}) {
|
|
94
98
|
const server = new McpServer({
|
|
95
99
|
name: "CompassApiSDK",
|
|
96
|
-
version: "0.3.
|
|
100
|
+
version: "0.3.2",
|
|
97
101
|
});
|
|
98
102
|
|
|
99
103
|
const client = new CompassApiSDKCore({
|
|
@@ -188,6 +192,10 @@ export function createMCPServer(deps: {
|
|
|
188
192
|
tool(tool$pendlePositions);
|
|
189
193
|
tool(tool$pendleMarkets);
|
|
190
194
|
tool(tool$pendleMarket);
|
|
195
|
+
tool(tool$pendleBuyPt);
|
|
196
|
+
tool(tool$pendleSellPt);
|
|
197
|
+
tool(tool$pendleBuyYt);
|
|
198
|
+
tool(tool$pendleSellYt);
|
|
191
199
|
tool(tool$transactionBatchingAuthorization);
|
|
192
200
|
tool(tool$transactionBatchingExecute);
|
|
193
201
|
tool(tool$transactionBatchingAaveLoop);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pendleBuyPt } from "../../funcs/pendleBuyPt.js";
|
|
6
|
+
import * as components from "../../models/components/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: components.PendleBuyPtRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$pendleBuyPt: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "pendle-buy-pt",
|
|
15
|
+
description: `Buy Princpal Token (PT)
|
|
16
|
+
|
|
17
|
+
Buy Principal Token (PT) with market's Underlying Token.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await pendleBuyPt(
|
|
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
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pendleBuyYt } from "../../funcs/pendleBuyYt.js";
|
|
6
|
+
import * as components from "../../models/components/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: components.PendleBuyYtRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$pendleBuyYt: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "pendle-buy-yt",
|
|
15
|
+
description: `Buy Yield Token (YT)
|
|
16
|
+
|
|
17
|
+
Buy Yield Token (YT) with market's Underlying Token.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await pendleBuyYt(
|
|
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
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pendleSellPt } from "../../funcs/pendleSellPt.js";
|
|
6
|
+
import * as components from "../../models/components/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: components.PendleSellPtRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$pendleSellPt: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "pendle-sell-pt",
|
|
15
|
+
description: `Sell Princpal Token (PT)
|
|
16
|
+
|
|
17
|
+
Sell Principal Token (PT) for the market's Underlying Token.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await pendleSellPt(
|
|
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
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pendleSellYt } from "../../funcs/pendleSellYt.js";
|
|
6
|
+
import * as components from "../../models/components/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: components.PendleSellYtRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$pendleSellYt: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "pendle-sell-yt",
|
|
15
|
+
description: `Sell Yield Token (YT)
|
|
16
|
+
|
|
17
|
+
Sell Yield Token (YT) for the market's Underlying Token.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await pendleSellYt(
|
|
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
|
+
};
|