@polymarket/bindings 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QX4CCP47.js → chunk-BAQM5QBB.js} +2 -2
- package/dist/{chunk-QX4CCP47.js.map → chunk-BAQM5QBB.js.map} +1 -1
- package/dist/chunk-NFJUONUG.js +2 -0
- package/dist/{chunk-UDKFL2IM.js.map → chunk-NFJUONUG.js.map} +1 -1
- package/dist/chunk-WVVJ3WNL.js +2 -0
- package/dist/chunk-WVVJ3WNL.js.map +1 -0
- package/dist/clob/index.d.ts +2499 -182
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/combos/index.d.ts +10 -10
- package/dist/combos/index.js +1 -1
- package/dist/combos/index.js.map +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +17 -8
- package/dist/index.js +1 -1
- package/dist/{orders-BDfNkzav.d.ts → orders-CAELACaR.d.ts} +1 -1
- package/dist/perps/index.d.ts +11 -11
- package/dist/perps/index.js +1 -1
- package/dist/relayer/index.d.ts +43 -2
- package/dist/relayer/index.js +1 -1
- package/dist/relayer/index.js.map +1 -1
- package/dist/subscriptions/index.d.ts +11 -11
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-AY4D74DC.js +0 -2
- package/dist/chunk-AY4D74DC.js.map +0 -1
- package/dist/chunk-UDKFL2IM.js +0 -2
package/dist/perps/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{$ as FetchPerpsAccountConfigResponseSchema,S as FetchPerpsAccountStatsResponseSchema,Q as FetchPerpsBalancesResponseSchema,Oa as FetchPerpsCandlesResponseSchema,Na as FetchPerpsFeesResponseSchema,Ja as FetchPerpsFundingHistoryResponseSchema,sa as FetchPerpsInstrumentsResponseSchema,ob as FetchPerpsOpenOrdersResponseSchema,nb as FetchPerpsOrdersResponseSchema,W as FetchPerpsPortfolioResponseSchema,ya as FetchPerpsStatisticsResponseSchema,ua as FetchPerpsTickersResponseSchema,Ha as FetchPerpsTradesResponseSchema,bb as FetchPerpsUnreadNotificationsCountResponseSchema,ja as ListPerpsDepositsResponseSchema,ba as ListPerpsEquityHistoryResponseSchema,rb as ListPerpsFillsResponseSchema,Y as ListPerpsFundingPaymentsResponseSchema,ab as ListPerpsNotificationsResponseSchema,da as ListPerpsPnlHistoryResponseSchema,ma as ListPerpsWithdrawalsResponseSchema,cb as MarkPerpsNotificationsReadResponseSchema,_ as PerpsAccountConfigSchema,qb as PerpsAccountFillSchema,sb as PerpsAccountFillUpdateSchema,Z as PerpsAccountFundingPaymentEntrySchema,X as PerpsAccountFundingPaymentSchema,R as PerpsAccountStatsSchema,J as PerpsAssetSchema,P as PerpsBalanceSchema,Da as PerpsBboSchema,Ea as PerpsBboUpdateSchema,Aa as PerpsBookLevelSchema,Ba as PerpsBookSchema,Ca as PerpsBookUpdateSchema,kb as PerpsCancelAllOrdersResponseSchema,jb as PerpsCancelOrderResultSchema,wa as PerpsCandleSchema,c as PerpsClientOrderIdSchema,hb as PerpsCommandAckSchema,gb as PerpsCommandStatusSchema,ga as PerpsCreateProxyResponseSchema,fa as PerpsCredentialsResponseSchema,L as PerpsDataResponseSchema,k as PerpsDecimalInputSchema,ha as PerpsDeleteProxyResponseSchema,ia as PerpsDepositSchema,r as PerpsDepositStatus,D as PerpsDepositStatusSchema,ka as PerpsDepositUpdateSchema,i as PerpsEntityIdSchema,aa as PerpsEquityPointSchema,La as PerpsFeeScheduleEntrySchema,Ka as PerpsFeeTierSchema,Ma as PerpsFeesInfoSchema,j as PerpsFundingIntervalSchema,f as PerpsFundingPaymentIdSchema,Ia as PerpsFundingRateSchema,m as PerpsInstrumentCategory,y as PerpsInstrumentCategorySchema,a as PerpsInstrumentIdSchema,ra as PerpsInstrumentSchema,l as PerpsInstrumentType,x as PerpsInstrumentTypeSchema,t as PerpsInternalTransferDirection,F as PerpsInternalTransferDirectionSchema,h as PerpsInternalTransferIdSchema,pa as PerpsInternalTransferSchema,u as PerpsKlineInterval,G as PerpsKlineIntervalSchema,s as PerpsKnownWithdrawalStatus,Xa as PerpsLimitOrderCanceledNotificationSchema,Ya as PerpsLiquidationWarningNotificationSchema,U as PerpsMarginSummarySchema,Ta as PerpsMarginType,Ua as PerpsMarginTypeSchema,$a as PerpsNotificationEntrySchema,d as PerpsNotificationIdSchema,Ra as PerpsNotificationOrderType,Sa as PerpsNotificationOrderTypeSchema,_a as PerpsNotificationSchema,Pa as PerpsNotificationType,Qa as PerpsNotificationTypeSchema,b as PerpsOrderIdSchema,mb as PerpsOrderSchema,db as PerpsOrderStatus,fb as PerpsOrderStatusSchema,pb as PerpsOrderUpdateSchema,v as PerpsPnlInterval,H as PerpsPnlIntervalSchema,ca as PerpsPnlPointSchema,T as PerpsPortfolioPositionSchema,V as PerpsPortfolioSchema,Va as PerpsPositionChangeNotificationSchema,Wa as PerpsPositionClosedNotificationSchema,Za as PerpsPositionLiquidatedNotificationSchema,ib as PerpsPostOrderAckSchema,ea as PerpsProxyKeySchema,Fa as PerpsPublicTradeSchema,Ga as PerpsPublicTradeUpdateSchema,qa as PerpsRiskTierSchema,n as PerpsSide,z as PerpsSideSchema,w as PerpsSortDirection,I as PerpsSortDirectionSchema,xa as PerpsStatisticSchema,za as PerpsStatisticUpdateSchema,va as PerpsTickerEntrySchema,ta as PerpsTickerSchema,o as PerpsTimeInForce,A as PerpsTimeInForceSchema,p as PerpsTpSlKind,B as PerpsTpSlKindSchema,eb as PerpsTpSlOrderFieldsSchema,q as PerpsTpSlScope,C as PerpsTpSlScopeSchema,e as PerpsTradeIdSchema,K as PerpsTxHashSchema,lb as PerpsUpdateLeverageResultSchema,na as PerpsWithdrawResponseSchema,g as PerpsWithdrawalIdSchema,la as PerpsWithdrawalSchema,E as PerpsWithdrawalStatusSchema,oa as PerpsWithdrawalUpdateSchema,O as decimalString,N as perpsBaseUnits,M as perpsDecimal}from'../chunk-
|
|
1
|
+
export{$ as FetchPerpsAccountConfigResponseSchema,S as FetchPerpsAccountStatsResponseSchema,Q as FetchPerpsBalancesResponseSchema,Oa as FetchPerpsCandlesResponseSchema,Na as FetchPerpsFeesResponseSchema,Ja as FetchPerpsFundingHistoryResponseSchema,sa as FetchPerpsInstrumentsResponseSchema,ob as FetchPerpsOpenOrdersResponseSchema,nb as FetchPerpsOrdersResponseSchema,W as FetchPerpsPortfolioResponseSchema,ya as FetchPerpsStatisticsResponseSchema,ua as FetchPerpsTickersResponseSchema,Ha as FetchPerpsTradesResponseSchema,bb as FetchPerpsUnreadNotificationsCountResponseSchema,ja as ListPerpsDepositsResponseSchema,ba as ListPerpsEquityHistoryResponseSchema,rb as ListPerpsFillsResponseSchema,Y as ListPerpsFundingPaymentsResponseSchema,ab as ListPerpsNotificationsResponseSchema,da as ListPerpsPnlHistoryResponseSchema,ma as ListPerpsWithdrawalsResponseSchema,cb as MarkPerpsNotificationsReadResponseSchema,_ as PerpsAccountConfigSchema,qb as PerpsAccountFillSchema,sb as PerpsAccountFillUpdateSchema,Z as PerpsAccountFundingPaymentEntrySchema,X as PerpsAccountFundingPaymentSchema,R as PerpsAccountStatsSchema,J as PerpsAssetSchema,P as PerpsBalanceSchema,Da as PerpsBboSchema,Ea as PerpsBboUpdateSchema,Aa as PerpsBookLevelSchema,Ba as PerpsBookSchema,Ca as PerpsBookUpdateSchema,kb as PerpsCancelAllOrdersResponseSchema,jb as PerpsCancelOrderResultSchema,wa as PerpsCandleSchema,c as PerpsClientOrderIdSchema,hb as PerpsCommandAckSchema,gb as PerpsCommandStatusSchema,ga as PerpsCreateProxyResponseSchema,fa as PerpsCredentialsResponseSchema,L as PerpsDataResponseSchema,k as PerpsDecimalInputSchema,ha as PerpsDeleteProxyResponseSchema,ia as PerpsDepositSchema,r as PerpsDepositStatus,D as PerpsDepositStatusSchema,ka as PerpsDepositUpdateSchema,i as PerpsEntityIdSchema,aa as PerpsEquityPointSchema,La as PerpsFeeScheduleEntrySchema,Ka as PerpsFeeTierSchema,Ma as PerpsFeesInfoSchema,j as PerpsFundingIntervalSchema,f as PerpsFundingPaymentIdSchema,Ia as PerpsFundingRateSchema,m as PerpsInstrumentCategory,y as PerpsInstrumentCategorySchema,a as PerpsInstrumentIdSchema,ra as PerpsInstrumentSchema,l as PerpsInstrumentType,x as PerpsInstrumentTypeSchema,t as PerpsInternalTransferDirection,F as PerpsInternalTransferDirectionSchema,h as PerpsInternalTransferIdSchema,pa as PerpsInternalTransferSchema,u as PerpsKlineInterval,G as PerpsKlineIntervalSchema,s as PerpsKnownWithdrawalStatus,Xa as PerpsLimitOrderCanceledNotificationSchema,Ya as PerpsLiquidationWarningNotificationSchema,U as PerpsMarginSummarySchema,Ta as PerpsMarginType,Ua as PerpsMarginTypeSchema,$a as PerpsNotificationEntrySchema,d as PerpsNotificationIdSchema,Ra as PerpsNotificationOrderType,Sa as PerpsNotificationOrderTypeSchema,_a as PerpsNotificationSchema,Pa as PerpsNotificationType,Qa as PerpsNotificationTypeSchema,b as PerpsOrderIdSchema,mb as PerpsOrderSchema,db as PerpsOrderStatus,fb as PerpsOrderStatusSchema,pb as PerpsOrderUpdateSchema,v as PerpsPnlInterval,H as PerpsPnlIntervalSchema,ca as PerpsPnlPointSchema,T as PerpsPortfolioPositionSchema,V as PerpsPortfolioSchema,Va as PerpsPositionChangeNotificationSchema,Wa as PerpsPositionClosedNotificationSchema,Za as PerpsPositionLiquidatedNotificationSchema,ib as PerpsPostOrderAckSchema,ea as PerpsProxyKeySchema,Fa as PerpsPublicTradeSchema,Ga as PerpsPublicTradeUpdateSchema,qa as PerpsRiskTierSchema,n as PerpsSide,z as PerpsSideSchema,w as PerpsSortDirection,I as PerpsSortDirectionSchema,xa as PerpsStatisticSchema,za as PerpsStatisticUpdateSchema,va as PerpsTickerEntrySchema,ta as PerpsTickerSchema,o as PerpsTimeInForce,A as PerpsTimeInForceSchema,p as PerpsTpSlKind,B as PerpsTpSlKindSchema,eb as PerpsTpSlOrderFieldsSchema,q as PerpsTpSlScope,C as PerpsTpSlScopeSchema,e as PerpsTradeIdSchema,K as PerpsTxHashSchema,lb as PerpsUpdateLeverageResultSchema,na as PerpsWithdrawResponseSchema,g as PerpsWithdrawalIdSchema,la as PerpsWithdrawalSchema,E as PerpsWithdrawalStatusSchema,oa as PerpsWithdrawalUpdateSchema,O as decimalString,N as perpsBaseUnits,M as perpsDecimal}from'../chunk-BAQM5QBB.js';import {u,da}from'../chunk-WVVJ3WNL.js';import {z}from'zod';var n=z.number().int().transform(e=>e===0?null:u(e)),jt=z.object({status:z.literal("ok"),deadline:n}),i=z.object({deadline:n,triggered:z.number().int().nonnegative(),daily_limit:z.number().int().nonnegative(),next_reset:da}).transform(e=>({deadline:e.deadline,triggered:e.triggered,dailyLimit:e.daily_limit,nextReset:e.next_reset})),Et=i;export{Et as FetchPerpsAutoCancelStatusResponseSchema,jt as PerpsAutoCancelResponseSchema,i as PerpsAutoCancelStatusSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/relayer/index.d.ts
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { TransactionId } from '../index.js';
|
|
2
3
|
import * as _polymarket_types from '@polymarket/types';
|
|
3
|
-
import {
|
|
4
|
+
import { TxHash } from '@polymarket/types';
|
|
5
|
+
|
|
6
|
+
declare enum RelayerAuthorizeSessionSignerStatus {
|
|
7
|
+
SUBMITTED = "SUBMITTED",
|
|
8
|
+
REGISTRY_PENDING = "REGISTRY_PENDING",
|
|
9
|
+
REGISTERED = "REGISTERED",
|
|
10
|
+
FAILED = "FAILED",
|
|
11
|
+
SUPERSEDED = "SUPERSEDED",
|
|
12
|
+
REPAIR_REQUIRED = "REPAIR_REQUIRED"
|
|
13
|
+
}
|
|
14
|
+
type RelayerAuthorizeSessionSignerResponse = {
|
|
15
|
+
/** Lifecycle status of the authorization operation. */
|
|
16
|
+
status: RelayerAuthorizeSessionSignerStatus;
|
|
17
|
+
/** Submitted transaction hash when it is already available. */
|
|
18
|
+
transactionHash: TxHash | null;
|
|
19
|
+
/** Identifier used to poll the submitted transaction. */
|
|
20
|
+
transactionId: TransactionId;
|
|
21
|
+
};
|
|
22
|
+
declare const RelayerAuthorizeSessionSignerResponseSchema: z.ZodObject<{
|
|
23
|
+
status: z.ZodEnum<typeof RelayerAuthorizeSessionSignerStatus>;
|
|
24
|
+
transactionHash: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<TxHash, string>>>>, z.ZodTransform<TxHash | null, TxHash | null | undefined>>;
|
|
25
|
+
transactionId: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
declare enum RelayerRevokeSessionSignerStatus {
|
|
28
|
+
PENDING = "PENDING",
|
|
29
|
+
FENCED = "FENCED",
|
|
30
|
+
SWEPT = "SWEPT",
|
|
31
|
+
CHAIN_SUBMITTED = "CHAIN_SUBMITTED",
|
|
32
|
+
CONFIRMED = "CONFIRMED",
|
|
33
|
+
FAILED = "FAILED"
|
|
34
|
+
}
|
|
35
|
+
type RelayerRevokeSessionSignerResponse = {
|
|
36
|
+
/** Lifecycle status of the revocation operation. */
|
|
37
|
+
status: RelayerRevokeSessionSignerStatus;
|
|
38
|
+
/** Identifier used to poll the submitted transaction. */
|
|
39
|
+
transactionId: TransactionId;
|
|
40
|
+
};
|
|
41
|
+
declare const RelayerRevokeSessionSignerResponseSchema: z.ZodObject<{
|
|
42
|
+
status: z.ZodEnum<typeof RelayerRevokeSessionSignerStatus>;
|
|
43
|
+
transactionId: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
4
45
|
|
|
5
46
|
declare enum RelayerTransactionType {
|
|
6
47
|
SAFE = "SAFE",
|
|
@@ -183,4 +224,4 @@ declare const GaslessTransactionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
183
224
|
}>>;
|
|
184
225
|
type GaslessTransaction = z.output<typeof GaslessTransactionSchema>;
|
|
185
226
|
|
|
186
|
-
export { type DepositWalletCall, DepositWalletCallSchema, type DepositWalletParams, DepositWalletParamsSchema, type GaslessTransaction, GaslessTransactionSchema, type RelayerDeployedResponse, RelayerDeployedResponseSchema, type RelayerDepositWalletCreateRequest, RelayerDepositWalletCreateRequestSchema, type RelayerDepositWalletExecuteRequest, RelayerDepositWalletExecuteRequestSchema, type RelayerExecuteParams, RelayerExecuteParamsSchema, type RelayerExecuteRequest, RelayerExecuteRequestSchema, type RelayerExecuteResponse, RelayerExecuteResponseSchema, type RelayerLegacyExecuteRequest, RelayerLegacyExecuteRequestSchema, RelayerTransactionState, RelayerTransactionType, RelayerTransactionTypeSchema };
|
|
227
|
+
export { type DepositWalletCall, DepositWalletCallSchema, type DepositWalletParams, DepositWalletParamsSchema, type GaslessTransaction, GaslessTransactionSchema, type RelayerAuthorizeSessionSignerResponse, RelayerAuthorizeSessionSignerResponseSchema, RelayerAuthorizeSessionSignerStatus, type RelayerDeployedResponse, RelayerDeployedResponseSchema, type RelayerDepositWalletCreateRequest, RelayerDepositWalletCreateRequestSchema, type RelayerDepositWalletExecuteRequest, RelayerDepositWalletExecuteRequestSchema, type RelayerExecuteParams, RelayerExecuteParamsSchema, type RelayerExecuteRequest, RelayerExecuteRequestSchema, type RelayerExecuteResponse, RelayerExecuteResponseSchema, type RelayerLegacyExecuteRequest, RelayerLegacyExecuteRequestSchema, type RelayerRevokeSessionSignerResponse, RelayerRevokeSessionSignerResponseSchema, RelayerRevokeSessionSignerStatus, RelayerTransactionState, RelayerTransactionType, RelayerTransactionTypeSchema };
|
package/dist/relayer/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {La,Ma,ca}from'../chunk-WVVJ3WNL.js';import {z}from'zod';var E=(t=>(t.SUBMITTED="SUBMITTED",t.REGISTRY_PENDING="REGISTRY_PENDING",t.REGISTERED="REGISTERED",t.FAILED="FAILED",t.SUPERSEDED="SUPERSEDED",t.REPAIR_REQUIRED="REPAIR_REQUIRED",t))(E||{}),f=z.object({status:z.enum(E),transactionHash:Ma.nullish().transform(o=>o??null),transactionId:La}),c=(t=>(t.PENDING="PENDING",t.FENCED="FENCED",t.SWEPT="SWEPT",t.CHAIN_SUBMITTED="CHAIN_SUBMITTED",t.CONFIRMED="CONFIRMED",t.FAILED="FAILED",t))(c||{}),L=z.object({status:z.enum(c),transactionId:La});var m=(s=>(s.SAFE="SAFE",s.PROXY="PROXY",s.SAFE_CREATE="SAFE-CREATE",s.WALLET="WALLET",s.WALLET_CREATE="WALLET-CREATE",s))(m||{}),C=z.enum(m),u=z.enum(["PROXY","SAFE","SAFE-CREATE"]),R=(t=>(t.STATE_NEW="STATE_NEW",t.STATE_EXECUTED="STATE_EXECUTED",t.STATE_MINED="STATE_MINED",t.STATE_CONFIRMED="STATE_CONFIRMED",t.STATE_INVALID="STATE_INVALID",t.STATE_FAILED="STATE_FAILED",t))(R||{}),T=z.enum(R),x=z.object({baseGas:z.string().optional(),gasLimit:z.string().optional(),gasPrice:z.string().optional(),gasToken:ca.optional(),operation:z.string().optional(),payment:z.string().optional(),paymentReceiver:ca.optional(),paymentToken:ca.optional(),refundReceiver:ca.optional(),relay:ca.optional(),relayHub:ca.optional(),relayerFee:z.string().optional(),safeTxnGas:z.string().optional()}),N=z.object({address:ca,nonce:z.string().min(1)}),D=z.object({data:z.string().min(1),from:ca,metadata:z.string().optional(),nonce:z.string().min(1).optional(),proxyWallet:ca,signature:z.string().min(1),signatureParams:x,to:ca,type:u,value:z.string().optional()}),I=z.object({data:z.string().min(1),target:ca,value:z.string().min(1)}),h=z.object({calls:z.array(I).min(1),deadline:z.string().min(1),depositWallet:ca}),A=z.object({depositWalletParams:h,from:ca,metadata:z.string().optional(),nonce:z.string().min(1),signature:z.string().min(1),to:ca,type:z.literal("WALLET")}),S=z.object({from:ca,metadata:z.string().optional(),to:ca,type:z.literal("WALLET-CREATE")}),F=z.union([D,A,S]),b=z.object({state:T,transactionHash:Ma.nullish().transform(o=>o??null),transactionID:La}).transform(({transactionHash:o,transactionID:l,...i})=>({...i,transactionHash:o??null,transactionId:l})),G=z.object({deployed:z.boolean()}),j=z.object({error_msg:z.string().nullish(),state:T,transaction_hash:z.union([z.literal(""),Ma]).transform(o=>o===""?null:o),transaction_id:La}).transform(({error_msg:o,transaction_hash:l,transaction_id:i,...y})=>({...y,errorMsg:o??null,transactionHash:l??null,transactionId:i}));export{I as DepositWalletCallSchema,h as DepositWalletParamsSchema,j as GaslessTransactionSchema,f as RelayerAuthorizeSessionSignerResponseSchema,E as RelayerAuthorizeSessionSignerStatus,G as RelayerDeployedResponseSchema,S as RelayerDepositWalletCreateRequestSchema,A as RelayerDepositWalletExecuteRequestSchema,N as RelayerExecuteParamsSchema,F as RelayerExecuteRequestSchema,b as RelayerExecuteResponseSchema,D as RelayerLegacyExecuteRequestSchema,L as RelayerRevokeSessionSignerResponseSchema,c as RelayerRevokeSessionSignerStatus,R as RelayerTransactionState,m as RelayerTransactionType,C 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":"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,aAAA,CACdA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,cAAgB,eAAA,CAChBA,CAAAA,CAAA,aAAe,cAAA,CANLA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IASNC,CAAAA,CAAgCH,CAAAA,CAAE,IAAA,CAAKE,CAAuB,CAAA,CAE9DE,CAAAA,CAA+BJ,EAAE,MAAA,CAAO,CAC5C,QAASA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAC7B,QAAA,CAAUA,CAAAA,CAAE,MAAA,EAAO,CAAE,UAAS,CAC9B,QAAA,CAAUA,EAAE,MAAA,EAAO,CAAE,UAAS,CAC9B,QAAA,CAAUK,EAAAA,CAAiB,QAAA,EAAS,CACpC,SAAA,CAAWL,EAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAC/B,OAAA,CAASA,CAAAA,CAAE,QAAO,CAAE,QAAA,EAAS,CAC7B,eAAA,CAAiBK,EAAAA,CAAiB,QAAA,GAClC,YAAA,CAAcA,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AUA,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/session-signer.ts","../../src/relayer/transaction.ts"],"names":["RelayerAuthorizeSessionSignerStatus","RelayerAuthorizeSessionSignerResponseSchema","z","TxHashSchema","value","TransactionIdSchema","RelayerRevokeSessionSignerStatus","RelayerRevokeSessionSignerResponseSchema","RelayerTransactionType","RelayerTransactionTypeSchema","RelayerLegacyTransactionTypeSchema","RelayerTransactionState","RelayerTransactionStateSchema","RelayerSignatureParamsSchema","EvmAddressSchema","RelayerExecuteParamsSchema","RelayerLegacyExecuteRequestSchema","DepositWalletCallSchema","DepositWalletParamsSchema","RelayerDepositWalletExecuteRequestSchema","RelayerDepositWalletCreateRequestSchema","RelayerExecuteRequestSchema","RelayerExecuteResponseSchema","transactionHash","transactionID","rest","RelayerDeployedResponseSchema","GaslessTransactionSchema","error_msg","transaction_hash","transaction_id"],"mappings":"gEAQO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,gBAAA,CAAmB,kBAAA,CACnBA,CAAAA,CAAA,UAAA,CAAa,YAAA,CACbA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,UAAA,CAAa,YAAA,CACbA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CANRA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAoBCC,CAAAA,CAA8CC,CAAAA,CAAE,MAAA,CAAO,CAClE,MAAA,CAAQA,CAAAA,CAAE,IAAA,CAAKF,CAAmC,CAAA,CAClD,eAAA,CAAiBG,EAAAA,CAAa,OAAA,EAAQ,CAAE,SAAA,CAAWC,CAAAA,EAAUA,CAAAA,EAAS,IAAI,CAAA,CAC1E,aAAA,CAAeC,EACjB,CAAC,CAAA,CAEWC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,UAAY,WAAA,CACZA,CAAAA,CAAA,MAAA,CAAS,QAAA,CANCA,CAAAA,CAAAA,EAAA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":["import { z } from 'zod';\nimport {\n type TransactionId,\n TransactionIdSchema,\n type TxHash,\n TxHashSchema,\n} from '../shared';\n\nexport enum RelayerAuthorizeSessionSignerStatus {\n SUBMITTED = 'SUBMITTED',\n REGISTRY_PENDING = 'REGISTRY_PENDING',\n REGISTERED = 'REGISTERED',\n FAILED = 'FAILED',\n SUPERSEDED = 'SUPERSEDED',\n REPAIR_REQUIRED = 'REPAIR_REQUIRED',\n}\n\nexport type RelayerAuthorizeSessionSignerResponse = {\n /** Lifecycle status of the authorization operation. */\n status: RelayerAuthorizeSessionSignerStatus;\n /** Submitted transaction hash when it is already available. */\n transactionHash: TxHash | null;\n /** Identifier used to poll the submitted transaction. */\n transactionId: TransactionId;\n};\n\n// The upstream `operationId` is omitted from the normalized response because\n// it is an opaque identifier with no SDK consumer.\nexport const RelayerAuthorizeSessionSignerResponseSchema = z.object({\n status: z.enum(RelayerAuthorizeSessionSignerStatus),\n transactionHash: TxHashSchema.nullish().transform((value) => value ?? null),\n transactionId: TransactionIdSchema,\n}) satisfies z.ZodType<RelayerAuthorizeSessionSignerResponse>;\n\nexport enum RelayerRevokeSessionSignerStatus {\n PENDING = 'PENDING',\n FENCED = 'FENCED',\n SWEPT = 'SWEPT',\n CHAIN_SUBMITTED = 'CHAIN_SUBMITTED',\n CONFIRMED = 'CONFIRMED',\n FAILED = 'FAILED',\n}\n\nexport type RelayerRevokeSessionSignerResponse = {\n /** Lifecycle status of the revocation operation. */\n status: RelayerRevokeSessionSignerStatus;\n /** Identifier used to poll the submitted transaction. */\n transactionId: TransactionId;\n};\n\n// The upstream response includes `operationId` and `fenced`. They are omitted\n// from the normalized response because the operation ID has no SDK consumer,\n// while `fenced` is only a submission-time snapshot rather than the eventual\n// revocation outcome.\nexport const RelayerRevokeSessionSignerResponseSchema = z.object({\n status: z.enum(RelayerRevokeSessionSignerStatus),\n transactionId: TransactionIdSchema,\n}) satisfies z.ZodType<RelayerRevokeSessionSignerResponse>;\n","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,6 +1,6 @@
|
|
|
1
1
|
import { TokenId, DecimalString, EpochMilliseconds, ConditionId, IsoDateTimeString, OrderSide, OrderType, TradeStatus, BaseUnits, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId } from '../index.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { P as PerpsInstrumentId, V as PerpsKlineInterval, c as PerpsDepositStatus, j as PerpsTradeId, ac as PerpsOrderId, k as PerpsSide, b as PerpsFundingPaymentId, a4 as PerpsNotificationId, a9 as PerpsNotificationType, a6 as PerpsNotificationOrderType, $ as PerpsMarginType, av as PerpsTimeInForce, af as PerpsOrderStatus, ax as PerpsTpSlKind, aB as PerpsTpSlScope, d as PerpsWithdrawalId, e as PerpsKnownWithdrawalStatus } from '../orders-
|
|
3
|
+
import { P as PerpsInstrumentId, V as PerpsKlineInterval, c as PerpsDepositStatus, j as PerpsTradeId, ac as PerpsOrderId, k as PerpsSide, b as PerpsFundingPaymentId, a4 as PerpsNotificationId, a9 as PerpsNotificationType, a6 as PerpsNotificationOrderType, $ as PerpsMarginType, av as PerpsTimeInForce, af as PerpsOrderStatus, ax as PerpsTpSlKind, aB as PerpsTpSlScope, d as PerpsWithdrawalId, e as PerpsKnownWithdrawalStatus } from '../orders-CAELACaR.js';
|
|
4
4
|
import * as _polymarket_types from '@polymarket/types';
|
|
5
5
|
import { R as ReactionType } from '../comment-C-jBbhp7.js';
|
|
6
6
|
|
|
@@ -2892,7 +2892,7 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2892
2892
|
asset: z.ZodString;
|
|
2893
2893
|
amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
|
|
2894
2894
|
fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2895
|
-
status: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
2895
|
+
status: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownWithdrawalStatus, string>>;
|
|
2896
2896
|
to: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
2897
2897
|
hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
|
|
2898
2898
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -2900,7 +2900,7 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2900
2900
|
asset: string;
|
|
2901
2901
|
amount: BaseUnits;
|
|
2902
2902
|
fee: DecimalString;
|
|
2903
|
-
status:
|
|
2903
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
2904
2904
|
to: _polymarket_types.EvmAddress;
|
|
2905
2905
|
hash: _polymarket_types.TxHash | undefined;
|
|
2906
2906
|
}, {
|
|
@@ -2908,7 +2908,7 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2908
2908
|
asset: string;
|
|
2909
2909
|
amount: BaseUnits;
|
|
2910
2910
|
fee: DecimalString;
|
|
2911
|
-
status:
|
|
2911
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
2912
2912
|
to: _polymarket_types.EvmAddress;
|
|
2913
2913
|
hash?: _polymarket_types.TxHash | undefined;
|
|
2914
2914
|
}>>;
|
|
@@ -2922,7 +2922,7 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2922
2922
|
asset: string;
|
|
2923
2923
|
amount: BaseUnits;
|
|
2924
2924
|
fee: DecimalString;
|
|
2925
|
-
status:
|
|
2925
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
2926
2926
|
to: _polymarket_types.EvmAddress;
|
|
2927
2927
|
hash: _polymarket_types.TxHash | undefined;
|
|
2928
2928
|
};
|
|
@@ -2935,7 +2935,7 @@ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2935
2935
|
asset: string;
|
|
2936
2936
|
amount: BaseUnits;
|
|
2937
2937
|
fee: DecimalString;
|
|
2938
|
-
status:
|
|
2938
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
2939
2939
|
to: _polymarket_types.EvmAddress;
|
|
2940
2940
|
hash: _polymarket_types.TxHash | undefined;
|
|
2941
2941
|
};
|
|
@@ -3838,7 +3838,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
|
|
|
3838
3838
|
asset: z.ZodString;
|
|
3839
3839
|
amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
|
|
3840
3840
|
fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
3841
|
-
status: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
3841
|
+
status: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownWithdrawalStatus, string>>;
|
|
3842
3842
|
to: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
3843
3843
|
hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
|
|
3844
3844
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -3846,7 +3846,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
|
|
|
3846
3846
|
asset: string;
|
|
3847
3847
|
amount: BaseUnits;
|
|
3848
3848
|
fee: DecimalString;
|
|
3849
|
-
status:
|
|
3849
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
3850
3850
|
to: _polymarket_types.EvmAddress;
|
|
3851
3851
|
hash: _polymarket_types.TxHash | undefined;
|
|
3852
3852
|
}, {
|
|
@@ -3854,7 +3854,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
|
|
|
3854
3854
|
asset: string;
|
|
3855
3855
|
amount: BaseUnits;
|
|
3856
3856
|
fee: DecimalString;
|
|
3857
|
-
status:
|
|
3857
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
3858
3858
|
to: _polymarket_types.EvmAddress;
|
|
3859
3859
|
hash?: _polymarket_types.TxHash | undefined;
|
|
3860
3860
|
}>>;
|
|
@@ -3868,7 +3868,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
|
|
|
3868
3868
|
asset: string;
|
|
3869
3869
|
amount: BaseUnits;
|
|
3870
3870
|
fee: DecimalString;
|
|
3871
|
-
status:
|
|
3871
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
3872
3872
|
to: _polymarket_types.EvmAddress;
|
|
3873
3873
|
hash: _polymarket_types.TxHash | undefined;
|
|
3874
3874
|
};
|
|
@@ -3881,7 +3881,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
|
|
|
3881
3881
|
asset: string;
|
|
3882
3882
|
amount: BaseUnits;
|
|
3883
3883
|
fee: DecimalString;
|
|
3884
|
-
status:
|
|
3884
|
+
status: (string & {}) | PerpsKnownWithdrawalStatus;
|
|
3885
3885
|
to: _polymarket_types.EvmAddress;
|
|
3886
3886
|
hash: _polymarket_types.TxHash | undefined;
|
|
3887
3887
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {N,K,O,P}from'../chunk-UDKFL2IM.js';import {Ga,Ea,Ca as Ca$1,va,za,wa,sb,b as b$1,a,P as P$1,V,pb,Z,ka,oa,_a}from'../chunk-QX4CCP47.js';import {Ba,Pa,y,Va,Ma,ha,ma,$,Ca,Da,fa,za as za$1,Ra,S}from'../chunk-AY4D74DC.js';export{d as TradeStatus}from'../chunk-AY4D74DC.js';import {z}from'zod';var x=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,Ba),re=(p=>(p.Live="LIVE",p.Matched="MATCHED",p.Delayed="DELAYED",p.Unmatched="UNMATCHED",p.Canceled="CANCELED",p))(re||{}),_e=z.enum(re),te=z.object({price:Pa,size:Pa}),b=z.string().regex(/^\d+$/).transform(t=>y(new Date(Number(t)*1e3).toISOString())),xe=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:y(new Date(Number(t)*1e3).toISOString())),ne=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ma,bids:z.array(te),asks:z.array(te),hash:z.string().nullish(),timestamp:ha.nullish(),min_order_size:Va,tick_size:Va,neg_risk:z.boolean().nullish(),last_trade_price:Va}).transform(({event_type:t,asset_id:n,min_order_size:a,tick_size:i,neg_risk:s,last_trade_price:p,...S})=>({topic:"market",type:t,payload:{...S,tokenId:n,minOrderSize:a,tickSize:i,negRisk:s,lastTradePrice:p}})),Te=z.object({asset_id:Ma,price:Pa,size:Pa,side:x,hash:z.string().nullish(),best_bid:Va,best_ask:Va}).transform(({asset_id:t,best_bid:n,best_ask:a,...i})=>({...i,tokenId:t,bestBid:n,bestAsk:a})),ae=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(Te),timestamp:ha.nullish()}).transform(({event_type:t,price_changes:n,...a})=>({topic:"market",type:t,payload:{...a,priceChanges:n}})),ie=z.object({event_type:z.literal("last_trade_price"),market:z.string(),asset_id:Ma,price:Pa,size:Va,fee_rate_bps:Va,side:x,timestamp:ha.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:n,fee_rate_bps:a,transaction_hash:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,feeRateBps:a,transactionHash:i}})),se=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ma,old_tick_size:Va,new_tick_size:Pa,timestamp:ha.nullish()}).transform(({event_type:t,asset_id:n,old_tick_size:a,new_tick_size:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,oldTickSize:a,newTickSize:i}})),oe=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ma,best_bid:Va,best_ask:Va,spread:Va,timestamp:ha.nullish()}).transform(({event_type:t,asset_id:n,best_bid:a,best_ask:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,bestBid:a,bestAsk:i}})),pe=z.object({id:z.string(),ticker:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),description:z.string().nullish()}),ce=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(Ma).nullish(),outcomes:z.array(z.string()).nullish(),event_message:pe.nullish(),timestamp:ha.nullish(),tags:z.array(z.string()).nullish(),condition_id:$.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Va,game_start_time:ma.nullish(),order_price_min_tick_size:Va,group_item_title:z.string().nullish(),taker_base_fee:Va,fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:n,event_message:a,condition_id:i,clob_token_ids:s,sports_market_type:p,game_start_time:S,order_price_min_tick_size:P,group_item_title:E,taker_base_fee:v,fees_enabled:k,fee_schedule:C,...z})=>({topic:"market",type:t,payload:{...z,tokenIds:n,eventMessage:a,conditionId:i,clobTokenIds:s,sportsMarketType:p,gameStartTime:S,orderPriceMinTickSize:P,groupItemTitle:E,takerBaseFee:v,feesEnabled:k,feeSchedule:C}})),me=z.object({event_type:z.literal("market_resolved"),id:z.string(),market:z.string(),assets_ids:z.array(Ma).nullish(),winning_asset_id:Ma.nullish(),winning_outcome:z.string().nullish(),event_message:pe.nullish(),timestamp:ha.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:n,winning_asset_id:a,winning_outcome:i,event_message:s,...p})=>({topic:"market",type:t,payload:{...p,tokenIds:n,winningTokenId:a,winningOutcome:i,eventMessage:s}})),le=(i=>(i.Placement="PLACEMENT",i.Update="UPDATE",i.Cancellation="CANCELLATION",i))(le||{}),be=z.enum(le),ze=z.object({event_type:z.literal("order"),id:z.string(),owner:z.string(),market:z.string(),asset_id:Ma,side:x,order_owner:z.string().nullish(),original_size:Pa,size_matched:Pa,price:Pa,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:be,created_at:b.nullish(),expiration:xe.nullish(),order_type:Ca.nullish(),status:_e.nullish(),maker_address:z.string().nullish(),timestamp:ha}).transform(({event_type:t,type:n,asset_id:a,order_owner:i,original_size:s,size_matched:p,associate_trades:S,created_at:P,expiration:E,order_type:v,maker_address:k,...C})=>({topic:"user",type:t,payload:{...C,orderEventType:n,tokenId:a,orderOwner:i,originalSize:s,sizeMatched:p,associateTrades:S,createdAt:P,expiresAt:E,orderType:v,makerAddress:k}})),Ie=z.object({order_id:z.string(),owner:z.string(),maker_address:z.string().nullish(),matched_amount:Pa,price:Pa,fee_rate_bps:Va,asset_id:Ma,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:x}).transform(({order_id:t,maker_address:n,matched_amount:a,fee_rate_bps:i,asset_id:s,outcome_index:p,...S})=>({...S,orderId:t,makerAddress:n,matchedAmount:a,feeRateBps:i,tokenId:s,outcomeIndex:p})),we=z.object({event_type:z.literal("trade"),type:z.literal("TRADE"),id:z.string(),taker_order_id:z.string(),market:z.string(),asset_id:Ma,side:x,size:Pa,fee_rate_bps:Va,price:Pa,status:Da,match_time:b.nullish(),matchtime:b.nullish(),last_update:b.nullish(),outcome:z.string().nullish(),owner:z.string(),trade_owner:z.string().nullish(),maker_address:z.string().nullish(),transaction_hash:z.string().nullish(),bucket_index:z.number().int().nullish(),maker_orders:z.array(Ie).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:ha}).transform(({event_type:t,type:n,taker_order_id:a,asset_id:i,fee_rate_bps:s,match_time:p,matchtime:S,last_update:P,trade_owner:E,maker_address:v,transaction_hash:k,bucket_index:C,maker_orders:z,trader_side:ke,...Ce})=>({topic:"user",type:t,payload:{...Ce,takerOrderId:a,tokenId:i,feeRateBps:s,matchedAt:p??S,updatedAt:P,tradeOwner:E,makerAddress:v,transactionHash:k,bucketIndex:C,makerOrders:z,traderSide:ke}})),qt=z.discriminatedUnion("event_type",[ne,ae,ie,se]),Ot=z.discriminatedUnion("event_type",[oe,ce,me]),jt=z.discriminatedUnion("event_type",[ne,ae,ie,se,oe,ce,me]),Nt=z.discriminatedUnion("event_type",[ze,we]);var de=z.number().int().nonnegative(),Ue=z.string().regex(/^trades::\d+$/),Me=z.string().regex(/^bbo::\d+$/),Re=z.string().regex(/^book::\d+$/),Ae=z.string().regex(/^tickers::(all|\d+)$/),Be=z.string().regex(/^statistics::(all|\d+)$/),qe=z.string().regex(/^klines::\d+::(1m|5m|15m|1h|4h|1d|1w)$/),Oe=z.string().regex(/^tpsl::\d+$/),je=z.enum(["balances","portfolio","orders","fills","funding","deposits","withdrawals","notifications"]),u=z.object({ts:fa,sq:de}),Ne=u.extend({ch:Ue,data:z.array(Ga)}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.trades",type:"trade",channel:t,timestamp:n,sequence:a,payload:i})),De=u.extend({ch:Me,data:Ea}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.bbo",type:"bbo",channel:t,timestamp:n,sequence:a,payload:i})),Le=u.extend({ch:Re,data:Ca$1}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.book",type:"book",channel:t,timestamp:n,sequence:a,payload:{instrumentId:he(t),...i}})),$e=u.extend({ch:Ae,data:va}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.tickers",type:"ticker",channel:t,timestamp:n,sequence:a,payload:i})),Fe=u.extend({ch:Be,data:za}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.statistics",type:"statistic",channel:t,timestamp:n,sequence:a,payload:i})),Ke=u.extend({ch:qe,data:z.array(wa)}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.candles",type:"candle",channel:t,timestamp:n,sequence:a,payload:{instrumentId:he(t),interval:rt(t),candles:i}})),Qt=z.union([Ne,De,Le,$e,Fe,Ke]),We=u.extend({ch:je});function f(t,n,a){return We.extend({ch:z.literal(n),data:a}).transform(i=>{let s=i;return {type:t,channel:s.ch,timestamp:s.ts,sequence:s.sq,payload:s.data}})}var He=f("balance","balances",P$1),Ye=f("portfolio","portfolio",V),Ze=f("order","orders",pb),Ve=f("fill","fills",z.array(sb)),Qe=f("funding","funding",Z),Ge=f("deposit","deposits",ka),Je=f("withdrawal","withdrawals",oa),Xe=f("notification","notifications",_a),Gt=z.object({ch:z.literal("notifications"),ts:fa,sq:de,type:z.literal("resync")}).transform(({ch:t,ts:n,sq:a})=>({type:"resync",channel:t,timestamp:n,sequence:a})),et=z.object({oid:b$1,st:z.enum(["untriggered","armed","cancelled","expired"]),reason:z.string().optional()}),tt=u.extend({ch:Oe,data:et.transform(t=>({orderId:t.oid,status:t.st,reason:t.reason}))}).transform(({ch:t,ts:n,sq:a,data:i})=>({type:"tpsl",channel:t,timestamp:n,sequence:a,payload:i})),Jt=z.union([He,Ye,Ze,Ve,Qe,Ge,Je,Xe,tt]);function he(t){let[,n]=t.split("::");return a.parse(Number(n))}function rt(t){let[,,n]=t.split("::");return n}var nt=z.object({id:z.string(),body:z.string().nullish(),parentEntityType:za$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()}),at=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:fa,payload:P}),it=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:fa,payload:nt}),st=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:fa,payload:N}),ot=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:fa,payload:N}),Se=z.object({symbol:z.string(),timestamp:fa,value:Ra}),pt="prices.crypto.binance",ct="prices.crypto.chainlink",ue="prices.crypto.chainlink.twap",mt=z.literal("crypto_prices"),lt=z.literal("crypto_prices_chainlink"),dt=z.literal("crypto_prices_twap_thirty"),ht=z.literal("crypto_prices_twap_sixty"),yt=mt.transform(()=>pt),St=lt.transform(()=>ct),ut=dt.transform(()=>ue),ft=ht.transform(()=>ue),Pt=z.object({topic:yt,type:z.literal("update"),timestamp:fa,payload:Se}),Et=z.object({topic:St,type:z.literal("update"),timestamp:fa,payload:Se}),ye=1000000000000000000n;function vt(t){let n=BigInt(t),a=n<0n,i=a?-n:n,s=i/ye,p=(i%ye).toString().padStart(18,"0").replace(/0+$/,"");return S(`${a?"-":""}${s}${p===""?"":`.${p}`}`)}var kt=z.string().regex(/^-?\d+$/).transform(vt),Ct=z.object({symbol:z.string(),value:Ra,full_accuracy_value:kt,timestamp:fa});function fe(t){return Ct.extend({window_s:z.literal(t)}).transform(n=>({symbol:n.symbol,timestamp:n.timestamp,value:n.full_accuracy_value,windowSeconds:n.window_s}))}var Pe=z.object({topic:ut,type:z.literal("update"),timestamp:fa,payload:fe(30)}),Ee=z.object({topic:ft,type:z.literal("update"),timestamp:fa,payload:fe(60)}),nr=z.union([Pe,Ee]),gt=z.discriminatedUnion("topic",[Pt,Et,Pe,Ee]),_t=z.object({symbol:z.string(),value:Ra,full_accuracy_value:Pa.nullish(),timestamp:fa,received_at:fa.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:n,is_carried_forward:a,value:i,...s})=>({...s,value:t??i,receivedAt:n,isCarriedForward:a})),xt=z.object({timestamp:z.number(),value:Ra}),Tt=z.object({symbol:z.string(),data:z.array(xt)}),bt=z.literal("equity_prices"),zt="prices.equity.pyth",ve=bt.transform(()=>zt),It=z.object({topic:ve,type:z.literal("update"),timestamp:fa,payload:_t}),wt=z.object({topic:ve,type:z.literal("subscribe"),timestamp:fa,payload:Tt}),Ut=z.discriminatedUnion("type",[It,wt]),Mt=z.discriminatedUnion("type",[at,it,st,ot]),ar=z.discriminatedUnion("topic",[Mt,gt,Ut]);var Rt=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:ma.nullish(),finished_timestamp:ma.nullish(),turn:z.string().nullish()}).transform(({finishedTimestamp:t,finished_timestamp:n,...a})=>({...a,finishedAt:t??n})),pr=Rt.transform(t=>({topic:"sports",type:"sport_result",payload:t}));export{at as CommentCreatedEventSchema,it as CommentRemovedEventSchema,Mt as CommentsEventSchema,Pt as CryptoPricesBinanceEventSchema,Et as CryptoPricesChainlinkEventSchema,nr as CryptoPricesChainlinkTwapEventSchema,Ee as CryptoPricesChainlinkTwapSixtyEventSchema,Pe as CryptoPricesChainlinkTwapThirtyEventSchema,gt as CryptoPricesEventSchema,Ot as CustomMarketEventSchema,Ut as EquityPricesEventSchema,wt as EquityPricesSubscribeEventSchema,It as EquityPricesUpdateEventSchema,oe as MarketBestBidAskEventSchema,ne as MarketBookEventSchema,jt as MarketEventSchema,ie as MarketLastTradePriceEventSchema,ae as MarketPriceChangeEventSchema,me as MarketResolvedEventSchema,se as MarketTickSizeChangeEventSchema,ce as NewMarketEventSchema,He as PerpsBalanceUpdateEventSchema,De as PerpsBboEventSchema,Le as PerpsBookEventSchema,Ke as PerpsCandleEventSchema,Ge as PerpsDepositUpdateEventSchema,Ve as PerpsFillUpdateEventSchema,Qe as PerpsFundingUpdateEventSchema,Qt as PerpsMarketDataEventSchema,Xe as PerpsNotificationUpdateEventSchema,Gt as PerpsNotificationsResyncFrameSchema,Ze as PerpsOrderUpdateEventSchema,Ye as PerpsPortfolioUpdateEventSchema,Jt as PerpsSessionUpdateEventSchema,Fe as PerpsStatisticEventSchema,$e as PerpsTickerEventSchema,tt as PerpsTpSlUpdateEventSchema,Ne as PerpsTradeEventSchema,Je as PerpsWithdrawalUpdateEventSchema,st as ReactionCreatedEventSchema,ot as ReactionRemovedEventSchema,ar as RealtimeEventSchema,pr as SportsResultEventSchema,qt as StandardMarketEventSchema,Nt as UserEventSchema,ze as UserOrderEventSchema,le as UserOrderEventType,re as UserOrderStatus,we as UserTradeEventSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {N,K,O,P}from'../chunk-NFJUONUG.js';import {Ga,Ea,Ca,va,za as za$1,wa,sb,b as b$1,a,P as P$1,V,pb,Z,ka as ka$1,oa,_a}from'../chunk-BAQM5QBB.js';import {za,Na,z as z$1,Ta,Ka,fa,ka,aa,Aa,Ba,da,xa,Pa,T}from'../chunk-WVVJ3WNL.js';export{d as TradeStatus}from'../chunk-WVVJ3WNL.js';import {z}from'zod';var x=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,za),re=(p=>(p.Live="LIVE",p.Matched="MATCHED",p.Delayed="DELAYED",p.Unmatched="UNMATCHED",p.Canceled="CANCELED",p))(re||{}),_e=z.enum(re),te=z.object({price:Na,size:Na}),b=z.string().regex(/^\d+$/).transform(t=>z$1(new Date(Number(t)*1e3).toISOString())),xe=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:z$1(new Date(Number(t)*1e3).toISOString())),ne=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ka,bids:z.array(te),asks:z.array(te),hash:z.string().nullish(),timestamp:fa.nullish(),min_order_size:Ta,tick_size:Ta,neg_risk:z.boolean().nullish(),last_trade_price:Ta}).transform(({event_type:t,asset_id:n,min_order_size:a,tick_size:i,neg_risk:s,last_trade_price:p,...S})=>({topic:"market",type:t,payload:{...S,tokenId:n,minOrderSize:a,tickSize:i,negRisk:s,lastTradePrice:p}})),Te=z.object({asset_id:Ka,price:Na,size:Na,side:x,hash:z.string().nullish(),best_bid:Ta,best_ask:Ta}).transform(({asset_id:t,best_bid:n,best_ask:a,...i})=>({...i,tokenId:t,bestBid:n,bestAsk:a})),ae=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(Te),timestamp:fa.nullish()}).transform(({event_type:t,price_changes:n,...a})=>({topic:"market",type:t,payload:{...a,priceChanges:n}})),ie=z.object({event_type:z.literal("last_trade_price"),market:z.string(),asset_id:Ka,price:Na,size:Ta,fee_rate_bps:Ta,side:x,timestamp:fa.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:n,fee_rate_bps:a,transaction_hash:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,feeRateBps:a,transactionHash:i}})),se=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ka,old_tick_size:Ta,new_tick_size:Na,timestamp:fa.nullish()}).transform(({event_type:t,asset_id:n,old_tick_size:a,new_tick_size:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,oldTickSize:a,newTickSize:i}})),oe=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ka,best_bid:Ta,best_ask:Ta,spread:Ta,timestamp:fa.nullish()}).transform(({event_type:t,asset_id:n,best_bid:a,best_ask:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,bestBid:a,bestAsk:i}})),pe=z.object({id:z.string(),ticker:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),description:z.string().nullish()}),ce=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(Ka).nullish(),outcomes:z.array(z.string()).nullish(),event_message:pe.nullish(),timestamp:fa.nullish(),tags:z.array(z.string()).nullish(),condition_id:aa.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Ta,game_start_time:ka.nullish(),order_price_min_tick_size:Ta,group_item_title:z.string().nullish(),taker_base_fee:Ta,fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:n,event_message:a,condition_id:i,clob_token_ids:s,sports_market_type:p,game_start_time:S,order_price_min_tick_size:P,group_item_title:E,taker_base_fee:v,fees_enabled:k,fee_schedule:C,...z})=>({topic:"market",type:t,payload:{...z,tokenIds:n,eventMessage:a,conditionId:i,clobTokenIds:s,sportsMarketType:p,gameStartTime:S,orderPriceMinTickSize:P,groupItemTitle:E,takerBaseFee:v,feesEnabled:k,feeSchedule:C}})),me=z.object({event_type:z.literal("market_resolved"),id:z.string(),market:z.string(),assets_ids:z.array(Ka).nullish(),winning_asset_id:Ka.nullish(),winning_outcome:z.string().nullish(),event_message:pe.nullish(),timestamp:fa.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:n,winning_asset_id:a,winning_outcome:i,event_message:s,...p})=>({topic:"market",type:t,payload:{...p,tokenIds:n,winningTokenId:a,winningOutcome:i,eventMessage:s}})),le=(i=>(i.Placement="PLACEMENT",i.Update="UPDATE",i.Cancellation="CANCELLATION",i))(le||{}),be=z.enum(le),ze=z.object({event_type:z.literal("order"),id:z.string(),owner:z.string(),market:z.string(),asset_id:Ka,side:x,order_owner:z.string().nullish(),original_size:Na,size_matched:Na,price:Na,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:be,created_at:b.nullish(),expiration:xe.nullish(),order_type:Aa.nullish(),status:_e.nullish(),maker_address:z.string().nullish(),timestamp:fa}).transform(({event_type:t,type:n,asset_id:a,order_owner:i,original_size:s,size_matched:p,associate_trades:S,created_at:P,expiration:E,order_type:v,maker_address:k,...C})=>({topic:"user",type:t,payload:{...C,orderEventType:n,tokenId:a,orderOwner:i,originalSize:s,sizeMatched:p,associateTrades:S,createdAt:P,expiresAt:E,orderType:v,makerAddress:k}})),Ie=z.object({order_id:z.string(),owner:z.string(),maker_address:z.string().nullish(),matched_amount:Na,price:Na,fee_rate_bps:Ta,asset_id:Ka,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:x}).transform(({order_id:t,maker_address:n,matched_amount:a,fee_rate_bps:i,asset_id:s,outcome_index:p,...S})=>({...S,orderId:t,makerAddress:n,matchedAmount:a,feeRateBps:i,tokenId:s,outcomeIndex:p})),we=z.object({event_type:z.literal("trade"),type:z.literal("TRADE"),id:z.string(),taker_order_id:z.string(),market:z.string(),asset_id:Ka,side:x,size:Na,fee_rate_bps:Ta,price:Na,status:Ba,match_time:b.nullish(),matchtime:b.nullish(),last_update:b.nullish(),outcome:z.string().nullish(),owner:z.string(),trade_owner:z.string().nullish(),maker_address:z.string().nullish(),transaction_hash:z.string().nullish(),bucket_index:z.number().int().nullish(),maker_orders:z.array(Ie).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:fa}).transform(({event_type:t,type:n,taker_order_id:a,asset_id:i,fee_rate_bps:s,match_time:p,matchtime:S,last_update:P,trade_owner:E,maker_address:v,transaction_hash:k,bucket_index:C,maker_orders:z,trader_side:ke,...Ce})=>({topic:"user",type:t,payload:{...Ce,takerOrderId:a,tokenId:i,feeRateBps:s,matchedAt:p??S,updatedAt:P,tradeOwner:E,makerAddress:v,transactionHash:k,bucketIndex:C,makerOrders:z,traderSide:ke}})),qt=z.discriminatedUnion("event_type",[ne,ae,ie,se]),Ot=z.discriminatedUnion("event_type",[oe,ce,me]),jt=z.discriminatedUnion("event_type",[ne,ae,ie,se,oe,ce,me]),Nt=z.discriminatedUnion("event_type",[ze,we]);var de=z.number().int().nonnegative(),Ue=z.string().regex(/^trades::\d+$/),Me=z.string().regex(/^bbo::\d+$/),Re=z.string().regex(/^book::\d+$/),Ae=z.string().regex(/^tickers::(all|\d+)$/),Be=z.string().regex(/^statistics::(all|\d+)$/),qe=z.string().regex(/^klines::\d+::(1m|5m|15m|1h|4h|1d|1w)$/),Oe=z.string().regex(/^tpsl::\d+$/),je=z.enum(["balances","portfolio","orders","fills","funding","deposits","withdrawals","notifications"]),u=z.object({ts:da,sq:de}),Ne=u.extend({ch:Ue,data:z.array(Ga)}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.trades",type:"trade",channel:t,timestamp:n,sequence:a,payload:i})),De=u.extend({ch:Me,data:Ea}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.bbo",type:"bbo",channel:t,timestamp:n,sequence:a,payload:i})),Le=u.extend({ch:Re,data:Ca}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.book",type:"book",channel:t,timestamp:n,sequence:a,payload:{instrumentId:he(t),...i}})),$e=u.extend({ch:Ae,data:va}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.tickers",type:"ticker",channel:t,timestamp:n,sequence:a,payload:i})),Fe=u.extend({ch:Be,data:za$1}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.statistics",type:"statistic",channel:t,timestamp:n,sequence:a,payload:i})),Ke=u.extend({ch:qe,data:z.array(wa)}).transform(({ch:t,ts:n,sq:a,data:i})=>({topic:"perps.candles",type:"candle",channel:t,timestamp:n,sequence:a,payload:{instrumentId:he(t),interval:rt(t),candles:i}})),Qt=z.union([Ne,De,Le,$e,Fe,Ke]),We=u.extend({ch:je});function f(t,n,a){return We.extend({ch:z.literal(n),data:a}).transform(i=>{let s=i;return {type:t,channel:s.ch,timestamp:s.ts,sequence:s.sq,payload:s.data}})}var He=f("balance","balances",P$1),Ye=f("portfolio","portfolio",V),Ze=f("order","orders",pb),Ve=f("fill","fills",z.array(sb)),Qe=f("funding","funding",Z),Ge=f("deposit","deposits",ka$1),Je=f("withdrawal","withdrawals",oa),Xe=f("notification","notifications",_a),Gt=z.object({ch:z.literal("notifications"),ts:da,sq:de,type:z.literal("resync")}).transform(({ch:t,ts:n,sq:a})=>({type:"resync",channel:t,timestamp:n,sequence:a})),et=z.object({oid:b$1,st:z.enum(["untriggered","armed","cancelled","expired"]),reason:z.string().optional()}),tt=u.extend({ch:Oe,data:et.transform(t=>({orderId:t.oid,status:t.st,reason:t.reason}))}).transform(({ch:t,ts:n,sq:a,data:i})=>({type:"tpsl",channel:t,timestamp:n,sequence:a,payload:i})),Jt=z.union([He,Ye,Ze,Ve,Qe,Ge,Je,Xe,tt]);function he(t){let[,n]=t.split("::");return a.parse(Number(n))}function rt(t){let[,,n]=t.split("::");return n}var nt=z.object({id:z.string(),body:z.string().nullish(),parentEntityType:xa.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()}),at=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:da,payload:P}),it=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:da,payload:nt}),st=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:da,payload:N}),ot=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:da,payload:N}),Se=z.object({symbol:z.string(),timestamp:da,value:Pa}),pt="prices.crypto.binance",ct="prices.crypto.chainlink",ue="prices.crypto.chainlink.twap",mt=z.literal("crypto_prices"),lt=z.literal("crypto_prices_chainlink"),dt=z.literal("crypto_prices_twap_thirty"),ht=z.literal("crypto_prices_twap_sixty"),yt=mt.transform(()=>pt),St=lt.transform(()=>ct),ut=dt.transform(()=>ue),ft=ht.transform(()=>ue),Pt=z.object({topic:yt,type:z.literal("update"),timestamp:da,payload:Se}),Et=z.object({topic:St,type:z.literal("update"),timestamp:da,payload:Se}),ye=1000000000000000000n;function vt(t){let n=BigInt(t),a=n<0n,i=a?-n:n,s=i/ye,p=(i%ye).toString().padStart(18,"0").replace(/0+$/,"");return T(`${a?"-":""}${s}${p===""?"":`.${p}`}`)}var kt=z.string().regex(/^-?\d+$/).transform(vt),Ct=z.object({symbol:z.string(),value:Pa,full_accuracy_value:kt,timestamp:da});function fe(t){return Ct.extend({window_s:z.literal(t)}).transform(n=>({symbol:n.symbol,timestamp:n.timestamp,value:n.full_accuracy_value,windowSeconds:n.window_s}))}var Pe=z.object({topic:ut,type:z.literal("update"),timestamp:da,payload:fe(30)}),Ee=z.object({topic:ft,type:z.literal("update"),timestamp:da,payload:fe(60)}),nr=z.union([Pe,Ee]),gt=z.discriminatedUnion("topic",[Pt,Et,Pe,Ee]),_t=z.object({symbol:z.string(),value:Pa,full_accuracy_value:Na.nullish(),timestamp:da,received_at:da.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:n,is_carried_forward:a,value:i,...s})=>({...s,value:t??i,receivedAt:n,isCarriedForward:a})),xt=z.object({timestamp:z.number(),value:Pa}),Tt=z.object({symbol:z.string(),data:z.array(xt)}),bt=z.literal("equity_prices"),zt="prices.equity.pyth",ve=bt.transform(()=>zt),It=z.object({topic:ve,type:z.literal("update"),timestamp:da,payload:_t}),wt=z.object({topic:ve,type:z.literal("subscribe"),timestamp:da,payload:Tt}),Ut=z.discriminatedUnion("type",[It,wt]),Mt=z.discriminatedUnion("type",[at,it,st,ot]),ar=z.discriminatedUnion("topic",[Mt,gt,Ut]);var Rt=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:ka.nullish(),finished_timestamp:ka.nullish(),turn:z.string().nullish()}).transform(({finishedTimestamp:t,finished_timestamp:n,...a})=>({...a,finishedAt:t??n})),pr=Rt.transform(t=>({topic:"sports",type:"sport_result",payload:t}));export{at as CommentCreatedEventSchema,it as CommentRemovedEventSchema,Mt as CommentsEventSchema,Pt as CryptoPricesBinanceEventSchema,Et as CryptoPricesChainlinkEventSchema,nr as CryptoPricesChainlinkTwapEventSchema,Ee as CryptoPricesChainlinkTwapSixtyEventSchema,Pe as CryptoPricesChainlinkTwapThirtyEventSchema,gt as CryptoPricesEventSchema,Ot as CustomMarketEventSchema,Ut as EquityPricesEventSchema,wt as EquityPricesSubscribeEventSchema,It as EquityPricesUpdateEventSchema,oe as MarketBestBidAskEventSchema,ne as MarketBookEventSchema,jt as MarketEventSchema,ie as MarketLastTradePriceEventSchema,ae as MarketPriceChangeEventSchema,me as MarketResolvedEventSchema,se as MarketTickSizeChangeEventSchema,ce as NewMarketEventSchema,He as PerpsBalanceUpdateEventSchema,De as PerpsBboEventSchema,Le as PerpsBookEventSchema,Ke as PerpsCandleEventSchema,Ge as PerpsDepositUpdateEventSchema,Ve as PerpsFillUpdateEventSchema,Qe as PerpsFundingUpdateEventSchema,Qt as PerpsMarketDataEventSchema,Xe as PerpsNotificationUpdateEventSchema,Gt as PerpsNotificationsResyncFrameSchema,Ze as PerpsOrderUpdateEventSchema,Ye as PerpsPortfolioUpdateEventSchema,Jt as PerpsSessionUpdateEventSchema,Fe as PerpsStatisticEventSchema,$e as PerpsTickerEventSchema,tt as PerpsTpSlUpdateEventSchema,Ne as PerpsTradeEventSchema,Je as PerpsWithdrawalUpdateEventSchema,st as ReactionCreatedEventSchema,ot as ReactionRemovedEventSchema,ar as RealtimeEventSchema,pr as SportsResultEventSchema,qt as StandardMarketEventSchema,Nt as UserEventSchema,ze as UserOrderEventSchema,le as UserOrderEventType,re as UserOrderStatus,we as UserTradeEventSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|