@polymarket/bindings 0.1.0-beta.10 → 0.1.0-beta.12

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.
@@ -223,6 +223,10 @@ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
223
223
  error?: string | undefined;
224
224
  }>>;
225
225
  type PerpsCancelOrderResult = z.infer<typeof PerpsCancelOrderResultSchema>;
226
+ declare const PerpsCancelAllOrdersResponseSchema: z.ZodObject<{
227
+ status: z.ZodLiteral<"ok">;
228
+ }, z.core.$strip>;
229
+ type PerpsCancelAllOrdersResponse = z.infer<typeof PerpsCancelAllOrdersResponseSchema>;
226
230
  declare const PerpsUpdateLeverageResultSchema: z.ZodPipe<z.ZodObject<{
227
231
  status: z.ZodLiteral<"ok">;
228
232
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -248,6 +252,7 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
248
252
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
249
253
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
250
254
  post_only: z.ZodBoolean;
255
+ ro: z.ZodBoolean;
251
256
  status: z.ZodEnum<typeof PerpsOrderStatus>;
252
257
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
253
258
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -284,6 +289,7 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
284
289
  quantity: DecimalString;
285
290
  timeInForce: PerpsTimeInForce;
286
291
  postOnly: boolean;
292
+ reduceOnly: boolean;
287
293
  status: PerpsOrderStatus;
288
294
  restingQuantity: DecimalString;
289
295
  filledQuantity: DecimalString;
@@ -306,6 +312,7 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
306
312
  quantity: DecimalString;
307
313
  tif: PerpsTimeInForce;
308
314
  post_only: boolean;
315
+ ro: boolean;
309
316
  status: PerpsOrderStatus;
310
317
  resting_quantity: DecimalString;
311
318
  filled_quantity: DecimalString;
@@ -330,6 +337,7 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
330
337
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
331
338
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
332
339
  post_only: z.ZodBoolean;
340
+ ro: z.ZodBoolean;
333
341
  status: z.ZodEnum<typeof PerpsOrderStatus>;
334
342
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
335
343
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -366,6 +374,7 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
366
374
  quantity: DecimalString;
367
375
  timeInForce: PerpsTimeInForce;
368
376
  postOnly: boolean;
377
+ reduceOnly: boolean;
369
378
  status: PerpsOrderStatus;
370
379
  restingQuantity: DecimalString;
371
380
  filledQuantity: DecimalString;
@@ -388,6 +397,7 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
388
397
  quantity: DecimalString;
389
398
  tif: PerpsTimeInForce;
390
399
  post_only: boolean;
400
+ ro: boolean;
391
401
  status: PerpsOrderStatus;
392
402
  resting_quantity: DecimalString;
393
403
  filled_quantity: DecimalString;
@@ -411,6 +421,7 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
411
421
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
412
422
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
413
423
  post_only: z.ZodBoolean;
424
+ ro: z.ZodBoolean;
414
425
  status: z.ZodEnum<typeof PerpsOrderStatus>;
415
426
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
416
427
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -447,6 +458,7 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
447
458
  quantity: DecimalString;
448
459
  timeInForce: PerpsTimeInForce;
449
460
  postOnly: boolean;
461
+ reduceOnly: boolean;
450
462
  status: PerpsOrderStatus;
451
463
  restingQuantity: DecimalString;
452
464
  filledQuantity: DecimalString;
@@ -469,6 +481,7 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
469
481
  quantity: DecimalString;
470
482
  tif: PerpsTimeInForce;
471
483
  post_only: boolean;
484
+ ro: boolean;
472
485
  status: PerpsOrderStatus;
473
486
  resting_quantity: DecimalString;
474
487
  filled_quantity: DecimalString;
@@ -492,6 +505,7 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
492
505
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
493
506
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
494
507
  po: z.ZodBoolean;
508
+ ro: z.ZodBoolean;
495
509
  status: z.ZodEnum<typeof PerpsOrderStatus>;
496
510
  rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
497
511
  fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -528,6 +542,7 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
528
542
  quantity: DecimalString;
529
543
  timeInForce: PerpsTimeInForce;
530
544
  postOnly: boolean;
545
+ reduceOnly: boolean;
531
546
  status: PerpsOrderStatus;
532
547
  restingQuantity: DecimalString;
533
548
  filledQuantity: DecimalString;
@@ -550,6 +565,7 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
550
565
  qty: DecimalString;
551
566
  tif: PerpsTimeInForce;
552
567
  po: boolean;
568
+ ro: boolean;
553
569
  status: PerpsOrderStatus;
554
570
  rest: DecimalString;
555
571
  fill: DecimalString;
@@ -717,4 +733,4 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
717
733
  coid?: string | undefined;
718
734
  }>>;
719
735
 
720
- export { PerpsSideSchema as $, PerpsDecimalInputSchema as A, type PerpsDepositAmount as B, PerpsDepositStatusSchema as C, PerpsEntityIdSchema as D, type PerpsFundingInterval as E, FetchPerpsOpenOrdersResponseSchema as F, PerpsFundingIntervalSchema as G, PerpsInstrumentCategorySchema as H, PerpsInstrumentIdSchema as I, PerpsInstrumentTypeSchema as J, PerpsInternalTransferDirectionSchema as K, ListPerpsFillsResponseSchema as L, PerpsInternalTransferIdSchema as M, PerpsKlineInterval as N, PerpsKlineIntervalSchema as O, type PerpsInstrumentId as P, type PerpsOrder as Q, type PerpsOrderId as R, PerpsOrderIdSchema as S, PerpsOrderSchema as T, PerpsOrderStatus as U, PerpsOrderStatusSchema as V, PerpsOrderUpdateSchema as W, PerpsPnlInterval as X, PerpsPnlIntervalSchema as Y, type PerpsPostOrderAck as Z, PerpsPostOrderAckSchema as _, type PerpsEntityId as a, PerpsTimeInForce as a0, PerpsTimeInForceSchema as a1, PerpsTpSlKind as a2, PerpsTpSlKindSchema as a3, type PerpsTpSlOrderFields as a4, PerpsTpSlOrderFieldsSchema as a5, PerpsTpSlScope as a6, PerpsTpSlScopeSchema as a7, PerpsTradeIdSchema as a8, type PerpsTxHash as a9, PerpsTxHashSchema as aa, type PerpsUpdateLeverageResult as ab, PerpsUpdateLeverageResultSchema as ac, type PerpsWithdrawalAmount as ad, PerpsWithdrawalIdSchema as ae, PerpsWithdrawalStatusSchema as af, decimalString as ag, perpsBaseUnits as ah, perpsDecimal as ai, PerpsDepositStatus as b, type PerpsWithdrawalId as c, PerpsWithdrawalStatus as d, type PerpsInternalTransferId as e, PerpsInternalTransferDirection as f, PerpsInstrumentType as g, PerpsInstrumentCategory as h, type PerpsTradeId as i, PerpsSide as j, FetchPerpsOrdersResponseSchema as k, type PerpsAccountFill as l, PerpsAccountFillSchema as m, PerpsAccountFillUpdateSchema as n, PerpsAssetSchema as o, type PerpsCancelOrderResult as p, PerpsCancelOrderResultSchema as q, type PerpsClientOrderId as r, PerpsClientOrderIdSchema as s, type PerpsCommandAck as t, PerpsCommandAckSchema as u, PerpsCommandStatusSchema as v, type PerpsCredentials as w, PerpsDataResponseSchema as x, type PerpsDecimal as y, type PerpsDecimalInput as z };
736
+ export { type PerpsPostOrderAck as $, type PerpsDecimal as A, type PerpsDecimalInput as B, PerpsDecimalInputSchema as C, type PerpsDepositAmount as D, PerpsDepositStatusSchema as E, FetchPerpsOpenOrdersResponseSchema as F, PerpsEntityIdSchema as G, type PerpsFundingInterval as H, PerpsFundingIntervalSchema as I, PerpsInstrumentCategorySchema as J, PerpsInstrumentIdSchema as K, ListPerpsFillsResponseSchema as L, PerpsInstrumentTypeSchema as M, PerpsInternalTransferDirectionSchema as N, PerpsInternalTransferIdSchema as O, type PerpsInstrumentId as P, PerpsKlineInterval as Q, PerpsKlineIntervalSchema as R, type PerpsOrder as S, type PerpsOrderId as T, PerpsOrderIdSchema as U, PerpsOrderSchema as V, PerpsOrderStatus as W, PerpsOrderStatusSchema as X, PerpsOrderUpdateSchema as Y, PerpsPnlInterval as Z, PerpsPnlIntervalSchema as _, type PerpsEntityId as a, PerpsPostOrderAckSchema as a0, PerpsSideSchema as a1, PerpsTimeInForce as a2, PerpsTimeInForceSchema as a3, PerpsTpSlKind as a4, PerpsTpSlKindSchema as a5, type PerpsTpSlOrderFields as a6, PerpsTpSlOrderFieldsSchema as a7, PerpsTpSlScope as a8, PerpsTpSlScopeSchema as a9, PerpsTradeIdSchema as aa, type PerpsTxHash as ab, PerpsTxHashSchema as ac, type PerpsUpdateLeverageResult as ad, PerpsUpdateLeverageResultSchema as ae, type PerpsWithdrawalAmount as af, PerpsWithdrawalIdSchema as ag, PerpsWithdrawalStatusSchema as ah, decimalString as ai, perpsBaseUnits as aj, perpsDecimal as ak, PerpsDepositStatus as b, type PerpsWithdrawalId as c, PerpsWithdrawalStatus as d, type PerpsInternalTransferId as e, PerpsInternalTransferDirection as f, PerpsInstrumentType as g, PerpsInstrumentCategory as h, type PerpsTradeId as i, PerpsSide as j, FetchPerpsOrdersResponseSchema as k, type PerpsAccountFill as l, PerpsAccountFillSchema as m, PerpsAccountFillUpdateSchema as n, PerpsAssetSchema as o, type PerpsCancelAllOrdersResponse as p, PerpsCancelAllOrdersResponseSchema as q, type PerpsCancelOrderResult as r, PerpsCancelOrderResultSchema as s, type PerpsClientOrderId as t, PerpsClientOrderIdSchema as u, type PerpsCommandAck as v, PerpsCommandAckSchema as w, PerpsCommandStatusSchema as x, type PerpsCredentials as y, PerpsDataResponseSchema as z };
@@ -1,6 +1,6 @@
1
1
  import * as _polymarket_types from '@polymarket/types';
2
- import { P as PerpsInstrumentId, a as PerpsEntityId, b as PerpsDepositStatus, c as PerpsWithdrawalId, d as PerpsWithdrawalStatus, e as PerpsInternalTransferId, f as PerpsInternalTransferDirection, g as PerpsInstrumentType, h as PerpsInstrumentCategory, i as PerpsTradeId, j as PerpsSide } from '../orders-DHP1WzKt.js';
3
- export { F as FetchPerpsOpenOrdersResponseSchema, k as FetchPerpsOrdersResponseSchema, L as ListPerpsFillsResponseSchema, l as PerpsAccountFill, m as PerpsAccountFillSchema, n as PerpsAccountFillUpdateSchema, o as PerpsAssetSchema, p as PerpsCancelOrderResult, q as PerpsCancelOrderResultSchema, r as PerpsClientOrderId, s as PerpsClientOrderIdSchema, t as PerpsCommandAck, u as PerpsCommandAckSchema, v as PerpsCommandStatusSchema, w as PerpsCredentials, x as PerpsDataResponseSchema, y as PerpsDecimal, z as PerpsDecimalInput, A as PerpsDecimalInputSchema, B as PerpsDepositAmount, C as PerpsDepositStatusSchema, D as PerpsEntityIdSchema, E as PerpsFundingInterval, G as PerpsFundingIntervalSchema, H as PerpsInstrumentCategorySchema, I as PerpsInstrumentIdSchema, J as PerpsInstrumentTypeSchema, K as PerpsInternalTransferDirectionSchema, M as PerpsInternalTransferIdSchema, N as PerpsKlineInterval, O as PerpsKlineIntervalSchema, Q as PerpsOrder, R as PerpsOrderId, S as PerpsOrderIdSchema, T as PerpsOrderSchema, U as PerpsOrderStatus, V as PerpsOrderStatusSchema, W as PerpsOrderUpdateSchema, X as PerpsPnlInterval, Y as PerpsPnlIntervalSchema, Z as PerpsPostOrderAck, _ as PerpsPostOrderAckSchema, $ as PerpsSideSchema, a0 as PerpsTimeInForce, a1 as PerpsTimeInForceSchema, a2 as PerpsTpSlKind, a3 as PerpsTpSlKindSchema, a4 as PerpsTpSlOrderFields, a5 as PerpsTpSlOrderFieldsSchema, a6 as PerpsTpSlScope, a7 as PerpsTpSlScopeSchema, a8 as PerpsTradeIdSchema, a9 as PerpsTxHash, aa as PerpsTxHashSchema, ab as PerpsUpdateLeverageResult, ac as PerpsUpdateLeverageResultSchema, ad as PerpsWithdrawalAmount, ae as PerpsWithdrawalIdSchema, af as PerpsWithdrawalStatusSchema, ag as decimalString, ah as perpsBaseUnits, ai as perpsDecimal } from '../orders-DHP1WzKt.js';
2
+ import { P as PerpsInstrumentId, a as PerpsEntityId, b as PerpsDepositStatus, c as PerpsWithdrawalId, d as PerpsWithdrawalStatus, e as PerpsInternalTransferId, f as PerpsInternalTransferDirection, g as PerpsInstrumentType, h as PerpsInstrumentCategory, i as PerpsTradeId, j as PerpsSide } from '../orders-Uj0Gkvd4.js';
3
+ export { F as FetchPerpsOpenOrdersResponseSchema, k as FetchPerpsOrdersResponseSchema, L as ListPerpsFillsResponseSchema, l as PerpsAccountFill, m as PerpsAccountFillSchema, n as PerpsAccountFillUpdateSchema, o as PerpsAssetSchema, p as PerpsCancelAllOrdersResponse, q as PerpsCancelAllOrdersResponseSchema, r as PerpsCancelOrderResult, s as PerpsCancelOrderResultSchema, t as PerpsClientOrderId, u as PerpsClientOrderIdSchema, v as PerpsCommandAck, w as PerpsCommandAckSchema, x as PerpsCommandStatusSchema, y as PerpsCredentials, z as PerpsDataResponseSchema, A as PerpsDecimal, B as PerpsDecimalInput, C as PerpsDecimalInputSchema, D as PerpsDepositAmount, E as PerpsDepositStatusSchema, G as PerpsEntityIdSchema, H as PerpsFundingInterval, I as PerpsFundingIntervalSchema, J as PerpsInstrumentCategorySchema, K as PerpsInstrumentIdSchema, M as PerpsInstrumentTypeSchema, N as PerpsInternalTransferDirectionSchema, O as PerpsInternalTransferIdSchema, Q as PerpsKlineInterval, R as PerpsKlineIntervalSchema, S as PerpsOrder, T as PerpsOrderId, U as PerpsOrderIdSchema, V as PerpsOrderSchema, W as PerpsOrderStatus, X as PerpsOrderStatusSchema, Y as PerpsOrderUpdateSchema, Z as PerpsPnlInterval, _ as PerpsPnlIntervalSchema, $ as PerpsPostOrderAck, a0 as PerpsPostOrderAckSchema, a1 as PerpsSideSchema, a2 as PerpsTimeInForce, a3 as PerpsTimeInForceSchema, a4 as PerpsTpSlKind, a5 as PerpsTpSlKindSchema, a6 as PerpsTpSlOrderFields, a7 as PerpsTpSlOrderFieldsSchema, a8 as PerpsTpSlScope, a9 as PerpsTpSlScopeSchema, aa as PerpsTradeIdSchema, ab as PerpsTxHash, ac as PerpsTxHashSchema, ad as PerpsUpdateLeverageResult, ae as PerpsUpdateLeverageResultSchema, af as PerpsWithdrawalAmount, ag as PerpsWithdrawalIdSchema, ah as PerpsWithdrawalStatusSchema, ai as decimalString, aj as perpsBaseUnits, ak as perpsDecimal } from '../orders-Uj0Gkvd4.js';
4
4
  import { DecimalString, EpochMilliseconds, BaseUnits } from '../index.js';
5
5
  import { z } from 'zod';
6
6
 
@@ -1,2 +1,2 @@
1
- export{X as FetchPerpsAccountConfigResponseSchema,O as FetchPerpsAccountStatsResponseSchema,M as FetchPerpsBalancesResponseSchema,Ja as FetchPerpsCandlesResponseSchema,Ia as FetchPerpsFeesResponseSchema,Fa as FetchPerpsFundingHistoryResponseSchema,oa as FetchPerpsInstrumentsResponseSchema,Ua as FetchPerpsOpenOrdersResponseSchema,Ta as FetchPerpsOrdersResponseSchema,S as FetchPerpsPortfolioResponseSchema,ua as FetchPerpsStatisticsResponseSchema,qa as FetchPerpsTickersResponseSchema,Da as FetchPerpsTradesResponseSchema,fa as ListPerpsDepositsResponseSchema,Z as ListPerpsEquityHistoryResponseSchema,Xa as ListPerpsFillsResponseSchema,U as ListPerpsFundingPaymentsResponseSchema,$ as ListPerpsPnlHistoryResponseSchema,ia as ListPerpsWithdrawalsResponseSchema,W as PerpsAccountConfigSchema,Wa as PerpsAccountFillSchema,Ya as PerpsAccountFillUpdateSchema,V as PerpsAccountFundingPaymentEntrySchema,T as PerpsAccountFundingPaymentSchema,N as PerpsAccountStatsSchema,F as PerpsAssetSchema,L as PerpsBalanceSchema,za as PerpsBboSchema,Aa as PerpsBboUpdateSchema,wa as PerpsBookLevelSchema,xa as PerpsBookSchema,ya as PerpsBookUpdateSchema,Qa as PerpsCancelOrderResultSchema,sa as PerpsCandleSchema,c as PerpsClientOrderIdSchema,Oa as PerpsCommandAckSchema,Na as PerpsCommandStatusSchema,ca as PerpsCreateProxyResponseSchema,ba as PerpsCredentialsResponseSchema,H as PerpsDataResponseSchema,i as PerpsDecimalInputSchema,da as PerpsDeleteProxyResponseSchema,ea as PerpsDepositSchema,p as PerpsDepositStatus,A as PerpsDepositStatusSchema,ga as PerpsDepositUpdateSchema,g as PerpsEntityIdSchema,Y as PerpsEquityPointSchema,Ga as PerpsFeeScheduleEntrySchema,Ha as PerpsFeesInfoSchema,h as PerpsFundingIntervalSchema,Ea as PerpsFundingRateSchema,k as PerpsInstrumentCategory,v as PerpsInstrumentCategorySchema,a as PerpsInstrumentIdSchema,na as PerpsInstrumentSchema,j as PerpsInstrumentType,u as PerpsInstrumentTypeSchema,r as PerpsInternalTransferDirection,C as PerpsInternalTransferDirectionSchema,f as PerpsInternalTransferIdSchema,la as PerpsInternalTransferSchema,s as PerpsKlineInterval,D as PerpsKlineIntervalSchema,Q as PerpsMarginSummarySchema,b as PerpsOrderIdSchema,Sa as PerpsOrderSchema,Ka as PerpsOrderStatus,Ma as PerpsOrderStatusSchema,Va as PerpsOrderUpdateSchema,t as PerpsPnlInterval,E as PerpsPnlIntervalSchema,_ as PerpsPnlPointSchema,P as PerpsPortfolioPositionSchema,R as PerpsPortfolioSchema,Pa as PerpsPostOrderAckSchema,aa as PerpsProxyKeySchema,Ba as PerpsPublicTradeSchema,Ca as PerpsPublicTradeUpdateSchema,ma as PerpsRiskTierSchema,l as PerpsSide,w as PerpsSideSchema,ta as PerpsStatisticSchema,va as PerpsStatisticUpdateSchema,ra as PerpsTickerEntrySchema,pa as PerpsTickerSchema,m as PerpsTimeInForce,x as PerpsTimeInForceSchema,n as PerpsTpSlKind,y as PerpsTpSlKindSchema,La as PerpsTpSlOrderFieldsSchema,o as PerpsTpSlScope,z as PerpsTpSlScopeSchema,d as PerpsTradeIdSchema,G as PerpsTxHashSchema,Ra as PerpsUpdateLeverageResultSchema,ja as PerpsWithdrawResponseSchema,e as PerpsWithdrawalIdSchema,ha as PerpsWithdrawalSchema,q as PerpsWithdrawalStatus,B as PerpsWithdrawalStatusSchema,ka as PerpsWithdrawalUpdateSchema,K as decimalString,J as perpsBaseUnits,I as perpsDecimal}from'../chunk-CCTEF2UT.js';import'../chunk-VBHCYSM7.js';//# sourceMappingURL=index.js.map
1
+ export{X as FetchPerpsAccountConfigResponseSchema,O as FetchPerpsAccountStatsResponseSchema,M as FetchPerpsBalancesResponseSchema,Ja as FetchPerpsCandlesResponseSchema,Ia as FetchPerpsFeesResponseSchema,Fa as FetchPerpsFundingHistoryResponseSchema,oa as FetchPerpsInstrumentsResponseSchema,Va as FetchPerpsOpenOrdersResponseSchema,Ua as FetchPerpsOrdersResponseSchema,S as FetchPerpsPortfolioResponseSchema,ua as FetchPerpsStatisticsResponseSchema,qa as FetchPerpsTickersResponseSchema,Da as FetchPerpsTradesResponseSchema,fa as ListPerpsDepositsResponseSchema,Z as ListPerpsEquityHistoryResponseSchema,Ya as ListPerpsFillsResponseSchema,U as ListPerpsFundingPaymentsResponseSchema,$ as ListPerpsPnlHistoryResponseSchema,ia as ListPerpsWithdrawalsResponseSchema,W as PerpsAccountConfigSchema,Xa as PerpsAccountFillSchema,Za as PerpsAccountFillUpdateSchema,V as PerpsAccountFundingPaymentEntrySchema,T as PerpsAccountFundingPaymentSchema,N as PerpsAccountStatsSchema,F as PerpsAssetSchema,L as PerpsBalanceSchema,za as PerpsBboSchema,Aa as PerpsBboUpdateSchema,wa as PerpsBookLevelSchema,xa as PerpsBookSchema,ya as PerpsBookUpdateSchema,Ra as PerpsCancelAllOrdersResponseSchema,Qa as PerpsCancelOrderResultSchema,sa as PerpsCandleSchema,c as PerpsClientOrderIdSchema,Oa as PerpsCommandAckSchema,Na as PerpsCommandStatusSchema,ca as PerpsCreateProxyResponseSchema,ba as PerpsCredentialsResponseSchema,H as PerpsDataResponseSchema,i as PerpsDecimalInputSchema,da as PerpsDeleteProxyResponseSchema,ea as PerpsDepositSchema,p as PerpsDepositStatus,A as PerpsDepositStatusSchema,ga as PerpsDepositUpdateSchema,g as PerpsEntityIdSchema,Y as PerpsEquityPointSchema,Ga as PerpsFeeScheduleEntrySchema,Ha as PerpsFeesInfoSchema,h as PerpsFundingIntervalSchema,Ea as PerpsFundingRateSchema,k as PerpsInstrumentCategory,v as PerpsInstrumentCategorySchema,a as PerpsInstrumentIdSchema,na as PerpsInstrumentSchema,j as PerpsInstrumentType,u as PerpsInstrumentTypeSchema,r as PerpsInternalTransferDirection,C as PerpsInternalTransferDirectionSchema,f as PerpsInternalTransferIdSchema,la as PerpsInternalTransferSchema,s as PerpsKlineInterval,D as PerpsKlineIntervalSchema,Q as PerpsMarginSummarySchema,b as PerpsOrderIdSchema,Ta as PerpsOrderSchema,Ka as PerpsOrderStatus,Ma as PerpsOrderStatusSchema,Wa as PerpsOrderUpdateSchema,t as PerpsPnlInterval,E as PerpsPnlIntervalSchema,_ as PerpsPnlPointSchema,P as PerpsPortfolioPositionSchema,R as PerpsPortfolioSchema,Pa as PerpsPostOrderAckSchema,aa as PerpsProxyKeySchema,Ba as PerpsPublicTradeSchema,Ca as PerpsPublicTradeUpdateSchema,ma as PerpsRiskTierSchema,l as PerpsSide,w as PerpsSideSchema,ta as PerpsStatisticSchema,va as PerpsStatisticUpdateSchema,ra as PerpsTickerEntrySchema,pa as PerpsTickerSchema,m as PerpsTimeInForce,x as PerpsTimeInForceSchema,n as PerpsTpSlKind,y as PerpsTpSlKindSchema,La as PerpsTpSlOrderFieldsSchema,o as PerpsTpSlScope,z as PerpsTpSlScopeSchema,d as PerpsTradeIdSchema,G as PerpsTxHashSchema,Sa as PerpsUpdateLeverageResultSchema,ja as PerpsWithdrawResponseSchema,e as PerpsWithdrawalIdSchema,ha as PerpsWithdrawalSchema,q as PerpsWithdrawalStatus,B as PerpsWithdrawalStatusSchema,ka as PerpsWithdrawalUpdateSchema,K as decimalString,J as perpsBaseUnits,I as perpsDecimal}from'../chunk-BI6DX3LX.js';import'../chunk-GTLPG5HR.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import {$,Fa,Ga}from'../chunk-VBHCYSM7.js';import {z}from'zod';var i=(n=>(n.SAFE="SAFE",n.PROXY="PROXY",n.SAFE_CREATE="SAFE-CREATE",n.WALLET="WALLET",n.WALLET_CREATE="WALLET-CREATE",n))(i||{}),D=z.enum(i),u=z.enum(["PROXY","SAFE","SAFE-CREATE"]),c=(o=>(o.STATE_NEW="STATE_NEW",o.STATE_EXECUTED="STATE_EXECUTED",o.STATE_MINED="STATE_MINED",o.STATE_CONFIRMED="STATE_CONFIRMED",o.STATE_INVALID="STATE_INVALID",o.STATE_FAILED="STATE_FAILED",o))(c||{}),m=z.enum(c),y=z.object({baseGas:z.string().optional(),gasLimit:z.string().optional(),gasPrice:z.string().optional(),gasToken:$.optional(),operation:z.string().optional(),payment:z.string().optional(),paymentReceiver:$.optional(),paymentToken:$.optional(),refundReceiver:$.optional(),relay:$.optional(),relayHub:$.optional(),relayerFee:z.string().optional(),safeTxnGas:z.string().optional()}),d=z.object({address:$,nonce:z.string().min(1)}),R=z.object({data:z.string().min(1),from:$,metadata:z.string().optional(),nonce:z.string().min(1).optional(),proxyWallet:$,signature:z.string().min(1),signatureParams:y,to:$,type:u,value:z.string().optional()}),T=z.object({data:z.string().min(1),target:$,value:z.string().min(1)}),x=z.object({calls:z.array(T).min(1),deadline:z.string().min(1),depositWallet:$}),S=z.object({depositWalletParams:x,from:$,metadata:z.string().optional(),nonce:z.string().min(1),signature:z.string().min(1),to:$,type:z.literal("WALLET")}),g=z.object({from:$,metadata:z.string().optional(),to:$,type:z.literal("WALLET-CREATE")}),W=z.union([R,S,g]),f=z.object({state:m,transactionHash:Ga.nullish().transform(a=>a??null),transactionID:Fa}).transform(({transactionHash:a,transactionID:s,...r})=>({...r,transactionHash:a??null,transactionId:s})),L=z.object({deployed:z.boolean()}),_=z.object({error_msg:z.string().nullish(),state:m,transaction_hash:z.union([z.literal(""),Ga]).transform(a=>a===""?null:a),transaction_id:Fa}).transform(({error_msg:a,transaction_hash:s,transaction_id:r,...E})=>({...E,errorMsg:a??null,transactionHash:s??null,transactionId:r}));export{T as DepositWalletCallSchema,x as DepositWalletParamsSchema,_ as GaslessTransactionSchema,L as RelayerDeployedResponseSchema,g as RelayerDepositWalletCreateRequestSchema,S as RelayerDepositWalletExecuteRequestSchema,d as RelayerExecuteParamsSchema,W as RelayerExecuteRequestSchema,f as RelayerExecuteResponseSchema,R as RelayerLegacyExecuteRequestSchema,c as RelayerTransactionState,i as RelayerTransactionType,D as RelayerTransactionTypeSchema};//# sourceMappingURL=index.js.map
1
+ import {ba,Ha,Ia}from'../chunk-GTLPG5HR.js';import {z}from'zod';var i=(n=>(n.SAFE="SAFE",n.PROXY="PROXY",n.SAFE_CREATE="SAFE-CREATE",n.WALLET="WALLET",n.WALLET_CREATE="WALLET-CREATE",n))(i||{}),D=z.enum(i),u=z.enum(["PROXY","SAFE","SAFE-CREATE"]),c=(o=>(o.STATE_NEW="STATE_NEW",o.STATE_EXECUTED="STATE_EXECUTED",o.STATE_MINED="STATE_MINED",o.STATE_CONFIRMED="STATE_CONFIRMED",o.STATE_INVALID="STATE_INVALID",o.STATE_FAILED="STATE_FAILED",o))(c||{}),m=z.enum(c),y=z.object({baseGas:z.string().optional(),gasLimit:z.string().optional(),gasPrice:z.string().optional(),gasToken:ba.optional(),operation:z.string().optional(),payment:z.string().optional(),paymentReceiver:ba.optional(),paymentToken:ba.optional(),refundReceiver:ba.optional(),relay:ba.optional(),relayHub:ba.optional(),relayerFee:z.string().optional(),safeTxnGas:z.string().optional()}),d=z.object({address:ba,nonce:z.string().min(1)}),R=z.object({data:z.string().min(1),from:ba,metadata:z.string().optional(),nonce:z.string().min(1).optional(),proxyWallet:ba,signature:z.string().min(1),signatureParams:y,to:ba,type:u,value:z.string().optional()}),T=z.object({data:z.string().min(1),target:ba,value:z.string().min(1)}),x=z.object({calls:z.array(T).min(1),deadline:z.string().min(1),depositWallet:ba}),S=z.object({depositWalletParams:x,from:ba,metadata:z.string().optional(),nonce:z.string().min(1),signature:z.string().min(1),to:ba,type:z.literal("WALLET")}),g=z.object({from:ba,metadata:z.string().optional(),to:ba,type:z.literal("WALLET-CREATE")}),W=z.union([R,S,g]),f=z.object({state:m,transactionHash:Ia.nullish().transform(a=>a??null),transactionID:Ha}).transform(({transactionHash:a,transactionID:s,...r})=>({...r,transactionHash:a??null,transactionId:s})),L=z.object({deployed:z.boolean()}),_=z.object({error_msg:z.string().nullish(),state:m,transaction_hash:z.union([z.literal(""),Ia]).transform(a=>a===""?null:a),transaction_id:Ha}).transform(({error_msg:a,transaction_hash:s,transaction_id:r,...E})=>({...E,errorMsg:a??null,transactionHash:s??null,transactionId:r}));export{T as DepositWalletCallSchema,x as DepositWalletParamsSchema,_ as GaslessTransactionSchema,L as RelayerDeployedResponseSchema,g as RelayerDepositWalletCreateRequestSchema,S as RelayerDepositWalletExecuteRequestSchema,d as RelayerExecuteParamsSchema,W as RelayerExecuteRequestSchema,f as RelayerExecuteResponseSchema,R as RelayerLegacyExecuteRequestSchema,c as RelayerTransactionState,i as RelayerTransactionType,D as RelayerTransactionTypeSchema};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/relayer/transaction.ts"],"names":["RelayerTransactionType","RelayerTransactionTypeSchema","z","RelayerLegacyTransactionTypeSchema","RelayerTransactionState","RelayerTransactionStateSchema","RelayerSignatureParamsSchema","EvmAddressSchema","RelayerExecuteParamsSchema","RelayerLegacyExecuteRequestSchema","DepositWalletCallSchema","DepositWalletParamsSchema","RelayerDepositWalletExecuteRequestSchema","RelayerDepositWalletCreateRequestSchema","RelayerExecuteRequestSchema","RelayerExecuteResponseSchema","TxHashSchema","value","TransactionIdSchema","transactionHash","transactionID","rest","RelayerDeployedResponseSchema","GaslessTransactionSchema","error_msg","transaction_hash","transaction_id"],"mappings":"+DAGO,IAAKA,OACVA,CAAAA,CAAA,IAAA,CAAO,MAAA,CACPA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,EAAA,WAAA,CAAc,aAAA,CACdA,EAAA,MAAA,CAAS,QAAA,CACTA,EAAA,aAAA,CAAgB,eAAA,CALNA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAQCC,CAAAA,CAA+BC,CAAAA,CAAE,KAAKF,CAAsB,CAAA,CAEnEG,EAAqCD,CAAAA,CAAE,IAAA,CAAK,CAChD,OAAA,CACA,MAAA,CACA,aACF,CAAC,CAAA,CAEWE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,SAAA,CAAY,WAAA,CACZA,EAAA,cAAA,CAAiB,gBAAA,CACjBA,EAAA,WAAA,CAAc,aAAA,CACdA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,cAAgB,eAAA,CAChBA,CAAAA,CAAA,aAAe,cAAA,CANLA,CAAAA,CAAAA,EAAAA,CAAAA,EA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CAAM,CACjDO,EACAG,CAAAA,CACAC,CACF,CAAC,CAAA,CAIYE,CAAAA,CAA+Bb,CAAAA,CACzC,OAAO,CACN,KAAA,CAAOG,EACP,eAAA,CAAiBW,EAAAA,CAAa,SAAQ,CAAE,SAAA,CAAWC,CAAAA,EAAUA,CAAAA,EAAS,IAAI,CAAA,CAC1E,cAAeC,EACjB,CAAC,EACA,SAAA,CAAU,CAAC,CAAE,eAAA,CAAAC,CAAAA,CAAiB,aAAA,CAAAC,CAAAA,CAAe,GAAGC,CAAK,KAAO,CAC3D,GAAGA,EACH,eAAA,CAAiBF,CAAAA,EAAmB,KACpC,aAAA,CAAeC,CACjB,CAAA,CAAE,CAAA,CAMSE,CAAAA,CAAgCpB,CAAAA,CAAE,OAAO,CACpD,QAAA,CAAUA,CAAAA,CAAE,OAAA,EACd,CAAC,EAMYqB,CAAAA,CAA2BrB,CAAAA,CACrC,MAAA,CAAO,CACN,SAAA,CAAWA,CAAAA,CAAE,QAAO,CAAE,OAAA,GACtB,KAAA,CAAOG,CAAAA,CACP,iBAAkBH,CAAAA,CACf,KAAA,CAAM,CAACA,CAAAA,CAAE,OAAA,CAAQ,EAAE,EAAGc,EAAY,CAAC,EACnC,SAAA,CAAWC,CAAAA,EAAWA,IAAU,EAAA,CAAK,IAAA,CAAOA,CAAM,CAAA,CACrD,cAAA,CAAgBC,EAClB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,SAAA,CAAAM,EAAW,gBAAA,CAAAC,CAAAA,CAAkB,cAAA,CAAAC,CAAAA,CAAgB,GAAGL,CAAK,KAAO,CACxE,GAAGA,CAAAA,CACH,QAAA,CAAUG,CAAAA,EAAa,IAAA,CACvB,gBAAiBC,CAAAA,EAAoB,IAAA,CACrC,aAAA,CAAeC,CACjB,CAAA,CAAE","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport { EvmAddressSchema, TransactionIdSchema, TxHashSchema } from '../shared';\n\nexport enum RelayerTransactionType {\n SAFE = 'SAFE',\n PROXY = 'PROXY',\n SAFE_CREATE = 'SAFE-CREATE',\n WALLET = 'WALLET',\n WALLET_CREATE = 'WALLET-CREATE',\n}\n\nexport const RelayerTransactionTypeSchema = z.enum(RelayerTransactionType);\n\nconst RelayerLegacyTransactionTypeSchema = z.enum([\n RelayerTransactionType.PROXY,\n RelayerTransactionType.SAFE,\n RelayerTransactionType.SAFE_CREATE,\n]);\n\nexport enum RelayerTransactionState {\n STATE_NEW = 'STATE_NEW',\n STATE_EXECUTED = 'STATE_EXECUTED',\n STATE_MINED = 'STATE_MINED',\n STATE_CONFIRMED = 'STATE_CONFIRMED',\n STATE_INVALID = 'STATE_INVALID',\n STATE_FAILED = 'STATE_FAILED',\n}\n\nconst RelayerTransactionStateSchema = z.enum(RelayerTransactionState);\n\nconst RelayerSignatureParamsSchema = z.object({\n baseGas: z.string().optional(),\n gasLimit: z.string().optional(),\n gasPrice: z.string().optional(),\n gasToken: EvmAddressSchema.optional(),\n operation: z.string().optional(),\n payment: z.string().optional(),\n paymentReceiver: EvmAddressSchema.optional(),\n paymentToken: EvmAddressSchema.optional(),\n refundReceiver: EvmAddressSchema.optional(),\n relay: EvmAddressSchema.optional(),\n relayHub: EvmAddressSchema.optional(),\n relayerFee: z.string().optional(),\n safeTxnGas: z.string().optional(),\n});\n\nexport const RelayerExecuteParamsSchema = z.object({\n address: EvmAddressSchema,\n nonce: z.string().min(1),\n});\n\nexport type RelayerExecuteParams = z.output<typeof RelayerExecuteParamsSchema>;\n\nexport const RelayerLegacyExecuteRequestSchema = z.object({\n data: z.string().min(1),\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n nonce: z.string().min(1).optional(),\n proxyWallet: EvmAddressSchema,\n signature: z.string().min(1),\n signatureParams: RelayerSignatureParamsSchema,\n to: EvmAddressSchema,\n type: RelayerLegacyTransactionTypeSchema,\n value: z.string().optional(),\n});\n\nexport type RelayerLegacyExecuteRequest = z.input<\n typeof RelayerLegacyExecuteRequestSchema\n>;\n\nexport const DepositWalletCallSchema = z.object({\n data: z.string().min(1),\n target: EvmAddressSchema,\n value: z.string().min(1),\n});\n\nexport type DepositWalletCall = z.input<typeof DepositWalletCallSchema>;\n\nexport const DepositWalletParamsSchema = z.object({\n calls: z.array(DepositWalletCallSchema).min(1),\n deadline: z.string().min(1),\n depositWallet: EvmAddressSchema,\n});\n\nexport type DepositWalletParams = z.input<typeof DepositWalletParamsSchema>;\n\nexport const RelayerDepositWalletExecuteRequestSchema = z.object({\n depositWalletParams: DepositWalletParamsSchema,\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n nonce: z.string().min(1),\n signature: z.string().min(1),\n to: EvmAddressSchema,\n type: z.literal(RelayerTransactionType.WALLET),\n});\n\nexport type RelayerDepositWalletExecuteRequest = z.input<\n typeof RelayerDepositWalletExecuteRequestSchema\n>;\n\nexport const RelayerDepositWalletCreateRequestSchema = z.object({\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n to: EvmAddressSchema,\n type: z.literal(RelayerTransactionType.WALLET_CREATE),\n});\n\nexport type RelayerDepositWalletCreateRequest = z.input<\n typeof RelayerDepositWalletCreateRequestSchema\n>;\n\nexport const RelayerExecuteRequestSchema = z.union([\n RelayerLegacyExecuteRequestSchema,\n RelayerDepositWalletExecuteRequestSchema,\n RelayerDepositWalletCreateRequestSchema,\n]);\n\nexport type RelayerExecuteRequest = z.input<typeof RelayerExecuteRequestSchema>;\n\nexport const RelayerExecuteResponseSchema = z\n .object({\n state: RelayerTransactionStateSchema,\n transactionHash: TxHashSchema.nullish().transform((value) => value ?? null),\n transactionID: TransactionIdSchema,\n })\n .transform(({ transactionHash, transactionID, ...rest }) => ({\n ...rest,\n transactionHash: transactionHash ?? null,\n transactionId: transactionID,\n }));\n\nexport type RelayerExecuteResponse = z.output<\n typeof RelayerExecuteResponseSchema\n>;\n\nexport const RelayerDeployedResponseSchema = z.object({\n deployed: z.boolean(),\n});\n\nexport type RelayerDeployedResponse = z.output<\n typeof RelayerDeployedResponseSchema\n>;\n\nexport const GaslessTransactionSchema = z\n .object({\n error_msg: z.string().nullish(),\n state: RelayerTransactionStateSchema,\n transaction_hash: z\n .union([z.literal(''), TxHashSchema])\n .transform((value) => (value === '' ? null : value)),\n transaction_id: TransactionIdSchema,\n })\n .transform(({ error_msg, transaction_hash, transaction_id, ...rest }) => ({\n ...rest,\n errorMsg: error_msg ?? null,\n transactionHash: transaction_hash ?? null,\n transactionId: transaction_id,\n }));\n\nexport type GaslessTransaction = z.output<typeof GaslessTransactionSchema>;\n"]}
1
+ {"version":3,"sources":["../../src/relayer/transaction.ts"],"names":["RelayerTransactionType","RelayerTransactionTypeSchema","z","RelayerLegacyTransactionTypeSchema","RelayerTransactionState","RelayerTransactionStateSchema","RelayerSignatureParamsSchema","EvmAddressSchema","RelayerExecuteParamsSchema","RelayerLegacyExecuteRequestSchema","DepositWalletCallSchema","DepositWalletParamsSchema","RelayerDepositWalletExecuteRequestSchema","RelayerDepositWalletCreateRequestSchema","RelayerExecuteRequestSchema","RelayerExecuteResponseSchema","TxHashSchema","value","TransactionIdSchema","transactionHash","transactionID","rest","RelayerDeployedResponseSchema","GaslessTransactionSchema","error_msg","transaction_hash","transaction_id"],"mappings":"gEAGO,IAAKA,OACVA,CAAAA,CAAA,IAAA,CAAO,MAAA,CACPA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,EAAA,WAAA,CAAc,aAAA,CACdA,EAAA,MAAA,CAAS,QAAA,CACTA,EAAA,aAAA,CAAgB,eAAA,CALNA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAQCC,CAAAA,CAA+BC,CAAAA,CAAE,KAAKF,CAAsB,CAAA,CAEnEG,EAAqCD,CAAAA,CAAE,IAAA,CAAK,CAChD,OAAA,CACA,MAAA,CACA,aACF,CAAC,CAAA,CAEWE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,SAAA,CAAY,WAAA,CACZA,EAAA,cAAA,CAAiB,gBAAA,CACjBA,EAAA,WAAA,CAAc,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,aAAA,CAAeC,CACjB,CAAA,CAAE","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport { EvmAddressSchema, TransactionIdSchema, TxHashSchema } from '../shared';\n\nexport enum RelayerTransactionType {\n SAFE = 'SAFE',\n PROXY = 'PROXY',\n SAFE_CREATE = 'SAFE-CREATE',\n WALLET = 'WALLET',\n WALLET_CREATE = 'WALLET-CREATE',\n}\n\nexport const RelayerTransactionTypeSchema = z.enum(RelayerTransactionType);\n\nconst RelayerLegacyTransactionTypeSchema = z.enum([\n RelayerTransactionType.PROXY,\n RelayerTransactionType.SAFE,\n RelayerTransactionType.SAFE_CREATE,\n]);\n\nexport enum RelayerTransactionState {\n STATE_NEW = 'STATE_NEW',\n STATE_EXECUTED = 'STATE_EXECUTED',\n STATE_MINED = 'STATE_MINED',\n STATE_CONFIRMED = 'STATE_CONFIRMED',\n STATE_INVALID = 'STATE_INVALID',\n STATE_FAILED = 'STATE_FAILED',\n}\n\nconst RelayerTransactionStateSchema = z.enum(RelayerTransactionState);\n\nconst RelayerSignatureParamsSchema = z.object({\n baseGas: z.string().optional(),\n gasLimit: z.string().optional(),\n gasPrice: z.string().optional(),\n gasToken: EvmAddressSchema.optional(),\n operation: z.string().optional(),\n payment: z.string().optional(),\n paymentReceiver: EvmAddressSchema.optional(),\n paymentToken: EvmAddressSchema.optional(),\n refundReceiver: EvmAddressSchema.optional(),\n relay: EvmAddressSchema.optional(),\n relayHub: EvmAddressSchema.optional(),\n relayerFee: z.string().optional(),\n safeTxnGas: z.string().optional(),\n});\n\nexport const RelayerExecuteParamsSchema = z.object({\n address: EvmAddressSchema,\n nonce: z.string().min(1),\n});\n\nexport type RelayerExecuteParams = z.output<typeof RelayerExecuteParamsSchema>;\n\nexport const RelayerLegacyExecuteRequestSchema = z.object({\n data: z.string().min(1),\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n nonce: z.string().min(1).optional(),\n proxyWallet: EvmAddressSchema,\n signature: z.string().min(1),\n signatureParams: RelayerSignatureParamsSchema,\n to: EvmAddressSchema,\n type: RelayerLegacyTransactionTypeSchema,\n value: z.string().optional(),\n});\n\nexport type RelayerLegacyExecuteRequest = z.input<\n typeof RelayerLegacyExecuteRequestSchema\n>;\n\nexport const DepositWalletCallSchema = z.object({\n data: z.string().min(1),\n target: EvmAddressSchema,\n value: z.string().min(1),\n});\n\nexport type DepositWalletCall = z.input<typeof DepositWalletCallSchema>;\n\nexport const DepositWalletParamsSchema = z.object({\n calls: z.array(DepositWalletCallSchema).min(1),\n deadline: z.string().min(1),\n depositWallet: EvmAddressSchema,\n});\n\nexport type DepositWalletParams = z.input<typeof DepositWalletParamsSchema>;\n\nexport const RelayerDepositWalletExecuteRequestSchema = z.object({\n depositWalletParams: DepositWalletParamsSchema,\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n nonce: z.string().min(1),\n signature: z.string().min(1),\n to: EvmAddressSchema,\n type: z.literal(RelayerTransactionType.WALLET),\n});\n\nexport type RelayerDepositWalletExecuteRequest = z.input<\n typeof RelayerDepositWalletExecuteRequestSchema\n>;\n\nexport const RelayerDepositWalletCreateRequestSchema = z.object({\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n to: EvmAddressSchema,\n type: z.literal(RelayerTransactionType.WALLET_CREATE),\n});\n\nexport type RelayerDepositWalletCreateRequest = z.input<\n typeof RelayerDepositWalletCreateRequestSchema\n>;\n\nexport const RelayerExecuteRequestSchema = z.union([\n RelayerLegacyExecuteRequestSchema,\n RelayerDepositWalletExecuteRequestSchema,\n RelayerDepositWalletCreateRequestSchema,\n]);\n\nexport type RelayerExecuteRequest = z.input<typeof RelayerExecuteRequestSchema>;\n\nexport const RelayerExecuteResponseSchema = z\n .object({\n state: RelayerTransactionStateSchema,\n transactionHash: TxHashSchema.nullish().transform((value) => value ?? null),\n transactionID: TransactionIdSchema,\n })\n .transform(({ transactionHash, transactionID, ...rest }) => ({\n ...rest,\n transactionHash: transactionHash ?? null,\n transactionId: transactionID,\n }));\n\nexport type RelayerExecuteResponse = z.output<\n typeof RelayerExecuteResponseSchema\n>;\n\nexport const RelayerDeployedResponseSchema = z.object({\n deployed: z.boolean(),\n});\n\nexport type RelayerDeployedResponse = z.output<\n typeof RelayerDeployedResponseSchema\n>;\n\nexport const GaslessTransactionSchema = z\n .object({\n error_msg: z.string().nullish(),\n state: RelayerTransactionStateSchema,\n transaction_hash: z\n .union([z.literal(''), TxHashSchema])\n .transform((value) => (value === '' ? null : value)),\n transaction_id: TransactionIdSchema,\n })\n .transform(({ error_msg, transaction_hash, transaction_id, ...rest }) => ({\n ...rest,\n errorMsg: error_msg ?? null,\n transactionHash: transaction_hash ?? null,\n transactionId: transaction_id,\n }));\n\nexport type GaslessTransaction = z.output<typeof GaslessTransactionSchema>;\n"]}
package/dist/rfq.js CHANGED
@@ -1,2 +1,2 @@
1
- import {b as b$1}from'./chunk-HOD4LKZU.js';import {X as X$1,ra,Ha,xa,wa,Ia,$,aa,W as W$1,Ca,Aa,Ba,Ga}from'./chunk-VBHCYSM7.js';import {z as z$1}from'zod';var x=(o=>(o.Buy="BUY",o.Sell="SELL",o))(x||{}),O=(o=>(o.Yes="YES",o.No="NO",o))(O||{}),g=(o=>(o.Confirm="CONFIRM",o.Decline="DECLINE",o))(g||{}),T=(u=>(u.Matched="MATCHED",u.Mined="MINED",u.Confirmed="CONFIRMED",u.Retrying="RETRYING",u.Failed="FAILED",u))(T||{}),N=(o=>(o.Notional="notional",o.Shares="shares",o))(N||{}),M=(i=>(i.AddressMismatch="ADDRESS_MISMATCH",i.AllowanceValidationFailed="ALLOWANCE_VALIDATION_FAILED",i.BalanceValidationFailed="BALANCE_VALIDATION_FAILED",i.ContradictoryLegs="CONTRADICTORY_LEGS",i.ExpiredRfq="EXPIRED_RFQ",i.InvalidAcceptance="INVALID_ACCEPTANCE",i.InvalidConfirmation="INVALID_CONFIRMATION",i.InvalidExecutionResult="INVALID_EXECUTION_RESULT",i.InvalidIdentity="INVALID_IDENTITY",i.InvalidMessage="INVALID_MESSAGE",i.InvalidQuote="INVALID_QUOTE",i.InvalidRfq="INVALID_RFQ",i.InvalidRfqState="INVALID_RFQ_STATE",i.InvalidRole="INVALID_ROLE",i.InvalidSignature="INVALID_SIGNATURE",i.InternalError="INTERNAL_ERROR",i.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",i.MakerAlreadyResponded="MAKER_ALREADY_RESPONDED",i.MakerNotRequired="MAKER_NOT_REQUIRED",i.PreExecutionBalanceReservationFailed="PRE_EXECUTION_BALANCE_RESERVATION_FAILED",i.QuoteMismatch="QUOTE_MISMATCH",i.QuoteUnavailable="QUOTE_UNAVAILABLE",i.RateLimited="RATE_LIMITED",i.RequestFailed="REQUEST_FAILED",i.ServiceUnavailable="SERVICE_UNAVAILABLE",i.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",i.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",i.Unauthenticated="UNAUTHENTICATED",i.UnauthorizedRole="UNAUTHORIZED_ROLE",i.UnknownRfq="UNKNOWN_RFQ",i))(M||{}),f=z$1.enum(x),R=z$1.literal("YES"),D=z$1.enum(g),L=z$1.enum(T),G=z$1.enum(N),C=z$1.enum(M),U=z$1.object({id:ra,condition_id:X$1,position_ids:z$1.array(xa),slug:z$1.string(),title:z$1.string(),outcomes:z$1.array(z$1.string()),outcome_prices:z$1.array(Ha),image:z$1.string(),volume:z$1.number(),tags:z$1.array(z$1.string())}).superRefine((e,I)=>{e.outcomes.length!==2&&I.addIssue({code:"custom",message:`Expected binary combo market outcomes, received ${e.outcomes.length}.`,path:["outcomes"]}),e.position_ids.length!==e.outcomes.length&&I.addIssue({code:"custom",message:"Expected position_ids and outcomes to have matching lengths.",path:["position_ids"]}),e.outcome_prices.length!==e.outcomes.length&&I.addIssue({code:"custom",message:"Expected outcome_prices and outcomes to have matching lengths.",path:["outcome_prices"]});}).transform(e=>({conditionId:e.condition_id,id:e.id,image:e.image,outcomes:{yes:{label:e.outcomes[0],positionId:e.position_ids[0],price:e.outcome_prices[0]},no:{label:e.outcomes[1],positionId:e.position_ids[1],price:e.outcome_prices[1]}},slug:e.slug,tags:e.tags,title:e.title,volume:e.volume})),W=z$1.object({markets:z$1.array(U),next_cursor:wa.nullish()}).transform(e=>({markets:e.markets,nextCursor:e.next_cursor??void 0})),b=z$1.discriminatedUnion("unit",[z$1.object({unit:z$1.literal("notional"),value_e6:Ia}),z$1.object({unit:z$1.literal("shares"),value_e6:Ia})]).transform(e=>({unit:e.unit,value:e.value_e6})),Q=(n=>(n.Auth="auth",n.QuoteRequest="RFQ_REQUEST",n.QuoteAck="ACK_RFQ_QUOTE",n.QuoteCancelAck="ACK_RFQ_QUOTE_CANCEL",n.ConfirmationRequest="RFQ_CONFIRMATION_REQUEST",n.ConfirmationAck="ACK_RFQ_CONFIRMATION_RESPONSE",n.ExecutionUpdate="RFQ_EXECUTION_UPDATE",n.Trade="RFQ_TRADE",n.Error="RFQ_ERROR",n))(Q||{}),d=z$1.object({type:z$1.enum(Q)}),v=d.extend({type:z$1.literal("auth"),success:z$1.boolean(),address:$.optional(),role:z$1.string().optional(),error:z$1.string().optional()}),k=d.extend({type:z$1.literal("RFQ_REQUEST"),rfq_id:Aa,requestor_public_id:Ca,leg_position_ids:z$1.array(xa),condition_id:W$1,yes_position_id:xa,no_position_id:xa,direction:f,side:R,requested_size:b,submission_deadline:aa}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestorPublicId:e.requestor_public_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,submissionDeadline:e.submission_deadline,type:"quote_request",yesPositionId:e.yes_position_id})),F=d.extend({type:z$1.literal("ACK_RFQ_QUOTE"),rfq_id:Aa,quote_id:Ba}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_ack"})),z=d.extend({type:z$1.literal("ACK_RFQ_QUOTE_CANCEL"),rfq_id:Aa,quote_id:Ba}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_cancel_ack"})),P=d.extend({type:z$1.literal("RFQ_CONFIRMATION_REQUEST"),rfq_id:Aa,quote_id:Ba,signer_address:$,maker_address:$,signature_type:b$1,leg_position_ids:z$1.array(xa),condition_id:W$1,yes_position_id:xa,no_position_id:xa,direction:f,side:R,fill_size_e6:Ia,price_e6:Ia,confirm_by:aa}).transform(e=>({conditionId:e.condition_id,confirmBy:e.confirm_by,direction:e.direction,fillSize:e.fill_size_e6,legPositionIds:e.leg_position_ids,makerAddress:e.maker_address,noPositionId:e.no_position_id,price:e.price_e6,quoteId:e.quote_id,rfqId:e.rfq_id,side:e.side,signatureType:e.signature_type,signerAddress:e.signer_address,type:"confirmation_request",yesPositionId:e.yes_position_id})),V=d.extend({type:z$1.literal("ACK_RFQ_CONFIRMATION_RESPONSE"),rfq_id:Aa,quote_id:Ba,decision:D}).transform(e=>({decision:e.decision,quoteId:e.quote_id,rfqId:e.rfq_id,type:"confirmation_ack"})),B=d.extend({type:z$1.literal("RFQ_EXECUTION_UPDATE"),rfq_id:Aa,status:L,tx_hash:Ga.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.tx_hash===void 0?{}:{txHash:e.tx_hash},type:"execution_update"})),H=d.extend({type:z$1.literal("RFQ_TRADE"),rfq_id:Aa,requester_id:Ca,condition_id:W$1,leg_position_ids:z$1.array(xa),direction:f,side:R,price_e6:Ia,size_e6:Ia,executed_at:aa}).transform(e=>({conditionId:e.condition_id,direction:e.direction,executedAt:e.executed_at,legPositionIds:e.leg_position_ids,price:e.price_e6,requesterId:e.requester_id,rfqId:e.rfq_id,side:e.side,size:e.size_e6,type:"trade"})),K=d.extend({type:z$1.literal("RFQ_ERROR"),error_id:z$1.string().optional(),request_type:z$1.string().optional(),rfq_id:Aa.optional(),quote_id:Ba.optional(),code:C,error:z$1.string(),request:z$1.unknown().optional()}).transform(e=>({code:e.code,errorId:e.error_id,message:e.error,quoteId:e.quote_id,requestType:e.request_type,rfqId:e.rfq_id,type:"rfq_error"})),X=z$1.discriminatedUnion("type",[v,k,F,z,P,V,B,H,K]);export{U as ComboMarketSchema,W as ListComboMarketsResponseSchema,v as RfqAuthResponseMessageSchema,V as RfqConfirmationAckSchema,g as RfqConfirmationDecision,D as RfqConfirmationDecisionSchema,P as RfqConfirmationRequestSchema,x as RfqDirection,f as RfqDirectionSchema,M as RfqErrorCode,C as RfqErrorCodeSchema,K as RfqErrorMessageSchema,T as RfqExecutionStatus,L as RfqExecutionStatusSchema,B as RfqExecutionUpdateSchema,d as RfqKnownInboundMessageSchema,Q as RfqKnownInboundType,F as RfqQuoteAckSchema,z as RfqQuoteCancelAckSchema,k as RfqQuoteRequestSchema,X as RfqQuoterInboundMessageSchema,N as RfqRequestedSizeUnit,G as RfqRequestedSizeUnitSchema,O as RfqSide,R as RfqSideSchema,H as RfqTradeSchema};//# sourceMappingURL=rfq.js.map
1
+ import {b as b$1}from'./chunk-HOD4LKZU.js';import {Z,ta,Ja,za,ya,Ka,ba,ca,Y,Ea,Ca,Da,Ia}from'./chunk-GTLPG5HR.js';import {z as z$1}from'zod';var x=(o=>(o.Buy="BUY",o.Sell="SELL",o))(x||{}),O=(o=>(o.Yes="YES",o.No="NO",o))(O||{}),g=(o=>(o.Confirm="CONFIRM",o.Decline="DECLINE",o))(g||{}),T=(u=>(u.Matched="MATCHED",u.Mined="MINED",u.Confirmed="CONFIRMED",u.Retrying="RETRYING",u.Failed="FAILED",u))(T||{}),N=(o=>(o.Notional="notional",o.Shares="shares",o))(N||{}),M=(i=>(i.AddressMismatch="ADDRESS_MISMATCH",i.AllowanceValidationFailed="ALLOWANCE_VALIDATION_FAILED",i.BalanceValidationFailed="BALANCE_VALIDATION_FAILED",i.ContradictoryLegs="CONTRADICTORY_LEGS",i.ExpiredRfq="EXPIRED_RFQ",i.InvalidAcceptance="INVALID_ACCEPTANCE",i.InvalidConfirmation="INVALID_CONFIRMATION",i.InvalidExecutionResult="INVALID_EXECUTION_RESULT",i.InvalidIdentity="INVALID_IDENTITY",i.InvalidMessage="INVALID_MESSAGE",i.InvalidQuote="INVALID_QUOTE",i.InvalidRfq="INVALID_RFQ",i.InvalidRfqState="INVALID_RFQ_STATE",i.InvalidRole="INVALID_ROLE",i.InvalidSignature="INVALID_SIGNATURE",i.InternalError="INTERNAL_ERROR",i.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",i.MakerAlreadyResponded="MAKER_ALREADY_RESPONDED",i.MakerNotRequired="MAKER_NOT_REQUIRED",i.PreExecutionBalanceReservationFailed="PRE_EXECUTION_BALANCE_RESERVATION_FAILED",i.QuoteMismatch="QUOTE_MISMATCH",i.QuoteUnavailable="QUOTE_UNAVAILABLE",i.RateLimited="RATE_LIMITED",i.RequestFailed="REQUEST_FAILED",i.ServiceUnavailable="SERVICE_UNAVAILABLE",i.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",i.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",i.Unauthenticated="UNAUTHENTICATED",i.UnauthorizedRole="UNAUTHORIZED_ROLE",i.UnknownRfq="UNKNOWN_RFQ",i))(M||{}),f=z$1.enum(x),R=z$1.literal("YES"),D=z$1.enum(g),L=z$1.enum(T),G=z$1.enum(N),C=z$1.enum(M),U=z$1.object({id:ta,condition_id:Z,position_ids:z$1.array(za),slug:z$1.string(),title:z$1.string(),outcomes:z$1.array(z$1.string()),outcome_prices:z$1.array(Ja),image:z$1.string(),volume:z$1.number(),tags:z$1.array(z$1.string())}).superRefine((e,I)=>{e.outcomes.length!==2&&I.addIssue({code:"custom",message:`Expected binary combo market outcomes, received ${e.outcomes.length}.`,path:["outcomes"]}),e.position_ids.length!==e.outcomes.length&&I.addIssue({code:"custom",message:"Expected position_ids and outcomes to have matching lengths.",path:["position_ids"]}),e.outcome_prices.length!==e.outcomes.length&&I.addIssue({code:"custom",message:"Expected outcome_prices and outcomes to have matching lengths.",path:["outcome_prices"]});}).transform(e=>({conditionId:e.condition_id,id:e.id,image:e.image,outcomes:{yes:{label:e.outcomes[0],positionId:e.position_ids[0],price:e.outcome_prices[0]},no:{label:e.outcomes[1],positionId:e.position_ids[1],price:e.outcome_prices[1]}},slug:e.slug,tags:e.tags,title:e.title,volume:e.volume})),W=z$1.object({markets:z$1.array(U),next_cursor:ya.nullish()}).transform(e=>({markets:e.markets,nextCursor:e.next_cursor??void 0})),b=z$1.discriminatedUnion("unit",[z$1.object({unit:z$1.literal("notional"),value_e6:Ka}),z$1.object({unit:z$1.literal("shares"),value_e6:Ka})]).transform(e=>({unit:e.unit,value:e.value_e6})),Q=(n=>(n.Auth="auth",n.QuoteRequest="RFQ_REQUEST",n.QuoteAck="ACK_RFQ_QUOTE",n.QuoteCancelAck="ACK_RFQ_QUOTE_CANCEL",n.ConfirmationRequest="RFQ_CONFIRMATION_REQUEST",n.ConfirmationAck="ACK_RFQ_CONFIRMATION_RESPONSE",n.ExecutionUpdate="RFQ_EXECUTION_UPDATE",n.Trade="RFQ_TRADE",n.Error="RFQ_ERROR",n))(Q||{}),d=z$1.object({type:z$1.enum(Q)}),v=d.extend({type:z$1.literal("auth"),success:z$1.boolean(),address:ba.optional(),role:z$1.string().optional(),error:z$1.string().optional()}),k=d.extend({type:z$1.literal("RFQ_REQUEST"),rfq_id:Ca,requestor_public_id:Ea,leg_position_ids:z$1.array(za),condition_id:Y,yes_position_id:za,no_position_id:za,direction:f,side:R,requested_size:b,submission_deadline:ca}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestorPublicId:e.requestor_public_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,submissionDeadline:e.submission_deadline,type:"quote_request",yesPositionId:e.yes_position_id})),F=d.extend({type:z$1.literal("ACK_RFQ_QUOTE"),rfq_id:Ca,quote_id:Da}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_ack"})),z=d.extend({type:z$1.literal("ACK_RFQ_QUOTE_CANCEL"),rfq_id:Ca,quote_id:Da}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_cancel_ack"})),P=d.extend({type:z$1.literal("RFQ_CONFIRMATION_REQUEST"),rfq_id:Ca,quote_id:Da,signer_address:ba,maker_address:ba,signature_type:b$1,leg_position_ids:z$1.array(za),condition_id:Y,yes_position_id:za,no_position_id:za,direction:f,side:R,fill_size_e6:Ka,price_e6:Ka,confirm_by:ca}).transform(e=>({conditionId:e.condition_id,confirmBy:e.confirm_by,direction:e.direction,fillSize:e.fill_size_e6,legPositionIds:e.leg_position_ids,makerAddress:e.maker_address,noPositionId:e.no_position_id,price:e.price_e6,quoteId:e.quote_id,rfqId:e.rfq_id,side:e.side,signatureType:e.signature_type,signerAddress:e.signer_address,type:"confirmation_request",yesPositionId:e.yes_position_id})),V=d.extend({type:z$1.literal("ACK_RFQ_CONFIRMATION_RESPONSE"),rfq_id:Ca,quote_id:Da,decision:D}).transform(e=>({decision:e.decision,quoteId:e.quote_id,rfqId:e.rfq_id,type:"confirmation_ack"})),B=d.extend({type:z$1.literal("RFQ_EXECUTION_UPDATE"),rfq_id:Ca,status:L,tx_hash:Ia.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.tx_hash===void 0?{}:{txHash:e.tx_hash},type:"execution_update"})),H=d.extend({type:z$1.literal("RFQ_TRADE"),rfq_id:Ca,requester_id:Ea,condition_id:Y,leg_position_ids:z$1.array(za),direction:f,side:R,price_e6:Ka,size_e6:Ka,executed_at:ca}).transform(e=>({conditionId:e.condition_id,direction:e.direction,executedAt:e.executed_at,legPositionIds:e.leg_position_ids,price:e.price_e6,requesterId:e.requester_id,rfqId:e.rfq_id,side:e.side,size:e.size_e6,type:"trade"})),K=d.extend({type:z$1.literal("RFQ_ERROR"),error_id:z$1.string().optional(),request_type:z$1.string().optional(),rfq_id:Ca.optional(),quote_id:Da.optional(),code:C,error:z$1.string(),request:z$1.unknown().optional()}).transform(e=>({code:e.code,errorId:e.error_id,message:e.error,quoteId:e.quote_id,requestType:e.request_type,rfqId:e.rfq_id,type:"rfq_error"})),X=z$1.discriminatedUnion("type",[v,k,F,z,P,V,B,H,K]);export{U as ComboMarketSchema,W as ListComboMarketsResponseSchema,v as RfqAuthResponseMessageSchema,V as RfqConfirmationAckSchema,g as RfqConfirmationDecision,D as RfqConfirmationDecisionSchema,P as RfqConfirmationRequestSchema,x as RfqDirection,f as RfqDirectionSchema,M as RfqErrorCode,C as RfqErrorCodeSchema,K as RfqErrorMessageSchema,T as RfqExecutionStatus,L as RfqExecutionStatusSchema,B as RfqExecutionUpdateSchema,d as RfqKnownInboundMessageSchema,Q as RfqKnownInboundType,F as RfqQuoteAckSchema,z as RfqQuoteCancelAckSchema,k as RfqQuoteRequestSchema,X as RfqQuoterInboundMessageSchema,N as RfqRequestedSizeUnit,G as RfqRequestedSizeUnitSchema,O as RfqSide,R as RfqSideSchema,H as RfqTradeSchema};//# sourceMappingURL=rfq.js.map
2
2
  //# sourceMappingURL=rfq.js.map
package/dist/rfq.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rfq.ts"],"names":["RfqDirection","RfqSide","RfqConfirmationDecision","RfqExecutionStatus","RfqRequestedSizeUnit","RfqErrorCode","RfqDirectionSchema","z","RfqSideSchema","RfqConfirmationDecisionSchema","RfqExecutionStatusSchema","RfqRequestedSizeUnitSchema","RfqErrorCodeSchema","ComboMarketSchema","MarketIdSchema","CtfConditionIdSchema","PositionIdSchema","DecimalStringSchema","market","context","ListComboMarketsResponseSchema","PaginationCursorSchema","response","RfqRequestedSizeSchema","E6BigIntStringToDecimalStringSchema","size","RfqKnownInboundType","RfqKnownInboundMessageSchema","RfqAuthResponseMessageSchema","EvmAddressSchema","RfqQuoteRequestSchema","RfqIdSchema","RfqRequestorPublicIdSchema","ComboConditionIdSchema","EpochMillisecondsSchema","message","RfqQuoteAckSchema","RfqQuoteIdSchema","RfqQuoteCancelAckSchema","RfqConfirmationRequestSchema","SignatureTypeSchema","RfqConfirmationAckSchema","RfqExecutionUpdateSchema","TxHashSchema","Rf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CACf,IAAA,CAAM,WACR,CAAA,CAAE,CAAA,CAIWW,CAAAA,CAAgCvC,IAAE,kBAAA,CAAmB,MAAA,CAAQ,CACxEqB,CAAAA,CACAE,CAAAA,CACAM,CAAAA,CACAE,CAAAA,CACAC,CAAAA,CACAE,CAAAA,CACAC,CAAAA,CACAE,CAAAA,CACAC,CACF,CAAC","file":"rfq.js","sourcesContent":["import type {\n Erc1271Signature,\n EvmSignature,\n HexString,\n} from '@polymarket/types';\nimport { z } from 'zod';\nimport { type SignatureType, SignatureTypeSchema } from './clob/signature-type';\nimport type {\n BaseUnits,\n CtfConditionId,\n DecimalString,\n EvmAddress,\n MarketId,\n TokenId,\n} from './shared';\nimport {\n ComboConditionIdSchema,\n CtfConditionIdSchema,\n DecimalStringSchema,\n E6BigIntStringToDecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n MarketIdSchema,\n type OrderSide,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\n type RfqId,\n RfqIdSchema,\n type RfqQuoteId,\n RfqQuoteIdSchema,\n RfqRequestorPublicIdSchema,\n TxHashSchema,\n} from './shared';\n\nexport type {\n RfqId,\n RfqQuoteId,\n RfqRequestorPublicId,\n} from './shared';\n\nexport enum RfqDirection {\n Buy = 'BUY',\n Sell = 'SELL',\n}\n\nexport enum RfqSide {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport enum RfqConfirmationDecision {\n Confirm = 'CONFIRM',\n Decline = 'DECLINE',\n}\n\nexport enum RfqExecutionStatus {\n Matched = 'MATCHED',\n Mined = 'MINED',\n Confirmed = 'CONFIRMED',\n Retrying = 'RETRYING',\n Failed = 'FAILED',\n}\n\nexport enum RfqRequestedSizeUnit {\n Notional = 'notional',\n Shares = 'shares',\n}\n\nexport enum RfqErrorCode {\n AddressMismatch = 'ADDRESS_MISMATCH',\n AllowanceValidationFailed = 'ALLOWANCE_VALIDATION_FAILED',\n BalanceValidationFailed = 'BALANCE_VALIDATION_FAILED',\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n ExpiredRfq = 'EXPIRED_RFQ',\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n InvalidConfirmation = 'INVALID_CONFIRMATION',\n InvalidExecutionResult = 'INVALID_EXECUTION_RESULT',\n InvalidIdentity = 'INVALID_IDENTITY',\n InvalidMessage = 'INVALID_MESSAGE',\n InvalidQuote = 'INVALID_QUOTE',\n InvalidRfq = 'INVALID_RFQ',\n InvalidRfqState = 'INVALID_RFQ_STATE',\n InvalidRole = 'INVALID_ROLE',\n InvalidSignature = 'INVALID_SIGNATURE',\n InternalError = 'INTERNAL_ERROR',\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n MakerAlreadyResponded = 'MAKER_ALREADY_RESPONDED',\n MakerNotRequired = 'MAKER_NOT_REQUIRED',\n PreExecutionBalanceReservationFailed = 'PRE_EXECUTION_BALANCE_RESERVATION_FAILED',\n QuoteMismatch = 'QUOTE_MISMATCH',\n QuoteUnavailable = 'QUOTE_UNAVAILABLE',\n RateLimited = 'RATE_LIMITED',\n RequestFailed = 'REQUEST_FAILED',\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n Unauthenticated = 'UNAUTHENTICATED',\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n UnknownRfq = 'UNKNOWN_RFQ',\n}\n\nexport const RfqDirectionSchema = z.enum(RfqDirection);\nexport const RfqSideSchema = z.literal(RfqSide.Yes);\nexport const RfqConfirmationDecisionSchema = z.enum(RfqConfirmationDecision);\nexport const RfqExecutionStatusSchema = z.enum(RfqExecutionStatus);\nexport const RfqRequestedSizeUnitSchema = z.enum(RfqRequestedSizeUnit);\nexport const RfqErrorCodeSchema = z.enum(RfqErrorCode);\n\nexport type ComboMarket = {\n id: MarketId;\n conditionId: CtfConditionId;\n slug: string;\n title: string;\n outcomes: ComboMarketOutcomes;\n image: string;\n volume: number;\n tags: string[];\n};\n\nexport type ComboMarketOutcome = {\n label: string;\n positionId: PositionId;\n price: DecimalString;\n};\n\nexport type ComboMarketOutcomes = {\n yes: ComboMarketOutcome;\n no: ComboMarketOutcome;\n};\n\nexport const ComboMarketSchema = z\n .object({\n id: MarketIdSchema,\n condition_id: CtfConditionIdSchema,\n position_ids: z.array(PositionIdSchema),\n slug: z.string(),\n title: z.string(),\n outcomes: z.array(z.string()),\n outcome_prices: z.array(DecimalStringSchema),\n image: z.string(),\n volume: z.number(),\n tags: z.array(z.string()),\n })\n .superRefine((market, context) => {\n if (market.outcomes.length !== 2) {\n context.addIssue({\n code: 'custom',\n message: `Expected binary combo market outcomes, received ${market.outcomes.length}.`,\n path: ['outcomes'],\n });\n }\n\n if (market.position_ids.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message: 'Expected position_ids and outcomes to have matching lengths.',\n path: ['position_ids'],\n });\n }\n\n if (market.outcome_prices.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message:\n 'Expected outcome_prices and outcomes to have matching lengths.',\n path: ['outcome_prices'],\n });\n }\n })\n .transform(\n (market): ComboMarket => ({\n conditionId: market.condition_id,\n id: market.id,\n image: market.image,\n outcomes: {\n yes: {\n label: market.outcomes[0] as string,\n positionId: market.position_ids[0] as PositionId,\n price: market.outcome_prices[0] as DecimalString,\n },\n no: {\n label: market.outcomes[1] as string,\n positionId: market.position_ids[1] as PositionId,\n price: market.outcome_prices[1] as DecimalString,\n },\n },\n slug: market.slug,\n tags: market.tags,\n title: market.title,\n volume: market.volume,\n }),\n );\n\nexport const ListComboMarketsResponseSchema = z\n .object({\n markets: z.array(ComboMarketSchema),\n next_cursor: PaginationCursorSchema.nullish(),\n })\n .transform((response) => ({\n markets: response.markets,\n nextCursor: response.next_cursor ?? undefined,\n }));\n\nexport type ListComboMarketsResponse = z.infer<\n typeof ListComboMarketsResponseSchema\n>;\n\nexport type RfqRequestedSize =\n | {\n unit: RfqRequestedSizeUnit.Notional;\n value: DecimalString;\n }\n | {\n unit: RfqRequestedSizeUnit.Shares;\n value: DecimalString;\n };\n\nconst RfqRequestedSizeSchema = z\n .discriminatedUnion('unit', [\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Notional),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Shares),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n ])\n .transform(\n (size): RfqRequestedSize => ({\n unit: size.unit,\n value: size.value_e6,\n }),\n ) satisfies z.ZodType<RfqRequestedSize>;\n\nexport type RfqSignedOrder = {\n salt: string;\n maker: EvmAddress;\n signer: EvmAddress;\n tokenId: PositionId | TokenId;\n makerAmount: BaseUnits;\n takerAmount: BaseUnits;\n side: RfqOrderSide;\n signatureType: SignatureType;\n timestamp: string;\n builder?: HexString;\n expiration?: string;\n metadata?: HexString;\n signature: EvmSignature | Erc1271Signature;\n};\n\nexport type RfqOrderSide = OrderSide | 0 | 1;\n\nexport type RfqAuthMessage = {\n type: 'auth';\n auth: {\n apiKey: string;\n passphrase: string;\n secret: string;\n };\n identity: {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n };\n};\n\nexport enum RfqKnownInboundType {\n Auth = 'auth',\n QuoteRequest = 'RFQ_REQUEST',\n QuoteAck = 'ACK_RFQ_QUOTE',\n QuoteCancelAck = 'ACK_RFQ_QUOTE_CANCEL',\n ConfirmationRequest = 'RFQ_CONFIRMATION_REQUEST',\n ConfirmationAck = 'ACK_RFQ_CONFIRMATION_RESPONSE',\n ExecutionUpdate = 'RFQ_EXECUTION_UPDATE',\n Trade = 'RFQ_TRADE',\n Error = 'RFQ_ERROR',\n}\n\nexport const RfqKnownInboundMessageSchema = z.object({\n type: z.enum(RfqKnownInboundType),\n});\n\nexport const RfqAuthResponseMessageSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.Auth),\n success: z.boolean(),\n address: EvmAddressSchema.optional(),\n role: z.string().optional(),\n error: z.string().optional(),\n },\n);\n\nexport type RfqAuthResponseMessage = z.infer<\n typeof RfqAuthResponseMessageSchema\n>;\n\nexport const RfqQuoteRequestSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteRequest),\n rfq_id: RfqIdSchema,\n requestor_public_id: RfqRequestorPublicIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n requested_size: RfqRequestedSizeSchema,\n submission_deadline: EpochMillisecondsSchema,\n}).transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n legPositionIds: message.leg_position_ids,\n noPositionId: message.no_position_id,\n requestorPublicId: message.requestor_public_id,\n requestedSize: message.requested_size,\n rfqId: message.rfq_id,\n side: message.side,\n submissionDeadline: message.submission_deadline,\n type: 'quote_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;\n\nexport type RfqQuoteMessage = {\n type: 'RFQ_QUOTE';\n rfq_id: RfqId;\n price_e6: string;\n size_e6: string;\n signed_order: RfqSignedOrder;\n};\n\nexport type RfqQuoteCancelMessage = {\n type: 'RFQ_QUOTE_CANCEL';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n};\n\nexport const RfqQuoteAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_ack' as const,\n}));\n\nexport type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;\n\nexport const RfqQuoteCancelAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteCancelAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_cancel_ack' as const,\n}));\n\nexport type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;\n\nexport const RfqConfirmationRequestSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.ConfirmationRequest),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n signer_address: EvmAddressSchema,\n maker_address: EvmAddressSchema,\n signature_type: SignatureTypeSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n fill_size_e6: E6BigIntStringToDecimalStringSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n confirm_by: EpochMillisecondsSchema,\n },\n).transform((message) => ({\n conditionId: message.condition_id,\n confirmBy: message.confirm_by,\n direction: message.direction,\n fillSize: message.fill_size_e6,\n legPositionIds: message.leg_position_ids,\n makerAddress: message.maker_address,\n noPositionId: message.no_position_id,\n price: message.price_e6,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n side: message.side,\n signatureType: message.signature_type,\n signerAddress: message.signer_address,\n type: 'confirmation_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqConfirmationRequest = z.infer<\n typeof RfqConfirmationRequestSchema\n>;\n\nexport type RfqConfirmationResponseMessage = {\n type: 'RFQ_CONFIRMATION_RESPONSE';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n decision: RfqConfirmationDecision;\n};\n\nexport const RfqConfirmationAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ConfirmationAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n decision: RfqConfirmationDecisionSchema,\n}).transform((message) => ({\n decision: message.decision,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'confirmation_ack' as const,\n}));\n\nexport type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;\n\nexport const RfqExecutionUpdateSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ExecutionUpdate),\n rfq_id: RfqIdSchema,\n status: RfqExecutionStatusSchema,\n tx_hash: TxHashSchema.optional(),\n}).transform((message) => ({\n rfqId: message.rfq_id,\n status: message.status,\n ...(message.tx_hash === undefined ? {} : { txHash: message.tx_hash }),\n type: 'execution_update' as const,\n}));\n\nexport type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;\n\nexport const RfqTradeSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.Trade),\n rfq_id: RfqIdSchema,\n requester_id: RfqRequestorPublicIdSchema,\n condition_id: ComboConditionIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n size_e6: E6BigIntStringToDecimalStringSchema,\n executed_at: EpochMillisecondsSchema,\n}).transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n executedAt: message.executed_at,\n legPositionIds: message.leg_position_ids,\n price: message.price_e6,\n requesterId: message.requester_id,\n rfqId: message.rfq_id,\n side: message.side,\n size: message.size_e6,\n type: 'trade' as const,\n}));\n\nexport type RfqTrade = z.infer<typeof RfqTradeSchema>;\n\nexport const RfqErrorMessageSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.Error),\n error_id: z.string().optional(),\n request_type: z.string().optional(),\n rfq_id: RfqIdSchema.optional(),\n quote_id: RfqQuoteIdSchema.optional(),\n code: RfqErrorCodeSchema,\n error: z.string(),\n request: z.unknown().optional(),\n}).transform((message) => ({\n code: message.code,\n errorId: message.error_id,\n message: message.error,\n quoteId: message.quote_id,\n requestType: message.request_type,\n rfqId: message.rfq_id,\n type: 'rfq_error' as const,\n}));\n\nexport type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;\n\nexport const RfqQuoterInboundMessageSchema = z.discriminatedUnion('type', [\n RfqAuthResponseMessageSchema,\n RfqQuoteRequestSchema,\n RfqQuoteAckSchema,\n RfqQuoteCancelAckSchema,\n RfqConfirmationRequestSchema,\n RfqConfirmationAckSchema,\n RfqExecutionUpdateSchema,\n RfqTradeSchema,\n RfqErrorMessageSchema,\n]);\n\nexport type RfqQuoterInboundMessage = z.infer<\n typeof RfqQuoterInboundMessageSchema\n>;\n\nexport type RfqQuoterOutboundMessage =\n | RfqQuoteMessage\n | RfqQuoteCancelMessage\n | RfqConfirmationResponseMessage;\n"]}
1
+ {"version":3,"sources":["../src/rfq.ts"],"names":["RfqDirection","RfqSide","RfqConfirmationDecision","RfqExecutionStatus","RfqRequestedSizeUnit","RfqErrorCode","RfqDirectionSchema","z","RfqSideSchema","RfqConfirmationDecisionSchema","RfqExecutionStatusSchema","RfqRequestedSizeUnitSchema","RfqErrorCodeSchema","ComboMarketSchema","MarketIdSchema","CtfConditionIdSchema","PositionIdSchema","DecimalStringSchema","market","context","ListComboMarketsResponseSchema","PaginationCursorSchema","response","RfqRequestedSizeSchema","E6BigIntStringToDecimalStringSchema","size","RfqKnownInboundType","RfqKnownInboundMessageSchema","RfqAuthResponseMessageSchema","EvmAddressSchema","RfqQuoteRequestSchema","RfqIdSchema","RfqRequestorPublicIdSchema","ComboConditionIdSchema","EpochMillisecondsSchema","message","RfqQuoteAckSchema","RfqQuoteIdSchema","RfqQuoteCancelAckSchema","RfqConfirmationRequestSchema","SignatureTypeSchema","RfqConfirmationAckSchema","RfqExecutionUpdateSchema","TxHashSchema","RfqTradeSchema","RfqErrorMessageSchema","RfqQuoterInboundMessageSchema"],"mappings":"6IAyCO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,GAAA,CAAM,KAAA,CACNA,CAA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,CACAE,CAAAA,CACAC,CAAAA,CACAE,CAAAA,CACAC,CAAAA,CACAE,CAAAA,CACAC,CACF,CAAC","file":"rfq.js","sourcesContent":["import type {\n Erc1271Signature,\n EvmSignature,\n HexString,\n} from '@polymarket/types';\nimport { z } from 'zod';\nimport { type SignatureType, SignatureTypeSchema } from './clob/signature-type';\nimport type {\n BaseUnits,\n CtfConditionId,\n DecimalString,\n EvmAddress,\n MarketId,\n TokenId,\n} from './shared';\nimport {\n ComboConditionIdSchema,\n CtfConditionIdSchema,\n DecimalStringSchema,\n E6BigIntStringToDecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n MarketIdSchema,\n type OrderSide,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\n type RfqId,\n RfqIdSchema,\n type RfqQuoteId,\n RfqQuoteIdSchema,\n RfqRequestorPublicIdSchema,\n TxHashSchema,\n} from './shared';\n\nexport type {\n RfqId,\n RfqQuoteId,\n RfqRequestorPublicId,\n} from './shared';\n\nexport enum RfqDirection {\n Buy = 'BUY',\n Sell = 'SELL',\n}\n\nexport enum RfqSide {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport enum RfqConfirmationDecision {\n Confirm = 'CONFIRM',\n Decline = 'DECLINE',\n}\n\nexport enum RfqExecutionStatus {\n Matched = 'MATCHED',\n Mined = 'MINED',\n Confirmed = 'CONFIRMED',\n Retrying = 'RETRYING',\n Failed = 'FAILED',\n}\n\nexport enum RfqRequestedSizeUnit {\n Notional = 'notional',\n Shares = 'shares',\n}\n\nexport enum RfqErrorCode {\n AddressMismatch = 'ADDRESS_MISMATCH',\n AllowanceValidationFailed = 'ALLOWANCE_VALIDATION_FAILED',\n BalanceValidationFailed = 'BALANCE_VALIDATION_FAILED',\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n ExpiredRfq = 'EXPIRED_RFQ',\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n InvalidConfirmation = 'INVALID_CONFIRMATION',\n InvalidExecutionResult = 'INVALID_EXECUTION_RESULT',\n InvalidIdentity = 'INVALID_IDENTITY',\n InvalidMessage = 'INVALID_MESSAGE',\n InvalidQuote = 'INVALID_QUOTE',\n InvalidRfq = 'INVALID_RFQ',\n InvalidRfqState = 'INVALID_RFQ_STATE',\n InvalidRole = 'INVALID_ROLE',\n InvalidSignature = 'INVALID_SIGNATURE',\n InternalError = 'INTERNAL_ERROR',\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n MakerAlreadyResponded = 'MAKER_ALREADY_RESPONDED',\n MakerNotRequired = 'MAKER_NOT_REQUIRED',\n PreExecutionBalanceReservationFailed = 'PRE_EXECUTION_BALANCE_RESERVATION_FAILED',\n QuoteMismatch = 'QUOTE_MISMATCH',\n QuoteUnavailable = 'QUOTE_UNAVAILABLE',\n RateLimited = 'RATE_LIMITED',\n RequestFailed = 'REQUEST_FAILED',\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n Unauthenticated = 'UNAUTHENTICATED',\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n UnknownRfq = 'UNKNOWN_RFQ',\n}\n\nexport const RfqDirectionSchema = z.enum(RfqDirection);\nexport const RfqSideSchema = z.literal(RfqSide.Yes);\nexport const RfqConfirmationDecisionSchema = z.enum(RfqConfirmationDecision);\nexport const RfqExecutionStatusSchema = z.enum(RfqExecutionStatus);\nexport const RfqRequestedSizeUnitSchema = z.enum(RfqRequestedSizeUnit);\nexport const RfqErrorCodeSchema = z.enum(RfqErrorCode);\n\nexport type ComboMarket = {\n id: MarketId;\n conditionId: CtfConditionId;\n slug: string;\n title: string;\n outcomes: ComboMarketOutcomes;\n image: string;\n volume: number;\n tags: string[];\n};\n\nexport type ComboMarketOutcome = {\n label: string;\n positionId: PositionId;\n price: DecimalString;\n};\n\nexport type ComboMarketOutcomes = {\n yes: ComboMarketOutcome;\n no: ComboMarketOutcome;\n};\n\nexport const ComboMarketSchema = z\n .object({\n id: MarketIdSchema,\n condition_id: CtfConditionIdSchema,\n position_ids: z.array(PositionIdSchema),\n slug: z.string(),\n title: z.string(),\n outcomes: z.array(z.string()),\n outcome_prices: z.array(DecimalStringSchema),\n image: z.string(),\n volume: z.number(),\n tags: z.array(z.string()),\n })\n .superRefine((market, context) => {\n if (market.outcomes.length !== 2) {\n context.addIssue({\n code: 'custom',\n message: `Expected binary combo market outcomes, received ${market.outcomes.length}.`,\n path: ['outcomes'],\n });\n }\n\n if (market.position_ids.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message: 'Expected position_ids and outcomes to have matching lengths.',\n path: ['position_ids'],\n });\n }\n\n if (market.outcome_prices.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message:\n 'Expected outcome_prices and outcomes to have matching lengths.',\n path: ['outcome_prices'],\n });\n }\n })\n .transform(\n (market): ComboMarket => ({\n conditionId: market.condition_id,\n id: market.id,\n image: market.image,\n outcomes: {\n yes: {\n label: market.outcomes[0] as string,\n positionId: market.position_ids[0] as PositionId,\n price: market.outcome_prices[0] as DecimalString,\n },\n no: {\n label: market.outcomes[1] as string,\n positionId: market.position_ids[1] as PositionId,\n price: market.outcome_prices[1] as DecimalString,\n },\n },\n slug: market.slug,\n tags: market.tags,\n title: market.title,\n volume: market.volume,\n }),\n );\n\nexport const ListComboMarketsResponseSchema = z\n .object({\n markets: z.array(ComboMarketSchema),\n next_cursor: PaginationCursorSchema.nullish(),\n })\n .transform((response) => ({\n markets: response.markets,\n nextCursor: response.next_cursor ?? undefined,\n }));\n\nexport type ListComboMarketsResponse = z.infer<\n typeof ListComboMarketsResponseSchema\n>;\n\nexport type RfqRequestedSize =\n | {\n unit: RfqRequestedSizeUnit.Notional;\n value: DecimalString;\n }\n | {\n unit: RfqRequestedSizeUnit.Shares;\n value: DecimalString;\n };\n\nconst RfqRequestedSizeSchema = z\n .discriminatedUnion('unit', [\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Notional),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Shares),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n ])\n .transform(\n (size): RfqRequestedSize => ({\n unit: size.unit,\n value: size.value_e6,\n }),\n ) satisfies z.ZodType<RfqRequestedSize>;\n\nexport type RfqSignedOrder = {\n salt: string;\n maker: EvmAddress;\n signer: EvmAddress;\n tokenId: PositionId | TokenId;\n makerAmount: BaseUnits;\n takerAmount: BaseUnits;\n side: RfqOrderSide;\n signatureType: SignatureType;\n timestamp: string;\n builder?: HexString;\n expiration?: string;\n metadata?: HexString;\n signature: EvmSignature | Erc1271Signature;\n};\n\nexport type RfqOrderSide = OrderSide | 0 | 1;\n\nexport type RfqAuthMessage = {\n type: 'auth';\n auth: {\n apiKey: string;\n passphrase: string;\n secret: string;\n };\n identity: {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n };\n};\n\nexport enum RfqKnownInboundType {\n Auth = 'auth',\n QuoteRequest = 'RFQ_REQUEST',\n QuoteAck = 'ACK_RFQ_QUOTE',\n QuoteCancelAck = 'ACK_RFQ_QUOTE_CANCEL',\n ConfirmationRequest = 'RFQ_CONFIRMATION_REQUEST',\n ConfirmationAck = 'ACK_RFQ_CONFIRMATION_RESPONSE',\n ExecutionUpdate = 'RFQ_EXECUTION_UPDATE',\n Trade = 'RFQ_TRADE',\n Error = 'RFQ_ERROR',\n}\n\nexport const RfqKnownInboundMessageSchema = z.object({\n type: z.enum(RfqKnownInboundType),\n});\n\nexport const RfqAuthResponseMessageSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.Auth),\n success: z.boolean(),\n address: EvmAddressSchema.optional(),\n role: z.string().optional(),\n error: z.string().optional(),\n },\n);\n\nexport type RfqAuthResponseMessage = z.infer<\n typeof RfqAuthResponseMessageSchema\n>;\n\nexport const RfqQuoteRequestSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteRequest),\n rfq_id: RfqIdSchema,\n requestor_public_id: RfqRequestorPublicIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n requested_size: RfqRequestedSizeSchema,\n submission_deadline: EpochMillisecondsSchema,\n}).transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n legPositionIds: message.leg_position_ids,\n noPositionId: message.no_position_id,\n requestorPublicId: message.requestor_public_id,\n requestedSize: message.requested_size,\n rfqId: message.rfq_id,\n side: message.side,\n submissionDeadline: message.submission_deadline,\n type: 'quote_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;\n\nexport type RfqQuoteMessage = {\n type: 'RFQ_QUOTE';\n rfq_id: RfqId;\n price_e6: string;\n size_e6: string;\n signed_order: RfqSignedOrder;\n};\n\nexport type RfqQuoteCancelMessage = {\n type: 'RFQ_QUOTE_CANCEL';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n};\n\nexport const RfqQuoteAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_ack' as const,\n}));\n\nexport type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;\n\nexport const RfqQuoteCancelAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteCancelAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_cancel_ack' as const,\n}));\n\nexport type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;\n\nexport const RfqConfirmationRequestSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.ConfirmationRequest),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n signer_address: EvmAddressSchema,\n maker_address: EvmAddressSchema,\n signature_type: SignatureTypeSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n fill_size_e6: E6BigIntStringToDecimalStringSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n confirm_by: EpochMillisecondsSchema,\n },\n).transform((message) => ({\n conditionId: message.condition_id,\n confirmBy: message.confirm_by,\n direction: message.direction,\n fillSize: message.fill_size_e6,\n legPositionIds: message.leg_position_ids,\n makerAddress: message.maker_address,\n noPositionId: message.no_position_id,\n price: message.price_e6,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n side: message.side,\n signatureType: message.signature_type,\n signerAddress: message.signer_address,\n type: 'confirmation_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqConfirmationRequest = z.infer<\n typeof RfqConfirmationRequestSchema\n>;\n\nexport type RfqConfirmationResponseMessage = {\n type: 'RFQ_CONFIRMATION_RESPONSE';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n decision: RfqConfirmationDecision;\n};\n\nexport const RfqConfirmationAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ConfirmationAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n decision: RfqConfirmationDecisionSchema,\n}).transform((message) => ({\n decision: message.decision,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'confirmation_ack' as const,\n}));\n\nexport type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;\n\nexport const RfqExecutionUpdateSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ExecutionUpdate),\n rfq_id: RfqIdSchema,\n status: RfqExecutionStatusSchema,\n tx_hash: TxHashSchema.optional(),\n}).transform((message) => ({\n rfqId: message.rfq_id,\n status: message.status,\n ...(message.tx_hash === undefined ? {} : { txHash: message.tx_hash }),\n type: 'execution_update' as const,\n}));\n\nexport type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;\n\nexport const RfqTradeSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.Trade),\n rfq_id: RfqIdSchema,\n requester_id: RfqRequestorPublicIdSchema,\n condition_id: ComboConditionIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n size_e6: E6BigIntStringToDecimalStringSchema,\n executed_at: EpochMillisecondsSchema,\n}).transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n executedAt: message.executed_at,\n legPositionIds: message.leg_position_ids,\n price: message.price_e6,\n requesterId: message.requester_id,\n rfqId: message.rfq_id,\n side: message.side,\n size: message.size_e6,\n type: 'trade' as const,\n}));\n\nexport type RfqTrade = z.infer<typeof RfqTradeSchema>;\n\nexport const RfqErrorMessageSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.Error),\n error_id: z.string().optional(),\n request_type: z.string().optional(),\n rfq_id: RfqIdSchema.optional(),\n quote_id: RfqQuoteIdSchema.optional(),\n code: RfqErrorCodeSchema,\n error: z.string(),\n request: z.unknown().optional(),\n}).transform((message) => ({\n code: message.code,\n errorId: message.error_id,\n message: message.error,\n quoteId: message.quote_id,\n requestType: message.request_type,\n rfqId: message.rfq_id,\n type: 'rfq_error' as const,\n}));\n\nexport type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;\n\nexport const RfqQuoterInboundMessageSchema = z.discriminatedUnion('type', [\n RfqAuthResponseMessageSchema,\n RfqQuoteRequestSchema,\n RfqQuoteAckSchema,\n RfqQuoteCancelAckSchema,\n RfqConfirmationRequestSchema,\n RfqConfirmationAckSchema,\n RfqExecutionUpdateSchema,\n RfqTradeSchema,\n RfqErrorMessageSchema,\n]);\n\nexport type RfqQuoterInboundMessage = z.infer<\n typeof RfqQuoterInboundMessageSchema\n>;\n\nexport type RfqQuoterOutboundMessage =\n | RfqQuoteMessage\n | RfqQuoteCancelMessage\n | RfqConfirmationResponseMessage;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { TokenId, DecimalString, EpochMilliseconds, CtfConditionId, IsoDateTimeString, OrderSide, OrderType, BaseUnits, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId } from '../index.js';
2
2
  import { z } from 'zod';
3
- import { P as PerpsInstrumentId, N as PerpsKlineInterval, b as PerpsDepositStatus, i as PerpsTradeId, R as PerpsOrderId, j as PerpsSide, a0 as PerpsTimeInForce, U as PerpsOrderStatus, a2 as PerpsTpSlKind, a6 as PerpsTpSlScope, c as PerpsWithdrawalId, d as PerpsWithdrawalStatus } from '../orders-DHP1WzKt.js';
3
+ import { P as PerpsInstrumentId, Q as PerpsKlineInterval, b as PerpsDepositStatus, i as PerpsTradeId, T as PerpsOrderId, j as PerpsSide, a2 as PerpsTimeInForce, W as PerpsOrderStatus, a4 as PerpsTpSlKind, a8 as PerpsTpSlScope, c as PerpsWithdrawalId, d as PerpsWithdrawalStatus } from '../orders-Uj0Gkvd4.js';
4
4
  import * as _polymarket_types from '@polymarket/types';
5
5
  import { R as ReactionType } from '../comment-C-jBbhp7.js';
6
6
 
@@ -2476,6 +2476,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2476
2476
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2477
2477
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
2478
2478
  po: z.ZodBoolean;
2479
+ ro: z.ZodBoolean;
2479
2480
  status: z.ZodEnum<typeof PerpsOrderStatus>;
2480
2481
  rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2481
2482
  fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -2512,6 +2513,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2512
2513
  quantity: DecimalString;
2513
2514
  timeInForce: PerpsTimeInForce;
2514
2515
  postOnly: boolean;
2516
+ reduceOnly: boolean;
2515
2517
  status: PerpsOrderStatus;
2516
2518
  restingQuantity: DecimalString;
2517
2519
  filledQuantity: DecimalString;
@@ -2534,6 +2536,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2534
2536
  qty: DecimalString;
2535
2537
  tif: PerpsTimeInForce;
2536
2538
  po: boolean;
2539
+ ro: boolean;
2537
2540
  status: PerpsOrderStatus;
2538
2541
  rest: DecimalString;
2539
2542
  fill: DecimalString;
@@ -2562,6 +2565,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2562
2565
  quantity: DecimalString;
2563
2566
  timeInForce: PerpsTimeInForce;
2564
2567
  postOnly: boolean;
2568
+ reduceOnly: boolean;
2565
2569
  status: PerpsOrderStatus;
2566
2570
  restingQuantity: DecimalString;
2567
2571
  filledQuantity: DecimalString;
@@ -2589,6 +2593,7 @@ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2589
2593
  quantity: DecimalString;
2590
2594
  timeInForce: PerpsTimeInForce;
2591
2595
  postOnly: boolean;
2596
+ reduceOnly: boolean;
2592
2597
  status: PerpsOrderStatus;
2593
2598
  restingQuantity: DecimalString;
2594
2599
  filledQuantity: DecimalString;
@@ -3120,6 +3125,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3120
3125
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3121
3126
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
3122
3127
  po: z.ZodBoolean;
3128
+ ro: z.ZodBoolean;
3123
3129
  status: z.ZodEnum<typeof PerpsOrderStatus>;
3124
3130
  rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3125
3131
  fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -3156,6 +3162,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3156
3162
  quantity: DecimalString;
3157
3163
  timeInForce: PerpsTimeInForce;
3158
3164
  postOnly: boolean;
3165
+ reduceOnly: boolean;
3159
3166
  status: PerpsOrderStatus;
3160
3167
  restingQuantity: DecimalString;
3161
3168
  filledQuantity: DecimalString;
@@ -3178,6 +3185,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3178
3185
  qty: DecimalString;
3179
3186
  tif: PerpsTimeInForce;
3180
3187
  po: boolean;
3188
+ ro: boolean;
3181
3189
  status: PerpsOrderStatus;
3182
3190
  rest: DecimalString;
3183
3191
  fill: DecimalString;
@@ -3206,6 +3214,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3206
3214
  quantity: DecimalString;
3207
3215
  timeInForce: PerpsTimeInForce;
3208
3216
  postOnly: boolean;
3217
+ reduceOnly: boolean;
3209
3218
  status: PerpsOrderStatus;
3210
3219
  restingQuantity: DecimalString;
3211
3220
  filledQuantity: DecimalString;
@@ -3233,6 +3242,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3233
3242
  quantity: DecimalString;
3234
3243
  timeInForce: PerpsTimeInForce;
3235
3244
  postOnly: boolean;
3245
+ reduceOnly: boolean;
3236
3246
  status: PerpsOrderStatus;
3237
3247
  restingQuantity: DecimalString;
3238
3248
  filledQuantity: DecimalString;
@@ -1,2 +1,2 @@
1
- import {N,K,O,P}from'../chunk-GYP7YNXL.js';import {Ca,Aa,ya,ra,va as va$1,sa,b,a,L,R,Va,Ya,V,ga as ga$1,ka}from'../chunk-CCTEF2UT.js';import {ua,Ha,w,Ea,ca,ga,X as X$1,va,aa,ta,Ja}from'../chunk-VBHCYSM7.js';import {z}from'zod';var k=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,ua),U=(l=>(l.Matched="TRADE_STATUS_MATCHED",l.MatchedNotBroadcasted="TRADE_STATUS_MATCHED_NOT_BROADCASTED",l.Mined="TRADE_STATUS_MINED",l.Confirmed="TRADE_STATUS_CONFIRMED",l.Retrying="TRADE_STATUS_RETRYING",l.Failed="TRADE_STATUS_FAILED",l))(U||{}),ye=z.preprocess(t=>typeof t!="string"||t.startsWith("TRADE_STATUS_")?t:Object.values(U).find(a=>a.slice(13)===t)??t,z.enum(U)),X=(p=>(p.Live="LIVE",p.Matched="MATCHED",p.Delayed="DELAYED",p.Unmatched="UNMATCHED",p.Canceled="CANCELED",p))(X||{}),ue=z.enum(X),J=z.object({price:Ha,size:Ha}),C=z.string().regex(/^\d+$/).transform(t=>w(new Date(Number(t)*1e3).toISOString())),Se=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:w(new Date(Number(t)*1e3).toISOString())),ee=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ea,bids:z.array(J),asks:z.array(J),hash:z.string().nullish(),timestamp:ca.nullish(),min_order_size:Ha.nullish(),tick_size:Ha.nullish(),neg_risk:z.boolean().nullish(),last_trade_price:Ha.nullish()}).transform(({event_type:t,asset_id:r,min_order_size:a,tick_size:s,neg_risk:o,last_trade_price:p,...l})=>({topic:"market",type:t,payload:{...l,tokenId:r,minOrderSize:a,tickSize:s,negRisk:o,lastTradePrice:p}})),Ee=z.object({asset_id:Ea,price:Ha,size:Ha,side:k,hash:z.string().nullish(),best_bid:Ha.nullish(),best_ask:Ha.nullish()}).transform(({asset_id:t,best_bid:r,best_ask:a,...s})=>({...s,tokenId:t,bestBid:r,bestAsk:a})),te=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(Ee),timestamp:ca.nullish()}).transform(({event_type:t,price_changes:r,...a})=>({topic:"market",type:t,payload:{...a,priceChanges:r}})),ne=z.object({event_type:z.literal("last_trade_price"),market:z.string(),asset_id:Ea,price:Ha,size:Ha.nullish(),fee_rate_bps:Ha.nullish(),side:k,timestamp:ca.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:r,fee_rate_bps:a,transaction_hash:s,...o})=>({topic:"market",type:t,payload:{...o,tokenId:r,feeRateBps:a,transactionHash:s}})),re=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ea,old_tick_size:Ha.nullish(),new_tick_size:Ha,timestamp:ca.nullish()}).transform(({event_type:t,asset_id:r,old_tick_size:a,new_tick_size:s,...o})=>({topic:"market",type:t,payload:{...o,tokenId:r,oldTickSize:a,newTickSize:s}})),ae=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ea,best_bid:Ha.nullish(),best_ask:Ha.nullish(),spread:Ha.nullish(),timestamp:ca.nullish()}).transform(({event_type:t,asset_id:r,best_bid:a,best_ask:s,...o})=>({topic:"market",type:t,payload:{...o,tokenId:r,bestBid:a,bestAsk:s}})),se=z.object({id:z.string(),ticker:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),description:z.string().nullish()}),ie=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(Ea).nullish(),outcomes:z.array(z.string()).nullish(),event_message:se.nullish(),timestamp:ca.nullish(),tags:z.array(z.string()).nullish(),condition_id:X$1.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Ha.nullish(),game_start_time:ga.nullish(),order_price_min_tick_size:Ha.nullish(),group_item_title:z.string().nullish(),taker_base_fee:Ha.nullish(),fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:r,event_message:a,condition_id:s,clob_token_ids:o,sports_market_type:p,game_start_time:l,order_price_min_tick_size:E,group_item_title:f,taker_base_fee:v,fees_enabled:P,fee_schedule:g,...b})=>({topic:"market",type:t,payload:{...b,tokenIds:r,eventMessage:a,conditionId:s,clobTokenIds:o,sportsMarketType:p,gameStartTime:l,orderPriceMinTickSize:E,groupItemTitle:f,takerBaseFee:v,feesEnabled:P,feeSchedule:g}})),oe=z.object({event_type:z.literal("market_resolved"),id:z.string(),market:z.string(),assets_ids:z.array(Ea).nullish(),winning_asset_id:Ea.nullish(),winning_outcome:z.string().nullish(),event_message:se.nullish(),timestamp:ca.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:r,winning_asset_id:a,winning_outcome:s,event_message:o,...p})=>({topic:"market",type:t,payload:{...p,tokenIds:r,winningTokenId:a,winningOutcome:s,eventMessage:o}})),pe=(s=>(s.Placement="PLACEMENT",s.Update="UPDATE",s.Cancellation="CANCELLATION",s))(pe||{}),fe=z.enum(pe),ve=z.object({event_type:z.literal("order"),id:z.string(),owner:z.string(),market:z.string(),asset_id:Ea,side:k,order_owner:z.string().nullish(),original_size:Ha,size_matched:Ha,price:Ha,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:fe,created_at:C.nullish(),expiration:Se.nullish(),order_type:va.nullish(),status:ue.nullish(),maker_address:z.string().nullish(),timestamp:ca}).transform(({event_type:t,type:r,asset_id:a,order_owner:s,original_size:o,size_matched:p,associate_trades:l,created_at:E,expiration:f,order_type:v,maker_address:P,...g})=>({topic:"user",type:t,payload:{...g,orderEventType:r,tokenId:a,orderOwner:s,originalSize:o,sizeMatched:p,associateTrades:l,createdAt:E,expiresAt:f,orderType:v,makerAddress:P}})),Pe=z.object({order_id:z.string(),owner:z.string(),maker_address:z.string().nullish(),matched_amount:Ha,price:Ha,fee_rate_bps:Ha.nullish(),asset_id:Ea,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:k}).transform(({order_id:t,maker_address:r,matched_amount:a,fee_rate_bps:s,asset_id:o,outcome_index:p,...l})=>({...l,orderId:t,makerAddress:r,matchedAmount:a,feeRateBps:s,tokenId:o,outcomeIndex:p})),ge=z.object({event_type:z.literal("trade"),type:z.literal("TRADE"),id:z.string(),taker_order_id:z.string(),market:z.string(),asset_id:Ea,side:k,size:Ha,fee_rate_bps:Ha.nullish(),price:Ha,status:ye,match_time:C.nullish(),matchtime:C.nullish(),last_update:C.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(Pe).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:ca}).transform(({event_type:t,type:r,taker_order_id:a,asset_id:s,fee_rate_bps:o,match_time:p,matchtime:l,last_update:E,trade_owner:f,maker_address:v,transaction_hash:P,bucket_index:g,maker_orders:b,trader_side:de,...he})=>({topic:"user",type:t,payload:{...he,takerOrderId:a,tokenId:s,feeRateBps:o,matchedAt:p??l,updatedAt:E,tradeOwner:f,makerAddress:v,transactionHash:P,bucketIndex:g,makerOrders:b,traderSide:de}})),Pt=z.discriminatedUnion("event_type",[ee,te,ne,re]),gt=z.discriminatedUnion("event_type",[ae,ie,oe]),_t=z.discriminatedUnion("event_type",[ee,te,ne,re,ae,ie,oe]),kt=z.discriminatedUnion("event_type",[ve,ge]);var _e=z.number().int().nonnegative(),ke=z.string().regex(/^trades::\d+$/),xe=z.string().regex(/^bbo::\d+$/),Te=z.string().regex(/^book::\d+$/),Ce=z.string().regex(/^tickers::(all|\d+)$/),be=z.string().regex(/^statistics::(all|\d+)$/),ze=z.string().regex(/^klines::\d+::(1m|5m|15m|1h|4h|1d|1w)$/),Ue=z.string().regex(/^tpsl::\d+$/),Ie=z.enum(["balances","portfolio","orders","fills","funding","deposits","withdrawals"]),u=z.object({ts:aa,sq:_e}),Me=u.extend({ch:ke,data:Ca}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.trades",type:"trade",channel:t,timestamp:r,sequence:a,payload:s})),Re=u.extend({ch:xe,data:Aa}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.bbo",type:"bbo",channel:t,timestamp:r,sequence:a,payload:s})),Ae=u.extend({ch:Te,data:ya}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.book",type:"book",channel:t,timestamp:r,sequence:a,payload:{instrumentId:ce(t),...s}})),Be=u.extend({ch:Ce,data:ra}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.tickers",type:"ticker",channel:t,timestamp:r,sequence:a,payload:s})),De=u.extend({ch:be,data:va$1}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.statistics",type:"statistic",channel:t,timestamp:r,sequence:a,payload:s})),qe=u.extend({ch:ze,data:z.array(sa)}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.candles",type:"candle",channel:t,timestamp:r,sequence:a,payload:{instrumentId:ce(t),interval:We(t),candles:s}})),Rt=z.union([Me,Re,Ae,Be,De,qe]),we=u.extend({ch:Ie});function S(t,r,a){return we.extend({ch:z.literal(r),data:a}).transform(s=>{let o=s;return {type:t,channel:o.ch,timestamp:o.ts,sequence:o.sq,payload:o.data}})}var Oe=S("balance","balances",L),je=S("portfolio","portfolio",R),Ne=S("order","orders",Va),Le=S("fill","fills",Ya),Fe=S("funding","funding",V),$e=S("deposit","deposits",ga$1),He=S("withdrawal","withdrawals",ka),Ye=z.object({oid:b,st:z.enum(["untriggered","armed","cancelled","expired"]),reason:z.string().optional()}),Ke=u.extend({ch:Ue,data:Ye.transform(t=>({orderId:t.oid,status:t.st,reason:t.reason}))}).transform(({ch:t,ts:r,sq:a,data:s})=>({type:"tpsl",channel:t,timestamp:r,sequence:a,payload:s})),At=z.union([Oe,je,Ne,Le,Fe,$e,He,Ke]);function ce(t){let[,r]=t.split("::");return a.parse(Number(r))}function We(t){let[,,r]=t.split("::");return r}var Ze=z.object({id:z.string(),body:z.string().nullish(),parentEntityType:ta.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:aa,payload:P}),Qe=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:aa,payload:Ze}),Ve=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:aa,payload:N}),Je=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:aa,payload:N}),le=z.object({symbol:z.string(),timestamp:aa,value:Ja}),Xe="prices.crypto.binance",et="prices.crypto.chainlink",tt=z.literal("crypto_prices"),nt=z.literal("crypto_prices_chainlink"),rt=tt.transform(()=>Xe),at=nt.transform(()=>et),st=z.object({topic:rt,type:z.literal("update"),timestamp:aa,payload:le}),it=z.object({topic:at,type:z.literal("update"),timestamp:aa,payload:le}),ot=z.discriminatedUnion("topic",[st,it]),pt=z.object({symbol:z.string(),value:Ja,full_accuracy_value:Ha.nullish(),timestamp:aa,received_at:aa.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:r,is_carried_forward:a,value:s,...o})=>({...o,value:t??s,receivedAt:r,isCarriedForward:a})),ct=z.object({timestamp:z.number(),value:Ja}),lt=z.object({symbol:z.string(),data:z.array(ct)}),mt=z.literal("equity_prices"),dt="prices.equity.pyth",me=mt.transform(()=>dt),ht=z.object({topic:me,type:z.literal("update"),timestamp:aa,payload:pt}),yt=z.object({topic:me,type:z.literal("subscribe"),timestamp:aa,payload:lt}),ut=z.discriminatedUnion("type",[ht,yt]),St=z.discriminatedUnion("type",[Ge,Qe,Ve,Je]),Ot=z.discriminatedUnion("topic",[St,ot,ut]);var Et=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:ga.nullish(),finished_timestamp:ga.nullish(),turn:z.string().nullish()}).transform(({finishedTimestamp:t,finished_timestamp:r,...a})=>({...a,finishedAt:t??r})),Ft=Et.transform(t=>({topic:"sports",type:"sport_result",payload:t}));export{Ge as CommentCreatedEventSchema,Qe as CommentRemovedEventSchema,St as CommentsEventSchema,st as CryptoPricesBinanceEventSchema,it as CryptoPricesChainlinkEventSchema,ot as CryptoPricesEventSchema,gt as CustomMarketEventSchema,ut as EquityPricesEventSchema,yt as EquityPricesSubscribeEventSchema,ht as EquityPricesUpdateEventSchema,ae as MarketBestBidAskEventSchema,ee as MarketBookEventSchema,_t as MarketEventSchema,ne as MarketLastTradePriceEventSchema,te as MarketPriceChangeEventSchema,oe as MarketResolvedEventSchema,re as MarketTickSizeChangeEventSchema,ie as NewMarketEventSchema,Oe as PerpsBalanceUpdateEventSchema,Re as PerpsBboEventSchema,Ae as PerpsBookEventSchema,qe as PerpsCandleEventSchema,$e as PerpsDepositUpdateEventSchema,Le as PerpsFillUpdateEventSchema,Fe as PerpsFundingUpdateEventSchema,Rt as PerpsMarketDataEventSchema,Ne as PerpsOrderUpdateEventSchema,je as PerpsPortfolioUpdateEventSchema,At as PerpsSessionUpdateEventSchema,De as PerpsStatisticEventSchema,Be as PerpsTickerEventSchema,Ke as PerpsTpSlUpdateEventSchema,Me as PerpsTradeEventSchema,He as PerpsWithdrawalUpdateEventSchema,Ve as ReactionCreatedEventSchema,Je as ReactionRemovedEventSchema,Ot as RealtimeEventSchema,Ft as SportsResultEventSchema,Pt as StandardMarketEventSchema,U as TradeStatus,kt as UserEventSchema,ve as UserOrderEventSchema,pe as UserOrderEventType,X as UserOrderStatus,ge as UserTradeEventSchema};//# sourceMappingURL=index.js.map
1
+ import {N,K,O,P}from'../chunk-G2DC5MZA.js';import {Ca,Aa,ya,ra,va,sa,b,a,L,R,Wa,Za,V,ga,ka}from'../chunk-BI6DX3LX.js';import {wa,Ja,x,Ga,ea,ia,Z,xa,ca,va as va$1,La}from'../chunk-GTLPG5HR.js';import {z}from'zod';var k=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,wa),U=(l=>(l.Matched="TRADE_STATUS_MATCHED",l.MatchedNotBroadcasted="TRADE_STATUS_MATCHED_NOT_BROADCASTED",l.Mined="TRADE_STATUS_MINED",l.Confirmed="TRADE_STATUS_CONFIRMED",l.Retrying="TRADE_STATUS_RETRYING",l.Failed="TRADE_STATUS_FAILED",l))(U||{}),ye=z.preprocess(t=>typeof t!="string"||t.startsWith("TRADE_STATUS_")?t:Object.values(U).find(a=>a.slice(13)===t)??t,z.enum(U)),X=(p=>(p.Live="LIVE",p.Matched="MATCHED",p.Delayed="DELAYED",p.Unmatched="UNMATCHED",p.Canceled="CANCELED",p))(X||{}),ue=z.enum(X),J=z.object({price:Ja,size:Ja}),C=z.string().regex(/^\d+$/).transform(t=>x(new Date(Number(t)*1e3).toISOString())),Se=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:x(new Date(Number(t)*1e3).toISOString())),ee=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ga,bids:z.array(J),asks:z.array(J),hash:z.string().nullish(),timestamp:ea.nullish(),min_order_size:Ja.nullish(),tick_size:Ja.nullish(),neg_risk:z.boolean().nullish(),last_trade_price:Ja.nullish()}).transform(({event_type:t,asset_id:r,min_order_size:a,tick_size:s,neg_risk:o,last_trade_price:p,...l})=>({topic:"market",type:t,payload:{...l,tokenId:r,minOrderSize:a,tickSize:s,negRisk:o,lastTradePrice:p}})),Ee=z.object({asset_id:Ga,price:Ja,size:Ja,side:k,hash:z.string().nullish(),best_bid:Ja.nullish(),best_ask:Ja.nullish()}).transform(({asset_id:t,best_bid:r,best_ask:a,...s})=>({...s,tokenId:t,bestBid:r,bestAsk:a})),te=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(Ee),timestamp:ea.nullish()}).transform(({event_type:t,price_changes:r,...a})=>({topic:"market",type:t,payload:{...a,priceChanges:r}})),ne=z.object({event_type:z.literal("last_trade_price"),market:z.string(),asset_id:Ga,price:Ja,size:Ja.nullish(),fee_rate_bps:Ja.nullish(),side:k,timestamp:ea.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:r,fee_rate_bps:a,transaction_hash:s,...o})=>({topic:"market",type:t,payload:{...o,tokenId:r,feeRateBps:a,transactionHash:s}})),re=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ga,old_tick_size:Ja.nullish(),new_tick_size:Ja,timestamp:ea.nullish()}).transform(({event_type:t,asset_id:r,old_tick_size:a,new_tick_size:s,...o})=>({topic:"market",type:t,payload:{...o,tokenId:r,oldTickSize:a,newTickSize:s}})),ae=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ga,best_bid:Ja.nullish(),best_ask:Ja.nullish(),spread:Ja.nullish(),timestamp:ea.nullish()}).transform(({event_type:t,asset_id:r,best_bid:a,best_ask:s,...o})=>({topic:"market",type:t,payload:{...o,tokenId:r,bestBid:a,bestAsk:s}})),se=z.object({id:z.string(),ticker:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),description:z.string().nullish()}),ie=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(Ga).nullish(),outcomes:z.array(z.string()).nullish(),event_message:se.nullish(),timestamp:ea.nullish(),tags:z.array(z.string()).nullish(),condition_id:Z.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Ja.nullish(),game_start_time:ia.nullish(),order_price_min_tick_size:Ja.nullish(),group_item_title:z.string().nullish(),taker_base_fee:Ja.nullish(),fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:r,event_message:a,condition_id:s,clob_token_ids:o,sports_market_type:p,game_start_time:l,order_price_min_tick_size:E,group_item_title:f,taker_base_fee:v,fees_enabled:P,fee_schedule:g,...b})=>({topic:"market",type:t,payload:{...b,tokenIds:r,eventMessage:a,conditionId:s,clobTokenIds:o,sportsMarketType:p,gameStartTime:l,orderPriceMinTickSize:E,groupItemTitle:f,takerBaseFee:v,feesEnabled:P,feeSchedule:g}})),oe=z.object({event_type:z.literal("market_resolved"),id:z.string(),market:z.string(),assets_ids:z.array(Ga).nullish(),winning_asset_id:Ga.nullish(),winning_outcome:z.string().nullish(),event_message:se.nullish(),timestamp:ea.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:r,winning_asset_id:a,winning_outcome:s,event_message:o,...p})=>({topic:"market",type:t,payload:{...p,tokenIds:r,winningTokenId:a,winningOutcome:s,eventMessage:o}})),pe=(s=>(s.Placement="PLACEMENT",s.Update="UPDATE",s.Cancellation="CANCELLATION",s))(pe||{}),fe=z.enum(pe),ve=z.object({event_type:z.literal("order"),id:z.string(),owner:z.string(),market:z.string(),asset_id:Ga,side:k,order_owner:z.string().nullish(),original_size:Ja,size_matched:Ja,price:Ja,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:fe,created_at:C.nullish(),expiration:Se.nullish(),order_type:xa.nullish(),status:ue.nullish(),maker_address:z.string().nullish(),timestamp:ea}).transform(({event_type:t,type:r,asset_id:a,order_owner:s,original_size:o,size_matched:p,associate_trades:l,created_at:E,expiration:f,order_type:v,maker_address:P,...g})=>({topic:"user",type:t,payload:{...g,orderEventType:r,tokenId:a,orderOwner:s,originalSize:o,sizeMatched:p,associateTrades:l,createdAt:E,expiresAt:f,orderType:v,makerAddress:P}})),Pe=z.object({order_id:z.string(),owner:z.string(),maker_address:z.string().nullish(),matched_amount:Ja,price:Ja,fee_rate_bps:Ja.nullish(),asset_id:Ga,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:k}).transform(({order_id:t,maker_address:r,matched_amount:a,fee_rate_bps:s,asset_id:o,outcome_index:p,...l})=>({...l,orderId:t,makerAddress:r,matchedAmount:a,feeRateBps:s,tokenId:o,outcomeIndex:p})),ge=z.object({event_type:z.literal("trade"),type:z.literal("TRADE"),id:z.string(),taker_order_id:z.string(),market:z.string(),asset_id:Ga,side:k,size:Ja,fee_rate_bps:Ja.nullish(),price:Ja,status:ye,match_time:C.nullish(),matchtime:C.nullish(),last_update:C.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(Pe).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:ea}).transform(({event_type:t,type:r,taker_order_id:a,asset_id:s,fee_rate_bps:o,match_time:p,matchtime:l,last_update:E,trade_owner:f,maker_address:v,transaction_hash:P,bucket_index:g,maker_orders:b,trader_side:de,...he})=>({topic:"user",type:t,payload:{...he,takerOrderId:a,tokenId:s,feeRateBps:o,matchedAt:p??l,updatedAt:E,tradeOwner:f,makerAddress:v,transactionHash:P,bucketIndex:g,makerOrders:b,traderSide:de}})),Pt=z.discriminatedUnion("event_type",[ee,te,ne,re]),gt=z.discriminatedUnion("event_type",[ae,ie,oe]),_t=z.discriminatedUnion("event_type",[ee,te,ne,re,ae,ie,oe]),kt=z.discriminatedUnion("event_type",[ve,ge]);var _e=z.number().int().nonnegative(),ke=z.string().regex(/^trades::\d+$/),xe=z.string().regex(/^bbo::\d+$/),Te=z.string().regex(/^book::\d+$/),Ce=z.string().regex(/^tickers::(all|\d+)$/),be=z.string().regex(/^statistics::(all|\d+)$/),ze=z.string().regex(/^klines::\d+::(1m|5m|15m|1h|4h|1d|1w)$/),Ue=z.string().regex(/^tpsl::\d+$/),Ie=z.enum(["balances","portfolio","orders","fills","funding","deposits","withdrawals"]),u=z.object({ts:ca,sq:_e}),Me=u.extend({ch:ke,data:Ca}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.trades",type:"trade",channel:t,timestamp:r,sequence:a,payload:s})),Re=u.extend({ch:xe,data:Aa}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.bbo",type:"bbo",channel:t,timestamp:r,sequence:a,payload:s})),Ae=u.extend({ch:Te,data:ya}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.book",type:"book",channel:t,timestamp:r,sequence:a,payload:{instrumentId:ce(t),...s}})),Be=u.extend({ch:Ce,data:ra}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.tickers",type:"ticker",channel:t,timestamp:r,sequence:a,payload:s})),De=u.extend({ch:be,data:va}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.statistics",type:"statistic",channel:t,timestamp:r,sequence:a,payload:s})),qe=u.extend({ch:ze,data:z.array(sa)}).transform(({ch:t,ts:r,sq:a,data:s})=>({topic:"perps.candles",type:"candle",channel:t,timestamp:r,sequence:a,payload:{instrumentId:ce(t),interval:We(t),candles:s}})),Rt=z.union([Me,Re,Ae,Be,De,qe]),we=u.extend({ch:Ie});function S(t,r,a){return we.extend({ch:z.literal(r),data:a}).transform(s=>{let o=s;return {type:t,channel:o.ch,timestamp:o.ts,sequence:o.sq,payload:o.data}})}var Oe=S("balance","balances",L),je=S("portfolio","portfolio",R),Ne=S("order","orders",Wa),Le=S("fill","fills",Za),Fe=S("funding","funding",V),$e=S("deposit","deposits",ga),He=S("withdrawal","withdrawals",ka),Ye=z.object({oid:b,st:z.enum(["untriggered","armed","cancelled","expired"]),reason:z.string().optional()}),Ke=u.extend({ch:Ue,data:Ye.transform(t=>({orderId:t.oid,status:t.st,reason:t.reason}))}).transform(({ch:t,ts:r,sq:a,data:s})=>({type:"tpsl",channel:t,timestamp:r,sequence:a,payload:s})),At=z.union([Oe,je,Ne,Le,Fe,$e,He,Ke]);function ce(t){let[,r]=t.split("::");return a.parse(Number(r))}function We(t){let[,,r]=t.split("::");return r}var Ze=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()}),Ge=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:ca,payload:P}),Qe=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:ca,payload:Ze}),Ve=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:ca,payload:N}),Je=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:ca,payload:N}),le=z.object({symbol:z.string(),timestamp:ca,value:La}),Xe="prices.crypto.binance",et="prices.crypto.chainlink",tt=z.literal("crypto_prices"),nt=z.literal("crypto_prices_chainlink"),rt=tt.transform(()=>Xe),at=nt.transform(()=>et),st=z.object({topic:rt,type:z.literal("update"),timestamp:ca,payload:le}),it=z.object({topic:at,type:z.literal("update"),timestamp:ca,payload:le}),ot=z.discriminatedUnion("topic",[st,it]),pt=z.object({symbol:z.string(),value:La,full_accuracy_value:Ja.nullish(),timestamp:ca,received_at:ca.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:r,is_carried_forward:a,value:s,...o})=>({...o,value:t??s,receivedAt:r,isCarriedForward:a})),ct=z.object({timestamp:z.number(),value:La}),lt=z.object({symbol:z.string(),data:z.array(ct)}),mt=z.literal("equity_prices"),dt="prices.equity.pyth",me=mt.transform(()=>dt),ht=z.object({topic:me,type:z.literal("update"),timestamp:ca,payload:pt}),yt=z.object({topic:me,type:z.literal("subscribe"),timestamp:ca,payload:lt}),ut=z.discriminatedUnion("type",[ht,yt]),St=z.discriminatedUnion("type",[Ge,Qe,Ve,Je]),Ot=z.discriminatedUnion("topic",[St,ot,ut]);var Et=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:r,...a})=>({...a,finishedAt:t??r})),Ft=Et.transform(t=>({topic:"sports",type:"sport_result",payload:t}));export{Ge as CommentCreatedEventSchema,Qe as CommentRemovedEventSchema,St as CommentsEventSchema,st as CryptoPricesBinanceEventSchema,it as CryptoPricesChainlinkEventSchema,ot as CryptoPricesEventSchema,gt as CustomMarketEventSchema,ut as EquityPricesEventSchema,yt as EquityPricesSubscribeEventSchema,ht as EquityPricesUpdateEventSchema,ae as MarketBestBidAskEventSchema,ee as MarketBookEventSchema,_t as MarketEventSchema,ne as MarketLastTradePriceEventSchema,te as MarketPriceChangeEventSchema,oe as MarketResolvedEventSchema,re as MarketTickSizeChangeEventSchema,ie as NewMarketEventSchema,Oe as PerpsBalanceUpdateEventSchema,Re as PerpsBboEventSchema,Ae as PerpsBookEventSchema,qe as PerpsCandleEventSchema,$e as PerpsDepositUpdateEventSchema,Le as PerpsFillUpdateEventSchema,Fe as PerpsFundingUpdateEventSchema,Rt as PerpsMarketDataEventSchema,Ne as PerpsOrderUpdateEventSchema,je as PerpsPortfolioUpdateEventSchema,At as PerpsSessionUpdateEventSchema,De as PerpsStatisticEventSchema,Be as PerpsTickerEventSchema,Ke as PerpsTpSlUpdateEventSchema,Me as PerpsTradeEventSchema,He as PerpsWithdrawalUpdateEventSchema,Ve as ReactionCreatedEventSchema,Je as ReactionRemovedEventSchema,Ot as RealtimeEventSchema,Ft as SportsResultEventSchema,Pt as StandardMarketEventSchema,U as TradeStatus,kt as UserEventSchema,ve as UserOrderEventSchema,pe as UserOrderEventType,X as UserOrderStatus,ge as UserTradeEventSchema};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map