@polymarket/bindings 0.2.0 → 0.3.0-beta.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.
@@ -4425,8 +4425,11 @@ declare const PriceUpdatePayloadSchema: z.ZodObject<{
4425
4425
  type PriceUpdatePayload = z.infer<typeof PriceUpdatePayloadSchema>;
4426
4426
  declare const CRYPTO_PRICES_BINANCE_TOPIC: "prices.crypto.binance";
4427
4427
  declare const CRYPTO_PRICES_CHAINLINK_TOPIC: "prices.crypto.chainlink";
4428
+ declare const CRYPTO_PRICES_CHAINLINK_TWAP_TOPIC: "prices.crypto.chainlink.twap";
4428
4429
  type CryptoPricesBinanceTopic = typeof CRYPTO_PRICES_BINANCE_TOPIC;
4429
4430
  type CryptoPricesChainlinkTopic = typeof CRYPTO_PRICES_CHAINLINK_TOPIC;
4431
+ type CryptoPricesChainlinkTwapTopic = typeof CRYPTO_PRICES_CHAINLINK_TWAP_TOPIC;
4432
+ type CryptoPricesChainlinkTwapWindowSeconds = 30 | 60;
4430
4433
  type CryptoPricesTopic = CryptoPricesBinanceTopic | CryptoPricesChainlinkTopic;
4431
4434
  declare const CryptoPricesBinanceEventSchema: z.ZodObject<{
4432
4435
  topic: z.ZodType<"prices.crypto.binance", unknown, z.core.$ZodTypeInternals<"prices.crypto.binance", unknown>>;
@@ -4450,6 +4453,100 @@ declare const CryptoPricesChainlinkEventSchema: z.ZodObject<{
4450
4453
  }, z.core.$strip>;
4451
4454
  }, z.core.$strip>;
4452
4455
  type CryptoPricesChainlinkEvent = z.infer<typeof CryptoPricesChainlinkEventSchema>;
4456
+ declare const CryptoPricesChainlinkTwapThirtyEventSchema: z.ZodObject<{
4457
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_thirty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_thirty">>;
4458
+ type: z.ZodLiteral<"update">;
4459
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4460
+ payload: z.ZodPipe<z.ZodObject<{
4461
+ symbol: z.ZodString;
4462
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4463
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4464
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4465
+ window_s: z.ZodLiteral<30>;
4466
+ }, z.core.$strip>, z.ZodTransform<{
4467
+ symbol: string;
4468
+ timestamp: EpochMilliseconds;
4469
+ value: DecimalString;
4470
+ windowSeconds: 30;
4471
+ }, {
4472
+ symbol: string;
4473
+ value: DecimalString;
4474
+ full_accuracy_value: DecimalString;
4475
+ timestamp: EpochMilliseconds;
4476
+ window_s: 30;
4477
+ }>>;
4478
+ }, z.core.$strip>;
4479
+ type CryptoPricesChainlinkTwapThirtyEvent = z.infer<typeof CryptoPricesChainlinkTwapThirtyEventSchema>;
4480
+ declare const CryptoPricesChainlinkTwapSixtyEventSchema: z.ZodObject<{
4481
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_sixty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_sixty">>;
4482
+ type: z.ZodLiteral<"update">;
4483
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4484
+ payload: z.ZodPipe<z.ZodObject<{
4485
+ symbol: z.ZodString;
4486
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4487
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4488
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4489
+ window_s: z.ZodLiteral<60>;
4490
+ }, z.core.$strip>, z.ZodTransform<{
4491
+ symbol: string;
4492
+ timestamp: EpochMilliseconds;
4493
+ value: DecimalString;
4494
+ windowSeconds: 60;
4495
+ }, {
4496
+ symbol: string;
4497
+ value: DecimalString;
4498
+ full_accuracy_value: DecimalString;
4499
+ timestamp: EpochMilliseconds;
4500
+ window_s: 60;
4501
+ }>>;
4502
+ }, z.core.$strip>;
4503
+ type CryptoPricesChainlinkTwapSixtyEvent = z.infer<typeof CryptoPricesChainlinkTwapSixtyEventSchema>;
4504
+ declare const CryptoPricesChainlinkTwapEventSchema: z.ZodUnion<readonly [z.ZodObject<{
4505
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_thirty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_thirty">>;
4506
+ type: z.ZodLiteral<"update">;
4507
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4508
+ payload: z.ZodPipe<z.ZodObject<{
4509
+ symbol: z.ZodString;
4510
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4511
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4512
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4513
+ window_s: z.ZodLiteral<30>;
4514
+ }, z.core.$strip>, z.ZodTransform<{
4515
+ symbol: string;
4516
+ timestamp: EpochMilliseconds;
4517
+ value: DecimalString;
4518
+ windowSeconds: 30;
4519
+ }, {
4520
+ symbol: string;
4521
+ value: DecimalString;
4522
+ full_accuracy_value: DecimalString;
4523
+ timestamp: EpochMilliseconds;
4524
+ window_s: 30;
4525
+ }>>;
4526
+ }, z.core.$strip>, z.ZodObject<{
4527
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_sixty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_sixty">>;
4528
+ type: z.ZodLiteral<"update">;
4529
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4530
+ payload: z.ZodPipe<z.ZodObject<{
4531
+ symbol: z.ZodString;
4532
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4533
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4534
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4535
+ window_s: z.ZodLiteral<60>;
4536
+ }, z.core.$strip>, z.ZodTransform<{
4537
+ symbol: string;
4538
+ timestamp: EpochMilliseconds;
4539
+ value: DecimalString;
4540
+ windowSeconds: 60;
4541
+ }, {
4542
+ symbol: string;
4543
+ value: DecimalString;
4544
+ full_accuracy_value: DecimalString;
4545
+ timestamp: EpochMilliseconds;
4546
+ window_s: 60;
4547
+ }>>;
4548
+ }, z.core.$strip>]>;
4549
+ type CryptoPricesChainlinkTwapEvent = z.infer<typeof CryptoPricesChainlinkTwapEventSchema>;
4453
4550
  declare const CryptoPricesEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4454
4551
  topic: z.ZodType<"prices.crypto.binance", unknown, z.core.$ZodTypeInternals<"prices.crypto.binance", unknown>>;
4455
4552
  type: z.ZodLiteral<"update">;
@@ -4468,6 +4565,50 @@ declare const CryptoPricesEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4468
4565
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4469
4566
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4470
4567
  }, z.core.$strip>;
4568
+ }, z.core.$strip>, z.ZodObject<{
4569
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_thirty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_thirty">>;
4570
+ type: z.ZodLiteral<"update">;
4571
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4572
+ payload: z.ZodPipe<z.ZodObject<{
4573
+ symbol: z.ZodString;
4574
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4575
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4576
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4577
+ window_s: z.ZodLiteral<30>;
4578
+ }, z.core.$strip>, z.ZodTransform<{
4579
+ symbol: string;
4580
+ timestamp: EpochMilliseconds;
4581
+ value: DecimalString;
4582
+ windowSeconds: 30;
4583
+ }, {
4584
+ symbol: string;
4585
+ value: DecimalString;
4586
+ full_accuracy_value: DecimalString;
4587
+ timestamp: EpochMilliseconds;
4588
+ window_s: 30;
4589
+ }>>;
4590
+ }, z.core.$strip>, z.ZodObject<{
4591
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_sixty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_sixty">>;
4592
+ type: z.ZodLiteral<"update">;
4593
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4594
+ payload: z.ZodPipe<z.ZodObject<{
4595
+ symbol: z.ZodString;
4596
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
4597
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
4598
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
4599
+ window_s: z.ZodLiteral<60>;
4600
+ }, z.core.$strip>, z.ZodTransform<{
4601
+ symbol: string;
4602
+ timestamp: EpochMilliseconds;
4603
+ value: DecimalString;
4604
+ windowSeconds: 60;
4605
+ }, {
4606
+ symbol: string;
4607
+ value: DecimalString;
4608
+ full_accuracy_value: DecimalString;
4609
+ timestamp: EpochMilliseconds;
4610
+ window_s: 60;
4611
+ }>>;
4471
4612
  }, z.core.$strip>], "topic">;
4472
4613
  type CryptoPricesEvent = z.infer<typeof CryptoPricesEventSchema>;
4473
4614
  declare const EquityPriceUpdatePayloadSchema: z.ZodPipe<z.ZodObject<{
@@ -5745,6 +5886,50 @@ declare const RealtimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUn
5745
5886
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5746
5887
  value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
5747
5888
  }, z.core.$strip>;
5889
+ }, z.core.$strip>, z.ZodObject<{
5890
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_thirty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_thirty">>;
5891
+ type: z.ZodLiteral<"update">;
5892
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5893
+ payload: z.ZodPipe<z.ZodObject<{
5894
+ symbol: z.ZodString;
5895
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
5896
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
5897
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5898
+ window_s: z.ZodLiteral<30>;
5899
+ }, z.core.$strip>, z.ZodTransform<{
5900
+ symbol: string;
5901
+ timestamp: EpochMilliseconds;
5902
+ value: DecimalString;
5903
+ windowSeconds: 30;
5904
+ }, {
5905
+ symbol: string;
5906
+ value: DecimalString;
5907
+ full_accuracy_value: DecimalString;
5908
+ timestamp: EpochMilliseconds;
5909
+ window_s: 30;
5910
+ }>>;
5911
+ }, z.core.$strip>, z.ZodObject<{
5912
+ topic: z.ZodPipe<z.ZodLiteral<"crypto_prices_twap_sixty">, z.ZodTransform<"prices.crypto.chainlink.twap", "crypto_prices_twap_sixty">>;
5913
+ type: z.ZodLiteral<"update">;
5914
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5915
+ payload: z.ZodPipe<z.ZodObject<{
5916
+ symbol: z.ZodString;
5917
+ value: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
5918
+ full_accuracy_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
5919
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
5920
+ window_s: z.ZodLiteral<60>;
5921
+ }, z.core.$strip>, z.ZodTransform<{
5922
+ symbol: string;
5923
+ timestamp: EpochMilliseconds;
5924
+ value: DecimalString;
5925
+ windowSeconds: 60;
5926
+ }, {
5927
+ symbol: string;
5928
+ value: DecimalString;
5929
+ full_accuracy_value: DecimalString;
5930
+ timestamp: EpochMilliseconds;
5931
+ window_s: 60;
5932
+ }>>;
5748
5933
  }, z.core.$strip>], "topic">, z.ZodDiscriminatedUnion<[z.ZodObject<{
5749
5934
  topic: z.ZodType<"prices.equity.pyth", unknown, z.core.$ZodTypeInternals<"prices.equity.pyth", unknown>>;
5750
5935
  type: z.ZodLiteral<"update">;
@@ -5868,4 +6053,4 @@ declare const SportsResultEventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
5868
6053
  }>>;
5869
6054
  type SportsEvent = z.infer<typeof SportsResultEventSchema>;
5870
6055
 
5871
- export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CustomMarketEvent, CustomMarketEventSchema, type EquityPriceSnapshotPoint, type EquityPriceSubscribePayload, type EquityPriceUpdatePayload, type EquityPricesEvent, EquityPricesEventSchema, type EquityPricesSubscribeEvent, EquityPricesSubscribeEventSchema, type EquityPricesTopic, type EquityPricesUpdateEvent, EquityPricesUpdateEventSchema, type MarketBestBidAskEvent, MarketBestBidAskEventSchema, type MarketBookEvent, MarketBookEventSchema, type MarketEvent, type MarketEventMessage, MarketEventSchema, type MarketLastTradePriceEvent, MarketLastTradePriceEventSchema, type MarketPriceChangeEvent, MarketPriceChangeEventSchema, type MarketResolvedEvent, MarketResolvedEventSchema, type MarketTickSizeChangeEvent, MarketTickSizeChangeEventSchema, type NewMarketEvent, NewMarketEventSchema, type OrderBookLevel, type PerpsBalanceUpdateEvent, PerpsBalanceUpdateEventSchema, type PerpsBboEvent, PerpsBboEventSchema, type PerpsBookEvent, PerpsBookEventSchema, type PerpsCandleEvent, PerpsCandleEventSchema, type PerpsDepositUpdateEvent, PerpsDepositUpdateEventSchema, type PerpsFillUpdateEvent, PerpsFillUpdateEventSchema, type PerpsFundingUpdateEvent, PerpsFundingUpdateEventSchema, type PerpsMarketDataEvent, PerpsMarketDataEventSchema, type PerpsOrderUpdateEvent, PerpsOrderUpdateEventSchema, type PerpsPortfolioUpdateEvent, PerpsPortfolioUpdateEventSchema, type PerpsResyncEvent, type PerpsSessionEvent, type PerpsSessionUpdateEvent, PerpsSessionUpdateEventSchema, type PerpsStatisticEvent, PerpsStatisticEventSchema, type PerpsTickerEvent, PerpsTickerEventSchema, type PerpsTpSlUpdateEvent, PerpsTpSlUpdateEventSchema, type PerpsTradeEvent, PerpsTradeEventSchema, type PerpsWithdrawalUpdateEvent, PerpsWithdrawalUpdateEventSchema, type PriceChange, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeEvent, RealtimeEventSchema, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };
6056
+ export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesChainlinkTwapEvent, CryptoPricesChainlinkTwapEventSchema, type CryptoPricesChainlinkTwapSixtyEvent, CryptoPricesChainlinkTwapSixtyEventSchema, type CryptoPricesChainlinkTwapThirtyEvent, CryptoPricesChainlinkTwapThirtyEventSchema, type CryptoPricesChainlinkTwapTopic, type CryptoPricesChainlinkTwapWindowSeconds, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CustomMarketEvent, CustomMarketEventSchema, type EquityPriceSnapshotPoint, type EquityPriceSubscribePayload, type EquityPriceUpdatePayload, type EquityPricesEvent, EquityPricesEventSchema, type EquityPricesSubscribeEvent, EquityPricesSubscribeEventSchema, type EquityPricesTopic, type EquityPricesUpdateEvent, EquityPricesUpdateEventSchema, type MarketBestBidAskEvent, MarketBestBidAskEventSchema, type MarketBookEvent, MarketBookEventSchema, type MarketEvent, type MarketEventMessage, MarketEventSchema, type MarketLastTradePriceEvent, MarketLastTradePriceEventSchema, type MarketPriceChangeEvent, MarketPriceChangeEventSchema, type MarketResolvedEvent, MarketResolvedEventSchema, type MarketTickSizeChangeEvent, MarketTickSizeChangeEventSchema, type NewMarketEvent, NewMarketEventSchema, type OrderBookLevel, type PerpsBalanceUpdateEvent, PerpsBalanceUpdateEventSchema, type PerpsBboEvent, PerpsBboEventSchema, type PerpsBookEvent, PerpsBookEventSchema, type PerpsCandleEvent, PerpsCandleEventSchema, type PerpsDepositUpdateEvent, PerpsDepositUpdateEventSchema, type PerpsFillUpdateEvent, PerpsFillUpdateEventSchema, type PerpsFundingUpdateEvent, PerpsFundingUpdateEventSchema, type PerpsMarketDataEvent, PerpsMarketDataEventSchema, type PerpsOrderUpdateEvent, PerpsOrderUpdateEventSchema, type PerpsPortfolioUpdateEvent, PerpsPortfolioUpdateEventSchema, type PerpsResyncEvent, type PerpsSessionEvent, type PerpsSessionUpdateEvent, PerpsSessionUpdateEventSchema, type PerpsStatisticEvent, PerpsStatisticEventSchema, type PerpsTickerEvent, PerpsTickerEventSchema, type PerpsTpSlUpdateEvent, PerpsTpSlUpdateEventSchema, type PerpsTradeEvent, PerpsTradeEventSchema, type PerpsWithdrawalUpdateEvent, PerpsWithdrawalUpdateEventSchema, type PriceChange, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeEvent, RealtimeEventSchema, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };
@@ -1,2 +1,2 @@
1
- import {N,K,O,P}from'../chunk-H6NL6UCA.js';import {Ca,Aa,ya as ya$1,ra,va,sa,_a,b,a,L,R,Xa,V,ga,ka}from'../chunk-N4P2EGRL.js';import {wa,Ka,x,Qa,Ha,da,ha,_ as _$1,xa,ya,ba,ua,Ma}from'../chunk-QTXFNR2Y.js';export{d as TradeStatus}from'../chunk-QTXFNR2Y.js';import {z}from'zod';var _=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,wa),ee=(p=>(p.Live="LIVE",p.Matched="MATCHED",p.Delayed="DELAYED",p.Unmatched="UNMATCHED",p.Canceled="CANCELED",p))(ee||{}),Se=z.enum(ee),X=z.object({price:Ka,size:Ka}),T=z.string().regex(/^\d+$/).transform(t=>x(new Date(Number(t)*1e3).toISOString())),Ee=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:x(new Date(Number(t)*1e3).toISOString())),te=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ha,bids:z.array(X),asks:z.array(X),hash:z.string().nullish(),timestamp:da.nullish(),min_order_size:Qa,tick_size:Qa,neg_risk:z.boolean().nullish(),last_trade_price:Qa}).transform(({event_type:t,asset_id:n,min_order_size:a,tick_size:s,neg_risk:i,last_trade_price:p,...u})=>({topic:"market",type:t,payload:{...u,tokenId:n,minOrderSize:a,tickSize:s,negRisk:i,lastTradePrice:p}})),fe=z.object({asset_id:Ha,price:Ka,size:Ka,side:_,hash:z.string().nullish(),best_bid:Qa,best_ask:Qa}).transform(({asset_id:t,best_bid:n,best_ask:a,...s})=>({...s,tokenId:t,bestBid:n,bestAsk:a})),re=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(fe),timestamp:da.nullish()}).transform(({event_type:t,price_changes:n,...a})=>({topic:"market",type:t,payload:{...a,priceChanges:n}})),ne=z.object({event_type:z.literal("last_trade_price"),market:z.string(),asset_id:Ha,price:Ka,size:Qa,fee_rate_bps:Qa,side:_,timestamp:da.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:n,fee_rate_bps:a,transaction_hash:s,...i})=>({topic:"market",type:t,payload:{...i,tokenId:n,feeRateBps:a,transactionHash:s}})),ae=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ha,old_tick_size:Qa,new_tick_size:Ka,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,old_tick_size:a,new_tick_size:s,...i})=>({topic:"market",type:t,payload:{...i,tokenId:n,oldTickSize:a,newTickSize:s}})),se=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ha,best_bid:Qa,best_ask:Qa,spread:Qa,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,best_bid:a,best_ask:s,...i})=>({topic:"market",type:t,payload:{...i,tokenId:n,bestBid:a,bestAsk:s}})),ie=z.object({id:z.string(),ticker:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),description:z.string().nullish()}),oe=z.object({event_type:z.literal("new_market"),id:z.string(),question:z.string().nullish(),market:z.string(),slug:z.string().nullish(),description:z.string().nullish(),assets_ids:z.array(Ha).nullish(),outcomes:z.array(z.string()).nullish(),event_message:ie.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish(),condition_id:_$1.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Qa,game_start_time:ha.nullish(),order_price_min_tick_size:Qa,group_item_title:z.string().nullish(),taker_base_fee:Qa,fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:n,event_message:a,condition_id:s,clob_token_ids:i,sports_market_type:p,game_start_time:u,order_price_min_tick_size:f,group_item_title:v,taker_base_fee:P,fees_enabled:g,fee_schedule:k,...z})=>({topic:"market",type:t,payload:{...z,tokenIds:n,eventMessage:a,conditionId:s,clobTokenIds:i,sportsMarketType:p,gameStartTime:u,orderPriceMinTickSize:f,groupItemTitle:v,takerBaseFee:P,feesEnabled:g,feeSchedule:k}})),pe=z.object({event_type:z.literal("market_resolved"),id:z.string(),market:z.string(),assets_ids:z.array(Ha).nullish(),winning_asset_id:Ha.nullish(),winning_outcome:z.string().nullish(),event_message:ie.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:n,winning_asset_id:a,winning_outcome:s,event_message:i,...p})=>({topic:"market",type:t,payload:{...p,tokenIds:n,winningTokenId:a,winningOutcome:s,eventMessage:i}})),ce=(s=>(s.Placement="PLACEMENT",s.Update="UPDATE",s.Cancellation="CANCELLATION",s))(ce||{}),ve=z.enum(ce),Pe=z.object({event_type:z.literal("order"),id:z.string(),owner:z.string(),market:z.string(),asset_id:Ha,side:_,order_owner:z.string().nullish(),original_size:Ka,size_matched:Ka,price:Ka,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:ve,created_at:T.nullish(),expiration:Ee.nullish(),order_type:xa.nullish(),status:Se.nullish(),maker_address:z.string().nullish(),timestamp:da}).transform(({event_type:t,type:n,asset_id:a,order_owner:s,original_size:i,size_matched:p,associate_trades:u,created_at:f,expiration:v,order_type:P,maker_address:g,...k})=>({topic:"user",type:t,payload:{...k,orderEventType:n,tokenId:a,orderOwner:s,originalSize:i,sizeMatched:p,associateTrades:u,createdAt:f,expiresAt:v,orderType:P,makerAddress:g}})),ge=z.object({order_id:z.string(),owner:z.string(),maker_address:z.string().nullish(),matched_amount:Ka,price:Ka,fee_rate_bps:Qa,asset_id:Ha,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:_}).transform(({order_id:t,maker_address:n,matched_amount:a,fee_rate_bps:s,asset_id:i,outcome_index:p,...u})=>({...u,orderId:t,makerAddress:n,matchedAmount:a,feeRateBps:s,tokenId:i,outcomeIndex:p})),ke=z.object({event_type:z.literal("trade"),type:z.literal("TRADE"),id:z.string(),taker_order_id:z.string(),market:z.string(),asset_id:Ha,side:_,size:Ka,fee_rate_bps:Qa,price:Ka,status:ya,match_time:T.nullish(),matchtime:T.nullish(),last_update:T.nullish(),outcome:z.string().nullish(),owner:z.string(),trade_owner:z.string().nullish(),maker_address:z.string().nullish(),transaction_hash:z.string().nullish(),bucket_index:z.number().int().nullish(),maker_orders:z.array(ge).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:da}).transform(({event_type:t,type:n,taker_order_id:a,asset_id:s,fee_rate_bps:i,match_time:p,matchtime:u,last_update:f,trade_owner:v,maker_address:P,transaction_hash:g,bucket_index:k,maker_orders:z,trader_side:he,...ye})=>({topic:"user",type:t,payload:{...ye,takerOrderId:a,tokenId:s,feeRateBps:i,matchedAt:p??u,updatedAt:f,tradeOwner:v,makerAddress:P,transactionHash:g,bucketIndex:k,makerOrders:z,traderSide:he}})),gt=z.discriminatedUnion("event_type",[te,re,ne,ae]),kt=z.discriminatedUnion("event_type",[se,oe,pe]),xt=z.discriminatedUnion("event_type",[te,re,ne,ae,se,oe,pe]),_t=z.discriminatedUnion("event_type",[Pe,ke]);var xe=z.number().int().nonnegative(),_e=z.string().regex(/^trades::\d+$/),Ce=z.string().regex(/^bbo::\d+$/),be=z.string().regex(/^book::\d+$/),Te=z.string().regex(/^tickers::(all|\d+)$/),ze=z.string().regex(/^statistics::(all|\d+)$/),Ie=z.string().regex(/^klines::\d+::(1m|5m|15m|1h|4h|1d|1w)$/),Ue=z.string().regex(/^tpsl::\d+$/),Me=z.enum(["balances","portfolio","orders","fills","funding","deposits","withdrawals"]),S=z.object({ts:ba,sq:xe}),Re=S.extend({ch:_e,data:z.array(Ca)}).transform(({ch:t,ts:n,sq:a,data:s})=>({topic:"perps.trades",type:"trade",channel:t,timestamp:n,sequence:a,payload:s})),Be=S.extend({ch:Ce,data:Aa}).transform(({ch:t,ts:n,sq:a,data:s})=>({topic:"perps.bbo",type:"bbo",channel:t,timestamp:n,sequence:a,payload:s})),qe=S.extend({ch:be,data:ya$1}).transform(({ch:t,ts:n,sq:a,data:s})=>({topic:"perps.book",type:"book",channel:t,timestamp:n,sequence:a,payload:{instrumentId:me(t),...s}})),we=S.extend({ch:Te,data:ra}).transform(({ch:t,ts:n,sq:a,data:s})=>({topic:"perps.tickers",type:"ticker",channel:t,timestamp:n,sequence:a,payload:s})),Ae=S.extend({ch:ze,data:va}).transform(({ch:t,ts:n,sq:a,data:s})=>({topic:"perps.statistics",type:"statistic",channel:t,timestamp:n,sequence:a,payload:s})),Oe=S.extend({ch:Ie,data:z.array(sa)}).transform(({ch:t,ts:n,sq:a,data:s})=>({topic:"perps.candles",type:"candle",channel:t,timestamp:n,sequence:a,payload:{instrumentId:me(t),interval:We(t),candles:s}})),qt=z.union([Re,Be,qe,we,Ae,Oe]),je=S.extend({ch:Me});function E(t,n,a){return je.extend({ch:z.literal(n),data:a}).transform(s=>{let i=s;return {type:t,channel:i.ch,timestamp:i.ts,sequence:i.sq,payload:i.data}})}var De=E("balance","balances",L),Ne=E("portfolio","portfolio",R),Le=E("order","orders",Xa),Fe=E("fill","fills",z.array(_a)),$e=E("funding","funding",V),Ke=E("deposit","deposits",ga),Ye=E("withdrawal","withdrawals",ka),He=z.object({oid:b,st:z.enum(["untriggered","armed","cancelled","expired"]),reason:z.string().optional()}),Ze=S.extend({ch:Ue,data:He.transform(t=>({orderId:t.oid,status:t.st,reason:t.reason}))}).transform(({ch:t,ts:n,sq:a,data:s})=>({type:"tpsl",channel:t,timestamp:n,sequence:a,payload:s})),wt=z.union([De,Ne,Le,Fe,$e,Ke,Ye,Ze]);function me(t){let[,n]=t.split("::");return a.parse(Number(n))}function We(t){let[,,n]=t.split("::");return n}var Qe=z.object({id:z.string(),body:z.string().nullish(),parentEntityType:ua.nullish(),parentEntityID:z.number().int().nullish(),parentCommentID:z.string().nullish(),userAddress:z.string().nullish(),replyAddress:z.string().nullish(),createdAt:z.string().nullish(),updatedAt:z.string().nullish(),media:z.array(O).nullish(),profile:K.nullish(),reactions:z.array(N).nullish(),reportCount:z.number().int().nullish(),reactionCount:z.number().int().nullish(),tradeAsset:z.string().nullish()}),Ge=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:ba,payload:P}),Ve=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:ba,payload:Qe}),Je=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:ba,payload:N}),Xe=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:ba,payload:N}),le=z.object({symbol:z.string(),timestamp:ba,value:Ma}),et="prices.crypto.binance",tt="prices.crypto.chainlink",rt=z.literal("crypto_prices"),nt=z.literal("crypto_prices_chainlink"),at=rt.transform(()=>et),st=nt.transform(()=>tt),it=z.object({topic:at,type:z.literal("update"),timestamp:ba,payload:le}),ot=z.object({topic:st,type:z.literal("update"),timestamp:ba,payload:le}),pt=z.discriminatedUnion("topic",[it,ot]),ct=z.object({symbol:z.string(),value:Ma,full_accuracy_value:Ka.nullish(),timestamp:ba,received_at:ba.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:n,is_carried_forward:a,value:s,...i})=>({...i,value:t??s,receivedAt:n,isCarriedForward:a})),mt=z.object({timestamp:z.number(),value:Ma}),lt=z.object({symbol:z.string(),data:z.array(mt)}),dt=z.literal("equity_prices"),ht="prices.equity.pyth",de=dt.transform(()=>ht),yt=z.object({topic:de,type:z.literal("update"),timestamp:ba,payload:ct}),ut=z.object({topic:de,type:z.literal("subscribe"),timestamp:ba,payload:lt}),St=z.discriminatedUnion("type",[yt,ut]),Et=z.discriminatedUnion("type",[Ge,Ve,Je,Xe]),Nt=z.discriminatedUnion("topic",[Et,pt,St]);var ft=z.object({gameId:z.number().int(),sportradarGameId:z.string().nullish(),slug:z.string().nullish(),leagueAbbreviation:z.string(),homeTeam:z.string().nullish(),awayTeam:z.string().nullish(),status:z.string(),live:z.boolean(),ended:z.boolean(),score:z.string(),period:z.string().nullish(),elapsed:z.string().nullish(),finishedTimestamp:ha.nullish(),finished_timestamp:ha.nullish(),turn:z.string().nullish()}).transform(({finishedTimestamp:t,finished_timestamp:n,...a})=>({...a,finishedAt:t??n})),Kt=ft.transform(t=>({topic:"sports",type:"sport_result",payload:t}));export{Ge as CommentCreatedEventSchema,Ve as CommentRemovedEventSchema,Et as CommentsEventSchema,it as CryptoPricesBinanceEventSchema,ot as CryptoPricesChainlinkEventSchema,pt as CryptoPricesEventSchema,kt as CustomMarketEventSchema,St as EquityPricesEventSchema,ut as EquityPricesSubscribeEventSchema,yt as EquityPricesUpdateEventSchema,se as MarketBestBidAskEventSchema,te as MarketBookEventSchema,xt as MarketEventSchema,ne as MarketLastTradePriceEventSchema,re as MarketPriceChangeEventSchema,pe as MarketResolvedEventSchema,ae as MarketTickSizeChangeEventSchema,oe as NewMarketEventSchema,De as PerpsBalanceUpdateEventSchema,Be as PerpsBboEventSchema,qe as PerpsBookEventSchema,Oe as PerpsCandleEventSchema,Ke as PerpsDepositUpdateEventSchema,Fe as PerpsFillUpdateEventSchema,$e as PerpsFundingUpdateEventSchema,qt as PerpsMarketDataEventSchema,Le as PerpsOrderUpdateEventSchema,Ne as PerpsPortfolioUpdateEventSchema,wt as PerpsSessionUpdateEventSchema,Ae as PerpsStatisticEventSchema,we as PerpsTickerEventSchema,Ze as PerpsTpSlUpdateEventSchema,Re as PerpsTradeEventSchema,Ye as PerpsWithdrawalUpdateEventSchema,Je as ReactionCreatedEventSchema,Xe as ReactionRemovedEventSchema,Nt as RealtimeEventSchema,Kt as SportsResultEventSchema,gt as StandardMarketEventSchema,_t as UserEventSchema,Pe as UserOrderEventSchema,ce as UserOrderEventType,ee as UserOrderStatus,ke as UserTradeEventSchema};//# sourceMappingURL=index.js.map
1
+ import {N,K,O,P}from'../chunk-GJX3FYFG.js';import {Ca,Aa,ya as ya$1,ra,va,sa,_a,b as b$1,a,L,R,Xa,V,ga,ka}from'../chunk-JRSTEY5H.js';import {xa,La,x as x$1,Ra,Ia,da,ia,_,ya,za,ba,va as va$1,Na,R as R$1}from'../chunk-6TO35A2S.js';export{d as TradeStatus}from'../chunk-6TO35A2S.js';import {z}from'zod';var x=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,xa),te=(o=>(o.Live="LIVE",o.Matched="MATCHED",o.Delayed="DELAYED",o.Unmatched="UNMATCHED",o.Canceled="CANCELED",o))(te||{}),Ce=z.enum(te),ee=z.object({price:La,size:La}),b=z.string().regex(/^\d+$/).transform(t=>x$1(new Date(Number(t)*1e3).toISOString())),ge=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:x$1(new Date(Number(t)*1e3).toISOString())),re=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ia,bids:z.array(ee),asks:z.array(ee),hash:z.string().nullish(),timestamp:da.nullish(),min_order_size:Ra,tick_size:Ra,neg_risk:z.boolean().nullish(),last_trade_price:Ra}).transform(({event_type:t,asset_id:n,min_order_size:a,tick_size:i,neg_risk:s,last_trade_price:o,...S})=>({topic:"market",type:t,payload:{...S,tokenId:n,minOrderSize:a,tickSize:i,negRisk:s,lastTradePrice:o}})),_e=z.object({asset_id:Ia,price:La,size:La,side:x,hash:z.string().nullish(),best_bid:Ra,best_ask:Ra}).transform(({asset_id:t,best_bid:n,best_ask:a,...i})=>({...i,tokenId:t,bestBid:n,bestAsk:a})),ne=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(_e),timestamp:da.nullish()}).transform(({event_type:t,price_changes:n,...a})=>({topic:"market",type:t,payload:{...a,priceChanges:n}})),ae=z.object({event_type:z.literal("last_trade_price"),market:z.string(),asset_id:Ia,price:La,size:Ra,fee_rate_bps:Ra,side:x,timestamp:da.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:n,fee_rate_bps:a,transaction_hash:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,feeRateBps:a,transactionHash:i}})),ie=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ia,old_tick_size:Ra,new_tick_size:La,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,old_tick_size:a,new_tick_size:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,oldTickSize:a,newTickSize:i}})),se=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ia,best_bid:Ra,best_ask:Ra,spread:Ra,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,best_bid:a,best_ask:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,bestBid:a,bestAsk:i}})),oe=z.object({id:z.string(),ticker:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),description:z.string().nullish()}),pe=z.object({event_type:z.literal("new_market"),id:z.string(),question:z.string().nullish(),market:z.string(),slug:z.string().nullish(),description:z.string().nullish(),assets_ids:z.array(Ia).nullish(),outcomes:z.array(z.string()).nullish(),event_message:oe.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish(),condition_id:_.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Ra,game_start_time:ia.nullish(),order_price_min_tick_size:Ra,group_item_title:z.string().nullish(),taker_base_fee:Ra,fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:n,event_message:a,condition_id:i,clob_token_ids:s,sports_market_type:o,game_start_time:S,order_price_min_tick_size:P,group_item_title:f,taker_base_fee:v,fees_enabled:k,fee_schedule:C,...z})=>({topic:"market",type:t,payload:{...z,tokenIds:n,eventMessage:a,conditionId:i,clobTokenIds:s,sportsMarketType:o,gameStartTime:S,orderPriceMinTickSize:P,groupItemTitle:f,takerBaseFee:v,feesEnabled:k,feeSchedule:C}})),ce=z.object({event_type:z.literal("market_resolved"),id:z.string(),market:z.string(),assets_ids:z.array(Ia).nullish(),winning_asset_id:Ia.nullish(),winning_outcome:z.string().nullish(),event_message:oe.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:n,winning_asset_id:a,winning_outcome:i,event_message:s,...o})=>({topic:"market",type:t,payload:{...o,tokenIds:n,winningTokenId:a,winningOutcome:i,eventMessage:s}})),le=(i=>(i.Placement="PLACEMENT",i.Update="UPDATE",i.Cancellation="CANCELLATION",i))(le||{}),xe=z.enum(le),Te=z.object({event_type:z.literal("order"),id:z.string(),owner:z.string(),market:z.string(),asset_id:Ia,side:x,order_owner:z.string().nullish(),original_size:La,size_matched:La,price:La,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:xe,created_at:b.nullish(),expiration:ge.nullish(),order_type:ya.nullish(),status:Ce.nullish(),maker_address:z.string().nullish(),timestamp:da}).transform(({event_type:t,type:n,asset_id:a,order_owner:i,original_size:s,size_matched:o,associate_trades:S,created_at:P,expiration:f,order_type:v,maker_address:k,...C})=>({topic:"user",type:t,payload:{...C,orderEventType:n,tokenId:a,orderOwner:i,originalSize:s,sizeMatched:o,associateTrades:S,createdAt:P,expiresAt:f,orderType:v,makerAddress:k}})),be=z.object({order_id:z.string(),owner:z.string(),maker_address:z.string().nullish(),matched_amount:La,price:La,fee_rate_bps:Ra,asset_id:Ia,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:x}).transform(({order_id:t,maker_address:n,matched_amount:a,fee_rate_bps:i,asset_id:s,outcome_index:o,...S})=>({...S,orderId:t,makerAddress:n,matchedAmount:a,feeRateBps:i,tokenId:s,outcomeIndex:o})),ze=z.object({event_type:z.literal("trade"),type:z.literal("TRADE"),id:z.string(),taker_order_id:z.string(),market:z.string(),asset_id:Ia,side:x,size:La,fee_rate_bps:Ra,price:La,status:za,match_time:b.nullish(),matchtime:b.nullish(),last_update:b.nullish(),outcome:z.string().nullish(),owner:z.string(),trade_owner:z.string().nullish(),maker_address:z.string().nullish(),transaction_hash:z.string().nullish(),bucket_index:z.number().int().nullish(),maker_orders:z.array(be).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:da}).transform(({event_type:t,type:n,taker_order_id:a,asset_id:i,fee_rate_bps:s,match_time:o,matchtime:S,last_update:P,trade_owner:f,maker_address:v,transaction_hash:k,bucket_index:C,maker_orders:z,trader_side:fe,...ve})=>({topic:"user",type:t,payload:{...ve,takerOrderId:a,tokenId:i,feeRateBps:s,matchedAt:o??S,updatedAt:P,tradeOwner:f,makerAddress:v,transactionHash:k,bucketIndex:C,makerOrders:z,traderSide:fe}})),At=z.discriminatedUnion("event_type",[re,ne,ae,ie]),Bt=z.discriminatedUnion("event_type",[se,pe,ce]),qt=z.discriminatedUnion("event_type",[re,ne,ae,ie,se,pe,ce]),Ot=z.discriminatedUnion("event_type",[Te,ze]);var Ie=z.number().int().nonnegative(),we=z.string().regex(/^trades::\d+$/),Ue=z.string().regex(/^bbo::\d+$/),Me=z.string().regex(/^book::\d+$/),Re=z.string().regex(/^tickers::(all|\d+)$/),Ae=z.string().regex(/^statistics::(all|\d+)$/),Be=z.string().regex(/^klines::\d+::(1m|5m|15m|1h|4h|1d|1w)$/),qe=z.string().regex(/^tpsl::\d+$/),Oe=z.enum(["balances","portfolio","orders","fills","funding","deposits","withdrawals"]),u=z.object({ts:ba,sq:Ie}),je=u.extend({ch:we,data:z.array(Ca)}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.trades",type:"trade",channel:t,timestamp:n,sequence:a,payload:i})),De=u.extend({ch:Ue,data:Aa}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.bbo",type:"bbo",channel:t,timestamp:n,sequence:a,payload:i})),Ne=u.extend({ch:Me,data:ya$1}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.book",type:"book",channel:t,timestamp:n,sequence:a,payload:{instrumentId:me(t),...i}})),Le=u.extend({ch:Re,data:ra}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.tickers",type:"ticker",channel:t,timestamp:n,sequence:a,payload:i})),$e=u.extend({ch:Ae,data:va}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.statistics",type:"statistic",channel:t,timestamp:n,sequence:a,payload:i})),Fe=u.extend({ch:Be,data:z.array(sa)}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.candles",type:"candle",channel:t,timestamp:n,sequence:a,payload:{instrumentId:me(t),interval:et(t),candles:i}})),Yt=z.union([je,De,Ne,Le,$e,Fe]),Ke=u.extend({ch:Oe});function E(t,n,a){return Ke.extend({ch:z.literal(n),data:a}).transform(i=>{let s=i;return {type:t,channel:s.ch,timestamp:s.ts,sequence:s.sq,payload:s.data}})}var We=E("balance","balances",L),He=E("portfolio","portfolio",R),Ye=E("order","orders",Xa),Ze=E("fill","fills",z.array(_a)),Ve=E("funding","funding",V),Qe=E("deposit","deposits",ga),Ge=E("withdrawal","withdrawals",ka),Je=z.object({oid:b$1,st:z.enum(["untriggered","armed","cancelled","expired"]),reason:z.string().optional()}),Xe=u.extend({ch:qe,data:Je.transform(t=>({orderId:t.oid,status:t.st,reason:t.reason}))}).transform(({ch:t,ts:n,sq:a,data:i})=>({type:"tpsl",channel:t,timestamp:n,sequence:a,payload:i})),Zt=z.union([We,He,Ye,Ze,Ve,Qe,Ge,Xe]);function me(t){let[,n]=t.split("::");return a.parse(Number(n))}function et(t){let[,,n]=t.split("::");return n}var tt=z.object({id:z.string(),body:z.string().nullish(),parentEntityType:va$1.nullish(),parentEntityID:z.number().int().nullish(),parentCommentID:z.string().nullish(),userAddress:z.string().nullish(),replyAddress:z.string().nullish(),createdAt:z.string().nullish(),updatedAt:z.string().nullish(),media:z.array(O).nullish(),profile:K.nullish(),reactions:z.array(N).nullish(),reportCount:z.number().int().nullish(),reactionCount:z.number().int().nullish(),tradeAsset:z.string().nullish()}),rt=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:ba,payload:P}),nt=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:ba,payload:tt}),at=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:ba,payload:N}),it=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:ba,payload:N}),he=z.object({symbol:z.string(),timestamp:ba,value:Na}),st="prices.crypto.binance",ot="prices.crypto.chainlink",ye="prices.crypto.chainlink.twap",pt=z.literal("crypto_prices"),ct=z.literal("crypto_prices_chainlink"),lt=z.literal("crypto_prices_twap_thirty"),mt=z.literal("crypto_prices_twap_sixty"),dt=pt.transform(()=>st),ht=ct.transform(()=>ot),yt=lt.transform(()=>ye),St=mt.transform(()=>ye),ut=z.object({topic:dt,type:z.literal("update"),timestamp:ba,payload:he}),Et=z.object({topic:ht,type:z.literal("update"),timestamp:ba,payload:he}),de=1000000000000000000n;function Pt(t){let n=BigInt(t),a=n<0n,i=a?-n:n,s=i/de,o=(i%de).toString().padStart(18,"0").replace(/0+$/,"");return R$1(`${a?"-":""}${s}${o===""?"":`.${o}`}`)}var ft=z.string().regex(/^-?\d+$/).transform(Pt),vt=z.object({symbol:z.string(),value:Na,full_accuracy_value:ft,timestamp:ba});function Se(t){return vt.extend({window_s:z.literal(t)}).transform(n=>({symbol:n.symbol,timestamp:n.timestamp,value:n.full_accuracy_value,windowSeconds:n.window_s}))}var ue=z.object({topic:yt,type:z.literal("update"),timestamp:ba,payload:Se(30)}),Ee=z.object({topic:St,type:z.literal("update"),timestamp:ba,payload:Se(60)}),Xt=z.union([ue,Ee]),kt=z.discriminatedUnion("topic",[ut,Et,ue,Ee]),Ct=z.object({symbol:z.string(),value:Na,full_accuracy_value:La.nullish(),timestamp:ba,received_at:ba.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:n,is_carried_forward:a,value:i,...s})=>({...s,value:t??i,receivedAt:n,isCarriedForward:a})),gt=z.object({timestamp:z.number(),value:Na}),_t=z.object({symbol:z.string(),data:z.array(gt)}),xt=z.literal("equity_prices"),Tt="prices.equity.pyth",Pe=xt.transform(()=>Tt),bt=z.object({topic:Pe,type:z.literal("update"),timestamp:ba,payload:Ct}),zt=z.object({topic:Pe,type:z.literal("subscribe"),timestamp:ba,payload:_t}),It=z.discriminatedUnion("type",[bt,zt]),wt=z.discriminatedUnion("type",[rt,nt,at,it]),er=z.discriminatedUnion("topic",[wt,kt,It]);var Ut=z.object({gameId:z.number().int(),sportradarGameId:z.string().nullish(),slug:z.string().nullish(),leagueAbbreviation:z.string(),homeTeam:z.string().nullish(),awayTeam:z.string().nullish(),status:z.string(),live:z.boolean(),ended:z.boolean(),score:z.string(),period:z.string().nullish(),elapsed:z.string().nullish(),finishedTimestamp:ia.nullish(),finished_timestamp:ia.nullish(),turn:z.string().nullish()}).transform(({finishedTimestamp:t,finished_timestamp:n,...a})=>({...a,finishedAt:t??n})),ar=Ut.transform(t=>({topic:"sports",type:"sport_result",payload:t}));export{rt as CommentCreatedEventSchema,nt as CommentRemovedEventSchema,wt as CommentsEventSchema,ut as CryptoPricesBinanceEventSchema,Et as CryptoPricesChainlinkEventSchema,Xt as CryptoPricesChainlinkTwapEventSchema,Ee as CryptoPricesChainlinkTwapSixtyEventSchema,ue as CryptoPricesChainlinkTwapThirtyEventSchema,kt as CryptoPricesEventSchema,Bt as CustomMarketEventSchema,It as EquityPricesEventSchema,zt as EquityPricesSubscribeEventSchema,bt as EquityPricesUpdateEventSchema,se as MarketBestBidAskEventSchema,re as MarketBookEventSchema,qt as MarketEventSchema,ae as MarketLastTradePriceEventSchema,ne as MarketPriceChangeEventSchema,ce as MarketResolvedEventSchema,ie as MarketTickSizeChangeEventSchema,pe as NewMarketEventSchema,We as PerpsBalanceUpdateEventSchema,De as PerpsBboEventSchema,Ne as PerpsBookEventSchema,Fe as PerpsCandleEventSchema,Qe as PerpsDepositUpdateEventSchema,Ze as PerpsFillUpdateEventSchema,Ve as PerpsFundingUpdateEventSchema,Yt as PerpsMarketDataEventSchema,Ye as PerpsOrderUpdateEventSchema,He as PerpsPortfolioUpdateEventSchema,Zt as PerpsSessionUpdateEventSchema,$e as PerpsStatisticEventSchema,Le as PerpsTickerEventSchema,Xe as PerpsTpSlUpdateEventSchema,je as PerpsTradeEventSchema,Ge as PerpsWithdrawalUpdateEventSchema,at as ReactionCreatedEventSchema,it as ReactionRemovedEventSchema,er as RealtimeEventSchema,ar as SportsResultEventSchema,At as StandardMarketEventSchema,Ot as UserEventSchema,Te as UserOrderEventSchema,le as UserOrderEventType,te as UserOrderStatus,ze as UserTradeEventSchema};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map