@polymarket/client 0.8.1 → 0.9.0
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/dist/actions/index.d.ts +11 -11
- package/dist/actions/index.js +1 -1
- package/dist/chunk-VY7OIGFI.js +3 -0
- package/dist/chunk-VY7OIGFI.js.map +1 -0
- package/dist/ethers-v5.d.ts +1 -1
- package/dist/index.d.ts +5 -8
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{sports-CzWL97Kk.d.ts → sports-B_JL_y8H.d.ts} +17 -17
- package/dist/{types-DEAKEE6E.d.ts → types-MSQcyDVD.d.ts} +407 -296
- package/dist/viem.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-HBNTVXSW.js +0 -3
- package/dist/chunk-HBNTVXSW.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OrderResponse } from '@polymarket/bindings/clob';
|
|
2
|
-
import {
|
|
2
|
+
import { c9 as RateLimitError, ch as RequestRejectedError, d9 as SigningError, dk as TransportError, dn as UnexpectedResponseError, U as UserInputError, aR as InsufficientLiquidityError, q as BaseSecureClient, fW as PrepareLimitOrderRequest, fz as OrderWorkflow, fy as OrderPostingWorkflow, fY as PrepareMarketOrderRequest, y as CancelledSigningError, bZ as PostOrderError, dc as TimeoutError, dg as TransactionFailedError, d6 as SignedOrder, B as BaseClient } from './types-MSQcyDVD.js';
|
|
3
3
|
import { SportsMarketTypesResponse, SportsMetadata } from '@polymarket/bindings/gamma';
|
|
4
4
|
|
|
5
5
|
type PrepareMarketOrderError = InsufficientLiquidityError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
6
6
|
declare const PrepareMarketOrderError: {
|
|
7
|
-
isError(error: unknown): error is
|
|
7
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | InsufficientLiquidityError | SigningError;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Starts the market-order workflow.
|
|
@@ -18,17 +18,17 @@ declare const PrepareMarketOrderError: {
|
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
20
20
|
* const workflow = await prepareMarketOrder(client, {
|
|
21
|
+
* assetId: '0x0122…0000',
|
|
21
22
|
* amount: 10,
|
|
22
23
|
* maxPrice: '0.55',
|
|
23
24
|
* side: OrderSide.BUY,
|
|
24
|
-
* tokenId: '123',
|
|
25
25
|
* });
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
declare function prepareMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderWorkflow>;
|
|
29
29
|
type PrepareLimitOrderError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
30
30
|
declare const PrepareLimitOrderError: {
|
|
31
|
-
isError(error: unknown): error is
|
|
31
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | SigningError;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
34
|
* Starts the limit-order workflow.
|
|
@@ -42,18 +42,18 @@ declare const PrepareLimitOrderError: {
|
|
|
42
42
|
* @example
|
|
43
43
|
* ```ts
|
|
44
44
|
* const workflow = await prepareLimitOrder(client, {
|
|
45
|
+
* assetId: '0x0122…0000',
|
|
45
46
|
* postOnly: true,
|
|
46
47
|
* price: 0.52,
|
|
47
48
|
* side: OrderSide.BUY,
|
|
48
49
|
* size: 10,
|
|
49
|
-
* tokenId: '123',
|
|
50
50
|
* });
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
declare function prepareLimitOrder(client: BaseSecureClient, request: PrepareLimitOrderRequest): Promise<OrderWorkflow>;
|
|
54
54
|
type PrepareMarketOrderPostingError = PrepareMarketOrderError;
|
|
55
55
|
declare const PrepareMarketOrderPostingError: {
|
|
56
|
-
isError(error: unknown): error is
|
|
56
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | InsufficientLiquidityError | SigningError;
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
59
59
|
* Starts and posts a market-order workflow.
|
|
@@ -67,17 +67,17 @@ declare const PrepareMarketOrderPostingError: {
|
|
|
67
67
|
* @example
|
|
68
68
|
* ```ts
|
|
69
69
|
* const workflow = await prepareMarketOrderPosting(client, {
|
|
70
|
+
* assetId: '0x0122…0000',
|
|
70
71
|
* minPrice: '0.54',
|
|
71
72
|
* shares: 10,
|
|
72
73
|
* side: OrderSide.SELL,
|
|
73
|
-
* tokenId: '123',
|
|
74
74
|
* });
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
77
|
declare function prepareMarketOrderPosting(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderPostingWorkflow>;
|
|
78
78
|
type PrepareLimitOrderPostingError = PrepareLimitOrderError;
|
|
79
79
|
declare const PrepareLimitOrderPostingError: {
|
|
80
|
-
isError(error: unknown): error is
|
|
80
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | SigningError;
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
83
|
* Starts and posts a limit-order workflow.
|
|
@@ -91,11 +91,11 @@ declare const PrepareLimitOrderPostingError: {
|
|
|
91
91
|
* @example
|
|
92
92
|
* ```ts
|
|
93
93
|
* const workflow = await prepareLimitOrderPosting(client, {
|
|
94
|
+
* assetId: '0x0122…0000',
|
|
94
95
|
* postOnly: true,
|
|
95
96
|
* price: 0.52,
|
|
96
97
|
* side: OrderSide.BUY,
|
|
97
98
|
* size: 10,
|
|
98
|
-
* tokenId: '123',
|
|
99
99
|
* });
|
|
100
100
|
* ```
|
|
101
101
|
*/
|
|
@@ -103,7 +103,7 @@ declare function prepareLimitOrderPosting(client: BaseSecureClient, request: Pre
|
|
|
103
103
|
|
|
104
104
|
type CreateMarketOrderError = PrepareMarketOrderError | CancelledSigningError;
|
|
105
105
|
declare const CreateMarketOrderError: {
|
|
106
|
-
isError(error: unknown): error is
|
|
106
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | CancelledSigningError | InsufficientLiquidityError | SigningError;
|
|
107
107
|
};
|
|
108
108
|
/**
|
|
109
109
|
* Creates a signed market order for the authenticated account.
|
|
@@ -117,17 +117,17 @@ declare const CreateMarketOrderError: {
|
|
|
117
117
|
* @example
|
|
118
118
|
* ```ts
|
|
119
119
|
* const order = await createMarketOrder(client, {
|
|
120
|
+
* assetId: '0x0122…0000',
|
|
120
121
|
* amount: '100',
|
|
121
122
|
* maxPrice: '0.55',
|
|
122
123
|
* side: OrderSide.BUY,
|
|
123
|
-
* tokenId: '123',
|
|
124
124
|
* });
|
|
125
125
|
* ```
|
|
126
126
|
*/
|
|
127
127
|
declare function createMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<SignedOrder>;
|
|
128
128
|
type PlaceMarketOrderError = CreateMarketOrderError | PostOrderError | TimeoutError | TransactionFailedError;
|
|
129
129
|
declare const PlaceMarketOrderError: {
|
|
130
|
-
isError(error: unknown): error is
|
|
130
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | TimeoutError | TransactionFailedError | CancelledSigningError | InsufficientLiquidityError | SigningError;
|
|
131
131
|
};
|
|
132
132
|
/**
|
|
133
133
|
* Creates and posts a market order for the authenticated account.
|
|
@@ -141,17 +141,17 @@ declare const PlaceMarketOrderError: {
|
|
|
141
141
|
* @example
|
|
142
142
|
* ```ts
|
|
143
143
|
* const response = await placeMarketOrder(client, {
|
|
144
|
+
* assetId: '0x0122…0000',
|
|
144
145
|
* minPrice: '0.54',
|
|
145
146
|
* shares: '180',
|
|
146
147
|
* side: OrderSide.SELL,
|
|
147
|
-
* tokenId: '123',
|
|
148
148
|
* });
|
|
149
149
|
* ```
|
|
150
150
|
*/
|
|
151
151
|
declare function placeMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderResponse>;
|
|
152
152
|
type CreateLimitOrderError = PrepareLimitOrderError | CancelledSigningError;
|
|
153
153
|
declare const CreateLimitOrderError: {
|
|
154
|
-
isError(error: unknown): error is
|
|
154
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | CancelledSigningError | SigningError;
|
|
155
155
|
};
|
|
156
156
|
/**
|
|
157
157
|
* Creates a signed limit order for the authenticated account.
|
|
@@ -169,7 +169,7 @@ declare const CreateLimitOrderError: {
|
|
|
169
169
|
declare function createLimitOrder(client: BaseSecureClient, request: PrepareLimitOrderRequest): Promise<SignedOrder>;
|
|
170
170
|
type PlaceLimitOrderError = CreateLimitOrderError | PostOrderError | TimeoutError | TransactionFailedError;
|
|
171
171
|
declare const PlaceLimitOrderError: {
|
|
172
|
-
isError(error: unknown): error is
|
|
172
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | TimeoutError | TransactionFailedError | CancelledSigningError | SigningError;
|
|
173
173
|
};
|
|
174
174
|
/**
|
|
175
175
|
* Creates and posts a limit order for the authenticated account.
|
|
@@ -188,7 +188,7 @@ declare function placeLimitOrder(client: BaseSecureClient, request: PrepareLimit
|
|
|
188
188
|
|
|
189
189
|
type ListSportsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
190
190
|
declare const ListSportsError: {
|
|
191
|
-
isError(error: unknown): error is
|
|
191
|
+
isError(error: unknown): error is UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
|
|
192
192
|
};
|
|
193
193
|
/**
|
|
194
194
|
* Lists available sports metadata.
|
|
@@ -209,7 +209,7 @@ declare const ListSportsError: {
|
|
|
209
209
|
declare function listSports(client: BaseClient): Promise<SportsMetadata[]>;
|
|
210
210
|
type FetchSportsMarketTypesError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
211
211
|
declare const FetchSportsMarketTypesError: {
|
|
212
|
-
isError(error: unknown): error is
|
|
212
|
+
isError(error: unknown): error is UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
|
|
213
213
|
};
|
|
214
214
|
/**
|
|
215
215
|
* Fetches the available market types grouped by sport.
|