@compass-labs/api-sdk 0.5.39 → 0.5.41

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.
Files changed (95) hide show
  1. package/README.md +2 -0
  2. package/bin/mcp-server.js +467 -253
  3. package/bin/mcp-server.js.map +13 -9
  4. package/dist/commonjs/funcs/pendleQuote.d.ts +24 -0
  5. package/dist/commonjs/funcs/pendleQuote.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/pendleQuote.js +132 -0
  7. package/dist/commonjs/funcs/pendleQuote.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/server.js +3 -1
  13. package/dist/commonjs/mcp-server/server.js.map +1 -1
  14. package/dist/commonjs/mcp-server/tools/pendleQuote.d.ts +8 -0
  15. package/dist/commonjs/mcp-server/tools/pendleQuote.d.ts.map +1 -0
  16. package/dist/commonjs/mcp-server/tools/pendleQuote.js +69 -0
  17. package/dist/commonjs/mcp-server/tools/pendleQuote.js.map +1 -0
  18. package/dist/commonjs/models/components/index.d.ts +1 -0
  19. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/index.js +1 -0
  21. package/dist/commonjs/models/components/index.js.map +1 -1
  22. package/dist/commonjs/models/components/pendlegetquoteresponse.d.ts +32 -0
  23. package/dist/commonjs/models/components/pendlegetquoteresponse.d.ts.map +1 -0
  24. package/dist/commonjs/models/components/pendlegetquoteresponse.js +69 -0
  25. package/dist/commonjs/models/components/pendlegetquoteresponse.js.map +1 -0
  26. package/dist/commonjs/models/components/vaultgetvaultresponse.d.ts +2 -2
  27. package/dist/commonjs/models/components/vaultgetvaultresponse.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/vaultgetvaultresponse.js +2 -2
  29. package/dist/commonjs/models/components/vaultgetvaultresponse.js.map +1 -1
  30. package/dist/commonjs/models/operations/index.d.ts +1 -0
  31. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  32. package/dist/commonjs/models/operations/index.js +1 -0
  33. package/dist/commonjs/models/operations/index.js.map +1 -1
  34. package/dist/commonjs/models/operations/pendlequote.d.ts +181 -0
  35. package/dist/commonjs/models/operations/pendlequote.d.ts.map +1 -0
  36. package/dist/commonjs/models/operations/pendlequote.js +186 -0
  37. package/dist/commonjs/models/operations/pendlequote.js.map +1 -0
  38. package/dist/commonjs/sdk/pendle.d.ts +12 -0
  39. package/dist/commonjs/sdk/pendle.d.ts.map +1 -1
  40. package/dist/commonjs/sdk/pendle.js +15 -0
  41. package/dist/commonjs/sdk/pendle.js.map +1 -1
  42. package/dist/esm/funcs/pendleQuote.d.ts +24 -0
  43. package/dist/esm/funcs/pendleQuote.d.ts.map +1 -0
  44. package/dist/esm/funcs/pendleQuote.js +96 -0
  45. package/dist/esm/funcs/pendleQuote.js.map +1 -0
  46. package/dist/esm/lib/config.d.ts +3 -3
  47. package/dist/esm/lib/config.js +3 -3
  48. package/dist/esm/mcp-server/mcp-server.js +1 -1
  49. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  50. package/dist/esm/mcp-server/server.js +3 -1
  51. package/dist/esm/mcp-server/server.js.map +1 -1
  52. package/dist/esm/mcp-server/tools/pendleQuote.d.ts +8 -0
  53. package/dist/esm/mcp-server/tools/pendleQuote.d.ts.map +1 -0
  54. package/dist/esm/mcp-server/tools/pendleQuote.js +33 -0
  55. package/dist/esm/mcp-server/tools/pendleQuote.js.map +1 -0
  56. package/dist/esm/models/components/index.d.ts +1 -0
  57. package/dist/esm/models/components/index.d.ts.map +1 -1
  58. package/dist/esm/models/components/index.js +1 -0
  59. package/dist/esm/models/components/index.js.map +1 -1
  60. package/dist/esm/models/components/pendlegetquoteresponse.d.ts +32 -0
  61. package/dist/esm/models/components/pendlegetquoteresponse.d.ts.map +1 -0
  62. package/dist/esm/models/components/pendlegetquoteresponse.js +31 -0
  63. package/dist/esm/models/components/pendlegetquoteresponse.js.map +1 -0
  64. package/dist/esm/models/components/vaultgetvaultresponse.d.ts +2 -2
  65. package/dist/esm/models/components/vaultgetvaultresponse.d.ts.map +1 -1
  66. package/dist/esm/models/components/vaultgetvaultresponse.js +2 -2
  67. package/dist/esm/models/components/vaultgetvaultresponse.js.map +1 -1
  68. package/dist/esm/models/operations/index.d.ts +1 -0
  69. package/dist/esm/models/operations/index.d.ts.map +1 -1
  70. package/dist/esm/models/operations/index.js +1 -0
  71. package/dist/esm/models/operations/index.js.map +1 -1
  72. package/dist/esm/models/operations/pendlequote.d.ts +181 -0
  73. package/dist/esm/models/operations/pendlequote.d.ts.map +1 -0
  74. package/dist/esm/models/operations/pendlequote.js +146 -0
  75. package/dist/esm/models/operations/pendlequote.js.map +1 -0
  76. package/dist/esm/sdk/pendle.d.ts +12 -0
  77. package/dist/esm/sdk/pendle.d.ts.map +1 -1
  78. package/dist/esm/sdk/pendle.js +15 -0
  79. package/dist/esm/sdk/pendle.js.map +1 -1
  80. package/docs/sdks/pendle/README.md +79 -0
  81. package/docs/sdks/smartaccount/README.md +2 -0
  82. package/docs/sdks/transactionbundler/README.md +2 -0
  83. package/jsr.json +1 -1
  84. package/package.json +3 -3
  85. package/src/funcs/pendleQuote.ts +184 -0
  86. package/src/lib/config.ts +3 -3
  87. package/src/mcp-server/mcp-server.ts +1 -1
  88. package/src/mcp-server/server.ts +3 -1
  89. package/src/mcp-server/tools/pendleQuote.ts +42 -0
  90. package/src/models/components/index.ts +1 -0
  91. package/src/models/components/pendlegetquoteresponse.ts +69 -0
  92. package/src/models/components/vaultgetvaultresponse.ts +4 -4
  93. package/src/models/operations/index.ts +1 -0
  94. package/src/models/operations/pendlequote.ts +265 -0
  95. package/src/sdk/pendle.ts +23 -0
@@ -0,0 +1,146 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod";
5
+ import { remap as remap$ } from "../../lib/primitives.js";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ /**
8
+ * The chain to use.
9
+ */
10
+ export const PendleQuoteChain = {
11
+ BaseMainnet: "base:mainnet",
12
+ EthereumMainnet: "ethereum:mainnet",
13
+ ArbitrumMainnet: "arbitrum:mainnet",
14
+ };
15
+ /**
16
+ * Specifies the token to quote (`PT`, `YT`, or `LP`)
17
+ */
18
+ export const TokenType = {
19
+ Pt: "PT",
20
+ Yt: "YT",
21
+ Lp: "LP",
22
+ };
23
+ /**
24
+ * Specifies the trade direction (`BUY` or `SELL`)
25
+ */
26
+ export const TradeType = {
27
+ Buy: "BUY",
28
+ Sell: "SELL",
29
+ };
30
+ /** @internal */
31
+ export const PendleQuoteChain$inboundSchema = z.nativeEnum(PendleQuoteChain);
32
+ /** @internal */
33
+ export const PendleQuoteChain$outboundSchema = PendleQuoteChain$inboundSchema;
34
+ /**
35
+ * @internal
36
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
37
+ */
38
+ export var PendleQuoteChain$;
39
+ (function (PendleQuoteChain$) {
40
+ /** @deprecated use `PendleQuoteChain$inboundSchema` instead. */
41
+ PendleQuoteChain$.inboundSchema = PendleQuoteChain$inboundSchema;
42
+ /** @deprecated use `PendleQuoteChain$outboundSchema` instead. */
43
+ PendleQuoteChain$.outboundSchema = PendleQuoteChain$outboundSchema;
44
+ })(PendleQuoteChain$ || (PendleQuoteChain$ = {}));
45
+ /** @internal */
46
+ export const Amount$inboundSchema = z
47
+ .union([z.number(), z.string()]);
48
+ /** @internal */
49
+ export const Amount$outboundSchema = z.union([z.number(), z.string()]);
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export var Amount$;
55
+ (function (Amount$) {
56
+ /** @deprecated use `Amount$inboundSchema` instead. */
57
+ Amount$.inboundSchema = Amount$inboundSchema;
58
+ /** @deprecated use `Amount$outboundSchema` instead. */
59
+ Amount$.outboundSchema = Amount$outboundSchema;
60
+ })(Amount$ || (Amount$ = {}));
61
+ export function amountToJSON(amount) {
62
+ return JSON.stringify(Amount$outboundSchema.parse(amount));
63
+ }
64
+ export function amountFromJSON(jsonString) {
65
+ return safeParse(jsonString, (x) => Amount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Amount' from JSON`);
66
+ }
67
+ /** @internal */
68
+ export const TokenType$inboundSchema = z
69
+ .nativeEnum(TokenType);
70
+ /** @internal */
71
+ export const TokenType$outboundSchema = TokenType$inboundSchema;
72
+ /**
73
+ * @internal
74
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
75
+ */
76
+ export var TokenType$;
77
+ (function (TokenType$) {
78
+ /** @deprecated use `TokenType$inboundSchema` instead. */
79
+ TokenType$.inboundSchema = TokenType$inboundSchema;
80
+ /** @deprecated use `TokenType$outboundSchema` instead. */
81
+ TokenType$.outboundSchema = TokenType$outboundSchema;
82
+ })(TokenType$ || (TokenType$ = {}));
83
+ /** @internal */
84
+ export const TradeType$inboundSchema = z
85
+ .nativeEnum(TradeType);
86
+ /** @internal */
87
+ export const TradeType$outboundSchema = TradeType$inboundSchema;
88
+ /**
89
+ * @internal
90
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
91
+ */
92
+ export var TradeType$;
93
+ (function (TradeType$) {
94
+ /** @deprecated use `TradeType$inboundSchema` instead. */
95
+ TradeType$.inboundSchema = TradeType$inboundSchema;
96
+ /** @deprecated use `TradeType$outboundSchema` instead. */
97
+ TradeType$.outboundSchema = TradeType$outboundSchema;
98
+ })(TradeType$ || (TradeType$ = {}));
99
+ /** @internal */
100
+ export const PendleQuoteRequest$inboundSchema = z.object({
101
+ chain: PendleQuoteChain$inboundSchema.default("arbitrum:mainnet"),
102
+ block: z.nullable(z.number().int()).optional(),
103
+ market_address: z.string().default("0x46d62a8dede1bf2d0de04f2ed863245cbba5e538"),
104
+ amount: z.union([z.number(), z.string()]),
105
+ token_type: TokenType$inboundSchema.default("PT"),
106
+ trade_type: TradeType$inboundSchema.default("BUY"),
107
+ }).transform((v) => {
108
+ return remap$(v, {
109
+ "market_address": "marketAddress",
110
+ "token_type": "tokenType",
111
+ "trade_type": "tradeType",
112
+ });
113
+ });
114
+ /** @internal */
115
+ export const PendleQuoteRequest$outboundSchema = z.object({
116
+ chain: PendleQuoteChain$outboundSchema.default("arbitrum:mainnet"),
117
+ block: z.nullable(z.number().int()).optional(),
118
+ marketAddress: z.string().default("0x46d62a8dede1bf2d0de04f2ed863245cbba5e538"),
119
+ amount: z.union([z.number(), z.string()]),
120
+ tokenType: TokenType$outboundSchema.default("PT"),
121
+ tradeType: TradeType$outboundSchema.default("BUY"),
122
+ }).transform((v) => {
123
+ return remap$(v, {
124
+ marketAddress: "market_address",
125
+ tokenType: "token_type",
126
+ tradeType: "trade_type",
127
+ });
128
+ });
129
+ /**
130
+ * @internal
131
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
132
+ */
133
+ export var PendleQuoteRequest$;
134
+ (function (PendleQuoteRequest$) {
135
+ /** @deprecated use `PendleQuoteRequest$inboundSchema` instead. */
136
+ PendleQuoteRequest$.inboundSchema = PendleQuoteRequest$inboundSchema;
137
+ /** @deprecated use `PendleQuoteRequest$outboundSchema` instead. */
138
+ PendleQuoteRequest$.outboundSchema = PendleQuoteRequest$outboundSchema;
139
+ })(PendleQuoteRequest$ || (PendleQuoteRequest$ = {}));
140
+ export function pendleQuoteRequestToJSON(pendleQuoteRequest) {
141
+ return JSON.stringify(PendleQuoteRequest$outboundSchema.parse(pendleQuoteRequest));
142
+ }
143
+ export function pendleQuoteRequestFromJSON(jsonString) {
144
+ return safeParse(jsonString, (x) => PendleQuoteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PendleQuoteRequest' from JSON`);
145
+ }
146
+ //# sourceMappingURL=pendlequote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendlequote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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC,IAAI,CAAC;IACjD,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC,KAAK,CAAC;CACnD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,aAAa,EAAE,gBAAgB;QAC/B,SAAS,EAAE,YAAY;QACvB,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,KAAW,mBAAmB,CAOnC;AAPD,WAAiB,mBAAmB;IAClC,kEAAkE;IACrD,iCAAa,GAAG,gCAAgC,CAAC;IAC9D,mEAAmE;IACtD,kCAAc,GAAG,iCAAiC,CAAC;AAGlE,CAAC,EAPgB,mBAAmB,KAAnB,mBAAmB,QAOnC;AAED,MAAM,UAAU,wBAAwB,CACtC,kBAAsC;IAEtC,OAAO,IAAI,CAAC,SAAS,CACnB,iCAAiC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC5D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC5D,gDAAgD,CACjD,CAAC;AACJ,CAAC"}
@@ -30,6 +30,18 @@ export declare class Pendle extends ClientSDK {
30
30
  * Get a list of active markets.
31
31
  */
32
32
  markets(request: operations.PendleMarketsRequest, options?: RequestOptions): Promise<components.PendleListMarketsResponse>;
33
+ /**
34
+ * Get Quote
35
+ *
36
+ * @remarks
37
+ * Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
38
+ * Provider Token (LP) on Pendle.
39
+ *
40
+ * For `BUY`, `amount` is the quantity of the Underlying Token to spend, and the quote returns the amount of `token_type` received.
41
+ *
42
+ * For `SELL`, `amount` is the quantity of `token_type` to sell, and the quote returns the amount of Underlying Token received.
43
+ */
44
+ quote(request: operations.PendleQuoteRequest, options?: RequestOptions): Promise<components.PendleGetQuoteResponse>;
33
45
  /**
34
46
  * Buy Principal Token (PT)
35
47
  *
@@ -1 +1 @@
1
- {"version":3,"file":"pendle.d.ts","sourceRoot":"","sources":["../../../src/sdk/pendle.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,MAAO,SAAQ,SAAS;IACnC;;;;;OAKG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAQpD;;;;;OAKG;IACG,SAAS,CACb,OAAO,EAAE,UAAU,CAAC,sBAAsB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,+BAA+B,CAAC;IAQtD;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAQ9C;;;;;OAKG;IACG,OAAO,CACX,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAQhD;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC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O,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;IAQjC;;;;;;;;OAQG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,yBAAyB,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;IAQjC;;;;;;;;;OASG;IACG,eAAe,CACnB,OAAO,EAAE,UAAU,CAAC,4BAA4B,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;CAOlC"}
@@ -8,6 +8,7 @@ import { pendleMarket } from "../funcs/pendleMarket.js";
8
8
  import { pendleMarkets } from "../funcs/pendleMarkets.js";
9
9
  import { pendlePosition } from "../funcs/pendlePosition.js";
10
10
  import { pendlePositions } from "../funcs/pendlePositions.js";
11
+ import { pendleQuote } from "../funcs/pendleQuote.js";
11
12
  import { pendleRedeemYield } from "../funcs/pendleRedeemYield.js";
12
13
  import { pendleRemoveLiquidity } from "../funcs/pendleRemoveLiquidity.js";
13
14
  import { pendleSellPt } from "../funcs/pendleSellPt.js";
@@ -51,6 +52,20 @@ export class Pendle extends ClientSDK {
51
52
  async markets(request, options) {
52
53
  return unwrapAsync(pendleMarkets(this, request, options));
53
54
  }
55
+ /**
56
+ * Get Quote
57
+ *
58
+ * @remarks
59
+ * Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
60
+ * Provider Token (LP) on Pendle.
61
+ *
62
+ * For `BUY`, `amount` is the quantity of the Underlying Token to spend, and the quote returns the amount of `token_type` received.
63
+ *
64
+ * For `SELL`, `amount` is the quantity of `token_type` to sell, and the quote returns the amount of Underlying Token received.
65
+ */
66
+ async quote(request, options) {
67
+ return unwrapAsync(pendleQuote(this, request, options));
68
+ }
54
69
  /**
55
70
  * Buy Principal Token (PT)
56
71
  *
@@ -1 +1 @@
1
- {"version":3,"file":"pendle.js","sourceRoot":"","sources":["../../../src/sdk/pendle.ts"],"names":[],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ED;;;;;;;;OAQG;IACH,KAAK,CAAC,YAAY,CAChB,OAA6C,EAC7C,OAAwB;QAExB,OAAO,WAAW,CAAC,kBAAkB,CACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,eAAe,CACnB,OAAgD,EAChD,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -9,6 +9,7 @@
9
9
  * [positions](#positions) - List User's Market Positions
10
10
  * [market](#market) - Get Market Data
11
11
  * [markets](#markets) - List Market Data
12
+ * [quote](#quote) - Get Quote
12
13
  * [buyPt](#buypt) - Buy Principal Token (PT)
13
14
  * [sellPt](#sellpt) - Sell Principal Token (PT)
14
15
  * [buyYt](#buyyt) - Buy Yield Token (YT)
@@ -293,6 +294,84 @@ run();
293
294
  | errors.HTTPValidationError | 422 | application/json |
294
295
  | errors.APIError | 4XX, 5XX | \*/\* |
295
296
 
297
+ ## quote
298
+
299
+ Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
300
+ Provider Token (LP) on Pendle.
301
+
302
+ For `BUY`, `amount` is the quantity of the Underlying Token to spend, and the quote returns the amount of `token_type` received.
303
+
304
+ For `SELL`, `amount` is the quantity of `token_type` to sell, and the quote returns the amount of Underlying Token received.
305
+
306
+ ### Example Usage
307
+
308
+ ```typescript
309
+ import { CompassApiSDK } from "@compass-labs/api-sdk";
310
+
311
+ const compassApiSDK = new CompassApiSDK({
312
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
313
+ });
314
+
315
+ async function run() {
316
+ const result = await compassApiSDK.pendle.quote({
317
+ amount: "82.33",
318
+ });
319
+
320
+ console.log(result);
321
+ }
322
+
323
+ run();
324
+ ```
325
+
326
+ ### Standalone function
327
+
328
+ The standalone function version of this method:
329
+
330
+ ```typescript
331
+ import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
332
+ import { pendleQuote } from "@compass-labs/api-sdk/funcs/pendleQuote.js";
333
+
334
+ // Use `CompassApiSDKCore` for best tree-shaking performance.
335
+ // You can create one instance of it to use across an application.
336
+ const compassApiSDK = new CompassApiSDKCore({
337
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
338
+ });
339
+
340
+ async function run() {
341
+ const res = await pendleQuote(compassApiSDK, {
342
+ amount: "82.33",
343
+ });
344
+ if (res.ok) {
345
+ const { value: result } = res;
346
+ console.log(result);
347
+ } else {
348
+ console.log("pendleQuote failed:", res.error);
349
+ }
350
+ }
351
+
352
+ run();
353
+ ```
354
+
355
+ ### Parameters
356
+
357
+ | Parameter | Type | Required | Description |
358
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
359
+ | `request` | [operations.PendleQuoteRequest](../../models/operations/pendlequoterequest.md) | :heavy_check_mark: | The request object to use for the request. |
360
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
361
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
362
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
363
+
364
+ ### Response
365
+
366
+ **Promise\<[components.PendleGetQuoteResponse](../../models/components/pendlegetquoteresponse.md)\>**
367
+
368
+ ### Errors
369
+
370
+ | Error Type | Status Code | Content Type |
371
+ | -------------------------- | -------------------------- | -------------------------- |
372
+ | errors.HTTPValidationError | 422 | application/json |
373
+ | errors.APIError | 4XX, 5XX | \*/\* |
374
+
296
375
  ## buyPt
297
376
 
298
377
  Buy Principal Token (PT) with market's Underlying Token.
@@ -27,6 +27,7 @@ async function run() {
27
27
  operations: [
28
28
  {
29
29
  body: {
30
+ actionType: "SET_ALLOWANCE",
30
31
  token: "WETH",
31
32
  contract: "UniswapV3Router",
32
33
  amount: "1000",
@@ -62,6 +63,7 @@ async function run() {
62
63
  operations: [
63
64
  {
64
65
  body: {
66
+ actionType: "SET_ALLOWANCE",
65
67
  token: "WETH",
66
68
  contract: "UniswapV3Router",
67
69
  amount: "1000",
@@ -123,6 +123,7 @@ async function run() {
123
123
  actions: [
124
124
  {
125
125
  body: {
126
+ actionType: "SET_ALLOWANCE",
126
127
  token: "WETH",
127
128
  contract: "UniswapV3Router",
128
129
  amount: "1000",
@@ -166,6 +167,7 @@ async function run() {
166
167
  actions: [
167
168
  {
168
169
  body: {
170
+ actionType: "SET_ALLOWANCE",
169
171
  token: "WETH",
170
172
  contract: "UniswapV3Router",
171
173
  amount: "1000",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@compass-labs/api-sdk",
5
- "version": "0.5.39",
5
+ "version": "0.5.41",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "0.5.39",
3
+ "version": "0.5.41",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,8 +47,8 @@
47
47
  "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0",
48
48
  "@stricli/core": "^1.1.1",
49
49
  "@types/express": "^4.17.21",
50
- "bun": "^1.2.2",
51
- "bun-types": "^1.2.2",
50
+ "bun": "1.2.17",
51
+ "bun-types": "1.2.17",
52
52
  "eslint": "^9.19.0",
53
53
  "express": "^4.21.2",
54
54
  "globals": "^15.14.0",
@@ -0,0 +1,184 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CompassApiSDKCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get Quote
31
+ *
32
+ * @remarks
33
+ * Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
34
+ * Provider Token (LP) on Pendle.
35
+ *
36
+ * For `BUY`, `amount` is the quantity of the Underlying Token to spend, and the quote returns the amount of `token_type` received.
37
+ *
38
+ * For `SELL`, `amount` is the quantity of `token_type` to sell, and the quote returns the amount of Underlying Token received.
39
+ */
40
+ export function pendleQuote(
41
+ client: CompassApiSDKCore,
42
+ request: operations.PendleQuoteRequest,
43
+ options?: RequestOptions,
44
+ ): APIPromise<
45
+ Result<
46
+ components.PendleGetQuoteResponse,
47
+ | errors.HTTPValidationError
48
+ | CompassAPISDKError
49
+ | ResponseValidationError
50
+ | ConnectionError
51
+ | RequestAbortedError
52
+ | RequestTimeoutError
53
+ | InvalidRequestError
54
+ | UnexpectedClientError
55
+ | SDKValidationError
56
+ >
57
+ > {
58
+ return new APIPromise($do(
59
+ client,
60
+ request,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: CompassApiSDKCore,
67
+ request: operations.PendleQuoteRequest,
68
+ options?: RequestOptions,
69
+ ): Promise<
70
+ [
71
+ Result<
72
+ components.PendleGetQuoteResponse,
73
+ | errors.HTTPValidationError
74
+ | CompassAPISDKError
75
+ | ResponseValidationError
76
+ | ConnectionError
77
+ | RequestAbortedError
78
+ | RequestTimeoutError
79
+ | InvalidRequestError
80
+ | UnexpectedClientError
81
+ | SDKValidationError
82
+ >,
83
+ APICall,
84
+ ]
85
+ > {
86
+ const parsed = safeParse(
87
+ request,
88
+ (value) => operations.PendleQuoteRequest$outboundSchema.parse(value),
89
+ "Input validation failed",
90
+ );
91
+ if (!parsed.ok) {
92
+ return [parsed, { status: "invalid" }];
93
+ }
94
+ const payload = parsed.value;
95
+ const body = null;
96
+
97
+ const path = pathToFunc("/v0/pendle/quote")();
98
+
99
+ const query = encodeFormQuery({
100
+ "amount": payload.amount,
101
+ "block": payload.block,
102
+ "chain": payload.chain,
103
+ "market_address": payload.market_address,
104
+ "token_type": payload.token_type,
105
+ "trade_type": payload.trade_type,
106
+ });
107
+
108
+ const headers = new Headers(compactMap({
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
113
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
114
+ const requestSecurity = resolveGlobalSecurity(securityInput);
115
+
116
+ const context = {
117
+ options: client._options,
118
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
119
+ operationID: "pendle_quote",
120
+ oAuth2Scopes: [],
121
+
122
+ resolvedSecurity: requestSecurity,
123
+
124
+ securitySource: client._options.apiKeyAuth,
125
+ retryConfig: options?.retries
126
+ || client._options.retryConfig
127
+ || { strategy: "none" },
128
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
+ };
130
+
131
+ const requestRes = client._createRequest(context, {
132
+ security: requestSecurity,
133
+ method: "GET",
134
+ baseURL: options?.serverURL,
135
+ path: path,
136
+ headers: headers,
137
+ query: query,
138
+ body: body,
139
+ userAgent: client._options.userAgent,
140
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
141
+ }, options);
142
+ if (!requestRes.ok) {
143
+ return [requestRes, { status: "invalid" }];
144
+ }
145
+ const req = requestRes.value;
146
+
147
+ const doResult = await client._do(req, {
148
+ context,
149
+ errorCodes: ["422", "4XX", "5XX"],
150
+ retryConfig: context.retryConfig,
151
+ retryCodes: context.retryCodes,
152
+ });
153
+ if (!doResult.ok) {
154
+ return [doResult, { status: "request-error", request: req }];
155
+ }
156
+ const response = doResult.value;
157
+
158
+ const responseFields = {
159
+ HttpMeta: { Response: response, Request: req },
160
+ };
161
+
162
+ const [result] = await M.match<
163
+ components.PendleGetQuoteResponse,
164
+ | errors.HTTPValidationError
165
+ | CompassAPISDKError
166
+ | ResponseValidationError
167
+ | ConnectionError
168
+ | RequestAbortedError
169
+ | RequestTimeoutError
170
+ | InvalidRequestError
171
+ | UnexpectedClientError
172
+ | SDKValidationError
173
+ >(
174
+ M.json(200, components.PendleGetQuoteResponse$inboundSchema),
175
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
176
+ M.fail("4XX"),
177
+ M.fail("5XX"),
178
+ )(response, req, { extraFields: responseFields });
179
+ if (!result.ok) {
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
182
+
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
package/src/lib/config.ts CHANGED
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
  export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
- sdkVersion: "0.5.39",
65
- genVersion: "2.648.1",
64
+ sdkVersion: "0.5.41",
65
+ genVersion: "2.648.7",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 0.5.39 2.648.1 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 0.5.41 2.648.7 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.5.39",
22
+ currentVersion: "0.5.41",
23
23
  },
24
24
  });
25
25
 
@@ -55,6 +55,7 @@ import { tool$pendleMarket } from "./tools/pendleMarket.js";
55
55
  import { tool$pendleMarkets } from "./tools/pendleMarkets.js";
56
56
  import { tool$pendlePosition } from "./tools/pendlePosition.js";
57
57
  import { tool$pendlePositions } from "./tools/pendlePositions.js";
58
+ import { tool$pendleQuote } from "./tools/pendleQuote.js";
58
59
  import { tool$pendleRedeemYield } from "./tools/pendleRedeemYield.js";
59
60
  import { tool$pendleRemoveLiquidity } from "./tools/pendleRemoveLiquidity.js";
60
61
  import { tool$pendleSellPt } from "./tools/pendleSellPt.js";
@@ -101,7 +102,7 @@ export function createMCPServer(deps: {
101
102
  }) {
102
103
  const server = new McpServer({
103
104
  name: "CompassApiSDK",
104
- version: "0.5.39",
105
+ version: "0.5.41",
105
106
  });
106
107
 
107
108
  const client = new CompassApiSDKCore({
@@ -194,6 +195,7 @@ export function createMCPServer(deps: {
194
195
  tool(tool$pendlePositions);
195
196
  tool(tool$pendleMarket);
196
197
  tool(tool$pendleMarkets);
198
+ tool(tool$pendleQuote);
197
199
  tool(tool$pendleBuyPt);
198
200
  tool(tool$pendleSellPt);
199
201
  tool(tool$pendleBuyYt);
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { pendleQuote } from "../../funcs/pendleQuote.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.PendleQuoteRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$pendleQuote: ToolDefinition<typeof args> = {
14
+ name: "pendle-quote",
15
+ description: `Get Quote
16
+
17
+ Retrieve a quote for trading Principal Token (PT), Yield Token (YT), or Liquidity
18
+ Provider Token (LP) on Pendle.
19
+
20
+ For \`BUY\`, \`amount\` is the quantity of the Underlying Token to spend, and the quote returns the amount of \`token_type\` received.
21
+
22
+ For \`SELL\`, \`amount\` is the quantity of \`token_type\` to sell, and the quote returns the amount of Underlying Token received.`,
23
+ args,
24
+ tool: async (client, args, ctx) => {
25
+ const [result, apiCall] = await pendleQuote(
26
+ client,
27
+ args.request,
28
+ { fetchOptions: { signal: ctx.signal } },
29
+ ).$inspect();
30
+
31
+ if (!result.ok) {
32
+ return {
33
+ content: [{ type: "text", text: result.error.message }],
34
+ isError: true,
35
+ };
36
+ }
37
+
38
+ const value = result.value;
39
+
40
+ return formatResult(value, apiCall);
41
+ },
42
+ };