@polymarket/client 0.1.0-beta.0 → 0.1.0-beta.10

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.
@@ -1,5 +1,5 @@
1
1
  import { OrderResponse } from '@polymarket/bindings/clob';
2
- import { aI as RateLimitError, aK as RequestRejectedError, b2 as SigningError, b9 as TransportError, bc as UnexpectedResponseError, U as UserInputError, a6 as InsufficientLiquidityError, h as BaseSecureClient, d9 as PrepareLimitOrderRequest, c_ as OrderWorkflow, cZ as OrderPostingWorkflow, db as PrepareMarketOrderRequest, m as CancelledSigningError, aA as PostOrderError, b4 as TimeoutError, b5 as TransactionFailedError, dx as SignedOrder, B as BaseClient } from './types-D7tLX0ye.js';
2
+ import { aR as RateLimitError, aT as RequestRejectedError, bz as SigningError, bG as TransportError, bJ as UnexpectedResponseError, U as UserInputError, a9 as InsufficientLiquidityError, h as BaseSecureClient, eD as PrepareLimitOrderRequest, eb as OrderWorkflow, ea as OrderPostingWorkflow, eF as PrepareMarketOrderRequest, m as CancelledSigningError, aI as PostOrderError, bB as TimeoutError, bC as TransactionFailedError, fi as SignedOrder, B as BaseClient } from './types-M1U0um0G.js';
3
3
  import { SportsMarketTypesResponse, SportsMetadata } from '@polymarket/bindings/gamma';
4
4
 
5
5
  type PrepareMarketOrderError = InsufficientLiquidityError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
@@ -10,7 +10,7 @@ declare const PrepareMarketOrderError: {
10
10
  * Starts the market-order workflow.
11
11
  *
12
12
  * @remarks
13
- * This is a low-level action that most SDK consumers will not need.
13
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
14
14
  *
15
15
  * @throws {@link PrepareMarketOrderError}
16
16
  * Thrown on failure.
@@ -19,6 +19,7 @@ declare const PrepareMarketOrderError: {
19
19
  * ```ts
20
20
  * const workflow = await prepareMarketOrder(client, {
21
21
  * amount: 10,
22
+ * maxPrice: '0.55',
22
23
  * side: OrderSide.BUY,
23
24
  * tokenId: '123',
24
25
  * });
@@ -33,7 +34,7 @@ declare const PrepareLimitOrderError: {
33
34
  * Starts the limit-order workflow.
34
35
  *
35
36
  * @remarks
36
- * This is a low-level action that most SDK consumers will not need.
37
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
37
38
  *
38
39
  * @throws {@link PrepareLimitOrderError}
39
40
  * Thrown on failure.
@@ -58,7 +59,7 @@ declare const PrepareMarketOrderPostingError: {
58
59
  * Starts and posts a market-order workflow.
59
60
  *
60
61
  * @remarks
61
- * This is a low-level action that most SDK consumers will not need.
62
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
62
63
  *
63
64
  * @throws {@link PrepareMarketOrderPostingError}
64
65
  * Thrown on failure.
@@ -66,8 +67,9 @@ declare const PrepareMarketOrderPostingError: {
66
67
  * @example
67
68
  * ```ts
68
69
  * const workflow = await prepareMarketOrderPosting(client, {
69
- * amount: 10,
70
- * side: OrderSide.BUY,
70
+ * minPrice: '0.54',
71
+ * shares: 10,
72
+ * side: OrderSide.SELL,
71
73
  * tokenId: '123',
72
74
  * });
73
75
  * ```
@@ -81,7 +83,7 @@ declare const PrepareLimitOrderPostingError: {
81
83
  * Starts and posts a limit-order workflow.
82
84
  *
83
85
  * @remarks
84
- * This is a low-level action that most SDK consumers will not need.
86
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
85
87
  *
86
88
  * @throws {@link PrepareLimitOrderPostingError}
87
89
  * Thrown on failure.
@@ -106,8 +108,21 @@ declare const CreateMarketOrderError: {
106
108
  /**
107
109
  * Creates a signed market order for the authenticated account.
108
110
  *
111
+ * @remarks
112
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
113
+ *
109
114
  * @throws {@link CreateMarketOrderError}
110
115
  * Thrown on failure.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * const order = await createMarketOrder(client, {
120
+ * amount: '100',
121
+ * maxPrice: '0.55',
122
+ * side: OrderSide.BUY,
123
+ * tokenId: '123',
124
+ * });
125
+ * ```
111
126
  */
112
127
  declare function createMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<SignedOrder>;
113
128
  type PlaceMarketOrderError = CreateMarketOrderError | PostOrderError | TimeoutError | TransactionFailedError;
@@ -117,8 +132,21 @@ declare const PlaceMarketOrderError: {
117
132
  /**
118
133
  * Creates and posts a market order for the authenticated account.
119
134
  *
135
+ * @remarks
136
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
137
+ *
120
138
  * @throws {@link PlaceMarketOrderError}
121
139
  * Thrown on failure.
140
+ *
141
+ * @example
142
+ * ```ts
143
+ * const response = await placeMarketOrder(client, {
144
+ * minPrice: '0.54',
145
+ * shares: '180',
146
+ * side: OrderSide.SELL,
147
+ * tokenId: '123',
148
+ * });
149
+ * ```
122
150
  */
123
151
  declare function placeMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderResponse>;
124
152
  type CreateLimitOrderError = PrepareLimitOrderError | CancelledSigningError;
@@ -128,6 +156,13 @@ declare const CreateLimitOrderError: {
128
156
  /**
129
157
  * Creates a signed limit order for the authenticated account.
130
158
  *
159
+ * @remarks
160
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
161
+ *
162
+ * GTD expirations must be at least 60 seconds in the future. Add your own
163
+ * buffer for network latency and clock skew when deriving an expiration from
164
+ * the current time.
165
+ *
131
166
  * @throws {@link CreateLimitOrderError}
132
167
  * Thrown on failure.
133
168
  */
@@ -139,6 +174,13 @@ declare const PlaceLimitOrderError: {
139
174
  /**
140
175
  * Creates and posts a limit order for the authenticated account.
141
176
  *
177
+ * @remarks
178
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
179
+ *
180
+ * GTD expirations must be at least 60 seconds in the future. Add your own
181
+ * buffer for network latency and clock skew when deriving an expiration from
182
+ * the current time.
183
+ *
142
184
  * @throws {@link PlaceLimitOrderError}
143
185
  * Thrown on failure.
144
186
  */
@@ -151,6 +193,9 @@ declare const ListSportsError: {
151
193
  /**
152
194
  * Lists available sports metadata.
153
195
  *
196
+ * @remarks
197
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
198
+ *
154
199
  * @throws {@link ListSportsError}
155
200
  * Thrown on failure.
156
201
  *
@@ -169,6 +214,9 @@ declare const FetchSportsMarketTypesError: {
169
214
  /**
170
215
  * Fetches the available market types grouped by sport.
171
216
  *
217
+ * @remarks
218
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
219
+ *
172
220
  * @throws {@link FetchSportsMarketTypesError}
173
221
  * Thrown on failure.
174
222
  *