@polymarket/bindings 0.12.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-Z6SGQXSJ.js +2 -0
- package/dist/chunk-Z6SGQXSJ.js.map +1 -0
- package/dist/data/index.d.ts +171 -2
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/{orders-BMW5PN-Q.d.ts → orders-BV68_6ST.d.ts} +495 -34
- package/dist/perps/index.d.ts +922 -4
- package/dist/perps/index.js +1 -1
- package/dist/perps/index.js.map +1 -1
- package/dist/subscriptions/index.d.ts +358 -61
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-DAWT25YZ.js +0 -2
- package/dist/chunk-DAWT25YZ.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
|
|
|
@@ -84,6 +85,8 @@ declare const PositionRowStatusSchema: z.ZodEnum<{
|
|
|
84
85
|
/** Sort key for position listings. */
|
|
85
86
|
declare enum PositionSortBy {
|
|
86
87
|
CurrentValue = "CURRENT_VALUE",
|
|
88
|
+
/** Current effective price; wallet closed positions use realized PnL instead. */
|
|
89
|
+
Price = "PRICE",
|
|
87
90
|
Tokens = "TOKENS",
|
|
88
91
|
UnrealizedPnl = "UNREALIZED_PNL",
|
|
89
92
|
RealizedPnl = "REALIZED_PNL",
|
|
@@ -167,6 +170,8 @@ type Position = {
|
|
|
167
170
|
* positions with no native economics.
|
|
168
171
|
*/
|
|
169
172
|
lastEventAt?: EpochMilliseconds;
|
|
173
|
+
/** First acquisition as Unix epoch milliseconds; absent when unrecorded. */
|
|
174
|
+
firstEntryAt?: EpochMilliseconds;
|
|
170
175
|
name?: string;
|
|
171
176
|
profileImage?: string;
|
|
172
177
|
verified: boolean;
|
|
@@ -177,7 +182,7 @@ type Position = {
|
|
|
177
182
|
* The wire is strict snake_case: absence arrives as an empty string (or the
|
|
178
183
|
* unknown-outcome sentinel `999`), normalized to `undefined` here. Timestamps
|
|
179
184
|
* arrive as epoch seconds and normalize to epoch milliseconds, with `0`
|
|
180
|
-
* (no
|
|
185
|
+
* (no recorded timestamp) normalized to `undefined`.
|
|
181
186
|
*/
|
|
182
187
|
declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
183
188
|
proxy_wallet: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
|
|
@@ -216,6 +221,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
216
221
|
opposite_token_id: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>>;
|
|
217
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>>]>>>;
|
|
218
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>>>>;
|
|
219
225
|
name: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
220
226
|
profile_image: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
221
227
|
verified: z.ZodBoolean;
|
|
@@ -254,6 +260,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
254
260
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
255
261
|
endDate: IsoCalendarDateString | undefined;
|
|
256
262
|
lastEventAt: EpochMilliseconds | undefined;
|
|
263
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
257
264
|
name: string | undefined;
|
|
258
265
|
profileImage: string | undefined;
|
|
259
266
|
verified: boolean;
|
|
@@ -291,6 +298,7 @@ declare const PositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
291
298
|
opposite_token_id?: PositionId | TokenId | undefined;
|
|
292
299
|
end_date?: IsoCalendarDateString | undefined;
|
|
293
300
|
last_event_at?: EpochMilliseconds | undefined;
|
|
301
|
+
first_entry_at?: EpochMilliseconds | undefined;
|
|
294
302
|
name?: string | undefined;
|
|
295
303
|
profile_image?: string | undefined;
|
|
296
304
|
}>>;
|
|
@@ -1388,6 +1396,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1388
1396
|
opposite_token_id: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>>;
|
|
1389
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>>]>>>;
|
|
1390
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>>>>;
|
|
1391
1400
|
name: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
1392
1401
|
profile_image: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
1393
1402
|
verified: z.ZodBoolean;
|
|
@@ -1426,6 +1435,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1426
1435
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
1427
1436
|
endDate: IsoCalendarDateString | undefined;
|
|
1428
1437
|
lastEventAt: EpochMilliseconds | undefined;
|
|
1438
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
1429
1439
|
name: string | undefined;
|
|
1430
1440
|
profileImage: string | undefined;
|
|
1431
1441
|
verified: boolean;
|
|
@@ -1463,6 +1473,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1463
1473
|
opposite_token_id?: PositionId | TokenId | undefined;
|
|
1464
1474
|
end_date?: IsoCalendarDateString | undefined;
|
|
1465
1475
|
last_event_at?: EpochMilliseconds | undefined;
|
|
1476
|
+
first_entry_at?: EpochMilliseconds | undefined;
|
|
1466
1477
|
name?: string | undefined;
|
|
1467
1478
|
profile_image?: string | undefined;
|
|
1468
1479
|
}>>>;
|
|
@@ -1508,6 +1519,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1508
1519
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
1509
1520
|
endDate: IsoCalendarDateString | undefined;
|
|
1510
1521
|
lastEventAt: EpochMilliseconds | undefined;
|
|
1522
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
1511
1523
|
name: string | undefined;
|
|
1512
1524
|
profileImage: string | undefined;
|
|
1513
1525
|
verified: boolean;
|
|
@@ -1550,6 +1562,7 @@ declare const ListPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1550
1562
|
oppositeTokenId: PositionId | TokenId | undefined;
|
|
1551
1563
|
endDate: IsoCalendarDateString | undefined;
|
|
1552
1564
|
lastEventAt: EpochMilliseconds | undefined;
|
|
1565
|
+
firstEntryAt: EpochMilliseconds | undefined;
|
|
1553
1566
|
name: string | undefined;
|
|
1554
1567
|
profileImage: string | undefined;
|
|
1555
1568
|
verified: boolean;
|
|
@@ -3583,6 +3596,142 @@ type ListMarketHoldersResponse = z.infer<typeof ListMarketHoldersResponseSchema>
|
|
|
3583
3596
|
type FetchOpenInterestResponse = z.infer<typeof FetchOpenInterestResponseSchema>;
|
|
3584
3597
|
type FetchEventLiveVolumeResponse = z.infer<typeof FetchEventLiveVolumeResponseSchema>;
|
|
3585
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
|
+
|
|
3586
3735
|
/**
|
|
3587
3736
|
* Parses the data-service paginated list envelope straight into the SDK's page shape
|
|
3588
3737
|
* — `{ items, hasMore, nextCursor }` — so actions hand the result to the
|
|
@@ -4303,6 +4452,14 @@ declare enum ResolutionReporter {
|
|
|
4303
4452
|
Eoa = "EOA"
|
|
4304
4453
|
}
|
|
4305
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>;
|
|
4306
4463
|
type Resolution = {
|
|
4307
4464
|
/** Oracle question identifier, when the resolution has one. */
|
|
4308
4465
|
questionId?: QuestionId;
|
|
@@ -4311,6 +4468,10 @@ type Resolution = {
|
|
|
4311
4468
|
status: ResolutionStatus;
|
|
4312
4469
|
/** Whether a managed proposal is in extended review. */
|
|
4313
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;
|
|
4314
4475
|
/** Whether the resolution was disputed at any point. */
|
|
4315
4476
|
wasDisputed: boolean;
|
|
4316
4477
|
/** Whether the question rules were updated after the question was posed. */
|
|
@@ -4341,6 +4502,8 @@ declare const ResolutionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4341
4502
|
condition_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>;
|
|
4342
4503
|
status: z.ZodEnum<typeof ResolutionStatus>;
|
|
4343
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>>;
|
|
4344
4507
|
was_disputed: z.ZodBoolean;
|
|
4345
4508
|
new_version_q: z.ZodBoolean;
|
|
4346
4509
|
proposed_price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
@@ -4366,6 +4529,8 @@ declare const ResolutionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4366
4529
|
last_update_timestamp: IsoDateTimeString;
|
|
4367
4530
|
question_id?: QuestionId | undefined;
|
|
4368
4531
|
condition_id?: ConditionId | undefined;
|
|
4532
|
+
expected_settlement_time?: IsoDateTimeString | undefined;
|
|
4533
|
+
settlement_time_basis?: ResolutionSettlementTimeBasis | undefined;
|
|
4369
4534
|
proposed_price?: DecimalString | undefined;
|
|
4370
4535
|
reproposed_price?: DecimalString | undefined;
|
|
4371
4536
|
price?: DecimalString | undefined;
|
|
@@ -4383,6 +4548,8 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4383
4548
|
condition_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>;
|
|
4384
4549
|
status: z.ZodEnum<typeof ResolutionStatus>;
|
|
4385
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>>;
|
|
4386
4553
|
was_disputed: z.ZodBoolean;
|
|
4387
4554
|
new_version_q: z.ZodBoolean;
|
|
4388
4555
|
proposed_price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
@@ -4408,6 +4575,8 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4408
4575
|
last_update_timestamp: IsoDateTimeString;
|
|
4409
4576
|
question_id?: QuestionId | undefined;
|
|
4410
4577
|
condition_id?: ConditionId | undefined;
|
|
4578
|
+
expected_settlement_time?: IsoDateTimeString | undefined;
|
|
4579
|
+
settlement_time_basis?: ResolutionSettlementTimeBasis | undefined;
|
|
4411
4580
|
proposed_price?: DecimalString | undefined;
|
|
4412
4581
|
reproposed_price?: DecimalString | undefined;
|
|
4413
4582
|
price?: DecimalString | undefined;
|
|
@@ -4424,4 +4593,4 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4424
4593
|
}>>;
|
|
4425
4594
|
type FetchResolutionsResponse = z.infer<typeof FetchResolutionsResponseSchema>;
|
|
4426
4595
|
|
|
4427
|
-
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, type PositionRowStatus, PositionRowStatusSchema, 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-3IZ4N7C2.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||{}),Rt=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 Ct=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=(m=>(m.Open="OPEN",m.Redeemable="REDEEMABLE",m.RedeemableLost="REDEEMABLE_LOST",m.Mergeable="MERGEABLE",m.Closed="CLOSED",m))(de||{}),Mt=z.enum(de),Ue=z.enum(["OPEN","REDEEMABLE","CLOSED"]),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||{}),Ot=z.enum(ce),pe=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(pe||{}),Ut=z.enum(pe),ue=(a=>(a.FirstEntry="FIRST_ENTRY",a.EntryCost="ENTRY_COST",a.CurrentValue="CURRENT_VALUE",a.Updated="UPDATED",a))(ue||{}),Bt=z.enum(ue),C=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:C,slug:C,icon:C,event_id:C,event_slug:C,outcome:C,outcome_index:Be,opposite_outcome:C,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:C,profile_image:C,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=(m=>(m.OneDay="1d",m.EighteenHours="18h",m.TwelveHours="12h",m.ThreeHours="3h",m.OneHour="1h",m))(_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:l,unrealized_pnl:a,fees_refunded:m,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:l,unrealizedPnl:a,feesRefunded:m,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:l,all_time_pnl:a,...m})=>({...m,wallet:e,tradedMarketCount:t,biggestWin:i,joinDate:l??null,allTimePnl:a??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:l})=>({eventId:e,eventSlug:t,eventTitle:i,eventImage:l})),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:l,group_item_title:a,sports_market_type:m,...s})=>({...s,marketId:e,groupItemTitle:a,sportsMarketType:m,imageUrl:t,iconUrl:i,endDate:l})),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:l,leg_outcome_label:a,leg_status:m,leg_resolved_at:s,leg_current_price:h,...L})=>({...L,legIndex:e,legPositionId:t,legConditionId:i,legOutcomeIndex:l,legOutcomeLabel:a,legStatus:m,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:l,proxy_wallet:a,current_size:m,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:l,wallet:a,currentSize:m,entryAvgPriceUsdc:s,entryCostUsdc:h,grossEntryCostUsdc:L,entryFeesUsdc:f,realizedPayoutUsdc:V,firstEntryAt:w,resolvedAt:W,legsTotal:H,legsResolved:p,legsPending:F,updatedAt:j})),Nt=b(Ne),Vt=I(Ve),wt=I(Fe.nullable()),Wt=I(We),Ht=I(He),Ft=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),d=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:d,slug:d,icon:d,event_slug:d,outcome:d,outcome_index:be,name:d,pseudonym:d,bio:d,profile_image:d,profile_image_optimized:d,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:d,slug:d,icon:d,event_slug:d,outcome:d,name:d,pseudonym:d,bio:d,profile_image:d,profile_image_optimized:d}),Je=$e.transform(tt),Qt=b(Qe),$t=b(Je),Jt=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 l=x(e.token_id,"token_id");return {...i,isCombo:false,conditionId:x(e.condition_id,"condition_id"),assetId:l,tokenId:l,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||{}),no=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})),io=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})),ro=b(st),so=I(z.array(at)),ao=I(mt);var fe=(a=>(a.Day="day",a.Week="week",a.Month="month",a.All="all",a))(fe||{}),uo=z.enum(fe),ve=(a=>(a.Day="day",a.Week="week",a.Month="month",a.Year="all",a))(ve||{}),go=z.enum(ve),Ie=(i=>(i.Pnl="PNL",i.Volume="VOLUME",i))(Ie||{}),_o=z.enum(Ie),xe=(i=>(i.Market="market",i.Combo="combo",i))(xe||{}),yo=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:l,...a})=>({...a,activeUsers:e,builderCode:t,builderName:i,...l===""?{}:{profileImage:l}})),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:l,profile_image:a,...m})=>({...m,activeUsers:e,bucketDate:l,builderCode:t,builderName:i,...a===""?{}:{profileImage:a}})),R=z.preprocess(Ta,z.string().nullable()),pt=z.object({rank:z.number().int().min(0),user_id:ca,pnl:Qa,volume:Qa,user_name:R,profile_image:R,x_username:R,verified:z.boolean()}).transform(({profile_image:e,user_id:t,user_name:i,x_username:l,...a})=>({...a,wallet:t,userName:i,profileImage:e,xUsername:l})),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:R,profile_image:R,x_username:R,verified:z.boolean()}).transform(({profile_image:e,rank_pnl:t,rank_volume:i,user_id:l,user_name:a,x_username:m,...s})=>({...s,wallet:l,pnlRank:t,volumeRank:i,userName:a,profileImage:e,xUsername:m})),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:R,profile_image:R}),_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:R,profile_image:R}),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}),So=b(dt),bo=I(z.array(ct)),ho=b(pt),fo=I(ut.nullable()),vo=b(yt);var Re=(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))(Re||{}),St=z.enum(Re),Ce=(l=>(l.Binary="BINARY",l.IncrementalNegRisk="INCREMENTAL_NEGRISK",l.AtomicNegRisk="ATOMIC_NEGRISK",l))(Ce||{}),bt=z.enum(Ce),Ee=(i=>(i.Reported="reported",i.Derived="derived",i))(Ee||{}),ht=z.enum(Ee),Te=(l=>(l.UmaOptimisticOracle="UMA_OO",l.Chainlink="CHAINLINK",l.Eoa="EOA",l))(Te||{}),ft=z.enum(Te),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,yo as BiggestWinnerKindSchema,yt as BiggestWinnerSchema,dt as BuilderStandingSchema,ve as BuilderVolumeInterval,go as BuilderVolumeIntervalSchema,ct as BuilderVolumePointSchema,Ct as CanonicalMarketConditionIdSchema,Ye as ComboActivitySchema,Se as ComboActivityType,Y as ComboPositionLegSchema,je as ComboPositionMarketEventSchema,Ze as ComboPositionMarketSchema,Ke as ComboPositionSchema,ue as ComboPositionSortBy,Bt as ComboPositionSortBySchema,le as ComboPositionStatus,me as ComboPositionStatusSchema,bo as FetchBuilderVolumeResponseSchema,ao as FetchEventLiveVolumeResponseSchema,so as FetchOpenInterestResponseSchema,Vt as FetchPortfolioValueResponseSchema,Co as FetchResolutionsResponseSchema,fo as FetchTraderLeaderboardStandingResponseSchema,Wt as FetchUserPnlResponseSchema,wt as FetchUserStatsResponseSchema,Ht as FetchUserVolumeResponseSchema,rt as HolderSchema,fe as LeaderboardWindow,uo as LeaderboardWindowSchema,$t as ListActivityResponseSchema,vo as ListBiggestWinnersResponseSchema,So as ListBuilderLeaderboardResponseSchema,Jt as ListComboActivityResponseSchema,Ft as ListComboPositionsResponseSchema,ro as ListMarketHoldersResponseSchema,Nt as ListPositionsResponseSchema,io as ListPriceHistoryResponseSchema,ho as ListTraderLeaderboardResponseSchema,Qt as ListTradesResponseSchema,mt as LiveVolumeSchema,lt as MarketLiveVolumeSchema,st as MetaHolderSchema,at as OpenInterestSchema,Ve as PortfolioValueSchema,pe as PositionFilterType,Ut as PositionFilterTypeSchema,Ue as PositionRowStatusSchema,Ne as PositionSchema,ce as PositionSortBy,Ot as PositionSortBySchema,de as PositionStatus,Mt as PositionStatusSchema,he as PriceHistoryInterval,no as PriceHistoryIntervalSchema,it as PriceHistoryPointSchema,Ce as ResolutionMarketType,bt as ResolutionMarketTypeSchema,Te as ResolutionReporter,ft as ResolutionReporterSchema,vt as ResolutionSchema,Ee as ResolutionSource,ht as ResolutionSourceSchema,Re as ResolutionStatus,St as ResolutionStatusSchema,re as SortDirection,At as SortDirectionSchema,ie as TipSide,q as TipSideSchema,se as TradeFilterType,Rt as TradeFilterTypeSchema,Qe as TradeSchema,pt as TraderLeaderboardEntrySchema,Ie as TraderLeaderboardSort,_o 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
|