@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.
- package/README.md +2 -10
- package/dist/actions/index.d.ts +15 -13
- package/dist/actions/index.js +1 -1
- package/dist/chunk-FMBJ7ZRK.js +2 -0
- package/dist/chunk-FMBJ7ZRK.js.map +1 -0
- package/dist/ethers-v5.d.ts +3 -1
- package/dist/index.d.ts +74 -11
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{sports-BDLhQVTP.d.ts → sports-BGrBawu_.d.ts} +55 -7
- package/dist/{types-D7tLX0ye.d.ts → types-M1U0um0G.d.ts} +2319 -348
- package/dist/viem.d.ts +3 -1
- package/package.json +13 -4
- package/dist/chunk-VQOVE5SC.js +0 -2
- package/dist/chunk-VQOVE5SC.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrderResponse } from '@polymarket/bindings/clob';
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
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
|
|
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
|
-
*
|
|
70
|
-
*
|
|
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
|
|
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
|
*
|