@polymarket/bindings 0.13.0 → 0.14.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-JPPG656Y.js +2 -0
- package/dist/chunk-JPPG656Y.js.map +1 -0
- package/dist/chunk-YXNKEMRF.js +2 -0
- package/dist/chunk-YXNKEMRF.js.map +1 -0
- package/dist/chunk-ZMJTXTXA.js +2 -0
- package/dist/chunk-ZMJTXTXA.js.map +1 -0
- package/dist/clob/index.d.ts +489 -8
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/combos/index.d.ts +1 -1
- package/dist/combos/index.js +1 -1
- package/dist/combos/index.js.map +1 -1
- package/dist/{comment-CKJIqOZS.d.ts → comment-tQ-L48Di.d.ts} +2 -2
- package/dist/data/index.d.ts +276 -9
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +79 -4
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +108 -213
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{orders-BV68_6ST.d.ts → orders-SIFuRgWc.d.ts} +114 -2
- package/dist/perps/index.d.ts +76 -3
- package/dist/perps/index.js +1 -1
- package/dist/perps/index.js.map +1 -1
- package/dist/relayer/index.d.ts +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/shared-QrXQ5O6x.d.ts +223 -0
- package/dist/subscriptions/index.d.ts +316 -23
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-2FRDSBWY.js +0 -2
- package/dist/chunk-2FRDSBWY.js.map +0 -1
- package/dist/chunk-3IZ4N7C2.js +0 -2
- package/dist/chunk-3IZ4N7C2.js.map +0 -1
- package/dist/chunk-Z6SGQXSJ.js +0 -2
- package/dist/chunk-Z6SGQXSJ.js.map +0 -1
package/dist/data/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConditionId, PositionId, IsoDateTimeString, DecimalString, ComboConditionId, EpochMilliseconds, PaginationCursor, TokenId, IsoCalendarDateString, OrderSide, ComboActivityId, ClobAssetId, EventId, BuilderCode, QuestionId } from '../
|
|
1
|
+
import { u as ConditionId, am as PositionId, $ as IsoDateTimeString, y as DecimalString, o as ComboConditionId, H as EpochMilliseconds, aj as PaginationCursor, aK as TokenId, Z as IsoCalendarDateString, af as OrderSide, m as ComboActivityId, h as ClobAssetId, O as EventId, d as BuilderCode, ap as QuestionId } from '../shared-QrXQ5O6x.js';
|
|
2
2
|
import * as _polymarket_types from '@polymarket/types';
|
|
3
3
|
import { EvmAddress, TxHash } from '@polymarket/types';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -2571,11 +2571,18 @@ type ComboTradeActivity = TradeActivityBase & {
|
|
|
2571
2571
|
conditionId: ComboConditionId;
|
|
2572
2572
|
/** Combo position id bought or sold by the wallet. */
|
|
2573
2573
|
positionId: PositionId;
|
|
2574
|
+
/** Basket token label, when available; never a selected leg's label. */
|
|
2575
|
+
outcome?: string;
|
|
2576
|
+
/** Basket token side index, when known. Missing is not zero. */
|
|
2577
|
+
outcomeIndex?: number;
|
|
2574
2578
|
};
|
|
2575
2579
|
type TradeActivity = ClobTradeActivity | ComboTradeActivity;
|
|
2576
|
-
|
|
2580
|
+
/** Collateral split into a market or Combo complete set; narrow on isCombo for market URLs. */
|
|
2581
|
+
type SplitActivity = ActivityBase & ({
|
|
2577
2582
|
/** Splitting collateral into a complete market set. */
|
|
2578
2583
|
type: 'SPLIT';
|
|
2584
|
+
/** Ordinary complete-set activity; parsed rows return false. */
|
|
2585
|
+
isCombo?: false;
|
|
2579
2586
|
/** Condition id of the market whose complete set was created. */
|
|
2580
2587
|
conditionId: ConditionId;
|
|
2581
2588
|
/** The collateral amount split into the complete set in USD. */
|
|
@@ -2588,10 +2595,24 @@ type SplitActivity = ActivityBase & {
|
|
|
2588
2595
|
icon: string | null;
|
|
2589
2596
|
/** URL slug of the event containing the split market. */
|
|
2590
2597
|
eventSlug: string;
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2598
|
+
} | {
|
|
2599
|
+
/** Complete-set activity for a Combo basket. */
|
|
2600
|
+
type: 'SPLIT';
|
|
2601
|
+
isCombo: true;
|
|
2602
|
+
/** Canonical Combo condition id of the basket. */
|
|
2603
|
+
conditionId: ComboConditionId;
|
|
2604
|
+
/** Collateral amount in USD. */
|
|
2605
|
+
amount: DecimalString;
|
|
2606
|
+
/** Human-readable basket title, when available. */
|
|
2607
|
+
title?: string;
|
|
2608
|
+
icon: string | null;
|
|
2609
|
+
});
|
|
2610
|
+
/** A complete set merged into collateral; narrow on isCombo for market URLs. */
|
|
2611
|
+
type MergeActivity = ActivityBase & ({
|
|
2593
2612
|
/** Merging a complete market set into collateral. */
|
|
2594
2613
|
type: 'MERGE';
|
|
2614
|
+
/** Ordinary complete-set activity; parsed rows return false. */
|
|
2615
|
+
isCombo?: false;
|
|
2595
2616
|
/** Condition id of the market whose complete set was merged. */
|
|
2596
2617
|
conditionId: ConditionId;
|
|
2597
2618
|
/** The collateral amount received from merging the complete set in USD. */
|
|
@@ -2604,10 +2625,27 @@ type MergeActivity = ActivityBase & {
|
|
|
2604
2625
|
icon: string | null;
|
|
2605
2626
|
/** URL slug of the event containing the merged market. */
|
|
2606
2627
|
eventSlug: string;
|
|
2607
|
-
}
|
|
2608
|
-
|
|
2628
|
+
} | {
|
|
2629
|
+
/** Complete-set activity for a Combo basket. */
|
|
2630
|
+
type: 'MERGE';
|
|
2631
|
+
isCombo: true;
|
|
2632
|
+
/** Canonical Combo condition id of the basket. */
|
|
2633
|
+
conditionId: ComboConditionId;
|
|
2634
|
+
/** Collateral amount in USD. */
|
|
2635
|
+
amount: DecimalString;
|
|
2636
|
+
/** Human-readable basket title, when available. */
|
|
2637
|
+
title?: string;
|
|
2638
|
+
icon: string | null;
|
|
2639
|
+
});
|
|
2640
|
+
type ClobRedeemActivity = ActivityBase & {
|
|
2609
2641
|
/** Redeeming resolved market proceeds. */
|
|
2610
2642
|
type: 'REDEEM';
|
|
2643
|
+
/** Ordinary redemption; parsed rows return false, constructed values may omit it. */
|
|
2644
|
+
isCombo?: false;
|
|
2645
|
+
/** Label of the redeemed token, when available. */
|
|
2646
|
+
outcome?: string;
|
|
2647
|
+
/** Index of the redeemed token's outcome, when known. */
|
|
2648
|
+
outcomeIndex?: number;
|
|
2611
2649
|
/** Condition id of the market redeemed by the wallet. */
|
|
2612
2650
|
conditionId: ConditionId;
|
|
2613
2651
|
/** The proceeds redeemed from the resolved market in USD. */
|
|
@@ -2621,6 +2659,24 @@ type RedeemActivity = ActivityBase & {
|
|
|
2621
2659
|
/** URL slug of the event containing the redeemed market. */
|
|
2622
2660
|
eventSlug: string;
|
|
2623
2661
|
};
|
|
2662
|
+
/** A resolved Combo token's proceeds in wallet activity history. */
|
|
2663
|
+
type ComboRedemptionActivity = ActivityBase & {
|
|
2664
|
+
type: 'REDEEM';
|
|
2665
|
+
isCombo: true;
|
|
2666
|
+
/** Canonical Combo condition id of the redeemed basket. */
|
|
2667
|
+
conditionId: ComboConditionId;
|
|
2668
|
+
/** Proceeds redeemed in USD. */
|
|
2669
|
+
amount: DecimalString;
|
|
2670
|
+
/** Human-readable title of the redeemed basket, when available. */
|
|
2671
|
+
title?: string;
|
|
2672
|
+
icon: string | null;
|
|
2673
|
+
/** Basket token label, when available; never a selected leg's label. */
|
|
2674
|
+
outcome?: string;
|
|
2675
|
+
/** Basket token side index, when known. Missing is not zero. */
|
|
2676
|
+
outcomeIndex?: number;
|
|
2677
|
+
};
|
|
2678
|
+
/** Wallet redemption; narrow on isCombo before using market-only metadata. */
|
|
2679
|
+
type RedeemActivity = ClobRedeemActivity | ComboRedemptionActivity;
|
|
2624
2680
|
type ConversionActivity = ActivityBase & {
|
|
2625
2681
|
/** A market conversion or migration activity. */
|
|
2626
2682
|
type: 'CONVERSION';
|
|
@@ -4482,9 +4538,18 @@ type Resolution = {
|
|
|
4482
4538
|
reproposedPrice?: DecimalString;
|
|
4483
4539
|
/** Final oracle settlement price, omitted until set. */
|
|
4484
4540
|
price?: DecimalString;
|
|
4485
|
-
/**
|
|
4541
|
+
/**
|
|
4542
|
+
* Transaction for the latest lifecycle event, or `null` when unavailable.
|
|
4543
|
+
* On UMA lifecycle rows, this can differ from the initial RequestPrice
|
|
4544
|
+
* transaction whose log index is retained in `logIndex`.
|
|
4545
|
+
*/
|
|
4486
4546
|
transactionHash: TxHash | null;
|
|
4487
|
-
/**
|
|
4547
|
+
/**
|
|
4548
|
+
* Initial RequestPrice log index on UMA lifecycle rows, or `null` when
|
|
4549
|
+
* unavailable. It need not belong to `transactionHash`.
|
|
4550
|
+
* Condition-resolution fallback rows instead carry their condition event's
|
|
4551
|
+
* log index and transaction hash.
|
|
4552
|
+
*/
|
|
4488
4553
|
logIndex: number | null;
|
|
4489
4554
|
/** Latest lifecycle change as an ISO 8601 datetime. */
|
|
4490
4555
|
lastUpdatedAt: IsoDateTimeString;
|
|
@@ -4593,4 +4658,206 @@ declare const FetchResolutionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
4593
4658
|
}>>;
|
|
4594
4659
|
type FetchResolutionsResponse = z.infer<typeof FetchResolutionsResponseSchema>;
|
|
4595
4660
|
|
|
4596
|
-
|
|
4661
|
+
/** Contract family that issued an outcome asset. */
|
|
4662
|
+
declare enum TokenModule {
|
|
4663
|
+
V1Ctf = "v1_ctf",
|
|
4664
|
+
Binary = "binary",
|
|
4665
|
+
NegRisk = "neg_risk",
|
|
4666
|
+
Combo = "combo"
|
|
4667
|
+
}
|
|
4668
|
+
declare const TokenModuleSchema: z.ZodEnum<typeof TokenModule>;
|
|
4669
|
+
/** Reference facts and current settlement metadata for an outcome asset. */
|
|
4670
|
+
type TokenReference = {
|
|
4671
|
+
/** Decimal ERC-1155 identifier, including structured protocol v2 assets. */
|
|
4672
|
+
assetId: ClobAssetId;
|
|
4673
|
+
/** Market condition in its 32-byte representation. */
|
|
4674
|
+
conditionId: ConditionId;
|
|
4675
|
+
/** On-chain protocol v2 condition in its 32-byte form; null for v1 assets. */
|
|
4676
|
+
structuralConditionId: ConditionId | null;
|
|
4677
|
+
module: TokenModule;
|
|
4678
|
+
/** On-chain outcome slot; this can differ from the market's order-book slot. */
|
|
4679
|
+
outcomeIndex: number;
|
|
4680
|
+
/** Order-book token-list slot; null before registration or outside v1. */
|
|
4681
|
+
clobIndex: number | null;
|
|
4682
|
+
/** Outcome label, which can lag by up to a minute. */
|
|
4683
|
+
outcome: string | null;
|
|
4684
|
+
/** The other asset of a two-outcome condition; otherwise null. */
|
|
4685
|
+
oppositeAssetId: ClobAssetId | null;
|
|
4686
|
+
/** Whether an on-chain payout exists; this can lag by up to a minute. */
|
|
4687
|
+
resolved: boolean;
|
|
4688
|
+
/** Payout rate, including fractional split payouts; null while unresolved. */
|
|
4689
|
+
finalPrice: DecimalString | null;
|
|
4690
|
+
title: string | null;
|
|
4691
|
+
marketSlug: string | null;
|
|
4692
|
+
/** Market closure state, which can lag by up to a minute. */
|
|
4693
|
+
closed: boolean | null;
|
|
4694
|
+
negRisk: boolean | null;
|
|
4695
|
+
/** Identifier of the containing neg-risk structure. */
|
|
4696
|
+
negRiskMarketId: ConditionId | null;
|
|
4697
|
+
/** Market's question index within its neg-risk structure. */
|
|
4698
|
+
questionIndex: number | null;
|
|
4699
|
+
/** Lowest event ID associated with the market. */
|
|
4700
|
+
eventId: EventId | null;
|
|
4701
|
+
eventSlug: string | null;
|
|
4702
|
+
};
|
|
4703
|
+
declare const TokenReferenceSchema: z.ZodPipe<z.ZodObject<{
|
|
4704
|
+
token_id: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>;
|
|
4705
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>;
|
|
4706
|
+
structural_condition_id: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
|
|
4707
|
+
module: z.ZodEnum<typeof TokenModule>;
|
|
4708
|
+
outcome_index: z.ZodNumber;
|
|
4709
|
+
clob_index: z.ZodNullable<z.ZodNumber>;
|
|
4710
|
+
outcome: z.ZodNullable<z.ZodString>;
|
|
4711
|
+
opposite_token_id: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>>;
|
|
4712
|
+
resolved: z.ZodBoolean;
|
|
4713
|
+
final_price: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>>;
|
|
4714
|
+
title: z.ZodNullable<z.ZodString>;
|
|
4715
|
+
market_slug: z.ZodNullable<z.ZodString>;
|
|
4716
|
+
closed: z.ZodNullable<z.ZodBoolean>;
|
|
4717
|
+
neg_risk: z.ZodNullable<z.ZodBoolean>;
|
|
4718
|
+
neg_risk_market_id: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
|
|
4719
|
+
question_index: z.ZodNullable<z.ZodNumber>;
|
|
4720
|
+
event_id: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<EventId, number>>>;
|
|
4721
|
+
event_slug: z.ZodNullable<z.ZodString>;
|
|
4722
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
4723
|
+
assetId: PositionId | TokenId;
|
|
4724
|
+
conditionId: ConditionId;
|
|
4725
|
+
structuralConditionId: ConditionId | null;
|
|
4726
|
+
module: TokenModule;
|
|
4727
|
+
outcomeIndex: number;
|
|
4728
|
+
clobIndex: number | null;
|
|
4729
|
+
outcome: string | null;
|
|
4730
|
+
oppositeAssetId: PositionId | TokenId | null;
|
|
4731
|
+
resolved: boolean;
|
|
4732
|
+
finalPrice: DecimalString | null;
|
|
4733
|
+
title: string | null;
|
|
4734
|
+
marketSlug: string | null;
|
|
4735
|
+
closed: boolean | null;
|
|
4736
|
+
negRisk: boolean | null;
|
|
4737
|
+
negRiskMarketId: ConditionId | null;
|
|
4738
|
+
questionIndex: number | null;
|
|
4739
|
+
eventId: EventId | null;
|
|
4740
|
+
eventSlug: string | null;
|
|
4741
|
+
}, {
|
|
4742
|
+
token_id: PositionId | TokenId;
|
|
4743
|
+
condition_id: ConditionId;
|
|
4744
|
+
structural_condition_id: ConditionId | null;
|
|
4745
|
+
module: TokenModule;
|
|
4746
|
+
outcome_index: number;
|
|
4747
|
+
clob_index: number | null;
|
|
4748
|
+
outcome: string | null;
|
|
4749
|
+
opposite_token_id: PositionId | TokenId | null;
|
|
4750
|
+
resolved: boolean;
|
|
4751
|
+
final_price: DecimalString | null;
|
|
4752
|
+
title: string | null;
|
|
4753
|
+
market_slug: string | null;
|
|
4754
|
+
closed: boolean | null;
|
|
4755
|
+
neg_risk: boolean | null;
|
|
4756
|
+
neg_risk_market_id: ConditionId | null;
|
|
4757
|
+
question_index: number | null;
|
|
4758
|
+
event_id: EventId | null;
|
|
4759
|
+
event_slug: string | null;
|
|
4760
|
+
}>>;
|
|
4761
|
+
declare const FetchTokenReferencesResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
4762
|
+
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
4763
|
+
token_id: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>;
|
|
4764
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>;
|
|
4765
|
+
structural_condition_id: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
|
|
4766
|
+
module: z.ZodEnum<typeof TokenModule>;
|
|
4767
|
+
outcome_index: z.ZodNumber;
|
|
4768
|
+
clob_index: z.ZodNullable<z.ZodNumber>;
|
|
4769
|
+
outcome: z.ZodNullable<z.ZodString>;
|
|
4770
|
+
opposite_token_id: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>>>;
|
|
4771
|
+
resolved: z.ZodBoolean;
|
|
4772
|
+
final_price: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>>;
|
|
4773
|
+
title: z.ZodNullable<z.ZodString>;
|
|
4774
|
+
market_slug: z.ZodNullable<z.ZodString>;
|
|
4775
|
+
closed: z.ZodNullable<z.ZodBoolean>;
|
|
4776
|
+
neg_risk: z.ZodNullable<z.ZodBoolean>;
|
|
4777
|
+
neg_risk_market_id: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
|
|
4778
|
+
question_index: z.ZodNullable<z.ZodNumber>;
|
|
4779
|
+
event_id: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<EventId, number>>>;
|
|
4780
|
+
event_slug: z.ZodNullable<z.ZodString>;
|
|
4781
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
4782
|
+
assetId: PositionId | TokenId;
|
|
4783
|
+
conditionId: ConditionId;
|
|
4784
|
+
structuralConditionId: ConditionId | null;
|
|
4785
|
+
module: TokenModule;
|
|
4786
|
+
outcomeIndex: number;
|
|
4787
|
+
clobIndex: number | null;
|
|
4788
|
+
outcome: string | null;
|
|
4789
|
+
oppositeAssetId: PositionId | TokenId | null;
|
|
4790
|
+
resolved: boolean;
|
|
4791
|
+
finalPrice: DecimalString | null;
|
|
4792
|
+
title: string | null;
|
|
4793
|
+
marketSlug: string | null;
|
|
4794
|
+
closed: boolean | null;
|
|
4795
|
+
negRisk: boolean | null;
|
|
4796
|
+
negRiskMarketId: ConditionId | null;
|
|
4797
|
+
questionIndex: number | null;
|
|
4798
|
+
eventId: EventId | null;
|
|
4799
|
+
eventSlug: string | null;
|
|
4800
|
+
}, {
|
|
4801
|
+
token_id: PositionId | TokenId;
|
|
4802
|
+
condition_id: ConditionId;
|
|
4803
|
+
structural_condition_id: ConditionId | null;
|
|
4804
|
+
module: TokenModule;
|
|
4805
|
+
outcome_index: number;
|
|
4806
|
+
clob_index: number | null;
|
|
4807
|
+
outcome: string | null;
|
|
4808
|
+
opposite_token_id: PositionId | TokenId | null;
|
|
4809
|
+
resolved: boolean;
|
|
4810
|
+
final_price: DecimalString | null;
|
|
4811
|
+
title: string | null;
|
|
4812
|
+
market_slug: string | null;
|
|
4813
|
+
closed: boolean | null;
|
|
4814
|
+
neg_risk: boolean | null;
|
|
4815
|
+
neg_risk_market_id: ConditionId | null;
|
|
4816
|
+
question_index: number | null;
|
|
4817
|
+
event_id: EventId | null;
|
|
4818
|
+
event_slug: string | null;
|
|
4819
|
+
}>>>;
|
|
4820
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
4821
|
+
assetId: PositionId | TokenId;
|
|
4822
|
+
conditionId: ConditionId;
|
|
4823
|
+
structuralConditionId: ConditionId | null;
|
|
4824
|
+
module: TokenModule;
|
|
4825
|
+
outcomeIndex: number;
|
|
4826
|
+
clobIndex: number | null;
|
|
4827
|
+
outcome: string | null;
|
|
4828
|
+
oppositeAssetId: PositionId | TokenId | null;
|
|
4829
|
+
resolved: boolean;
|
|
4830
|
+
finalPrice: DecimalString | null;
|
|
4831
|
+
title: string | null;
|
|
4832
|
+
marketSlug: string | null;
|
|
4833
|
+
closed: boolean | null;
|
|
4834
|
+
negRisk: boolean | null;
|
|
4835
|
+
negRiskMarketId: ConditionId | null;
|
|
4836
|
+
questionIndex: number | null;
|
|
4837
|
+
eventId: EventId | null;
|
|
4838
|
+
eventSlug: string | null;
|
|
4839
|
+
}[], {
|
|
4840
|
+
data: {
|
|
4841
|
+
assetId: PositionId | TokenId;
|
|
4842
|
+
conditionId: ConditionId;
|
|
4843
|
+
structuralConditionId: ConditionId | null;
|
|
4844
|
+
module: TokenModule;
|
|
4845
|
+
outcomeIndex: number;
|
|
4846
|
+
clobIndex: number | null;
|
|
4847
|
+
outcome: string | null;
|
|
4848
|
+
oppositeAssetId: PositionId | TokenId | null;
|
|
4849
|
+
resolved: boolean;
|
|
4850
|
+
finalPrice: DecimalString | null;
|
|
4851
|
+
title: string | null;
|
|
4852
|
+
marketSlug: string | null;
|
|
4853
|
+
closed: boolean | null;
|
|
4854
|
+
negRisk: boolean | null;
|
|
4855
|
+
negRiskMarketId: ConditionId | null;
|
|
4856
|
+
questionIndex: number | null;
|
|
4857
|
+
eventId: EventId | null;
|
|
4858
|
+
eventSlug: string | null;
|
|
4859
|
+
}[];
|
|
4860
|
+
}>>;
|
|
4861
|
+
type FetchTokenReferencesResponse = z.infer<typeof FetchTokenReferencesResponseSchema>;
|
|
4862
|
+
|
|
4863
|
+
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 ClobRedeemActivity, 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 ComboRedemptionActivity, 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 FetchTokenReferencesResponse, FetchTokenReferencesResponseSchema, 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, TokenModule, TokenModuleSchema, type TokenReference, TokenReferenceSchema, 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,$ 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
|
|
1
|
+
import {ba,Ra,Fa,da,fa,qa,pa,Ea,aa,Oa,$ as $$1,Aa,Ua,Y as Y$1,na,Qa,ia,Pa,A as A$1,Ga,w,U,q,G}from'../chunk-JPPG656Y.js';import {z}from'zod';var Y=(_=>(_.TRADE="TRADE",_.SPLIT="SPLIT",_.MERGE="MERGE",_.REDEEM="REDEEM",_.REWARD="REWARD",_.CONVERSION="CONVERSION",_.MIGRATION="MIGRATION",_.MAKER_REBATE="MAKER_REBATE",_.REFERRAL_REWARD="REFERRAL_REWARD",_.YIELD="YIELD",_.DEPOSIT="DEPOSIT",_.WITHDRAWAL="WITHDRAWAL",_.TAKER_REBATE="TAKER_REBATE",_.TIP="TIP",_))(Y||{}),me=z.enum(Y),de=(i=>(i.In="IN",i.Out="OUT",i))(de||{}),$=z.enum(de),ce=(i=>(i.Asc="ASC",i.Desc="DESC",i))(ce||{}),wt=z.enum(ce),pe=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(pe||{}),Zt=z.enum(pe);function Ze(e){let t=e.length===64?`${e}00`:e;return q(t.toLowerCase())}function Ke(e){if(e.length===66)return true;let t=e.toLowerCase();return t.startsWith("0x01")||t.startsWith("0x02")}var Kt=ba.refine(Ke,"Expected a 32-byte condition ID or a 31-byte protocol v2 market condition ID").transform(Ze);function A(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:G(i.next_cursor)}))}function f(e){return z.object({data:e}).transform(t=>t.data)}var ge=(l=>(l.Open="OPEN",l.Redeemable="REDEEMABLE",l.Partial="PARTIAL",l.ResolvedPartial="RESOLVED_PARTIAL",l.ResolvedWin="RESOLVED_WIN",l.ResolvedLoss="RESOLVED_LOSS",l))(ge||{}),_e=z.enum(ge),be=(m=>(m.Open="OPEN",m.Redeemable="REDEEMABLE",m.RedeemableLost="REDEEMABLE_LOST",m.Mergeable="MERGEABLE",m.Closed="CLOSED",m))(be||{}),eo=z.enum(be),Ge=z.enum(["OPEN","REDEEMABLE","CLOSED"]),ye=(p=>(p.CurrentValue="CURRENT_VALUE",p.Price="PRICE",p.Tokens="TOKENS",p.UnrealizedPnl="UNREALIZED_PNL",p.RealizedPnl="REALIZED_PNL",p.TotalPnl="TOTAL_PNL",p.Timestamp="TIMESTAMP",p))(ye||{}),to=z.enum(ye),Se=(i=>(i.Cash="CASH",i.Tokens="TOKENS",i))(Se||{}),oo=z.enum(Se),fe=(r=>(r.FirstEntry="FIRST_ENTRY",r.EntryCost="ENTRY_COST",r.CurrentValue="CURRENT_VALUE",r.Updated="UPDATED",r))(fe||{}),no=z.enum(fe),k=z.preprocess(e=>e===""?void 0:e,z.string().optional()),qe=z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),Ye=z.object({proxy_wallet:da,token_id:Fa,condition_id:ba,current_size:Ra,avg_price:Ra,entry_cost_usdc:Ra,entry_fees_usdc:Ra,total_cost_usdc:Ra,current_price:Ra,current_value:Ra,total_size:Ra,realized_pnl:Ra,unrealized_pnl:Ra,total_pnl:Ra,percent_pnl:Ra,percent_realized_pnl:Ra,status:Ge,redeemable:z.boolean(),mergeable:z.boolean(),negative_risk:z.boolean(),archived:z.boolean(),title:k,slug:k,icon:k,event_id:k,event_slug:k,outcome:k,outcome_index:qe,opposite_outcome:k,opposite_token_id:z.preprocess(e=>e===""?void 0:e,Fa.optional()),end_date:z.preprocess(e=>e===""?void 0:e,qa.optional()),last_event_at:z.preprocess(e=>e===0?void 0:e,fa.optional()),first_entry_at:z.preprocess(e=>e===0?void 0:e,fa.optional()),name:k,profile_image:k,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})),$e=z.object({proxy_wallet:da,value:Ra}).transform(({proxy_wallet:e,value:t})=>({wallet:e,value:t})),he=(l=>(l.Max="max",l.OneMonth="1m",l.OneWeek="1w",l.OneDay="1d",l.TwelveHours="12h",l.SixHours="6h",l))(he||{}),Qe=z.enum(he),Ie=(m=>(m.OneDay="1d",m.EighteenHours="18h",m.TwelveHours="12h",m.ThreeHours="3h",m.OneHour="1h",m))(Ie||{}),ue=z.enum(Ie),b=Ra.nullish().transform(e=>e??null),ve=z.object({timestamp:fa,source_block:z.number().int().nonnegative(),realized_market_pnl:Ra,realized_lp_pnl:Ra,realized_combo_pnl:Ra,unrealized_pnl:b,fees_refunded:b,maker_rebate:b,taker_rebate:b,reward_income:b,yield_income:b,referral_income:b,deposits:b,withdrawals:b,realized_pnl:Ra,wallet_income:b,position_pnl:b,settled_pnl:b,economic_pnl:b,trade_pnl:b,sponsored_income:b,fees:b,fees_paid:b,cashflow_net:b,volume:Ra,volume_usdc:Ra,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:p,reward_income:O,yield_income:C,referral_income:H,realized_pnl:F,wallet_income:j,position_pnl:w,settled_pnl:_,economic_pnl:Z,trade_pnl:K,sponsored_income:G,fees_paid:We,cashflow_net:He,volume_usdc:Fe,trade_count:je,...we})=>({...we,sourceBlock:e,realizedMarketPnl:t,realizedLpPnl:i,realizedComboPnl:a,unrealizedPnl:r,feesRefunded:m,makerRebate:l,takerRebate:p,rewardIncome:O,yieldIncome:C,referralIncome:H,realizedPnl:F,walletIncome:j,positionPnl:w,settledPnl:_,economicPnl:Z,tradePnl:K,sponsoredIncome:G,feesPaid:We,cashflowNet:He,volumeUsdc:Fe,tradeCount:je})),Je=z.object({proxy_wallet:da,interval:Qe,fidelity:ue,source_fidelity:ue,points:z.array(ve)}).transform(({proxy_wallet:e,source_fidelity:t,...i})=>({...i,wallet:e,sourceFidelity:t})),Xe=z.object({volume:Ra,volume_usdc:Ra,trade_count:z.number().int().nonnegative()}).transform(({volume_usdc:e,trade_count:t,...i})=>({...i,volumeUsdc:e,tradeCount:t})),et=z.object({proxy_wallet:da,trades:z.number().int().nonnegative(),biggest_win:Ra,views:z.number().int().nonnegative(),join_date:fa.nullish(),all_time_pnl:ve.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})),tt=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})),ot=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:pa.nullish(),event:tt.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})),Q=z.object({leg_index:z.number().int(),leg_position_id:Ea,leg_condition_id:ba,leg_outcome_index:z.number().int(),leg_outcome_label:z.string().nullish(),leg_status:_e,leg_resolved_at:pa.nullish(),leg_current_price:Ra.nullish(),market:ot.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:p,...O})=>({...O,legIndex:e,legPositionId:t,legConditionId:i,legOutcomeIndex:a,legOutcomeLabel:r,legStatus:m,legResolvedAt:l,legCurrentPrice:p})),nt=z.object({combo_condition_id:aa,outcome_index:z.number().int(),outcome_label:z.string(),combo_position_id:Ea,proxy_wallet:da,current_size:Ra,entry_avg_price_usdc:Ra,entry_cost_usdc:Ra,gross_entry_cost_usdc:Ra,entry_fees_usdc:Ra,realized_payout_usdc:Ra,status:_e,redeemable:z.boolean(),first_entry_at:pa,resolved_at:pa.nullish(),legs_total:z.number().int(),legs_resolved:z.number().int(),legs_pending:z.number().int(),legs:z.array(Q),updated_at:pa}).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:p,gross_entry_cost_usdc:O,entry_fees_usdc:C,realized_payout_usdc:H,first_entry_at:F,resolved_at:j,legs_total:w,legs_resolved:_,legs_pending:Z,updated_at:K,...G})=>({...G,conditionId:e,outcomeIndex:t,outcomeLabel:i,positionId:a,wallet:r,currentSize:m,entryAvgPriceUsdc:l,entryCostUsdc:p,grossEntryCostUsdc:O,entryFeesUsdc:C,realizedPayoutUsdc:H,firstEntryAt:F,resolvedAt:j,legsTotal:w,legsResolved:_,legsPending:Z,updatedAt:K})),io=A(Ye),ro=f($e),so=f(et.nullable()),ao=f(Je),lo=f(Xe),mo=A(nt);var xe=(p=>(p.Split="SPLIT",p.Merge="MERGE",p.Convert="CONVERT",p.Compress="COMPRESS",p.Wrap="WRAP",p.Unwrap="UNWRAP",p.Redeem="REDEEM",p))(xe||{}),it=z.enum(xe),rt=z.object({id:$$1,type:it,proxy_wallet:da,combo_condition_id:aa,combo_position_id:Ea,amount_usdc:Ra.nullish(),payout_usdc:Ra.nullish(),timestamp:fa,transaction_hash:Oa,block_number:z.number().int(),legs:z.array(Q)}),st=rt.transform(dt),u=z.preprocess(e=>e===""?void 0:e,z.string().optional()),Ae=z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),at=z.object({proxy_wallet:da,side:Aa,token_id:Fa,condition_id:ba,size:Ra,price:Ra,timestamp:fa,title:u,slug:u,icon:u,event_slug:u,outcome:u,outcome_index:Ae,name:u,pseudonym:u,bio:u,profile_image:u,profile_image_optimized:u,transaction_hash:Oa}).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})),lt=z.object({proxy_wallet:da,timestamp:fa,condition_id:z.preprocess(e=>e===""?void 0:e,ba.optional()),type:me,size:Ra,usdc_size:Ra,transaction_hash:Oa,price:Ra,token_id:z.preprocess(e=>e===""?void 0:e,Fa.optional()),side:z.preprocess(e=>e===""?void 0:e,z.union([Aa,$]).optional()),is_combo:z.boolean().optional(),outcome_index:Ae,title:u,slug:u,icon:u,event_slug:u,outcome:u,name:u,pseudonym:u,bio:u,profile_image:u,profile_image_optimized:u}).superRefine((e,t)=>{if(e.is_combo!==true||e.type!=="TRADE"&&e.type!=="REDEEM"&&e.type!=="SPLIT"&&e.type!=="MERGE")return;let i=aa.safeParse(e.condition_id);if(!i.success)for(let a of i.error.issues)t.addIssue({...a,path:["condition_id",...a.path]});}),mt=lt.transform(pt),yo=A(at),So=A(mt),fo=A(st);function dt(e){let t=ct(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 ct(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 pt(e){let t=_t(e);switch(e.type){case "TRADE":return ut(e,t);case "REDEEM":return gt(e,t);case "SPLIT":case "MERGE":return e.is_combo===true?{...t,type:e.type,isCombo:true,conditionId:aa.parse(e.condition_id),amount:e.usdc_size,title:e.title,icon:e.icon??null}:{...t,type:e.type,isCombo:false,conditionId:c(e.condition_id,"condition_id"),amount:e.usdc_size,title:c(e.title,"title"),slug:c(e.slug,"slug"),icon:e.icon??null,eventSlug:c(e.event_slug,"event_slug")};case "CONVERSION":return {...t,type:e.type,conditionId:c(e.condition_id,"condition_id"),amount:e.usdc_size,title:c(e.title,"title"),slug:c(e.slug,"slug"),icon:e.icon??null,eventSlug:c(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:$.parse(e.side)}}}function ut(e,t){let i={...t,type:"TRADE",side:Aa.parse(c(e.side,"side")),shares:e.size,amount:e.usdc_size,price:e.price,title:c(e.title,"title"),icon:e.icon??null};if(e.is_combo===true)return {...i,isCombo:true,conditionId:aa.parse(c(e.condition_id,"condition_id")),positionId:Ea.parse(c(e.token_id,"token_id")),outcome:e.outcome,outcomeIndex:e.outcome_index};let a=c(e.token_id,"token_id");return {...i,isCombo:false,conditionId:c(e.condition_id,"condition_id"),assetId:a,tokenId:a,outcome:c(e.outcome,"outcome"),outcomeIndex:e.outcome_index,slug:c(e.slug,"slug"),eventSlug:c(e.event_slug,"event_slug")}}function gt(e,t){let i={...t,type:"REDEEM",amount:e.usdc_size,title:e.title,icon:e.icon??null,outcome:e.outcome,outcomeIndex:e.outcome_index};return e.is_combo===true?{...i,isCombo:true,conditionId:aa.parse(c(e.condition_id,"condition_id"))}:{...i,isCombo:false,title:c(e.title,"title"),conditionId:c(e.condition_id,"condition_id"),slug:c(e.slug,"slug"),eventSlug:c(e.event_slug,"event_slug")}}function _t(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 c(e,t){if(e==null)throw new TypeError(`Expected activity.${t} to be present`);return e}var Ce=(l=>(l.Max="max",l.OneMonth="1m",l.OneWeek="1w",l.OneDay="1d",l.SixHours="6h",l.OneHour="1h",l))(Ce||{}),Ao=z.enum(Ce),bt=z.object({timestamp:fa,price:Ra,resolution_seconds:z.number().int().nonnegative()}).transform(({price:e,resolution_seconds:t,timestamp:i})=>({timestamp:i,price:e,resolutionSeconds:t})),Co=A(bt),B=z.preprocess(e=>e===""?null:e,z.string().nullable()),yt=z.object({proxy_wallet:da,bio:B,token_id:Fa,pseudonym:B,amount:Ra,display_username_public:z.boolean(),outcome_index:z.preprocess(e=>e===999?null:e,z.number().int().nullable()),name:B,profile_image:B,profile_image_optimized:B,verified:z.boolean(),avg_price:Ra.nullish(),entry_cost_usdc:Ra.nullish(),current_price:Ra.nullish(),current_value:Ra.nullish(),realized_pnl:Ra.nullish(),unrealized_pnl:Ra.nullish(),total_pnl:Ra.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:Fa,holders:z.array(yt)}).transform(({holders:e,token_id:t})=>({assetId:t,token:t,holders:e})),ft=z.object({condition_id:z.union([ba,z.literal("GLOBAL")]),value:Ra}).transform(({condition_id:e,value:t})=>({conditionId:e==="GLOBAL"?null:e,value:t})),ht=z.object({condition_id:z.preprocess(Ua,ba.nullable()),taker_volume:Ra}).transform(({condition_id:e,taker_volume:t})=>({conditionId:e,takerVolume:t})),It=z.object({taker_volume_total:Ra,conditions:z.array(ht)}).transform(({conditions:e,taker_volume_total:t})=>({markets:e,takerVolumeTotal:t})),Ro=A(St),Eo=f(z.array(ft)),To=f(It);var vt=(i=>(i.Erc20="ERC20",i.Erc1155="ERC1155",i))(vt||{}),xt=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")]),At=z.discriminatedUnion("standard",[z.object({token:da,spender:da,standard:z.literal("ERC20"),amount:xt,approved:z.boolean()}),z.object({token:da,spender:da,standard:z.literal("ERC1155"),approved:z.boolean()})]),Ct=z.object({token:z.string(),spender:z.string()}).transform(e=>({token:e.token,spender:e.spender,standard:void 0})),Rt=z.union([At,Ct]),Lo=f(z.object({address:da,chain_id:z.number().int().positive(),contracts:z.array(Rt)}).transform(({chain_id:e,...t})=>({...t,chainId:e})));var Re=(r=>(r.Day="day",r.Week="week",r.Month="month",r.All="all",r))(Re||{}),No=z.enum(Re),Ee=(r=>(r.Day="day",r.Week="week",r.Month="month",r.Year="all",r))(Ee||{}),Vo=z.enum(Ee),Te=(i=>(i.Pnl="PNL",i.Volume="VOLUME",i))(Te||{}),Wo=z.enum(Te),ke=(i=>(i.Market="market",i.Combo="combo",i))(ke||{}),Ho=z.enum(ke),Et=z.object({rank:z.number().int().positive(),builder_name:z.string(),builder_code:Y$1,profile_image:z.string(),verified:z.boolean(),volume:Ra,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}})),Tt=z.object({date:qa,rank:z.number().int().min(0),builder_name:z.string(),builder_code:Y$1,profile_image:z.string(),verified:z.boolean(),volume:Ra,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}})),T=z.preprocess(Ua,z.string().nullable()),kt=z.object({rank:z.number().int().min(0),user_id:da,pnl:Ra,volume:Ra,user_name:T,profile_image:T,x_username:T,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})),Dt=z.object({user_id:da,pnl:Ra,volume:Ra,rank_pnl:z.number().int().positive().nullable(),rank_volume:z.number().int().positive().nullable(),user_name:T,profile_image:T,x_username:T,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})),Pt=z.object({win_rank:z.number().int().positive(),kind:z.literal("market"),user_id:da,pnl:Ra,initial_value:Ra,final_value:Ra,resolved_at:fa,condition_id:ba,position_id:Fa,event_id:na,event_slug:z.string(),event_title:z.string(),user_name:T,profile_image:T}),zt=z.object({win_rank:z.number().int().positive(),kind:z.literal("combo"),user_id:da,pnl:Ra,initial_value:Ra,final_value:Ra,resolved_at:fa,condition_id:aa,position_id:Ea,event_id:z.literal(0),event_slug:z.literal(""),event_title:z.string(),user_name:T,profile_image:T}),Lt=z.discriminatedUnion("kind",[Pt,zt]).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}),Fo=A(Et),jo=f(z.array(Tt)),wo=A(kt),Zo=f(Dt.nullable()),Ko=A(Lt);var Pe=(C=>(C.Initialized="initialized",C.Posed="posed",C.Proposed="proposed",C.Challenged="challenged",C.Reproposed="reproposed",C.Disputed="disputed",C.Active="active",C.Arbitration="arbitration",C.Resolved="resolved",C))(Pe||{}),Mt=z.enum(Pe),ze=(a=>(a.Binary="BINARY",a.IncrementalNegRisk="INCREMENTAL_NEGRISK",a.AtomicNegRisk="ATOMIC_NEGRISK",a))(ze||{}),Ot=z.enum(ze),Le=(i=>(i.Reported="reported",i.Derived="derived",i))(Le||{}),Bt=z.enum(Le),Me=(a=>(a.UmaOptimisticOracle="UMA_OO",a.Chainlink="CHAINLINK",a.Eoa="EOA",a))(Me||{}),Ut=z.enum(Me),Oe=(r=>(r.ManagedProposalExpiration="managed_proposal_expiration",r.ProposalExpiration="proposal_expiration",r.Liveness="liveness",r.DvmRoundEstimate="dvm_round_estimate",r))(Oe||{}),Nt=z.enum(Oe),De=z.number().int().min(0).transform(String).pipe(Qa),Vt=z.object({question_id:Ga.optional(),condition_id:ba.optional(),status:Mt,extended_review:z.boolean(),expected_settlement_time:z.iso.datetime().transform(A$1).optional(),settlement_time_basis:Nt.optional(),was_disputed:z.boolean(),new_version_q:z.boolean(),proposed_price:Pa.optional(),reproposed_price:Pa.optional(),price:Pa.optional(),transaction_hash:z.preprocess(Ua,Oa.nullable()),log_index:z.preprocess(Ua,z.string().regex(/^\d+$/).transform(Number).nullable()),last_update_timestamp:ia,market_type:Ot.optional(),payouts:z.tuple([De,De]).optional(),resolution_source:Bt.optional(),reporter:Ut.optional(),was_arbitrated:z.boolean().optional(),resolved_block:z.number().int().min(0).optional(),resolved_at:pa.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}),Qo=f(z.array(Vt));var Ve=(r=>(r.V1Ctf="v1_ctf",r.Binary="binary",r.NegRisk="neg_risk",r.Combo="combo",r))(Ve||{}),Wt=z.enum(Ve),Be=z.string().regex(/^[0-9]{1,78}$/).pipe(Fa),J=z.string().regex(/^0x[0-9a-fA-F]{64}$/).pipe(ba),Ue=z.number().int().min(-32768).max(32767),Ne=z.number().int().min(-2147483648).max(2147483647),Ht=z.object({token_id:Be,condition_id:J,structural_condition_id:J.nullable(),module:Wt,outcome_index:Ue,clob_index:Ue.nullable(),outcome:z.string().nullable(),opposite_token_id:Be.nullable(),resolved:z.boolean(),final_price:z.number().transform(e=>U(String(e))).nullable(),title:z.string().nullable(),market_slug:z.string().nullable(),closed:z.boolean().nullable(),neg_risk:z.boolean().nullable(),neg_risk_market_id:J.nullable(),question_index:Ne.nullable(),event_id:Ne.transform(e=>w(String(e))).nullable(),event_slug:z.string().nullable()}).transform(e=>({assetId:e.token_id,conditionId:e.condition_id,structuralConditionId:e.structural_condition_id,module:e.module,outcomeIndex:e.outcome_index,clobIndex:e.clob_index,outcome:e.outcome,oppositeAssetId:e.opposite_token_id,resolved:e.resolved,finalPrice:e.final_price,title:e.title,marketSlug:e.market_slug,closed:e.closed,negRisk:e.neg_risk,negRiskMarketId:e.neg_risk_market_id,questionIndex:e.question_index,eventId:e.event_id,eventSlug:e.event_slug})),on=f(z.array(Ht));export{mt as ActivitySchema,Y as ActivityType,me as ActivityTypeSchema,vt as ApprovalStandard,ke as BiggestWinnerKind,Ho as BiggestWinnerKindSchema,Lt as BiggestWinnerSchema,Et as BuilderStandingSchema,Ee as BuilderVolumeInterval,Vo as BuilderVolumeIntervalSchema,Tt as BuilderVolumePointSchema,Kt as CanonicalMarketConditionIdSchema,st as ComboActivitySchema,xe as ComboActivityType,Q as ComboPositionLegSchema,tt as ComboPositionMarketEventSchema,ot as ComboPositionMarketSchema,nt as ComboPositionSchema,fe as ComboPositionSortBy,no as ComboPositionSortBySchema,ge as ComboPositionStatus,_e as ComboPositionStatusSchema,Lo as FetchApprovalsResponseSchema,jo as FetchBuilderVolumeResponseSchema,To as FetchEventLiveVolumeResponseSchema,Eo as FetchOpenInterestResponseSchema,ro as FetchPortfolioValueResponseSchema,Qo as FetchResolutionsResponseSchema,on as FetchTokenReferencesResponseSchema,Zo as FetchTraderLeaderboardStandingResponseSchema,ao as FetchUserPnlResponseSchema,so as FetchUserStatsResponseSchema,lo as FetchUserVolumeResponseSchema,yt as HolderSchema,Re as LeaderboardWindow,No as LeaderboardWindowSchema,So as ListActivityResponseSchema,Ko as ListBiggestWinnersResponseSchema,Fo as ListBuilderLeaderboardResponseSchema,fo as ListComboActivityResponseSchema,mo as ListComboPositionsResponseSchema,Ro as ListMarketHoldersResponseSchema,io as ListPositionsResponseSchema,Co as ListPriceHistoryResponseSchema,wo as ListTraderLeaderboardResponseSchema,yo as ListTradesResponseSchema,It as LiveVolumeSchema,ht as MarketLiveVolumeSchema,St as MetaHolderSchema,ft as OpenInterestSchema,$e as PortfolioValueSchema,Se as PositionFilterType,oo as PositionFilterTypeSchema,Ge as PositionRowStatusSchema,Ye as PositionSchema,ye as PositionSortBy,to as PositionSortBySchema,be as PositionStatus,eo as PositionStatusSchema,Ce as PriceHistoryInterval,Ao as PriceHistoryIntervalSchema,bt as PriceHistoryPointSchema,ze as ResolutionMarketType,Ot as ResolutionMarketTypeSchema,Me as ResolutionReporter,Ut as ResolutionReporterSchema,Vt as ResolutionSchema,Oe as ResolutionSettlementTimeBasis,Nt as ResolutionSettlementTimeBasisSchema,Le as ResolutionSource,Bt as ResolutionSourceSchema,Pe as ResolutionStatus,Mt as ResolutionStatusSchema,ce as SortDirection,wt as SortDirectionSchema,de as TipSide,$ as TipSideSchema,Ve as TokenModule,Wt as TokenModuleSchema,Ht as TokenReferenceSchema,pe as TradeFilterType,Zt as TradeFilterTypeSchema,at as TradeSchema,kt as TraderLeaderboardEntrySchema,Te as TraderLeaderboardSort,Wo as TraderLeaderboardSortSchema,Dt as TraderLeaderboardStandingSchema,Ie as UserPnlFidelity,ue as UserPnlFidelitySchema,he as UserPnlInterval,Qe as UserPnlIntervalSchema,ve as UserPnlPointSchema,Je as UserPnlSeriesSchema,et as UserStatsSchema,Xe as UserVolumeSchema,f as dataEnvelopeSchema,A as dataPageSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|