@compass-labs/api-sdk 0.1.4 → 0.1.6
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 +5 -0
- package/bin/mcp-server.js +441 -260
- package/bin/mcp-server.js.map +15 -11
- package/dist/commonjs/funcs/pendleAccruedInterest.d.ts +15 -0
- package/dist/commonjs/funcs/pendleAccruedInterest.d.ts.map +1 -0
- package/dist/commonjs/funcs/pendleAccruedInterest.js +119 -0
- package/dist/commonjs/funcs/pendleAccruedInterest.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- 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/pendleAccruedInterest.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/pendleAccruedInterest.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/pendleAccruedInterest.js +62 -0
- package/dist/commonjs/mcp-server/tools/pendleAccruedInterest.js.map +1 -0
- package/dist/commonjs/models/components/contractname.d.ts +6 -0
- package/dist/commonjs/models/components/contractname.d.ts.map +1 -1
- package/dist/commonjs/models/components/contractname.js +2 -0
- package/dist/commonjs/models/components/contractname.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/pendleaccruedinterestresponse.d.ts +32 -0
- package/dist/commonjs/models/components/pendleaccruedinterestresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/pendleaccruedinterestresponse.js +78 -0
- package/dist/commonjs/models/components/pendleaccruedinterestresponse.js.map +1 -0
- package/dist/commonjs/models/components/txresponse.d.ts +3 -2
- package/dist/commonjs/models/components/txresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/txresponse.js +3 -0
- package/dist/commonjs/models/components/txresponse.js.map +1 -1
- 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/pendleaccruedinterest.d.ts +77 -0
- package/dist/commonjs/models/operations/pendleaccruedinterest.d.ts.map +1 -0
- package/dist/commonjs/models/operations/pendleaccruedinterest.js +107 -0
- package/dist/commonjs/models/operations/pendleaccruedinterest.js.map +1 -0
- package/dist/commonjs/sdk/pendle.d.ts +10 -0
- package/dist/commonjs/sdk/pendle.d.ts.map +1 -0
- package/dist/commonjs/sdk/pendle.js +19 -0
- package/dist/commonjs/sdk/pendle.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/pendleAccruedInterest.d.ts +15 -0
- package/dist/esm/funcs/pendleAccruedInterest.d.ts.map +1 -0
- package/dist/esm/funcs/pendleAccruedInterest.js +83 -0
- package/dist/esm/funcs/pendleAccruedInterest.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- 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/pendleAccruedInterest.d.ts +8 -0
- package/dist/esm/mcp-server/tools/pendleAccruedInterest.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/pendleAccruedInterest.js +26 -0
- package/dist/esm/mcp-server/tools/pendleAccruedInterest.js.map +1 -0
- package/dist/esm/models/components/contractname.d.ts +6 -0
- package/dist/esm/models/components/contractname.d.ts.map +1 -1
- package/dist/esm/models/components/contractname.js +2 -0
- package/dist/esm/models/components/contractname.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/pendleaccruedinterestresponse.d.ts +32 -0
- package/dist/esm/models/components/pendleaccruedinterestresponse.d.ts.map +1 -0
- package/dist/esm/models/components/pendleaccruedinterestresponse.js +40 -0
- package/dist/esm/models/components/pendleaccruedinterestresponse.js.map +1 -0
- package/dist/esm/models/components/txresponse.d.ts +3 -2
- package/dist/esm/models/components/txresponse.d.ts.map +1 -1
- package/dist/esm/models/components/txresponse.js +3 -0
- package/dist/esm/models/components/txresponse.js.map +1 -1
- 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/pendleaccruedinterest.d.ts +77 -0
- package/dist/esm/models/operations/pendleaccruedinterest.d.ts.map +1 -0
- package/dist/esm/models/operations/pendleaccruedinterest.js +69 -0
- package/dist/esm/models/operations/pendleaccruedinterest.js.map +1 -0
- package/dist/esm/sdk/pendle.d.ts +10 -0
- package/dist/esm/sdk/pendle.d.ts.map +1 -0
- package/dist/esm/sdk/pendle.js +15 -0
- package/dist/esm/sdk/pendle.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/pendle/README.md +89 -0
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/pendleAccruedInterest.ts +168 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/pendleAccruedInterest.ts +35 -0
- package/src/models/components/contractname.ts +2 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/pendleaccruedinterestresponse.ts +80 -0
- package/src/models/components/txresponse.ts +14 -2
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/pendleaccruedinterest.ts +139 -0
- package/src/sdk/pendle.ts +25 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,168 @@
|
|
|
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 { 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 * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get Accrued Interest
|
|
30
|
+
*/
|
|
31
|
+
export function pendleAccruedInterest(
|
|
32
|
+
client: CompassApiSDKCore,
|
|
33
|
+
request: operations.PendleAccruedInterestRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
components.PendleAccruedInterestResponse,
|
|
38
|
+
| errors.HTTPValidationError
|
|
39
|
+
| APIError
|
|
40
|
+
| SDKValidationError
|
|
41
|
+
| UnexpectedClientError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: CompassApiSDKCore,
|
|
57
|
+
request: operations.PendleAccruedInterestRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
components.PendleAccruedInterestResponse,
|
|
63
|
+
| errors.HTTPValidationError
|
|
64
|
+
| APIError
|
|
65
|
+
| SDKValidationError
|
|
66
|
+
| UnexpectedClientError
|
|
67
|
+
| InvalidRequestError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const parsed = safeParse(
|
|
76
|
+
request,
|
|
77
|
+
(value) =>
|
|
78
|
+
operations.PendleAccruedInterestRequest$outboundSchema.parse(value),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = null;
|
|
86
|
+
|
|
87
|
+
const path = pathToFunc("/v0/pendle/accrued_interest")();
|
|
88
|
+
|
|
89
|
+
const query = encodeFormQuery({
|
|
90
|
+
"chain": payload.chain,
|
|
91
|
+
"market_address": payload.market_address,
|
|
92
|
+
"user_address": payload.user_address,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
Accept: "application/json",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
100
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "pendle_accrued_interest",
|
|
106
|
+
oAuth2Scopes: [],
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.apiKeyAuth,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "GET",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
query: query,
|
|
124
|
+
body: body,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const responseFields = {
|
|
144
|
+
HttpMeta: { Response: response, Request: req },
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const [result] = await M.match<
|
|
148
|
+
components.PendleAccruedInterestResponse,
|
|
149
|
+
| errors.HTTPValidationError
|
|
150
|
+
| APIError
|
|
151
|
+
| SDKValidationError
|
|
152
|
+
| UnexpectedClientError
|
|
153
|
+
| InvalidRequestError
|
|
154
|
+
| RequestAbortedError
|
|
155
|
+
| RequestTimeoutError
|
|
156
|
+
| ConnectionError
|
|
157
|
+
>(
|
|
158
|
+
M.json(200, components.PendleAccruedInterestResponse$inboundSchema),
|
|
159
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
160
|
+
M.fail("4XX"),
|
|
161
|
+
M.fail("5XX"),
|
|
162
|
+
)(response, { extraFields: responseFields });
|
|
163
|
+
if (!result.ok) {
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
57
57
|
export const SDK_METADATA = {
|
|
58
58
|
language: "typescript",
|
|
59
59
|
openapiDocVersion: "0.0.1",
|
|
60
|
-
sdkVersion: "0.1.
|
|
61
|
-
genVersion: "2.
|
|
60
|
+
sdkVersion: "0.1.6",
|
|
61
|
+
genVersion: "2.610.0",
|
|
62
62
|
userAgent:
|
|
63
|
-
"speakeasy-sdk/typescript 0.1.
|
|
63
|
+
"speakeasy-sdk/typescript 0.1.6 2.610.0 0.0.1 @compass-labs/api-sdk",
|
|
64
64
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -47,6 +47,7 @@ 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$pendleAccruedInterest } from "./tools/pendleAccruedInterest.js";
|
|
50
51
|
import { tool$skyBuy } from "./tools/skyBuy.js";
|
|
51
52
|
import { tool$skyDeposit } from "./tools/skyDeposit.js";
|
|
52
53
|
import { tool$skyPosition } from "./tools/skyPosition.js";
|
|
@@ -89,7 +90,7 @@ export function createMCPServer(deps: {
|
|
|
89
90
|
}) {
|
|
90
91
|
const server = new McpServer({
|
|
91
92
|
name: "CompassApiSDK",
|
|
92
|
-
version: "0.1.
|
|
93
|
+
version: "0.1.6",
|
|
93
94
|
});
|
|
94
95
|
|
|
95
96
|
const client = new CompassApiSDKCore({
|
|
@@ -184,6 +185,7 @@ export function createMCPServer(deps: {
|
|
|
184
185
|
tool(tool$transactionBatchingExecute);
|
|
185
186
|
tool(tool$transactionBatchingAaveLoop);
|
|
186
187
|
tool(tool$smartAccountAccountBatchedUserOperations);
|
|
188
|
+
tool(tool$pendleAccruedInterest);
|
|
187
189
|
|
|
188
190
|
return server;
|
|
189
191
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pendleAccruedInterest } from "../../funcs/pendleAccruedInterest.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.PendleAccruedInterestRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$pendleAccruedInterest: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "pendle-accrued-interest",
|
|
15
|
+
description: `Get Accrued Interest`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await pendleAccruedInterest(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -36,6 +36,8 @@ export const ContractName = {
|
|
|
36
36
|
SkyDaiUsdsConverter: "SkyDaiUsdsConverter",
|
|
37
37
|
SkyUsdcUsdsConverter: "SkyUsdcUsdsConverter",
|
|
38
38
|
SkyUsdsVault: "SkyUsdsVault",
|
|
39
|
+
PendleYt: "PendleYt",
|
|
40
|
+
PendleMarket: "PendleMarket",
|
|
39
41
|
Multicall: "Multicall",
|
|
40
42
|
} as const;
|
|
41
43
|
/**
|
|
@@ -93,6 +93,7 @@ export * from "./multicallactiontype.js";
|
|
|
93
93
|
export * from "./multicallauthorizationrequest.js";
|
|
94
94
|
export * from "./multicallauthorizationresponse.js";
|
|
95
95
|
export * from "./multicallexecuterequest.js";
|
|
96
|
+
export * from "./pendleaccruedinterestresponse.js";
|
|
96
97
|
export * from "./portfolio.js";
|
|
97
98
|
export * from "./redeemunderlying.js";
|
|
98
99
|
export * from "./repay.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* Response model for accrued interest.
|
|
13
|
+
*/
|
|
14
|
+
export type PendleAccruedInterestResponse = {
|
|
15
|
+
accruedInterest: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const PendleAccruedInterestResponse$inboundSchema: z.ZodType<
|
|
20
|
+
PendleAccruedInterestResponse,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
accrued_interest: z.number().int(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"accrued_interest": "accruedInterest",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type PendleAccruedInterestResponse$Outbound = {
|
|
33
|
+
accrued_interest: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const PendleAccruedInterestResponse$outboundSchema: z.ZodType<
|
|
38
|
+
PendleAccruedInterestResponse$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
PendleAccruedInterestResponse
|
|
41
|
+
> = z.object({
|
|
42
|
+
accruedInterest: z.number().int(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
accruedInterest: "accrued_interest",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace PendleAccruedInterestResponse$ {
|
|
54
|
+
/** @deprecated use `PendleAccruedInterestResponse$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = PendleAccruedInterestResponse$inboundSchema;
|
|
56
|
+
/** @deprecated use `PendleAccruedInterestResponse$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = PendleAccruedInterestResponse$outboundSchema;
|
|
58
|
+
/** @deprecated use `PendleAccruedInterestResponse$Outbound` instead. */
|
|
59
|
+
export type Outbound = PendleAccruedInterestResponse$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function pendleAccruedInterestResponseToJSON(
|
|
63
|
+
pendleAccruedInterestResponse: PendleAccruedInterestResponse,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
PendleAccruedInterestResponse$outboundSchema.parse(
|
|
67
|
+
pendleAccruedInterestResponse,
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function pendleAccruedInterestResponseFromJSON(
|
|
73
|
+
jsonString: string,
|
|
74
|
+
): SafeParseResult<PendleAccruedInterestResponse, SDKValidationError> {
|
|
75
|
+
return safeParse(
|
|
76
|
+
jsonString,
|
|
77
|
+
(x) => PendleAccruedInterestResponse$inboundSchema.parse(JSON.parse(x)),
|
|
78
|
+
`Failed to parse 'PendleAccruedInterestResponse' from JSON`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -6,6 +6,12 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
UnsignedMulticallTransaction,
|
|
11
|
+
UnsignedMulticallTransaction$inboundSchema,
|
|
12
|
+
UnsignedMulticallTransaction$Outbound,
|
|
13
|
+
UnsignedMulticallTransaction$outboundSchema,
|
|
14
|
+
} from "./unsignedmulticalltransaction.js";
|
|
9
15
|
import {
|
|
10
16
|
UnsignedTransaction,
|
|
11
17
|
UnsignedTransaction$inboundSchema,
|
|
@@ -19,7 +25,10 @@ import {
|
|
|
19
25
|
UserOperationResponse$outboundSchema,
|
|
20
26
|
} from "./useroperationresponse.js";
|
|
21
27
|
|
|
22
|
-
export type TxResponse =
|
|
28
|
+
export type TxResponse =
|
|
29
|
+
| UserOperationResponse
|
|
30
|
+
| UnsignedTransaction
|
|
31
|
+
| UnsignedMulticallTransaction;
|
|
23
32
|
|
|
24
33
|
/** @internal */
|
|
25
34
|
export const TxResponse$inboundSchema: z.ZodType<
|
|
@@ -29,12 +38,14 @@ export const TxResponse$inboundSchema: z.ZodType<
|
|
|
29
38
|
> = z.union([
|
|
30
39
|
UserOperationResponse$inboundSchema,
|
|
31
40
|
UnsignedTransaction$inboundSchema,
|
|
41
|
+
UnsignedMulticallTransaction$inboundSchema,
|
|
32
42
|
]);
|
|
33
43
|
|
|
34
44
|
/** @internal */
|
|
35
45
|
export type TxResponse$Outbound =
|
|
36
46
|
| UserOperationResponse$Outbound
|
|
37
|
-
| UnsignedTransaction$Outbound
|
|
47
|
+
| UnsignedTransaction$Outbound
|
|
48
|
+
| UnsignedMulticallTransaction$Outbound;
|
|
38
49
|
|
|
39
50
|
/** @internal */
|
|
40
51
|
export const TxResponse$outboundSchema: z.ZodType<
|
|
@@ -44,6 +55,7 @@ export const TxResponse$outboundSchema: z.ZodType<
|
|
|
44
55
|
> = z.union([
|
|
45
56
|
UserOperationResponse$outboundSchema,
|
|
46
57
|
UnsignedTransaction$outboundSchema,
|
|
58
|
+
UnsignedMulticallTransaction$outboundSchema,
|
|
47
59
|
]);
|
|
48
60
|
|
|
49
61
|
/**
|
|
@@ -25,6 +25,7 @@ export * from "./morphouserposition.js";
|
|
|
25
25
|
export * from "./morphovault.js";
|
|
26
26
|
export * from "./morphovaultposition.js";
|
|
27
27
|
export * from "./morphovaults.js";
|
|
28
|
+
export * from "./pendleaccruedinterest.js";
|
|
28
29
|
export * from "./skyposition.js";
|
|
29
30
|
export * from "./tokenaddress.js";
|
|
30
31
|
export * from "./tokenbalance.js";
|
|
@@ -0,0 +1,139 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The chain to use.
|
|
14
|
+
*/
|
|
15
|
+
export const PendleAccruedInterestChain = {
|
|
16
|
+
BaseMainnet: "base:mainnet",
|
|
17
|
+
EthereumMainnet: "ethereum:mainnet",
|
|
18
|
+
ArbitrumMainnet: "arbitrum:mainnet",
|
|
19
|
+
} as const;
|
|
20
|
+
/**
|
|
21
|
+
* The chain to use.
|
|
22
|
+
*/
|
|
23
|
+
export type PendleAccruedInterestChain = ClosedEnum<
|
|
24
|
+
typeof PendleAccruedInterestChain
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
export type PendleAccruedInterestRequest = {
|
|
28
|
+
/**
|
|
29
|
+
* The chain to use.
|
|
30
|
+
*/
|
|
31
|
+
chain?: PendleAccruedInterestChain | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The address of the market to get the accrued interest for.
|
|
34
|
+
*/
|
|
35
|
+
marketAddress?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The address of the user to get the accrued interest for.
|
|
38
|
+
*/
|
|
39
|
+
userAddress?: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const PendleAccruedInterestChain$inboundSchema: z.ZodNativeEnum<
|
|
44
|
+
typeof PendleAccruedInterestChain
|
|
45
|
+
> = z.nativeEnum(PendleAccruedInterestChain);
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const PendleAccruedInterestChain$outboundSchema: z.ZodNativeEnum<
|
|
49
|
+
typeof PendleAccruedInterestChain
|
|
50
|
+
> = PendleAccruedInterestChain$inboundSchema;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
|
+
*/
|
|
56
|
+
export namespace PendleAccruedInterestChain$ {
|
|
57
|
+
/** @deprecated use `PendleAccruedInterestChain$inboundSchema` instead. */
|
|
58
|
+
export const inboundSchema = PendleAccruedInterestChain$inboundSchema;
|
|
59
|
+
/** @deprecated use `PendleAccruedInterestChain$outboundSchema` instead. */
|
|
60
|
+
export const outboundSchema = PendleAccruedInterestChain$outboundSchema;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const PendleAccruedInterestRequest$inboundSchema: z.ZodType<
|
|
65
|
+
PendleAccruedInterestRequest,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
unknown
|
|
68
|
+
> = z.object({
|
|
69
|
+
chain: PendleAccruedInterestChain$inboundSchema.default("arbitrum:mainnet"),
|
|
70
|
+
market_address: z.string().default(
|
|
71
|
+
"0xff4d6991658c5844856faef5da9232c252896fca",
|
|
72
|
+
),
|
|
73
|
+
user_address: z.string().default(
|
|
74
|
+
"0xebdddbafc3fc3742fe2a3cfec17a20a50e84d598",
|
|
75
|
+
),
|
|
76
|
+
}).transform((v) => {
|
|
77
|
+
return remap$(v, {
|
|
78
|
+
"market_address": "marketAddress",
|
|
79
|
+
"user_address": "userAddress",
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export type PendleAccruedInterestRequest$Outbound = {
|
|
85
|
+
chain: string;
|
|
86
|
+
market_address: string;
|
|
87
|
+
user_address: string;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const PendleAccruedInterestRequest$outboundSchema: z.ZodType<
|
|
92
|
+
PendleAccruedInterestRequest$Outbound,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
PendleAccruedInterestRequest
|
|
95
|
+
> = z.object({
|
|
96
|
+
chain: PendleAccruedInterestChain$outboundSchema.default("arbitrum:mainnet"),
|
|
97
|
+
marketAddress: z.string().default(
|
|
98
|
+
"0xff4d6991658c5844856faef5da9232c252896fca",
|
|
99
|
+
),
|
|
100
|
+
userAddress: z.string().default("0xebdddbafc3fc3742fe2a3cfec17a20a50e84d598"),
|
|
101
|
+
}).transform((v) => {
|
|
102
|
+
return remap$(v, {
|
|
103
|
+
marketAddress: "market_address",
|
|
104
|
+
userAddress: "user_address",
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
111
|
+
*/
|
|
112
|
+
export namespace PendleAccruedInterestRequest$ {
|
|
113
|
+
/** @deprecated use `PendleAccruedInterestRequest$inboundSchema` instead. */
|
|
114
|
+
export const inboundSchema = PendleAccruedInterestRequest$inboundSchema;
|
|
115
|
+
/** @deprecated use `PendleAccruedInterestRequest$outboundSchema` instead. */
|
|
116
|
+
export const outboundSchema = PendleAccruedInterestRequest$outboundSchema;
|
|
117
|
+
/** @deprecated use `PendleAccruedInterestRequest$Outbound` instead. */
|
|
118
|
+
export type Outbound = PendleAccruedInterestRequest$Outbound;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function pendleAccruedInterestRequestToJSON(
|
|
122
|
+
pendleAccruedInterestRequest: PendleAccruedInterestRequest,
|
|
123
|
+
): string {
|
|
124
|
+
return JSON.stringify(
|
|
125
|
+
PendleAccruedInterestRequest$outboundSchema.parse(
|
|
126
|
+
pendleAccruedInterestRequest,
|
|
127
|
+
),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function pendleAccruedInterestRequestFromJSON(
|
|
132
|
+
jsonString: string,
|
|
133
|
+
): SafeParseResult<PendleAccruedInterestRequest, SDKValidationError> {
|
|
134
|
+
return safeParse(
|
|
135
|
+
jsonString,
|
|
136
|
+
(x) => PendleAccruedInterestRequest$inboundSchema.parse(JSON.parse(x)),
|
|
137
|
+
`Failed to parse 'PendleAccruedInterestRequest' from JSON`,
|
|
138
|
+
);
|
|
139
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pendleAccruedInterest } from "../funcs/pendleAccruedInterest.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as components from "../models/components/index.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Pendle extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* Get Accrued Interest
|
|
14
|
+
*/
|
|
15
|
+
async accruedInterest(
|
|
16
|
+
request: operations.PendleAccruedInterestRequest,
|
|
17
|
+
options?: RequestOptions,
|
|
18
|
+
): Promise<components.PendleAccruedInterestResponse> {
|
|
19
|
+
return unwrapAsync(pendleAccruedInterest(
|
|
20
|
+
this,
|
|
21
|
+
request,
|
|
22
|
+
options,
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { ClientSDK } from "../lib/sdks.js";
|
|
|
6
6
|
import { AaveV3 } from "./aavev3.js";
|
|
7
7
|
import { AerodromeSlipstream } from "./aerodromeslipstream.js";
|
|
8
8
|
import { Morpho } from "./morpho.js";
|
|
9
|
+
import { Pendle } from "./pendle.js";
|
|
9
10
|
import { Sky } from "./sky.js";
|
|
10
11
|
import { SmartAccount } from "./smartaccount.js";
|
|
11
12
|
import { Token } from "./token.js";
|
|
@@ -62,4 +63,9 @@ export class CompassApiSDK extends ClientSDK {
|
|
|
62
63
|
get smartAccount(): SmartAccount {
|
|
63
64
|
return (this._smartAccount ??= new SmartAccount(this._options));
|
|
64
65
|
}
|
|
66
|
+
|
|
67
|
+
private _pendle?: Pendle;
|
|
68
|
+
get pendle(): Pendle {
|
|
69
|
+
return (this._pendle ??= new Pendle(this._options));
|
|
70
|
+
}
|
|
65
71
|
}
|