@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.
Files changed (201) hide show
  1. package/README.md +8 -0
  2. package/bin/mcp-server.js +1044 -308
  3. package/bin/mcp-server.js.map +25 -9
  4. package/dist/commonjs/funcs/pendleBuyPt.d.ts +17 -0
  5. package/dist/commonjs/funcs/pendleBuyPt.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/pendleBuyPt.js +118 -0
  7. package/dist/commonjs/funcs/pendleBuyPt.js.map +1 -0
  8. package/dist/commonjs/funcs/pendleBuyYt.d.ts +17 -0
  9. package/dist/commonjs/funcs/pendleBuyYt.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/pendleBuyYt.js +118 -0
  11. package/dist/commonjs/funcs/pendleBuyYt.js.map +1 -0
  12. package/dist/commonjs/funcs/pendleSellPt.d.ts +17 -0
  13. package/dist/commonjs/funcs/pendleSellPt.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/pendleSellPt.js +118 -0
  15. package/dist/commonjs/funcs/pendleSellPt.js.map +1 -0
  16. package/dist/commonjs/funcs/pendleSellYt.d.ts +17 -0
  17. package/dist/commonjs/funcs/pendleSellYt.d.ts.map +1 -0
  18. package/dist/commonjs/funcs/pendleSellYt.js +118 -0
  19. package/dist/commonjs/funcs/pendleSellYt.js.map +1 -0
  20. package/dist/commonjs/lib/config.d.ts +2 -2
  21. package/dist/commonjs/lib/config.js +2 -2
  22. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  23. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  24. package/dist/commonjs/mcp-server/server.js +9 -1
  25. package/dist/commonjs/mcp-server/server.js.map +1 -1
  26. package/dist/commonjs/mcp-server/tools/pendleBuyPt.d.ts +8 -0
  27. package/dist/commonjs/mcp-server/tools/pendleBuyPt.d.ts.map +1 -0
  28. package/dist/commonjs/mcp-server/tools/pendleBuyPt.js +64 -0
  29. package/dist/commonjs/mcp-server/tools/pendleBuyPt.js.map +1 -0
  30. package/dist/commonjs/mcp-server/tools/pendleBuyYt.d.ts +8 -0
  31. package/dist/commonjs/mcp-server/tools/pendleBuyYt.d.ts.map +1 -0
  32. package/dist/commonjs/mcp-server/tools/pendleBuyYt.js +64 -0
  33. package/dist/commonjs/mcp-server/tools/pendleBuyYt.js.map +1 -0
  34. package/dist/commonjs/mcp-server/tools/pendleSellPt.d.ts +8 -0
  35. package/dist/commonjs/mcp-server/tools/pendleSellPt.d.ts.map +1 -0
  36. package/dist/commonjs/mcp-server/tools/pendleSellPt.js +64 -0
  37. package/dist/commonjs/mcp-server/tools/pendleSellPt.js.map +1 -0
  38. package/dist/commonjs/mcp-server/tools/pendleSellYt.d.ts +8 -0
  39. package/dist/commonjs/mcp-server/tools/pendleSellYt.d.ts.map +1 -0
  40. package/dist/commonjs/mcp-server/tools/pendleSellYt.js +64 -0
  41. package/dist/commonjs/mcp-server/tools/pendleSellYt.js.map +1 -0
  42. package/dist/commonjs/models/components/index.d.ts +8 -0
  43. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  44. package/dist/commonjs/models/components/index.js +8 -0
  45. package/dist/commonjs/models/components/index.js.map +1 -1
  46. package/dist/commonjs/models/components/multicallactiontype.d.ts +12 -0
  47. package/dist/commonjs/models/components/multicallactiontype.d.ts.map +1 -1
  48. package/dist/commonjs/models/components/multicallactiontype.js +4 -0
  49. package/dist/commonjs/models/components/multicallactiontype.js.map +1 -1
  50. package/dist/commonjs/models/components/pendlebuyptparams.d.ts +61 -0
  51. package/dist/commonjs/models/components/pendlebuyptparams.d.ts.map +1 -0
  52. package/dist/commonjs/models/components/pendlebuyptparams.js +103 -0
  53. package/dist/commonjs/models/components/pendlebuyptparams.js.map +1 -0
  54. package/dist/commonjs/models/components/pendlebuyptrequest.d.ts +72 -0
  55. package/dist/commonjs/models/components/pendlebuyptrequest.d.ts.map +1 -0
  56. package/dist/commonjs/models/components/pendlebuyptrequest.js +108 -0
  57. package/dist/commonjs/models/components/pendlebuyptrequest.js.map +1 -0
  58. package/dist/commonjs/models/components/pendlebuyytparams.d.ts +61 -0
  59. package/dist/commonjs/models/components/pendlebuyytparams.d.ts.map +1 -0
  60. package/dist/commonjs/models/components/pendlebuyytparams.js +103 -0
  61. package/dist/commonjs/models/components/pendlebuyytparams.js.map +1 -0
  62. package/dist/commonjs/models/components/pendlebuyytrequest.d.ts +72 -0
  63. package/dist/commonjs/models/components/pendlebuyytrequest.d.ts.map +1 -0
  64. package/dist/commonjs/models/components/pendlebuyytrequest.js +108 -0
  65. package/dist/commonjs/models/components/pendlebuyytrequest.js.map +1 -0
  66. package/dist/commonjs/models/components/pendlesellptparams.d.ts +61 -0
  67. package/dist/commonjs/models/components/pendlesellptparams.d.ts.map +1 -0
  68. package/dist/commonjs/models/components/pendlesellptparams.js +103 -0
  69. package/dist/commonjs/models/components/pendlesellptparams.js.map +1 -0
  70. package/dist/commonjs/models/components/pendlesellptrequest.d.ts +72 -0
  71. package/dist/commonjs/models/components/pendlesellptrequest.d.ts.map +1 -0
  72. package/dist/commonjs/models/components/pendlesellptrequest.js +108 -0
  73. package/dist/commonjs/models/components/pendlesellptrequest.js.map +1 -0
  74. package/dist/commonjs/models/components/pendlesellytparams.d.ts +61 -0
  75. package/dist/commonjs/models/components/pendlesellytparams.d.ts.map +1 -0
  76. package/dist/commonjs/models/components/pendlesellytparams.js +103 -0
  77. package/dist/commonjs/models/components/pendlesellytparams.js.map +1 -0
  78. package/dist/commonjs/models/components/pendlesellytrequest.d.ts +72 -0
  79. package/dist/commonjs/models/components/pendlesellytrequest.d.ts.map +1 -0
  80. package/dist/commonjs/models/components/pendlesellytrequest.js +108 -0
  81. package/dist/commonjs/models/components/pendlesellytrequest.js.map +1 -0
  82. package/dist/commonjs/models/components/useroperation.d.ts +8 -4
  83. package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
  84. package/dist/commonjs/models/components/useroperation.js +20 -0
  85. package/dist/commonjs/models/components/useroperation.js.map +1 -1
  86. package/dist/commonjs/sdk/pendle.d.ts +28 -0
  87. package/dist/commonjs/sdk/pendle.d.ts.map +1 -1
  88. package/dist/commonjs/sdk/pendle.js +40 -0
  89. package/dist/commonjs/sdk/pendle.js.map +1 -1
  90. package/dist/esm/funcs/pendleBuyPt.d.ts +17 -0
  91. package/dist/esm/funcs/pendleBuyPt.d.ts.map +1 -0
  92. package/dist/esm/funcs/pendleBuyPt.js +82 -0
  93. package/dist/esm/funcs/pendleBuyPt.js.map +1 -0
  94. package/dist/esm/funcs/pendleBuyYt.d.ts +17 -0
  95. package/dist/esm/funcs/pendleBuyYt.d.ts.map +1 -0
  96. package/dist/esm/funcs/pendleBuyYt.js +82 -0
  97. package/dist/esm/funcs/pendleBuyYt.js.map +1 -0
  98. package/dist/esm/funcs/pendleSellPt.d.ts +17 -0
  99. package/dist/esm/funcs/pendleSellPt.d.ts.map +1 -0
  100. package/dist/esm/funcs/pendleSellPt.js +82 -0
  101. package/dist/esm/funcs/pendleSellPt.js.map +1 -0
  102. package/dist/esm/funcs/pendleSellYt.d.ts +17 -0
  103. package/dist/esm/funcs/pendleSellYt.d.ts.map +1 -0
  104. package/dist/esm/funcs/pendleSellYt.js +82 -0
  105. package/dist/esm/funcs/pendleSellYt.js.map +1 -0
  106. package/dist/esm/lib/config.d.ts +2 -2
  107. package/dist/esm/lib/config.js +2 -2
  108. package/dist/esm/mcp-server/mcp-server.js +1 -1
  109. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  110. package/dist/esm/mcp-server/server.js +9 -1
  111. package/dist/esm/mcp-server/server.js.map +1 -1
  112. package/dist/esm/mcp-server/tools/pendleBuyPt.d.ts +8 -0
  113. package/dist/esm/mcp-server/tools/pendleBuyPt.d.ts.map +1 -0
  114. package/dist/esm/mcp-server/tools/pendleBuyPt.js +28 -0
  115. package/dist/esm/mcp-server/tools/pendleBuyPt.js.map +1 -0
  116. package/dist/esm/mcp-server/tools/pendleBuyYt.d.ts +8 -0
  117. package/dist/esm/mcp-server/tools/pendleBuyYt.d.ts.map +1 -0
  118. package/dist/esm/mcp-server/tools/pendleBuyYt.js +28 -0
  119. package/dist/esm/mcp-server/tools/pendleBuyYt.js.map +1 -0
  120. package/dist/esm/mcp-server/tools/pendleSellPt.d.ts +8 -0
  121. package/dist/esm/mcp-server/tools/pendleSellPt.d.ts.map +1 -0
  122. package/dist/esm/mcp-server/tools/pendleSellPt.js +28 -0
  123. package/dist/esm/mcp-server/tools/pendleSellPt.js.map +1 -0
  124. package/dist/esm/mcp-server/tools/pendleSellYt.d.ts +8 -0
  125. package/dist/esm/mcp-server/tools/pendleSellYt.d.ts.map +1 -0
  126. package/dist/esm/mcp-server/tools/pendleSellYt.js +28 -0
  127. package/dist/esm/mcp-server/tools/pendleSellYt.js.map +1 -0
  128. package/dist/esm/models/components/index.d.ts +8 -0
  129. package/dist/esm/models/components/index.d.ts.map +1 -1
  130. package/dist/esm/models/components/index.js +8 -0
  131. package/dist/esm/models/components/index.js.map +1 -1
  132. package/dist/esm/models/components/multicallactiontype.d.ts +12 -0
  133. package/dist/esm/models/components/multicallactiontype.d.ts.map +1 -1
  134. package/dist/esm/models/components/multicallactiontype.js +4 -0
  135. package/dist/esm/models/components/multicallactiontype.js.map +1 -1
  136. package/dist/esm/models/components/pendlebuyptparams.d.ts +61 -0
  137. package/dist/esm/models/components/pendlebuyptparams.d.ts.map +1 -0
  138. package/dist/esm/models/components/pendlebuyptparams.js +63 -0
  139. package/dist/esm/models/components/pendlebuyptparams.js.map +1 -0
  140. package/dist/esm/models/components/pendlebuyptrequest.d.ts +72 -0
  141. package/dist/esm/models/components/pendlebuyptrequest.d.ts.map +1 -0
  142. package/dist/esm/models/components/pendlebuyptrequest.js +68 -0
  143. package/dist/esm/models/components/pendlebuyptrequest.js.map +1 -0
  144. package/dist/esm/models/components/pendlebuyytparams.d.ts +61 -0
  145. package/dist/esm/models/components/pendlebuyytparams.d.ts.map +1 -0
  146. package/dist/esm/models/components/pendlebuyytparams.js +63 -0
  147. package/dist/esm/models/components/pendlebuyytparams.js.map +1 -0
  148. package/dist/esm/models/components/pendlebuyytrequest.d.ts +72 -0
  149. package/dist/esm/models/components/pendlebuyytrequest.d.ts.map +1 -0
  150. package/dist/esm/models/components/pendlebuyytrequest.js +68 -0
  151. package/dist/esm/models/components/pendlebuyytrequest.js.map +1 -0
  152. package/dist/esm/models/components/pendlesellptparams.d.ts +61 -0
  153. package/dist/esm/models/components/pendlesellptparams.d.ts.map +1 -0
  154. package/dist/esm/models/components/pendlesellptparams.js +63 -0
  155. package/dist/esm/models/components/pendlesellptparams.js.map +1 -0
  156. package/dist/esm/models/components/pendlesellptrequest.d.ts +72 -0
  157. package/dist/esm/models/components/pendlesellptrequest.d.ts.map +1 -0
  158. package/dist/esm/models/components/pendlesellptrequest.js +68 -0
  159. package/dist/esm/models/components/pendlesellptrequest.js.map +1 -0
  160. package/dist/esm/models/components/pendlesellytparams.d.ts +61 -0
  161. package/dist/esm/models/components/pendlesellytparams.d.ts.map +1 -0
  162. package/dist/esm/models/components/pendlesellytparams.js +63 -0
  163. package/dist/esm/models/components/pendlesellytparams.js.map +1 -0
  164. package/dist/esm/models/components/pendlesellytrequest.d.ts +72 -0
  165. package/dist/esm/models/components/pendlesellytrequest.d.ts.map +1 -0
  166. package/dist/esm/models/components/pendlesellytrequest.js +68 -0
  167. package/dist/esm/models/components/pendlesellytrequest.js.map +1 -0
  168. package/dist/esm/models/components/useroperation.d.ts +8 -4
  169. package/dist/esm/models/components/useroperation.d.ts.map +1 -1
  170. package/dist/esm/models/components/useroperation.js +20 -0
  171. package/dist/esm/models/components/useroperation.js.map +1 -1
  172. package/dist/esm/sdk/pendle.d.ts +28 -0
  173. package/dist/esm/sdk/pendle.d.ts.map +1 -1
  174. package/dist/esm/sdk/pendle.js +40 -0
  175. package/dist/esm/sdk/pendle.js.map +1 -1
  176. package/docs/sdks/pendle/README.md +336 -0
  177. package/jsr.json +1 -1
  178. package/package.json +1 -1
  179. package/src/funcs/pendleBuyPt.ts +165 -0
  180. package/src/funcs/pendleBuyYt.ts +165 -0
  181. package/src/funcs/pendleSellPt.ts +165 -0
  182. package/src/funcs/pendleSellYt.ts +165 -0
  183. package/src/lib/config.ts +2 -2
  184. package/src/mcp-server/mcp-server.ts +1 -1
  185. package/src/mcp-server/server.ts +9 -1
  186. package/src/mcp-server/tools/pendleBuyPt.ts +37 -0
  187. package/src/mcp-server/tools/pendleBuyYt.ts +37 -0
  188. package/src/mcp-server/tools/pendleSellPt.ts +37 -0
  189. package/src/mcp-server/tools/pendleSellYt.ts +37 -0
  190. package/src/models/components/index.ts +8 -0
  191. package/src/models/components/multicallactiontype.ts +4 -0
  192. package/src/models/components/pendlebuyptparams.ts +138 -0
  193. package/src/models/components/pendlebuyptrequest.ts +153 -0
  194. package/src/models/components/pendlebuyytparams.ts +138 -0
  195. package/src/models/components/pendlebuyytrequest.ts +153 -0
  196. package/src/models/components/pendlesellptparams.ts +138 -0
  197. package/src/models/components/pendlesellptrequest.ts +153 -0
  198. package/src/models/components/pendlesellytparams.ts +138 -0
  199. package/src/models/components/pendlesellytrequest.ts +153 -0
  200. package/src/models/components/useroperation.ts +56 -0
  201. package/src/sdk/pendle.ts +72 -0
@@ -98,11 +98,19 @@ export * from "./multicallauthorizationrequest.js";
98
98
  export * from "./multicallauthorizationresponse.js";
99
99
  export * from "./multicallexecuterequest.js";
100
100
  export * from "./openposition.js";
101
+ export * from "./pendlebuyptparams.js";
102
+ export * from "./pendlebuyptrequest.js";
103
+ export * from "./pendlebuyytparams.js";
104
+ export * from "./pendlebuyytrequest.js";
101
105
  export * from "./pendlegetmarketresponse.js";
102
106
  export * from "./pendlegetuserpositionresponse.js";
103
107
  export * from "./pendlelistmarketsresponse.js";
104
108
  export * from "./pendlelistuserpositionsresponse.js";
105
109
  export * from "./pendlemarket.js";
110
+ export * from "./pendlesellptparams.js";
111
+ export * from "./pendlesellptrequest.js";
112
+ export * from "./pendlesellytparams.js";
113
+ export * from "./pendlesellytrequest.js";
106
114
  export * from "./portfolio.js";
107
115
  export * from "./position.js";
108
116
  export * from "./redeemunderlying.js";
@@ -25,6 +25,10 @@ export const MulticallActionType = {
25
25
  MorphoSupplyCollateral: "MORPHO_SUPPLY_COLLATERAL",
26
26
  MorphoWithdraw: "MORPHO_WITHDRAW",
27
27
  MorphoWithdrawCollateral: "MORPHO_WITHDRAW_COLLATERAL",
28
+ PendleBuyPt: "PENDLE_BUY_PT",
29
+ PendleBuyYt: "PENDLE_BUY_YT",
30
+ PendleSellPt: "PENDLE_SELL_PT",
31
+ PendleSellYt: "PENDLE_SELL_YT",
28
32
  SkyBuy: "SKY_BUY",
29
33
  SkyDeposit: "SKY_DEPOSIT",
30
34
  SkySell: "SKY_SELL",
@@ -0,0 +1,138 @@
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
+ * The amount of market's Underlying Token you would like to sell for market's Principal Token (PT).
13
+ */
14
+ export type PendleBuyPtParamsAmount = number | string;
15
+
16
+ export type PendleBuyPtParams = {
17
+ /**
18
+ * The address of the market identifying which Principal Token (PT) you would like to buy.
19
+ */
20
+ marketAddress: string;
21
+ /**
22
+ * The amount of market's Underlying Token you would like to sell for market's Principal Token (PT).
23
+ */
24
+ amount: number | string;
25
+ };
26
+
27
+ /** @internal */
28
+ export const PendleBuyPtParamsAmount$inboundSchema: z.ZodType<
29
+ PendleBuyPtParamsAmount,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.union([z.number(), z.string()]);
33
+
34
+ /** @internal */
35
+ export type PendleBuyPtParamsAmount$Outbound = number | string;
36
+
37
+ /** @internal */
38
+ export const PendleBuyPtParamsAmount$outboundSchema: z.ZodType<
39
+ PendleBuyPtParamsAmount$Outbound,
40
+ z.ZodTypeDef,
41
+ PendleBuyPtParamsAmount
42
+ > = z.union([z.number(), z.string()]);
43
+
44
+ /**
45
+ * @internal
46
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
+ */
48
+ export namespace PendleBuyPtParamsAmount$ {
49
+ /** @deprecated use `PendleBuyPtParamsAmount$inboundSchema` instead. */
50
+ export const inboundSchema = PendleBuyPtParamsAmount$inboundSchema;
51
+ /** @deprecated use `PendleBuyPtParamsAmount$outboundSchema` instead. */
52
+ export const outboundSchema = PendleBuyPtParamsAmount$outboundSchema;
53
+ /** @deprecated use `PendleBuyPtParamsAmount$Outbound` instead. */
54
+ export type Outbound = PendleBuyPtParamsAmount$Outbound;
55
+ }
56
+
57
+ export function pendleBuyPtParamsAmountToJSON(
58
+ pendleBuyPtParamsAmount: PendleBuyPtParamsAmount,
59
+ ): string {
60
+ return JSON.stringify(
61
+ PendleBuyPtParamsAmount$outboundSchema.parse(pendleBuyPtParamsAmount),
62
+ );
63
+ }
64
+
65
+ export function pendleBuyPtParamsAmountFromJSON(
66
+ jsonString: string,
67
+ ): SafeParseResult<PendleBuyPtParamsAmount, SDKValidationError> {
68
+ return safeParse(
69
+ jsonString,
70
+ (x) => PendleBuyPtParamsAmount$inboundSchema.parse(JSON.parse(x)),
71
+ `Failed to parse 'PendleBuyPtParamsAmount' from JSON`,
72
+ );
73
+ }
74
+
75
+ /** @internal */
76
+ export const PendleBuyPtParams$inboundSchema: z.ZodType<
77
+ PendleBuyPtParams,
78
+ z.ZodTypeDef,
79
+ unknown
80
+ > = z.object({
81
+ market_address: z.string(),
82
+ amount: z.union([z.number(), z.string()]),
83
+ }).transform((v) => {
84
+ return remap$(v, {
85
+ "market_address": "marketAddress",
86
+ });
87
+ });
88
+
89
+ /** @internal */
90
+ export type PendleBuyPtParams$Outbound = {
91
+ market_address: string;
92
+ amount: number | string;
93
+ };
94
+
95
+ /** @internal */
96
+ export const PendleBuyPtParams$outboundSchema: z.ZodType<
97
+ PendleBuyPtParams$Outbound,
98
+ z.ZodTypeDef,
99
+ PendleBuyPtParams
100
+ > = z.object({
101
+ marketAddress: z.string(),
102
+ amount: z.union([z.number(), z.string()]),
103
+ }).transform((v) => {
104
+ return remap$(v, {
105
+ marketAddress: "market_address",
106
+ });
107
+ });
108
+
109
+ /**
110
+ * @internal
111
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
112
+ */
113
+ export namespace PendleBuyPtParams$ {
114
+ /** @deprecated use `PendleBuyPtParams$inboundSchema` instead. */
115
+ export const inboundSchema = PendleBuyPtParams$inboundSchema;
116
+ /** @deprecated use `PendleBuyPtParams$outboundSchema` instead. */
117
+ export const outboundSchema = PendleBuyPtParams$outboundSchema;
118
+ /** @deprecated use `PendleBuyPtParams$Outbound` instead. */
119
+ export type Outbound = PendleBuyPtParams$Outbound;
120
+ }
121
+
122
+ export function pendleBuyPtParamsToJSON(
123
+ pendleBuyPtParams: PendleBuyPtParams,
124
+ ): string {
125
+ return JSON.stringify(
126
+ PendleBuyPtParams$outboundSchema.parse(pendleBuyPtParams),
127
+ );
128
+ }
129
+
130
+ export function pendleBuyPtParamsFromJSON(
131
+ jsonString: string,
132
+ ): SafeParseResult<PendleBuyPtParams, SDKValidationError> {
133
+ return safeParse(
134
+ jsonString,
135
+ (x) => PendleBuyPtParams$inboundSchema.parse(JSON.parse(x)),
136
+ `Failed to parse 'PendleBuyPtParams' from JSON`,
137
+ );
138
+ }
@@ -0,0 +1,153 @@
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
+ import { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
11
+
12
+ /**
13
+ * The amount of market's Underlying Token you would like to sell for market's Principal Token (PT).
14
+ */
15
+ export type PendleBuyPtRequestAmount = number | string;
16
+
17
+ export type PendleBuyPtRequest = {
18
+ /**
19
+ * The address of the market identifying which Principal Token (PT) you would like to buy.
20
+ */
21
+ marketAddress: string;
22
+ /**
23
+ * The amount of market's Underlying Token you would like to sell for market's Principal Token (PT).
24
+ */
25
+ amount: number | string;
26
+ /**
27
+ * The chain to use.
28
+ */
29
+ chain: Chain;
30
+ /**
31
+ * The address of the transaction sender.
32
+ */
33
+ sender: string;
34
+ };
35
+
36
+ /** @internal */
37
+ export const PendleBuyPtRequestAmount$inboundSchema: z.ZodType<
38
+ PendleBuyPtRequestAmount,
39
+ z.ZodTypeDef,
40
+ unknown
41
+ > = z.union([z.number(), z.string()]);
42
+
43
+ /** @internal */
44
+ export type PendleBuyPtRequestAmount$Outbound = number | string;
45
+
46
+ /** @internal */
47
+ export const PendleBuyPtRequestAmount$outboundSchema: z.ZodType<
48
+ PendleBuyPtRequestAmount$Outbound,
49
+ z.ZodTypeDef,
50
+ PendleBuyPtRequestAmount
51
+ > = z.union([z.number(), z.string()]);
52
+
53
+ /**
54
+ * @internal
55
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
+ */
57
+ export namespace PendleBuyPtRequestAmount$ {
58
+ /** @deprecated use `PendleBuyPtRequestAmount$inboundSchema` instead. */
59
+ export const inboundSchema = PendleBuyPtRequestAmount$inboundSchema;
60
+ /** @deprecated use `PendleBuyPtRequestAmount$outboundSchema` instead. */
61
+ export const outboundSchema = PendleBuyPtRequestAmount$outboundSchema;
62
+ /** @deprecated use `PendleBuyPtRequestAmount$Outbound` instead. */
63
+ export type Outbound = PendleBuyPtRequestAmount$Outbound;
64
+ }
65
+
66
+ export function pendleBuyPtRequestAmountToJSON(
67
+ pendleBuyPtRequestAmount: PendleBuyPtRequestAmount,
68
+ ): string {
69
+ return JSON.stringify(
70
+ PendleBuyPtRequestAmount$outboundSchema.parse(pendleBuyPtRequestAmount),
71
+ );
72
+ }
73
+
74
+ export function pendleBuyPtRequestAmountFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<PendleBuyPtRequestAmount, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => PendleBuyPtRequestAmount$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'PendleBuyPtRequestAmount' from JSON`,
81
+ );
82
+ }
83
+
84
+ /** @internal */
85
+ export const PendleBuyPtRequest$inboundSchema: z.ZodType<
86
+ PendleBuyPtRequest,
87
+ z.ZodTypeDef,
88
+ unknown
89
+ > = z.object({
90
+ market_address: z.string(),
91
+ amount: z.union([z.number(), z.string()]),
92
+ chain: Chain$inboundSchema,
93
+ sender: z.string(),
94
+ }).transform((v) => {
95
+ return remap$(v, {
96
+ "market_address": "marketAddress",
97
+ });
98
+ });
99
+
100
+ /** @internal */
101
+ export type PendleBuyPtRequest$Outbound = {
102
+ market_address: string;
103
+ amount: number | string;
104
+ chain: string;
105
+ sender: string;
106
+ };
107
+
108
+ /** @internal */
109
+ export const PendleBuyPtRequest$outboundSchema: z.ZodType<
110
+ PendleBuyPtRequest$Outbound,
111
+ z.ZodTypeDef,
112
+ PendleBuyPtRequest
113
+ > = z.object({
114
+ marketAddress: z.string(),
115
+ amount: z.union([z.number(), z.string()]),
116
+ chain: Chain$outboundSchema,
117
+ sender: z.string(),
118
+ }).transform((v) => {
119
+ return remap$(v, {
120
+ marketAddress: "market_address",
121
+ });
122
+ });
123
+
124
+ /**
125
+ * @internal
126
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
127
+ */
128
+ export namespace PendleBuyPtRequest$ {
129
+ /** @deprecated use `PendleBuyPtRequest$inboundSchema` instead. */
130
+ export const inboundSchema = PendleBuyPtRequest$inboundSchema;
131
+ /** @deprecated use `PendleBuyPtRequest$outboundSchema` instead. */
132
+ export const outboundSchema = PendleBuyPtRequest$outboundSchema;
133
+ /** @deprecated use `PendleBuyPtRequest$Outbound` instead. */
134
+ export type Outbound = PendleBuyPtRequest$Outbound;
135
+ }
136
+
137
+ export function pendleBuyPtRequestToJSON(
138
+ pendleBuyPtRequest: PendleBuyPtRequest,
139
+ ): string {
140
+ return JSON.stringify(
141
+ PendleBuyPtRequest$outboundSchema.parse(pendleBuyPtRequest),
142
+ );
143
+ }
144
+
145
+ export function pendleBuyPtRequestFromJSON(
146
+ jsonString: string,
147
+ ): SafeParseResult<PendleBuyPtRequest, SDKValidationError> {
148
+ return safeParse(
149
+ jsonString,
150
+ (x) => PendleBuyPtRequest$inboundSchema.parse(JSON.parse(x)),
151
+ `Failed to parse 'PendleBuyPtRequest' from JSON`,
152
+ );
153
+ }
@@ -0,0 +1,138 @@
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
+ * The amount of market's Underlying Token you would like to sell for market's Yield Token (YT).
13
+ */
14
+ export type PendleBuyYtParamsAmount = number | string;
15
+
16
+ export type PendleBuyYtParams = {
17
+ /**
18
+ * The address of the market identifying which Yield Token (YT) you would like to buy.
19
+ */
20
+ marketAddress: string;
21
+ /**
22
+ * The amount of market's Underlying Token you would like to sell for market's Yield Token (YT).
23
+ */
24
+ amount: number | string;
25
+ };
26
+
27
+ /** @internal */
28
+ export const PendleBuyYtParamsAmount$inboundSchema: z.ZodType<
29
+ PendleBuyYtParamsAmount,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.union([z.number(), z.string()]);
33
+
34
+ /** @internal */
35
+ export type PendleBuyYtParamsAmount$Outbound = number | string;
36
+
37
+ /** @internal */
38
+ export const PendleBuyYtParamsAmount$outboundSchema: z.ZodType<
39
+ PendleBuyYtParamsAmount$Outbound,
40
+ z.ZodTypeDef,
41
+ PendleBuyYtParamsAmount
42
+ > = z.union([z.number(), z.string()]);
43
+
44
+ /**
45
+ * @internal
46
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
+ */
48
+ export namespace PendleBuyYtParamsAmount$ {
49
+ /** @deprecated use `PendleBuyYtParamsAmount$inboundSchema` instead. */
50
+ export const inboundSchema = PendleBuyYtParamsAmount$inboundSchema;
51
+ /** @deprecated use `PendleBuyYtParamsAmount$outboundSchema` instead. */
52
+ export const outboundSchema = PendleBuyYtParamsAmount$outboundSchema;
53
+ /** @deprecated use `PendleBuyYtParamsAmount$Outbound` instead. */
54
+ export type Outbound = PendleBuyYtParamsAmount$Outbound;
55
+ }
56
+
57
+ export function pendleBuyYtParamsAmountToJSON(
58
+ pendleBuyYtParamsAmount: PendleBuyYtParamsAmount,
59
+ ): string {
60
+ return JSON.stringify(
61
+ PendleBuyYtParamsAmount$outboundSchema.parse(pendleBuyYtParamsAmount),
62
+ );
63
+ }
64
+
65
+ export function pendleBuyYtParamsAmountFromJSON(
66
+ jsonString: string,
67
+ ): SafeParseResult<PendleBuyYtParamsAmount, SDKValidationError> {
68
+ return safeParse(
69
+ jsonString,
70
+ (x) => PendleBuyYtParamsAmount$inboundSchema.parse(JSON.parse(x)),
71
+ `Failed to parse 'PendleBuyYtParamsAmount' from JSON`,
72
+ );
73
+ }
74
+
75
+ /** @internal */
76
+ export const PendleBuyYtParams$inboundSchema: z.ZodType<
77
+ PendleBuyYtParams,
78
+ z.ZodTypeDef,
79
+ unknown
80
+ > = z.object({
81
+ market_address: z.string(),
82
+ amount: z.union([z.number(), z.string()]),
83
+ }).transform((v) => {
84
+ return remap$(v, {
85
+ "market_address": "marketAddress",
86
+ });
87
+ });
88
+
89
+ /** @internal */
90
+ export type PendleBuyYtParams$Outbound = {
91
+ market_address: string;
92
+ amount: number | string;
93
+ };
94
+
95
+ /** @internal */
96
+ export const PendleBuyYtParams$outboundSchema: z.ZodType<
97
+ PendleBuyYtParams$Outbound,
98
+ z.ZodTypeDef,
99
+ PendleBuyYtParams
100
+ > = z.object({
101
+ marketAddress: z.string(),
102
+ amount: z.union([z.number(), z.string()]),
103
+ }).transform((v) => {
104
+ return remap$(v, {
105
+ marketAddress: "market_address",
106
+ });
107
+ });
108
+
109
+ /**
110
+ * @internal
111
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
112
+ */
113
+ export namespace PendleBuyYtParams$ {
114
+ /** @deprecated use `PendleBuyYtParams$inboundSchema` instead. */
115
+ export const inboundSchema = PendleBuyYtParams$inboundSchema;
116
+ /** @deprecated use `PendleBuyYtParams$outboundSchema` instead. */
117
+ export const outboundSchema = PendleBuyYtParams$outboundSchema;
118
+ /** @deprecated use `PendleBuyYtParams$Outbound` instead. */
119
+ export type Outbound = PendleBuyYtParams$Outbound;
120
+ }
121
+
122
+ export function pendleBuyYtParamsToJSON(
123
+ pendleBuyYtParams: PendleBuyYtParams,
124
+ ): string {
125
+ return JSON.stringify(
126
+ PendleBuyYtParams$outboundSchema.parse(pendleBuyYtParams),
127
+ );
128
+ }
129
+
130
+ export function pendleBuyYtParamsFromJSON(
131
+ jsonString: string,
132
+ ): SafeParseResult<PendleBuyYtParams, SDKValidationError> {
133
+ return safeParse(
134
+ jsonString,
135
+ (x) => PendleBuyYtParams$inboundSchema.parse(JSON.parse(x)),
136
+ `Failed to parse 'PendleBuyYtParams' from JSON`,
137
+ );
138
+ }
@@ -0,0 +1,153 @@
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
+ import { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
11
+
12
+ /**
13
+ * The amount of market's Underlying Token you would like to sell for market's Yield Token (YT).
14
+ */
15
+ export type PendleBuyYtRequestAmount = number | string;
16
+
17
+ export type PendleBuyYtRequest = {
18
+ /**
19
+ * The address of the market identifying which Yield Token (YT) you would like to buy.
20
+ */
21
+ marketAddress: string;
22
+ /**
23
+ * The amount of market's Underlying Token you would like to sell for market's Yield Token (YT).
24
+ */
25
+ amount: number | string;
26
+ /**
27
+ * The chain to use.
28
+ */
29
+ chain: Chain;
30
+ /**
31
+ * The address of the transaction sender.
32
+ */
33
+ sender: string;
34
+ };
35
+
36
+ /** @internal */
37
+ export const PendleBuyYtRequestAmount$inboundSchema: z.ZodType<
38
+ PendleBuyYtRequestAmount,
39
+ z.ZodTypeDef,
40
+ unknown
41
+ > = z.union([z.number(), z.string()]);
42
+
43
+ /** @internal */
44
+ export type PendleBuyYtRequestAmount$Outbound = number | string;
45
+
46
+ /** @internal */
47
+ export const PendleBuyYtRequestAmount$outboundSchema: z.ZodType<
48
+ PendleBuyYtRequestAmount$Outbound,
49
+ z.ZodTypeDef,
50
+ PendleBuyYtRequestAmount
51
+ > = z.union([z.number(), z.string()]);
52
+
53
+ /**
54
+ * @internal
55
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
+ */
57
+ export namespace PendleBuyYtRequestAmount$ {
58
+ /** @deprecated use `PendleBuyYtRequestAmount$inboundSchema` instead. */
59
+ export const inboundSchema = PendleBuyYtRequestAmount$inboundSchema;
60
+ /** @deprecated use `PendleBuyYtRequestAmount$outboundSchema` instead. */
61
+ export const outboundSchema = PendleBuyYtRequestAmount$outboundSchema;
62
+ /** @deprecated use `PendleBuyYtRequestAmount$Outbound` instead. */
63
+ export type Outbound = PendleBuyYtRequestAmount$Outbound;
64
+ }
65
+
66
+ export function pendleBuyYtRequestAmountToJSON(
67
+ pendleBuyYtRequestAmount: PendleBuyYtRequestAmount,
68
+ ): string {
69
+ return JSON.stringify(
70
+ PendleBuyYtRequestAmount$outboundSchema.parse(pendleBuyYtRequestAmount),
71
+ );
72
+ }
73
+
74
+ export function pendleBuyYtRequestAmountFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<PendleBuyYtRequestAmount, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => PendleBuyYtRequestAmount$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'PendleBuyYtRequestAmount' from JSON`,
81
+ );
82
+ }
83
+
84
+ /** @internal */
85
+ export const PendleBuyYtRequest$inboundSchema: z.ZodType<
86
+ PendleBuyYtRequest,
87
+ z.ZodTypeDef,
88
+ unknown
89
+ > = z.object({
90
+ market_address: z.string(),
91
+ amount: z.union([z.number(), z.string()]),
92
+ chain: Chain$inboundSchema,
93
+ sender: z.string(),
94
+ }).transform((v) => {
95
+ return remap$(v, {
96
+ "market_address": "marketAddress",
97
+ });
98
+ });
99
+
100
+ /** @internal */
101
+ export type PendleBuyYtRequest$Outbound = {
102
+ market_address: string;
103
+ amount: number | string;
104
+ chain: string;
105
+ sender: string;
106
+ };
107
+
108
+ /** @internal */
109
+ export const PendleBuyYtRequest$outboundSchema: z.ZodType<
110
+ PendleBuyYtRequest$Outbound,
111
+ z.ZodTypeDef,
112
+ PendleBuyYtRequest
113
+ > = z.object({
114
+ marketAddress: z.string(),
115
+ amount: z.union([z.number(), z.string()]),
116
+ chain: Chain$outboundSchema,
117
+ sender: z.string(),
118
+ }).transform((v) => {
119
+ return remap$(v, {
120
+ marketAddress: "market_address",
121
+ });
122
+ });
123
+
124
+ /**
125
+ * @internal
126
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
127
+ */
128
+ export namespace PendleBuyYtRequest$ {
129
+ /** @deprecated use `PendleBuyYtRequest$inboundSchema` instead. */
130
+ export const inboundSchema = PendleBuyYtRequest$inboundSchema;
131
+ /** @deprecated use `PendleBuyYtRequest$outboundSchema` instead. */
132
+ export const outboundSchema = PendleBuyYtRequest$outboundSchema;
133
+ /** @deprecated use `PendleBuyYtRequest$Outbound` instead. */
134
+ export type Outbound = PendleBuyYtRequest$Outbound;
135
+ }
136
+
137
+ export function pendleBuyYtRequestToJSON(
138
+ pendleBuyYtRequest: PendleBuyYtRequest,
139
+ ): string {
140
+ return JSON.stringify(
141
+ PendleBuyYtRequest$outboundSchema.parse(pendleBuyYtRequest),
142
+ );
143
+ }
144
+
145
+ export function pendleBuyYtRequestFromJSON(
146
+ jsonString: string,
147
+ ): SafeParseResult<PendleBuyYtRequest, SDKValidationError> {
148
+ return safeParse(
149
+ jsonString,
150
+ (x) => PendleBuyYtRequest$inboundSchema.parse(JSON.parse(x)),
151
+ `Failed to parse 'PendleBuyYtRequest' from JSON`,
152
+ );
153
+ }