@polymarket/client 0.1.0-beta.6 → 0.1.0-beta.8
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 +14 -13
- package/dist/actions/index.js +1 -1
- package/dist/chunk-GZWA532J.js +2 -0
- package/dist/chunk-GZWA532J.js.map +1 -0
- package/dist/ethers-v5.d.ts +2 -1
- package/dist/index.d.ts +23 -7
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{sports-DNd7kOz2.d.ts → sports-_kLx9-gD.d.ts} +35 -13
- package/dist/{types-DLNcPNT6.d.ts → types-5uGoLhNm.d.ts} +1015 -118
- package/dist/viem.d.ts +2 -1
- package/package.json +3 -2
- package/dist/chunk-2ZZDFOKL.js +0 -2
- package/dist/chunk-2ZZDFOKL.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OrderResponse } from '@polymarket/bindings/clob';
|
|
2
|
-
import {
|
|
2
|
+
import { aR as RateLimitError, aT as RequestRejectedError, by as SigningError, bF as TransportError, bI as UnexpectedResponseError, U as UserInputError, a9 as InsufficientLiquidityError, h as BaseSecureClient, ey as PrepareLimitOrderRequest, ea as OrderWorkflow, e9 as OrderPostingWorkflow, eA as PrepareMarketOrderRequest, m as CancelledSigningError, aI as PostOrderError, bA as TimeoutError, bB as TransactionFailedError, fd as SignedOrder, B as BaseClient } from './types-5uGoLhNm.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.
|
|
@@ -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
|
* });
|
|
@@ -27,7 +28,7 @@ declare const PrepareMarketOrderError: {
|
|
|
27
28
|
declare function prepareMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderWorkflow>;
|
|
28
29
|
type PrepareLimitOrderError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
29
30
|
declare const PrepareLimitOrderError: {
|
|
30
|
-
isError(error: unknown): error is
|
|
31
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | SigningError;
|
|
31
32
|
};
|
|
32
33
|
/**
|
|
33
34
|
* Starts the limit-order workflow.
|
|
@@ -52,7 +53,7 @@ declare const PrepareLimitOrderError: {
|
|
|
52
53
|
declare function prepareLimitOrder(client: BaseSecureClient, request: PrepareLimitOrderRequest): Promise<OrderWorkflow>;
|
|
53
54
|
type PrepareMarketOrderPostingError = PrepareMarketOrderError;
|
|
54
55
|
declare const PrepareMarketOrderPostingError: {
|
|
55
|
-
isError(error: unknown): error is
|
|
56
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | InsufficientLiquidityError | SigningError;
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
58
59
|
* Starts and posts a market-order workflow.
|
|
@@ -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
|
* ```
|
|
@@ -75,7 +77,7 @@ declare const PrepareMarketOrderPostingError: {
|
|
|
75
77
|
declare function prepareMarketOrderPosting(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderPostingWorkflow>;
|
|
76
78
|
type PrepareLimitOrderPostingError = PrepareLimitOrderError;
|
|
77
79
|
declare const PrepareLimitOrderPostingError: {
|
|
78
|
-
isError(error: unknown): error is
|
|
80
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | SigningError;
|
|
79
81
|
};
|
|
80
82
|
/**
|
|
81
83
|
* Starts and posts a limit-order workflow.
|
|
@@ -101,7 +103,7 @@ declare function prepareLimitOrderPosting(client: BaseSecureClient, request: Pre
|
|
|
101
103
|
|
|
102
104
|
type CreateMarketOrderError = PrepareMarketOrderError | CancelledSigningError;
|
|
103
105
|
declare const CreateMarketOrderError: {
|
|
104
|
-
isError(error: unknown): error is
|
|
106
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | CancelledSigningError | InsufficientLiquidityError | SigningError;
|
|
105
107
|
};
|
|
106
108
|
/**
|
|
107
109
|
* Creates a signed market order for the authenticated account.
|
|
@@ -111,11 +113,21 @@ declare const CreateMarketOrderError: {
|
|
|
111
113
|
*
|
|
112
114
|
* @throws {@link CreateMarketOrderError}
|
|
113
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
|
+
* ```
|
|
114
126
|
*/
|
|
115
127
|
declare function createMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<SignedOrder>;
|
|
116
128
|
type PlaceMarketOrderError = CreateMarketOrderError | PostOrderError | TimeoutError | TransactionFailedError;
|
|
117
129
|
declare const PlaceMarketOrderError: {
|
|
118
|
-
isError(error: unknown): error is
|
|
130
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | TimeoutError | TransactionFailedError | CancelledSigningError | InsufficientLiquidityError | SigningError;
|
|
119
131
|
};
|
|
120
132
|
/**
|
|
121
133
|
* Creates and posts a market order for the authenticated account.
|
|
@@ -125,11 +137,21 @@ declare const PlaceMarketOrderError: {
|
|
|
125
137
|
*
|
|
126
138
|
* @throws {@link PlaceMarketOrderError}
|
|
127
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
|
+
* ```
|
|
128
150
|
*/
|
|
129
151
|
declare function placeMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderResponse>;
|
|
130
152
|
type CreateLimitOrderError = PrepareLimitOrderError | CancelledSigningError;
|
|
131
153
|
declare const CreateLimitOrderError: {
|
|
132
|
-
isError(error: unknown): error is
|
|
154
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | CancelledSigningError | SigningError;
|
|
133
155
|
};
|
|
134
156
|
/**
|
|
135
157
|
* Creates a signed limit order for the authenticated account.
|
|
@@ -147,7 +169,7 @@ declare const CreateLimitOrderError: {
|
|
|
147
169
|
declare function createLimitOrder(client: BaseSecureClient, request: PrepareLimitOrderRequest): Promise<SignedOrder>;
|
|
148
170
|
type PlaceLimitOrderError = CreateLimitOrderError | PostOrderError | TimeoutError | TransactionFailedError;
|
|
149
171
|
declare const PlaceLimitOrderError: {
|
|
150
|
-
isError(error: unknown): error is
|
|
172
|
+
isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | TimeoutError | TransactionFailedError | CancelledSigningError | SigningError;
|
|
151
173
|
};
|
|
152
174
|
/**
|
|
153
175
|
* Creates and posts a limit order for the authenticated account.
|
|
@@ -166,7 +188,7 @@ declare function placeLimitOrder(client: BaseSecureClient, request: PrepareLimit
|
|
|
166
188
|
|
|
167
189
|
type ListSportsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
168
190
|
declare const ListSportsError: {
|
|
169
|
-
isError(error: unknown): error is
|
|
191
|
+
isError(error: unknown): error is UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
|
|
170
192
|
};
|
|
171
193
|
/**
|
|
172
194
|
* Lists available sports metadata.
|
|
@@ -187,7 +209,7 @@ declare const ListSportsError: {
|
|
|
187
209
|
declare function listSports(client: BaseClient): Promise<SportsMetadata[]>;
|
|
188
210
|
type FetchSportsMarketTypesError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
189
211
|
declare const FetchSportsMarketTypesError: {
|
|
190
|
-
isError(error: unknown): error is
|
|
212
|
+
isError(error: unknown): error is UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
|
|
191
213
|
};
|
|
192
214
|
/**
|
|
193
215
|
* Fetches the available market types grouped by sport.
|