@polymarket/bindings 0.1.0-beta.6 → 0.1.0-beta.7

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.
@@ -0,0 +1,2 @@
1
+ import {Ga,Ha,aa,$ as $$1,La,Ja,P}from'./chunk-SB2LAVJ4.js';import {z as z$1}from'zod';function R(e){return e}var i=z$1.number().int().nonnegative().transform(R),x=z$1.number().int().nonnegative().transform(R),w=z$1.string().regex(/^[0-9a-f]{32}$/).transform(e=>e),_=z$1.number().int().nonnegative().transform(R),v=z$1.number().int().nonnegative().transform(R),A=z$1.number().int().nonnegative().transform(R),$=Ja,B=(P=>(P.Perpetual="perpetual",P))(B||{}),M=(h=>(h.Equity="equity",h.Commodity="commodity",h.Index="index",h.Crypto="crypto",h))(M||{}),H=(b=>(b.Long="long",b.Short="short",b))(H||{}),L=(d=>(d.Gtc="gtc",d.Ioc="ioc",d.Fok="fok",d))(L||{}),W=(d=>(d.Pending="pending",d.Confirmed="confirmed",d.Removed="removed",d))(W||{}),Q=(d=>(d.Pending="pending",d.Confirmed="confirmed",d.Removed="removed",d))(Q||{}),U=(b=>(b.In="in",b.Out="out",b))(U||{}),N=(S=>(S.OneSecond="1s",S.OneMinute="1m",S.FiveMinutes="5m",S.FifteenMinutes="15m",S.OneHour="1h",S.FourHours="4h",S.OneDay="1d",S.OneWeek="1w",S))(N||{}),V=(h=>(h.OneHour="1h",h.FourHours="4h",h.OneDay="1d",h.OneWeek="1w",h))(V||{}),q=z$1.enum(B),T=z$1.enum(M),g=z$1.enum(H),k=z$1.enum(L),j=z$1.enum(W),z=z$1.enum(Q),O=z$1.enum(U),Ie=z$1.enum(N),Re=z$1.enum(V),o=z$1.string().min(1),f=z$1.preprocess(e=>e==="0x"||e===""?void 0:e,Ga.optional()),u=e=>z$1.object({data:z$1.array(e),more:z$1.boolean()});function ve(e){return $.parse(e)}function qe(e){return La.parse(e)}function Te(e){return P(e)}var J=z$1.object({asset:o,balance:Ha,value:Ha}),we=z$1.array(J),K=z$1.object({instrumentId:i,symbol:z$1.string().min(1),size:Ha,entryPrice:Ha,leverage:z$1.number().int().positive(),cross:z$1.boolean(),initialMargin:Ha,maintenanceMargin:Ha,positionValue:Ha,liquidationPrice:Ha,unrealizedPnl:Ha,returnOnEquity:Ha,cumulativeFunding:Ha}),Y=z$1.object({instrument_id:i,symbol:z$1.string().min(1),size:Ha,entry_price:Ha,leverage:z$1.number().int().positive(),cross:z$1.boolean(),initial_margin:Ha,maintenance_margin:Ha,position_value:Ha,liquidation_price:Ha,unrealized_pnl:Ha,return_on_equity:Ha,cumulative_funding:Ha}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,size:e.size,entryPrice:e.entry_price,leverage:e.leverage,cross:e.cross,initialMargin:e.initial_margin,maintenanceMargin:e.maintenance_margin,positionValue:e.position_value,liquidationPrice:e.liquidation_price,unrealizedPnl:e.unrealized_pnl,returnOnEquity:e.return_on_equity,cumulativeFunding:e.cumulative_funding})),ee=z$1.object({totalAccountValue:Ha,totalInitialMargin:Ha,totalMaintenanceMargin:Ha,totalPositionValue:Ha}),te=z$1.object({total_account_value:Ha,total_initial_margin:Ha,total_maintenance_margin:Ha,total_position_value:Ha}).transform(e=>({totalAccountValue:e.total_account_value,totalInitialMargin:e.total_initial_margin,totalMaintenanceMargin:e.total_maintenance_margin,totalPositionValue:e.total_position_value})),Ae=z$1.object({positions:z$1.array(K),margin:ee,withdrawable:Ha,inLiquidation:z$1.boolean(),timestamp:aa}),re=z$1.object({positions:z$1.array(Y),margin:te,withdrawable:Ha,in_liquidation:z$1.boolean(),timestamp:aa}).transform(e=>({positions:e.positions,margin:e.margin,withdrawable:e.withdrawable,inLiquidation:e.in_liquidation,timestamp:e.timestamp})),Oe=re,De=z$1.object({instrumentId:i,size:Ha,fundingRate:Ha,fundingAsset:o,funding:Ha,timestamp:aa}),ne=z$1.object({instrument_id:i,size:Ha,funding_rate:Ha,funding_asset:o,funding:Ha,timestamp:aa}).transform(e=>({instrumentId:e.instrument_id,size:e.size,fundingRate:e.funding_rate,fundingAsset:e.funding_asset,funding:e.funding,timestamp:e.timestamp})),Ce=u(ne),Ee=z$1.object({iid:i,sz:Ha,fr:Ha,fund:Ha,fua:o,ts:aa}).transform(e=>({instrumentId:e.iid,size:e.sz,fundingRate:e.fr,fundingAsset:e.fua,funding:e.fund,timestamp:e.ts})),Be=z$1.object({instrumentId:i,leverage:z$1.number().int().positive(),cross:z$1.boolean()}),ae=z$1.object({instrument_id:i,leverage:z$1.number().int().positive(),cross:z$1.boolean()}).transform(e=>({instrumentId:e.instrument_id,leverage:e.leverage,cross:e.cross})),Me=z$1.array(ae),se=z$1.tuple([aa,Ha]).transform(([e,P])=>({timestamp:e,equity:P})),He=u(se),ie=z$1.tuple([aa,Ha]).transform(([e,P])=>({timestamp:e,pnl:P})),Le=u(ie),oe=z$1.number().finite().positive().refine(e=>Number.isInteger(e),"Expected integer").transform(e=>e>Number.MAX_SAFE_INTEGER?Math.floor(e/1e6):e).pipe(aa),We=z$1.object({proxy:$$1,label:z$1.string().optional(),expiresAt:aa}),me=z$1.object({proxy:$$1,label:z$1.string().optional(),expiry:oe}).transform(e=>({proxy:e.proxy,label:e.label,expiresAt:e.expiry})),Qe=z$1.object({address:$$1,keys:z$1.array(me)}).transform(e=>({address:e.address,keys:e.keys})),Ue=z$1.object({secret:z$1.string().min(1)}),Ne=z$1.object({status:z$1.enum(["ok","err"]),error:z$1.string().optional()});var $e=z$1.object({hash:Ga,asset:o,amount:La,status:j,from:$$1,to:$$1,confirmations:z$1.number().int().nonnegative(),requiredConfirmations:z$1.number().int().nonnegative(),createdTimestamp:aa,confirmedTimestamp:aa.optional()}),pe=z$1.object({hash:Ga,asset:o,amount:La,status:j,from:$$1,to:$$1,confirmations:z$1.number().int().nonnegative(),required_confirmations:z$1.number().int().nonnegative(),created_timestamp:aa,confirmed_timestamp:aa.optional()}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status,from:e.from,to:e.to,confirmations:e.confirmations,requiredConfirmations:e.required_confirmations,createdTimestamp:e.created_timestamp,confirmedTimestamp:e.confirmed_timestamp})),Je=u(pe),Ke=z$1.object({hash:f,asset:o,amount:La,status:j}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status})),Ye=z$1.object({withdrawalId:v,asset:o,amount:La,fee:Ha,status:z,to:$$1,hash:Ga.optional(),confirmations:z$1.number().int().nonnegative(),requiredConfirmations:z$1.number().int().nonnegative(),createdTimestamp:aa,confirmedTimestamp:aa.optional()}),ce=z$1.object({withdraw_id:v,asset:o,amount:La,fee:Ha,status:z,to:$$1,hash:f,confirmations:z$1.number().int().nonnegative(),required_confirmations:z$1.number().int().nonnegative(),created_timestamp:aa,confirmed_timestamp:aa.optional()}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash,confirmations:e.confirmations,requiredConfirmations:e.required_confirmations,createdTimestamp:e.created_timestamp,confirmedTimestamp:e.confirmed_timestamp})),et=u(ce),tt=z$1.object({status:z$1.enum(["ok","err"]),withdraw_id:v.optional(),error:z$1.string().optional()}).transform(e=>({status:e.status,withdrawalId:e.withdraw_id,error:e.error})),rt=z$1.object({withdraw_id:v,asset:o,amount:La,fee:Ha,status:z,to:$$1,hash:f}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash})),nt=z$1.object({transferId:A,asset:o,amount:La,direction:O,counterparty:$$1,label:z$1.string().optional(),createdTimestamp:aa}),at=z$1.object({transfer_id:A,asset:o,amount:La,direction:O,counterparty:$$1,label:z$1.string().optional(),created_timestamp:aa}).transform(e=>({transferId:e.transfer_id,asset:e.asset,amount:e.amount,direction:e.direction,counterparty:e.counterparty,label:e.label,createdTimestamp:e.created_timestamp}));var de=z$1.object({lowerBound:Ha,maxLeverage:z$1.number().int().positive()}),ue=z$1.object({lower_bound:Ha,max_leverage:z$1.number().int().positive()}).transform(e=>({lowerBound:e.lower_bound,maxLeverage:e.max_leverage})),pt=z$1.object({instrumentId:i,instrumentType:q,category:T,symbol:z$1.string().min(1),baseAsset:o,quoteAsset:o,fundingInterval:z$1.string().min(1),quantityDecimals:z$1.number().int().nonnegative(),priceDecimals:z$1.number().int().nonnegative(),priceBounds:Ha,liquidationFee:Ha,maxOrderCount:z$1.number().int().positive(),minNotional:Ha,maxMarketNotional:Ha,maxLimitNotional:Ha,maxLeverage:z$1.number().int().positive(),riskTiers:z$1.array(de)}),he=z$1.object({instrument_id:i,instrument_type:q,category:T,symbol:z$1.string().min(1),base_asset:o,quote_asset:o,funding_interval:z$1.string().min(1),quantity_decimals:z$1.number().int().nonnegative(),price_decimals:z$1.number().int().nonnegative(),price_bounds:Ha,liquidation_fee:Ha,max_order_count:z$1.number().int().positive(),min_notional:Ha,max_market_notional:Ha,max_limit_notional:Ha,max_leverage:z$1.number().int().positive(),risk_tiers:z$1.array(ue)}).transform(e=>({instrumentId:e.instrument_id,instrumentType:e.instrument_type,category:e.category,symbol:e.symbol,baseAsset:e.base_asset,quoteAsset:e.quote_asset,fundingInterval:e.funding_interval,quantityDecimals:e.quantity_decimals,priceDecimals:e.price_decimals,priceBounds:e.price_bounds,liquidationFee:e.liquidation_fee,maxOrderCount:e.max_order_count,minNotional:e.min_notional,maxMarketNotional:e.max_market_notional,maxLimitNotional:e.max_limit_notional,maxLeverage:e.max_leverage,riskTiers:e.risk_tiers})),ct=z$1.array(he),dt=z$1.object({instrumentId:i,symbol:z$1.string().min(1),indexPrice:Ha,markPrice:Ha,lastPrice:Ha,midPrice:Ha,openInterest:Ha,fundingRate:Ha,nextFunding:aa,volume24h:Ha.optional(),openPrice:Ha.optional(),timestamp:aa.optional()}),le=z$1.object({instrument_id:i,symbol:z$1.string().min(1),index_price:Ha,mark_price:Ha,last_price:Ha,mid_price:Ha,open_interest:Ha,funding_rate:Ha,next_funding:aa,timestamp:aa.optional()}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,indexPrice:e.index_price,markPrice:e.mark_price,lastPrice:e.last_price,midPrice:e.mid_price,openInterest:e.open_interest,fundingRate:e.funding_rate,nextFunding:e.next_funding,timestamp:e.timestamp})),ut=z$1.array(le),ht=z$1.object({iid:i,idx:Ha,mark:Ha,last:Ha,mid:Ha,oi:Ha,fr:Ha,nxf:aa}).transform(e=>({instrumentId:e.iid,indexPrice:e.idx,markPrice:e.mark,lastPrice:e.last,midPrice:e.mid,openInterest:e.oi,fundingRate:e.fr,nextFunding:e.nxf})),F=z$1.tuple([aa,Ha,Ha,Ha,Ha,Ha,z$1.number().int().nonnegative()]).transform(([e,P,b,d,h,X,Z])=>({timestamp:e,open:P,high:b,low:d,close:h,volume:X,trades:Z})),lt=z$1.object({instrumentId:i,symbol:z$1.string().min(1).optional(),volume:Ha,openPrice:Ha,klines:z$1.array(F)}),ye=z$1.object({instrument_id:i,symbol:z$1.string().min(1).optional(),volume:Ha,open_price:Ha,klines:z$1.array(F)}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,volume:e.volume,openPrice:e.open_price,klines:e.klines})),yt=z$1.array(ye),Pt=z$1.object({iid:i,vol:Ha,open:Ha,klines:z$1.array(F)}).transform(e=>({instrumentId:e.iid,volume:e.vol,openPrice:e.open,klines:e.klines})),I=z$1.tuple([Ha,Ha]).transform(([e,P])=>({price:e,quantity:P})),xt=z$1.object({instrumentId:i,bids:z$1.array(I),asks:z$1.array(I),timestamp:aa,sequence:z$1.number().int().nonnegative()}),ft=z$1.object({instrument_id:i,bids:z$1.array(I),asks:z$1.array(I),timestamp:aa,sequence:z$1.number().int().nonnegative()}).transform(e=>({instrumentId:e.instrument_id,bids:e.bids,asks:e.asks,timestamp:e.timestamp,sequence:e.sequence})),St=z$1.object({b:z$1.array(I),a:z$1.array(I)}).transform(e=>({bids:e.b,asks:e.a})),_t=z$1.object({instrumentId:i,bidPrice:Ha,bidQuantity:Ha,askPrice:Ha,askQuantity:Ha,timestamp:aa.optional()}),gt=z$1.object({instrument_id:i,bid_price:Ha,bid_quantity:Ha,ask_price:Ha,ask_quantity:Ha,timestamp:aa.optional()}).transform(e=>({instrumentId:e.instrument_id,bidPrice:e.bid_price,bidQuantity:e.bid_quantity,askPrice:e.ask_price,askQuantity:e.ask_quantity,timestamp:e.timestamp})),bt=z$1.object({iid:i,bp:Ha,bq:Ha,ap:Ha,aq:Ha}).transform(e=>({instrumentId:e.iid,bidPrice:e.bp,bidQuantity:e.bq,askPrice:e.ap,askQuantity:e.aq})),It=z$1.object({tradeId:_,instrumentId:i,side:g,price:Ha,quantity:Ha,timestamp:aa,hash:Ga.optional()}),Pe=z$1.object({trade_id:_,instrument_id:i,side:g,price:Ha,quantity:Ha,timestamp:aa,hash:f}).transform(e=>({tradeId:e.trade_id,instrumentId:e.instrument_id,side:e.side,price:e.price,quantity:e.quantity,timestamp:e.timestamp,hash:e.hash})),Rt=z$1.object({tid:_,iid:i,side:g,p:Ha,qty:Ha,ts:aa,hash:f}).transform(e=>({tradeId:e.tid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,timestamp:e.ts,hash:e.hash})),vt=u(Pe),qt=z$1.object({fundingRate:Ha,timestamp:aa}),xe=z$1.object({funding_rate:Ha,timestamp:aa}).transform(e=>({fundingRate:e.funding_rate,timestamp:e.timestamp})),Tt=u(xe),fe=z$1.object({instrumentType:q,category:T,takerFeeRate:Ha,makerFeeRate:Ha}),Se=z$1.object({instrument_type:q,category:T,taker_fee_rate:Ha,maker_fee_rate:Ha}).transform(e=>({instrumentType:e.instrument_type,category:e.category,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate})),kt=z$1.object({feeSchedule:z$1.array(fe)}),jt=z$1.object({fee_schedule:z$1.array(Se)}).transform(e=>({feeSchedule:e.fee_schedule})),zt=u(F);var Dt=z$1.object({orderId:x,instrumentId:i,buy:z$1.boolean(),price:Ha,quantity:Ha,timeInForce:k,postOnly:z$1.boolean(),status:z$1.string().min(1),restingQuantity:Ha,filledQuantity:Ha,createdTimestamp:aa,updatedTimestamp:aa,clientOrderId:z$1.string().optional()}),D=z$1.enum(["ok","err"]),Ct=z$1.object({status:D,orderId:x.optional(),clientOrderId:w.optional(),error:z$1.string().optional()}),Et=z$1.object({status:D,oid:x.optional(),coid:w.optional(),error:z$1.string().optional()}).transform(e=>({status:e.status,orderId:e.oid,clientOrderId:e.coid,error:e.error})),Bt=z$1.object({status:D,error:z$1.string().optional()}),G=z$1.object({order_id:x,instrument_id:i,buy:z$1.boolean(),price:Ha,quantity:Ha,tif:k,post_only:z$1.boolean(),status:z$1.string().min(1),resting_quantity:Ha,filled_quantity:Ha,created_timestamp:aa,updated_timestamp:aa,client_order_id:z$1.string().optional()}).transform(e=>({orderId:e.order_id,instrumentId:e.instrument_id,buy:e.buy,price:e.price,quantity:e.quantity,timeInForce:e.tif,postOnly:e.post_only,status:e.status,restingQuantity:e.resting_quantity,filledQuantity:e.filled_quantity,createdTimestamp:e.created_timestamp,updatedTimestamp:e.updated_timestamp,clientOrderId:e.client_order_id})),Mt=z$1.array(G),Ht=z$1.array(G),Lt=z$1.object({oid:x,iid:i,buy:z$1.boolean(),p:Ha,qty:Ha,tif:k,po:z$1.boolean(),status:z$1.string().min(1),rest:Ha,fill:Ha,cts:aa,uts:aa,coid:z$1.string().optional()}).transform(e=>({orderId:e.oid,instrumentId:e.iid,buy:e.buy,price:e.p,quantity:e.qty,timeInForce:e.tif,postOnly:e.po,status:e.status,restingQuantity:e.rest,filledQuantity:e.fill,createdTimestamp:e.cts,updatedTimestamp:e.uts,clientOrderId:e.coid})),Wt=z$1.object({tradeId:_,orderId:x,instrumentId:i,side:g,price:Ha,quantity:Ha,taker:z$1.boolean(),fee:Ha,feeAsset:o,previousSize:Ha,previousEntryPrice:Ha,pnl:Ha,liquidation:z$1.boolean(),timestamp:aa,hash:Ga.optional(),clientOrderId:z$1.string().optional()}),_e=z$1.object({trade_id:_,order_id:x,instrument_id:i,side:g,price:Ha,quantity:Ha,taker:z$1.boolean(),fee:Ha,fee_asset:o,previous_size:Ha,previous_entry_price:Ha,pnl:Ha,liquidation:z$1.boolean(),timestamp:aa,hash:f}).transform(e=>({tradeId:e.trade_id,orderId:e.order_id,instrumentId:e.instrument_id,side:e.side,price:e.price,quantity:e.quantity,taker:e.taker,fee:e.fee,feeAsset:e.fee_asset,previousSize:e.previous_size,previousEntryPrice:e.previous_entry_price,pnl:e.pnl,liquidation:e.liquidation,timestamp:e.timestamp,hash:e.hash})),Qt=u(_e),Ut=z$1.object({tid:_,oid:x,iid:i,side:g,p:Ha,qty:Ha,taker:z$1.boolean(),fee:Ha,fea:o,psz:Ha,pep:Ha,pnl:Ha,liq:z$1.boolean(),ts:aa,coid:z$1.string().optional()}).transform(e=>({tradeId:e.tid,orderId:e.oid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,taker:e.taker,fee:e.fee,feeAsset:e.fea,previousSize:e.psz,previousEntryPrice:e.pep,pnl:e.pnl,liquidation:e.liq,timestamp:e.ts,clientOrderId:e.coid}));export{Ue as $,Wt as $a,f as A,xt as Aa,u as B,ft as Ba,ve as C,St as Ca,qe as D,_t as Da,Te as E,gt as Ea,J as F,bt as Fa,we as G,It as Ga,K as H,Pe as Ha,Y as I,Rt as Ia,ee as J,vt as Ja,Ae as K,qt as Ka,re as L,xe as La,Oe as M,Tt as Ma,De as N,fe as Na,ne as O,Se as Oa,Ce as P,kt as Pa,Ee as Q,jt as Qa,Be as R,zt as Ra,ae as S,Dt as Sa,Me as T,D as Ta,se as U,Ct as Ua,He as V,Et as Va,ie as W,Bt as Wa,Le as X,G as Xa,We as Y,Mt as Ya,me as Z,Ht as Za,Qe as _,Lt as _a,i as a,Ne as aa,_e as ab,x as b,$e as ba,Qt as bb,w as c,pe as ca,Ut as cb,_ as d,Je as da,v as e,Ke as ea,A as f,Ye as fa,$ as g,ce as ga,B as h,et as ha,M as i,tt as ia,H as j,rt as ja,L as k,nt as ka,W as l,at as la,Q as m,de as ma,U as n,pt as na,N as o,he as oa,V as p,ct as pa,q,dt as qa,T as r,le as ra,g as s,ut as sa,k as t,ht as ta,j as u,F as ua,z as v,lt as va,O as w,ye as wa,Ie as x,yt as xa,Re as y,Pt as ya,o as z,I as za};//# sourceMappingURL=chunk-CFT5AXUR.js.map
2
+ //# sourceMappingURL=chunk-CFT5AXUR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/perps/common.ts","../src/perps/account.ts","../src/perps/funds.ts","../src/perps/market.ts","../src/perps/orders.ts"],"names":["taggedInteger","value","PerpsInstrumentIdSchema","z","PerpsOrderIdSchema","PerpsClientOrderIdSchema","PerpsTradeIdSchema","PerpsWithdrawalIdSchema","PerpsInternalTransferIdSchema","PerpsDecimalInputSchema","DecimalishSchema","PerpsInstrumentType","PerpsInstrumentCategory","PerpsSide","PerpsTimeInForce","PerpsDepositStatus","PerpsWithdrawalStatus","PerpsInternalTransferDirection","PerpsKlineInterval","PerpsPnlInterval","PerpsInstrumentTypeSchema","PerpsInstrumentCategorySchema","PerpsSideSchema","PerpsTimeInForceSchema","PerpsDepositStatusSchema","PerpsWithdrawalStatusSchema","PerpsInternalTransferDirectionSchema","PerpsKlineIntervalSchema","PerpsPnlIntervalSchema","PerpsAssetSchema","RawPerpsTxHashSchema","hash","TxHashSchema","PerpsDataResponseSchema","itemSchema","perpsDecimal","perpsBaseUnits","BaseUnitsSchema","decimalString","toDecimalString","PerpsBalanceSchema","DecimalStringSchema","FetchPerpsBalancesResponseSchema","PerpsPortfolioPositionSchema","RawPerpsPortfolioPositionSchema","position","PerpsMarginSummarySchema","RawPerpsMarginSummarySchema","margin","PerpsPortfolioSchema","EpochMillisecondsSchema","RawPerpsPortfolioSchema","portfolio","FetchPerpsPortfolioResponseSchema","PerpsAccountFundingPaymentSchema","RawPerpsAccountFundingPaymentSchema","funding","ListPerpsFundingPaymentsResponseSchema","RawPerpsAccountFundingPaymentEntrySchema","PerpsAccountConfigSchema","RawPerpsAccountConfigSchema","config","FetchPerpsAccountConfigResponseSchema","PerpsEquityPointSchema","timestamp","equity","ListPerpsEquityHistoryResponseSchema","PerpsPnlPointSchema","pnl","ListPerpsPnlHistoryResponseSchema","RawPerpsProxyExpirySchema","PerpsProxyKeySchema","EvmAddressSchema","RawPerpsProxyKeySchema","key","RawPerpsCredentialsResponseSchema","credentials","RawPerpsCreateProxyResponseSchema","RawPerpsDeleteProxyResponseSchema","PerpsDepositSchema","RawPerpsDepositSchema","deposit","ListPerpsDepositsResponseSchema","RawPerpsDepositUpdateSchema","PerpsWithdrawalSchema","RawPerpsWithdrawalSchema","withdrawal","ListPerpsWithdrawalsResponseSchema","RawPerpsWithdrawResponseSchema","response","RawPerpsWithdrawalUpdateSchema","PerpsInternalTransferSchema","RawPerpsInternalTransferSchema","transfer","PerpsRiskTierSchema","RawPerpsRiskTierSchema","tier","PerpsInstrumentSchema","RawPerpsInstrumentSchema","instrument","FetchPerpsInstrumentsResponseSchema","PerpsTickerSchema","RawPerpsTickerSchema","ticker","FetchPerpsTickersResponseSchema","RawPerpsTickerEntrySchema","PerpsCandleSchema","open","high","low","close","volume","trades","PerpsStatisticSchema","RawPerpsStatisticSchema","statistic","FetchPerpsStatisticsResponseSchema","RawPerpsStatisticDataSchema","PerpsBookLevelSchema","price","quantity","PerpsBookSchema","RawPerpsBookSchema","book","RawPerpsBookUpdateSchema","PerpsBboSchema","RawPerpsBboSchema","bbo","RawPerpsBboDataSchema","PerpsPublicTradeSchema","RawPerpsPublicTradeSchema","trade","RawPerpsPublicTradeResponseSchema","FetchPerpsTradesResponseSchema","PerpsFundingRateSchema","RawPerpsFundingRateSchema","FetchPerpsFundingHistoryResponseSchema","PerpsFeeScheduleEntrySchema","RawPerpsFeeScheduleEntrySchema","fee","PerpsFeesInfoSchema","FetchPerpsFeesResponseSchema","fees","FetchPerpsCandlesResponseSchema","PerpsOrderSchema","PerpsCommandStatusSchema","PerpsOrderCommandAckSchema","RawPerpsOrderCommandAckSchema","ack","PerpsCommandAckSchema","RawPerpsOrderSchema","order","FetchPerpsOrdersResponseSchema","FetchPerpsOpenOrdersResponseSchema","RawPerpsOrderUpdateSchema","PerpsAccountFillSchema","RawPerpsAccountFillSchema","fill","ListPerpsFillsResponseSchema","RawPerpsAccountFillUpdateSchema"],"mappings":"uFAsBA,SAASA,CAAAA,CAAgCC,CAAAA,CAAkB,CACzD,OAAOA,CACT,CAEO,IAAMC,CAAAA,CAA0BC,IACpC,MAAA,EAAO,CACP,KAAI,CACJ,WAAA,GACA,SAAA,CAAUH,CAAgC,CAAA,CAEhCI,CAAAA,CAAqBD,IAC/B,MAAA,EAAO,CACP,KAAI,CACJ,WAAA,GACA,SAAA,CAAUH,CAA2B,EAE3BK,CAAAA,CAA2BF,GAAAA,CACrC,QAAO,CACP,KAAA,CAAM,gBAAgB,CAAA,CACtB,SAAA,CAAWF,GAAUA,CAA2B,CAAA,CAEtCK,CAAAA,CAAqBH,GAAAA,CAC/B,QAAO,CACP,GAAA,GACA,WAAA,EAAY,CACZ,UAAUH,CAA2B,CAAA,CAE3BO,EAA0BJ,GAAAA,CACpC,MAAA,GACA,GAAA,EAAI,CACJ,aAAY,CACZ,SAAA,CAAUH,CAAgC,CAAA,CAEhCQ,CAAAA,CAAgCL,GAAAA,CAC1C,MAAA,GACA,GAAA,EAAI,CACJ,aAAY,CACZ,SAAA,CAAUH,CAAsC,CAAA,CAEtCS,CAAAA,CAA0BC,GAG3BC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,UAAY,WAAA,CADFA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IAIAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,OAAS,QAAA,CACTA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,EAAA,KAAA,CAAQ,OAAA,CACRA,EAAA,MAAA,CAAS,QAAA,CAJCA,OAAA,EAAA,CAAA,CAOAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,IAAA,CAAO,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,CACL,GAAA,CAAKA,GACL,GAAA,CAAKtC,GAAAA,CAAE,SAAQ,CACf,EAAA,CAAI+C,GACJ,IAAA,CAAM/C,GAAAA,CAAE,QAAO,CAAE,QAAA,EACnB,CAAC,CAAA,CACA,UAAW0J,CAAAA,GAAU,CACpB,OAAA,CAASA,CAAAA,CAAK,IACd,OAAA,CAASA,CAAAA,CAAK,IACd,YAAA,CAAcA,CAAAA,CAAK,IACnB,IAAA,CAAMA,CAAAA,CAAK,KACX,KAAA,CAAOA,CAAAA,CAAK,EACZ,QAAA,CAAUA,CAAAA,CAAK,IACf,KAAA,CAAOA,CAAAA,CAAK,MACZ,GAAA,CAAKA,CAAAA,CAAK,IACV,QAAA,CAAUA,CAAAA,CAAK,IACf,YAAA,CAAcA,CAAAA,CAAK,IACnB,kBAAA,CAAoBA,CAAAA,CAAK,IACzB,GAAA,CAAKA,CAAAA,CAAK,IACV,WAAA,CAAaA,CAAAA,CAAK,IAClB,SAAA,CAAWA,CAAAA,CAAK,GAChB,aAAA,CAAeA,CAAAA,CAAK,IACtB,CAAA,CAAE","file":"chunk-CFT5AXUR.js","sourcesContent":["import type { PrivateKey } from '@polymarket/types';\nimport { z } from 'zod';\nimport {\n type BaseUnits,\n BaseUnitsSchema,\n DecimalishSchema,\n type DecimalString,\n type EvmAddress,\n type TxHash,\n TxHashSchema,\n toDecimalString,\n} from '../shared';\n\ntype Tagged<T, Tag extends string> = T & { readonly __tag: Tag };\n\nexport type PerpsInstrumentId = Tagged<number, 'PerpsInstrumentId'>;\nexport type PerpsOrderId = Tagged<number, 'PerpsOrderId'>;\nexport type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;\nexport type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;\nexport type PerpsWithdrawalId = Tagged<number, 'PerpsWithdrawalId'>;\nexport type PerpsInternalTransferId = Tagged<number, 'PerpsInternalTransferId'>;\n\nfunction taggedInteger<T extends number>(value: number): T {\n return value as T;\n}\n\nexport const PerpsInstrumentIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInstrumentId>);\n\nexport const PerpsOrderIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsOrderId>);\n\nexport const PerpsClientOrderIdSchema = z\n .string()\n .regex(/^[0-9a-f]{32}$/)\n .transform((value) => value as PerpsClientOrderId);\n\nexport const PerpsTradeIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsTradeId>);\n\nexport const PerpsWithdrawalIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsWithdrawalId>);\n\nexport const PerpsInternalTransferIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInternalTransferId>);\n\nexport const PerpsDecimalInputSchema = DecimalishSchema;\nexport type PerpsDecimalInput = z.input<typeof PerpsDecimalInputSchema>;\n\nexport enum PerpsInstrumentType {\n Perpetual = 'perpetual',\n}\n\nexport enum PerpsInstrumentCategory {\n Equity = 'equity',\n Commodity = 'commodity',\n Index = 'index',\n Crypto = 'crypto',\n}\n\nexport enum PerpsSide {\n Long = 'long',\n Short = 'short',\n}\n\nexport enum PerpsTimeInForce {\n Gtc = 'gtc',\n Ioc = 'ioc',\n Fok = 'fok',\n}\n\nexport enum PerpsDepositStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n}\n\nexport enum PerpsWithdrawalStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n}\n\nexport enum PerpsInternalTransferDirection {\n In = 'in',\n Out = 'out',\n}\n\nexport enum PerpsKlineInterval {\n OneSecond = '1s',\n OneMinute = '1m',\n FiveMinutes = '5m',\n FifteenMinutes = '15m',\n OneHour = '1h',\n FourHours = '4h',\n OneDay = '1d',\n OneWeek = '1w',\n}\n\nexport enum PerpsPnlInterval {\n OneHour = '1h',\n FourHours = '4h',\n OneDay = '1d',\n OneWeek = '1w',\n}\n\nexport const PerpsInstrumentTypeSchema = z.enum(PerpsInstrumentType);\nexport const PerpsInstrumentCategorySchema = z.enum(PerpsInstrumentCategory);\nexport const PerpsSideSchema = z.enum(PerpsSide);\nexport const PerpsTimeInForceSchema = z.enum(PerpsTimeInForce);\nexport const PerpsDepositStatusSchema = z.enum(PerpsDepositStatus);\nexport const PerpsWithdrawalStatusSchema = z.enum(PerpsWithdrawalStatus);\nexport const PerpsInternalTransferDirectionSchema = z.enum(\n PerpsInternalTransferDirection,\n);\nexport const PerpsKlineIntervalSchema = z.enum(PerpsKlineInterval);\nexport const PerpsPnlIntervalSchema = z.enum(PerpsPnlInterval);\n\nexport const PerpsAssetSchema = z.string().min(1);\n\nexport const RawPerpsTxHashSchema = z.preprocess(\n (hash) => (hash === '0x' || hash === '' ? undefined : hash),\n TxHashSchema.optional(),\n);\n\nexport const PerpsDataResponseSchema = <T extends z.ZodType>(itemSchema: T) =>\n z.object({\n data: z.array(itemSchema),\n more: z.boolean(),\n });\n\nexport type PerpsCredentials = {\n proxy: EvmAddress;\n privateKey: PrivateKey;\n secret: string;\n expiresAt: number;\n};\n\nexport type PerpsDepositAmount = BaseUnits;\nexport type PerpsWithdrawalAmount = BaseUnits;\nexport type PerpsTxHash = TxHash;\nexport type PerpsDecimal = DecimalString;\n\nexport function perpsDecimal(value: string | number): DecimalString {\n return PerpsDecimalInputSchema.parse(value);\n}\n\nexport function perpsBaseUnits(value: string): BaseUnits {\n return BaseUnitsSchema.parse(value);\n}\n\nexport function decimalString(value: string): DecimalString {\n return toDecimalString(value);\n}\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsDataResponseSchema,\n PerpsInstrumentIdSchema,\n} from './common';\n\nexport const PerpsBalanceSchema = z.object({\n asset: PerpsAssetSchema,\n balance: DecimalStringSchema,\n value: DecimalStringSchema,\n});\n\nexport type PerpsBalance = z.infer<typeof PerpsBalanceSchema>;\n\nexport const FetchPerpsBalancesResponseSchema = z.array(PerpsBalanceSchema);\n\nexport const PerpsPortfolioPositionSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n symbol: z.string().min(1),\n size: DecimalStringSchema,\n entryPrice: DecimalStringSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n initialMargin: DecimalStringSchema,\n maintenanceMargin: DecimalStringSchema,\n positionValue: DecimalStringSchema,\n liquidationPrice: DecimalStringSchema,\n unrealizedPnl: DecimalStringSchema,\n returnOnEquity: DecimalStringSchema,\n cumulativeFunding: DecimalStringSchema,\n});\n\nexport type PerpsPortfolioPosition = z.infer<\n typeof PerpsPortfolioPositionSchema\n>;\n\nexport const RawPerpsPortfolioPositionSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n symbol: z.string().min(1),\n size: DecimalStringSchema,\n entry_price: DecimalStringSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n initial_margin: DecimalStringSchema,\n maintenance_margin: DecimalStringSchema,\n position_value: DecimalStringSchema,\n liquidation_price: DecimalStringSchema,\n unrealized_pnl: DecimalStringSchema,\n return_on_equity: DecimalStringSchema,\n cumulative_funding: DecimalStringSchema,\n })\n .transform((position) => ({\n instrumentId: position.instrument_id,\n symbol: position.symbol,\n size: position.size,\n entryPrice: position.entry_price,\n leverage: position.leverage,\n cross: position.cross,\n initialMargin: position.initial_margin,\n maintenanceMargin: position.maintenance_margin,\n positionValue: position.position_value,\n liquidationPrice: position.liquidation_price,\n unrealizedPnl: position.unrealized_pnl,\n returnOnEquity: position.return_on_equity,\n cumulativeFunding: position.cumulative_funding,\n }));\n\nexport const PerpsMarginSummarySchema = z.object({\n totalAccountValue: DecimalStringSchema,\n totalInitialMargin: DecimalStringSchema,\n totalMaintenanceMargin: DecimalStringSchema,\n totalPositionValue: DecimalStringSchema,\n});\n\nexport type PerpsMarginSummary = z.infer<typeof PerpsMarginSummarySchema>;\n\nconst RawPerpsMarginSummarySchema = z\n .object({\n total_account_value: DecimalStringSchema,\n total_initial_margin: DecimalStringSchema,\n total_maintenance_margin: DecimalStringSchema,\n total_position_value: DecimalStringSchema,\n })\n .transform((margin) => ({\n totalAccountValue: margin.total_account_value,\n totalInitialMargin: margin.total_initial_margin,\n totalMaintenanceMargin: margin.total_maintenance_margin,\n totalPositionValue: margin.total_position_value,\n }));\n\nexport const PerpsPortfolioSchema = z.object({\n positions: z.array(PerpsPortfolioPositionSchema),\n margin: PerpsMarginSummarySchema,\n withdrawable: DecimalStringSchema,\n inLiquidation: z.boolean(),\n timestamp: EpochMillisecondsSchema,\n});\n\nexport type PerpsPortfolio = z.infer<typeof PerpsPortfolioSchema>;\n\nexport const RawPerpsPortfolioSchema = z\n .object({\n positions: z.array(RawPerpsPortfolioPositionSchema),\n margin: RawPerpsMarginSummarySchema,\n withdrawable: DecimalStringSchema,\n in_liquidation: z.boolean(),\n timestamp: EpochMillisecondsSchema,\n })\n .transform((portfolio) => ({\n positions: portfolio.positions,\n margin: portfolio.margin,\n withdrawable: portfolio.withdrawable,\n inLiquidation: portfolio.in_liquidation,\n timestamp: portfolio.timestamp,\n }));\n\nexport const FetchPerpsPortfolioResponseSchema = RawPerpsPortfolioSchema;\n\nexport const PerpsAccountFundingPaymentSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n size: DecimalStringSchema,\n fundingRate: DecimalStringSchema,\n fundingAsset: PerpsAssetSchema,\n funding: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema,\n});\n\nexport type PerpsAccountFundingPayment = z.infer<\n typeof PerpsAccountFundingPaymentSchema\n>;\n\nexport const RawPerpsAccountFundingPaymentSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n size: DecimalStringSchema,\n funding_rate: DecimalStringSchema,\n funding_asset: PerpsAssetSchema,\n funding: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema,\n })\n .transform((funding) => ({\n instrumentId: funding.instrument_id,\n size: funding.size,\n fundingRate: funding.funding_rate,\n fundingAsset: funding.funding_asset,\n funding: funding.funding,\n timestamp: funding.timestamp,\n }));\n\nexport const ListPerpsFundingPaymentsResponseSchema = PerpsDataResponseSchema(\n RawPerpsAccountFundingPaymentSchema,\n);\n\nexport const RawPerpsAccountFundingPaymentEntrySchema = z\n .object({\n iid: PerpsInstrumentIdSchema,\n sz: DecimalStringSchema,\n fr: DecimalStringSchema,\n fund: DecimalStringSchema,\n fua: PerpsAssetSchema,\n ts: EpochMillisecondsSchema,\n })\n .transform((funding) => ({\n instrumentId: funding.iid,\n size: funding.sz,\n fundingRate: funding.fr,\n fundingAsset: funding.fua,\n funding: funding.fund,\n timestamp: funding.ts,\n }));\n\nexport const PerpsAccountConfigSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n});\n\nexport type PerpsAccountConfig = z.infer<typeof PerpsAccountConfigSchema>;\n\nexport const RawPerpsAccountConfigSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n })\n .transform((config) => ({\n instrumentId: config.instrument_id,\n leverage: config.leverage,\n cross: config.cross,\n }));\n\nexport const FetchPerpsAccountConfigResponseSchema = z.array(\n RawPerpsAccountConfigSchema,\n);\n\nexport const PerpsEquityPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, equity]) => ({ timestamp, equity }));\n\nexport type PerpsEquityPoint = z.infer<typeof PerpsEquityPointSchema>;\n\nexport const ListPerpsEquityHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsEquityPointSchema,\n);\n\nexport const PerpsPnlPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, pnl]) => ({ timestamp, pnl }));\n\nexport type PerpsPnlPoint = z.infer<typeof PerpsPnlPointSchema>;\n\nexport const ListPerpsPnlHistoryResponseSchema =\n PerpsDataResponseSchema(PerpsPnlPointSchema);\n\nconst RawPerpsProxyExpirySchema = z\n .number()\n .finite()\n .positive()\n .refine((value) => Number.isInteger(value), 'Expected integer')\n // The credentials endpoint currently returns proxy expiries in nanoseconds.\n .transform((value) =>\n value > Number.MAX_SAFE_INTEGER ? Math.floor(value / 1_000_000) : value,\n )\n .pipe(EpochMillisecondsSchema);\n\nexport const PerpsProxyKeySchema = z.object({\n proxy: EvmAddressSchema,\n label: z.string().optional(),\n expiresAt: EpochMillisecondsSchema,\n});\n\nexport type PerpsProxyKey = z.infer<typeof PerpsProxyKeySchema>;\n\nexport const RawPerpsProxyKeySchema = z\n .object({\n proxy: EvmAddressSchema,\n label: z.string().optional(),\n expiry: RawPerpsProxyExpirySchema,\n })\n .transform((key) => ({\n proxy: key.proxy,\n label: key.label,\n expiresAt: key.expiry,\n }));\n\nexport const RawPerpsCredentialsResponseSchema = z\n .object({\n address: EvmAddressSchema,\n keys: z.array(RawPerpsProxyKeySchema),\n })\n .transform((credentials) => ({\n address: credentials.address,\n keys: credentials.keys,\n }));\n\nexport const RawPerpsCreateProxyResponseSchema = z.object({\n secret: z.string().min(1),\n});\n\nexport const RawPerpsDeleteProxyResponseSchema = z.object({\n status: z.enum(['ok', 'err']),\n error: z.string().optional(),\n});\n","import { z } from 'zod';\nimport {\n BaseUnitsSchema,\n DecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n TxHashSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsDataResponseSchema,\n PerpsDepositStatusSchema,\n PerpsInternalTransferDirectionSchema,\n PerpsInternalTransferIdSchema,\n PerpsWithdrawalIdSchema,\n PerpsWithdrawalStatusSchema,\n RawPerpsTxHashSchema,\n} from './common';\n\nexport const PerpsDepositSchema = z.object({\n hash: TxHashSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n status: PerpsDepositStatusSchema,\n from: EvmAddressSchema,\n to: EvmAddressSchema,\n confirmations: z.number().int().nonnegative(),\n requiredConfirmations: z.number().int().nonnegative(),\n createdTimestamp: EpochMillisecondsSchema,\n confirmedTimestamp: EpochMillisecondsSchema.optional(),\n});\n\nexport type PerpsDeposit = z.infer<typeof PerpsDepositSchema>;\n\nexport const RawPerpsDepositSchema = z\n .object({\n hash: TxHashSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n status: PerpsDepositStatusSchema,\n from: EvmAddressSchema,\n to: EvmAddressSchema,\n confirmations: z.number().int().nonnegative(),\n required_confirmations: z.number().int().nonnegative(),\n created_timestamp: EpochMillisecondsSchema,\n confirmed_timestamp: EpochMillisecondsSchema.optional(),\n })\n .transform((deposit) => ({\n hash: deposit.hash,\n asset: deposit.asset,\n amount: deposit.amount,\n status: deposit.status,\n from: deposit.from,\n to: deposit.to,\n confirmations: deposit.confirmations,\n requiredConfirmations: deposit.required_confirmations,\n createdTimestamp: deposit.created_timestamp,\n confirmedTimestamp: deposit.confirmed_timestamp,\n }));\n\nexport const ListPerpsDepositsResponseSchema = PerpsDataResponseSchema(\n RawPerpsDepositSchema,\n);\n\nexport const RawPerpsDepositUpdateSchema = z\n .object({\n hash: RawPerpsTxHashSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n status: PerpsDepositStatusSchema,\n })\n .transform((deposit) => ({\n hash: deposit.hash,\n asset: deposit.asset,\n amount: deposit.amount,\n status: deposit.status,\n }));\n\nexport const PerpsWithdrawalSchema = z.object({\n withdrawalId: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: TxHashSchema.optional(),\n confirmations: z.number().int().nonnegative(),\n requiredConfirmations: z.number().int().nonnegative(),\n createdTimestamp: EpochMillisecondsSchema,\n confirmedTimestamp: EpochMillisecondsSchema.optional(),\n});\n\nexport type PerpsWithdrawal = z.infer<typeof PerpsWithdrawalSchema>;\n\nexport const RawPerpsWithdrawalSchema = z\n .object({\n withdraw_id: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: RawPerpsTxHashSchema,\n confirmations: z.number().int().nonnegative(),\n required_confirmations: z.number().int().nonnegative(),\n created_timestamp: EpochMillisecondsSchema,\n confirmed_timestamp: EpochMillisecondsSchema.optional(),\n })\n .transform((withdrawal) => ({\n withdrawalId: withdrawal.withdraw_id,\n asset: withdrawal.asset,\n amount: withdrawal.amount,\n fee: withdrawal.fee,\n status: withdrawal.status,\n to: withdrawal.to,\n hash: withdrawal.hash,\n confirmations: withdrawal.confirmations,\n requiredConfirmations: withdrawal.required_confirmations,\n createdTimestamp: withdrawal.created_timestamp,\n confirmedTimestamp: withdrawal.confirmed_timestamp,\n }));\n\nexport const ListPerpsWithdrawalsResponseSchema = PerpsDataResponseSchema(\n RawPerpsWithdrawalSchema,\n);\n\nexport const RawPerpsWithdrawResponseSchema = z\n .object({\n status: z.enum(['ok', 'err']),\n withdraw_id: PerpsWithdrawalIdSchema.optional(),\n error: z.string().optional(),\n })\n .transform((response) => ({\n status: response.status,\n withdrawalId: response.withdraw_id,\n error: response.error,\n }));\n\nexport const RawPerpsWithdrawalUpdateSchema = z\n .object({\n withdraw_id: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: RawPerpsTxHashSchema,\n })\n .transform((withdrawal) => ({\n withdrawalId: withdrawal.withdraw_id,\n asset: withdrawal.asset,\n amount: withdrawal.amount,\n fee: withdrawal.fee,\n status: withdrawal.status,\n to: withdrawal.to,\n hash: withdrawal.hash,\n }));\n\nexport const PerpsInternalTransferSchema = z.object({\n transferId: PerpsInternalTransferIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n direction: PerpsInternalTransferDirectionSchema,\n counterparty: EvmAddressSchema,\n label: z.string().optional(),\n createdTimestamp: EpochMillisecondsSchema,\n});\n\nexport type PerpsInternalTransfer = z.infer<typeof PerpsInternalTransferSchema>;\n\nexport const RawPerpsInternalTransferSchema = z\n .object({\n transfer_id: PerpsInternalTransferIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n direction: PerpsInternalTransferDirectionSchema,\n counterparty: EvmAddressSchema,\n label: z.string().optional(),\n created_timestamp: EpochMillisecondsSchema,\n })\n .transform((transfer) => ({\n transferId: transfer.transfer_id,\n asset: transfer.asset,\n amount: transfer.amount,\n direction: transfer.direction,\n counterparty: transfer.counterparty,\n label: transfer.label,\n createdTimestamp: transfer.created_timestamp,\n }));\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n TxHashSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsDataResponseSchema,\n PerpsInstrumentCategorySchema,\n PerpsInstrumentIdSchema,\n PerpsInstrumentTypeSchema,\n PerpsSideSchema,\n PerpsTradeIdSchema,\n RawPerpsTxHashSchema,\n} from './common';\n\nexport const PerpsRiskTierSchema = z.object({\n lowerBound: DecimalStringSchema,\n maxLeverage: z.number().int().positive(),\n});\n\nconst RawPerpsRiskTierSchema = z\n .object({\n lower_bound: DecimalStringSchema,\n max_leverage: z.number().int().positive(),\n })\n .transform((tier) => ({\n lowerBound: tier.lower_bound,\n maxLeverage: tier.max_leverage,\n }));\n\nexport type PerpsRiskTier = z.infer<typeof PerpsRiskTierSchema>;\n\nexport const PerpsInstrumentSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n instrumentType: PerpsInstrumentTypeSchema,\n category: PerpsInstrumentCategorySchema,\n symbol: z.string().min(1),\n baseAsset: PerpsAssetSchema,\n quoteAsset: PerpsAssetSchema,\n fundingInterval: z.string().min(1),\n quantityDecimals: z.number().int().nonnegative(),\n priceDecimals: z.number().int().nonnegative(),\n priceBounds: DecimalStringSchema,\n liquidationFee: DecimalStringSchema,\n maxOrderCount: z.number().int().positive(),\n minNotional: DecimalStringSchema,\n maxMarketNotional: DecimalStringSchema,\n maxLimitNotional: DecimalStringSchema,\n maxLeverage: z.number().int().positive(),\n riskTiers: z.array(PerpsRiskTierSchema),\n});\n\nexport type PerpsInstrument = z.infer<typeof PerpsInstrumentSchema>;\n\nexport const RawPerpsInstrumentSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n instrument_type: PerpsInstrumentTypeSchema,\n category: PerpsInstrumentCategorySchema,\n symbol: z.string().min(1),\n base_asset: PerpsAssetSchema,\n quote_asset: PerpsAssetSchema,\n funding_interval: z.string().min(1),\n quantity_decimals: z.number().int().nonnegative(),\n price_decimals: z.number().int().nonnegative(),\n price_bounds: DecimalStringSchema,\n liquidation_fee: DecimalStringSchema,\n max_order_count: z.number().int().positive(),\n min_notional: DecimalStringSchema,\n max_market_notional: DecimalStringSchema,\n max_limit_notional: DecimalStringSchema,\n max_leverage: z.number().int().positive(),\n risk_tiers: z.array(RawPerpsRiskTierSchema),\n })\n .transform((instrument) => ({\n instrumentId: instrument.instrument_id,\n instrumentType: instrument.instrument_type,\n category: instrument.category,\n symbol: instrument.symbol,\n baseAsset: instrument.base_asset,\n quoteAsset: instrument.quote_asset,\n fundingInterval: instrument.funding_interval,\n quantityDecimals: instrument.quantity_decimals,\n priceDecimals: instrument.price_decimals,\n priceBounds: instrument.price_bounds,\n liquidationFee: instrument.liquidation_fee,\n maxOrderCount: instrument.max_order_count,\n minNotional: instrument.min_notional,\n maxMarketNotional: instrument.max_market_notional,\n maxLimitNotional: instrument.max_limit_notional,\n maxLeverage: instrument.max_leverage,\n riskTiers: instrument.risk_tiers,\n }));\n\nexport const FetchPerpsInstrumentsResponseSchema = z.array(\n RawPerpsInstrumentSchema,\n);\n\nexport const PerpsTickerSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n symbol: z.string().min(1),\n indexPrice: DecimalStringSchema,\n markPrice: DecimalStringSchema,\n lastPrice: DecimalStringSchema,\n midPrice: DecimalStringSchema,\n openInterest: DecimalStringSchema,\n fundingRate: DecimalStringSchema,\n nextFunding: EpochMillisecondsSchema,\n volume24h: DecimalStringSchema.optional(),\n openPrice: DecimalStringSchema.optional(),\n timestamp: EpochMillisecondsSchema.optional(),\n});\n\nexport type PerpsTicker = z.infer<typeof PerpsTickerSchema>;\n\nexport const RawPerpsTickerSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n symbol: z.string().min(1),\n index_price: DecimalStringSchema,\n mark_price: DecimalStringSchema,\n last_price: DecimalStringSchema,\n mid_price: DecimalStringSchema,\n open_interest: DecimalStringSchema,\n funding_rate: DecimalStringSchema,\n next_funding: EpochMillisecondsSchema,\n timestamp: EpochMillisecondsSchema.optional(),\n })\n .transform((ticker) => ({\n instrumentId: ticker.instrument_id,\n symbol: ticker.symbol,\n indexPrice: ticker.index_price,\n markPrice: ticker.mark_price,\n lastPrice: ticker.last_price,\n midPrice: ticker.mid_price,\n openInterest: ticker.open_interest,\n fundingRate: ticker.funding_rate,\n nextFunding: ticker.next_funding,\n timestamp: ticker.timestamp,\n }));\n\nexport const FetchPerpsTickersResponseSchema = z.array(RawPerpsTickerSchema);\n\nexport const RawPerpsTickerEntrySchema = z\n .object({\n iid: PerpsInstrumentIdSchema,\n idx: DecimalStringSchema,\n mark: DecimalStringSchema,\n last: DecimalStringSchema,\n mid: DecimalStringSchema,\n oi: DecimalStringSchema,\n fr: DecimalStringSchema,\n nxf: EpochMillisecondsSchema,\n })\n .transform((ticker) => ({\n instrumentId: ticker.iid,\n indexPrice: ticker.idx,\n markPrice: ticker.mark,\n lastPrice: ticker.last,\n midPrice: ticker.mid,\n openInterest: ticker.oi,\n fundingRate: ticker.fr,\n nextFunding: ticker.nxf,\n }));\n\nexport const PerpsCandleSchema = z\n .tuple([\n EpochMillisecondsSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n z.number().int().nonnegative(),\n ])\n .transform(([timestamp, open, high, low, close, volume, trades]) => ({\n timestamp,\n open,\n high,\n low,\n close,\n volume,\n trades,\n }));\n\nexport type PerpsCandle = z.infer<typeof PerpsCandleSchema>;\n\nexport const PerpsStatisticSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n symbol: z.string().min(1).optional(),\n volume: DecimalStringSchema,\n openPrice: DecimalStringSchema,\n klines: z.array(PerpsCandleSchema),\n});\n\nexport type PerpsStatistic = z.infer<typeof PerpsStatisticSchema>;\n\nexport const RawPerpsStatisticSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n symbol: z.string().min(1).optional(),\n volume: DecimalStringSchema,\n open_price: DecimalStringSchema,\n klines: z.array(PerpsCandleSchema),\n })\n .transform((statistic) => ({\n instrumentId: statistic.instrument_id,\n symbol: statistic.symbol,\n volume: statistic.volume,\n openPrice: statistic.open_price,\n klines: statistic.klines,\n }));\n\nexport const FetchPerpsStatisticsResponseSchema = z.array(\n RawPerpsStatisticSchema,\n);\n\nexport const RawPerpsStatisticDataSchema = z\n .object({\n iid: PerpsInstrumentIdSchema,\n vol: DecimalStringSchema,\n open: DecimalStringSchema,\n klines: z.array(PerpsCandleSchema),\n })\n .transform((statistic) => ({\n instrumentId: statistic.iid,\n volume: statistic.vol,\n openPrice: statistic.open,\n klines: statistic.klines,\n }));\n\nexport const PerpsBookLevelSchema = z\n .tuple([DecimalStringSchema, DecimalStringSchema])\n .transform(([price, quantity]) => ({ price, quantity }));\n\nexport type PerpsBookLevel = z.infer<typeof PerpsBookLevelSchema>;\n\nexport const PerpsBookSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n bids: z.array(PerpsBookLevelSchema),\n asks: z.array(PerpsBookLevelSchema),\n timestamp: EpochMillisecondsSchema,\n sequence: z.number().int().nonnegative(),\n});\n\nexport type PerpsBook = z.infer<typeof PerpsBookSchema>;\n\nexport const RawPerpsBookSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n bids: z.array(PerpsBookLevelSchema),\n asks: z.array(PerpsBookLevelSchema),\n timestamp: EpochMillisecondsSchema,\n sequence: z.number().int().nonnegative(),\n })\n .transform((book) => ({\n instrumentId: book.instrument_id,\n bids: book.bids,\n asks: book.asks,\n timestamp: book.timestamp,\n sequence: book.sequence,\n }));\n\nexport const RawPerpsBookUpdateSchema = z\n .object({\n b: z.array(PerpsBookLevelSchema),\n a: z.array(PerpsBookLevelSchema),\n })\n .transform((book) => ({\n bids: book.b,\n asks: book.a,\n }));\n\nexport const PerpsBboSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n bidPrice: DecimalStringSchema,\n bidQuantity: DecimalStringSchema,\n askPrice: DecimalStringSchema,\n askQuantity: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema.optional(),\n});\n\nexport type PerpsBbo = z.infer<typeof PerpsBboSchema>;\n\nexport const RawPerpsBboSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n bid_price: DecimalStringSchema,\n bid_quantity: DecimalStringSchema,\n ask_price: DecimalStringSchema,\n ask_quantity: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema.optional(),\n })\n .transform((bbo) => ({\n instrumentId: bbo.instrument_id,\n bidPrice: bbo.bid_price,\n bidQuantity: bbo.bid_quantity,\n askPrice: bbo.ask_price,\n askQuantity: bbo.ask_quantity,\n timestamp: bbo.timestamp,\n }));\n\nexport const RawPerpsBboDataSchema = z\n .object({\n iid: PerpsInstrumentIdSchema,\n bp: DecimalStringSchema,\n bq: DecimalStringSchema,\n ap: DecimalStringSchema,\n aq: DecimalStringSchema,\n })\n .transform((bbo) => ({\n instrumentId: bbo.iid,\n bidPrice: bbo.bp,\n bidQuantity: bbo.bq,\n askPrice: bbo.ap,\n askQuantity: bbo.aq,\n }));\n\nexport const PerpsPublicTradeSchema = z.object({\n tradeId: PerpsTradeIdSchema,\n instrumentId: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n price: DecimalStringSchema,\n quantity: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema,\n hash: TxHashSchema.optional(),\n});\n\nexport type PerpsPublicTrade = z.infer<typeof PerpsPublicTradeSchema>;\n\nexport const RawPerpsPublicTradeSchema = z\n .object({\n trade_id: PerpsTradeIdSchema,\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n price: DecimalStringSchema,\n quantity: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema,\n hash: RawPerpsTxHashSchema,\n })\n .transform((trade) => ({\n tradeId: trade.trade_id,\n instrumentId: trade.instrument_id,\n side: trade.side,\n price: trade.price,\n quantity: trade.quantity,\n timestamp: trade.timestamp,\n hash: trade.hash,\n }));\n\nexport const RawPerpsPublicTradeResponseSchema = z\n .object({\n tid: PerpsTradeIdSchema,\n iid: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n p: DecimalStringSchema,\n qty: DecimalStringSchema,\n ts: EpochMillisecondsSchema,\n hash: RawPerpsTxHashSchema,\n })\n .transform((trade) => ({\n tradeId: trade.tid,\n instrumentId: trade.iid,\n side: trade.side,\n price: trade.p,\n quantity: trade.qty,\n timestamp: trade.ts,\n hash: trade.hash,\n }));\n\nexport const FetchPerpsTradesResponseSchema = PerpsDataResponseSchema(\n RawPerpsPublicTradeSchema,\n);\n\nexport const PerpsFundingRateSchema = z.object({\n fundingRate: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema,\n});\n\nexport type PerpsFundingRate = z.infer<typeof PerpsFundingRateSchema>;\n\nexport const RawPerpsFundingRateSchema = z\n .object({\n funding_rate: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema,\n })\n .transform((funding) => ({\n fundingRate: funding.funding_rate,\n timestamp: funding.timestamp,\n }));\n\nexport const FetchPerpsFundingHistoryResponseSchema = PerpsDataResponseSchema(\n RawPerpsFundingRateSchema,\n);\n\nexport const PerpsFeeScheduleEntrySchema = z.object({\n instrumentType: PerpsInstrumentTypeSchema,\n category: PerpsInstrumentCategorySchema,\n takerFeeRate: DecimalStringSchema,\n makerFeeRate: DecimalStringSchema,\n});\n\nexport type PerpsFeeScheduleEntry = z.infer<typeof PerpsFeeScheduleEntrySchema>;\n\nexport const RawPerpsFeeScheduleEntrySchema = z\n .object({\n instrument_type: PerpsInstrumentTypeSchema,\n category: PerpsInstrumentCategorySchema,\n taker_fee_rate: DecimalStringSchema,\n maker_fee_rate: DecimalStringSchema,\n })\n .transform((fee) => ({\n instrumentType: fee.instrument_type,\n category: fee.category,\n takerFeeRate: fee.taker_fee_rate,\n makerFeeRate: fee.maker_fee_rate,\n }));\n\nexport const PerpsFeesInfoSchema = z.object({\n feeSchedule: z.array(PerpsFeeScheduleEntrySchema),\n});\n\nexport type PerpsFeesInfo = z.infer<typeof PerpsFeesInfoSchema>;\n\nexport const FetchPerpsFeesResponseSchema = z\n .object({\n fee_schedule: z.array(RawPerpsFeeScheduleEntrySchema),\n })\n .transform((fees) => ({\n feeSchedule: fees.fee_schedule,\n }));\n\nexport const FetchPerpsCandlesResponseSchema =\n PerpsDataResponseSchema(PerpsCandleSchema);\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n TxHashSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsClientOrderIdSchema,\n PerpsDataResponseSchema,\n PerpsInstrumentIdSchema,\n PerpsOrderIdSchema,\n PerpsSideSchema,\n PerpsTimeInForceSchema,\n PerpsTradeIdSchema,\n RawPerpsTxHashSchema,\n} from './common';\n\nexport const PerpsOrderSchema = z.object({\n orderId: PerpsOrderIdSchema,\n instrumentId: PerpsInstrumentIdSchema,\n buy: z.boolean(),\n price: DecimalStringSchema,\n quantity: DecimalStringSchema,\n timeInForce: PerpsTimeInForceSchema,\n postOnly: z.boolean(),\n status: z.string().min(1),\n restingQuantity: DecimalStringSchema,\n filledQuantity: DecimalStringSchema,\n createdTimestamp: EpochMillisecondsSchema,\n updatedTimestamp: EpochMillisecondsSchema,\n clientOrderId: z.string().optional(),\n});\n\nexport type PerpsOrder = z.infer<typeof PerpsOrderSchema>;\n\nexport const PerpsCommandStatusSchema = z.enum(['ok', 'err']);\n\nexport const PerpsOrderCommandAckSchema = z.object({\n status: PerpsCommandStatusSchema,\n orderId: PerpsOrderIdSchema.optional(),\n clientOrderId: PerpsClientOrderIdSchema.optional(),\n error: z.string().optional(),\n});\n\nexport type PerpsOrderCommandAck = z.infer<typeof PerpsOrderCommandAckSchema>;\n\nexport const RawPerpsOrderCommandAckSchema = z\n .object({\n status: PerpsCommandStatusSchema,\n oid: PerpsOrderIdSchema.optional(),\n coid: PerpsClientOrderIdSchema.optional(),\n error: z.string().optional(),\n })\n .transform((ack) => ({\n status: ack.status,\n orderId: ack.oid,\n clientOrderId: ack.coid,\n error: ack.error,\n }));\n\nexport const PerpsCommandAckSchema = z.object({\n status: PerpsCommandStatusSchema,\n error: z.string().optional(),\n});\n\nexport type PerpsCommandAck = z.infer<typeof PerpsCommandAckSchema>;\n\nexport const RawPerpsOrderSchema = z\n .object({\n order_id: PerpsOrderIdSchema,\n instrument_id: PerpsInstrumentIdSchema,\n buy: z.boolean(),\n price: DecimalStringSchema,\n quantity: DecimalStringSchema,\n tif: PerpsTimeInForceSchema,\n post_only: z.boolean(),\n status: z.string().min(1),\n resting_quantity: DecimalStringSchema,\n filled_quantity: DecimalStringSchema,\n created_timestamp: EpochMillisecondsSchema,\n updated_timestamp: EpochMillisecondsSchema,\n client_order_id: z.string().optional(),\n })\n .transform((order) => ({\n orderId: order.order_id,\n instrumentId: order.instrument_id,\n buy: order.buy,\n price: order.price,\n quantity: order.quantity,\n timeInForce: order.tif,\n postOnly: order.post_only,\n status: order.status,\n restingQuantity: order.resting_quantity,\n filledQuantity: order.filled_quantity,\n createdTimestamp: order.created_timestamp,\n updatedTimestamp: order.updated_timestamp,\n clientOrderId: order.client_order_id,\n }));\n\nexport const FetchPerpsOrdersResponseSchema = z.array(RawPerpsOrderSchema);\n\nexport const FetchPerpsOpenOrdersResponseSchema = z.array(RawPerpsOrderSchema);\n\nexport const RawPerpsOrderUpdateSchema = z\n .object({\n oid: PerpsOrderIdSchema,\n iid: PerpsInstrumentIdSchema,\n buy: z.boolean(),\n p: DecimalStringSchema,\n qty: DecimalStringSchema,\n tif: PerpsTimeInForceSchema,\n po: z.boolean(),\n status: z.string().min(1),\n rest: DecimalStringSchema,\n fill: DecimalStringSchema,\n cts: EpochMillisecondsSchema,\n uts: EpochMillisecondsSchema,\n coid: z.string().optional(),\n })\n .transform((order) => ({\n orderId: order.oid,\n instrumentId: order.iid,\n buy: order.buy,\n price: order.p,\n quantity: order.qty,\n timeInForce: order.tif,\n postOnly: order.po,\n status: order.status,\n restingQuantity: order.rest,\n filledQuantity: order.fill,\n createdTimestamp: order.cts,\n updatedTimestamp: order.uts,\n clientOrderId: order.coid,\n }));\n\nexport const PerpsAccountFillSchema = z.object({\n tradeId: PerpsTradeIdSchema,\n orderId: PerpsOrderIdSchema,\n instrumentId: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n price: DecimalStringSchema,\n quantity: DecimalStringSchema,\n taker: z.boolean(),\n fee: DecimalStringSchema,\n feeAsset: PerpsAssetSchema,\n previousSize: DecimalStringSchema,\n previousEntryPrice: DecimalStringSchema,\n pnl: DecimalStringSchema,\n liquidation: z.boolean(),\n timestamp: EpochMillisecondsSchema,\n hash: TxHashSchema.optional(),\n clientOrderId: z.string().optional(),\n});\n\nexport type PerpsAccountFill = z.infer<typeof PerpsAccountFillSchema>;\n\nexport const RawPerpsAccountFillSchema = z\n .object({\n trade_id: PerpsTradeIdSchema,\n order_id: PerpsOrderIdSchema,\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n price: DecimalStringSchema,\n quantity: DecimalStringSchema,\n taker: z.boolean(),\n fee: DecimalStringSchema,\n fee_asset: PerpsAssetSchema,\n previous_size: DecimalStringSchema,\n previous_entry_price: DecimalStringSchema,\n pnl: DecimalStringSchema,\n liquidation: z.boolean(),\n timestamp: EpochMillisecondsSchema,\n hash: RawPerpsTxHashSchema,\n })\n .transform((fill) => ({\n tradeId: fill.trade_id,\n orderId: fill.order_id,\n instrumentId: fill.instrument_id,\n side: fill.side,\n price: fill.price,\n quantity: fill.quantity,\n taker: fill.taker,\n fee: fill.fee,\n feeAsset: fill.fee_asset,\n previousSize: fill.previous_size,\n previousEntryPrice: fill.previous_entry_price,\n pnl: fill.pnl,\n liquidation: fill.liquidation,\n timestamp: fill.timestamp,\n hash: fill.hash,\n }));\n\nexport const ListPerpsFillsResponseSchema = PerpsDataResponseSchema(\n RawPerpsAccountFillSchema,\n);\n\nexport const RawPerpsAccountFillUpdateSchema = z\n .object({\n tid: PerpsTradeIdSchema,\n oid: PerpsOrderIdSchema,\n iid: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n p: DecimalStringSchema,\n qty: DecimalStringSchema,\n taker: z.boolean(),\n fee: DecimalStringSchema,\n fea: PerpsAssetSchema,\n psz: DecimalStringSchema,\n pep: DecimalStringSchema,\n pnl: DecimalStringSchema,\n liq: z.boolean(),\n ts: EpochMillisecondsSchema,\n coid: z.string().optional(),\n })\n .transform((fill) => ({\n tradeId: fill.tid,\n orderId: fill.oid,\n instrumentId: fill.iid,\n side: fill.side,\n price: fill.p,\n quantity: fill.qty,\n taker: fill.taker,\n fee: fill.fee,\n feeAsset: fill.fea,\n previousSize: fill.psz,\n previousEntryPrice: fill.pep,\n pnl: fill.pnl,\n liquidation: fill.liq,\n timestamp: fill.ts,\n clientOrderId: fill.coid,\n }));\n"]}
@@ -0,0 +1,99 @@
1
+ import { EvmAddress, PrivateKey, TxHash } from '@polymarket/types';
2
+ import { z } from 'zod';
3
+ import { DecimalString, BaseUnits } from './index.js';
4
+
5
+ type Tagged<T, Tag extends string> = T & {
6
+ readonly __tag: Tag;
7
+ };
8
+ type PerpsInstrumentId = Tagged<number, 'PerpsInstrumentId'>;
9
+ type PerpsOrderId = Tagged<number, 'PerpsOrderId'>;
10
+ type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;
11
+ type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;
12
+ type PerpsWithdrawalId = Tagged<number, 'PerpsWithdrawalId'>;
13
+ type PerpsInternalTransferId = Tagged<number, 'PerpsInternalTransferId'>;
14
+ declare const PerpsInstrumentIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
15
+ declare const PerpsOrderIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
16
+ declare const PerpsClientOrderIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>;
17
+ declare const PerpsTradeIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
18
+ declare const PerpsWithdrawalIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsWithdrawalId, number>>;
19
+ declare const PerpsInternalTransferIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInternalTransferId, number>>;
20
+ declare const PerpsDecimalInputSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
21
+ type PerpsDecimalInput = z.input<typeof PerpsDecimalInputSchema>;
22
+ declare enum PerpsInstrumentType {
23
+ Perpetual = "perpetual"
24
+ }
25
+ declare enum PerpsInstrumentCategory {
26
+ Equity = "equity",
27
+ Commodity = "commodity",
28
+ Index = "index",
29
+ Crypto = "crypto"
30
+ }
31
+ declare enum PerpsSide {
32
+ Long = "long",
33
+ Short = "short"
34
+ }
35
+ declare enum PerpsTimeInForce {
36
+ Gtc = "gtc",
37
+ Ioc = "ioc",
38
+ Fok = "fok"
39
+ }
40
+ declare enum PerpsDepositStatus {
41
+ Pending = "pending",
42
+ Confirmed = "confirmed",
43
+ Removed = "removed"
44
+ }
45
+ declare enum PerpsWithdrawalStatus {
46
+ Pending = "pending",
47
+ Confirmed = "confirmed",
48
+ Removed = "removed"
49
+ }
50
+ declare enum PerpsInternalTransferDirection {
51
+ In = "in",
52
+ Out = "out"
53
+ }
54
+ declare enum PerpsKlineInterval {
55
+ OneSecond = "1s",
56
+ OneMinute = "1m",
57
+ FiveMinutes = "5m",
58
+ FifteenMinutes = "15m",
59
+ OneHour = "1h",
60
+ FourHours = "4h",
61
+ OneDay = "1d",
62
+ OneWeek = "1w"
63
+ }
64
+ declare enum PerpsPnlInterval {
65
+ OneHour = "1h",
66
+ FourHours = "4h",
67
+ OneDay = "1d",
68
+ OneWeek = "1w"
69
+ }
70
+ declare const PerpsInstrumentTypeSchema: z.ZodEnum<typeof PerpsInstrumentType>;
71
+ declare const PerpsInstrumentCategorySchema: z.ZodEnum<typeof PerpsInstrumentCategory>;
72
+ declare const PerpsSideSchema: z.ZodEnum<typeof PerpsSide>;
73
+ declare const PerpsTimeInForceSchema: z.ZodEnum<typeof PerpsTimeInForce>;
74
+ declare const PerpsDepositStatusSchema: z.ZodEnum<typeof PerpsDepositStatus>;
75
+ declare const PerpsWithdrawalStatusSchema: z.ZodEnum<typeof PerpsWithdrawalStatus>;
76
+ declare const PerpsInternalTransferDirectionSchema: z.ZodEnum<typeof PerpsInternalTransferDirection>;
77
+ declare const PerpsKlineIntervalSchema: z.ZodEnum<typeof PerpsKlineInterval>;
78
+ declare const PerpsPnlIntervalSchema: z.ZodEnum<typeof PerpsPnlInterval>;
79
+ declare const PerpsAssetSchema: z.ZodString;
80
+ declare const RawPerpsTxHashSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<TxHash, string>>>>;
81
+ declare const PerpsDataResponseSchema: <T extends z.ZodType>(itemSchema: T) => z.ZodObject<{
82
+ data: z.ZodArray<T>;
83
+ more: z.ZodBoolean;
84
+ }, z.core.$strip>;
85
+ type PerpsCredentials = {
86
+ proxy: EvmAddress;
87
+ privateKey: PrivateKey;
88
+ secret: string;
89
+ expiresAt: number;
90
+ };
91
+ type PerpsDepositAmount = BaseUnits;
92
+ type PerpsWithdrawalAmount = BaseUnits;
93
+ type PerpsTxHash = TxHash;
94
+ type PerpsDecimal = DecimalString;
95
+ declare function perpsDecimal(value: string | number): DecimalString;
96
+ declare function perpsBaseUnits(value: string): BaseUnits;
97
+ declare function decimalString(value: string): DecimalString;
98
+
99
+ export { PerpsKlineInterval as A, PerpsKlineIntervalSchema as B, PerpsOrderIdSchema as C, PerpsPnlInterval as D, PerpsPnlIntervalSchema as E, PerpsSideSchema as F, PerpsTimeInForceSchema as G, PerpsTradeIdSchema as H, type PerpsTxHash as I, type PerpsWithdrawalAmount as J, PerpsWithdrawalIdSchema as K, PerpsWithdrawalStatusSchema as L, decimalString as M, perpsBaseUnits as N, perpsDecimal as O, type PerpsInstrumentId as P, RawPerpsTxHashSchema as R, PerpsDepositStatus as a, type PerpsWithdrawalId as b, PerpsWithdrawalStatus as c, type PerpsInternalTransferId as d, PerpsInternalTransferDirection as e, PerpsInstrumentType as f, PerpsInstrumentCategory as g, type PerpsTradeId as h, PerpsSide as i, type PerpsOrderId as j, PerpsTimeInForce as k, type PerpsClientOrderId as l, PerpsAssetSchema as m, PerpsClientOrderIdSchema as n, type PerpsCredentials as o, PerpsDataResponseSchema as p, type PerpsDecimal as q, type PerpsDecimalInput as r, PerpsDecimalInputSchema as s, type PerpsDepositAmount as t, PerpsDepositStatusSchema as u, PerpsInstrumentCategorySchema as v, PerpsInstrumentIdSchema as w, PerpsInstrumentTypeSchema as x, PerpsInternalTransferDirectionSchema as y, PerpsInternalTransferIdSchema as z };