@polymarket/bindings 0.11.0 → 0.13.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-2FRDSBWY.js +2 -0
- package/dist/chunk-2FRDSBWY.js.map +1 -0
- package/dist/{chunk-RGWF46B7.js → chunk-3IZ4N7C2.js} +2 -2
- package/dist/{chunk-RGWF46B7.js.map → chunk-3IZ4N7C2.js.map} +1 -1
- package/dist/chunk-Z6SGQXSJ.js +2 -0
- package/dist/chunk-Z6SGQXSJ.js.map +1 -0
- package/dist/clob/index.d.ts +15 -10
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/combos/index.js +1 -1
- package/dist/{comment-C-jBbhp7.d.ts → comment-CKJIqOZS.d.ts} +372 -2
- package/dist/data/index.d.ts +211 -12
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +16 -1
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1 -1
- package/dist/{orders-CAELACaR.d.ts → orders-BV68_6ST.d.ts} +1150 -72
- package/dist/perps/index.d.ts +993 -9
- package/dist/perps/index.js +1 -1
- package/dist/perps/index.js.map +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/subscriptions/index.d.ts +748 -98
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-NILFT6EF.js +0 -2
- package/dist/chunk-NILFT6EF.js.map +0 -1
- package/dist/chunk-V3FFOW6W.js +0 -2
- package/dist/chunk-V3FFOW6W.js.map +0 -1
package/dist/data/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConditionId, PositionId, IsoDateTimeString, DecimalString, ComboConditionId, EpochMilliseconds, PaginationCursor, TokenId, IsoCalendarDateString, OrderSide, ComboActivityId, ClobAssetId, EventId, BuilderCode, QuestionId } from '../index.js';
|
|
2
|
+
import * as _polymarket_types from '@polymarket/types';
|
|
2
3
|
import { EvmAddress, TxHash } from '@polymarket/types';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
@@ -54,15 +55,38 @@ declare enum ComboPositionStatus {
|
|
|
54
55
|
ResolvedLoss = "RESOLVED_LOSS"
|
|
55
56
|
}
|
|
56
57
|
declare const ComboPositionStatusSchema: z.ZodEnum<typeof ComboPositionStatus>;
|
|
58
|
+
/** Lifecycle filter for a positions listing. */
|
|
57
59
|
declare enum PositionStatus {
|
|
58
60
|
Open = "OPEN",
|
|
59
61
|
Redeemable = "REDEEMABLE",
|
|
62
|
+
/** Still-held, zero-payout (lost) positions, ranked on frozen values. */
|
|
63
|
+
RedeemableLost = "REDEEMABLE_LOST",
|
|
64
|
+
/**
|
|
65
|
+
* Live complementary pairs the wallet can merge back to collateral (holds >= 2
|
|
66
|
+
* live outcome tokens of a condition). Settled pairs are excluded; they are a
|
|
67
|
+
* redeem, not a merge.
|
|
68
|
+
*/
|
|
69
|
+
Mergeable = "MERGEABLE",
|
|
60
70
|
Closed = "CLOSED"
|
|
61
71
|
}
|
|
62
72
|
declare const PositionStatusSchema: z.ZodEnum<typeof PositionStatus>;
|
|
73
|
+
/**
|
|
74
|
+
* The statuses a position row itself reports, which is narrower than the
|
|
75
|
+
* listing filter: `REDEEMABLE_LOST` and `MERGEABLE` are filter vocabulary
|
|
76
|
+
* only. A lost holding still reports `REDEEMABLE`, and a mergeable one
|
|
77
|
+
* reports `OPEN`.
|
|
78
|
+
*/
|
|
79
|
+
type PositionRowStatus = PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
80
|
+
declare const PositionRowStatusSchema: z.ZodEnum<{
|
|
81
|
+
OPEN: PositionStatus.Open;
|
|
82
|
+
REDEEMABLE: PositionStatus.Redeemable;
|
|
83
|
+
CLOSED: PositionStatus.Closed;
|
|
84
|
+
}>;
|
|
63
85
|
/** Sort key for position listings. */
|
|
64
86
|
declare enum PositionSortBy {
|
|
65
87
|
CurrentValue = "CURRENT_VALUE",
|
|
88
|
+
/** Current effective price; wallet closed positions use realized PnL instead. */
|
|
89
|
+
Price = "PRICE",
|
|
66
90
|
Tokens = "TOKENS",
|
|
67
91
|
UnrealizedPnl = "UNREALIZED_PNL",
|
|
68
92
|
RealizedPnl = "REALIZED_PNL",
|
|
@@ -119,9 +143,10 @@ type Position = {
|
|
|
119
143
|
percentRealizedPnl: DecimalString;
|
|
120
144
|
/**
|
|
121
145
|
* The row's actual state — can be narrower than the requested status,
|
|
122
|
-
* since an OPEN request also returns REDEEMABLE rows
|
|
146
|
+
* since an OPEN request also returns REDEEMABLE rows, and a
|
|
147
|
+
* REDEEMABLE_LOST or MERGEABLE listing reports REDEEMABLE or OPEN rows.
|
|
123
148
|
*/
|
|
124
|
-
status:
|
|
149
|
+
status: PositionRowStatus;
|
|
125
150
|
redeemable: boolean;
|
|
126
151
|
mergeable: boolean;
|
|
127
152
|
negativeRisk: boolean;
|
|
@@ -145,6 +170,8 @@ type Position = {
|
|
|
145
170
|
* positions with no native economics.
|
|
146
171
|
*/
|
|
147
172
|
lastEventAt?: EpochMilliseconds;
|
|
173
|
+
/** First acquisition as Unix epoch milliseconds; absent when unrecorded. */
|
|
174
|
+
firstEntryAt?: EpochMilliseconds;
|
|
148
175
|
name?: string;
|
|
149
176
|
profileImage?: string;
|
|
150
177
|
verified: boolean;
|
|
@@ -155,7 +182,7 @@ type Position = {
|
|
|
155
182
|
* The wire is strict snake_case: absence arrives as an empty string (or the
|
|
156
183
|
* unknown-outcome sentinel `999`), normalized to `undefined` here. Timestamps
|
|
157
184
|
* arrive as epoch seconds and normalize to epoch milliseconds, with `0`
|
|
158
|
-
* (no
|
|
185
|
+
* (no recorded timestamp) normalized to `undefined`.
|
|
159
186
|
*/
|
|
160
187
|
declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
161
188
|
proxy_wallet: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
|
|
@@ -174,7 +201,11 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
174
201
|
total_pnl: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
175
202
|
percent_pnl: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
176
203
|
percent_realized_pnl: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
177
|
-
status: z.ZodEnum<
|
|
204
|
+
status: z.ZodEnum<{
|
|
205
|
+
OPEN: PositionStatus.Open;
|
|
206
|
+
REDEEMABLE: PositionStatus.Redeemable;
|
|
207
|
+
CLOSED: PositionStatus.Closed;
|
|
208
|
+
}>;
|
|
178
209
|
redeemable: z.ZodBoolean;
|
|
179
210
|
mergeable: z.ZodBoolean;
|
|
180
211
|
negative_risk: z.ZodBoolean;
|
|
@@ -190,6 +221,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
190
221
|
opposite_token_id: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>>;
|
|
191
222
|
end_date: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<IsoCalendarDateString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<IsoCalendarDateString, Date>>]>>>;
|
|
192
223
|
last_event_at: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>>;
|
|
224
|
+
first_entry_at: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>>;
|
|
193
225
|
name: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
194
226
|
profile_image: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
195
227
|
verified: z.ZodBoolean;
|
|
@@ -211,7 +243,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
211
243
|
totalPnl: DecimalString;
|
|
212
244
|
percentPnl: DecimalString;
|
|
213
245
|
percentRealizedPnl: DecimalString;
|
|
214
|
-
status: PositionStatus;
|
|
246
|
+
status: PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
215
247
|
redeemable: boolean;
|
|
216
248
|
mergeable: boolean;
|
|
217
249
|
negativeRisk: boolean;
|
|
@@ -228,6 +260,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
228
260
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
229
261
|
endDate: IsoCalendarDateString | undefined;
|
|
230
262
|
lastEventAt: EpochMilliseconds | undefined;
|
|
263
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
231
264
|
name: string | undefined;
|
|
232
265
|
profileImage: string | undefined;
|
|
233
266
|
verified: boolean;
|
|
@@ -248,7 +281,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
248
281
|
total_pnl: DecimalString;
|
|
249
282
|
percent_pnl: DecimalString;
|
|
250
283
|
percent_realized_pnl: DecimalString;
|
|
251
|
-
status: PositionStatus;
|
|
284
|
+
status: PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
252
285
|
redeemable: boolean;
|
|
253
286
|
mergeable: boolean;
|
|
254
287
|
negative_risk: boolean;
|
|
@@ -265,6 +298,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
265
298
|
opposite_token_id?: PositionId | TokenId | undefined;
|
|
266
299
|
end_date?: IsoCalendarDateString | undefined;
|
|
267
300
|
last_event_at?: EpochMilliseconds | undefined;
|
|
301
|
+
first_entry_at?: EpochMilliseconds | undefined;
|
|
268
302
|
name?: string | undefined;
|
|
269
303
|
profile_image?: string | undefined;
|
|
270
304
|
}>>;
|
|
@@ -1342,7 +1376,11 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1342
1376
|
total_pnl: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
1343
1377
|
percent_pnl: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
1344
1378
|
percent_realized_pnl: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
1345
|
-
status: z.ZodEnum<
|
|
1379
|
+
status: z.ZodEnum<{
|
|
1380
|
+
OPEN: PositionStatus.Open;
|
|
1381
|
+
REDEEMABLE: PositionStatus.Redeemable;
|
|
1382
|
+
CLOSED: PositionStatus.Closed;
|
|
1383
|
+
}>;
|
|
1346
1384
|
redeemable: z.ZodBoolean;
|
|
1347
1385
|
mergeable: z.ZodBoolean;
|
|
1348
1386
|
negative_risk: z.ZodBoolean;
|
|
@@ -1358,6 +1396,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1358
1396
|
opposite_token_id: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>>;
|
|
1359
1397
|
end_date: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<IsoCalendarDateString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<IsoCalendarDateString, Date>>]>>>;
|
|
1360
1398
|
last_event_at: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>>;
|
|
1399
|
+
first_entry_at: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>>;
|
|
1361
1400
|
name: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
1362
1401
|
profile_image: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
1363
1402
|
verified: z.ZodBoolean;
|
|
@@ -1379,7 +1418,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1379
1418
|
totalPnl: DecimalString;
|
|
1380
1419
|
percentPnl: DecimalString;
|
|
1381
1420
|
percentRealizedPnl: DecimalString;
|
|
1382
|
-
status: PositionStatus;
|
|
1421
|
+
status: PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
1383
1422
|
redeemable: boolean;
|
|
1384
1423
|
mergeable: boolean;
|
|
1385
1424
|
negativeRisk: boolean;
|
|
@@ -1396,6 +1435,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1396
1435
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
1397
1436
|
endDate: IsoCalendarDateString | undefined;
|
|
1398
1437
|
lastEventAt: EpochMilliseconds | undefined;
|
|
1438
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
1399
1439
|
name: string | undefined;
|
|
1400
1440
|
profileImage: string | undefined;
|
|
1401
1441
|
verified: boolean;
|
|
@@ -1416,7 +1456,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1416
1456
|
total_pnl: DecimalString;
|
|
1417
1457
|
percent_pnl: DecimalString;
|
|
1418
1458
|
percent_realized_pnl: DecimalString;
|
|
1419
|
-
status: PositionStatus;
|
|
1459
|
+
status: PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
1420
1460
|
redeemable: boolean;
|
|
1421
1461
|
mergeable: boolean;
|
|
1422
1462
|
negative_risk: boolean;
|
|
@@ -1433,6 +1473,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1433
1473
|
opposite_token_id?: PositionId | TokenId | undefined;
|
|
1434
1474
|
end_date?: IsoCalendarDateString | undefined;
|
|
1435
1475
|
last_event_at?: EpochMilliseconds | undefined;
|
|
1476
|
+
first_entry_at?: EpochMilliseconds | undefined;
|
|
1436
1477
|
name?: string | undefined;
|
|
1437
1478
|
profile_image?: string | undefined;
|
|
1438
1479
|
}>>>;
|
|
@@ -1461,7 +1502,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1461
1502
|
totalPnl: DecimalString;
|
|
1462
1503
|
percentPnl: DecimalString;
|
|
1463
1504
|
percentRealizedPnl: DecimalString;
|
|
1464
|
-
status: PositionStatus;
|
|
1505
|
+
status: PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
1465
1506
|
redeemable: boolean;
|
|
1466
1507
|
mergeable: boolean;
|
|
1467
1508
|
negativeRisk: boolean;
|
|
@@ -1478,6 +1519,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1478
1519
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
1479
1520
|
endDate: IsoCalendarDateString | undefined;
|
|
1480
1521
|
lastEventAt: EpochMilliseconds | undefined;
|
|
1522
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
1481
1523
|
name: string | undefined;
|
|
1482
1524
|
profileImage: string | undefined;
|
|
1483
1525
|
verified: boolean;
|
|
@@ -1503,7 +1545,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1503
1545
|
totalPnl: DecimalString;
|
|
1504
1546
|
percentPnl: DecimalString;
|
|
1505
1547
|
percentRealizedPnl: DecimalString;
|
|
1506
|
-
status: PositionStatus;
|
|
1548
|
+
status: PositionStatus.Open | PositionStatus.Redeemable | PositionStatus.Closed;
|
|
1507
1549
|
redeemable: boolean;
|
|
1508
1550
|
mergeable: boolean;
|
|
1509
1551
|
negativeRisk: boolean;
|
|
@@ -1520,6 +1562,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1520
1562
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
1521
1563
|
endDate: IsoCalendarDateString | undefined;
|
|
1522
1564
|
lastEventAt: EpochMilliseconds | undefined;
|
|
1565
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
1523
1566
|
name: string | undefined;
|
|
1524
1567
|
profileImage: string | undefined;
|
|
1525
1568
|
verified: boolean;
|
|
@@ -3553,6 +3596,142 @@ type ListMarketHoldersResponse = z.infer<typeof ListMarketHoldersResponseSchema>
|
|
|
3553
3596
|
type FetchOpenInterestResponse = z.infer<typeof FetchOpenInterestResponseSchema>;
|
|
3554
3597
|
type FetchEventLiveVolumeResponse = z.infer<typeof FetchEventLiveVolumeResponseSchema>;
|
|
3555
3598
|
|
|
3599
|
+
declare enum ApprovalStandard {
|
|
3600
|
+
Erc20 = "ERC20",
|
|
3601
|
+
Erc1155 = "ERC1155"
|
|
3602
|
+
}
|
|
3603
|
+
declare const ApprovalContractSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3604
|
+
token: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3605
|
+
spender: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3606
|
+
standard: z.ZodLiteral<ApprovalStandard.Erc20>;
|
|
3607
|
+
amount: z.ZodUnion<readonly [z.ZodLiteral<"max">, z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>]>;
|
|
3608
|
+
approved: z.ZodBoolean;
|
|
3609
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3610
|
+
token: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3611
|
+
spender: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3612
|
+
standard: z.ZodLiteral<ApprovalStandard.Erc1155>;
|
|
3613
|
+
approved: z.ZodBoolean;
|
|
3614
|
+
}, z.core.$strip>], "standard">, z.ZodPipe<z.ZodObject<{
|
|
3615
|
+
token: z.ZodString;
|
|
3616
|
+
spender: z.ZodString;
|
|
3617
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
3618
|
+
token: string;
|
|
3619
|
+
spender: string;
|
|
3620
|
+
standard: undefined;
|
|
3621
|
+
}, {
|
|
3622
|
+
token: string;
|
|
3623
|
+
spender: string;
|
|
3624
|
+
}>>]>;
|
|
3625
|
+
type ApprovalContract = z.infer<typeof ApprovalContractSchema>;
|
|
3626
|
+
/** An indexed approval snapshot. Recent changes may not yet be reflected. */
|
|
3627
|
+
declare const FetchApprovalsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
3628
|
+
data: z.ZodPipe<z.ZodObject<{
|
|
3629
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3630
|
+
chain_id: z.ZodNumber;
|
|
3631
|
+
contracts: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3632
|
+
token: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3633
|
+
spender: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3634
|
+
standard: z.ZodLiteral<ApprovalStandard.Erc20>;
|
|
3635
|
+
amount: z.ZodUnion<readonly [z.ZodLiteral<"max">, z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>]>;
|
|
3636
|
+
approved: z.ZodBoolean;
|
|
3637
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3638
|
+
token: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3639
|
+
spender: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3640
|
+
standard: z.ZodLiteral<ApprovalStandard.Erc1155>;
|
|
3641
|
+
approved: z.ZodBoolean;
|
|
3642
|
+
}, z.core.$strip>], "standard">, z.ZodPipe<z.ZodObject<{
|
|
3643
|
+
token: z.ZodString;
|
|
3644
|
+
spender: z.ZodString;
|
|
3645
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
3646
|
+
token: string;
|
|
3647
|
+
spender: string;
|
|
3648
|
+
standard: undefined;
|
|
3649
|
+
}, {
|
|
3650
|
+
token: string;
|
|
3651
|
+
spender: string;
|
|
3652
|
+
}>>]>>;
|
|
3653
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
3654
|
+
chainId: number;
|
|
3655
|
+
address: _polymarket_types.EvmAddress;
|
|
3656
|
+
contracts: ({
|
|
3657
|
+
token: _polymarket_types.EvmAddress;
|
|
3658
|
+
spender: _polymarket_types.EvmAddress;
|
|
3659
|
+
standard: ApprovalStandard.Erc20;
|
|
3660
|
+
amount: bigint | "max";
|
|
3661
|
+
approved: boolean;
|
|
3662
|
+
} | {
|
|
3663
|
+
token: _polymarket_types.EvmAddress;
|
|
3664
|
+
spender: _polymarket_types.EvmAddress;
|
|
3665
|
+
standard: ApprovalStandard.Erc1155;
|
|
3666
|
+
approved: boolean;
|
|
3667
|
+
} | {
|
|
3668
|
+
token: string;
|
|
3669
|
+
spender: string;
|
|
3670
|
+
standard: undefined;
|
|
3671
|
+
})[];
|
|
3672
|
+
}, {
|
|
3673
|
+
address: _polymarket_types.EvmAddress;
|
|
3674
|
+
chain_id: number;
|
|
3675
|
+
contracts: ({
|
|
3676
|
+
token: _polymarket_types.EvmAddress;
|
|
3677
|
+
spender: _polymarket_types.EvmAddress;
|
|
3678
|
+
standard: ApprovalStandard.Erc20;
|
|
3679
|
+
amount: bigint | "max";
|
|
3680
|
+
approved: boolean;
|
|
3681
|
+
} | {
|
|
3682
|
+
token: _polymarket_types.EvmAddress;
|
|
3683
|
+
spender: _polymarket_types.EvmAddress;
|
|
3684
|
+
standard: ApprovalStandard.Erc1155;
|
|
3685
|
+
approved: boolean;
|
|
3686
|
+
} | {
|
|
3687
|
+
token: string;
|
|
3688
|
+
spender: string;
|
|
3689
|
+
standard: undefined;
|
|
3690
|
+
})[];
|
|
3691
|
+
}>>;
|
|
3692
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
3693
|
+
chainId: number;
|
|
3694
|
+
address: _polymarket_types.EvmAddress;
|
|
3695
|
+
contracts: ({
|
|
3696
|
+
token: _polymarket_types.EvmAddress;
|
|
3697
|
+
spender: _polymarket_types.EvmAddress;
|
|
3698
|
+
standard: ApprovalStandard.Erc20;
|
|
3699
|
+
amount: bigint | "max";
|
|
3700
|
+
approved: boolean;
|
|
3701
|
+
} | {
|
|
3702
|
+
token: _polymarket_types.EvmAddress;
|
|
3703
|
+
spender: _polymarket_types.EvmAddress;
|
|
3704
|
+
standard: ApprovalStandard.Erc1155;
|
|
3705
|
+
approved: boolean;
|
|
3706
|
+
} | {
|
|
3707
|
+
token: string;
|
|
3708
|
+
spender: string;
|
|
3709
|
+
standard: undefined;
|
|
3710
|
+
})[];
|
|
3711
|
+
}, {
|
|
3712
|
+
data: {
|
|
3713
|
+
chainId: number;
|
|
3714
|
+
address: _polymarket_types.EvmAddress;
|
|
3715
|
+
contracts: ({
|
|
3716
|
+
token: _polymarket_types.EvmAddress;
|
|
3717
|
+
spender: _polymarket_types.EvmAddress;
|
|
3718
|
+
standard: ApprovalStandard.Erc20;
|
|
3719
|
+
amount: bigint | "max";
|
|
3720
|
+
approved: boolean;
|
|
3721
|
+
} | {
|
|
3722
|
+
token: _polymarket_types.EvmAddress;
|
|
3723
|
+
spender: _polymarket_types.EvmAddress;
|
|
3724
|
+
standard: ApprovalStandard.Erc1155;
|
|
3725
|
+
approved: boolean;
|
|
3726
|
+
} | {
|
|
3727
|
+
token: string;
|
|
3728
|
+
spender: string;
|
|
3729
|
+
standard: undefined;
|
|
3730
|
+
})[];
|
|
3731
|
+
};
|
|
3732
|
+
}>>;
|
|
3733
|
+
type ApprovalsSnapshot = z.infer<typeof FetchApprovalsResponseSchema>;
|
|
3734
|
+
|
|
3556
3735
|
/**
|
|
3557
3736
|
* Parses the data-service paginated list envelope straight into the SDK's page shape
|
|
3558
3737
|
* — `{ items, hasMore, nextCursor }` — so actions hand the result to the
|
|
@@ -4273,6 +4452,14 @@ declare enum ResolutionReporter {
|
|
|
4273
4452
|
Eoa = "EOA"
|
|
4274
4453
|
}
|
|
4275
4454
|
declare const ResolutionReporterSchema: z.ZodEnum<typeof ResolutionReporter>;
|
|
4455
|
+
/** Basis for a resolution's earliest estimated settlement time. */
|
|
4456
|
+
declare enum ResolutionSettlementTimeBasis {
|
|
4457
|
+
ManagedProposalExpiration = "managed_proposal_expiration",
|
|
4458
|
+
ProposalExpiration = "proposal_expiration",
|
|
4459
|
+
Liveness = "liveness",
|
|
4460
|
+
DvmRoundEstimate = "dvm_round_estimate"
|
|
4461
|
+
}
|
|
4462
|
+
declare const ResolutionSettlementTimeBasisSchema: z.ZodEnum<typeof ResolutionSettlementTimeBasis>;
|
|
4276
4463
|
type Resolution = {
|
|
4277
4464
|
/** Oracle question identifier, when the resolution has one. */
|
|
4278
4465
|
questionId?: QuestionId;
|
|
@@ -4281,6 +4468,10 @@ type Resolution = {
|
|
|
4281
4468
|
status: ResolutionStatus;
|
|
4282
4469
|
/** Whether a managed proposal is in extended review. */
|
|
4283
4470
|
extendedReview: boolean;
|
|
4471
|
+
/** Earliest estimated settlement time, not a deadline; may have elapsed. */
|
|
4472
|
+
expectedSettlementTime?: IsoDateTimeString;
|
|
4473
|
+
/** Estimate basis, omitted when unavailable. Voting estimates can roll to a later round. */
|
|
4474
|
+
settlementTimeBasis?: ResolutionSettlementTimeBasis;
|
|
4284
4475
|
/** Whether the resolution was disputed at any point. */
|
|
4285
4476
|
wasDisputed: boolean;
|
|
4286
4477
|
/** Whether the question rules were updated after the question was posed. */
|
|
@@ -4311,6 +4502,8 @@ declare const ResolutionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4311
4502
|
condition_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>;
|
|
4312
4503
|
status: z.ZodEnum<typeof ResolutionStatus>;
|
|
4313
4504
|
extended_review: z.ZodBoolean;
|
|
4505
|
+
expected_settlement_time: z.ZodOptional<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<IsoDateTimeString, string>>>;
|
|
4506
|
+
settlement_time_basis: z.ZodOptional<z.ZodEnum<typeof ResolutionSettlementTimeBasis>>;
|
|
4314
4507
|
was_disputed: z.ZodBoolean;
|
|
4315
4508
|
new_version_q: z.ZodBoolean;
|
|
4316
4509
|
proposed_price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
@@ -4336,6 +4529,8 @@ declare const ResolutionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4336
4529
|
last_update_timestamp: IsoDateTimeString;
|
|
4337
4530
|
question_id?: QuestionId | undefined;
|
|
4338
4531
|
condition_id?: ConditionId | undefined;
|
|
4532
|
+
expected_settlement_time?: IsoDateTimeString | undefined;
|
|
4533
|
+
settlement_time_basis?: ResolutionSettlementTimeBasis | undefined;
|
|
4339
4534
|
proposed_price?: DecimalString | undefined;
|
|
4340
4535
|
reproposed_price?: DecimalString | undefined;
|
|
4341
4536
|
price?: DecimalString | undefined;
|
|
@@ -4353,6 +4548,8 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4353
4548
|
condition_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>;
|
|
4354
4549
|
status: z.ZodEnum<typeof ResolutionStatus>;
|
|
4355
4550
|
extended_review: z.ZodBoolean;
|
|
4551
|
+
expected_settlement_time: z.ZodOptional<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<IsoDateTimeString, string>>>;
|
|
4552
|
+
settlement_time_basis: z.ZodOptional<z.ZodEnum<typeof ResolutionSettlementTimeBasis>>;
|
|
4356
4553
|
was_disputed: z.ZodBoolean;
|
|
4357
4554
|
new_version_q: z.ZodBoolean;
|
|
4358
4555
|
proposed_price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
@@ -4378,6 +4575,8 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4378
4575
|
last_update_timestamp: IsoDateTimeString;
|
|
4379
4576
|
question_id?: QuestionId | undefined;
|
|
4380
4577
|
condition_id?: ConditionId | undefined;
|
|
4578
|
+
expected_settlement_time?: IsoDateTimeString | undefined;
|
|
4579
|
+
settlement_time_basis?: ResolutionSettlementTimeBasis | undefined;
|
|
4381
4580
|
proposed_price?: DecimalString | undefined;
|
|
4382
4581
|
reproposed_price?: DecimalString | undefined;
|
|
4383
4582
|
price?: DecimalString | undefined;
|
|
@@ -4394,4 +4593,4 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4394
4593
|
}>>;
|
|
4395
4594
|
type FetchResolutionsResponse = z.infer<typeof FetchResolutionsResponseSchema>;
|
|
4396
4595
|
|
|
4397
|
-
export { type Activity, type ActivityBase, ActivitySchema, ActivityType, ActivityTypeSchema, type BiggestWinner, BiggestWinnerKind, BiggestWinnerKindSchema, BiggestWinnerSchema, type BuilderStanding, BuilderStandingSchema, BuilderVolumeInterval, BuilderVolumeIntervalSchema, type BuilderVolumePoint, BuilderVolumePointSchema, CanonicalMarketConditionIdSchema, type ClobTradeActivity, type ComboActivity, ComboActivitySchema, ComboActivityType, type ComboBiggestWinner, type ComboCompressActivity, type ComboConvertActivity, type ComboMergeActivity, type ComboPosition, type ComboPositionLeg, ComboPositionLegSchema, type ComboPositionMarket, type ComboPositionMarketEvent, ComboPositionMarketEventSchema, ComboPositionMarketSchema, ComboPositionSchema, ComboPositionSortBy, ComboPositionSortBySchema, ComboPositionStatus, ComboPositionStatusSchema, type ComboRedeemActivity, type ComboSplitActivity, type ComboTradeActivity, type ComboUnwrapActivity, type ComboWrapActivity, type ConversionActivity, type DepositActivity, type FetchBuilderVolumeResponse, FetchBuilderVolumeResponseSchema, type FetchEventLiveVolumeResponse, FetchEventLiveVolumeResponseSchema, type FetchOpenInterestResponse, FetchOpenInterestResponseSchema, type FetchPortfolioValueResponse, FetchPortfolioValueResponseSchema, type FetchResolutionsResponse, FetchResolutionsResponseSchema, type FetchTraderLeaderboardStandingResponse, FetchTraderLeaderboardStandingResponseSchema, type FetchUserPnlResponse, FetchUserPnlResponseSchema, type FetchUserStatsResponse, FetchUserStatsResponseSchema, type FetchUserVolumeResponse, FetchUserVolumeResponseSchema, type Holder, HolderSchema, LeaderboardWindow, LeaderboardWindowSchema, type ListActivityResponse, ListActivityResponseSchema, type ListBiggestWinnersResponse, ListBiggestWinnersResponseSchema, type ListBuilderLeaderboardResponse, ListBuilderLeaderboardResponseSchema, type ListComboActivityResponse, ListComboActivityResponseSchema, type ListComboPositionsResponse, ListComboPositionsResponseSchema, type ListMarketHoldersResponse, ListMarketHoldersResponseSchema, type ListPositionsResponse, ListPositionsResponseSchema, type ListPriceHistoryResponse, ListPriceHistoryResponseSchema, type ListTraderLeaderboardResponse, ListTraderLeaderboardResponseSchema, type ListTradesResponse, ListTradesResponseSchema, type LiveVolume, LiveVolumeSchema, type MakerRebateActivity, type MarketBiggestWinner, type MarketLiveVolume, MarketLiveVolumeSchema, type MergeActivity, type MetaHolder, MetaHolderSchema, type MigrationActivity, type OpenInterest, OpenInterestSchema, type PortfolioValue, PortfolioValueSchema, type Position, PositionFilterType, PositionFilterTypeSchema, PositionSchema, PositionSortBy, PositionSortBySchema, PositionStatus, PositionStatusSchema, PriceHistoryInterval, PriceHistoryIntervalSchema, type PriceHistoryPoint, PriceHistoryPointSchema, type RedeemActivity, type ReferralRewardActivity, type Resolution, ResolutionMarketType, ResolutionMarketTypeSchema, ResolutionReporter, ResolutionReporterSchema, ResolutionSchema, ResolutionSource, ResolutionSourceSchema, ResolutionStatus, ResolutionStatusSchema, type RewardActivity, SortDirection, SortDirectionSchema, type SplitActivity, type TakerRebateActivity, type TipActivity, TipSide, TipSideSchema, type Trade, type TradeActivity, TradeFilterType, TradeFilterTypeSchema, TradeSchema, type TraderLeaderboardEntry, TraderLeaderboardEntrySchema, TraderLeaderboardSort, TraderLeaderboardSortSchema, type TraderLeaderboardStanding, TraderLeaderboardStandingSchema, UserPnlFidelity, UserPnlFidelitySchema, UserPnlInterval, UserPnlIntervalSchema, type UserPnlPoint, UserPnlPointSchema, type UserPnlSeries, UserPnlSeriesSchema, type UserStats, UserStatsSchema, type UserVolume, UserVolumeSchema, type WithdrawalActivity, type YieldActivity, dataEnvelopeSchema, dataPageSchema };
|
|
4596
|
+
export { type Activity, type ActivityBase, ActivitySchema, ActivityType, ActivityTypeSchema, type ApprovalContract, ApprovalStandard, type ApprovalsSnapshot, type BiggestWinner, BiggestWinnerKind, BiggestWinnerKindSchema, BiggestWinnerSchema, type BuilderStanding, BuilderStandingSchema, BuilderVolumeInterval, BuilderVolumeIntervalSchema, type BuilderVolumePoint, BuilderVolumePointSchema, CanonicalMarketConditionIdSchema, type ClobTradeActivity, type ComboActivity, ComboActivitySchema, ComboActivityType, type ComboBiggestWinner, type ComboCompressActivity, type ComboConvertActivity, type ComboMergeActivity, type ComboPosition, type ComboPositionLeg, ComboPositionLegSchema, type ComboPositionMarket, type ComboPositionMarketEvent, ComboPositionMarketEventSchema, ComboPositionMarketSchema, ComboPositionSchema, ComboPositionSortBy, ComboPositionSortBySchema, ComboPositionStatus, ComboPositionStatusSchema, type ComboRedeemActivity, type ComboSplitActivity, type ComboTradeActivity, type ComboUnwrapActivity, type ComboWrapActivity, type ConversionActivity, type DepositActivity, FetchApprovalsResponseSchema, type FetchBuilderVolumeResponse, FetchBuilderVolumeResponseSchema, type FetchEventLiveVolumeResponse, FetchEventLiveVolumeResponseSchema, type FetchOpenInterestResponse, FetchOpenInterestResponseSchema, type FetchPortfolioValueResponse, FetchPortfolioValueResponseSchema, type FetchResolutionsResponse, FetchResolutionsResponseSchema, type FetchTraderLeaderboardStandingResponse, FetchTraderLeaderboardStandingResponseSchema, type FetchUserPnlResponse, FetchUserPnlResponseSchema, type FetchUserStatsResponse, FetchUserStatsResponseSchema, type FetchUserVolumeResponse, FetchUserVolumeResponseSchema, type Holder, HolderSchema, LeaderboardWindow, LeaderboardWindowSchema, type ListActivityResponse, ListActivityResponseSchema, type ListBiggestWinnersResponse, ListBiggestWinnersResponseSchema, type ListBuilderLeaderboardResponse, ListBuilderLeaderboardResponseSchema, type ListComboActivityResponse, ListComboActivityResponseSchema, type ListComboPositionsResponse, ListComboPositionsResponseSchema, type ListMarketHoldersResponse, ListMarketHoldersResponseSchema, type ListPositionsResponse, ListPositionsResponseSchema, type ListPriceHistoryResponse, ListPriceHistoryResponseSchema, type ListTraderLeaderboardResponse, ListTraderLeaderboardResponseSchema, type ListTradesResponse, ListTradesResponseSchema, type LiveVolume, LiveVolumeSchema, type MakerRebateActivity, type MarketBiggestWinner, type MarketLiveVolume, MarketLiveVolumeSchema, type MergeActivity, type MetaHolder, MetaHolderSchema, type MigrationActivity, type OpenInterest, OpenInterestSchema, type PortfolioValue, PortfolioValueSchema, type Position, PositionFilterType, PositionFilterTypeSchema, type PositionRowStatus, PositionRowStatusSchema, PositionSchema, PositionSortBy, PositionSortBySchema, PositionStatus, PositionStatusSchema, PriceHistoryInterval, PriceHistoryIntervalSchema, type PriceHistoryPoint, PriceHistoryPointSchema, type RedeemActivity, type ReferralRewardActivity, type Resolution, ResolutionMarketType, ResolutionMarketTypeSchema, ResolutionReporter, ResolutionReporterSchema, ResolutionSchema, ResolutionSettlementTimeBasis, ResolutionSettlementTimeBasisSchema, ResolutionSource, ResolutionSourceSchema, ResolutionStatus, ResolutionStatusSchema, type RewardActivity, SortDirection, SortDirectionSchema, type SplitActivity, type TakerRebateActivity, type TipActivity, TipSide, TipSideSchema, type Trade, type TradeActivity, TradeFilterType, TradeFilterTypeSchema, TradeSchema, type TraderLeaderboardEntry, TraderLeaderboardEntrySchema, TraderLeaderboardSort, TraderLeaderboardSortSchema, type TraderLeaderboardStanding, TraderLeaderboardStandingSchema, UserPnlFidelity, UserPnlFidelitySchema, UserPnlInterval, UserPnlIntervalSchema, type UserPnlPoint, UserPnlPointSchema, type UserPnlSeries, UserPnlSeriesSchema, type UserStats, UserStatsSchema, type UserVolume, UserVolumeSchema, type WithdrawalActivity, type YieldActivity, dataEnvelopeSchema, dataPageSchema };
|
package/dist/data/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {aa,Qa,Ea,ca,ea,pa,oa,Da,$,Na,_,za,Ta,X,ma,Pa,ha,Oa,Fa,p,F}from'../chunk-RGWF46B7.js';import {z}from'zod';var G=(p=>(p.TRADE="TRADE",p.SPLIT="SPLIT",p.MERGE="MERGE",p.REDEEM="REDEEM",p.REWARD="REWARD",p.CONVERSION="CONVERSION",p.MIGRATION="MIGRATION",p.MAKER_REBATE="MAKER_REBATE",p.REFERRAL_REWARD="REFERRAL_REWARD",p.YIELD="YIELD",p.DEPOSIT="DEPOSIT",p.WITHDRAWAL="WITHDRAWAL",p.TAKER_REBATE="TAKER_REBATE",p.TIP="TIP",p))(G||{}),ne=z.enum(G),ie=(i=>(i.In="IN",i.Out="OUT",i))(ie||{}),q=z.enum(ie),re=(i=>(i.Asc="ASC",i.Desc="DESC",i))(re||{}),At=z.enum(re),se=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(se||{}),Ct=z.enum(se);function Me(e){let t=e.length===64?`${e}00`:e;return p(t.toLowerCase())}function Oe(e){if(e.length===66)return true;let t=e.toLowerCase();return t.startsWith("0x01")||t.startsWith("0x02")}var Rt=aa.refine(Oe,"Expected a 32-byte condition ID or a 31-byte protocol v2 market condition ID").transform(Me);function b(e){return z.object({data:z.array(e),pagination:z.object({limit:z.number().int(),offset:z.number().int(),has_more:z.boolean(),next_cursor:z.string().min(1).nullable()})}).refine(t=>t.pagination.has_more===(t.pagination.next_cursor!==null),{message:"has_more and next_cursor must agree",path:["pagination","next_cursor"]}).transform(({data:t,pagination:i})=>({items:t,hasMore:i.has_more,nextCursor:i.next_cursor===null?void 0:F(i.next_cursor)}))}function I(e){return z.object({data:e}).transform(t=>t.data)}var le=(s=>(s.Open="OPEN",s.Redeemable="REDEEMABLE",s.Partial="PARTIAL",s.ResolvedPartial="RESOLVED_PARTIAL",s.ResolvedWin="RESOLVED_WIN",s.ResolvedLoss="RESOLVED_LOSS",s))(le||{}),me=z.enum(le),de=(a=>(a.Open="OPEN",a.Redeemable="REDEEMABLE",a.Closed="CLOSED",a))(de||{}),Ue=z.enum(de),ce=(s=>(s.CurrentValue="CURRENT_VALUE",s.Tokens="TOKENS",s.UnrealizedPnl="UNREALIZED_PNL",s.RealizedPnl="REALIZED_PNL",s.TotalPnl="TOTAL_PNL",s.Timestamp="TIMESTAMP",s))(ce||{}),Mt=z.enum(ce),pe=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(pe||{}),Ot=z.enum(pe),ue=(l=>(l.FirstEntry="FIRST_ENTRY",l.EntryCost="ENTRY_COST",l.CurrentValue="CURRENT_VALUE",l.Updated="UPDATED",l))(ue||{}),Ut=z.enum(ue),R=z.preprocess(e=>e===""?void 0:e,z.string().optional()),Be=z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),Ne=z.object({proxy_wallet:ca,token_id:Ea,condition_id:aa,current_size:Qa,avg_price:Qa,entry_cost_usdc:Qa,entry_fees_usdc:Qa,total_cost_usdc:Qa,current_price:Qa,current_value:Qa,total_size:Qa,realized_pnl:Qa,unrealized_pnl:Qa,total_pnl:Qa,percent_pnl:Qa,percent_realized_pnl:Qa,status:Ue,redeemable:z.boolean(),mergeable:z.boolean(),negative_risk:z.boolean(),archived:z.boolean(),title:R,slug:R,icon:R,event_id:R,event_slug:R,outcome:R,outcome_index:Be,opposite_outcome:R,opposite_token_id:z.preprocess(e=>e===""?void 0:e,Ea.optional()),end_date:z.preprocess(e=>e===""?void 0:e,pa.optional()),last_event_at:z.preprocess(e=>e===0?void 0:e,ea.optional()),name:R,profile_image:R,verified:z.boolean()}).transform(e=>({wallet:e.proxy_wallet,assetId:e.token_id,tokenId:e.token_id,conditionId:e.condition_id,currentSize:e.current_size,avgPrice:e.avg_price,entryCostUsdc:e.entry_cost_usdc,entryFeesUsdc:e.entry_fees_usdc,totalCostUsdc:e.total_cost_usdc,currentPrice:e.current_price,currentValue:e.current_value,totalSize:e.total_size,realizedPnl:e.realized_pnl,unrealizedPnl:e.unrealized_pnl,totalPnl:e.total_pnl,percentPnl:e.percent_pnl,percentRealizedPnl:e.percent_realized_pnl,status:e.status,redeemable:e.redeemable,mergeable:e.mergeable,negativeRisk:e.negative_risk,archived:e.archived,title:e.title,slug:e.slug,icon:e.icon,eventId:e.event_id,eventSlug:e.event_slug,outcome:e.outcome,outcomeIndex:e.outcome_index,oppositeOutcome:e.opposite_outcome,oppositeAssetId:e.opposite_token_id,oppositeTokenId:e.opposite_token_id,endDate:e.end_date,lastEventAt:e.last_event_at,name:e.name,profileImage:e.profile_image,verified:e.verified})),Ve=z.object({proxy_wallet:ca,value:Qa}).transform(({proxy_wallet:e,value:t})=>({wallet:e,value:t})),ge=(s=>(s.Max="max",s.OneMonth="1m",s.OneWeek="1w",s.OneDay="1d",s.TwelveHours="12h",s.SixHours="6h",s))(ge||{}),We=z.enum(ge),_e=(c=>(c.OneDay="1d",c.EighteenHours="18h",c.TwelveHours="12h",c.ThreeHours="3h",c.OneHour="1h",c))(_e||{}),ae=z.enum(_e),u=Qa.nullish().transform(e=>e??null),ye=z.object({timestamp:ea,source_block:z.number().int().nonnegative(),realized_market_pnl:Qa,realized_lp_pnl:Qa,realized_combo_pnl:Qa,unrealized_pnl:u,fees_refunded:u,maker_rebate:u,taker_rebate:u,reward_income:u,yield_income:u,referral_income:u,deposits:u,withdrawals:u,realized_pnl:Qa,wallet_income:u,position_pnl:u,settled_pnl:u,economic_pnl:u,trade_pnl:u,sponsored_income:u,fees:u,fees_paid:u,cashflow_net:u,volume:Qa,volume_usdc:Qa,trade_count:z.number().int().nonnegative()}).transform(({source_block:e,realized_market_pnl:t,realized_lp_pnl:i,realized_combo_pnl:a,unrealized_pnl:l,fees_refunded:c,maker_rebate:s,taker_rebate:h,reward_income:L,yield_income:f,referral_income:V,realized_pnl:W,wallet_income:w,position_pnl:H,settled_pnl:p,economic_pnl:F,trade_pnl:j,sponsored_income:Z,fees_paid:De,cashflow_net:ke,volume_usdc:Pe,trade_count:ze,...Le})=>({...Le,sourceBlock:e,realizedMarketPnl:t,realizedLpPnl:i,realizedComboPnl:a,unrealizedPnl:l,feesRefunded:c,makerRebate:s,takerRebate:h,rewardIncome:L,yieldIncome:f,referralIncome:V,realizedPnl:W,walletIncome:w,positionPnl:H,settledPnl:p,economicPnl:F,tradePnl:j,sponsoredIncome:Z,feesPaid:De,cashflowNet:ke,volumeUsdc:Pe,tradeCount:ze})),we=z.object({proxy_wallet:ca,interval:We,fidelity:ae,source_fidelity:ae,points:z.array(ye)}).transform(({proxy_wallet:e,source_fidelity:t,...i})=>({...i,wallet:e,sourceFidelity:t})),He=z.object({volume:Qa,volume_usdc:Qa,trade_count:z.number().int().nonnegative()}).transform(({volume_usdc:e,trade_count:t,...i})=>({...i,volumeUsdc:e,tradeCount:t})),Fe=z.object({proxy_wallet:ca,trades:z.number().int().nonnegative(),biggest_win:Qa,views:z.number().int().nonnegative(),join_date:ea.nullish(),all_time_pnl:ye.nullish()}).transform(({proxy_wallet:e,trades:t,biggest_win:i,join_date:a,all_time_pnl:l,...c})=>({...c,wallet:e,tradedMarketCount:t,biggestWin:i,joinDate:a??null,allTimePnl:l??null})),je=z.object({event_id:z.string().nullish(),event_slug:z.string().nullish(),event_title:z.string().nullish(),event_image:z.string().nullish()}).transform(({event_id:e,event_slug:t,event_title:i,event_image:a})=>({eventId:e,eventSlug:t,eventTitle:i,eventImage:a})),Ze=z.object({market_id:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),question:z.string().nullish(),group_item_title:z.string().nullish(),sports_market_type:z.string().nullish(),line:z.number().nullish(),outcomes:z.array(z.string()).nullish(),outcome:z.string().nullish(),image_url:z.string().nullish(),icon_url:z.string().nullish(),category:z.string().nullish(),subcategory:z.string().nullish(),tags:z.array(z.string()).nullish(),end_date:oa.nullish(),event:je.nullish()}).transform(({market_id:e,image_url:t,icon_url:i,end_date:a,group_item_title:l,sports_market_type:c,...s})=>({...s,marketId:e,groupItemTitle:l,sportsMarketType:c,imageUrl:t,iconUrl:i,endDate:a})),Y=z.object({leg_index:z.number().int(),leg_position_id:Da,leg_condition_id:aa,leg_outcome_index:z.number().int(),leg_outcome_label:z.string().nullish(),leg_status:me,leg_resolved_at:oa.nullish(),leg_current_price:Qa.nullish(),market:Ze.nullish()}).transform(({leg_index:e,leg_position_id:t,leg_condition_id:i,leg_outcome_index:a,leg_outcome_label:l,leg_status:c,leg_resolved_at:s,leg_current_price:h,...L})=>({...L,legIndex:e,legPositionId:t,legConditionId:i,legOutcomeIndex:a,legOutcomeLabel:l,legStatus:c,legResolvedAt:s,legCurrentPrice:h})),Ke=z.object({combo_condition_id:$,outcome_index:z.number().int(),outcome_label:z.string(),combo_position_id:Da,proxy_wallet:ca,current_size:Qa,entry_avg_price_usdc:Qa,entry_cost_usdc:Qa,gross_entry_cost_usdc:Qa,entry_fees_usdc:Qa,realized_payout_usdc:Qa,status:me,redeemable:z.boolean(),first_entry_at:oa,resolved_at:oa.nullish(),legs_total:z.number().int(),legs_resolved:z.number().int(),legs_pending:z.number().int(),legs:z.array(Y),updated_at:oa}).transform(({combo_condition_id:e,outcome_index:t,outcome_label:i,combo_position_id:a,proxy_wallet:l,current_size:c,entry_avg_price_usdc:s,entry_cost_usdc:h,gross_entry_cost_usdc:L,entry_fees_usdc:f,realized_payout_usdc:V,first_entry_at:W,resolved_at:w,legs_total:H,legs_resolved:p,legs_pending:F,updated_at:j,...Z})=>({...Z,conditionId:e,outcomeIndex:t,outcomeLabel:i,positionId:a,wallet:l,currentSize:c,entryAvgPriceUsdc:s,entryCostUsdc:h,grossEntryCostUsdc:L,entryFeesUsdc:f,realizedPayoutUsdc:V,firstEntryAt:W,resolvedAt:w,legsTotal:H,legsResolved:p,legsPending:F,updatedAt:j})),Bt=b(Ne),Nt=I(Ve),Vt=I(Fe.nullable()),Wt=I(we),wt=I(He),Ht=b(Ke);var Se=(h=>(h.Split="SPLIT",h.Merge="MERGE",h.Convert="CONVERT",h.Compress="COMPRESS",h.Wrap="WRAP",h.Unwrap="UNWRAP",h.Redeem="REDEEM",h))(Se||{}),Ge=z.enum(Se),qe=z.object({id:_,type:Ge,proxy_wallet:ca,combo_condition_id:$,combo_position_id:Da,amount_usdc:Qa.nullish(),payout_usdc:Qa.nullish(),timestamp:ea,transaction_hash:Na,block_number:z.number().int(),legs:z.array(Y)}),Ye=qe.transform(Xe),m=z.preprocess(e=>e===""?void 0:e,z.string().optional()),be=z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),Qe=z.object({proxy_wallet:ca,side:za,token_id:Ea,condition_id:aa,size:Qa,price:Qa,timestamp:ea,title:m,slug:m,icon:m,event_slug:m,outcome:m,outcome_index:be,name:m,pseudonym:m,bio:m,profile_image:m,profile_image_optimized:m,transaction_hash:Na}).transform(e=>({wallet:e.proxy_wallet,side:e.side,assetId:e.token_id,tokenId:e.token_id,conditionId:e.condition_id,size:e.size,price:e.price,timestamp:e.timestamp,title:e.title,slug:e.slug,icon:e.icon,eventSlug:e.event_slug,outcome:e.outcome,outcomeIndex:e.outcome_index,name:e.name,pseudonym:e.pseudonym,bio:e.bio,profileImage:e.profile_image,profileImageOptimized:e.profile_image_optimized,transactionHash:e.transaction_hash})),$e=z.object({proxy_wallet:ca,timestamp:ea,condition_id:z.preprocess(e=>e===""?void 0:e,aa.optional()),type:ne,size:Qa,usdc_size:Qa,transaction_hash:Na,price:Qa,token_id:z.preprocess(e=>e===""?void 0:e,Ea.optional()),side:z.preprocess(e=>e===""?void 0:e,z.union([za,q]).optional()),is_combo:z.boolean().optional(),outcome_index:be,title:m,slug:m,icon:m,event_slug:m,outcome:m,name:m,pseudonym:m,bio:m,profile_image:m,profile_image_optimized:m}),Je=$e.transform(tt),Yt=b(Qe),Qt=b(Je),$t=b(Ye);function Xe(e){let t=et(e);switch(e.type){case "SPLIT":return {...t,type:"SPLIT"};case "MERGE":return {...t,type:"MERGE"};case "CONVERT":return {...t,type:"CONVERT"};case "COMPRESS":return {...t,type:"COMPRESS"};case "WRAP":return {...t,type:"WRAP"};case "UNWRAP":return {...t,type:"UNWRAP"};case "REDEEM":return {...t,type:"REDEEM",payout:e.payout_usdc??null}}}function et(e){return {id:e.id,type:e.type,wallet:e.proxy_wallet,conditionId:e.combo_condition_id,positionId:e.combo_position_id,amount:e.amount_usdc??null,timestamp:e.timestamp,transactionHash:e.transaction_hash,blockNumber:e.block_number,legs:e.legs}}function tt(e){let t=nt(e);switch(e.type){case "TRADE":return ot(e,t);case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...t,type:e.type,conditionId:x(e.condition_id,"condition_id"),amount:e.usdc_size,title:x(e.title,"title"),slug:x(e.slug,"slug"),icon:e.icon??null,eventSlug:x(e.event_slug,"event_slug")};case "MIGRATION":case "REWARD":case "MAKER_REBATE":case "REFERRAL_REWARD":case "YIELD":case "DEPOSIT":case "WITHDRAWAL":case "TAKER_REBATE":return {...t,type:e.type,amount:e.usdc_size};case "TIP":return {...t,type:e.type,amount:e.usdc_size,side:e.side===void 0?null:q.parse(e.side)}}}function ot(e,t){let i={...t,type:"TRADE",side:za.parse(x(e.side,"side")),shares:e.size,amount:e.usdc_size,price:e.price,title:x(e.title,"title"),icon:e.icon??null};if(e.is_combo===true)return {...i,isCombo:true,conditionId:$.parse(x(e.condition_id,"condition_id")),positionId:Da.parse(x(e.token_id,"token_id"))};let a=x(e.token_id,"token_id");return {...i,isCombo:false,conditionId:x(e.condition_id,"condition_id"),assetId:a,tokenId:a,outcome:x(e.outcome,"outcome"),outcomeIndex:e.outcome_index,slug:x(e.slug,"slug"),eventSlug:x(e.event_slug,"event_slug")}}function nt(e){return {wallet:e.proxy_wallet,timestamp:e.timestamp,transactionHash:e.transaction_hash,name:e.name??null,pseudonym:e.pseudonym??null,bio:e.bio??null,profileImage:e.profile_image??null,profileImageOptimized:e.profile_image_optimized??null}}function x(e,t){if(e==null)throw new TypeError(`Expected activity.${t} to be present`);return e}var he=(s=>(s.Max="max",s.OneMonth="1m",s.OneWeek="1w",s.OneDay="1d",s.SixHours="6h",s.OneHour="1h",s))(he||{}),oo=z.enum(he),it=z.object({timestamp:ea,price:Qa,resolution_seconds:z.number().int().nonnegative()}).transform(({price:e,resolution_seconds:t,timestamp:i})=>({timestamp:i,price:e,resolutionSeconds:t})),no=b(it),M=z.preprocess(e=>e===""?null:e,z.string().nullable()),rt=z.object({proxy_wallet:ca,bio:M,token_id:Ea,pseudonym:M,amount:Qa,display_username_public:z.boolean(),outcome_index:z.preprocess(e=>e===999?null:e,z.number().int().nullable()),name:M,profile_image:M,profile_image_optimized:M,verified:z.boolean(),avg_price:Qa.nullish(),entry_cost_usdc:Qa.nullish(),current_price:Qa.nullish(),current_value:Qa.nullish(),realized_pnl:Qa.nullish(),unrealized_pnl:Qa.nullish(),total_pnl:Qa.nullish()}).transform(e=>({wallet:e.proxy_wallet,assetId:e.token_id,tokenId:e.token_id,amount:e.amount,displayUsernamePublic:e.display_username_public,outcomeIndex:e.outcome_index,verified:e.verified,bio:e.bio,pseudonym:e.pseudonym,name:e.name,profileImage:e.profile_image,profileImageOptimized:e.profile_image_optimized,avgPrice:e.avg_price,entryCostUsdc:e.entry_cost_usdc,currentPrice:e.current_price,currentValue:e.current_value,realizedPnl:e.realized_pnl,unrealizedPnl:e.unrealized_pnl,totalPnl:e.total_pnl})),st=z.object({token_id:Ea,holders:z.array(rt)}).transform(({holders:e,token_id:t})=>({assetId:t,token:t,holders:e})),at=z.object({condition_id:z.union([aa,z.literal("GLOBAL")]),value:Qa}).transform(({condition_id:e,value:t})=>({conditionId:e==="GLOBAL"?null:e,value:t})),lt=z.object({condition_id:z.preprocess(Ta,aa.nullable()),taker_volume:Qa}).transform(({condition_id:e,taker_volume:t})=>({conditionId:e,takerVolume:t})),mt=z.object({taker_volume_total:Qa,conditions:z.array(lt)}).transform(({conditions:e,taker_volume_total:t})=>({markets:e,takerVolumeTotal:t})),io=b(st),ro=I(z.array(at)),so=I(mt);var fe=(l=>(l.Day="day",l.Week="week",l.Month="month",l.All="all",l))(fe||{}),po=z.enum(fe),ve=(l=>(l.Day="day",l.Week="week",l.Month="month",l.Year="all",l))(ve||{}),uo=z.enum(ve),Ie=(i=>(i.Pnl="PNL",i.Volume="VOLUME",i))(Ie||{}),go=z.enum(Ie),xe=(i=>(i.Market="market",i.Combo="combo",i))(xe||{}),_o=z.enum(xe),dt=z.object({rank:z.number().int().positive(),builder_name:z.string(),builder_code:X,profile_image:z.string(),verified:z.boolean(),volume:Qa,active_users:z.number().int().min(0)}).transform(({active_users:e,builder_code:t,builder_name:i,profile_image:a,...l})=>({...l,activeUsers:e,builderCode:t,builderName:i,...a===""?{}:{profileImage:a}})),ct=z.object({date:pa,rank:z.number().int().min(0),builder_name:z.string(),builder_code:X,profile_image:z.string(),verified:z.boolean(),volume:Qa,active_users:z.number().int().min(0)}).transform(({active_users:e,builder_code:t,builder_name:i,date:a,profile_image:l,...c})=>({...c,activeUsers:e,bucketDate:a,builderCode:t,builderName:i,...l===""?{}:{profileImage:l}})),C=z.preprocess(Ta,z.string().nullable()),pt=z.object({rank:z.number().int().min(0),user_id:ca,pnl:Qa,volume:Qa,user_name:C,profile_image:C,x_username:C,verified:z.boolean()}).transform(({profile_image:e,user_id:t,user_name:i,x_username:a,...l})=>({...l,wallet:t,userName:i,profileImage:e,xUsername:a})),ut=z.object({user_id:ca,pnl:Qa,volume:Qa,rank_pnl:z.number().int().positive().nullable(),rank_volume:z.number().int().positive().nullable(),user_name:C,profile_image:C,x_username:C,verified:z.boolean()}).transform(({profile_image:e,rank_pnl:t,rank_volume:i,user_id:a,user_name:l,x_username:c,...s})=>({...s,wallet:a,pnlRank:t,volumeRank:i,userName:l,profileImage:e,xUsername:c})),gt=z.object({win_rank:z.number().int().positive(),kind:z.literal("market"),user_id:ca,pnl:Qa,initial_value:Qa,final_value:Qa,resolved_at:ea,condition_id:aa,position_id:Ea,event_id:ma,event_slug:z.string(),event_title:z.string(),user_name:C,profile_image:C}),_t=z.object({win_rank:z.number().int().positive(),kind:z.literal("combo"),user_id:ca,pnl:Qa,initial_value:Qa,final_value:Qa,resolved_at:ea,condition_id:$,position_id:Da,event_id:z.literal(0),event_slug:z.literal(""),event_title:z.string(),user_name:C,profile_image:C}),yt=z.discriminatedUnion("kind",[gt,_t]).transform(e=>e.kind==="combo"?{rank:e.win_rank,kind:e.kind,wallet:e.user_id,pnl:e.pnl,initialValue:e.initial_value,finalValue:e.final_value,resolvedAt:e.resolved_at,conditionId:e.condition_id,positionId:e.position_id,eventId:null,eventSlug:null,eventTitle:e.event_title,userName:e.user_name,profileImage:e.profile_image}:{rank:e.win_rank,kind:e.kind,wallet:e.user_id,pnl:e.pnl,initialValue:e.initial_value,finalValue:e.final_value,resolvedAt:e.resolved_at,conditionId:e.condition_id,assetId:e.position_id,eventId:e.event_id,eventSlug:e.event_slug,eventTitle:e.event_title,userName:e.user_name,profileImage:e.profile_image}),yo=b(dt),So=I(z.array(ct)),bo=b(pt),ho=I(ut.nullable()),fo=b(yt);var Ce=(f=>(f.Initialized="initialized",f.Posed="posed",f.Proposed="proposed",f.Challenged="challenged",f.Reproposed="reproposed",f.Disputed="disputed",f.Active="active",f.Arbitration="arbitration",f.Resolved="resolved",f))(Ce||{}),St=z.enum(Ce),Re=(a=>(a.Binary="BINARY",a.IncrementalNegRisk="INCREMENTAL_NEGRISK",a.AtomicNegRisk="ATOMIC_NEGRISK",a))(Re||{}),bt=z.enum(Re),Te=(i=>(i.Reported="reported",i.Derived="derived",i))(Te||{}),ht=z.enum(Te),Ee=(a=>(a.UmaOptimisticOracle="UMA_OO",a.Chainlink="CHAINLINK",a.Eoa="EOA",a))(Ee||{}),ft=z.enum(Ee),Ae=z.number().int().min(0).transform(String).pipe(Pa),vt=z.object({question_id:Fa.optional(),condition_id:aa.optional(),status:St,extended_review:z.boolean(),was_disputed:z.boolean(),new_version_q:z.boolean(),proposed_price:Oa.optional(),reproposed_price:Oa.optional(),price:Oa.optional(),transaction_hash:z.preprocess(Ta,Na.nullable()),log_index:z.preprocess(Ta,z.string().regex(/^\d+$/).transform(Number).nullable()),last_update_timestamp:ha,market_type:bt.optional(),payouts:z.tuple([Ae,Ae]).optional(),resolution_source:ht.optional(),reporter:ft.optional(),was_arbitrated:z.boolean().optional(),resolved_block:z.number().int().min(0).optional(),resolved_at:oa.optional()}).transform(e=>{let t={status:e.status,extendedReview:e.extended_review,wasDisputed:e.was_disputed,questionRulesUpdated:e.new_version_q,transactionHash:e.transaction_hash,logIndex:e.log_index,lastUpdatedAt:e.last_update_timestamp};return e.question_id!==void 0&&(t.questionId=e.question_id),e.condition_id!==void 0&&(t.conditionId=e.condition_id),e.proposed_price!==void 0&&e.proposed_price!=="69"&&(t.proposedPrice=e.proposed_price),e.reproposed_price!==void 0&&e.reproposed_price!=="69"&&(t.reproposedPrice=e.reproposed_price),e.price!==void 0&&e.price!=="69"&&(t.price=e.price),e.market_type!==void 0&&(t.marketType=e.market_type),e.payouts!==void 0&&(t.payouts=e.payouts),e.resolution_source!==void 0&&(t.resolutionSource=e.resolution_source),e.reporter!==void 0&&(t.reporter=e.reporter),e.was_arbitrated!==void 0&&(t.wasArbitrated=e.was_arbitrated),e.resolved_block!==void 0&&(t.resolvedBlock=e.resolved_block),e.resolved_at!==void 0&&(t.resolvedAt=e.resolved_at),t}),Co=I(z.array(vt));export{Je as ActivitySchema,G as ActivityType,ne as ActivityTypeSchema,xe as BiggestWinnerKind,_o as BiggestWinnerKindSchema,yt as BiggestWinnerSchema,dt as BuilderStandingSchema,ve as BuilderVolumeInterval,uo as BuilderVolumeIntervalSchema,ct as BuilderVolumePointSchema,Rt as CanonicalMarketConditionIdSchema,Ye as ComboActivitySchema,Se as ComboActivityType,Y as ComboPositionLegSchema,je as ComboPositionMarketEventSchema,Ze as ComboPositionMarketSchema,Ke as ComboPositionSchema,ue as ComboPositionSortBy,Ut as ComboPositionSortBySchema,le as ComboPositionStatus,me as ComboPositionStatusSchema,So as FetchBuilderVolumeResponseSchema,so as FetchEventLiveVolumeResponseSchema,ro as FetchOpenInterestResponseSchema,Nt as FetchPortfolioValueResponseSchema,Co as FetchResolutionsResponseSchema,ho as FetchTraderLeaderboardStandingResponseSchema,Wt as FetchUserPnlResponseSchema,Vt as FetchUserStatsResponseSchema,wt as FetchUserVolumeResponseSchema,rt as HolderSchema,fe as LeaderboardWindow,po as LeaderboardWindowSchema,Qt as ListActivityResponseSchema,fo as ListBiggestWinnersResponseSchema,yo as ListBuilderLeaderboardResponseSchema,$t as ListComboActivityResponseSchema,Ht as ListComboPositionsResponseSchema,io as ListMarketHoldersResponseSchema,Bt as ListPositionsResponseSchema,no as ListPriceHistoryResponseSchema,bo as ListTraderLeaderboardResponseSchema,Yt as ListTradesResponseSchema,mt as LiveVolumeSchema,lt as MarketLiveVolumeSchema,st as MetaHolderSchema,at as OpenInterestSchema,Ve as PortfolioValueSchema,pe as PositionFilterType,Ot as PositionFilterTypeSchema,Ne as PositionSchema,ce as PositionSortBy,Mt as PositionSortBySchema,de as PositionStatus,Ue as PositionStatusSchema,he as PriceHistoryInterval,oo as PriceHistoryIntervalSchema,it as PriceHistoryPointSchema,Re as ResolutionMarketType,bt as ResolutionMarketTypeSchema,Ee as ResolutionReporter,ft as ResolutionReporterSchema,vt as ResolutionSchema,Te as ResolutionSource,ht as ResolutionSourceSchema,Ce as ResolutionStatus,St as ResolutionStatusSchema,re as SortDirection,At as SortDirectionSchema,ie as TipSide,q as TipSideSchema,se as TradeFilterType,Ct as TradeFilterTypeSchema,Qe as TradeSchema,pt as TraderLeaderboardEntrySchema,Ie as TraderLeaderboardSort,go as TraderLeaderboardSortSchema,ut as TraderLeaderboardStandingSchema,_e as UserPnlFidelity,ae as UserPnlFidelitySchema,ge as UserPnlInterval,We as UserPnlIntervalSchema,ye as UserPnlPointSchema,we as UserPnlSeriesSchema,Fe as UserStatsSchema,He as UserVolumeSchema,I as dataEnvelopeSchema,b as dataPageSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {aa,Qa,Ea,ca,ea,pa,oa,Da,$ as $$1,Na,_ as _$1,za,Ta,X,ma,Pa,ha,Oa,z as z$1,Fa,p as p$1,F}from'../chunk-3IZ4N7C2.js';import {z}from'zod';var q=(g=>(g.TRADE="TRADE",g.SPLIT="SPLIT",g.MERGE="MERGE",g.REDEEM="REDEEM",g.REWARD="REWARD",g.CONVERSION="CONVERSION",g.MIGRATION="MIGRATION",g.MAKER_REBATE="MAKER_REBATE",g.REFERRAL_REWARD="REFERRAL_REWARD",g.YIELD="YIELD",g.DEPOSIT="DEPOSIT",g.WITHDRAWAL="WITHDRAWAL",g.TAKER_REBATE="TAKER_REBATE",g.TIP="TIP",g))(q||{}),re=z.enum(q),se=(i=>(i.In="IN",i.Out="OUT",i))(se||{}),Y=z.enum(se),ae=(i=>(i.Asc="ASC",i.Desc="DESC",i))(ae||{}),Lt=z.enum(ae),le=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(le||{}),Mt=z.enum(le);function Be(e){let t=e.length===64?`${e}00`:e;return p$1(t.toLowerCase())}function Ne(e){if(e.length===66)return true;let t=e.toLowerCase();return t.startsWith("0x01")||t.startsWith("0x02")}var Ot=aa.refine(Ne,"Expected a 32-byte condition ID or a 31-byte protocol v2 market condition ID").transform(Be);function I(e){return z.object({data:z.array(e),pagination:z.object({limit:z.number().int(),offset:z.number().int(),has_more:z.boolean(),next_cursor:z.string().min(1).nullable()})}).refine(t=>t.pagination.has_more===(t.pagination.next_cursor!==null),{message:"has_more and next_cursor must agree",path:["pagination","next_cursor"]}).transform(({data:t,pagination:i})=>({items:t,hasMore:i.has_more,nextCursor:i.next_cursor===null?void 0:F(i.next_cursor)}))}function h(e){return z.object({data:e}).transform(t=>t.data)}var de=(l=>(l.Open="OPEN",l.Redeemable="REDEEMABLE",l.Partial="PARTIAL",l.ResolvedPartial="RESOLVED_PARTIAL",l.ResolvedWin="RESOLVED_WIN",l.ResolvedLoss="RESOLVED_LOSS",l))(de||{}),ce=z.enum(de),pe=(m=>(m.Open="OPEN",m.Redeemable="REDEEMABLE",m.RedeemableLost="REDEEMABLE_LOST",m.Mergeable="MERGEABLE",m.Closed="CLOSED",m))(pe||{}),jt=z.enum(pe),Ve=z.enum(["OPEN","REDEEMABLE","CLOSED"]),ue=(c=>(c.CurrentValue="CURRENT_VALUE",c.Price="PRICE",c.Tokens="TOKENS",c.UnrealizedPnl="UNREALIZED_PNL",c.RealizedPnl="REALIZED_PNL",c.TotalPnl="TOTAL_PNL",c.Timestamp="TIMESTAMP",c))(ue||{}),Ft=z.enum(ue),ge=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(ge||{}),Zt=z.enum(ge),_e=(r=>(r.FirstEntry="FIRST_ENTRY",r.EntryCost="ENTRY_COST",r.CurrentValue="CURRENT_VALUE",r.Updated="UPDATED",r))(_e||{}),Kt=z.enum(_e),E=z.preprocess(e=>e===""?void 0:e,z.string().optional()),we=z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),We=z.object({proxy_wallet:ca,token_id:Ea,condition_id:aa,current_size:Qa,avg_price:Qa,entry_cost_usdc:Qa,entry_fees_usdc:Qa,total_cost_usdc:Qa,current_price:Qa,current_value:Qa,total_size:Qa,realized_pnl:Qa,unrealized_pnl:Qa,total_pnl:Qa,percent_pnl:Qa,percent_realized_pnl:Qa,status:Ve,redeemable:z.boolean(),mergeable:z.boolean(),negative_risk:z.boolean(),archived:z.boolean(),title:E,slug:E,icon:E,event_id:E,event_slug:E,outcome:E,outcome_index:we,opposite_outcome:E,opposite_token_id:z.preprocess(e=>e===""?void 0:e,Ea.optional()),end_date:z.preprocess(e=>e===""?void 0:e,pa.optional()),last_event_at:z.preprocess(e=>e===0?void 0:e,ea.optional()),first_entry_at:z.preprocess(e=>e===0?void 0:e,ea.optional()),name:E,profile_image:E,verified:z.boolean()}).transform(e=>({wallet:e.proxy_wallet,assetId:e.token_id,tokenId:e.token_id,conditionId:e.condition_id,currentSize:e.current_size,avgPrice:e.avg_price,entryCostUsdc:e.entry_cost_usdc,entryFeesUsdc:e.entry_fees_usdc,totalCostUsdc:e.total_cost_usdc,currentPrice:e.current_price,currentValue:e.current_value,totalSize:e.total_size,realizedPnl:e.realized_pnl,unrealizedPnl:e.unrealized_pnl,totalPnl:e.total_pnl,percentPnl:e.percent_pnl,percentRealizedPnl:e.percent_realized_pnl,status:e.status,redeemable:e.redeemable,mergeable:e.mergeable,negativeRisk:e.negative_risk,archived:e.archived,title:e.title,slug:e.slug,icon:e.icon,eventId:e.event_id,eventSlug:e.event_slug,outcome:e.outcome,outcomeIndex:e.outcome_index,oppositeOutcome:e.opposite_outcome,oppositeAssetId:e.opposite_token_id,oppositeTokenId:e.opposite_token_id,endDate:e.end_date,lastEventAt:e.last_event_at,firstEntryAt:e.first_entry_at,name:e.name,profileImage:e.profile_image,verified:e.verified})),He=z.object({proxy_wallet:ca,value:Qa}).transform(({proxy_wallet:e,value:t})=>({wallet:e,value:t})),ye=(l=>(l.Max="max",l.OneMonth="1m",l.OneWeek="1w",l.OneDay="1d",l.TwelveHours="12h",l.SixHours="6h",l))(ye||{}),je=z.enum(ye),Se=(m=>(m.OneDay="1d",m.EighteenHours="18h",m.TwelveHours="12h",m.ThreeHours="3h",m.OneHour="1h",m))(Se||{}),me=z.enum(Se),_=Qa.nullish().transform(e=>e??null),be=z.object({timestamp:ea,source_block:z.number().int().nonnegative(),realized_market_pnl:Qa,realized_lp_pnl:Qa,realized_combo_pnl:Qa,unrealized_pnl:_,fees_refunded:_,maker_rebate:_,taker_rebate:_,reward_income:_,yield_income:_,referral_income:_,deposits:_,withdrawals:_,realized_pnl:Qa,wallet_income:_,position_pnl:_,settled_pnl:_,economic_pnl:_,trade_pnl:_,sponsored_income:_,fees:_,fees_paid:_,cashflow_net:_,volume:Qa,volume_usdc:Qa,trade_count:z.number().int().nonnegative()}).transform(({source_block:e,realized_market_pnl:t,realized_lp_pnl:i,realized_combo_pnl:a,unrealized_pnl:r,fees_refunded:m,maker_rebate:l,taker_rebate:c,reward_income:M,yield_income:x,referral_income:w,realized_pnl:W,wallet_income:H,position_pnl:j,settled_pnl:g,economic_pnl:F,trade_pnl:Z,sponsored_income:K,fees_paid:ze,cashflow_net:Le,volume_usdc:Me,trade_count:Oe,...Ue})=>({...Ue,sourceBlock:e,realizedMarketPnl:t,realizedLpPnl:i,realizedComboPnl:a,unrealizedPnl:r,feesRefunded:m,makerRebate:l,takerRebate:c,rewardIncome:M,yieldIncome:x,referralIncome:w,realizedPnl:W,walletIncome:H,positionPnl:j,settledPnl:g,economicPnl:F,tradePnl:Z,sponsoredIncome:K,feesPaid:ze,cashflowNet:Le,volumeUsdc:Me,tradeCount:Oe})),Fe=z.object({proxy_wallet:ca,interval:je,fidelity:me,source_fidelity:me,points:z.array(be)}).transform(({proxy_wallet:e,source_fidelity:t,...i})=>({...i,wallet:e,sourceFidelity:t})),Ze=z.object({volume:Qa,volume_usdc:Qa,trade_count:z.number().int().nonnegative()}).transform(({volume_usdc:e,trade_count:t,...i})=>({...i,volumeUsdc:e,tradeCount:t})),Ke=z.object({proxy_wallet:ca,trades:z.number().int().nonnegative(),biggest_win:Qa,views:z.number().int().nonnegative(),join_date:ea.nullish(),all_time_pnl:be.nullish()}).transform(({proxy_wallet:e,trades:t,biggest_win:i,join_date:a,all_time_pnl:r,...m})=>({...m,wallet:e,tradedMarketCount:t,biggestWin:i,joinDate:a??null,allTimePnl:r??null})),Ge=z.object({event_id:z.string().nullish(),event_slug:z.string().nullish(),event_title:z.string().nullish(),event_image:z.string().nullish()}).transform(({event_id:e,event_slug:t,event_title:i,event_image:a})=>({eventId:e,eventSlug:t,eventTitle:i,eventImage:a})),qe=z.object({market_id:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),question:z.string().nullish(),group_item_title:z.string().nullish(),sports_market_type:z.string().nullish(),line:z.number().nullish(),outcomes:z.array(z.string()).nullish(),outcome:z.string().nullish(),image_url:z.string().nullish(),icon_url:z.string().nullish(),category:z.string().nullish(),subcategory:z.string().nullish(),tags:z.array(z.string()).nullish(),end_date:oa.nullish(),event:Ge.nullish()}).transform(({market_id:e,image_url:t,icon_url:i,end_date:a,group_item_title:r,sports_market_type:m,...l})=>({...l,marketId:e,groupItemTitle:r,sportsMarketType:m,imageUrl:t,iconUrl:i,endDate:a})),$=z.object({leg_index:z.number().int(),leg_position_id:Da,leg_condition_id:aa,leg_outcome_index:z.number().int(),leg_outcome_label:z.string().nullish(),leg_status:ce,leg_resolved_at:oa.nullish(),leg_current_price:Qa.nullish(),market:qe.nullish()}).transform(({leg_index:e,leg_position_id:t,leg_condition_id:i,leg_outcome_index:a,leg_outcome_label:r,leg_status:m,leg_resolved_at:l,leg_current_price:c,...M})=>({...M,legIndex:e,legPositionId:t,legConditionId:i,legOutcomeIndex:a,legOutcomeLabel:r,legStatus:m,legResolvedAt:l,legCurrentPrice:c})),Ye=z.object({combo_condition_id:$$1,outcome_index:z.number().int(),outcome_label:z.string(),combo_position_id:Da,proxy_wallet:ca,current_size:Qa,entry_avg_price_usdc:Qa,entry_cost_usdc:Qa,gross_entry_cost_usdc:Qa,entry_fees_usdc:Qa,realized_payout_usdc:Qa,status:ce,redeemable:z.boolean(),first_entry_at:oa,resolved_at:oa.nullish(),legs_total:z.number().int(),legs_resolved:z.number().int(),legs_pending:z.number().int(),legs:z.array($),updated_at:oa}).transform(({combo_condition_id:e,outcome_index:t,outcome_label:i,combo_position_id:a,proxy_wallet:r,current_size:m,entry_avg_price_usdc:l,entry_cost_usdc:c,gross_entry_cost_usdc:M,entry_fees_usdc:x,realized_payout_usdc:w,first_entry_at:W,resolved_at:H,legs_total:j,legs_resolved:g,legs_pending:F,updated_at:Z,...K})=>({...K,conditionId:e,outcomeIndex:t,outcomeLabel:i,positionId:a,wallet:r,currentSize:m,entryAvgPriceUsdc:l,entryCostUsdc:c,grossEntryCostUsdc:M,entryFeesUsdc:x,realizedPayoutUsdc:w,firstEntryAt:W,resolvedAt:H,legsTotal:j,legsResolved:g,legsPending:F,updatedAt:Z})),Gt=I(We),qt=h(He),Yt=h(Ke.nullable()),$t=h(Fe),Qt=h(Ze),Jt=I(Ye);var he=(c=>(c.Split="SPLIT",c.Merge="MERGE",c.Convert="CONVERT",c.Compress="COMPRESS",c.Wrap="WRAP",c.Unwrap="UNWRAP",c.Redeem="REDEEM",c))(he||{}),$e=z.enum(he),Qe=z.object({id:_$1,type:$e,proxy_wallet:ca,combo_condition_id:$$1,combo_position_id:Da,amount_usdc:Qa.nullish(),payout_usdc:Qa.nullish(),timestamp:ea,transaction_hash:Na,block_number:z.number().int(),legs:z.array($)}),Je=Qe.transform(ot),p=z.preprocess(e=>e===""?void 0:e,z.string().optional()),fe=z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),Xe=z.object({proxy_wallet:ca,side:za,token_id:Ea,condition_id:aa,size:Qa,price:Qa,timestamp:ea,title:p,slug:p,icon:p,event_slug:p,outcome:p,outcome_index:fe,name:p,pseudonym:p,bio:p,profile_image:p,profile_image_optimized:p,transaction_hash:Na}).transform(e=>({wallet:e.proxy_wallet,side:e.side,assetId:e.token_id,tokenId:e.token_id,conditionId:e.condition_id,size:e.size,price:e.price,timestamp:e.timestamp,title:e.title,slug:e.slug,icon:e.icon,eventSlug:e.event_slug,outcome:e.outcome,outcomeIndex:e.outcome_index,name:e.name,pseudonym:e.pseudonym,bio:e.bio,profileImage:e.profile_image,profileImageOptimized:e.profile_image_optimized,transactionHash:e.transaction_hash})),et=z.object({proxy_wallet:ca,timestamp:ea,condition_id:z.preprocess(e=>e===""?void 0:e,aa.optional()),type:re,size:Qa,usdc_size:Qa,transaction_hash:Na,price:Qa,token_id:z.preprocess(e=>e===""?void 0:e,Ea.optional()),side:z.preprocess(e=>e===""?void 0:e,z.union([za,Y]).optional()),is_combo:z.boolean().optional(),outcome_index:fe,title:p,slug:p,icon:p,event_slug:p,outcome:p,name:p,pseudonym:p,bio:p,profile_image:p,profile_image_optimized:p}),tt=et.transform(it),ro=I(Xe),so=I(tt),ao=I(Je);function ot(e){let t=nt(e);switch(e.type){case "SPLIT":return {...t,type:"SPLIT"};case "MERGE":return {...t,type:"MERGE"};case "CONVERT":return {...t,type:"CONVERT"};case "COMPRESS":return {...t,type:"COMPRESS"};case "WRAP":return {...t,type:"WRAP"};case "UNWRAP":return {...t,type:"UNWRAP"};case "REDEEM":return {...t,type:"REDEEM",payout:e.payout_usdc??null}}}function nt(e){return {id:e.id,type:e.type,wallet:e.proxy_wallet,conditionId:e.combo_condition_id,positionId:e.combo_position_id,amount:e.amount_usdc??null,timestamp:e.timestamp,transactionHash:e.transaction_hash,blockNumber:e.block_number,legs:e.legs}}function it(e){let t=st(e);switch(e.type){case "TRADE":return rt(e,t);case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...t,type:e.type,conditionId:A(e.condition_id,"condition_id"),amount:e.usdc_size,title:A(e.title,"title"),slug:A(e.slug,"slug"),icon:e.icon??null,eventSlug:A(e.event_slug,"event_slug")};case "MIGRATION":case "REWARD":case "MAKER_REBATE":case "REFERRAL_REWARD":case "YIELD":case "DEPOSIT":case "WITHDRAWAL":case "TAKER_REBATE":return {...t,type:e.type,amount:e.usdc_size};case "TIP":return {...t,type:e.type,amount:e.usdc_size,side:e.side===void 0?null:Y.parse(e.side)}}}function rt(e,t){let i={...t,type:"TRADE",side:za.parse(A(e.side,"side")),shares:e.size,amount:e.usdc_size,price:e.price,title:A(e.title,"title"),icon:e.icon??null};if(e.is_combo===true)return {...i,isCombo:true,conditionId:$$1.parse(A(e.condition_id,"condition_id")),positionId:Da.parse(A(e.token_id,"token_id"))};let a=A(e.token_id,"token_id");return {...i,isCombo:false,conditionId:A(e.condition_id,"condition_id"),assetId:a,tokenId:a,outcome:A(e.outcome,"outcome"),outcomeIndex:e.outcome_index,slug:A(e.slug,"slug"),eventSlug:A(e.event_slug,"event_slug")}}function st(e){return {wallet:e.proxy_wallet,timestamp:e.timestamp,transactionHash:e.transaction_hash,name:e.name??null,pseudonym:e.pseudonym??null,bio:e.bio??null,profileImage:e.profile_image??null,profileImageOptimized:e.profile_image_optimized??null}}function A(e,t){if(e==null)throw new TypeError(`Expected activity.${t} to be present`);return e}var ve=(l=>(l.Max="max",l.OneMonth="1m",l.OneWeek="1w",l.OneDay="1d",l.SixHours="6h",l.OneHour="1h",l))(ve||{}),uo=z.enum(ve),at=z.object({timestamp:ea,price:Qa,resolution_seconds:z.number().int().nonnegative()}).transform(({price:e,resolution_seconds:t,timestamp:i})=>({timestamp:i,price:e,resolutionSeconds:t})),go=I(at),O=z.preprocess(e=>e===""?null:e,z.string().nullable()),lt=z.object({proxy_wallet:ca,bio:O,token_id:Ea,pseudonym:O,amount:Qa,display_username_public:z.boolean(),outcome_index:z.preprocess(e=>e===999?null:e,z.number().int().nullable()),name:O,profile_image:O,profile_image_optimized:O,verified:z.boolean(),avg_price:Qa.nullish(),entry_cost_usdc:Qa.nullish(),current_price:Qa.nullish(),current_value:Qa.nullish(),realized_pnl:Qa.nullish(),unrealized_pnl:Qa.nullish(),total_pnl:Qa.nullish()}).transform(e=>({wallet:e.proxy_wallet,assetId:e.token_id,tokenId:e.token_id,amount:e.amount,displayUsernamePublic:e.display_username_public,outcomeIndex:e.outcome_index,verified:e.verified,bio:e.bio,pseudonym:e.pseudonym,name:e.name,profileImage:e.profile_image,profileImageOptimized:e.profile_image_optimized,avgPrice:e.avg_price,entryCostUsdc:e.entry_cost_usdc,currentPrice:e.current_price,currentValue:e.current_value,realizedPnl:e.realized_pnl,unrealizedPnl:e.unrealized_pnl,totalPnl:e.total_pnl})),mt=z.object({token_id:Ea,holders:z.array(lt)}).transform(({holders:e,token_id:t})=>({assetId:t,token:t,holders:e})),dt=z.object({condition_id:z.union([aa,z.literal("GLOBAL")]),value:Qa}).transform(({condition_id:e,value:t})=>({conditionId:e==="GLOBAL"?null:e,value:t})),ct=z.object({condition_id:z.preprocess(Ta,aa.nullable()),taker_volume:Qa}).transform(({condition_id:e,taker_volume:t})=>({conditionId:e,takerVolume:t})),pt=z.object({taker_volume_total:Qa,conditions:z.array(ct)}).transform(({conditions:e,taker_volume_total:t})=>({markets:e,takerVolumeTotal:t})),_o=I(mt),yo=h(z.array(dt)),So=h(pt);var ut=(i=>(i.Erc20="ERC20",i.Erc1155="ERC1155",i))(ut||{}),gt=z.union([z.literal("max"),z.string().regex(/^(0|[1-9][0-9]{0,77})$/).transform(BigInt).refine(e=>e<=2n**256n-1n,"Expected a uint256 amount")]),_t=z.discriminatedUnion("standard",[z.object({token:ca,spender:ca,standard:z.literal("ERC20"),amount:gt,approved:z.boolean()}),z.object({token:ca,spender:ca,standard:z.literal("ERC1155"),approved:z.boolean()})]),yt=z.object({token:z.string(),spender:z.string()}).transform(e=>({token:e.token,spender:e.spender,standard:void 0})),St=z.union([_t,yt]),Io=h(z.object({address:ca,chain_id:z.number().int().positive(),contracts:z.array(St)}).transform(({chain_id:e,...t})=>({...t,chainId:e})));var Ie=(r=>(r.Day="day",r.Week="week",r.Month="month",r.All="all",r))(Ie||{}),Eo=z.enum(Ie),xe=(r=>(r.Day="day",r.Week="week",r.Month="month",r.Year="all",r))(xe||{}),To=z.enum(xe),Ae=(i=>(i.Pnl="PNL",i.Volume="VOLUME",i))(Ae||{}),Do=z.enum(Ae),Re=(i=>(i.Market="market",i.Combo="combo",i))(Re||{}),ko=z.enum(Re),bt=z.object({rank:z.number().int().positive(),builder_name:z.string(),builder_code:X,profile_image:z.string(),verified:z.boolean(),volume:Qa,active_users:z.number().int().min(0)}).transform(({active_users:e,builder_code:t,builder_name:i,profile_image:a,...r})=>({...r,activeUsers:e,builderCode:t,builderName:i,...a===""?{}:{profileImage:a}})),ht=z.object({date:pa,rank:z.number().int().min(0),builder_name:z.string(),builder_code:X,profile_image:z.string(),verified:z.boolean(),volume:Qa,active_users:z.number().int().min(0)}).transform(({active_users:e,builder_code:t,builder_name:i,date:a,profile_image:r,...m})=>({...m,activeUsers:e,bucketDate:a,builderCode:t,builderName:i,...r===""?{}:{profileImage:r}})),C=z.preprocess(Ta,z.string().nullable()),ft=z.object({rank:z.number().int().min(0),user_id:ca,pnl:Qa,volume:Qa,user_name:C,profile_image:C,x_username:C,verified:z.boolean()}).transform(({profile_image:e,user_id:t,user_name:i,x_username:a,...r})=>({...r,wallet:t,userName:i,profileImage:e,xUsername:a})),vt=z.object({user_id:ca,pnl:Qa,volume:Qa,rank_pnl:z.number().int().positive().nullable(),rank_volume:z.number().int().positive().nullable(),user_name:C,profile_image:C,x_username:C,verified:z.boolean()}).transform(({profile_image:e,rank_pnl:t,rank_volume:i,user_id:a,user_name:r,x_username:m,...l})=>({...l,wallet:a,pnlRank:t,volumeRank:i,userName:r,profileImage:e,xUsername:m})),It=z.object({win_rank:z.number().int().positive(),kind:z.literal("market"),user_id:ca,pnl:Qa,initial_value:Qa,final_value:Qa,resolved_at:ea,condition_id:aa,position_id:Ea,event_id:ma,event_slug:z.string(),event_title:z.string(),user_name:C,profile_image:C}),xt=z.object({win_rank:z.number().int().positive(),kind:z.literal("combo"),user_id:ca,pnl:Qa,initial_value:Qa,final_value:Qa,resolved_at:ea,condition_id:$$1,position_id:Da,event_id:z.literal(0),event_slug:z.literal(""),event_title:z.string(),user_name:C,profile_image:C}),At=z.discriminatedUnion("kind",[It,xt]).transform(e=>e.kind==="combo"?{rank:e.win_rank,kind:e.kind,wallet:e.user_id,pnl:e.pnl,initialValue:e.initial_value,finalValue:e.final_value,resolvedAt:e.resolved_at,conditionId:e.condition_id,positionId:e.position_id,eventId:null,eventSlug:null,eventTitle:e.event_title,userName:e.user_name,profileImage:e.profile_image}:{rank:e.win_rank,kind:e.kind,wallet:e.user_id,pnl:e.pnl,initialValue:e.initial_value,finalValue:e.final_value,resolvedAt:e.resolved_at,conditionId:e.condition_id,assetId:e.position_id,eventId:e.event_id,eventSlug:e.event_slug,eventTitle:e.event_title,userName:e.user_name,profileImage:e.profile_image}),Po=I(bt),zo=h(z.array(ht)),Lo=I(ft),Mo=h(vt.nullable()),Oo=I(At);var Ee=(x=>(x.Initialized="initialized",x.Posed="posed",x.Proposed="proposed",x.Challenged="challenged",x.Reproposed="reproposed",x.Disputed="disputed",x.Active="active",x.Arbitration="arbitration",x.Resolved="resolved",x))(Ee||{}),Rt=z.enum(Ee),Te=(a=>(a.Binary="BINARY",a.IncrementalNegRisk="INCREMENTAL_NEGRISK",a.AtomicNegRisk="ATOMIC_NEGRISK",a))(Te||{}),Ct=z.enum(Te),De=(i=>(i.Reported="reported",i.Derived="derived",i))(De||{}),Et=z.enum(De),ke=(a=>(a.UmaOptimisticOracle="UMA_OO",a.Chainlink="CHAINLINK",a.Eoa="EOA",a))(ke||{}),Tt=z.enum(ke),Pe=(r=>(r.ManagedProposalExpiration="managed_proposal_expiration",r.ProposalExpiration="proposal_expiration",r.Liveness="liveness",r.DvmRoundEstimate="dvm_round_estimate",r))(Pe||{}),Dt=z.enum(Pe),Ce=z.number().int().min(0).transform(String).pipe(Pa),kt=z.object({question_id:Fa.optional(),condition_id:aa.optional(),status:Rt,extended_review:z.boolean(),expected_settlement_time:z.iso.datetime().transform(z$1).optional(),settlement_time_basis:Dt.optional(),was_disputed:z.boolean(),new_version_q:z.boolean(),proposed_price:Oa.optional(),reproposed_price:Oa.optional(),price:Oa.optional(),transaction_hash:z.preprocess(Ta,Na.nullable()),log_index:z.preprocess(Ta,z.string().regex(/^\d+$/).transform(Number).nullable()),last_update_timestamp:ha,market_type:Ct.optional(),payouts:z.tuple([Ce,Ce]).optional(),resolution_source:Et.optional(),reporter:Tt.optional(),was_arbitrated:z.boolean().optional(),resolved_block:z.number().int().min(0).optional(),resolved_at:oa.optional()}).transform(e=>{let t={status:e.status,extendedReview:e.extended_review,wasDisputed:e.was_disputed,questionRulesUpdated:e.new_version_q,transactionHash:e.transaction_hash,logIndex:e.log_index,lastUpdatedAt:e.last_update_timestamp};return e.question_id!==void 0&&(t.questionId=e.question_id),e.condition_id!==void 0&&(t.conditionId=e.condition_id),e.expected_settlement_time!==void 0&&(t.expectedSettlementTime=e.expected_settlement_time),e.settlement_time_basis!==void 0&&(t.settlementTimeBasis=e.settlement_time_basis),e.proposed_price!==void 0&&e.proposed_price!=="69"&&(t.proposedPrice=e.proposed_price),e.reproposed_price!==void 0&&e.reproposed_price!=="69"&&(t.reproposedPrice=e.reproposed_price),e.price!==void 0&&e.price!=="69"&&(t.price=e.price),e.market_type!==void 0&&(t.marketType=e.market_type),e.payouts!==void 0&&(t.payouts=e.payouts),e.resolution_source!==void 0&&(t.resolutionSource=e.resolution_source),e.reporter!==void 0&&(t.reporter=e.reporter),e.was_arbitrated!==void 0&&(t.wasArbitrated=e.was_arbitrated),e.resolved_block!==void 0&&(t.resolvedBlock=e.resolved_block),e.resolved_at!==void 0&&(t.resolvedAt=e.resolved_at),t}),wo=h(z.array(kt));export{tt as ActivitySchema,q as ActivityType,re as ActivityTypeSchema,ut as ApprovalStandard,Re as BiggestWinnerKind,ko as BiggestWinnerKindSchema,At as BiggestWinnerSchema,bt as BuilderStandingSchema,xe as BuilderVolumeInterval,To as BuilderVolumeIntervalSchema,ht as BuilderVolumePointSchema,Ot as CanonicalMarketConditionIdSchema,Je as ComboActivitySchema,he as ComboActivityType,$ as ComboPositionLegSchema,Ge as ComboPositionMarketEventSchema,qe as ComboPositionMarketSchema,Ye as ComboPositionSchema,_e as ComboPositionSortBy,Kt as ComboPositionSortBySchema,de as ComboPositionStatus,ce as ComboPositionStatusSchema,Io as FetchApprovalsResponseSchema,zo as FetchBuilderVolumeResponseSchema,So as FetchEventLiveVolumeResponseSchema,yo as FetchOpenInterestResponseSchema,qt as FetchPortfolioValueResponseSchema,wo as FetchResolutionsResponseSchema,Mo as FetchTraderLeaderboardStandingResponseSchema,$t as FetchUserPnlResponseSchema,Yt as FetchUserStatsResponseSchema,Qt as FetchUserVolumeResponseSchema,lt as HolderSchema,Ie as LeaderboardWindow,Eo as LeaderboardWindowSchema,so as ListActivityResponseSchema,Oo as ListBiggestWinnersResponseSchema,Po as ListBuilderLeaderboardResponseSchema,ao as ListComboActivityResponseSchema,Jt as ListComboPositionsResponseSchema,_o as ListMarketHoldersResponseSchema,Gt as ListPositionsResponseSchema,go as ListPriceHistoryResponseSchema,Lo as ListTraderLeaderboardResponseSchema,ro as ListTradesResponseSchema,pt as LiveVolumeSchema,ct as MarketLiveVolumeSchema,mt as MetaHolderSchema,dt as OpenInterestSchema,He as PortfolioValueSchema,ge as PositionFilterType,Zt as PositionFilterTypeSchema,Ve as PositionRowStatusSchema,We as PositionSchema,ue as PositionSortBy,Ft as PositionSortBySchema,pe as PositionStatus,jt as PositionStatusSchema,ve as PriceHistoryInterval,uo as PriceHistoryIntervalSchema,at as PriceHistoryPointSchema,Te as ResolutionMarketType,Ct as ResolutionMarketTypeSchema,ke as ResolutionReporter,Tt as ResolutionReporterSchema,kt as ResolutionSchema,Pe as ResolutionSettlementTimeBasis,Dt as ResolutionSettlementTimeBasisSchema,De as ResolutionSource,Et as ResolutionSourceSchema,Ee as ResolutionStatus,Rt as ResolutionStatusSchema,ae as SortDirection,Lt as SortDirectionSchema,se as TipSide,Y as TipSideSchema,le as TradeFilterType,Mt as TradeFilterTypeSchema,Xe as TradeSchema,ft as TraderLeaderboardEntrySchema,Ae as TraderLeaderboardSort,Do as TraderLeaderboardSortSchema,vt as TraderLeaderboardStandingSchema,Se as UserPnlFidelity,me as UserPnlFidelitySchema,ye as UserPnlInterval,je as UserPnlIntervalSchema,be as UserPnlPointSchema,Fe as UserPnlSeriesSchema,Ke as UserStatsSchema,Ze as UserVolumeSchema,h as dataEnvelopeSchema,I as dataPageSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|