@polymarket/bindings 0.1.0-beta.9 → 0.1.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/chunk-2VUWIHOR.js +2 -0
- package/dist/chunk-2VUWIHOR.js.map +1 -0
- package/dist/chunk-667TIILD.js +2 -0
- package/dist/{chunk-GYP7YNXL.js.map → chunk-667TIILD.js.map} +1 -1
- package/dist/chunk-D6QJEBYH.js +2 -0
- package/dist/chunk-D6QJEBYH.js.map +1 -0
- package/dist/clob/index.d.ts +110 -46
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/data/index.d.ts +1049 -915
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +48 -1
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +13 -9
- package/dist/index.js +1 -1
- package/dist/{orders-B7JX0nMz.d.ts → orders-mGd3XVG1.d.ts} +429 -1
- package/dist/perps/index.d.ts +288 -3
- package/dist/perps/index.js +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/rfq.d.ts +15 -40
- package/dist/rfq.js +1 -1
- package/dist/rfq.js.map +1 -1
- package/dist/subscriptions/index.d.ts +371 -67
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-GYP7YNXL.js +0 -2
- package/dist/chunk-KYFSCD3H.js +0 -2
- package/dist/chunk-KYFSCD3H.js.map +0 -1
- package/dist/chunk-VBHCYSM7.js +0 -2
- package/dist/chunk-VBHCYSM7.js.map +0 -1
package/dist/clob/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _polymarket_types from '@polymarket/types';
|
|
2
2
|
import { TxHash } from '@polymarket/types';
|
|
3
|
-
import { BaseUnits, TokenId, DecimalString, IsoDateTimeString, NotificationId, EpochMilliseconds,
|
|
3
|
+
import { BaseUnits, CtfConditionId, TokenId, DecimalString, IsoDateTimeString, NotificationId, EpochMilliseconds, ApiKey, OrderSide, OrderId } from '../index.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export { S as SignatureType, a as SignatureTypeSchema } from '../signature-type-CrLAA9AN.js';
|
|
6
6
|
|
|
@@ -12,6 +12,24 @@ declare const ClosedOnlyModeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
12
12
|
closed_only: boolean;
|
|
13
13
|
}>>;
|
|
14
14
|
type ClosedOnlyMode = z.infer<typeof ClosedOnlyModeSchema>;
|
|
15
|
+
type OpenOrder = {
|
|
16
|
+
id: string;
|
|
17
|
+
/** CTF condition id for the market associated with this order. */
|
|
18
|
+
conditionId: CtfConditionId;
|
|
19
|
+
tokenId: TokenId;
|
|
20
|
+
owner: string;
|
|
21
|
+
makerAddress: string;
|
|
22
|
+
side: string;
|
|
23
|
+
price: DecimalString;
|
|
24
|
+
originalSize: DecimalString;
|
|
25
|
+
sizeMatched: DecimalString;
|
|
26
|
+
outcome: string;
|
|
27
|
+
orderType: string;
|
|
28
|
+
status: string;
|
|
29
|
+
associateTrades: string[];
|
|
30
|
+
createdAt: IsoDateTimeString;
|
|
31
|
+
expiresAt?: IsoDateTimeString;
|
|
32
|
+
};
|
|
15
33
|
declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
16
34
|
asset_id: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
17
35
|
associate_trades: z.ZodArray<z.ZodString>;
|
|
@@ -19,7 +37,7 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
19
37
|
expiration: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString | undefined, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
20
38
|
id: z.ZodString;
|
|
21
39
|
maker_address: z.ZodString;
|
|
22
|
-
market: z.ZodString
|
|
40
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
23
41
|
order_type: z.ZodString;
|
|
24
42
|
original_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
25
43
|
outcome: z.ZodString;
|
|
@@ -29,6 +47,7 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
29
47
|
size_matched: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
30
48
|
status: z.ZodString;
|
|
31
49
|
}, z.core.$strip>, z.ZodTransform<{
|
|
50
|
+
conditionId: CtfConditionId;
|
|
32
51
|
tokenId: TokenId;
|
|
33
52
|
associateTrades: string[];
|
|
34
53
|
createdAt: IsoDateTimeString;
|
|
@@ -37,7 +56,6 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
37
56
|
originalSize: DecimalString;
|
|
38
57
|
sizeMatched: DecimalString;
|
|
39
58
|
id: string;
|
|
40
|
-
market: string;
|
|
41
59
|
outcome: string;
|
|
42
60
|
owner: string;
|
|
43
61
|
price: DecimalString;
|
|
@@ -45,6 +63,7 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
45
63
|
status: string;
|
|
46
64
|
} | {
|
|
47
65
|
expiresAt: IsoDateTimeString;
|
|
66
|
+
conditionId: CtfConditionId;
|
|
48
67
|
tokenId: TokenId;
|
|
49
68
|
associateTrades: string[];
|
|
50
69
|
createdAt: IsoDateTimeString;
|
|
@@ -53,7 +72,6 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
53
72
|
originalSize: DecimalString;
|
|
54
73
|
sizeMatched: DecimalString;
|
|
55
74
|
id: string;
|
|
56
|
-
market: string;
|
|
57
75
|
outcome: string;
|
|
58
76
|
owner: string;
|
|
59
77
|
price: DecimalString;
|
|
@@ -66,7 +84,7 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
66
84
|
expiration: IsoDateTimeString | undefined;
|
|
67
85
|
id: string;
|
|
68
86
|
maker_address: string;
|
|
69
|
-
market:
|
|
87
|
+
market: CtfConditionId;
|
|
70
88
|
order_type: string;
|
|
71
89
|
original_size: DecimalString;
|
|
72
90
|
outcome: string;
|
|
@@ -76,7 +94,6 @@ declare const OpenOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
76
94
|
size_matched: DecimalString;
|
|
77
95
|
status: string;
|
|
78
96
|
}>>;
|
|
79
|
-
type OpenOrder = z.infer<typeof OpenOrderSchema>;
|
|
80
97
|
declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
81
98
|
count: z.ZodNumber;
|
|
82
99
|
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
@@ -86,7 +103,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
86
103
|
expiration: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString | undefined, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
87
104
|
id: z.ZodString;
|
|
88
105
|
maker_address: z.ZodString;
|
|
89
|
-
market: z.ZodString
|
|
106
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
90
107
|
order_type: z.ZodString;
|
|
91
108
|
original_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
92
109
|
outcome: z.ZodString;
|
|
@@ -96,6 +113,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
96
113
|
size_matched: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
97
114
|
status: z.ZodString;
|
|
98
115
|
}, z.core.$strip>, z.ZodTransform<{
|
|
116
|
+
conditionId: CtfConditionId;
|
|
99
117
|
tokenId: TokenId;
|
|
100
118
|
associateTrades: string[];
|
|
101
119
|
createdAt: IsoDateTimeString;
|
|
@@ -104,7 +122,6 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
104
122
|
originalSize: DecimalString;
|
|
105
123
|
sizeMatched: DecimalString;
|
|
106
124
|
id: string;
|
|
107
|
-
market: string;
|
|
108
125
|
outcome: string;
|
|
109
126
|
owner: string;
|
|
110
127
|
price: DecimalString;
|
|
@@ -112,6 +129,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
112
129
|
status: string;
|
|
113
130
|
} | {
|
|
114
131
|
expiresAt: IsoDateTimeString;
|
|
132
|
+
conditionId: CtfConditionId;
|
|
115
133
|
tokenId: TokenId;
|
|
116
134
|
associateTrades: string[];
|
|
117
135
|
createdAt: IsoDateTimeString;
|
|
@@ -120,7 +138,6 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
120
138
|
originalSize: DecimalString;
|
|
121
139
|
sizeMatched: DecimalString;
|
|
122
140
|
id: string;
|
|
123
|
-
market: string;
|
|
124
141
|
outcome: string;
|
|
125
142
|
owner: string;
|
|
126
143
|
price: DecimalString;
|
|
@@ -133,7 +150,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
133
150
|
expiration: IsoDateTimeString | undefined;
|
|
134
151
|
id: string;
|
|
135
152
|
maker_address: string;
|
|
136
|
-
market:
|
|
153
|
+
market: CtfConditionId;
|
|
137
154
|
order_type: string;
|
|
138
155
|
original_size: DecimalString;
|
|
139
156
|
outcome: string;
|
|
@@ -149,6 +166,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
149
166
|
nextCursor: string;
|
|
150
167
|
count: number;
|
|
151
168
|
data: ({
|
|
169
|
+
conditionId: CtfConditionId;
|
|
152
170
|
tokenId: TokenId;
|
|
153
171
|
associateTrades: string[];
|
|
154
172
|
createdAt: IsoDateTimeString;
|
|
@@ -157,7 +175,6 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
157
175
|
originalSize: DecimalString;
|
|
158
176
|
sizeMatched: DecimalString;
|
|
159
177
|
id: string;
|
|
160
|
-
market: string;
|
|
161
178
|
outcome: string;
|
|
162
179
|
owner: string;
|
|
163
180
|
price: DecimalString;
|
|
@@ -165,6 +182,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
165
182
|
status: string;
|
|
166
183
|
} | {
|
|
167
184
|
expiresAt: IsoDateTimeString;
|
|
185
|
+
conditionId: CtfConditionId;
|
|
168
186
|
tokenId: TokenId;
|
|
169
187
|
associateTrades: string[];
|
|
170
188
|
createdAt: IsoDateTimeString;
|
|
@@ -173,7 +191,6 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
173
191
|
originalSize: DecimalString;
|
|
174
192
|
sizeMatched: DecimalString;
|
|
175
193
|
id: string;
|
|
176
|
-
market: string;
|
|
177
194
|
outcome: string;
|
|
178
195
|
owner: string;
|
|
179
196
|
price: DecimalString;
|
|
@@ -184,6 +201,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
184
201
|
}, {
|
|
185
202
|
count: number;
|
|
186
203
|
data: ({
|
|
204
|
+
conditionId: CtfConditionId;
|
|
187
205
|
tokenId: TokenId;
|
|
188
206
|
associateTrades: string[];
|
|
189
207
|
createdAt: IsoDateTimeString;
|
|
@@ -192,7 +210,6 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
192
210
|
originalSize: DecimalString;
|
|
193
211
|
sizeMatched: DecimalString;
|
|
194
212
|
id: string;
|
|
195
|
-
market: string;
|
|
196
213
|
outcome: string;
|
|
197
214
|
owner: string;
|
|
198
215
|
price: DecimalString;
|
|
@@ -200,6 +217,7 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
200
217
|
status: string;
|
|
201
218
|
} | {
|
|
202
219
|
expiresAt: IsoDateTimeString;
|
|
220
|
+
conditionId: CtfConditionId;
|
|
203
221
|
tokenId: TokenId;
|
|
204
222
|
associateTrades: string[];
|
|
205
223
|
createdAt: IsoDateTimeString;
|
|
@@ -208,7 +226,6 @@ declare const OpenOrdersPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
208
226
|
originalSize: DecimalString;
|
|
209
227
|
sizeMatched: DecimalString;
|
|
210
228
|
id: string;
|
|
211
|
-
market: string;
|
|
212
229
|
outcome: string;
|
|
213
230
|
owner: string;
|
|
214
231
|
price: DecimalString;
|
|
@@ -250,6 +267,28 @@ declare const MakerOrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
250
267
|
price: DecimalString;
|
|
251
268
|
side: string;
|
|
252
269
|
}>>;
|
|
270
|
+
type MakerOrder = z.output<typeof MakerOrderSchema>;
|
|
271
|
+
type ClobTrade = {
|
|
272
|
+
id: string;
|
|
273
|
+
/** CTF condition id for the market associated with this trade. */
|
|
274
|
+
conditionId: CtfConditionId;
|
|
275
|
+
tokenId: TokenId;
|
|
276
|
+
owner: string;
|
|
277
|
+
makerAddress: string;
|
|
278
|
+
takerOrderId: string;
|
|
279
|
+
side: string;
|
|
280
|
+
traderSide: 'TAKER' | 'MAKER';
|
|
281
|
+
price: DecimalString;
|
|
282
|
+
size: DecimalString;
|
|
283
|
+
outcome: string;
|
|
284
|
+
status: string;
|
|
285
|
+
feeRateBps: DecimalString;
|
|
286
|
+
bucketIndex: number;
|
|
287
|
+
transactionHash: string;
|
|
288
|
+
makerOrders: MakerOrder[];
|
|
289
|
+
matchedAt: IsoDateTimeString;
|
|
290
|
+
updatedAt: IsoDateTimeString;
|
|
291
|
+
};
|
|
253
292
|
declare const ClobTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
254
293
|
asset_id: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
255
294
|
bucket_index: z.ZodNumber;
|
|
@@ -288,7 +327,7 @@ declare const ClobTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
288
327
|
price: DecimalString;
|
|
289
328
|
side: string;
|
|
290
329
|
}>>>;
|
|
291
|
-
market: z.ZodString
|
|
330
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
292
331
|
match_time: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
293
332
|
outcome: z.ZodString;
|
|
294
333
|
owner: z.ZodString;
|
|
@@ -303,6 +342,7 @@ declare const ClobTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
303
342
|
}>;
|
|
304
343
|
transaction_hash: z.ZodString;
|
|
305
344
|
}, z.core.$strip>, z.ZodTransform<{
|
|
345
|
+
conditionId: CtfConditionId;
|
|
306
346
|
tokenId: TokenId;
|
|
307
347
|
bucketIndex: number;
|
|
308
348
|
feeRateBps: DecimalString;
|
|
@@ -324,7 +364,6 @@ declare const ClobTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
324
364
|
traderSide: "TAKER" | "MAKER";
|
|
325
365
|
transactionHash: string;
|
|
326
366
|
id: string;
|
|
327
|
-
market: string;
|
|
328
367
|
outcome: string;
|
|
329
368
|
owner: string;
|
|
330
369
|
price: DecimalString;
|
|
@@ -349,7 +388,7 @@ declare const ClobTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
349
388
|
price: DecimalString;
|
|
350
389
|
side: string;
|
|
351
390
|
}[];
|
|
352
|
-
market:
|
|
391
|
+
market: CtfConditionId;
|
|
353
392
|
match_time: IsoDateTimeString;
|
|
354
393
|
outcome: string;
|
|
355
394
|
owner: string;
|
|
@@ -361,7 +400,6 @@ declare const ClobTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
361
400
|
trader_side: "TAKER" | "MAKER";
|
|
362
401
|
transaction_hash: string;
|
|
363
402
|
}>>;
|
|
364
|
-
type ClobTrade = z.infer<typeof ClobTradeSchema>;
|
|
365
403
|
declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
366
404
|
count: z.ZodNumber;
|
|
367
405
|
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
@@ -402,7 +440,7 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
402
440
|
price: DecimalString;
|
|
403
441
|
side: string;
|
|
404
442
|
}>>>;
|
|
405
|
-
market: z.ZodString
|
|
443
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
406
444
|
match_time: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
407
445
|
outcome: z.ZodString;
|
|
408
446
|
owner: z.ZodString;
|
|
@@ -417,6 +455,7 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
417
455
|
}>;
|
|
418
456
|
transaction_hash: z.ZodString;
|
|
419
457
|
}, z.core.$strip>, z.ZodTransform<{
|
|
458
|
+
conditionId: CtfConditionId;
|
|
420
459
|
tokenId: TokenId;
|
|
421
460
|
bucketIndex: number;
|
|
422
461
|
feeRateBps: DecimalString;
|
|
@@ -438,7 +477,6 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
438
477
|
traderSide: "TAKER" | "MAKER";
|
|
439
478
|
transactionHash: string;
|
|
440
479
|
id: string;
|
|
441
|
-
market: string;
|
|
442
480
|
outcome: string;
|
|
443
481
|
owner: string;
|
|
444
482
|
price: DecimalString;
|
|
@@ -463,7 +501,7 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
463
501
|
price: DecimalString;
|
|
464
502
|
side: string;
|
|
465
503
|
}[];
|
|
466
|
-
market:
|
|
504
|
+
market: CtfConditionId;
|
|
467
505
|
match_time: IsoDateTimeString;
|
|
468
506
|
outcome: string;
|
|
469
507
|
owner: string;
|
|
@@ -481,6 +519,7 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
481
519
|
nextCursor: string;
|
|
482
520
|
count: number;
|
|
483
521
|
data: {
|
|
522
|
+
conditionId: CtfConditionId;
|
|
484
523
|
tokenId: TokenId;
|
|
485
524
|
bucketIndex: number;
|
|
486
525
|
feeRateBps: DecimalString;
|
|
@@ -502,7 +541,6 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
502
541
|
traderSide: "TAKER" | "MAKER";
|
|
503
542
|
transactionHash: string;
|
|
504
543
|
id: string;
|
|
505
|
-
market: string;
|
|
506
544
|
outcome: string;
|
|
507
545
|
owner: string;
|
|
508
546
|
price: DecimalString;
|
|
@@ -514,6 +552,7 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
514
552
|
}, {
|
|
515
553
|
count: number;
|
|
516
554
|
data: {
|
|
555
|
+
conditionId: CtfConditionId;
|
|
517
556
|
tokenId: TokenId;
|
|
518
557
|
bucketIndex: number;
|
|
519
558
|
feeRateBps: DecimalString;
|
|
@@ -535,7 +574,6 @@ declare const ClobTradesPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
535
574
|
traderSide: "TAKER" | "MAKER";
|
|
536
575
|
transactionHash: string;
|
|
537
576
|
id: string;
|
|
538
|
-
market: string;
|
|
539
577
|
outcome: string;
|
|
540
578
|
owner: string;
|
|
541
579
|
price: DecimalString;
|
|
@@ -1090,12 +1128,38 @@ declare const BuilderApiKeysResponseSchema: z.ZodPipe<z.ZodArray<z.ZodUnion<read
|
|
|
1090
1128
|
})[]>>;
|
|
1091
1129
|
type BuilderApiKeysResponse = z.infer<typeof BuilderApiKeysResponseSchema>;
|
|
1092
1130
|
|
|
1131
|
+
type BuilderTrade = {
|
|
1132
|
+
id: string;
|
|
1133
|
+
tradeType: string;
|
|
1134
|
+
takerOrderHash: string;
|
|
1135
|
+
builder: string;
|
|
1136
|
+
/** CTF condition id for the market associated with this trade. */
|
|
1137
|
+
conditionId: CtfConditionId;
|
|
1138
|
+
tokenId: TokenId;
|
|
1139
|
+
side: OrderSide;
|
|
1140
|
+
size: DecimalString;
|
|
1141
|
+
sizeUsdc: DecimalString;
|
|
1142
|
+
price: DecimalString;
|
|
1143
|
+
status: string;
|
|
1144
|
+
outcome: string;
|
|
1145
|
+
outcomeIndex: number;
|
|
1146
|
+
owner: string;
|
|
1147
|
+
maker: string;
|
|
1148
|
+
transactionHash: string;
|
|
1149
|
+
matchedAt: IsoDateTimeString;
|
|
1150
|
+
bucketIndex: number;
|
|
1151
|
+
fee: DecimalString;
|
|
1152
|
+
feeUsdc: DecimalString;
|
|
1153
|
+
errMsg: string | null | undefined;
|
|
1154
|
+
createdAt?: IsoDateTimeString;
|
|
1155
|
+
updatedAt?: IsoDateTimeString;
|
|
1156
|
+
};
|
|
1093
1157
|
declare const BuilderTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
1094
1158
|
id: z.ZodString;
|
|
1095
1159
|
tradeType: z.ZodString;
|
|
1096
1160
|
takerOrderHash: z.ZodString;
|
|
1097
1161
|
builder: z.ZodString;
|
|
1098
|
-
market: z.ZodString
|
|
1162
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1099
1163
|
assetId: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1100
1164
|
side: z.ZodEnum<typeof OrderSide>;
|
|
1101
1165
|
size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
@@ -1115,6 +1179,7 @@ declare const BuilderTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1115
1179
|
createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>;
|
|
1116
1180
|
updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>;
|
|
1117
1181
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1182
|
+
conditionId: CtfConditionId;
|
|
1118
1183
|
tokenId: TokenId;
|
|
1119
1184
|
errMsg: string | null | undefined;
|
|
1120
1185
|
matchedAt: IsoDateTimeString;
|
|
@@ -1122,7 +1187,6 @@ declare const BuilderTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1122
1187
|
tradeType: string;
|
|
1123
1188
|
takerOrderHash: string;
|
|
1124
1189
|
builder: string;
|
|
1125
|
-
market: string;
|
|
1126
1190
|
side: OrderSide;
|
|
1127
1191
|
size: DecimalString;
|
|
1128
1192
|
sizeUsdc: DecimalString;
|
|
@@ -1143,7 +1207,7 @@ declare const BuilderTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1143
1207
|
tradeType: string;
|
|
1144
1208
|
takerOrderHash: string;
|
|
1145
1209
|
builder: string;
|
|
1146
|
-
market:
|
|
1210
|
+
market: CtfConditionId;
|
|
1147
1211
|
assetId: TokenId;
|
|
1148
1212
|
side: OrderSide;
|
|
1149
1213
|
size: DecimalString;
|
|
@@ -1163,7 +1227,6 @@ declare const BuilderTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1163
1227
|
createdAt?: IsoDateTimeString | undefined;
|
|
1164
1228
|
updatedAt?: IsoDateTimeString | undefined;
|
|
1165
1229
|
}>>;
|
|
1166
|
-
type BuilderTrade = z.infer<typeof BuilderTradeSchema>;
|
|
1167
1230
|
declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
1168
1231
|
limit: z.ZodNumber;
|
|
1169
1232
|
count: z.ZodNumber;
|
|
@@ -1173,7 +1236,7 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1173
1236
|
tradeType: z.ZodString;
|
|
1174
1237
|
takerOrderHash: z.ZodString;
|
|
1175
1238
|
builder: z.ZodString;
|
|
1176
|
-
market: z.ZodString
|
|
1239
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1177
1240
|
assetId: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1178
1241
|
side: z.ZodEnum<typeof OrderSide>;
|
|
1179
1242
|
size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
@@ -1193,6 +1256,7 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1193
1256
|
createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>;
|
|
1194
1257
|
updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>>;
|
|
1195
1258
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1259
|
+
conditionId: CtfConditionId;
|
|
1196
1260
|
tokenId: TokenId;
|
|
1197
1261
|
errMsg: string | null | undefined;
|
|
1198
1262
|
matchedAt: IsoDateTimeString;
|
|
@@ -1200,7 +1264,6 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1200
1264
|
tradeType: string;
|
|
1201
1265
|
takerOrderHash: string;
|
|
1202
1266
|
builder: string;
|
|
1203
|
-
market: string;
|
|
1204
1267
|
side: OrderSide;
|
|
1205
1268
|
size: DecimalString;
|
|
1206
1269
|
sizeUsdc: DecimalString;
|
|
@@ -1221,7 +1284,7 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1221
1284
|
tradeType: string;
|
|
1222
1285
|
takerOrderHash: string;
|
|
1223
1286
|
builder: string;
|
|
1224
|
-
market:
|
|
1287
|
+
market: CtfConditionId;
|
|
1225
1288
|
assetId: TokenId;
|
|
1226
1289
|
side: OrderSide;
|
|
1227
1290
|
size: DecimalString;
|
|
@@ -1246,6 +1309,7 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1246
1309
|
limit: number;
|
|
1247
1310
|
count: number;
|
|
1248
1311
|
data: {
|
|
1312
|
+
conditionId: CtfConditionId;
|
|
1249
1313
|
tokenId: TokenId;
|
|
1250
1314
|
errMsg: string | null | undefined;
|
|
1251
1315
|
matchedAt: IsoDateTimeString;
|
|
@@ -1253,7 +1317,6 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1253
1317
|
tradeType: string;
|
|
1254
1318
|
takerOrderHash: string;
|
|
1255
1319
|
builder: string;
|
|
1256
|
-
market: string;
|
|
1257
1320
|
side: OrderSide;
|
|
1258
1321
|
size: DecimalString;
|
|
1259
1322
|
sizeUsdc: DecimalString;
|
|
@@ -1275,6 +1338,7 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1275
1338
|
count: number;
|
|
1276
1339
|
next_cursor: string;
|
|
1277
1340
|
data: {
|
|
1341
|
+
conditionId: CtfConditionId;
|
|
1278
1342
|
tokenId: TokenId;
|
|
1279
1343
|
errMsg: string | null | undefined;
|
|
1280
1344
|
matchedAt: IsoDateTimeString;
|
|
@@ -1282,7 +1346,6 @@ declare const PaginatedBuilderTradesSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1282
1346
|
tradeType: string;
|
|
1283
1347
|
takerOrderHash: string;
|
|
1284
1348
|
builder: string;
|
|
1285
|
-
market: string;
|
|
1286
1349
|
side: OrderSide;
|
|
1287
1350
|
size: DecimalString;
|
|
1288
1351
|
sizeUsdc: DecimalString;
|
|
@@ -1325,14 +1388,14 @@ type BuilderFeeRates = z.infer<typeof BuilderFeeRatesSchema>;
|
|
|
1325
1388
|
type FetchBuilderFeeRatesResponse = z.infer<typeof FetchBuilderFeeRatesResponseSchema>;
|
|
1326
1389
|
|
|
1327
1390
|
declare const CancelOrdersResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
1328
|
-
canceled: z.ZodArray<z.ZodString
|
|
1329
|
-
not_canceled: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1391
|
+
canceled: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<OrderId, string>>>;
|
|
1392
|
+
not_canceled: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<OrderId, string>>, z.ZodString>;
|
|
1330
1393
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1331
|
-
canceled:
|
|
1332
|
-
notCanceled: Record<
|
|
1394
|
+
canceled: OrderId[];
|
|
1395
|
+
notCanceled: Record<OrderId, string>;
|
|
1333
1396
|
}, {
|
|
1334
|
-
canceled:
|
|
1335
|
-
not_canceled: Record<
|
|
1397
|
+
canceled: OrderId[];
|
|
1398
|
+
not_canceled: Record<OrderId, string>;
|
|
1336
1399
|
}>>;
|
|
1337
1400
|
type CancelOrdersResponse = z.infer<typeof CancelOrdersResponseSchema>;
|
|
1338
1401
|
|
|
@@ -1348,21 +1411,21 @@ declare const MidpointSchema: z.ZodObject<{
|
|
|
1348
1411
|
mid: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1349
1412
|
}, z.core.$strip>;
|
|
1350
1413
|
type Midpoint = z.infer<typeof MidpointSchema>;
|
|
1351
|
-
declare const MidpointsSchema: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
1414
|
+
declare const MidpointsSchema: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
1352
1415
|
type Midpoints = z.infer<typeof MidpointsSchema>;
|
|
1353
1416
|
declare const PriceSchema: z.ZodObject<{
|
|
1354
1417
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1355
1418
|
}, z.core.$strip>;
|
|
1356
1419
|
type Price = z.infer<typeof PriceSchema>;
|
|
1357
|
-
declare const PricesBySideSchema: z.ZodRecord<z.ZodEnum<typeof OrderSide
|
|
1420
|
+
declare const PricesBySideSchema: z.ZodRecord<z.ZodEnum<typeof OrderSide> & z.core.$partial, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
1358
1421
|
type PricesBySide = z.infer<typeof PricesBySideSchema>;
|
|
1359
|
-
declare const PricesSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<typeof OrderSide
|
|
1422
|
+
declare const PricesSchema: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>, z.ZodRecord<z.ZodEnum<typeof OrderSide> & z.core.$partial, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1360
1423
|
type Prices = z.infer<typeof PricesSchema>;
|
|
1361
1424
|
declare const SpreadSchema: z.ZodObject<{
|
|
1362
1425
|
spread: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1363
1426
|
}, z.core.$strip>;
|
|
1364
1427
|
type Spread = z.infer<typeof SpreadSchema>;
|
|
1365
|
-
declare const SpreadsSchema: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
1428
|
+
declare const SpreadsSchema: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
1366
1429
|
type Spreads = z.infer<typeof SpreadsSchema>;
|
|
1367
1430
|
declare const LastTradePriceSchema: z.ZodObject<{
|
|
1368
1431
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
@@ -1558,7 +1621,8 @@ type OrderBookHash = string & {
|
|
|
1558
1621
|
readonly __tag: 'OrderBookHash';
|
|
1559
1622
|
};
|
|
1560
1623
|
type OrderBook = {
|
|
1561
|
-
market
|
|
1624
|
+
/** CTF condition id for the market this book belongs to. */
|
|
1625
|
+
conditionId: CtfConditionId;
|
|
1562
1626
|
tokenId: TokenId;
|
|
1563
1627
|
timestamp?: EpochMilliseconds | null;
|
|
1564
1628
|
/** Bid levels in ascending price order, lowest bid first. */
|
|
@@ -1594,12 +1658,12 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1594
1658
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1595
1659
|
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1596
1660
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1661
|
+
conditionId: CtfConditionId;
|
|
1597
1662
|
tokenId: TokenId;
|
|
1598
1663
|
minOrderSize: DecimalString;
|
|
1599
1664
|
tickSize: DecimalString;
|
|
1600
1665
|
negRisk: boolean;
|
|
1601
1666
|
lastTradePrice: DecimalString | null | undefined;
|
|
1602
|
-
market: CtfConditionId;
|
|
1603
1667
|
bids: {
|
|
1604
1668
|
price: DecimalString;
|
|
1605
1669
|
size: DecimalString;
|
|
@@ -1646,12 +1710,12 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1646
1710
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1647
1711
|
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1648
1712
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1713
|
+
conditionId: CtfConditionId;
|
|
1649
1714
|
tokenId: TokenId;
|
|
1650
1715
|
minOrderSize: DecimalString;
|
|
1651
1716
|
tickSize: DecimalString;
|
|
1652
1717
|
negRisk: boolean;
|
|
1653
1718
|
lastTradePrice: DecimalString | null | undefined;
|
|
1654
|
-
market: CtfConditionId;
|
|
1655
1719
|
bids: {
|
|
1656
1720
|
price: DecimalString;
|
|
1657
1721
|
size: DecimalString;
|
|
@@ -1698,12 +1762,12 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1698
1762
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1699
1763
|
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1700
1764
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1765
|
+
conditionId: CtfConditionId;
|
|
1701
1766
|
tokenId: TokenId;
|
|
1702
1767
|
minOrderSize: DecimalString;
|
|
1703
1768
|
tickSize: DecimalString;
|
|
1704
1769
|
negRisk: boolean;
|
|
1705
1770
|
lastTradePrice: DecimalString | null | undefined;
|
|
1706
|
-
market: CtfConditionId;
|
|
1707
1771
|
bids: {
|
|
1708
1772
|
price: DecimalString;
|
|
1709
1773
|
size: DecimalString;
|
package/dist/clob/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {Ha,ha,ga,Ea,Ma,ea,aa,sa,La,$ as $$1,Ja,X as X$1,S,ua,ca,Ga,ja}from'../chunk-VBHCYSM7.js';import {z as z$1}from'zod';import {never}from'@polymarket/types';function z(e){return z$1.object({count:z$1.number(),data:z$1.array(e),limit:z$1.number(),next_cursor:z$1.string()}).transform(({next_cursor:t,...a})=>({...a,nextCursor:t}))}var je=z$1.object({closed_only:z$1.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),X=z$1.object({asset_id:Ea,associate_trades:z$1.array(z$1.string()),created_at:ga,expiration:ha,id:z$1.string(),maker_address:z$1.string(),market:z$1.string(),order_type:z$1.string(),original_size:Ha,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size_matched:Ha,status:z$1.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:s,maker_address:f,order_type:c,original_size:u,size_matched:x,...k})=>{let h={...k,tokenId:e,associateTrades:t,createdAt:a,makerAddress:f,orderType:c,originalSize:u,sizeMatched:x};return s===void 0?h:{...h,expiresAt:s}}),Fe=z(X),Z=z$1.object({asset_id:Ea,fee_rate_bps:z$1.preprocess(Ma,Ha.nullable()),maker_address:z$1.string(),matched_amount:Ha,order_id:z$1.string(),outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:s,order_id:f,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:s,orderId:f})),$=z$1.object({asset_id:Ea,bucket_index:z$1.number(),fee_rate_bps:Ha,id:z$1.string(),last_update:ea,maker_address:z$1.string(),maker_orders:z$1.array(Z),market:z$1.string(),match_time:ea,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size:Ha,status:z$1.string(),taker_order_id:z$1.string(),trader_side:z$1.enum(["TAKER","MAKER"]),transaction_hash:z$1.string()}).transform(({asset_id:e,bucket_index:t,fee_rate_bps:a,last_update:s,maker_address:f,maker_orders:c,match_time:u,taker_order_id:x,trader_side:k,transaction_hash:h,...W})=>({...W,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:s,makerAddress:f,makerOrders:c,matchedAt:u,takerOrderId:x,traderSide:k,transactionHash:h})),Ue=z($),q=z$1.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),aa),G=z$1.object({id:sa,owner:z$1.string(),payload:z$1.unknown(),timestamp:q,type:z$1.number()}),Ke=z$1.array(G),L=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(L||{}),He=z$1.enum(L),ve=z$1.object({allowances:z$1.record($$1,z$1.string().transform(BigInt)),balance:La}),Ve=z$1.object({scoring:z$1.boolean()}),Ye=z$1.record(z$1.string(),z$1.boolean()),J=z$1.object({asset_address:z$1.string(),asset_rate:Ja,condition_id:X$1,date:ga,earnings:Ja,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:s,...f})=>({...f,assetAddress:e,assetRate:t,conditionId:a,makerAddress:s})),We=z(J),Q=z$1.object({asset_address:z$1.string(),asset_rate:Ja,date:ga,earnings:Ja,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...s})=>({...s,assetAddress:e,assetRate:t,makerAddress:a})),Xe=z$1.array(Q),Ze=z$1.record(X$1,z$1.number()),ee=z$1.object({outcome:z$1.string(),price:Ja,token_id:Ea}).transform(({token_id:e,...t})=>({...t,tokenId:e})),re=z$1.object({asset_address:z$1.string(),end_date:ga,rate_per_day:Ja,start_date:ga,total_rewards:Ja}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:s,total_rewards:f})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:s,totalRewards:f})),te=z$1.object({asset_address:z$1.string(),asset_rate:Ja,earnings:Ja}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),oe=z$1.object({condition_id:X$1,earning_percentage:z$1.number(),earnings:z$1.array(te),event_slug:z$1.string(),image:z$1.string(),maker_address:z$1.string(),market_competitiveness:z$1.number(),market_slug:z$1.string(),question:z$1.string(),rewards_config:z$1.array(re),rewards_max_spread:z$1.number(),rewards_min_size:Ja,tokens:z$1.array(ee)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:s,market_competitiveness:f,market_slug:c,rewards_config:u,rewards_max_spread:x,rewards_min_size:k,...h})=>({...h,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:s,marketCompetitiveness:f,marketSlug:c,rewardsConfig:u,rewardsMaxSpread:x,rewardsMinSize:k})),$e=z(oe);var Qe=z$1.object({apiKey:S,secret:z$1.string(),passphrase:z$1.string()}).transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),er=z$1.object({apiKeys:z$1.array(S)}),rr=z$1.object({key:S,secret:z$1.string(),passphrase:z$1.string()}),N=z$1.object({key:S,createdAt:ga.optional(),revokedAt:ga.nullable().optional()}),tr=z$1.array(z$1.union([S.transform(e=>({key:e})),N])).transform(e=>e.map(t=>N.parse(t)));var ae=z$1.object({id:z$1.string(),tradeType:z$1.string(),takerOrderHash:z$1.string(),builder:z$1.string(),market:z$1.string(),assetId:Ea,side:ua,size:Ha,sizeUsdc:Ha,price:Ha,status:z$1.string(),outcome:z$1.string(),outcomeIndex:z$1.number().int(),owner:z$1.string(),maker:z$1.string(),transactionHash:z$1.string(),matchTime:ea,bucketIndex:z$1.number().int(),fee:Ha,feeUsdc:Ha,err_msg:z$1.string().nullable().optional(),createdAt:ga.optional(),updatedAt:ga.optional()}).transform(({err_msg:e,assetId:t,matchTime:a,...s})=>({...s,tokenId:t,errMsg:e,matchedAt:a})),nr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(ae)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),j=1e4,se=z$1.object({builder_maker_fee_rate_bps:z$1.number(),builder_taker_fee_rate_bps:z$1.number()}).transform(({builder_maker_fee_rate_bps:e,builder_taker_fee_rate_bps:t})=>({maker:e/j,taker:t/j})),ir=se;var pr=z$1.object({canceled:z$1.array(z$1.string()),not_canceled:z$1.record(z$1.string(),z$1.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var F=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(F||{}),hr=z$1.enum(F),lr=z$1.object({mid:Ha}),yr=z$1.record(z$1.string(),Ha),gr=z$1.object({price:Ha}),ne=z$1.record(ua,Ha.optional()),ur=z$1.record(z$1.string(),ne),xr=z$1.object({spread:Ha}),kr=z$1.record(z$1.string(),Ha),_r=z$1.object({price:Ha,side:ua}),ie=z$1.object({price:Ha,side:ua,token_id:Ea}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z$1.object({tokenId:Ea,price:Ha,side:ua});var Or=z$1.array(ie),ce=z$1.object({t:z$1.number().int(),p:z$1.number()}),Tr=z$1.object({history:z$1.array(ce)}),de=z$1.object({condition_id:X$1}).transform(({condition_id:e})=>e),br=de,pe=z$1.object({r:z$1.number().default(0),e:z$1.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),me=z$1.object({t:Ea,o:z$1.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),fe=z$1.object({fd:pe.nullish(),t:z$1.array(me)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),zr=fe;var Se=z$1.object({neg_risk:z$1.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Cr=Se;var K=z$1.object({price:Ha,size:Ha}),he=z$1.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),H=z$1.object({market:X$1,asset_id:Ea,timestamp:ca.nullish(),bids:z$1.array(K),asks:z$1.array(K),min_order_size:Ha,tick_size:Ha,neg_risk:z$1.boolean(),last_trade_price:Ha.nullish(),hash:he}).transform(({asset_id:e,min_order_size:t,tick_size:a,neg_risk:s,last_trade_price:f,...c})=>({...c,tokenId:e,minOrderSize:t,tickSize:a,negRisk:s,lastTradePrice:f})),Dr=H,Br=z$1.array(H);var v=z$1.preprocess(e=>e===""?"0":e,Ha),ye=z$1.object({errorMsg:z$1.string(),makingAmount:v,orderID:z$1.string(),status:z$1.string(),success:z$1.boolean(),takingAmount:v,tradeIDs:z$1.array(z$1.string()).default([]),transactionsHashes:z$1.array(z$1.string()).default([])}),V=(s=>(s.LIVE="live",s.MATCHED="matched",s.DELAYED="delayed",s))(V||{}),ge=z$1.nativeEnum(V),Y=(h=>(h.UNMATCHED="unmatched",h.MARKET_NOT_READY="market_not_ready",h.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",h.INVALID_NONCE="invalid_nonce",h.INVALID_EXPIRATION="invalid_expiration",h.POST_ONLY_WOULD_CROSS="post_only_would_cross",h.FOK_NOT_FILLED="fok_not_filled",h.FAK_NOT_FILLED="fak_not_filled",h.UNKNOWN="unknown",h))(Y||{}),ue=z$1.nativeEnum(Y),xe=z$1.object({ok:z$1.literal(true),orderId:z$1.string().min(1),status:ge,makingAmount:Ha,takingAmount:Ha,tradeIds:z$1.array(z$1.string()),transactionsHashes:z$1.array(Ga)}),ke=z$1.object({ok:z$1.literal(false),code:ue,message:z$1.string().min(1)}),_e=ye.transform(Te),Fr=z$1.array(_e);function Re(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&ze(e.status)}function Oe(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function Te(e){return Re(e)?xe.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:Oe(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):ke.parse({code:be(e),message:e.errorMsg||"Unknown order failure",ok:false})}function be(e){if(e.status==="unmatched")return "unmatched";switch(e.errorMsg){case "the market is not yet ready to process new orders":return "market_not_ready";case "invalid nonce":return "invalid_nonce";case "invalid expiration":return "invalid_expiration";case "invalid post-only order: order crosses book":return "post_only_would_cross";case "order couldn't be fully filled. FOK orders are fully filled or killed.":return "fok_not_filled";case "no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.":return "fak_not_filled"}return e.errorMsg.includes("not enough balance / allowance")?"insufficient_balance_or_allowance":"unknown"}function ze(e){return e==="live"||e==="matched"||e==="delayed"}var Kr="LTE=";var Ae=z$1.object({id:z$1.number().int().optional(),asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ja,total_rewards:Ja.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Ie=z$1.object({condition_id:X$1,rewards_max_spread:z$1.number().optional(),rewards_min_size:Ja.optional(),rewards_config:z$1.array(Ae).optional(),sponsored_daily_rate:Ja.optional(),sponsors_count:z$1.number().int().optional(),native_daily_rate:Ja.optional(),total_daily_rate:Ja.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:s,sponsored_daily_rate:f,sponsors_count:c,native_daily_rate:u,total_daily_rate:x,...k})=>({...k,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:s,sponsoredDailyRate:f,sponsorsCount:c,nativeDailyRate:u,totalDailyRate:x})),Yr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Ie)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),Ce=z$1.object({token_id:Ea,outcome:z$1.string(),price:Ja}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Ee=z$1.object({asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ja,total_rewards:Ja.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Pe=z$1.object({condition_id:X$1,question:z$1.string(),market_slug:z$1.string().optional(),event_slug:z$1.string().optional(),image:z$1.string().optional(),rewards_max_spread:z$1.number().optional(),rewards_min_size:Ja.optional(),market_competitiveness:z$1.number().optional(),tokens:z$1.array(Ce),rewards_config:z$1.array(Ee).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:s,rewards_min_size:f,market_competitiveness:c,rewards_config:u,...x})=>({...x,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:s,rewardsMinSize:f,marketCompetitiveness:c,rewardsConfig:u})),Wr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Pe)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var De=z$1.object({minimum_tick_size:ja}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),qr=De;export{xe as AcceptedOrderResponseSchema,Qe as ApiKeyCredsSchema,er as ApiKeysResponseSchema,L as AssetType,He as AssetTypeSchema,ve as BalanceAllowanceResponseSchema,rr as BuilderApiKeyCredsSchema,N as BuilderApiKeySchema,tr as BuilderApiKeysResponseSchema,se as BuilderFeeRatesSchema,ae as BuilderTradeSchema,pr as CancelOrdersResponseSchema,$ as ClobTradeSchema,Ue as ClobTradesPageSchema,je as ClosedOnlyModeSchema,de as ConditionByTokenSchema,Ie as CurrentRewardSchema,Kr as END_CURSOR,te as EarningSchema,ir as FetchBuilderFeeRatesResponseSchema,zr as FetchMarketInfoResponseSchema,Cr as FetchNegRiskResponseSchema,Dr as FetchOrderBookResponseSchema,qr as FetchTickSizeResponseSchema,_r as LastTradePriceSchema,Or as LastTradePricesSchema,Z as MakerOrderSchema,pe as MarketFeeInfoSchema,fe as MarketInfoSchema,Pe as MarketRewardSchema,me as MarketTokenSchema,lr as MidpointSchema,yr as MidpointsSchema,Se as NegRiskSchema,G as NotificationSchema,Ke as NotificationsResponseSchema,X as OpenOrderSchema,Fe as OpenOrdersPageSchema,he as OrderBookHashSchema,K as OrderBookLevelSchema,H as OrderBookSchema,Br as OrderBooksSchema,V as OrderPostStatus,ge as OrderPostStatusSchema,Y as OrderResponseErrorCode,ue as OrderResponseErrorCodeSchema,_e as OrderResponseSchema,Fr as OrderResponsesSchema,Ve as OrderScoringResponseSchema,Ye as OrdersScoringResponseSchema,nr as PaginatedBuilderTradesSchema,Yr as PaginatedCurrentRewardsSchema,Wr as PaginatedMarketRewardsSchema,F as PriceHistoryInterval,hr as PriceHistoryIntervalSchema,Tr as PriceHistorySchema,gr as PriceSchema,ur as PricesSchema,ke as RejectedOrderResponseSchema,br as ResolveConditionByTokenResponseSchema,re as RewardsConfigSchema,Ze as RewardsPercentagesSchema,xr as SpreadSchema,kr as SpreadsSchema,De as TickSizeSchema,ee as TokenSchema,Q as TotalUserEarningSchema,Xe as TotalUserEarningsResponseSchema,J as UserEarningSchema,We as UserEarningsPageSchema,oe as UserRewardsEarningSchema,$e as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {Ia,Z as Z$1,ha,ga,Fa,Na,ea,aa,sa,Ma,$ as $$1,Ka,T,va,ua,ca,Ha,ja}from'../chunk-D6QJEBYH.js';import {z}from'zod';import {never}from'@polymarket/types';function b(e){return z.object({count:z.number(),data:z.array(e),limit:z.number(),next_cursor:z.string()}).transform(({next_cursor:t,...a})=>({...a,nextCursor:t}))}var Ue=z.object({closed_only:z.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),$=z.object({asset_id:Fa,associate_trades:z.array(z.string()),created_at:ga,expiration:ha,id:z.string(),maker_address:z.string(),market:Z$1,order_type:z.string(),original_size:Ia,outcome:z.string(),owner:z.string(),price:Ia,side:z.string(),size_matched:Ia,status:z.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:n,maker_address:d,market:c,order_type:y,original_size:k,size_matched:x,...l})=>{let I={...l,conditionId:c,tokenId:e,associateTrades:t,createdAt:a,makerAddress:d,orderType:y,originalSize:k,sizeMatched:x};return n===void 0?I:{...I,expiresAt:n}}),Ke=b($),q=z.object({asset_id:Fa,fee_rate_bps:z.preprocess(Na,Ia.nullable()),maker_address:z.string(),matched_amount:Ia,order_id:z.string(),outcome:z.string(),owner:z.string(),price:Ia,side:z.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:n,order_id:d,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:n,orderId:d})),G=z.object({asset_id:Fa,bucket_index:z.number(),fee_rate_bps:Ia,id:z.string(),last_update:ea,maker_address:z.string(),maker_orders:z.array(q),market:Z$1,match_time:ea,outcome:z.string(),owner:z.string(),price:Ia,side:z.string(),size:Ia,status:z.string(),taker_order_id:z.string(),trader_side:z.enum(["TAKER","MAKER"]),transaction_hash:z.string()}).transform(({asset_id:e,bucket_index:t,fee_rate_bps:a,last_update:n,maker_address:d,maker_orders:c,market:y,match_time:k,taker_order_id:x,trader_side:l,transaction_hash:I,...X})=>({...X,conditionId:y,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:n,makerAddress:d,makerOrders:c,matchedAt:k,takerOrderId:x,traderSide:l,transactionHash:I})),He=b(G),J=z.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),aa),Q=z.object({id:sa,owner:z.string(),payload:z.unknown(),timestamp:J,type:z.number()}),ve=z.array(Q),j=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(j||{}),Ve=z.enum(j),Ye=z.object({allowances:z.record($$1,z.string().transform(BigInt)),balance:Ma}),We=z.object({scoring:z.boolean()}),Ze=z.record(z.string(),z.boolean()),ee=z.object({asset_address:z.string(),asset_rate:Ka,condition_id:Z$1,date:ga,earnings:Ka,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:n,...d})=>({...d,assetAddress:e,assetRate:t,conditionId:a,makerAddress:n})),Xe=b(ee),re=z.object({asset_address:z.string(),asset_rate:Ka,date:ga,earnings:Ka,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...n})=>({...n,assetAddress:e,assetRate:t,makerAddress:a})),$e=z.array(re),qe=z.record(Z$1,z.number()),te=z.object({outcome:z.string(),price:Ka,token_id:Fa}).transform(({token_id:e,...t})=>({...t,tokenId:e})),oe=z.object({asset_address:z.string(),end_date:ga,rate_per_day:Ka,start_date:ga,total_rewards:Ka}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:n,total_rewards:d})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:n,totalRewards:d})),ae=z.object({asset_address:z.string(),asset_rate:Ka,earnings:Ka}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),ne=z.object({condition_id:Z$1,earning_percentage:z.number(),earnings:z.array(ae),event_slug:z.string(),image:z.string(),maker_address:z.string(),market_competitiveness:z.number(),market_slug:z.string(),question:z.string(),rewards_config:z.array(oe),rewards_max_spread:z.number(),rewards_min_size:Ka,tokens:z.array(te)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:n,market_competitiveness:d,market_slug:c,rewards_config:y,rewards_max_spread:k,rewards_min_size:x,...l})=>({...l,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:n,marketCompetitiveness:d,marketSlug:c,rewardsConfig:y,rewardsMaxSpread:k,rewardsMinSize:x})),Ge=b(ne);var rr=z.object({apiKey:T,secret:z.string(),passphrase:z.string()}).transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),tr=z.object({apiKeys:z.array(T)}),or=z.object({key:T,secret:z.string(),passphrase:z.string()}),F=z.object({key:T,createdAt:ga.optional(),revokedAt:ga.nullable().optional()}),ar=z.array(z.union([T.transform(e=>({key:e})),F])).transform(e=>e.map(t=>F.parse(t)));var se=z.object({id:z.string(),tradeType:z.string(),takerOrderHash:z.string(),builder:z.string(),market:Z$1,assetId:Fa,side:va,size:Ia,sizeUsdc:Ia,price:Ia,status:z.string(),outcome:z.string(),outcomeIndex:z.number().int(),owner:z.string(),maker:z.string(),transactionHash:z.string(),matchTime:ea,bucketIndex:z.number().int(),fee:Ia,feeUsdc:Ia,err_msg:z.string().nullable().optional(),createdAt:ga.optional(),updatedAt:ga.optional()}).transform(({err_msg:e,assetId:t,market:a,matchTime:n,...d})=>({...d,conditionId:a,tokenId:t,errMsg:e,matchedAt:n})),dr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(se)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),U=1e4,ie=z.object({builder_maker_fee_rate_bps:z.number(),builder_taker_fee_rate_bps:z.number()}).transform(({builder_maker_fee_rate_bps:e,builder_taker_fee_rate_bps:t})=>({maker:e/U,taker:t/U})),cr=ie;var fr=z.object({canceled:z.array(ua),not_canceled:z.record(ua,z.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var K=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(K||{}),yr=z.enum(K),ur=z.object({mid:Ia}),kr=z.record(Fa,Ia),xr=z.object({price:Ia}),de=z.partialRecord(va,Ia),_r=z.record(Fa,de),Rr=z.object({spread:Ia}),Tr=z.record(Fa,Ia),Or=z.object({price:Ia,side:va}),ce=z.object({price:Ia,side:va,token_id:Fa}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z.object({tokenId:Fa,price:Ia,side:va});var br=z.array(ce),pe=z.object({t:z.number().int(),p:z.number()}),Ar=z.object({history:z.array(pe)}),me=z.object({condition_id:Z$1}).transform(({condition_id:e})=>e),zr=me,Se=z.object({r:z.number().default(0),e:z.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),fe=z.object({t:Fa,o:z.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),ge=z.object({fd:Se.nullish(),t:z.array(fe)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),Cr=ge;var le=z.object({neg_risk:z.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Pr=le;var v=z.object({price:Ia,size:Ia}),he=z.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),V=z.object({market:Z$1,asset_id:Fa,timestamp:ca.nullish(),bids:z.array(v),asks:z.array(v),min_order_size:Ia,tick_size:Ia,neg_risk:z.boolean(),last_trade_price:Ia.nullish(),hash:he}).transform(({market:e,asset_id:t,min_order_size:a,tick_size:n,neg_risk:d,last_trade_price:c,...y})=>({...y,conditionId:e,tokenId:t,minOrderSize:a,tickSize:n,negRisk:d,lastTradePrice:c})),Lr=V,Nr=z.array(V);var Y=z.preprocess(e=>e===""?"0":e,Ia),ue=z.object({errorMsg:z.string(),makingAmount:Y,orderID:z.string(),status:z.string(),success:z.boolean(),takingAmount:Y,tradeIDs:z.array(z.string()).default([]),transactionsHashes:z.array(z.string()).default([])}),W=(n=>(n.LIVE="live",n.MATCHED="matched",n.DELAYED="delayed",n))(W||{}),ke=z.nativeEnum(W),Z=(l=>(l.UNMATCHED="unmatched",l.MARKET_NOT_READY="market_not_ready",l.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",l.INVALID_NONCE="invalid_nonce",l.INVALID_EXPIRATION="invalid_expiration",l.POST_ONLY_WOULD_CROSS="post_only_would_cross",l.FOK_NOT_FILLED="fok_not_filled",l.FAK_NOT_FILLED="fak_not_filled",l.UNKNOWN="unknown",l))(Z||{}),xe=z.nativeEnum(Z),_e=z.object({ok:z.literal(true),orderId:z.string().min(1),status:ke,makingAmount:Ia,takingAmount:Ia,tradeIds:z.array(z.string()),transactionsHashes:z.array(Ha)}),Re=z.object({ok:z.literal(false),code:xe,message:z.string().min(1)}),Te=ue.transform(be),Hr=z.array(Te);function Oe(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&ze(e.status)}function Ie(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function be(e){return Oe(e)?_e.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:Ie(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):Re.parse({code:Ae(e),message:e.errorMsg||"Unknown order failure",ok:false})}function Ae(e){if(e.status==="unmatched")return "unmatched";switch(e.errorMsg){case "the market is not yet ready to process new orders":return "market_not_ready";case "invalid nonce":return "invalid_nonce";case "invalid expiration":return "invalid_expiration";case "invalid post-only order: order crosses book":return "post_only_would_cross";case "order couldn't be fully filled. FOK orders are fully filled or killed.":return "fok_not_filled";case "no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.":return "fak_not_filled"}return e.errorMsg.includes("not enough balance / allowance")?"insufficient_balance_or_allowance":"unknown"}function ze(e){return e==="live"||e==="matched"||e==="delayed"}var Vr="LTE=";var Ce=z.object({id:z.number().int().optional(),asset_address:z.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ka,total_rewards:Ka.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:n,total_rewards:d,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:n,totalRewards:d})),De=z.object({condition_id:Z$1,rewards_max_spread:z.number().optional(),rewards_min_size:Ka.optional(),rewards_config:z.array(Ce).optional(),sponsored_daily_rate:Ka.optional(),sponsors_count:z.number().int().optional(),native_daily_rate:Ka.optional(),total_daily_rate:Ka.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:n,sponsored_daily_rate:d,sponsors_count:c,native_daily_rate:y,total_daily_rate:k,...x})=>({...x,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:n,sponsoredDailyRate:d,sponsorsCount:c,nativeDailyRate:y,totalDailyRate:k})),Xr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(De)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),Ee=z.object({token_id:Fa,outcome:z.string(),price:Ka}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Pe=z.object({asset_address:z.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ka,total_rewards:Ka.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:n,total_rewards:d,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:n,totalRewards:d})),we=z.object({condition_id:Z$1,question:z.string(),market_slug:z.string().optional(),event_slug:z.string().optional(),image:z.string().optional(),rewards_max_spread:z.number().optional(),rewards_min_size:Ka.optional(),market_competitiveness:z.number().optional(),tokens:z.array(Ee),rewards_config:z.array(Pe).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:n,rewards_min_size:d,market_competitiveness:c,rewards_config:y,...k})=>({...k,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:n,rewardsMinSize:d,marketCompetitiveness:c,rewardsConfig:y})),$r=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(we)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var Be=z.object({minimum_tick_size:ja}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),Qr=Be;export{_e as AcceptedOrderResponseSchema,rr as ApiKeyCredsSchema,tr as ApiKeysResponseSchema,j as AssetType,Ve as AssetTypeSchema,Ye as BalanceAllowanceResponseSchema,or as BuilderApiKeyCredsSchema,F as BuilderApiKeySchema,ar as BuilderApiKeysResponseSchema,ie as BuilderFeeRatesSchema,se as BuilderTradeSchema,fr as CancelOrdersResponseSchema,G as ClobTradeSchema,He as ClobTradesPageSchema,Ue as ClosedOnlyModeSchema,me as ConditionByTokenSchema,De as CurrentRewardSchema,Vr as END_CURSOR,ae as EarningSchema,cr as FetchBuilderFeeRatesResponseSchema,Cr as FetchMarketInfoResponseSchema,Pr as FetchNegRiskResponseSchema,Lr as FetchOrderBookResponseSchema,Qr as FetchTickSizeResponseSchema,Or as LastTradePriceSchema,br as LastTradePricesSchema,q as MakerOrderSchema,Se as MarketFeeInfoSchema,ge as MarketInfoSchema,we as MarketRewardSchema,fe as MarketTokenSchema,ur as MidpointSchema,kr as MidpointsSchema,le as NegRiskSchema,Q as NotificationSchema,ve as NotificationsResponseSchema,$ as OpenOrderSchema,Ke as OpenOrdersPageSchema,he as OrderBookHashSchema,v as OrderBookLevelSchema,V as OrderBookSchema,Nr as OrderBooksSchema,W as OrderPostStatus,ke as OrderPostStatusSchema,Z as OrderResponseErrorCode,xe as OrderResponseErrorCodeSchema,Te as OrderResponseSchema,Hr as OrderResponsesSchema,We as OrderScoringResponseSchema,Ze as OrdersScoringResponseSchema,dr as PaginatedBuilderTradesSchema,Xr as PaginatedCurrentRewardsSchema,$r as PaginatedMarketRewardsSchema,K as PriceHistoryInterval,yr as PriceHistoryIntervalSchema,Ar as PriceHistorySchema,xr as PriceSchema,_r as PricesSchema,Re as RejectedOrderResponseSchema,zr as ResolveConditionByTokenResponseSchema,oe as RewardsConfigSchema,qe as RewardsPercentagesSchema,Rr as SpreadSchema,Tr as SpreadsSchema,Be as TickSizeSchema,te as TokenSchema,re as TotalUserEarningSchema,$e as TotalUserEarningsResponseSchema,ee as UserEarningSchema,Xe as UserEarningsPageSchema,ne as UserRewardsEarningSchema,Ge as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|