@polymarket/bindings 0.4.0 → 0.5.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.
@@ -0,0 +1,2 @@
1
+ import {Ka,La,ba,aa,Pa,Na,R as R$1}from'./chunk-6TO35A2S.js';import {z}from'zod';function v(e){return e}var a=z.number().int().nonnegative().transform(v),b=z.number().int().nonnegative().transform(v),A=z.string().regex(/^[0-9a-f]{32}$/).transform(e=>e),q=z.uuid().transform(e=>e),k=z.number().int().nonnegative().transform(v),C=z.number().int().nonnegative().transform(v),R=z.number().int().nonnegative().transform(v),H=z.number().int().nonnegative().transform(v),w=z.number().int().positive().transform(v),Q=z.string().regex(/^[1-9]\d*h$/).transform(e=>e),he=Na,V=(l=>(l.Perpetual="perpetual",l))(V||{}),$=(c=>(c.Equity="equity",c.Commodity="commodity",c.Index="index",c.Crypto="crypto",c))($||{}),G=(d=>(d.Long="long",d.Short="short",d))(G||{}),Y=(P=>(P.GTC="gtc",P.IOC="ioc",P.FOK="fok",P))(Y||{}),Z=(d=>(d.TakeProfit="tp",d.StopLoss="sl",d))(Z||{}),X=(d=>(d.Order="order",d.Position="position",d))(X||{}),J=(P=>(P.Pending="pending",P.Confirmed="confirmed",P.Removed="removed",P))(J||{}),Pe=(c=>(c.Pending="pending",c.Confirmed="confirmed",c.Removed="removed",c.Failed="failed",c))(Pe||{}),K=(d=>(d.In="in",d.Out="out",d))(K||{}),ee=(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))(ee||{}),te=(c=>(c.OneHour="1h",c.FourHours="4h",c.OneDay="1d",c.OneWeek="1w",c))(te||{}),re=(d=>(d.Descending="desc",d.Ascending="asc",d))(re||{}),E=z.enum(V),O=z.enum($),_=z.enum(G),L=z.enum(Y),ne=z.enum(Z),ie=z.enum(X),N=z.enum(J),D=z.string().transform(e=>e),oe=z.enum(K),rt=z.enum(ee),nt=z.enum(te),it=z.enum(re),u=z.string().min(1),x=z.preprocess(e=>e==="0x"||e===""?void 0:e,Ka.optional()),y=e=>z.object({data:z.array(e),more:z.boolean()});function ot(e){return he.parse(e)}function st(e){return Pa.parse(e)}function at(e){return R$1(e)}var _e=z.object({asset:u,balance:La,value:La}),ut=z.array(_e),fe=z.object({volume_7d:La,taker_volume_7d:La,maker_volume_7d:La,account_maker_share_7d:La,entity_maker_share_7d:La.optional(),entity_id:w.optional(),entity_name:z.string().min(1).optional()}).transform(e=>({volume7d:e.volume_7d,takerVolume7d:e.taker_volume_7d,makerVolume7d:e.maker_volume_7d,accountMakerShare7d:e.account_maker_share_7d,entityMakerShare7d:e.entity_maker_share_7d,entityId:e.entity_id,entityName:e.entity_name})),lt=fe,xe=z.object({instrument_id:a,symbol:z.string().min(1),size:La,entry_price:La,leverage:z.number().int().positive(),cross:z.boolean(),initial_margin:La,maintenance_margin:La,position_value:La,liquidation_price:La,unrealized_pnl:La,return_on_equity:La,cumulative_funding:La}).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})),yt=z.object({totalAccountValue:La,totalInitialMargin:La,totalMaintenanceMargin:La,totalPositionValue:La}),Se=z.object({total_account_value:La,total_initial_margin:La,total_maintenance_margin:La,total_position_value:La}).transform(e=>({totalAccountValue:e.total_account_value,totalInitialMargin:e.total_initial_margin,totalMaintenanceMargin:e.total_maintenance_margin,totalPositionValue:e.total_position_value})),ge=z.object({positions:z.array(xe),margin:Se,withdrawable:La,in_liquidation:z.boolean(),timestamp:ba}).transform(e=>({positions:e.positions,margin:e.margin,withdrawable:e.withdrawable,inLiquidation:e.in_liquidation,timestamp:e.timestamp})),ht=ge,be=z.object({id:C,instrument_id:a,size:La,funding_rate:La,funding_asset:u,funding:La,timestamp:ba}).transform(e=>({id:e.id,instrumentId:e.instrument_id,size:e.size,fundingRate:e.funding_rate,fundingAsset:e.funding_asset,funding:e.funding,timestamp:e.timestamp})),Pt=y(be),_t=z.object({id:C,iid:a,sz:La,fr:La,fund:La,fua:u,ts:ba}).transform(e=>({id:e.id,instrumentId:e.iid,size:e.sz,fundingRate:e.fr,fundingAsset:e.fua,funding:e.fund,timestamp:e.ts})),Ie=z.object({instrument_id:a,leverage:z.number().int().positive(),cross:z.boolean()}).transform(e=>({instrumentId:e.instrument_id,leverage:e.leverage,cross:e.cross})),ft=z.array(Ie),ve=z.tuple([ba,La]).transform(([e,l])=>({timestamp:e,equity:l})),xt=y(ve),qe=z.tuple([ba,La]).transform(([e,l])=>({timestamp:e,pnl:l})),St=y(qe),ke=z.number().finite().positive().refine(e=>Number.isInteger(e),"Expected integer").transform(e=>e>Number.MAX_SAFE_INTEGER?Math.floor(e/1e6):e).pipe(ba),Te=z.object({proxy:aa,label:z.string().optional(),expiry:ke}).transform(e=>({proxy:e.proxy,label:e.label,expiresAt:e.expiry})),gt=z.object({address:aa,keys:z.array(Te)}).transform(e=>({address:e.address,keys:e.keys})),bt=z.object({secret:z.string().min(1)}),It=z.object({status:z.enum(["ok","err"]),error:z.string().optional()});var ze=z.object({hash:Ka,asset:u,amount:Pa,status:N,from:aa,to:aa,confirmations:z.number().int().nonnegative(),required_confirmations:z.number().int().nonnegative(),created_timestamp:ba,confirmed_timestamp:ba.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})),zt=y(ze),Ft=z.object({hash:x,asset:u,amount:Pa,status:N}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status})),Fe=z.object({withdraw_id:R,asset:u,amount:Pa,fee:La,status:D,to:aa,hash:x,confirmations:z.number().int().nonnegative(),required_confirmations:z.number().int().nonnegative(),created_timestamp:ba,confirmed_timestamp:ba.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})),Rt=y(Fe),jt=z.object({status:z.enum(["ok","err"]),withdraw_id:R.optional(),error:z.string().optional()}).transform(e=>({status:e.status,withdrawalId:e.withdraw_id,error:e.error})),At=z.object({withdraw_id:R,asset:u,amount:Pa,fee:La,status:D,to:aa,hash:x}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash})),Ct=z.object({transferId:H,asset:u,amount:Pa,direction:oe,counterparty:aa,label:z.string().optional(),createdTimestamp:ba});var Dt=z.object({lowerBound:La,maxLeverage:z.number().int().positive()}),Re=z.object({lower_bound:La,max_leverage:z.number().int().positive()}).transform(e=>({lowerBound:e.lower_bound,maxLeverage:e.max_leverage})),je=z.object({instrument_id:a,instrument_type:E,category:O,symbol:z.string().min(1),base_asset:u,quote_asset:u,funding_interval:Q,quantity_decimals:z.number().int().nonnegative(),price_decimals:z.number().int().nonnegative(),price_bounds:La,liquidation_fee:La,max_order_count:z.number().int().positive(),min_notional:La,max_market_notional:La,max_limit_notional:La,max_leverage:z.number().int().positive(),isolated_only:z.boolean(),risk_tiers:z.array(Re)}).transform(e=>({id:e.instrument_id,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,isolatedOnly:e.isolated_only,riskTiers:e.risk_tiers})),Bt=z.array(je),Ae=z.object({instrument_id:a,symbol:z.string().min(1),index_price:La,mark_price:La,last_price:La,mid_price:La,open_interest:La,funding_rate:La,next_funding:ba,timestamp:ba.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})),Mt=z.array(Ae),Ut=z.object({iid:a,idx:La,mark:La,last:La,mid:La,oi:La,fr:La,nxf:ba}).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})),B=z.tuple([ba,La,La,La,La,La,z.number().int().nonnegative()]).transform(([e,l,d,P,c,T,z])=>({timestamp:e,open:l,high:d,low:P,close:c,volume:T,trades:z})),Ce=z.object({instrument_id:a,symbol:z.string().min(1).optional(),volume:La,open_price:La,klines:z.array(B)}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,volume:e.volume,openPrice:e.open_price,klines:e.klines})),Wt=z.array(Ce),Ht=z.object({iid:a,vol:La,open:La,klines:z.array(B)}).transform(e=>({instrumentId:e.iid,volume:e.vol,openPrice:e.open,klines:e.klines})),j=z.tuple([La,La]).transform(([e,l])=>({price:e,quantity:l})),wt=z.object({instrument_id:a,bids:z.array(j),asks:z.array(j),timestamp:ba,sequence:z.number().int().nonnegative()}).transform(e=>({instrumentId:e.instrument_id,bids:e.bids,asks:e.asks,timestamp:e.timestamp,sequence:e.sequence})),Qt=z.object({b:z.array(j),a:z.array(j)}).transform(e=>({bids:e.b,asks:e.a})),Vt=z.object({instrumentId:a,bidPrice:La,bidQuantity:La,askPrice:La,askQuantity:La,timestamp:ba.optional()}),$t=z.object({iid:a,bp:La,bq:La,ap:La,aq:La}).transform(e=>({instrumentId:e.iid,bidPrice:e.bp,bidQuantity:e.bq,askPrice:e.ap,askQuantity:e.aq})),Ee=z.object({trade_id:k,instrument_id:a,side:_,price:La,quantity:La,timestamp:ba,hash:x}).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})),Gt=z.object({tid:k,iid:a,side:_,p:La,qty:La,ts:ba,hash:x}).transform(e=>({tradeId:e.tid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,timestamp:e.ts,hash:e.hash})),Yt=y(Ee),Oe=z.object({funding_rate:La,timestamp:ba}).transform(e=>({fundingRate:e.funding_rate,timestamp:e.timestamp})),Zt=y(Oe),Le=z.object({min_volume_30d:La,taker_fee_rate:La,maker_fee_rate:La}).transform(e=>({minVolume30d:e.min_volume_30d,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate})),Ne=z.object({instrument_type:E,category:O,taker_fee_rate:La,maker_fee_rate:La,tiers:z.array(Le)}).transform(e=>({category:e.category,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate,tiers:e.tiers})),De=z.object({fee_schedule:z.array(Ne)}).transform(e=>({feeSchedule:e.fee_schedule})),Xt=De,Jt=y(B);var se=(I=>(I.PositionOpened="position_opened",I.PositionIncreased="position_increased",I.PositionReduced="position_reduced",I.PositionClosed="position_closed",I.LimitOrderCanceled="limit_order_canceled",I.LiquidationWarning="liquidation_warning",I.PositionLiquidated="position_liquidated",I))(se||{}),Be=z.enum(se),ae=(c=>(c.Market="market",c.Limit="limit",c.TakeProfit="take_profit",c.StopLoss="stop_loss",c))(ae||{}),pe=z.enum(ae),me=(d=>(d.Cross="cross",d.Isolated="isolated",d))(me||{}),Me=z.enum(me),Ue=z.object({id:q,type:z.enum(["position_opened","position_increased","position_reduced"]),instrument_id:a,side:_,size:La,avg_price:La,leverage:z.number().int().positive(),order_type:pe.optional()}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,size:e.size,avgPrice:e.avg_price,leverage:e.leverage,orderType:e.order_type})),We=z.object({id:q,type:z.literal("position_closed"),instrument_id:a,side:_,size:La,avg_price:La,pnl:La,order_type:pe.optional()}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,size:e.size,avgPrice:e.avg_price,pnl:e.pnl,orderType:e.order_type})),He=z.object({id:q,type:z.literal("limit_order_canceled"),instrument_id:a,side:_,size:La,price:La}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,size:e.size,price:e.price})),we=z.object({id:q,type:z.literal("liquidation_warning"),margin_type:z.literal("isolated"),instrument_id:a,mark_price:La,liq_price:La}).transform(e=>({id:e.id,type:e.type,marginType:e.margin_type,instrumentId:e.instrument_id,markPrice:e.mark_price,liquidationPrice:e.liq_price})),Qe=z.object({id:q,type:z.literal("liquidation_warning"),margin_type:z.literal("cross"),instrument_id:z.null(),mark_price:La,affected_instruments:z.array(a)}).transform(e=>({id:e.id,type:e.type,marginType:e.margin_type,markPrice:e.mark_price,affectedInstruments:e.affected_instruments})),Ve=z.discriminatedUnion("margin_type",[we,Qe]),$e=z.object({id:q,type:z.literal("position_liquidated"),instrument_id:a,side:_,size_closed:La,pnl:La.nullable(),margin_type:Me,via_backstop:z.boolean()}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,sizeClosed:e.size_closed,pnl:e.pnl,marginType:e.margin_type,viaBackstop:e.via_backstop})),Ge=z.discriminatedUnion("type",[Ue,We,He,Ve,$e]),Ye=z.object({notification:Ge,read_at:ba.nullable(),ts:ba}).transform(e=>({notification:e.notification,readAt:e.read_at,timestamp:e.ts})),Ze=z.object({notification:z.object({type:Be})}),Xe=z.array(z.unknown()).transform((e,l)=>{let d=[];return e.forEach((P,c)=>{if(!Ze.safeParse(P).success)return;let T=Ye.safeParse(P);if(T.success){d.push(T.data);return}for(let z of T.error.issues)l.addIssue({...z,path:[c,...z.path]});}),d}),nr=z.object({items:Xe,unread:z.number().int().nonnegative(),durable_source_seq:z.number().int().nonnegative(),has_more:z.boolean(),next_cursor:z.string().nullable()}),ir=z.object({unread:z.number().int().nonnegative()}),or=z.object({status:z.enum(["ok","err"]),error:z.string().optional()});var ce=(m=>(m.Accepted="accepted",m.Open="open",m.Partial="partial",m.Filled="filled",m.Cancelled="cancelled",m.AutoCancelled="auto_cancelled",m.PostOnlyRejected="post_only_rejected",m.FokUnfilled="fok_unfilled",m.IocNoFill="ioc_no_fill",m.IocExpired="ioc_expired",m.StpCancelled="stp_cancelled",m.ZeroQuantity="zero_quantity",m.DuplicateOrder="duplicate_order",m.OrderNotFound="order_not_found",m.ReduceOnlyInvalid="reduce_only_invalid",m.ReduceOnlyExpired="reduce_only_expired",m.OrderExpired="order_expired",m.Untriggered="untriggered",m.Armed="armed",m.Triggered="triggered",m.ParentCancelled="parent_cancelled",m.PositionClosed="position_closed",m.PositionFlipped="position_flipped",m.ReduceOnlyInvalidAtTrigger="reduce_only_invalid_at_trigger",m.Expired="expired",m))(ce||{}),de=z.object({kind:ne,scope:ie,trp:La,parent_oid:b.optional(),armed_qty:La.optional(),slip_bps:z.number().int().nonnegative().optional()}).transform(e=>({kind:e.kind,scope:e.scope,triggerPrice:e.trp,parentOrderId:e.parent_oid,armedQuantity:e.armed_qty,slippageBps:e.slip_bps})),ue=z.enum(ce),le=z.enum(["ok","err"]),Je=z.string().min(1).optional().transform(M),dr=z.discriminatedUnion("status",[z.object({status:z.literal("ok")}),z.object({status:z.literal("err"),error:Je})]),ur=z.object({status:le,oid:b.optional(),coid:A.optional(),error:z.string().optional()}).transform((e,l)=>e.status==="err"?{status:"err",error:M(e.error),clientOrderId:e.coid}:e.oid===void 0?(l.addIssue({code:"custom",message:"Expected Perps place order acknowledgement order id."}),z.NEVER):{status:"ok",orderId:e.oid,clientOrderId:e.coid}),lr=z.object({status:le,oid:b.optional(),coid:A.optional(),error:z.string().optional()}).transform(e=>e.status==="err"?{status:"err",error:M(e.error),orderId:e.oid,clientOrderId:e.coid}:{status:"ok",orderId:e.oid,clientOrderId:e.coid}),yr=z.object({status:z.literal("ok")}),hr=z.object({status:z.literal("ok"),instrument_id:a,leverage:z.number().int().positive(),cross:z.boolean()}).transform(e=>({status:e.status,instrumentId:e.instrument_id,leverage:e.leverage,crossMargin:e.cross}));function M(e){return e??"Perps command was rejected."}var ye=z.object({order_id:b,instrument_id:a,buy:z.boolean(),price:La,quantity:La,tif:L,post_only:z.boolean(),ro:z.boolean(),status:ue,resting_quantity:La,filled_quantity:La,created_timestamp:ba,updated_timestamp:ba,client_order_id:z.string().optional(),tpsl:de.nullish()}).transform(e=>({id:e.order_id,instrumentId:e.instrument_id,side:e.buy?"BUY":"SELL",price:e.price,quantity:e.quantity,timeInForce:e.tif,postOnly:e.post_only,reduceOnly:e.ro,status:e.status,restingQuantity:e.resting_quantity,filledQuantity:e.filled_quantity,createdTimestamp:e.created_timestamp,updatedTimestamp:e.updated_timestamp,clientOrderId:e.client_order_id,tpSl:e.tpsl??void 0})),Pr=z.array(ye),_r=z.array(ye),fr=z.object({oid:b,iid:a,buy:z.boolean(),p:La,qty:La,tif:L,po:z.boolean(),ro:z.boolean(),status:ue,rest:La,fill:La,cts:ba,uts:ba,coid:z.string().optional(),tpsl:de.nullish()}).transform(e=>({id:e.oid,instrumentId:e.iid,side:e.buy?"BUY":"SELL",price:e.p,quantity:e.qty,timeInForce:e.tif,postOnly:e.po,reduceOnly:e.ro,status:e.status,restingQuantity:e.rest,filledQuantity:e.fill,createdTimestamp:e.cts,updatedTimestamp:e.uts,clientOrderId:e.coid,tpSl:e.tpsl??void 0})),Ke=z.object({trade_id:k,order_id:b,instrument_id:a,side:_,price:La,quantity:La,taker:z.boolean(),fee:La,fee_asset:u,previous_size:La,previous_entry_price:La,pnl:La,liquidation:z.boolean(),timestamp:ba,hash:x}).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})),xr=y(Ke),Sr=z.object({tid:k,oid:b,iid:a,side:_,p:La,qty:La,taker:z.boolean(),fee:La,fea:u,psz:La,pep:La,pnl:La,liq:z.boolean(),ts:ba,coid:z.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{ft as $,Ye as $a,L as A,j as Aa,ne as B,wt as Ba,ie as C,Qt as Ca,N as D,Vt as Da,D as E,$t as Ea,oe as F,Ee as Fa,rt as G,Gt as Ga,nt as H,Yt as Ha,it as I,Oe as Ia,u as J,Zt as Ja,x as K,Le as Ka,y as L,Ne as La,ot as M,De as Ma,st as N,Xt as Na,at as O,Jt as Oa,_e as P,se as Pa,ut as Q,Be as Qa,fe as R,ae as Ra,lt as S,pe as Sa,xe as T,me as Ta,yt as U,Me as Ua,ge as V,Ue as Va,ht as W,We as Wa,be as X,He as Xa,Pt as Y,Ve as Ya,_t as Z,$e as Za,Ie as _,Ge as _a,a,ve as aa,nr as ab,b,xt as ba,ir as bb,A as c,qe as ca,or as cb,q as d,St as da,ce as db,k as e,Te as ea,de as eb,C as f,gt as fa,ue as fb,R as g,bt as ga,le as gb,H as h,It as ha,dr as hb,w as i,ze as ia,ur as ib,Q as j,zt as ja,lr as jb,he as k,Ft as ka,yr as kb,V as l,Fe as la,hr as lb,$ as m,Rt as ma,ye as mb,G as n,jt as na,Pr as nb,Y as o,At as oa,_r as ob,Z as p,Ct as pa,fr as pb,X as q,Dt as qa,Ke as qb,J as r,je as ra,xr as rb,Pe as s,Bt as sa,Sr as sb,K as t,Ae as ta,ee as u,Mt as ua,te as v,Ut as va,re as w,B as wa,E as x,Ce as xa,O as y,Wt as ya,_ as z,Ht as za};//# sourceMappingURL=chunk-I4SRN2Q5.js.map
2
+ //# sourceMappingURL=chunk-I4SRN2Q5.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/notifications.ts","../src/perps/orders.ts"],"names":["taggedInteger","value","PerpsInstrumentIdSchema","z","PerpsOrderIdSchema","PerpsClientOrderIdSchema","PerpsNotificationIdSchema","PerpsTradeIdSchema","PerpsFundingPaymentIdSchema","PerpsWithdrawalIdSchema","PerpsInternalTransferIdSchema","PerpsEntityIdSchema","PerpsFundingIntervalSchema","PerpsDecimalInputSchema","DecimalishSchema","PerpsInstrumentType","PerpsInstrumentCategory","PerpsSide","PerpsTimeInForce","PerpsTpSlKind","PerpsTpSlScope","PerpsDepositStatus","PerpsKnownWithdrawalStatus","PerpsInternalTransferDirection","PerpsKlineInterval","PerpsPnlInterval","PerpsSortDirection","PerpsInstrumentTypeSchema","PerpsInstrumentCategorySchema","PerpsSideSchema","PerpsTimeInForceSchema","PerpsTpSlKindSchema","PerpsTpSlScopeSchema","PerpsDepositStatusSchema","PerpsWithdrawalStatusSchema","PerpsInternalTransferDirectionSchema","PerpsKlineIntervalSchema","PerpsPnlIntervalSchema","PerpsSortDirectionSchema","PerpsAssetSchema","PerpsTxHashSchema","hash","TxHashSchema","PerpsDataResponseSchema","itemSchema","perpsDecimal","perpsBaseUnits","BaseUnitsSchema","decimalString","toDecimalString","PerpsBalanceSchema","DecimalStringSchema","FetchPerpsBalancesResponseSchema","PerpsAccountStatsSchema","stats","FetchPerpsAccountStatsResponseSchema","PerpsPortfolioPositionSchema","position","PerpsMarginSummarySchema","RawPerpsMarginSummarySchema","margin","PerpsPortfolioSchema","EpochMillisecondsSchema","portfolio","FetchPerpsPortfolioResponseSchema","PerpsAccountFundingPaymentSchema","funding","ListPerpsFundingPaymentsResponseSchema","PerpsAccountFundingPaymentEntrySchema","PerpsAccountConfigSchema","config","FetchPerpsAccountConfigResponseSchema","PerpsEquityPointSchema","timestamp","equity","ListPerpsEquityHistoryResponseSchema","PerpsPnlPointSchema","pnl","ListPerpsPnlHistoryResponseSchema","RawPerpsProxyExpirySchema","PerpsProxyKeySchema","EvmAddressSchema","key","PerpsCredentialsResponseSchema","credentials","PerpsCreateProxyResponseSchema","PerpsDeleteProxyResponseSchema","PerpsDepositSchema","deposit","ListPerpsDepositsResponseSchema","PerpsDepositUpdateSchema","PerpsWithdrawalSchema","withdrawal","ListPerpsWithdrawalsResponseSchema","PerpsWithdrawResponseSchema","response","PerpsWithdrawalUpdateSchema","PerpsInternalTransferSchema","PerpsRiskTierSchema","RawPerpsRiskTierSchema","tier","PerpsInstrumentSchema","instrument","FetchPerpsInstrumentsResponseSchema","PerpsTickerSchema","ticker","FetchPerpsTickersResponseSchema","PerpsTickerEntrySchema","PerpsCandleSchema","open","high","low","close","volume","trades","PerpsStatisticSchema","statistic","FetchPerpsStatisticsResponseSchema","PerpsStatisticUpdateSchema","PerpsBookLevelSchema","price","quantity","PerpsBookSchema","book","PerpsBookUpdateSchema","PerpsBboSchema","PerpsBboUpdateSchema","bbo","PerpsPublicTradeSchema","trade","PerpsPublicTradeUpdateSchema","FetchPerpsTradesResponseSchema","PerpsFundingRateSchema","FetchPerpsFundingHistoryResponseSchema","PerpsFeeTierSchema","PerpsFeeScheduleEntrySchema","fee","PerpsFeesInfoSchema","fees","FetchPerpsFeesResponseSchema","FetchPerpsCandlesResponseSchema","PerpsNotificationType","PerpsNotificationTypeSchema","PerpsNotificationOrderType","PerpsNotificationOrderTypeSchema","PerpsMarginType","PerpsMarginTypeSchema","PerpsPositionChangeNotificationSchema","notification","PerpsPositionClosedNotificationSchema","PerpsLimitOrderCanceledNotificationSchema","PerpsIsolatedLiquidationWarningNotificationSchema","PerpsCrossLiquidationWarningNotificationSchema","PerpsLiquidationWarningNotificationSchema","PerpsPositionLiquidatedNotificationSchema","PerpsNotificationSchema","PerpsNotificationEntrySchema","entry","PerpsNotificationEntryTypeProbeSchema","PerpsNotificationEntriesSchema","items","ctx","entries","item","index","issue","ListPerpsNotificationsResponseSchema","FetchPerpsUnreadNotificationsCountResponseSchema","MarkPerpsNotificationsReadResponseSchema","PerpsOrderStatus","PerpsTpSlOrderFieldsSchema","fields","PerpsOrderStatusSchema","PerpsCommandStatusSchema","PerpsAckErrorSchema","perpsAckError","PerpsCommandAckSchema","PerpsPostOrderAckSchema","ack","PerpsCancelOrderResultSchema","PerpsCancelAllOrdersResponseSchema","PerpsUpdateLeverageResultSchema","result","error","PerpsOrderSchema","order","FetchPerpsOrdersResponseSchema","FetchPerpsOpenOrdersResponseSchema","PerpsOrderUpdateSchema","PerpsAccountFillSchema","fill","ListPerpsFillsResponseSchema","PerpsAccountFillUpdateSchema"],"mappings":"iFAwDA,SAASA,EAAgCC,CAAAA,CAAkB,CACzD,OAAOA,CACT,CAKO,IAAMC,EAA0BC,CAAAA,CACpC,MAAA,GACA,GAAA,EAAI,CACJ,aAAY,CACZ,SAAA,CAAUH,CAAgC,CAAA,CAKhCI,CAAAA,CAAqBD,CAAAA,CAC/B,QAAO,CACP,GAAA,GACA,WAAA,EAAY,CACZ,UAAUH,CAA2B,CAAA,CAK3BK,CAAAA,CAA2BF,CAAAA,CACrC,MAAA,EAAO,CACP,MAAM,gBAAgB,CAAA,CACtB,SAAA,CAAWF,CAAAA,EAAUA,CAA2B,CAAA,CAKtCK,EAA4BH,CAAAA,CACtC,IAAA,EAAK,CACL,SAAA,CAAWF,CAAAA,EAAUA,CAA4B,EAKvCM,CAAAA,CAAqBJ,CAAAA,CAC/B,QAAO,CACP,GAAA,GACA,WAAA,EAAY,CACZ,SAAA,CAAUH,CAA2B,CAAA,CAK3BQ,CAAAA,CAA8BL,EACxC,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,WAAA,EAAY,CACZ,UAAUH,CAAoC,CAAA,CAKpCS,CAAAA,CAA0B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A,CAAKgD,EAAAA,CACL,GAAA,CAAKZ,CAAAA,CACL,GAAA,CAAKY,EAAAA,CACL,IAAKA,EAAAA,CACL,GAAA,CAAKA,EAAAA,CACL,GAAA,CAAKhD,CAAAA,CAAE,OAAA,GACP,EAAA,CAAI2D,EAAAA,CACJ,IAAA,CAAM3D,CAAAA,CAAE,MAAA,EAAO,CAAE,UACnB,CAAC,EACA,SAAA,CAAW2L,CAAAA,GAAU,CACpB,OAAA,CAASA,CAAAA,CAAK,GAAA,CACd,OAAA,CAASA,CAAAA,CAAK,GAAA,CACd,aAAcA,CAAAA,CAAK,GAAA,CACnB,IAAA,CAAMA,CAAAA,CAAK,IAAA,CACX,KAAA,CAAOA,EAAK,CAAA,CACZ,QAAA,CAAUA,CAAAA,CAAK,GAAA,CACf,KAAA,CAAOA,CAAAA,CAAK,MACZ,GAAA,CAAKA,CAAAA,CAAK,IACV,QAAA,CAAUA,CAAAA,CAAK,IACf,YAAA,CAAcA,CAAAA,CAAK,GAAA,CACnB,kBAAA,CAAoBA,CAAAA,CAAK,GAAA,CACzB,IAAKA,CAAAA,CAAK,GAAA,CACV,WAAA,CAAaA,CAAAA,CAAK,GAAA,CAClB,SAAA,CAAWA,EAAK,EAAA,CAChB,aAAA,CAAeA,CAAAA,CAAK,IACtB,CAAA,CAAE","file":"chunk-I4SRN2Q5.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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInstrumentId = Tagged<number, 'PerpsInstrumentId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsOrderId = Tagged<number, 'PerpsOrderId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsNotificationId = Tagged<string, 'PerpsNotificationId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFundingPaymentId = Tagged<number, 'PerpsFundingPaymentId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawalId = Tagged<number, 'PerpsWithdrawalId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInternalTransferId = Tagged<number, 'PerpsInternalTransferId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsEntityId = Tagged<number, 'PerpsEntityId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFundingInterval = `${number}h`;\n\nfunction taggedInteger<T extends number>(value: number): T {\n return value as T;\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInstrumentId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsOrderId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsClientOrderIdSchema = z\n .string()\n .regex(/^[0-9a-f]{32}$/)\n .transform((value) => value as PerpsClientOrderId);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationIdSchema = z\n .uuid()\n .transform((value) => value as PerpsNotificationId);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTradeIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsTradeId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFundingPaymentIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsFundingPaymentId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsWithdrawalId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInternalTransferIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInternalTransferId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsEntityIdSchema = z\n .number()\n .int()\n .positive()\n .transform(taggedInteger<PerpsEntityId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFundingIntervalSchema = z\n .string()\n .regex(/^[1-9]\\d*h$/)\n .transform((value) => value as PerpsFundingInterval);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDecimalInputSchema = DecimalishSchema;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDecimalInput = z.input<typeof PerpsDecimalInputSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsInstrumentType {\n Perpetual = 'perpetual',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsInstrumentCategory {\n Equity = 'equity',\n Commodity = 'commodity',\n Index = 'index',\n Crypto = 'crypto',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsSide {\n Long = 'long',\n Short = 'short',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTimeInForce {\n GTC = 'gtc',\n IOC = 'ioc',\n FOK = 'fok',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTpSlKind {\n TakeProfit = 'tp',\n StopLoss = 'sl',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTpSlScope {\n Order = 'order',\n Position = 'position',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsDepositStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n}\n\n/**\n * Known withdrawal statuses.\n *\n * The service evolves this set independently of released clients, so\n * withdrawal parsing accepts unknown statuses as plain strings; see\n * {@link PerpsWithdrawalStatus}.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsKnownWithdrawalStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n Failed = 'failed',\n}\n\n/**\n * A withdrawal status. Known statuses are enumerated in\n * {@link PerpsKnownWithdrawalStatus}; newly introduced statuses flow through\n * as plain strings so they can be handled before a client release that\n * enumerates them.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawalStatus = PerpsKnownWithdrawalStatus | (string & {});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsInternalTransferDirection {\n In = 'in',\n Out = 'out',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsPnlInterval {\n OneHour = '1h',\n FourHours = '4h',\n OneDay = '1d',\n OneWeek = '1w',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsSortDirection {\n Descending = 'desc',\n Ascending = 'asc',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentTypeSchema = z.enum(PerpsInstrumentType);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentCategorySchema = z.enum(PerpsInstrumentCategory);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsSideSchema = z.enum(PerpsSide);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTimeInForceSchema = z.enum(PerpsTimeInForce);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTpSlKindSchema = z.enum(PerpsTpSlKind);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTpSlScopeSchema = z.enum(PerpsTpSlScope);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDepositStatusSchema = z.enum(PerpsDepositStatus);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalStatusSchema = z\n .string()\n .transform((value): PerpsWithdrawalStatus => value);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInternalTransferDirectionSchema = z.enum(\n PerpsInternalTransferDirection,\n);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsKlineIntervalSchema = z.enum(PerpsKlineInterval);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPnlIntervalSchema = z.enum(PerpsPnlInterval);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsSortDirectionSchema = z.enum(PerpsSortDirection);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAssetSchema = z.string().min(1);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTxHashSchema = z.preprocess(\n (hash) => (hash === '0x' || hash === '' ? undefined : hash),\n TxHashSchema.optional(),\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDataResponseSchema = <T extends z.ZodType>(itemSchema: T) =>\n z.object({\n data: z.array(itemSchema),\n more: z.boolean(),\n });\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCredentials = {\n proxy: EvmAddress;\n privateKey: PrivateKey;\n secret: string;\n expiresAt: number;\n};\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDepositAmount = BaseUnits;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawalAmount = BaseUnits;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTxHash = TxHash;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDecimal = DecimalString;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport function perpsDecimal(value: string | number): DecimalString {\n return PerpsDecimalInputSchema.parse(value);\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport function perpsBaseUnits(value: string): BaseUnits {\n return BaseUnitsSchema.parse(value);\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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 PerpsEntityIdSchema,\n PerpsFundingPaymentIdSchema,\n PerpsInstrumentIdSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBalanceSchema = z.object({\n asset: PerpsAssetSchema,\n balance: DecimalStringSchema,\n value: DecimalStringSchema,\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBalance = z.infer<typeof PerpsBalanceSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsBalancesResponseSchema = z.array(PerpsBalanceSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountStatsSchema = z\n .object({\n volume_7d: DecimalStringSchema,\n taker_volume_7d: DecimalStringSchema,\n maker_volume_7d: DecimalStringSchema,\n account_maker_share_7d: DecimalStringSchema,\n entity_maker_share_7d: DecimalStringSchema.optional(),\n entity_id: PerpsEntityIdSchema.optional(),\n entity_name: z.string().min(1).optional(),\n })\n .transform((stats) => ({\n volume7d: stats.volume_7d,\n takerVolume7d: stats.taker_volume_7d,\n makerVolume7d: stats.maker_volume_7d,\n accountMakerShare7d: stats.account_maker_share_7d,\n entityMakerShare7d: stats.entity_maker_share_7d,\n entityId: stats.entity_id,\n entityName: stats.entity_name,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountStats = z.infer<typeof PerpsAccountStatsSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsAccountStatsResponseSchema = PerpsAccountStatsSchema;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPortfolioPositionSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPortfolioPosition = z.infer<\n typeof PerpsPortfolioPositionSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsMarginSummarySchema = z.object({\n totalAccountValue: DecimalStringSchema,\n totalInitialMargin: DecimalStringSchema,\n totalMaintenanceMargin: DecimalStringSchema,\n totalPositionValue: DecimalStringSchema,\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPortfolioSchema = z\n .object({\n positions: z.array(PerpsPortfolioPositionSchema),\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPortfolio = z.infer<typeof PerpsPortfolioSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsPortfolioResponseSchema = PerpsPortfolioSchema;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFundingPaymentSchema = z\n .object({\n id: PerpsFundingPaymentIdSchema,\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 id: funding.id,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountFundingPayment = z.infer<\n typeof PerpsAccountFundingPaymentSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsFundingPaymentsResponseSchema = PerpsDataResponseSchema(\n PerpsAccountFundingPaymentSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFundingPaymentEntrySchema = z\n .object({\n id: PerpsFundingPaymentIdSchema,\n iid: PerpsInstrumentIdSchema,\n sz: DecimalStringSchema,\n fr: DecimalStringSchema,\n fund: DecimalStringSchema,\n fua: PerpsAssetSchema,\n ts: EpochMillisecondsSchema,\n })\n .transform((funding) => ({\n id: funding.id,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountConfigSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountConfig = z.infer<typeof PerpsAccountConfigSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsAccountConfigResponseSchema = z.array(\n PerpsAccountConfigSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsEquityPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, equity]) => ({ timestamp, equity }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsEquityPoint = z.infer<typeof PerpsEquityPointSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsEquityHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsEquityPointSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPnlPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, pnl]) => ({ timestamp, pnl }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPnlPoint = z.infer<typeof PerpsPnlPointSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsProxyKeySchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsProxyKey = z.infer<typeof PerpsProxyKeySchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCredentialsResponseSchema = z\n .object({\n address: EvmAddressSchema,\n keys: z.array(PerpsProxyKeySchema),\n })\n .transform((credentials) => ({\n address: credentials.address,\n keys: credentials.keys,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCreateProxyResponseSchema = z.object({\n secret: z.string().min(1),\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDeleteProxyResponseSchema = 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 PerpsTxHashSchema,\n PerpsWithdrawalIdSchema,\n PerpsWithdrawalStatusSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDepositSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDeposit = z.infer<typeof PerpsDepositSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsDepositsResponseSchema =\n PerpsDataResponseSchema(PerpsDepositSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDepositUpdateSchema = z\n .object({\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalSchema = z\n .object({\n withdraw_id: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawal = z.infer<typeof PerpsWithdrawalSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsWithdrawalsResponseSchema = PerpsDataResponseSchema(\n PerpsWithdrawalSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawResponseSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalUpdateSchema = z\n .object({\n withdraw_id: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInternalTransfer = z.infer<typeof PerpsInternalTransferSchema>;\n","import { z } from 'zod';\nimport {\n type DecimalString,\n DecimalStringSchema,\n EpochMillisecondsSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsDataResponseSchema,\n PerpsFundingIntervalSchema,\n PerpsInstrumentCategorySchema,\n PerpsInstrumentIdSchema,\n PerpsInstrumentTypeSchema,\n PerpsSideSchema,\n PerpsTradeIdSchema,\n PerpsTxHashSchema,\n} from './common';\n\nexport {\n type PerpsFundingInterval,\n PerpsFundingIntervalSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsRiskTier = z.infer<typeof PerpsRiskTierSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentSchema = 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: PerpsFundingIntervalSchema,\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 isolated_only: z.boolean(),\n risk_tiers: z.array(RawPerpsRiskTierSchema),\n })\n .transform((instrument) => ({\n id: instrument.instrument_id,\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 isolatedOnly: instrument.isolated_only,\n riskTiers: instrument.risk_tiers,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInstrument = z.infer<typeof PerpsInstrumentSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsInstrumentsResponseSchema = z.array(\n PerpsInstrumentSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTickerSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTicker = z.infer<typeof PerpsTickerSchema> & {\n openPrice?: DecimalString;\n volume24h?: DecimalString;\n};\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsTickersResponseSchema = z.array(PerpsTickerSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTickerEntrySchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCandle = z.infer<typeof PerpsCandleSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsStatisticSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsStatistic = z.infer<typeof PerpsStatisticSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsStatisticsResponseSchema = z.array(PerpsStatisticSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsStatisticUpdateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBookLevelSchema = z\n .tuple([DecimalStringSchema, DecimalStringSchema])\n .transform(([price, quantity]) => ({ price, quantity }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBookLevel = z.infer<typeof PerpsBookLevelSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBookSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBook = z.infer<typeof PerpsBookSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBookUpdateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBbo = z.infer<typeof PerpsBboSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBboUpdateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPublicTradeSchema = 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: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPublicTrade = z.infer<typeof PerpsPublicTradeSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPublicTradeUpdateSchema = z\n .object({\n tid: PerpsTradeIdSchema,\n iid: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n p: DecimalStringSchema,\n qty: DecimalStringSchema,\n ts: EpochMillisecondsSchema,\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsTradesResponseSchema = PerpsDataResponseSchema(\n PerpsPublicTradeSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFundingRateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFundingRate = z.infer<typeof PerpsFundingRateSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsFundingHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsFundingRateSchema,\n);\n\nexport const PerpsFeeTierSchema = z\n .object({\n min_volume_30d: DecimalStringSchema,\n taker_fee_rate: DecimalStringSchema,\n maker_fee_rate: DecimalStringSchema,\n })\n .transform((tier) => ({\n minVolume30d: tier.min_volume_30d,\n takerFeeRate: tier.taker_fee_rate,\n makerFeeRate: tier.maker_fee_rate,\n }));\n\nexport type PerpsFeeTier = z.infer<typeof PerpsFeeTierSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFeeScheduleEntrySchema = z\n .object({\n instrument_type: PerpsInstrumentTypeSchema,\n category: PerpsInstrumentCategorySchema,\n taker_fee_rate: DecimalStringSchema,\n maker_fee_rate: DecimalStringSchema,\n tiers: z.array(PerpsFeeTierSchema),\n })\n .transform((fee) => ({\n category: fee.category,\n takerFeeRate: fee.taker_fee_rate,\n makerFeeRate: fee.maker_fee_rate,\n tiers: fee.tiers,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFeeScheduleEntry = z.infer<typeof PerpsFeeScheduleEntrySchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFeesInfoSchema = z\n .object({\n fee_schedule: z.array(PerpsFeeScheduleEntrySchema),\n })\n .transform((fees) => ({\n feeSchedule: fees.fee_schedule,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFeesInfo = z.infer<typeof PerpsFeesInfoSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsFeesResponseSchema = PerpsFeesInfoSchema;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsCandlesResponseSchema =\n PerpsDataResponseSchema(PerpsCandleSchema);\n","import { z } from 'zod';\nimport { DecimalStringSchema, EpochMillisecondsSchema } from '../shared';\nimport {\n PerpsInstrumentIdSchema,\n PerpsNotificationIdSchema,\n PerpsSideSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsNotificationType {\n PositionOpened = 'position_opened',\n PositionIncreased = 'position_increased',\n PositionReduced = 'position_reduced',\n PositionClosed = 'position_closed',\n LimitOrderCanceled = 'limit_order_canceled',\n LiquidationWarning = 'liquidation_warning',\n PositionLiquidated = 'position_liquidated',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationTypeSchema = z.enum(PerpsNotificationType);\n\n/**\n * Kind of order whose execution produced a fill-driven position notification.\n * A TP/SL-triggered order reports the trigger that fired it whether it\n * aggressed or rested; otherwise an aggressor submitted without a limit price\n * is `market` and everything else, including a maker's resting order, is\n * `limit`.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsNotificationOrderType {\n Market = 'market',\n Limit = 'limit',\n TakeProfit = 'take_profit',\n StopLoss = 'stop_loss',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationOrderTypeSchema = z.enum(\n PerpsNotificationOrderType,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsMarginType {\n Cross = 'cross',\n Isolated = 'isolated',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsMarginTypeSchema = z.enum(PerpsMarginType);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPositionChangeNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.enum([\n PerpsNotificationType.PositionOpened,\n PerpsNotificationType.PositionIncreased,\n PerpsNotificationType.PositionReduced,\n ]),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size: DecimalStringSchema,\n avg_price: DecimalStringSchema,\n leverage: z.number().int().positive(),\n order_type: PerpsNotificationOrderTypeSchema.optional(),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n size: notification.size,\n avgPrice: notification.avg_price,\n leverage: notification.leverage,\n orderType: notification.order_type,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPositionChangeNotification = z.infer<\n typeof PerpsPositionChangeNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPositionClosedNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.PositionClosed),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size: DecimalStringSchema,\n avg_price: DecimalStringSchema,\n pnl: DecimalStringSchema,\n order_type: PerpsNotificationOrderTypeSchema.optional(),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n size: notification.size,\n avgPrice: notification.avg_price,\n pnl: notification.pnl,\n orderType: notification.order_type,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPositionClosedNotification = z.infer<\n typeof PerpsPositionClosedNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsLimitOrderCanceledNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.LimitOrderCanceled),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size: DecimalStringSchema,\n price: DecimalStringSchema,\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n size: notification.size,\n price: notification.price,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsLimitOrderCanceledNotification = z.infer<\n typeof PerpsLimitOrderCanceledNotificationSchema\n>;\n\nconst PerpsIsolatedLiquidationWarningNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.LiquidationWarning),\n margin_type: z.literal(PerpsMarginType.Isolated),\n instrument_id: PerpsInstrumentIdSchema,\n mark_price: DecimalStringSchema,\n liq_price: DecimalStringSchema,\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n marginType: notification.margin_type,\n instrumentId: notification.instrument_id,\n markPrice: notification.mark_price,\n liquidationPrice: notification.liq_price,\n }));\n\nconst PerpsCrossLiquidationWarningNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.LiquidationWarning),\n margin_type: z.literal(PerpsMarginType.Cross),\n instrument_id: z.null(),\n mark_price: DecimalStringSchema,\n affected_instruments: z.array(PerpsInstrumentIdSchema),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n marginType: notification.margin_type,\n markPrice: notification.mark_price,\n affectedInstruments: notification.affected_instruments,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsLiquidationWarningNotificationSchema = z.discriminatedUnion(\n 'margin_type',\n [\n PerpsIsolatedLiquidationWarningNotificationSchema,\n PerpsCrossLiquidationWarningNotificationSchema,\n ],\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsLiquidationWarningNotification = z.infer<\n typeof PerpsLiquidationWarningNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPositionLiquidatedNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.PositionLiquidated),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size_closed: DecimalStringSchema,\n pnl: DecimalStringSchema.nullable(),\n margin_type: PerpsMarginTypeSchema,\n via_backstop: z.boolean(),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n sizeClosed: notification.size_closed,\n pnl: notification.pnl,\n marginType: notification.margin_type,\n viaBackstop: notification.via_backstop,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPositionLiquidatedNotification = z.infer<\n typeof PerpsPositionLiquidatedNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationSchema = z.discriminatedUnion('type', [\n PerpsPositionChangeNotificationSchema,\n PerpsPositionClosedNotificationSchema,\n PerpsLimitOrderCanceledNotificationSchema,\n PerpsLiquidationWarningNotificationSchema,\n PerpsPositionLiquidatedNotificationSchema,\n]);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsNotification = z.infer<typeof PerpsNotificationSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationEntrySchema = z\n .object({\n notification: PerpsNotificationSchema,\n read_at: EpochMillisecondsSchema.nullable(),\n ts: EpochMillisecondsSchema,\n })\n .transform((entry) => ({\n notification: entry.notification,\n readAt: entry.read_at,\n timestamp: entry.ts,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsNotificationEntry = z.infer<\n typeof PerpsNotificationEntrySchema\n>;\n\n// Probes only the discriminator so list entries carrying notification types\n// unknown to this SDK version can be skipped without failing the page read.\nconst PerpsNotificationEntryTypeProbeSchema = z.object({\n notification: z.object({ type: PerpsNotificationTypeSchema }),\n});\n\nconst PerpsNotificationEntriesSchema = z\n .array(z.unknown())\n .transform((items, ctx) => {\n const entries: PerpsNotificationEntry[] = [];\n items.forEach((item, index) => {\n if (!PerpsNotificationEntryTypeProbeSchema.safeParse(item).success) {\n return;\n }\n const entry = PerpsNotificationEntrySchema.safeParse(item);\n if (entry.success) {\n entries.push(entry.data);\n return;\n }\n for (const issue of entry.error.issues) {\n ctx.addIssue({ ...issue, path: [index, ...issue.path] });\n }\n });\n return entries;\n });\n\n/**\n * Entries with notification types unknown to this SDK version are omitted\n * from `items` so newly introduced notification kinds cannot fail the read;\n * recognized types still validate strictly.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsNotificationsResponseSchema = z.object({\n items: PerpsNotificationEntriesSchema,\n unread: z.number().int().nonnegative(),\n durable_source_seq: z.number().int().nonnegative(),\n has_more: z.boolean(),\n next_cursor: z.string().nullable(),\n});\n\n/**\n * Projection of the notifications list response for unread-count reads.\n * Deliberately leaves `items` unvalidated so notification shapes unknown to\n * this SDK version cannot fail a read that only needs the counter.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsUnreadNotificationsCountResponseSchema = z.object({\n unread: z.number().int().nonnegative(),\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const MarkPerpsNotificationsReadResponseSchema = z.object({\n status: z.enum(['ok', 'err']),\n error: z.string().optional(),\n});\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n OrderSide,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsClientOrderIdSchema,\n PerpsDataResponseSchema,\n PerpsInstrumentIdSchema,\n PerpsOrderIdSchema,\n PerpsSideSchema,\n PerpsTimeInForceSchema,\n PerpsTpSlKindSchema,\n PerpsTpSlScopeSchema,\n PerpsTradeIdSchema,\n PerpsTxHashSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsOrderStatus {\n Accepted = 'accepted',\n Open = 'open',\n Partial = 'partial',\n Filled = 'filled',\n Cancelled = 'cancelled',\n AutoCancelled = 'auto_cancelled',\n PostOnlyRejected = 'post_only_rejected',\n FokUnfilled = 'fok_unfilled',\n IocNoFill = 'ioc_no_fill',\n IocExpired = 'ioc_expired',\n StpCancelled = 'stp_cancelled',\n ZeroQuantity = 'zero_quantity',\n DuplicateOrder = 'duplicate_order',\n OrderNotFound = 'order_not_found',\n ReduceOnlyInvalid = 'reduce_only_invalid',\n ReduceOnlyExpired = 'reduce_only_expired',\n OrderExpired = 'order_expired',\n Untriggered = 'untriggered',\n Armed = 'armed',\n Triggered = 'triggered',\n ParentCancelled = 'parent_cancelled',\n PositionClosed = 'position_closed',\n PositionFlipped = 'position_flipped',\n ReduceOnlyInvalidAtTrigger = 'reduce_only_invalid_at_trigger',\n Expired = 'expired',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTpSlOrderFieldsSchema = z\n .object({\n kind: PerpsTpSlKindSchema,\n scope: PerpsTpSlScopeSchema,\n trp: DecimalStringSchema,\n parent_oid: PerpsOrderIdSchema.optional(),\n armed_qty: DecimalStringSchema.optional(),\n slip_bps: z.number().int().nonnegative().optional(),\n })\n .transform((fields) => ({\n kind: fields.kind,\n scope: fields.scope,\n triggerPrice: fields.trp,\n parentOrderId: fields.parent_oid,\n armedQuantity: fields.armed_qty,\n slippageBps: fields.slip_bps,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTpSlOrderFields = z.infer<typeof PerpsTpSlOrderFieldsSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderStatusSchema = z.enum(PerpsOrderStatus);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCommandStatusSchema = z.enum(['ok', 'err']);\n\nconst PerpsAckErrorSchema = z\n .string()\n .min(1)\n .optional()\n .transform(perpsAckError);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCommandAckSchema = z.discriminatedUnion('status', [\n z.object({ status: z.literal('ok') }),\n z.object({\n status: z.literal('err'),\n error: PerpsAckErrorSchema,\n }),\n]);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCommandAck = z.infer<typeof PerpsCommandAckSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPostOrderAckSchema = z\n .object({\n status: PerpsCommandStatusSchema,\n oid: PerpsOrderIdSchema.optional(),\n coid: PerpsClientOrderIdSchema.optional(),\n error: z.string().optional(),\n })\n .transform((ack, ctx) => {\n if (ack.status === 'err') {\n return {\n status: 'err' as const,\n error: perpsAckError(ack.error),\n clientOrderId: ack.coid,\n };\n }\n\n if (ack.oid === undefined) {\n ctx.addIssue({\n code: 'custom',\n message: 'Expected Perps place order acknowledgement order id.',\n });\n return z.NEVER;\n }\n\n return {\n status: 'ok' as const,\n orderId: ack.oid,\n clientOrderId: ack.coid,\n };\n });\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCancelOrderResultSchema = z\n .object({\n status: PerpsCommandStatusSchema,\n oid: PerpsOrderIdSchema.optional(),\n coid: PerpsClientOrderIdSchema.optional(),\n error: z.string().optional(),\n })\n .transform((ack) => {\n if (ack.status === 'err') {\n return {\n status: 'err' as const,\n error: perpsAckError(ack.error),\n orderId: ack.oid,\n clientOrderId: ack.coid,\n };\n }\n\n return {\n status: 'ok' as const,\n orderId: ack.oid,\n clientOrderId: ack.coid,\n };\n });\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCancelOrderResult = z.infer<\n typeof PerpsCancelOrderResultSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCancelAllOrdersResponseSchema = z.object({\n status: z.literal('ok'),\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCancelAllOrdersResponse = z.infer<\n typeof PerpsCancelAllOrdersResponseSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsUpdateLeverageResultSchema = z\n .object({\n status: z.literal('ok'),\n instrument_id: PerpsInstrumentIdSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n })\n .transform((result) => ({\n status: result.status,\n instrumentId: result.instrument_id,\n leverage: result.leverage,\n crossMargin: result.cross,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsUpdateLeverageResult = z.infer<\n typeof PerpsUpdateLeverageResultSchema\n>;\n\nfunction perpsAckError(error: string | undefined): string {\n return error ?? 'Perps command was rejected.';\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderSchema = 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 ro: z.boolean(),\n status: PerpsOrderStatusSchema,\n resting_quantity: DecimalStringSchema,\n filled_quantity: DecimalStringSchema,\n created_timestamp: EpochMillisecondsSchema,\n updated_timestamp: EpochMillisecondsSchema,\n client_order_id: z.string().optional(),\n tpsl: PerpsTpSlOrderFieldsSchema.nullish(),\n })\n .transform((order) => ({\n id: order.order_id,\n instrumentId: order.instrument_id,\n side: order.buy ? OrderSide.BUY : OrderSide.SELL,\n price: order.price,\n quantity: order.quantity,\n timeInForce: order.tif,\n postOnly: order.post_only,\n reduceOnly: order.ro,\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 tpSl: order.tpsl ?? undefined,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsOrder = z.infer<typeof PerpsOrderSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsOrdersResponseSchema = z.array(PerpsOrderSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsOpenOrdersResponseSchema = z.array(PerpsOrderSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderUpdateSchema = 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 ro: z.boolean(),\n status: PerpsOrderStatusSchema,\n rest: DecimalStringSchema,\n fill: DecimalStringSchema,\n cts: EpochMillisecondsSchema,\n uts: EpochMillisecondsSchema,\n coid: z.string().optional(),\n tpsl: PerpsTpSlOrderFieldsSchema.nullish(),\n })\n .transform((order) => ({\n id: order.oid,\n instrumentId: order.iid,\n side: order.buy ? OrderSide.BUY : OrderSide.SELL,\n price: order.p,\n quantity: order.qty,\n timeInForce: order.tif,\n postOnly: order.po,\n reduceOnly: order.ro,\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 tpSl: order.tpsl ?? undefined,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFillSchema = 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: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountFill = z.infer<typeof PerpsAccountFillSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsFillsResponseSchema = PerpsDataResponseSchema(\n PerpsAccountFillSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFillUpdateSchema = 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"]}
@@ -26,6 +26,10 @@ type PerpsNotificationId = Tagged<string, 'PerpsNotificationId'>;
26
26
  * @experimental This API may change in a breaking way in any release, including patch releases.
27
27
  */
28
28
  type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;
29
+ /**
30
+ * @experimental This API may change in a breaking way in any release, including patch releases.
31
+ */
32
+ type PerpsFundingPaymentId = Tagged<number, 'PerpsFundingPaymentId'>;
29
33
  /**
30
34
  * @experimental This API may change in a breaking way in any release, including patch releases.
31
35
  */
@@ -62,6 +66,10 @@ declare const PerpsNotificationIdSchema: z.ZodPipe<z.ZodUUID, z.ZodTransform<Per
62
66
  * @experimental This API may change in a breaking way in any release, including patch releases.
63
67
  */
64
68
  declare const PerpsTradeIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
69
+ /**
70
+ * @experimental This API may change in a breaking way in any release, including patch releases.
71
+ */
72
+ declare const PerpsFundingPaymentIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsFundingPaymentId, number>>;
65
73
  /**
66
74
  * @experimental This API may change in a breaking way in any release, including patch releases.
67
75
  */
@@ -1728,4 +1736,4 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1728
1736
  coid?: string | undefined;
1729
1737
  }>>;
1730
1738
 
1731
- export { type PerpsNotification as $, type PerpsCredentials as A, PerpsDataResponseSchema as B, type PerpsDecimal as C, type PerpsDecimalInput as D, PerpsDecimalInputSchema as E, FetchPerpsOpenOrdersResponseSchema as F, type PerpsDepositAmount as G, PerpsDepositStatusSchema as H, PerpsEntityIdSchema as I, type PerpsFundingInterval as J, PerpsFundingIntervalSchema as K, ListPerpsFillsResponseSchema as L, MarkPerpsNotificationsReadResponseSchema as M, PerpsInstrumentCategorySchema as N, PerpsInstrumentIdSchema as O, type PerpsInstrumentId as P, PerpsInstrumentTypeSchema as Q, PerpsInternalTransferDirectionSchema as R, PerpsInternalTransferIdSchema as S, PerpsKlineInterval as T, PerpsKlineIntervalSchema as U, type PerpsLimitOrderCanceledNotification as V, PerpsLimitOrderCanceledNotificationSchema as W, type PerpsLiquidationWarningNotification as X, PerpsLiquidationWarningNotificationSchema as Y, PerpsMarginType as Z, PerpsMarginTypeSchema as _, type PerpsEntityId as a, type PerpsNotificationEntry as a0, PerpsNotificationEntrySchema as a1, type PerpsNotificationId as a2, PerpsNotificationIdSchema as a3, PerpsNotificationOrderType as a4, PerpsNotificationOrderTypeSchema as a5, PerpsNotificationSchema as a6, PerpsNotificationType as a7, PerpsNotificationTypeSchema as a8, type PerpsOrder as a9, PerpsTpSlScopeSchema as aA, PerpsTradeIdSchema as aB, type PerpsTxHash as aC, PerpsTxHashSchema as aD, type PerpsUpdateLeverageResult as aE, PerpsUpdateLeverageResultSchema as aF, type PerpsWithdrawalAmount as aG, PerpsWithdrawalIdSchema as aH, type PerpsWithdrawalStatus as aI, PerpsWithdrawalStatusSchema as aJ, decimalString as aK, perpsBaseUnits as aL, perpsDecimal as aM, type PerpsOrderId as aa, PerpsOrderIdSchema as ab, PerpsOrderSchema as ac, PerpsOrderStatus as ad, PerpsOrderStatusSchema as ae, PerpsOrderUpdateSchema as af, PerpsPnlInterval as ag, PerpsPnlIntervalSchema as ah, type PerpsPositionChangeNotification as ai, PerpsPositionChangeNotificationSchema as aj, type PerpsPositionClosedNotification as ak, PerpsPositionClosedNotificationSchema as al, type PerpsPositionLiquidatedNotification as am, PerpsPositionLiquidatedNotificationSchema as an, type PerpsPostOrderAck as ao, PerpsPostOrderAckSchema as ap, PerpsSideSchema as aq, PerpsSortDirection as ar, PerpsSortDirectionSchema as as, PerpsTimeInForce as at, PerpsTimeInForceSchema as au, PerpsTpSlKind as av, PerpsTpSlKindSchema as aw, type PerpsTpSlOrderFields as ax, PerpsTpSlOrderFieldsSchema as ay, PerpsTpSlScope as az, PerpsDepositStatus as b, type PerpsWithdrawalId as c, PerpsKnownWithdrawalStatus as d, type PerpsInternalTransferId as e, PerpsInternalTransferDirection as f, PerpsInstrumentType as g, PerpsInstrumentCategory as h, type PerpsTradeId as i, PerpsSide as j, FetchPerpsOrdersResponseSchema as k, FetchPerpsUnreadNotificationsCountResponseSchema as l, ListPerpsNotificationsResponseSchema as m, type PerpsAccountFill as n, PerpsAccountFillSchema as o, PerpsAccountFillUpdateSchema as p, PerpsAssetSchema as q, type PerpsCancelAllOrdersResponse as r, PerpsCancelAllOrdersResponseSchema as s, type PerpsCancelOrderResult as t, PerpsCancelOrderResultSchema as u, type PerpsClientOrderId as v, PerpsClientOrderIdSchema as w, type PerpsCommandAck as x, PerpsCommandAckSchema as y, PerpsCommandStatusSchema as z };
1739
+ export { PerpsMarginType as $, PerpsCommandStatusSchema as A, type PerpsCredentials as B, PerpsDataResponseSchema as C, type PerpsDecimal as D, type PerpsDecimalInput as E, FetchPerpsOpenOrdersResponseSchema as F, PerpsDecimalInputSchema as G, type PerpsDepositAmount as H, PerpsDepositStatusSchema as I, PerpsEntityIdSchema as J, type PerpsFundingInterval as K, ListPerpsFillsResponseSchema as L, MarkPerpsNotificationsReadResponseSchema as M, PerpsFundingIntervalSchema as N, PerpsFundingPaymentIdSchema as O, type PerpsInstrumentId as P, PerpsInstrumentCategorySchema as Q, PerpsInstrumentIdSchema as R, PerpsInstrumentTypeSchema as S, PerpsInternalTransferDirectionSchema as T, PerpsInternalTransferIdSchema as U, PerpsKlineInterval as V, PerpsKlineIntervalSchema as W, type PerpsLimitOrderCanceledNotification as X, PerpsLimitOrderCanceledNotificationSchema as Y, type PerpsLiquidationWarningNotification as Z, PerpsLiquidationWarningNotificationSchema as _, type PerpsEntityId as a, PerpsMarginTypeSchema as a0, type PerpsNotification as a1, type PerpsNotificationEntry as a2, PerpsNotificationEntrySchema as a3, type PerpsNotificationId as a4, PerpsNotificationIdSchema as a5, PerpsNotificationOrderType as a6, PerpsNotificationOrderTypeSchema as a7, PerpsNotificationSchema as a8, PerpsNotificationType as a9, PerpsTpSlOrderFieldsSchema as aA, PerpsTpSlScope as aB, PerpsTpSlScopeSchema as aC, PerpsTradeIdSchema as aD, type PerpsTxHash as aE, PerpsTxHashSchema as aF, type PerpsUpdateLeverageResult as aG, PerpsUpdateLeverageResultSchema as aH, type PerpsWithdrawalAmount as aI, PerpsWithdrawalIdSchema as aJ, type PerpsWithdrawalStatus as aK, PerpsWithdrawalStatusSchema as aL, decimalString as aM, perpsBaseUnits as aN, perpsDecimal as aO, PerpsNotificationTypeSchema as aa, type PerpsOrder as ab, type PerpsOrderId as ac, PerpsOrderIdSchema as ad, PerpsOrderSchema as ae, PerpsOrderStatus as af, PerpsOrderStatusSchema as ag, PerpsOrderUpdateSchema as ah, PerpsPnlInterval as ai, PerpsPnlIntervalSchema as aj, type PerpsPositionChangeNotification as ak, PerpsPositionChangeNotificationSchema as al, type PerpsPositionClosedNotification as am, PerpsPositionClosedNotificationSchema as an, type PerpsPositionLiquidatedNotification as ao, PerpsPositionLiquidatedNotificationSchema as ap, type PerpsPostOrderAck as aq, PerpsPostOrderAckSchema as ar, PerpsSideSchema as as, PerpsSortDirection as at, PerpsSortDirectionSchema as au, PerpsTimeInForce as av, PerpsTimeInForceSchema as aw, PerpsTpSlKind as ax, PerpsTpSlKindSchema as ay, type PerpsTpSlOrderFields as az, type PerpsFundingPaymentId as b, PerpsDepositStatus as c, type PerpsWithdrawalId as d, PerpsKnownWithdrawalStatus as e, type PerpsInternalTransferId as f, PerpsInternalTransferDirection as g, PerpsInstrumentType as h, PerpsInstrumentCategory as i, type PerpsTradeId as j, PerpsSide as k, FetchPerpsOrdersResponseSchema as l, FetchPerpsUnreadNotificationsCountResponseSchema as m, ListPerpsNotificationsResponseSchema as n, type PerpsAccountFill as o, PerpsAccountFillSchema as p, PerpsAccountFillUpdateSchema as q, PerpsAssetSchema as r, type PerpsCancelAllOrdersResponse as s, PerpsCancelAllOrdersResponseSchema as t, type PerpsCancelOrderResult as u, PerpsCancelOrderResultSchema as v, type PerpsClientOrderId as w, PerpsClientOrderIdSchema as x, type PerpsCommandAck as y, PerpsCommandAckSchema as z };
@@ -1,6 +1,6 @@
1
1
  import * as _polymarket_types from '@polymarket/types';
2
- import { P as PerpsInstrumentId, a as PerpsEntityId, b as PerpsDepositStatus, c as PerpsWithdrawalId, d as PerpsKnownWithdrawalStatus, e as PerpsInternalTransferId, f as PerpsInternalTransferDirection, g as PerpsInstrumentType, h as PerpsInstrumentCategory, i as PerpsTradeId, j as PerpsSide } from '../orders-CTqTKxTR.js';
3
- export { F as FetchPerpsOpenOrdersResponseSchema, k as FetchPerpsOrdersResponseSchema, l as FetchPerpsUnreadNotificationsCountResponseSchema, L as ListPerpsFillsResponseSchema, m as ListPerpsNotificationsResponseSchema, M as MarkPerpsNotificationsReadResponseSchema, n as PerpsAccountFill, o as PerpsAccountFillSchema, p as PerpsAccountFillUpdateSchema, q as PerpsAssetSchema, r as PerpsCancelAllOrdersResponse, s as PerpsCancelAllOrdersResponseSchema, t as PerpsCancelOrderResult, u as PerpsCancelOrderResultSchema, v as PerpsClientOrderId, w as PerpsClientOrderIdSchema, x as PerpsCommandAck, y as PerpsCommandAckSchema, z as PerpsCommandStatusSchema, A as PerpsCredentials, B as PerpsDataResponseSchema, C as PerpsDecimal, D as PerpsDecimalInput, E as PerpsDecimalInputSchema, G as PerpsDepositAmount, H as PerpsDepositStatusSchema, I as PerpsEntityIdSchema, J as PerpsFundingInterval, K as PerpsFundingIntervalSchema, N as PerpsInstrumentCategorySchema, O as PerpsInstrumentIdSchema, Q as PerpsInstrumentTypeSchema, R as PerpsInternalTransferDirectionSchema, S as PerpsInternalTransferIdSchema, T as PerpsKlineInterval, U as PerpsKlineIntervalSchema, V as PerpsLimitOrderCanceledNotification, W as PerpsLimitOrderCanceledNotificationSchema, X as PerpsLiquidationWarningNotification, Y as PerpsLiquidationWarningNotificationSchema, Z as PerpsMarginType, _ as PerpsMarginTypeSchema, $ as PerpsNotification, a0 as PerpsNotificationEntry, a1 as PerpsNotificationEntrySchema, a2 as PerpsNotificationId, a3 as PerpsNotificationIdSchema, a4 as PerpsNotificationOrderType, a5 as PerpsNotificationOrderTypeSchema, a6 as PerpsNotificationSchema, a7 as PerpsNotificationType, a8 as PerpsNotificationTypeSchema, a9 as PerpsOrder, aa as PerpsOrderId, ab as PerpsOrderIdSchema, ac as PerpsOrderSchema, ad as PerpsOrderStatus, ae as PerpsOrderStatusSchema, af as PerpsOrderUpdateSchema, ag as PerpsPnlInterval, ah as PerpsPnlIntervalSchema, ai as PerpsPositionChangeNotification, aj as PerpsPositionChangeNotificationSchema, ak as PerpsPositionClosedNotification, al as PerpsPositionClosedNotificationSchema, am as PerpsPositionLiquidatedNotification, an as PerpsPositionLiquidatedNotificationSchema, ao as PerpsPostOrderAck, ap as PerpsPostOrderAckSchema, aq as PerpsSideSchema, ar as PerpsSortDirection, as as PerpsSortDirectionSchema, at as PerpsTimeInForce, au as PerpsTimeInForceSchema, av as PerpsTpSlKind, aw as PerpsTpSlKindSchema, ax as PerpsTpSlOrderFields, ay as PerpsTpSlOrderFieldsSchema, az as PerpsTpSlScope, aA as PerpsTpSlScopeSchema, aB as PerpsTradeIdSchema, aC as PerpsTxHash, aD as PerpsTxHashSchema, aE as PerpsUpdateLeverageResult, aF as PerpsUpdateLeverageResultSchema, aG as PerpsWithdrawalAmount, aH as PerpsWithdrawalIdSchema, aI as PerpsWithdrawalStatus, aJ as PerpsWithdrawalStatusSchema, aK as decimalString, aL as perpsBaseUnits, aM as perpsDecimal } from '../orders-CTqTKxTR.js';
2
+ import { P as PerpsInstrumentId, a as PerpsEntityId, b as PerpsFundingPaymentId, c as PerpsDepositStatus, d as PerpsWithdrawalId, e as PerpsKnownWithdrawalStatus, f as PerpsInternalTransferId, g as PerpsInternalTransferDirection, h as PerpsInstrumentType, i as PerpsInstrumentCategory, j as PerpsTradeId, k as PerpsSide } from '../orders-BDfNkzav.js';
3
+ export { F as FetchPerpsOpenOrdersResponseSchema, l as FetchPerpsOrdersResponseSchema, m as FetchPerpsUnreadNotificationsCountResponseSchema, L as ListPerpsFillsResponseSchema, n as ListPerpsNotificationsResponseSchema, M as MarkPerpsNotificationsReadResponseSchema, o as PerpsAccountFill, p as PerpsAccountFillSchema, q as PerpsAccountFillUpdateSchema, r as PerpsAssetSchema, s as PerpsCancelAllOrdersResponse, t as PerpsCancelAllOrdersResponseSchema, u as PerpsCancelOrderResult, v as PerpsCancelOrderResultSchema, w as PerpsClientOrderId, x as PerpsClientOrderIdSchema, y as PerpsCommandAck, z as PerpsCommandAckSchema, A as PerpsCommandStatusSchema, B as PerpsCredentials, C as PerpsDataResponseSchema, D as PerpsDecimal, E as PerpsDecimalInput, G as PerpsDecimalInputSchema, H as PerpsDepositAmount, I as PerpsDepositStatusSchema, J as PerpsEntityIdSchema, K as PerpsFundingInterval, N as PerpsFundingIntervalSchema, O as PerpsFundingPaymentIdSchema, Q as PerpsInstrumentCategorySchema, R as PerpsInstrumentIdSchema, S as PerpsInstrumentTypeSchema, T as PerpsInternalTransferDirectionSchema, U as PerpsInternalTransferIdSchema, V as PerpsKlineInterval, W as PerpsKlineIntervalSchema, X as PerpsLimitOrderCanceledNotification, Y as PerpsLimitOrderCanceledNotificationSchema, Z as PerpsLiquidationWarningNotification, _ as PerpsLiquidationWarningNotificationSchema, $ as PerpsMarginType, a0 as PerpsMarginTypeSchema, a1 as PerpsNotification, a2 as PerpsNotificationEntry, a3 as PerpsNotificationEntrySchema, a4 as PerpsNotificationId, a5 as PerpsNotificationIdSchema, a6 as PerpsNotificationOrderType, a7 as PerpsNotificationOrderTypeSchema, a8 as PerpsNotificationSchema, a9 as PerpsNotificationType, aa as PerpsNotificationTypeSchema, ab as PerpsOrder, ac as PerpsOrderId, ad as PerpsOrderIdSchema, ae as PerpsOrderSchema, af as PerpsOrderStatus, ag as PerpsOrderStatusSchema, ah as PerpsOrderUpdateSchema, ai as PerpsPnlInterval, aj as PerpsPnlIntervalSchema, ak as PerpsPositionChangeNotification, al as PerpsPositionChangeNotificationSchema, am as PerpsPositionClosedNotification, an as PerpsPositionClosedNotificationSchema, ao as PerpsPositionLiquidatedNotification, ap as PerpsPositionLiquidatedNotificationSchema, aq as PerpsPostOrderAck, ar as PerpsPostOrderAckSchema, as as PerpsSideSchema, at as PerpsSortDirection, au as PerpsSortDirectionSchema, av as PerpsTimeInForce, aw as PerpsTimeInForceSchema, ax as PerpsTpSlKind, ay as PerpsTpSlKindSchema, az as PerpsTpSlOrderFields, aA as PerpsTpSlOrderFieldsSchema, aB as PerpsTpSlScope, aC as PerpsTpSlScopeSchema, aD as PerpsTradeIdSchema, aE as PerpsTxHash, aF as PerpsTxHashSchema, aG as PerpsUpdateLeverageResult, aH as PerpsUpdateLeverageResultSchema, aI as PerpsWithdrawalAmount, aJ as PerpsWithdrawalIdSchema, aK as PerpsWithdrawalStatus, aL as PerpsWithdrawalStatusSchema, aM as decimalString, aN as perpsBaseUnits, aO as perpsDecimal } from '../orders-BDfNkzav.js';
4
4
  import { DecimalString, EpochMilliseconds, BaseUnits } from '../index.js';
5
5
  import { z } from 'zod';
6
6
 
@@ -389,6 +389,7 @@ declare const FetchPerpsPortfolioResponseSchema: z.ZodPipe<z.ZodObject<{
389
389
  * @experimental This API may change in a breaking way in any release, including patch releases.
390
390
  */
391
391
  declare const PerpsAccountFundingPaymentSchema: z.ZodPipe<z.ZodObject<{
392
+ id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsFundingPaymentId, number>>;
392
393
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
393
394
  size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
394
395
  funding_rate: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -396,6 +397,7 @@ declare const PerpsAccountFundingPaymentSchema: z.ZodPipe<z.ZodObject<{
396
397
  funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
397
398
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
398
399
  }, z.core.$strip>, z.ZodTransform<{
400
+ id: PerpsFundingPaymentId;
399
401
  instrumentId: PerpsInstrumentId;
400
402
  size: DecimalString;
401
403
  fundingRate: DecimalString;
@@ -403,6 +405,7 @@ declare const PerpsAccountFundingPaymentSchema: z.ZodPipe<z.ZodObject<{
403
405
  funding: DecimalString;
404
406
  timestamp: EpochMilliseconds;
405
407
  }, {
408
+ id: PerpsFundingPaymentId;
406
409
  instrument_id: PerpsInstrumentId;
407
410
  size: DecimalString;
408
411
  funding_rate: DecimalString;
@@ -419,6 +422,7 @@ type PerpsAccountFundingPayment = z.infer<typeof PerpsAccountFundingPaymentSchem
419
422
  */
420
423
  declare const ListPerpsFundingPaymentsResponseSchema: z.ZodObject<{
421
424
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
425
+ id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsFundingPaymentId, number>>;
422
426
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
423
427
  size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
424
428
  funding_rate: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -426,6 +430,7 @@ declare const ListPerpsFundingPaymentsResponseSchema: z.ZodObject<{
426
430
  funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
427
431
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
428
432
  }, z.core.$strip>, z.ZodTransform<{
433
+ id: PerpsFundingPaymentId;
429
434
  instrumentId: PerpsInstrumentId;
430
435
  size: DecimalString;
431
436
  fundingRate: DecimalString;
@@ -433,6 +438,7 @@ declare const ListPerpsFundingPaymentsResponseSchema: z.ZodObject<{
433
438
  funding: DecimalString;
434
439
  timestamp: EpochMilliseconds;
435
440
  }, {
441
+ id: PerpsFundingPaymentId;
436
442
  instrument_id: PerpsInstrumentId;
437
443
  size: DecimalString;
438
444
  funding_rate: DecimalString;
@@ -446,6 +452,7 @@ declare const ListPerpsFundingPaymentsResponseSchema: z.ZodObject<{
446
452
  * @experimental This API may change in a breaking way in any release, including patch releases.
447
453
  */
448
454
  declare const PerpsAccountFundingPaymentEntrySchema: z.ZodPipe<z.ZodObject<{
455
+ id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsFundingPaymentId, number>>;
449
456
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
450
457
  sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
451
458
  fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -453,6 +460,7 @@ declare const PerpsAccountFundingPaymentEntrySchema: z.ZodPipe<z.ZodObject<{
453
460
  fua: z.ZodString;
454
461
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
455
462
  }, z.core.$strip>, z.ZodTransform<{
463
+ id: PerpsFundingPaymentId;
456
464
  instrumentId: PerpsInstrumentId;
457
465
  size: DecimalString;
458
466
  fundingRate: DecimalString;
@@ -460,6 +468,7 @@ declare const PerpsAccountFundingPaymentEntrySchema: z.ZodPipe<z.ZodObject<{
460
468
  funding: DecimalString;
461
469
  timestamp: EpochMilliseconds;
462
470
  }, {
471
+ id: PerpsFundingPaymentId;
463
472
  iid: PerpsInstrumentId;
464
473
  sz: DecimalString;
465
474
  fr: DecimalString;
@@ -615,6 +624,67 @@ declare const PerpsDeleteProxyResponseSchema: z.ZodObject<{
615
624
  error: z.ZodOptional<z.ZodString>;
616
625
  }, z.core.$strip>;
617
626
 
627
+ /**
628
+ * Acknowledgement for a Perps auto-cancel update. `deadline` echoes the armed
629
+ * cancellation time in Unix milliseconds, or `null` when the schedule was
630
+ * disarmed.
631
+ *
632
+ * @experimental This API may change in a breaking way in any release, including patch releases.
633
+ */
634
+ declare const PerpsAutoCancelResponseSchema: z.ZodObject<{
635
+ status: z.ZodLiteral<"ok">;
636
+ deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds | null, number>>;
637
+ }, z.core.$strip>;
638
+ /**
639
+ * @experimental This API may change in a breaking way in any release, including patch releases.
640
+ */
641
+ type PerpsAutoCancelResponse = z.infer<typeof PerpsAutoCancelResponseSchema>;
642
+ /**
643
+ * Current auto-cancel state for an account. `deadline` is `null` when no
644
+ * schedule is armed.
645
+ *
646
+ * @experimental This API may change in a breaking way in any release, including patch releases.
647
+ */
648
+ declare const PerpsAutoCancelStatusSchema: z.ZodPipe<z.ZodObject<{
649
+ deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds | null, number>>;
650
+ triggered: z.ZodNumber;
651
+ daily_limit: z.ZodNumber;
652
+ next_reset: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
653
+ }, z.core.$strip>, z.ZodTransform<{
654
+ deadline: EpochMilliseconds | null;
655
+ triggered: number;
656
+ dailyLimit: number;
657
+ nextReset: EpochMilliseconds;
658
+ }, {
659
+ deadline: EpochMilliseconds | null;
660
+ triggered: number;
661
+ daily_limit: number;
662
+ next_reset: EpochMilliseconds;
663
+ }>>;
664
+ /**
665
+ * @experimental This API may change in a breaking way in any release, including patch releases.
666
+ */
667
+ type PerpsAutoCancelStatus = z.infer<typeof PerpsAutoCancelStatusSchema>;
668
+ /**
669
+ * @experimental This API may change in a breaking way in any release, including patch releases.
670
+ */
671
+ declare const FetchPerpsAutoCancelStatusResponseSchema: z.ZodPipe<z.ZodObject<{
672
+ deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds | null, number>>;
673
+ triggered: z.ZodNumber;
674
+ daily_limit: z.ZodNumber;
675
+ next_reset: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
676
+ }, z.core.$strip>, z.ZodTransform<{
677
+ deadline: EpochMilliseconds | null;
678
+ triggered: number;
679
+ dailyLimit: number;
680
+ nextReset: EpochMilliseconds;
681
+ }, {
682
+ deadline: EpochMilliseconds | null;
683
+ triggered: number;
684
+ daily_limit: number;
685
+ next_reset: EpochMilliseconds;
686
+ }>>;
687
+
618
688
  /**
619
689
  * @experimental This API may change in a breaking way in any release, including patch releases.
620
690
  */
@@ -1754,4 +1824,4 @@ declare const FetchPerpsCandlesResponseSchema: z.ZodObject<{
1754
1824
  more: z.ZodBoolean;
1755
1825
  }, z.core.$strip>;
1756
1826
 
1757
- export { FetchPerpsAccountConfigResponseSchema, FetchPerpsAccountStatsResponseSchema, FetchPerpsBalancesResponseSchema, FetchPerpsCandlesResponseSchema, FetchPerpsFeesResponseSchema, FetchPerpsFundingHistoryResponseSchema, FetchPerpsInstrumentsResponseSchema, FetchPerpsPortfolioResponseSchema, FetchPerpsStatisticsResponseSchema, FetchPerpsTickersResponseSchema, FetchPerpsTradesResponseSchema, ListPerpsDepositsResponseSchema, ListPerpsEquityHistoryResponseSchema, ListPerpsFundingPaymentsResponseSchema, ListPerpsPnlHistoryResponseSchema, ListPerpsWithdrawalsResponseSchema, type PerpsAccountConfig, PerpsAccountConfigSchema, type PerpsAccountFundingPayment, PerpsAccountFundingPaymentEntrySchema, PerpsAccountFundingPaymentSchema, type PerpsAccountStats, PerpsAccountStatsSchema, type PerpsBalance, PerpsBalanceSchema, type PerpsBbo, PerpsBboSchema, PerpsBboUpdateSchema, type PerpsBook, type PerpsBookLevel, PerpsBookLevelSchema, PerpsBookSchema, PerpsBookUpdateSchema, type PerpsCandle, PerpsCandleSchema, PerpsCreateProxyResponseSchema, PerpsCredentialsResponseSchema, PerpsDeleteProxyResponseSchema, type PerpsDeposit, PerpsDepositSchema, PerpsDepositStatus, PerpsDepositUpdateSchema, PerpsEntityId, type PerpsEquityPoint, PerpsEquityPointSchema, type PerpsFeeScheduleEntry, PerpsFeeScheduleEntrySchema, type PerpsFeeTier, PerpsFeeTierSchema, type PerpsFeesInfo, PerpsFeesInfoSchema, type PerpsFundingRate, PerpsFundingRateSchema, type PerpsInstrument, PerpsInstrumentCategory, PerpsInstrumentId, PerpsInstrumentSchema, PerpsInstrumentType, type PerpsInternalTransfer, PerpsInternalTransferDirection, PerpsInternalTransferId, PerpsInternalTransferSchema, PerpsKnownWithdrawalStatus, type PerpsMarginSummary, PerpsMarginSummarySchema, type PerpsPnlPoint, PerpsPnlPointSchema, type PerpsPortfolio, type PerpsPortfolioPosition, PerpsPortfolioPositionSchema, PerpsPortfolioSchema, type PerpsProxyKey, PerpsProxyKeySchema, type PerpsPublicTrade, PerpsPublicTradeSchema, PerpsPublicTradeUpdateSchema, type PerpsRiskTier, PerpsRiskTierSchema, PerpsSide, type PerpsStatistic, PerpsStatisticSchema, PerpsStatisticUpdateSchema, type PerpsTicker, PerpsTickerEntrySchema, PerpsTickerSchema, PerpsTradeId, PerpsWithdrawResponseSchema, type PerpsWithdrawal, PerpsWithdrawalId, PerpsWithdrawalSchema, PerpsWithdrawalUpdateSchema };
1827
+ export { FetchPerpsAccountConfigResponseSchema, FetchPerpsAccountStatsResponseSchema, FetchPerpsAutoCancelStatusResponseSchema, FetchPerpsBalancesResponseSchema, FetchPerpsCandlesResponseSchema, FetchPerpsFeesResponseSchema, FetchPerpsFundingHistoryResponseSchema, FetchPerpsInstrumentsResponseSchema, FetchPerpsPortfolioResponseSchema, FetchPerpsStatisticsResponseSchema, FetchPerpsTickersResponseSchema, FetchPerpsTradesResponseSchema, ListPerpsDepositsResponseSchema, ListPerpsEquityHistoryResponseSchema, ListPerpsFundingPaymentsResponseSchema, ListPerpsPnlHistoryResponseSchema, ListPerpsWithdrawalsResponseSchema, type PerpsAccountConfig, PerpsAccountConfigSchema, type PerpsAccountFundingPayment, PerpsAccountFundingPaymentEntrySchema, PerpsAccountFundingPaymentSchema, type PerpsAccountStats, PerpsAccountStatsSchema, type PerpsAutoCancelResponse, PerpsAutoCancelResponseSchema, type PerpsAutoCancelStatus, PerpsAutoCancelStatusSchema, type PerpsBalance, PerpsBalanceSchema, type PerpsBbo, PerpsBboSchema, PerpsBboUpdateSchema, type PerpsBook, type PerpsBookLevel, PerpsBookLevelSchema, PerpsBookSchema, PerpsBookUpdateSchema, type PerpsCandle, PerpsCandleSchema, PerpsCreateProxyResponseSchema, PerpsCredentialsResponseSchema, PerpsDeleteProxyResponseSchema, type PerpsDeposit, PerpsDepositSchema, PerpsDepositStatus, PerpsDepositUpdateSchema, PerpsEntityId, type PerpsEquityPoint, PerpsEquityPointSchema, type PerpsFeeScheduleEntry, PerpsFeeScheduleEntrySchema, type PerpsFeeTier, PerpsFeeTierSchema, type PerpsFeesInfo, PerpsFeesInfoSchema, PerpsFundingPaymentId, type PerpsFundingRate, PerpsFundingRateSchema, type PerpsInstrument, PerpsInstrumentCategory, PerpsInstrumentId, PerpsInstrumentSchema, PerpsInstrumentType, type PerpsInternalTransfer, PerpsInternalTransferDirection, PerpsInternalTransferId, PerpsInternalTransferSchema, PerpsKnownWithdrawalStatus, type PerpsMarginSummary, PerpsMarginSummarySchema, type PerpsPnlPoint, PerpsPnlPointSchema, type PerpsPortfolio, type PerpsPortfolioPosition, PerpsPortfolioPositionSchema, PerpsPortfolioSchema, type PerpsProxyKey, PerpsProxyKeySchema, type PerpsPublicTrade, PerpsPublicTradeSchema, PerpsPublicTradeUpdateSchema, type PerpsRiskTier, PerpsRiskTierSchema, PerpsSide, type PerpsStatistic, PerpsStatisticSchema, PerpsStatisticUpdateSchema, type PerpsTicker, PerpsTickerEntrySchema, PerpsTickerSchema, PerpsTradeId, PerpsWithdrawResponseSchema, type PerpsWithdrawal, PerpsWithdrawalId, PerpsWithdrawalSchema, PerpsWithdrawalUpdateSchema };
@@ -1,2 +1,2 @@
1
- export{_ as FetchPerpsAccountConfigResponseSchema,R as FetchPerpsAccountStatsResponseSchema,P as FetchPerpsBalancesResponseSchema,Na as FetchPerpsCandlesResponseSchema,Ma as FetchPerpsFeesResponseSchema,Ia as FetchPerpsFundingHistoryResponseSchema,ra as FetchPerpsInstrumentsResponseSchema,nb as FetchPerpsOpenOrdersResponseSchema,mb as FetchPerpsOrdersResponseSchema,V as FetchPerpsPortfolioResponseSchema,xa as FetchPerpsStatisticsResponseSchema,ta as FetchPerpsTickersResponseSchema,Ga as FetchPerpsTradesResponseSchema,ab as FetchPerpsUnreadNotificationsCountResponseSchema,ia as ListPerpsDepositsResponseSchema,aa as ListPerpsEquityHistoryResponseSchema,qb as ListPerpsFillsResponseSchema,X as ListPerpsFundingPaymentsResponseSchema,$a as ListPerpsNotificationsResponseSchema,ca as ListPerpsPnlHistoryResponseSchema,la as ListPerpsWithdrawalsResponseSchema,bb as MarkPerpsNotificationsReadResponseSchema,Z as PerpsAccountConfigSchema,pb as PerpsAccountFillSchema,rb as PerpsAccountFillUpdateSchema,Y as PerpsAccountFundingPaymentEntrySchema,W as PerpsAccountFundingPaymentSchema,Q as PerpsAccountStatsSchema,I as PerpsAssetSchema,O as PerpsBalanceSchema,Ca as PerpsBboSchema,Da as PerpsBboUpdateSchema,za as PerpsBookLevelSchema,Aa as PerpsBookSchema,Ba as PerpsBookUpdateSchema,jb as PerpsCancelAllOrdersResponseSchema,ib as PerpsCancelOrderResultSchema,va as PerpsCandleSchema,c as PerpsClientOrderIdSchema,gb as PerpsCommandAckSchema,fb as PerpsCommandStatusSchema,fa as PerpsCreateProxyResponseSchema,ea as PerpsCredentialsResponseSchema,K as PerpsDataResponseSchema,j as PerpsDecimalInputSchema,ga as PerpsDeleteProxyResponseSchema,ha as PerpsDepositSchema,q as PerpsDepositStatus,C as PerpsDepositStatusSchema,ja as PerpsDepositUpdateSchema,h as PerpsEntityIdSchema,$ as PerpsEquityPointSchema,Ka as PerpsFeeScheduleEntrySchema,Ja as PerpsFeeTierSchema,La as PerpsFeesInfoSchema,i as PerpsFundingIntervalSchema,Ha as PerpsFundingRateSchema,l as PerpsInstrumentCategory,x as PerpsInstrumentCategorySchema,a as PerpsInstrumentIdSchema,qa as PerpsInstrumentSchema,k as PerpsInstrumentType,w as PerpsInstrumentTypeSchema,s as PerpsInternalTransferDirection,E as PerpsInternalTransferDirectionSchema,g as PerpsInternalTransferIdSchema,oa as PerpsInternalTransferSchema,t as PerpsKlineInterval,F as PerpsKlineIntervalSchema,r as PerpsKnownWithdrawalStatus,Wa as PerpsLimitOrderCanceledNotificationSchema,Xa as PerpsLiquidationWarningNotificationSchema,T as PerpsMarginSummarySchema,Sa as PerpsMarginType,Ta as PerpsMarginTypeSchema,_a as PerpsNotificationEntrySchema,d as PerpsNotificationIdSchema,Qa as PerpsNotificationOrderType,Ra as PerpsNotificationOrderTypeSchema,Za as PerpsNotificationSchema,Oa as PerpsNotificationType,Pa as PerpsNotificationTypeSchema,b as PerpsOrderIdSchema,lb as PerpsOrderSchema,cb as PerpsOrderStatus,eb as PerpsOrderStatusSchema,ob as PerpsOrderUpdateSchema,u as PerpsPnlInterval,G as PerpsPnlIntervalSchema,ba as PerpsPnlPointSchema,S as PerpsPortfolioPositionSchema,U as PerpsPortfolioSchema,Ua as PerpsPositionChangeNotificationSchema,Va as PerpsPositionClosedNotificationSchema,Ya as PerpsPositionLiquidatedNotificationSchema,hb as PerpsPostOrderAckSchema,da as PerpsProxyKeySchema,Ea as PerpsPublicTradeSchema,Fa as PerpsPublicTradeUpdateSchema,pa as PerpsRiskTierSchema,m as PerpsSide,y as PerpsSideSchema,v as PerpsSortDirection,H as PerpsSortDirectionSchema,wa as PerpsStatisticSchema,ya as PerpsStatisticUpdateSchema,ua as PerpsTickerEntrySchema,sa as PerpsTickerSchema,n as PerpsTimeInForce,z as PerpsTimeInForceSchema,o as PerpsTpSlKind,A as PerpsTpSlKindSchema,db as PerpsTpSlOrderFieldsSchema,p as PerpsTpSlScope,B as PerpsTpSlScopeSchema,e as PerpsTradeIdSchema,J as PerpsTxHashSchema,kb as PerpsUpdateLeverageResultSchema,ma as PerpsWithdrawResponseSchema,f as PerpsWithdrawalIdSchema,ka as PerpsWithdrawalSchema,D as PerpsWithdrawalStatusSchema,na as PerpsWithdrawalUpdateSchema,N as decimalString,M as perpsBaseUnits,L as perpsDecimal}from'../chunk-BVFKAX4O.js';import'../chunk-6TO35A2S.js';//# sourceMappingURL=index.js.map
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-I4SRN2Q5.js';import {s,ba}from'../chunk-6TO35A2S.js';import {z}from'zod';var n=z.number().int().transform(e=>e===0?null:s(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:ba}).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
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
1
+ {"version":3,"sources":["../../src/perps/auto-cancel.ts"],"names":["AutoCancelDeadlineSchema","z","value","toEpochMilliseconds","PerpsAutoCancelResponseSchema","PerpsAutoCancelStatusSchema","EpochMillisecondsSchema","status","FetchPerpsAutoCancelStatusResponseSchema"],"mappings":"8gIAIA,IAAMA,EAA2BC,CAAAA,CAC9B,MAAA,EAAO,CACP,GAAA,GACA,SAAA,CAAWC,CAAAA,EAAWA,CAAAA,GAAU,CAAA,CAAI,KAAOC,CAAAA,CAAoBD,CAAK,CAAE,CAAA,CAS5DE,GAAgCH,CAAAA,CAAE,MAAA,CAAO,CACpD,MAAA,CAAQA,EAAE,OAAA,CAAQ,IAAI,CAAA,CACtB,QAAA,CAAUD,CACZ,CAAC,CAAA,CAeYK,CAAAA,CAA8BJ,CAAAA,CACxC,OAAO,CACN,QAAA,CAAUD,CAAAA,CACV,SAAA,CAAWC,EAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,aAAY,CACxC,WAAA,CAAaA,CAAAA,CAAE,MAAA,GAAS,GAAA,EAAI,CAAE,WAAA,EAAY,CAC1C,WAAYK,EACd,CAAC,CAAA,CACA,SAAA,CAAWC,IAAY,CACtB,QAAA,CAAUA,CAAAA,CAAO,QAAA,CACjB,UAAWA,CAAAA,CAAO,SAAA,CAClB,UAAA,CAAYA,CAAAA,CAAO,YACnB,SAAA,CAAWA,CAAAA,CAAO,UACpB,CAAA,CAAE,EAUSC,EAAAA,CACXH","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport { EpochMillisecondsSchema, toEpochMilliseconds } from '../shared';\n\n// The API reports an unarmed schedule as `deadline: 0`.\nconst AutoCancelDeadlineSchema = z\n .number()\n .int()\n .transform((value) => (value === 0 ? null : toEpochMilliseconds(value)));\n\n/**\n * Acknowledgement for a Perps auto-cancel update. `deadline` echoes the armed\n * cancellation time in Unix milliseconds, or `null` when the schedule was\n * disarmed.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAutoCancelResponseSchema = z.object({\n status: z.literal('ok'),\n deadline: AutoCancelDeadlineSchema,\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAutoCancelResponse = z.infer<\n typeof PerpsAutoCancelResponseSchema\n>;\n\n/**\n * Current auto-cancel state for an account. `deadline` is `null` when no\n * schedule is armed.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAutoCancelStatusSchema = z\n .object({\n deadline: AutoCancelDeadlineSchema,\n triggered: z.number().int().nonnegative(),\n daily_limit: z.number().int().nonnegative(),\n next_reset: EpochMillisecondsSchema,\n })\n .transform((status) => ({\n deadline: status.deadline,\n triggered: status.triggered,\n dailyLimit: status.daily_limit,\n nextReset: status.next_reset,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAutoCancelStatus = z.infer<typeof PerpsAutoCancelStatusSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsAutoCancelStatusResponseSchema =\n PerpsAutoCancelStatusSchema;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { TokenId, DecimalString, EpochMilliseconds, CtfConditionId, IsoDateTimeString, OrderSide, OrderType, TradeStatus, BaseUnits, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId } from '../index.js';
2
2
  import { z } from 'zod';
3
- import { P as PerpsInstrumentId, T as PerpsKlineInterval, b as PerpsDepositStatus, i as PerpsTradeId, aa as PerpsOrderId, j as PerpsSide, a2 as PerpsNotificationId, a7 as PerpsNotificationType, a4 as PerpsNotificationOrderType, Z as PerpsMarginType, at as PerpsTimeInForce, ad as PerpsOrderStatus, av as PerpsTpSlKind, az as PerpsTpSlScope, c as PerpsWithdrawalId, d as PerpsKnownWithdrawalStatus } from '../orders-CTqTKxTR.js';
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-BDfNkzav.js';
4
4
  import * as _polymarket_types from '@polymarket/types';
5
5
  import { R as ReactionType } from '../comment-C-jBbhp7.js';
6
6
 
@@ -2775,6 +2775,7 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2775
2775
  sq: z.ZodNumber;
2776
2776
  ch: z.ZodLiteral<"funding">;
2777
2777
  data: z.ZodPipe<z.ZodObject<{
2778
+ id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsFundingPaymentId, number>>;
2778
2779
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2779
2780
  sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2780
2781
  fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -2782,6 +2783,7 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2782
2783
  fua: z.ZodString;
2783
2784
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2784
2785
  }, z.core.$strip>, z.ZodTransform<{
2786
+ id: PerpsFundingPaymentId;
2785
2787
  instrumentId: PerpsInstrumentId;
2786
2788
  size: DecimalString;
2787
2789
  fundingRate: DecimalString;
@@ -2789,6 +2791,7 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2789
2791
  funding: DecimalString;
2790
2792
  timestamp: EpochMilliseconds;
2791
2793
  }, {
2794
+ id: PerpsFundingPaymentId;
2792
2795
  iid: PerpsInstrumentId;
2793
2796
  sz: DecimalString;
2794
2797
  fr: DecimalString;
@@ -2802,6 +2805,7 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2802
2805
  timestamp: number;
2803
2806
  sequence: number;
2804
2807
  payload: {
2808
+ id: PerpsFundingPaymentId;
2805
2809
  instrumentId: PerpsInstrumentId;
2806
2810
  size: DecimalString;
2807
2811
  fundingRate: DecimalString;
@@ -2814,6 +2818,7 @@ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2814
2818
  sq: number;
2815
2819
  ch: "funding";
2816
2820
  data: {
2821
+ id: PerpsFundingPaymentId;
2817
2822
  instrumentId: PerpsInstrumentId;
2818
2823
  size: DecimalString;
2819
2824
  fundingRate: DecimalString;
@@ -3732,6 +3737,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3732
3737
  sq: z.ZodNumber;
3733
3738
  ch: z.ZodLiteral<"funding">;
3734
3739
  data: z.ZodPipe<z.ZodObject<{
3740
+ id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsFundingPaymentId, number>>;
3735
3741
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3736
3742
  sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3737
3743
  fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -3739,6 +3745,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3739
3745
  fua: z.ZodString;
3740
3746
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3741
3747
  }, z.core.$strip>, z.ZodTransform<{
3748
+ id: PerpsFundingPaymentId;
3742
3749
  instrumentId: PerpsInstrumentId;
3743
3750
  size: DecimalString;
3744
3751
  fundingRate: DecimalString;
@@ -3746,6 +3753,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3746
3753
  funding: DecimalString;
3747
3754
  timestamp: EpochMilliseconds;
3748
3755
  }, {
3756
+ id: PerpsFundingPaymentId;
3749
3757
  iid: PerpsInstrumentId;
3750
3758
  sz: DecimalString;
3751
3759
  fr: DecimalString;
@@ -3759,6 +3767,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3759
3767
  timestamp: number;
3760
3768
  sequence: number;
3761
3769
  payload: {
3770
+ id: PerpsFundingPaymentId;
3762
3771
  instrumentId: PerpsInstrumentId;
3763
3772
  size: DecimalString;
3764
3773
  fundingRate: DecimalString;
@@ -3771,6 +3780,7 @@ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.Zo
3771
3780
  sq: number;
3772
3781
  ch: "funding";
3773
3782
  data: {
3783
+ id: PerpsFundingPaymentId;
3774
3784
  instrumentId: PerpsInstrumentId;
3775
3785
  size: DecimalString;
3776
3786
  fundingRate: DecimalString;
@@ -1,2 +1,2 @@
1
- import {N,K,O,P}from'../chunk-GJX3FYFG.js';import {Fa,Da,Ba,ua,ya as ya$1,va,rb,b as b$1,a,O as O$1,U,ob,Y,ja,na,Za}from'../chunk-BVFKAX4O.js';import {xa,La,x as x$1,Ra,Ia,da,ia,_,ya,za,ba,va as va$1,Na,R}from'../chunk-6TO35A2S.js';export{d as TradeStatus}from'../chunk-6TO35A2S.js';import {z}from'zod';var x=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,xa),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:La,size:La}),b=z.string().regex(/^\d+$/).transform(t=>x$1(new Date(Number(t)*1e3).toISOString())),xe=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:x$1(new Date(Number(t)*1e3).toISOString())),ne=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ia,bids:z.array(te),asks:z.array(te),hash:z.string().nullish(),timestamp:da.nullish(),min_order_size:Ra,tick_size:Ra,neg_risk:z.boolean().nullish(),last_trade_price:Ra}).transform(({event_type:t,asset_id:n,min_order_size:a,tick_size:i,neg_risk:s,last_trade_price:p,...S})=>({topic:"market",type:t,payload:{...S,tokenId:n,minOrderSize:a,tickSize:i,negRisk:s,lastTradePrice:p}})),Te=z.object({asset_id:Ia,price:La,size:La,side:x,hash:z.string().nullish(),best_bid:Ra,best_ask:Ra}).transform(({asset_id:t,best_bid:n,best_ask:a,...i})=>({...i,tokenId:t,bestBid:n,bestAsk:a})),ae=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(Te),timestamp:da.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:Ia,price:La,size:Ra,fee_rate_bps:Ra,side:x,timestamp:da.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:n,fee_rate_bps:a,transaction_hash:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,feeRateBps:a,transactionHash:i}})),se=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ia,old_tick_size:Ra,new_tick_size:La,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,old_tick_size:a,new_tick_size:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,oldTickSize:a,newTickSize:i}})),oe=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ia,best_bid:Ra,best_ask:Ra,spread:Ra,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,best_bid:a,best_ask:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,bestBid:a,bestAsk:i}})),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(Ia).nullish(),outcomes:z.array(z.string()).nullish(),event_message:pe.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish(),condition_id:_.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Ra,game_start_time:ia.nullish(),order_price_min_tick_size:Ra,group_item_title:z.string().nullish(),taker_base_fee:Ra,fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:n,event_message:a,condition_id:i,clob_token_ids:s,sports_market_type: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(Ia).nullish(),winning_asset_id:Ia.nullish(),winning_outcome:z.string().nullish(),event_message:pe.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:n,winning_asset_id:a,winning_outcome:i,event_message:s,...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:Ia,side:x,order_owner:z.string().nullish(),original_size:La,size_matched:La,price:La,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:be,created_at:b.nullish(),expiration:xe.nullish(),order_type:ya.nullish(),status:_e.nullish(),maker_address:z.string().nullish(),timestamp:da}).transform(({event_type:t,type:n,asset_id:a,order_owner:i,original_size:s,size_matched: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:La,price:La,fee_rate_bps:Ra,asset_id:Ia,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:x}).transform(({order_id:t,maker_address:n,matched_amount:a,fee_rate_bps:i,asset_id:s,outcome_index: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:Ia,side:x,size:La,fee_rate_bps:Ra,price:La,status:za,match_time:b.nullish(),matchtime:b.nullish(),last_update:b.nullish(),outcome:z.string().nullish(),owner:z.string(),trade_owner:z.string().nullish(),maker_address:z.string().nullish(),transaction_hash:z.string().nullish(),bucket_index:z.number().int().nullish(),maker_orders:z.array(Ie).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:da}).transform(({event_type:t,type:n,taker_order_id:a,asset_id:i,fee_rate_bps:s,match_time: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:ba,sq:de}),Ne=u.extend({ch:Ue,data:z.array(Fa)}).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:Da}).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:Ba}).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:ua}).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:ya$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(va)}).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",O$1),Ye=f("portfolio","portfolio",U),Ze=f("order","orders",ob),Ve=f("fill","fills",z.array(rb)),Qe=f("funding","funding",Y),Ge=f("deposit","deposits",ja),Je=f("withdrawal","withdrawals",na),Xe=f("notification","notifications",Za),Gt=z.object({ch:z.literal("notifications"),ts:ba,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:va$1.nullish(),parentEntityID:z.number().int().nullish(),parentCommentID:z.string().nullish(),userAddress:z.string().nullish(),replyAddress:z.string().nullish(),createdAt:z.string().nullish(),updatedAt:z.string().nullish(),media:z.array(O).nullish(),profile:K.nullish(),reactions:z.array(N).nullish(),reportCount:z.number().int().nullish(),reactionCount:z.number().int().nullish(),tradeAsset:z.string().nullish()}),at=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:ba,payload:P}),it=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:ba,payload:nt}),st=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:ba,payload:N}),ot=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:ba,payload:N}),Se=z.object({symbol:z.string(),timestamp:ba,value:Na}),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:ba,payload:Se}),Et=z.object({topic:St,type:z.literal("update"),timestamp:ba,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 R(`${a?"-":""}${s}${p===""?"":`.${p}`}`)}var kt=z.string().regex(/^-?\d+$/).transform(vt),Ct=z.object({symbol:z.string(),value:Na,full_accuracy_value:kt,timestamp:ba});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:ba,payload:fe(30)}),Ee=z.object({topic:ft,type:z.literal("update"),timestamp:ba,payload:fe(60)}),nr=z.union([Pe,Ee]),gt=z.discriminatedUnion("topic",[Pt,Et,Pe,Ee]),_t=z.object({symbol:z.string(),value:Na,full_accuracy_value:La.nullish(),timestamp:ba,received_at:ba.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:n,is_carried_forward:a,value:i,...s})=>({...s,value:t??i,receivedAt:n,isCarriedForward:a})),xt=z.object({timestamp:z.number(),value:Na}),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:ba,payload:_t}),wt=z.object({topic:ve,type:z.literal("subscribe"),timestamp:ba,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:ia.nullish(),finished_timestamp:ia.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-GJX3FYFG.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,oa,_a}from'../chunk-I4SRN2Q5.js';import {xa,La,x as x$1,Ra,Ia,da,ia,_,ya,za,ba,va as va$1,Na,R}from'../chunk-6TO35A2S.js';export{d as TradeStatus}from'../chunk-6TO35A2S.js';import {z}from'zod';var x=z.preprocess(t=>typeof t=="string"?t.toUpperCase():t,xa),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:La,size:La}),b=z.string().regex(/^\d+$/).transform(t=>x$1(new Date(Number(t)*1e3).toISOString())),xe=z.string().regex(/^\d+$/).transform(t=>t==="0"?void 0:x$1(new Date(Number(t)*1e3).toISOString())),ne=z.object({event_type:z.literal("book"),market:z.string(),asset_id:Ia,bids:z.array(te),asks:z.array(te),hash:z.string().nullish(),timestamp:da.nullish(),min_order_size:Ra,tick_size:Ra,neg_risk:z.boolean().nullish(),last_trade_price:Ra}).transform(({event_type:t,asset_id:n,min_order_size:a,tick_size:i,neg_risk:s,last_trade_price:p,...S})=>({topic:"market",type:t,payload:{...S,tokenId:n,minOrderSize:a,tickSize:i,negRisk:s,lastTradePrice:p}})),Te=z.object({asset_id:Ia,price:La,size:La,side:x,hash:z.string().nullish(),best_bid:Ra,best_ask:Ra}).transform(({asset_id:t,best_bid:n,best_ask:a,...i})=>({...i,tokenId:t,bestBid:n,bestAsk:a})),ae=z.object({event_type:z.literal("price_change"),market:z.string(),price_changes:z.array(Te),timestamp:da.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:Ia,price:La,size:Ra,fee_rate_bps:Ra,side:x,timestamp:da.nullish(),transaction_hash:z.string().nullish()}).transform(({event_type:t,asset_id:n,fee_rate_bps:a,transaction_hash:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,feeRateBps:a,transactionHash:i}})),se=z.object({event_type:z.literal("tick_size_change"),market:z.string(),asset_id:Ia,old_tick_size:Ra,new_tick_size:La,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,old_tick_size:a,new_tick_size:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,oldTickSize:a,newTickSize:i}})),oe=z.object({event_type:z.literal("best_bid_ask"),market:z.string(),asset_id:Ia,best_bid:Ra,best_ask:Ra,spread:Ra,timestamp:da.nullish()}).transform(({event_type:t,asset_id:n,best_bid:a,best_ask:i,...s})=>({topic:"market",type:t,payload:{...s,tokenId:n,bestBid:a,bestAsk:i}})),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(Ia).nullish(),outcomes:z.array(z.string()).nullish(),event_message:pe.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish(),condition_id:_.nullish(),active:z.boolean().nullish(),clob_token_ids:z.array(z.string()).nullish(),sports_market_type:z.string().nullish(),line:Ra,game_start_time:ia.nullish(),order_price_min_tick_size:Ra,group_item_title:z.string().nullish(),taker_base_fee:Ra,fees_enabled:z.boolean().nullish(),fee_schedule:z.unknown().nullish()}).transform(({event_type:t,assets_ids:n,event_message:a,condition_id:i,clob_token_ids:s,sports_market_type: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(Ia).nullish(),winning_asset_id:Ia.nullish(),winning_outcome:z.string().nullish(),event_message:pe.nullish(),timestamp:da.nullish(),tags:z.array(z.string()).nullish()}).transform(({event_type:t,assets_ids:n,winning_asset_id:a,winning_outcome:i,event_message:s,...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:Ia,side:x,order_owner:z.string().nullish(),original_size:La,size_matched:La,price:La,associate_trades:z.array(z.string()).nullish(),outcome:z.string().nullish(),type:be,created_at:b.nullish(),expiration:xe.nullish(),order_type:ya.nullish(),status:_e.nullish(),maker_address:z.string().nullish(),timestamp:da}).transform(({event_type:t,type:n,asset_id:a,order_owner:i,original_size:s,size_matched: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:La,price:La,fee_rate_bps:Ra,asset_id:Ia,outcome:z.string().nullish(),outcome_index:z.number().int().nullish(),side:x}).transform(({order_id:t,maker_address:n,matched_amount:a,fee_rate_bps:i,asset_id:s,outcome_index: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:Ia,side:x,size:La,fee_rate_bps:Ra,price:La,status:za,match_time:b.nullish(),matchtime:b.nullish(),last_update:b.nullish(),outcome:z.string().nullish(),owner:z.string(),trade_owner:z.string().nullish(),maker_address:z.string().nullish(),transaction_hash:z.string().nullish(),bucket_index:z.number().int().nullish(),maker_orders:z.array(Ie).nullish(),trader_side:z.union([z.literal("TAKER"),z.literal("MAKER")]).nullish(),timestamp:da}).transform(({event_type:t,type:n,taker_order_id:a,asset_id:i,fee_rate_bps:s,match_time: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:ba,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),Je=f("withdrawal","withdrawals",oa),Xe=f("notification","notifications",_a),Gt=z.object({ch:z.literal("notifications"),ts:ba,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:va$1.nullish(),parentEntityID:z.number().int().nullish(),parentCommentID:z.string().nullish(),userAddress:z.string().nullish(),replyAddress:z.string().nullish(),createdAt:z.string().nullish(),updatedAt:z.string().nullish(),media:z.array(O).nullish(),profile:K.nullish(),reactions:z.array(N).nullish(),reportCount:z.number().int().nullish(),reactionCount:z.number().int().nullish(),tradeAsset:z.string().nullish()}),at=z.object({topic:z.literal("comments"),type:z.literal("comment_created"),timestamp:ba,payload:P}),it=z.object({topic:z.literal("comments"),type:z.literal("comment_removed"),timestamp:ba,payload:nt}),st=z.object({topic:z.literal("comments"),type:z.literal("reaction_created"),timestamp:ba,payload:N}),ot=z.object({topic:z.literal("comments"),type:z.literal("reaction_removed"),timestamp:ba,payload:N}),Se=z.object({symbol:z.string(),timestamp:ba,value:Na}),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:ba,payload:Se}),Et=z.object({topic:St,type:z.literal("update"),timestamp:ba,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 R(`${a?"-":""}${s}${p===""?"":`.${p}`}`)}var kt=z.string().regex(/^-?\d+$/).transform(vt),Ct=z.object({symbol:z.string(),value:Na,full_accuracy_value:kt,timestamp:ba});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:ba,payload:fe(30)}),Ee=z.object({topic:ft,type:z.literal("update"),timestamp:ba,payload:fe(60)}),nr=z.union([Pe,Ee]),gt=z.discriminatedUnion("topic",[Pt,Et,Pe,Ee]),_t=z.object({symbol:z.string(),value:Na,full_accuracy_value:La.nullish(),timestamp:ba,received_at:ba.nullish(),is_carried_forward:z.boolean().nullish()}).transform(({full_accuracy_value:t,received_at:n,is_carried_forward:a,value:i,...s})=>({...s,value:t??i,receivedAt:n,isCarriedForward:a})),xt=z.object({timestamp:z.number(),value:Na}),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:ba,payload:_t}),wt=z.object({topic:ve,type:z.literal("subscribe"),timestamp:ba,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:ia.nullish(),finished_timestamp:ia.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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarket/bindings",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Internal package. Contains generated bindings for the Polymarket API. Not intended for direct use.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- import {Ka,La,ba,aa,Pa,Na,R}from'./chunk-6TO35A2S.js';import {z}from'zod';function q(e){return e}var a=z.number().int().nonnegative().transform(q),b=z.number().int().nonnegative().transform(q),A=z.string().regex(/^[0-9a-f]{32}$/).transform(e=>e),v=z.uuid().transform(e=>e),k=z.number().int().nonnegative().transform(q),F=z.number().int().nonnegative().transform(q),W=z.number().int().nonnegative().transform(q),H=z.number().int().positive().transform(q),w=z.string().regex(/^[1-9]\d*h$/).transform(e=>e),ye=Na,Q=(l=>(l.Perpetual="perpetual",l))(Q||{}),V=(c=>(c.Equity="equity",c.Commodity="commodity",c.Index="index",c.Crypto="crypto",c))(V||{}),$=(d=>(d.Long="long",d.Short="short",d))($||{}),G=(P=>(P.GTC="gtc",P.IOC="ioc",P.FOK="fok",P))(G||{}),Y=(d=>(d.TakeProfit="tp",d.StopLoss="sl",d))(Y||{}),Z=(d=>(d.Order="order",d.Position="position",d))(Z||{}),X=(P=>(P.Pending="pending",P.Confirmed="confirmed",P.Removed="removed",P))(X||{}),he=(c=>(c.Pending="pending",c.Confirmed="confirmed",c.Removed="removed",c.Failed="failed",c))(he||{}),J=(d=>(d.In="in",d.Out="out",d))(J||{}),K=(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))(K||{}),ee=(c=>(c.OneHour="1h",c.FourHours="4h",c.OneDay="1d",c.OneWeek="1w",c))(ee||{}),te=(d=>(d.Descending="desc",d.Ascending="asc",d))(te||{}),C=z.enum(Q),E=z.enum(V),_=z.enum($),O=z.enum(G),re=z.enum(Y),ne=z.enum(Z),L=z.enum(X),N=z.string().transform(e=>e),ie=z.enum(J),tt=z.enum(K),rt=z.enum(ee),nt=z.enum(te),u=z.string().min(1),x=z.preprocess(e=>e==="0x"||e===""?void 0:e,Ka.optional()),y=e=>z.object({data:z.array(e),more:z.boolean()});function it(e){return ye.parse(e)}function ot(e){return Pa.parse(e)}function st(e){return R(e)}var Pe=z.object({asset:u,balance:La,value:La}),dt=z.array(Pe),_e=z.object({volume_7d:La,taker_volume_7d:La,maker_volume_7d:La,account_maker_share_7d:La,entity_maker_share_7d:La.optional(),entity_id:H.optional(),entity_name:z.string().min(1).optional()}).transform(e=>({volume7d:e.volume_7d,takerVolume7d:e.taker_volume_7d,makerVolume7d:e.maker_volume_7d,accountMakerShare7d:e.account_maker_share_7d,entityMakerShare7d:e.entity_maker_share_7d,entityId:e.entity_id,entityName:e.entity_name})),ut=_e,fe=z.object({instrument_id:a,symbol:z.string().min(1),size:La,entry_price:La,leverage:z.number().int().positive(),cross:z.boolean(),initial_margin:La,maintenance_margin:La,position_value:La,liquidation_price:La,unrealized_pnl:La,return_on_equity:La,cumulative_funding:La}).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})),lt=z.object({totalAccountValue:La,totalInitialMargin:La,totalMaintenanceMargin:La,totalPositionValue:La}),xe=z.object({total_account_value:La,total_initial_margin:La,total_maintenance_margin:La,total_position_value:La}).transform(e=>({totalAccountValue:e.total_account_value,totalInitialMargin:e.total_initial_margin,totalMaintenanceMargin:e.total_maintenance_margin,totalPositionValue:e.total_position_value})),Se=z.object({positions:z.array(fe),margin:xe,withdrawable:La,in_liquidation:z.boolean(),timestamp:ba}).transform(e=>({positions:e.positions,margin:e.margin,withdrawable:e.withdrawable,inLiquidation:e.in_liquidation,timestamp:e.timestamp})),yt=Se,ge=z.object({instrument_id:a,size:La,funding_rate:La,funding_asset:u,funding:La,timestamp:ba}).transform(e=>({instrumentId:e.instrument_id,size:e.size,fundingRate:e.funding_rate,fundingAsset:e.funding_asset,funding:e.funding,timestamp:e.timestamp})),ht=y(ge),Pt=z.object({iid:a,sz:La,fr:La,fund:La,fua:u,ts:ba}).transform(e=>({instrumentId:e.iid,size:e.sz,fundingRate:e.fr,fundingAsset:e.fua,funding:e.fund,timestamp:e.ts})),be=z.object({instrument_id:a,leverage:z.number().int().positive(),cross:z.boolean()}).transform(e=>({instrumentId:e.instrument_id,leverage:e.leverage,cross:e.cross})),_t=z.array(be),Ie=z.tuple([ba,La]).transform(([e,l])=>({timestamp:e,equity:l})),ft=y(Ie),ve=z.tuple([ba,La]).transform(([e,l])=>({timestamp:e,pnl:l})),xt=y(ve),qe=z.number().finite().positive().refine(e=>Number.isInteger(e),"Expected integer").transform(e=>e>Number.MAX_SAFE_INTEGER?Math.floor(e/1e6):e).pipe(ba),ke=z.object({proxy:aa,label:z.string().optional(),expiry:qe}).transform(e=>({proxy:e.proxy,label:e.label,expiresAt:e.expiry})),St=z.object({address:aa,keys:z.array(ke)}).transform(e=>({address:e.address,keys:e.keys})),gt=z.object({secret:z.string().min(1)}),bt=z.object({status:z.enum(["ok","err"]),error:z.string().optional()});var Te=z.object({hash:Ka,asset:u,amount:Pa,status:L,from:aa,to:aa,confirmations:z.number().int().nonnegative(),required_confirmations:z.number().int().nonnegative(),created_timestamp:ba,confirmed_timestamp:ba.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})),Tt=y(Te),zt=z.object({hash:x,asset:u,amount:Pa,status:L}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status})),ze=z.object({withdraw_id:F,asset:u,amount:Pa,fee:La,status:N,to:aa,hash:x,confirmations:z.number().int().nonnegative(),required_confirmations:z.number().int().nonnegative(),created_timestamp:ba,confirmed_timestamp:ba.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})),Rt=y(ze),Ft=z.object({status:z.enum(["ok","err"]),withdraw_id:F.optional(),error:z.string().optional()}).transform(e=>({status:e.status,withdrawalId:e.withdraw_id,error:e.error})),jt=z.object({withdraw_id:F,asset:u,amount:Pa,fee:La,status:N,to:aa,hash:x}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash})),At=z.object({transferId:W,asset:u,amount:Pa,direction:ie,counterparty:aa,label:z.string().optional(),createdTimestamp:ba});var Nt=z.object({lowerBound:La,maxLeverage:z.number().int().positive()}),Re=z.object({lower_bound:La,max_leverage:z.number().int().positive()}).transform(e=>({lowerBound:e.lower_bound,maxLeverage:e.max_leverage})),Fe=z.object({instrument_id:a,instrument_type:C,category:E,symbol:z.string().min(1),base_asset:u,quote_asset:u,funding_interval:w,quantity_decimals:z.number().int().nonnegative(),price_decimals:z.number().int().nonnegative(),price_bounds:La,liquidation_fee:La,max_order_count:z.number().int().positive(),min_notional:La,max_market_notional:La,max_limit_notional:La,max_leverage:z.number().int().positive(),isolated_only:z.boolean(),risk_tiers:z.array(Re)}).transform(e=>({id:e.instrument_id,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,isolatedOnly:e.isolated_only,riskTiers:e.risk_tiers})),Dt=z.array(Fe),je=z.object({instrument_id:a,symbol:z.string().min(1),index_price:La,mark_price:La,last_price:La,mid_price:La,open_interest:La,funding_rate:La,next_funding:ba,timestamp:ba.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})),Bt=z.array(je),Mt=z.object({iid:a,idx:La,mark:La,last:La,mid:La,oi:La,fr:La,nxf:ba}).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})),D=z.tuple([ba,La,La,La,La,La,z.number().int().nonnegative()]).transform(([e,l,d,P,c,T,z])=>({timestamp:e,open:l,high:d,low:P,close:c,volume:T,trades:z})),Ae=z.object({instrument_id:a,symbol:z.string().min(1).optional(),volume:La,open_price:La,klines:z.array(D)}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,volume:e.volume,openPrice:e.open_price,klines:e.klines})),Ut=z.array(Ae),Wt=z.object({iid:a,vol:La,open:La,klines:z.array(D)}).transform(e=>({instrumentId:e.iid,volume:e.vol,openPrice:e.open,klines:e.klines})),j=z.tuple([La,La]).transform(([e,l])=>({price:e,quantity:l})),Ht=z.object({instrument_id:a,bids:z.array(j),asks:z.array(j),timestamp:ba,sequence:z.number().int().nonnegative()}).transform(e=>({instrumentId:e.instrument_id,bids:e.bids,asks:e.asks,timestamp:e.timestamp,sequence:e.sequence})),wt=z.object({b:z.array(j),a:z.array(j)}).transform(e=>({bids:e.b,asks:e.a})),Qt=z.object({instrumentId:a,bidPrice:La,bidQuantity:La,askPrice:La,askQuantity:La,timestamp:ba.optional()}),Vt=z.object({iid:a,bp:La,bq:La,ap:La,aq:La}).transform(e=>({instrumentId:e.iid,bidPrice:e.bp,bidQuantity:e.bq,askPrice:e.ap,askQuantity:e.aq})),Ce=z.object({trade_id:k,instrument_id:a,side:_,price:La,quantity:La,timestamp:ba,hash:x}).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})),$t=z.object({tid:k,iid:a,side:_,p:La,qty:La,ts:ba,hash:x}).transform(e=>({tradeId:e.tid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,timestamp:e.ts,hash:e.hash})),Gt=y(Ce),Ee=z.object({funding_rate:La,timestamp:ba}).transform(e=>({fundingRate:e.funding_rate,timestamp:e.timestamp})),Yt=y(Ee),Oe=z.object({min_volume_30d:La,taker_fee_rate:La,maker_fee_rate:La}).transform(e=>({minVolume30d:e.min_volume_30d,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate})),Le=z.object({instrument_type:C,category:E,taker_fee_rate:La,maker_fee_rate:La,tiers:z.array(Oe)}).transform(e=>({category:e.category,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate,tiers:e.tiers})),Ne=z.object({fee_schedule:z.array(Le)}).transform(e=>({feeSchedule:e.fee_schedule})),Zt=Ne,Xt=y(D);var oe=(I=>(I.PositionOpened="position_opened",I.PositionIncreased="position_increased",I.PositionReduced="position_reduced",I.PositionClosed="position_closed",I.LimitOrderCanceled="limit_order_canceled",I.LiquidationWarning="liquidation_warning",I.PositionLiquidated="position_liquidated",I))(oe||{}),De=z.enum(oe),se=(c=>(c.Market="market",c.Limit="limit",c.TakeProfit="take_profit",c.StopLoss="stop_loss",c))(se||{}),ae=z.enum(se),pe=(d=>(d.Cross="cross",d.Isolated="isolated",d))(pe||{}),Be=z.enum(pe),Me=z.object({id:v,type:z.enum(["position_opened","position_increased","position_reduced"]),instrument_id:a,side:_,size:La,avg_price:La,leverage:z.number().int().positive(),order_type:ae.optional()}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,size:e.size,avgPrice:e.avg_price,leverage:e.leverage,orderType:e.order_type})),Ue=z.object({id:v,type:z.literal("position_closed"),instrument_id:a,side:_,size:La,avg_price:La,pnl:La,order_type:ae.optional()}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,size:e.size,avgPrice:e.avg_price,pnl:e.pnl,orderType:e.order_type})),We=z.object({id:v,type:z.literal("limit_order_canceled"),instrument_id:a,side:_,size:La,price:La}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,size:e.size,price:e.price})),He=z.object({id:v,type:z.literal("liquidation_warning"),margin_type:z.literal("isolated"),instrument_id:a,mark_price:La,liq_price:La}).transform(e=>({id:e.id,type:e.type,marginType:e.margin_type,instrumentId:e.instrument_id,markPrice:e.mark_price,liquidationPrice:e.liq_price})),we=z.object({id:v,type:z.literal("liquidation_warning"),margin_type:z.literal("cross"),instrument_id:z.null(),mark_price:La,affected_instruments:z.array(a)}).transform(e=>({id:e.id,type:e.type,marginType:e.margin_type,markPrice:e.mark_price,affectedInstruments:e.affected_instruments})),Qe=z.discriminatedUnion("margin_type",[He,we]),Ve=z.object({id:v,type:z.literal("position_liquidated"),instrument_id:a,side:_,size_closed:La,pnl:La.nullable(),margin_type:Be,via_backstop:z.boolean()}).transform(e=>({id:e.id,type:e.type,instrumentId:e.instrument_id,side:e.side,sizeClosed:e.size_closed,pnl:e.pnl,marginType:e.margin_type,viaBackstop:e.via_backstop})),$e=z.discriminatedUnion("type",[Me,Ue,We,Qe,Ve]),Ge=z.object({notification:$e,read_at:ba.nullable(),ts:ba}).transform(e=>({notification:e.notification,readAt:e.read_at,timestamp:e.ts})),Ye=z.object({notification:z.object({type:De})}),Ze=z.array(z.unknown()).transform((e,l)=>{let d=[];return e.forEach((P,c)=>{if(!Ye.safeParse(P).success)return;let T=Ge.safeParse(P);if(T.success){d.push(T.data);return}for(let z of T.error.issues)l.addIssue({...z,path:[c,...z.path]});}),d}),rr=z.object({items:Ze,unread:z.number().int().nonnegative(),durable_source_seq:z.number().int().nonnegative(),has_more:z.boolean(),next_cursor:z.string().nullable()}),nr=z.object({unread:z.number().int().nonnegative()}),ir=z.object({status:z.enum(["ok","err"]),error:z.string().optional()});var me=(m=>(m.Accepted="accepted",m.Open="open",m.Partial="partial",m.Filled="filled",m.Cancelled="cancelled",m.AutoCancelled="auto_cancelled",m.PostOnlyRejected="post_only_rejected",m.FokUnfilled="fok_unfilled",m.IocNoFill="ioc_no_fill",m.IocExpired="ioc_expired",m.StpCancelled="stp_cancelled",m.ZeroQuantity="zero_quantity",m.DuplicateOrder="duplicate_order",m.OrderNotFound="order_not_found",m.ReduceOnlyInvalid="reduce_only_invalid",m.ReduceOnlyExpired="reduce_only_expired",m.OrderExpired="order_expired",m.Untriggered="untriggered",m.Armed="armed",m.Triggered="triggered",m.ParentCancelled="parent_cancelled",m.PositionClosed="position_closed",m.PositionFlipped="position_flipped",m.ReduceOnlyInvalidAtTrigger="reduce_only_invalid_at_trigger",m.Expired="expired",m))(me||{}),ce=z.object({kind:re,scope:ne,trp:La,parent_oid:b.optional(),armed_qty:La.optional(),slip_bps:z.number().int().nonnegative().optional()}).transform(e=>({kind:e.kind,scope:e.scope,triggerPrice:e.trp,parentOrderId:e.parent_oid,armedQuantity:e.armed_qty,slippageBps:e.slip_bps})),de=z.enum(me),ue=z.enum(["ok","err"]),Xe=z.string().min(1).optional().transform(B),cr=z.discriminatedUnion("status",[z.object({status:z.literal("ok")}),z.object({status:z.literal("err"),error:Xe})]),dr=z.object({status:ue,oid:b.optional(),coid:A.optional(),error:z.string().optional()}).transform((e,l)=>e.status==="err"?{status:"err",error:B(e.error),clientOrderId:e.coid}:e.oid===void 0?(l.addIssue({code:"custom",message:"Expected Perps place order acknowledgement order id."}),z.NEVER):{status:"ok",orderId:e.oid,clientOrderId:e.coid}),ur=z.object({status:ue,oid:b.optional(),coid:A.optional(),error:z.string().optional()}).transform(e=>e.status==="err"?{status:"err",error:B(e.error),orderId:e.oid,clientOrderId:e.coid}:{status:"ok",orderId:e.oid,clientOrderId:e.coid}),lr=z.object({status:z.literal("ok")}),yr=z.object({status:z.literal("ok"),instrument_id:a,leverage:z.number().int().positive(),cross:z.boolean()}).transform(e=>({status:e.status,instrumentId:e.instrument_id,leverage:e.leverage,crossMargin:e.cross}));function B(e){return e??"Perps command was rejected."}var le=z.object({order_id:b,instrument_id:a,buy:z.boolean(),price:La,quantity:La,tif:O,post_only:z.boolean(),ro:z.boolean(),status:de,resting_quantity:La,filled_quantity:La,created_timestamp:ba,updated_timestamp:ba,client_order_id:z.string().optional(),tpsl:ce.nullish()}).transform(e=>({id:e.order_id,instrumentId:e.instrument_id,side:e.buy?"BUY":"SELL",price:e.price,quantity:e.quantity,timeInForce:e.tif,postOnly:e.post_only,reduceOnly:e.ro,status:e.status,restingQuantity:e.resting_quantity,filledQuantity:e.filled_quantity,createdTimestamp:e.created_timestamp,updatedTimestamp:e.updated_timestamp,clientOrderId:e.client_order_id,tpSl:e.tpsl??void 0})),hr=z.array(le),Pr=z.array(le),_r=z.object({oid:b,iid:a,buy:z.boolean(),p:La,qty:La,tif:O,po:z.boolean(),ro:z.boolean(),status:de,rest:La,fill:La,cts:ba,uts:ba,coid:z.string().optional(),tpsl:ce.nullish()}).transform(e=>({id:e.oid,instrumentId:e.iid,side:e.buy?"BUY":"SELL",price:e.p,quantity:e.qty,timeInForce:e.tif,postOnly:e.po,reduceOnly:e.ro,status:e.status,restingQuantity:e.rest,filledQuantity:e.fill,createdTimestamp:e.cts,updatedTimestamp:e.uts,clientOrderId:e.coid,tpSl:e.tpsl??void 0})),Je=z.object({trade_id:k,order_id:b,instrument_id:a,side:_,price:La,quantity:La,taker:z.boolean(),fee:La,fee_asset:u,previous_size:La,previous_entry_price:La,pnl:La,liquidation:z.boolean(),timestamp:ba,hash:x}).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})),fr=y(Je),xr=z.object({tid:k,oid:b,iid:a,side:_,p:La,qty:La,taker:z.boolean(),fee:La,fea:u,psz:La,pep:La,pnl:La,liq:z.boolean(),ts:ba,coid:z.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{Ie as $,rr as $a,re as A,Ht as Aa,ne as B,wt as Ba,L as C,Qt as Ca,N as D,Vt as Da,ie as E,Ce as Ea,tt as F,$t as Fa,rt as G,Gt as Ga,nt as H,Ee as Ha,u as I,Yt as Ia,x as J,Oe as Ja,y as K,Le as Ka,it as L,Ne as La,ot as M,Zt as Ma,st as N,Xt as Na,Pe as O,oe as Oa,dt as P,De as Pa,_e as Q,se as Qa,ut as R,ae as Ra,fe as S,pe as Sa,lt as T,Be as Ta,Se as U,Me as Ua,yt as V,Ue as Va,ge as W,We as Wa,ht as X,Qe as Xa,Pt as Y,Ve as Ya,be as Z,$e as Za,_t as _,Ge as _a,a,ft as aa,nr as ab,b,ve as ba,ir as bb,A as c,xt as ca,me as cb,v as d,ke as da,ce as db,k as e,St as ea,de as eb,F as f,gt as fa,ue as fb,W as g,bt as ga,cr as gb,H as h,Te as ha,dr as hb,w as i,Tt as ia,ur as ib,ye as j,zt as ja,lr as jb,Q as k,ze as ka,yr as kb,V as l,Rt as la,le as lb,$ as m,Ft as ma,hr as mb,G as n,jt as na,Pr as nb,Y as o,At as oa,_r as ob,Z as p,Nt as pa,Je as pb,X as q,Fe as qa,fr as qb,he as r,Dt as ra,xr as rb,J as s,je as sa,K as t,Bt as ta,ee as u,Mt as ua,te as v,D as va,C as w,Ae as wa,E as x,Ut as xa,_ as y,Wt as ya,O as z,j as za};//# sourceMappingURL=chunk-BVFKAX4O.js.map
2
- //# sourceMappingURL=chunk-BVFKAX4O.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/perps/common.ts","../src/perps/account.ts","../src/perps/funds.ts","../src/perps/market.ts","../src/perps/notifications.ts","../src/perps/orders.ts"],"names":["taggedInteger","value","PerpsInstrumentIdSchema","z","PerpsOrderIdSchema","PerpsClientOrderIdSchema","PerpsNotificationIdSchema","PerpsTradeIdSchema","PerpsWithdrawalIdSchema","PerpsInternalTransferIdSchema","PerpsEntityIdSchema","PerpsFundingIntervalSchema","PerpsDecimalInputSchema","DecimalishSchema","PerpsInstrumentType","PerpsInstrumentCategory","PerpsSide","PerpsTimeInForce","PerpsTpSlKind","PerpsTpSlScope","PerpsDepositStatus","PerpsKnownWithdrawalStatus","PerpsInternalTransferDirection","PerpsKlineInterval","PerpsPnlInterval","PerpsSortDirection","PerpsInstrumentTypeSchema","PerpsInstrumentCategorySchema","PerpsSideSchema","PerpsTimeInForceSchema","PerpsTpSlKindSchema","PerpsTpSlScopeSchema","PerpsDepositStatusSchema","PerpsWithdrawalStatusSchema","PerpsInternalTransferDirectionSchema","PerpsKlineIntervalSchema","PerpsPnlIntervalSchema","PerpsSortDirectionSchema","PerpsAssetSchema","PerpsTxHashSchema","hash","TxHashSchema","PerpsDataResponseSchema","itemSchema","perpsDecimal","perpsBaseUnits","BaseUnitsSchema","decimalString","toDecimalString","PerpsBalanceSchema","DecimalStringSchema","FetchPerpsBalancesResponseSchema","PerpsAccountStatsSchema","stats","FetchPerpsAccountStatsResponseSchema","PerpsPortfolioPositionSchema","position","PerpsMarginSummarySchema","RawPerpsMarginSummarySchema","margin","PerpsPortfolioSchema","EpochMillisecondsSchema","portfolio","FetchPerpsPortfolioResponseSchema","PerpsAccountFundingPaymentSchema","funding","ListPerpsFundingPaymentsResponseSchema","PerpsAccountFundingPaymentEntrySchema","PerpsAccountConfigSchema","config","FetchPerpsAccountConfigResponseSchema","PerpsEquityPointSchema","timestamp","equity","ListPerpsEquityHistoryResponseSchema","PerpsPnlPointSchema","pnl","ListPerpsPnlHistoryResponseSchema","RawPerpsProxyExpirySchema","PerpsProxyKeySchema","EvmAddressSchema","key","PerpsCredentialsResponseSchema","credentials","PerpsCreateProxyResponseSchema","PerpsDeleteProxyResponseSchema","PerpsDepositSchema","deposit","ListPerpsDepositsResponseSchema","PerpsDepositUpdateSchema","PerpsWithdrawalSchema","withdrawal","ListPerpsWithdrawalsResponseSchema","PerpsWithdrawResponseSchema","response","PerpsWithdrawalUpdateSchema","PerpsInternalTransferSchema","PerpsRiskTierSchema","RawPerpsRiskTierSchema","tier","PerpsInstrumentSchema","instrument","FetchPerpsInstrumentsResponseSchema","PerpsTickerSchema","ticker","FetchPerpsTickersResponseSchema","PerpsTickerEntrySchema","PerpsCandleSchema","open","high","low","close","volume","trades","PerpsStatisticSchema","statistic","FetchPerpsStatisticsResponseSchema","PerpsStatisticUpdateSchema","PerpsBookLevelSchema","price","quantity","PerpsBookSchema","book","PerpsBookUpdateSchema","PerpsBboSchema","PerpsBboUpdateSchema","bbo","PerpsPublicTradeSchema","trade","PerpsPublicTradeUpdateSchema","FetchPerpsTradesResponseSchema","PerpsFundingRateSchema","FetchPerpsFundingHistoryResponseSchema","PerpsFeeTierSchema","PerpsFeeScheduleEntrySchema","fee","PerpsFeesInfoSchema","fees","FetchPerpsFeesResponseSchema","FetchPerpsCandlesResponseSchema","PerpsNotificationType","PerpsNotificationTypeSchema","PerpsNotificationOrderType","PerpsNotificationOrderTypeSchema","PerpsMarginType","PerpsMarginTypeSchema","PerpsPositionChangeNotificationSchema","notification","PerpsPositionClosedNotificationSchema","PerpsLimitOrderCanceledNotificationSchema","PerpsIsolatedLiquidationWarningNotificationSchema","PerpsCrossLiquidationWarningNotificationSchema","PerpsLiquidationWarningNotificationSchema","PerpsPositionLiquidatedNotificationSchema","PerpsNotificationSchema","PerpsNotificationEntrySchema","entry","PerpsNotificationEntryTypeProbeSchema","PerpsNotificationEntriesSchema","items","ctx","entries","item","index","issue","ListPerpsNotificationsResponseSchema","FetchPerpsUnreadNotificationsCountResponseSchema","MarkPerpsNotificationsReadResponseSchema","PerpsOrderStatus","PerpsTpSlOrderFieldsSchema","fields","PerpsOrderStatusSchema","PerpsCommandStatusSchema","PerpsAckErrorSchema","perpsAckError","PerpsCommandAckSchema","PerpsPostOrderAckSchema","ack","PerpsCancelOrderResultSchema","PerpsCancelAllOrdersResponseSchema","PerpsUpdateLeverageResultSchema","result","error","PerpsOrderSchema","order","FetchPerpsOrdersResponseSchema","FetchPerpsOpenOrdersResponseSchema","PerpsOrderUpdateSchema","PerpsAccountFillSchema","fill","ListPerpsFillsResponseSchema","PerpsAccountFillUpdateSchema"],"mappings":"0EAoDA,SAASA,EAAgCC,CAAAA,CAAkB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\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInstrumentId = Tagged<number, 'PerpsInstrumentId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsOrderId = Tagged<number, 'PerpsOrderId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsNotificationId = Tagged<string, 'PerpsNotificationId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawalId = Tagged<number, 'PerpsWithdrawalId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInternalTransferId = Tagged<number, 'PerpsInternalTransferId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsEntityId = Tagged<number, 'PerpsEntityId'>;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFundingInterval = `${number}h`;\n\nfunction taggedInteger<T extends number>(value: number): T {\n return value as T;\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInstrumentId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsOrderId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsClientOrderIdSchema = z\n .string()\n .regex(/^[0-9a-f]{32}$/)\n .transform((value) => value as PerpsClientOrderId);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationIdSchema = z\n .uuid()\n .transform((value) => value as PerpsNotificationId);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTradeIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsTradeId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsWithdrawalId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInternalTransferIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInternalTransferId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsEntityIdSchema = z\n .number()\n .int()\n .positive()\n .transform(taggedInteger<PerpsEntityId>);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFundingIntervalSchema = z\n .string()\n .regex(/^[1-9]\\d*h$/)\n .transform((value) => value as PerpsFundingInterval);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDecimalInputSchema = DecimalishSchema;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDecimalInput = z.input<typeof PerpsDecimalInputSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsInstrumentType {\n Perpetual = 'perpetual',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsInstrumentCategory {\n Equity = 'equity',\n Commodity = 'commodity',\n Index = 'index',\n Crypto = 'crypto',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsSide {\n Long = 'long',\n Short = 'short',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTimeInForce {\n GTC = 'gtc',\n IOC = 'ioc',\n FOK = 'fok',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTpSlKind {\n TakeProfit = 'tp',\n StopLoss = 'sl',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTpSlScope {\n Order = 'order',\n Position = 'position',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsDepositStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n}\n\n/**\n * Known withdrawal statuses.\n *\n * The service evolves this set independently of released clients, so\n * withdrawal parsing accepts unknown statuses as plain strings; see\n * {@link PerpsWithdrawalStatus}.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsKnownWithdrawalStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n Failed = 'failed',\n}\n\n/**\n * A withdrawal status. Known statuses are enumerated in\n * {@link PerpsKnownWithdrawalStatus}; newly introduced statuses flow through\n * as plain strings so they can be handled before a client release that\n * enumerates them.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawalStatus = PerpsKnownWithdrawalStatus | (string & {});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsInternalTransferDirection {\n In = 'in',\n Out = 'out',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsPnlInterval {\n OneHour = '1h',\n FourHours = '4h',\n OneDay = '1d',\n OneWeek = '1w',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsSortDirection {\n Descending = 'desc',\n Ascending = 'asc',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentTypeSchema = z.enum(PerpsInstrumentType);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentCategorySchema = z.enum(PerpsInstrumentCategory);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsSideSchema = z.enum(PerpsSide);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTimeInForceSchema = z.enum(PerpsTimeInForce);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTpSlKindSchema = z.enum(PerpsTpSlKind);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTpSlScopeSchema = z.enum(PerpsTpSlScope);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDepositStatusSchema = z.enum(PerpsDepositStatus);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalStatusSchema = z\n .string()\n .transform((value): PerpsWithdrawalStatus => value);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInternalTransferDirectionSchema = z.enum(\n PerpsInternalTransferDirection,\n);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsKlineIntervalSchema = z.enum(PerpsKlineInterval);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPnlIntervalSchema = z.enum(PerpsPnlInterval);\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsSortDirectionSchema = z.enum(PerpsSortDirection);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAssetSchema = z.string().min(1);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTxHashSchema = z.preprocess(\n (hash) => (hash === '0x' || hash === '' ? undefined : hash),\n TxHashSchema.optional(),\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDataResponseSchema = <T extends z.ZodType>(itemSchema: T) =>\n z.object({\n data: z.array(itemSchema),\n more: z.boolean(),\n });\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCredentials = {\n proxy: EvmAddress;\n privateKey: PrivateKey;\n secret: string;\n expiresAt: number;\n};\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDepositAmount = BaseUnits;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawalAmount = BaseUnits;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTxHash = TxHash;\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDecimal = DecimalString;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport function perpsDecimal(value: string | number): DecimalString {\n return PerpsDecimalInputSchema.parse(value);\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport function perpsBaseUnits(value: string): BaseUnits {\n return BaseUnitsSchema.parse(value);\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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 PerpsEntityIdSchema,\n PerpsInstrumentIdSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBalanceSchema = z.object({\n asset: PerpsAssetSchema,\n balance: DecimalStringSchema,\n value: DecimalStringSchema,\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBalance = z.infer<typeof PerpsBalanceSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsBalancesResponseSchema = z.array(PerpsBalanceSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountStatsSchema = z\n .object({\n volume_7d: DecimalStringSchema,\n taker_volume_7d: DecimalStringSchema,\n maker_volume_7d: DecimalStringSchema,\n account_maker_share_7d: DecimalStringSchema,\n entity_maker_share_7d: DecimalStringSchema.optional(),\n entity_id: PerpsEntityIdSchema.optional(),\n entity_name: z.string().min(1).optional(),\n })\n .transform((stats) => ({\n volume7d: stats.volume_7d,\n takerVolume7d: stats.taker_volume_7d,\n makerVolume7d: stats.maker_volume_7d,\n accountMakerShare7d: stats.account_maker_share_7d,\n entityMakerShare7d: stats.entity_maker_share_7d,\n entityId: stats.entity_id,\n entityName: stats.entity_name,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountStats = z.infer<typeof PerpsAccountStatsSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsAccountStatsResponseSchema = PerpsAccountStatsSchema;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPortfolioPositionSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPortfolioPosition = z.infer<\n typeof PerpsPortfolioPositionSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsMarginSummarySchema = z.object({\n totalAccountValue: DecimalStringSchema,\n totalInitialMargin: DecimalStringSchema,\n totalMaintenanceMargin: DecimalStringSchema,\n totalPositionValue: DecimalStringSchema,\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPortfolioSchema = z\n .object({\n positions: z.array(PerpsPortfolioPositionSchema),\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPortfolio = z.infer<typeof PerpsPortfolioSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsPortfolioResponseSchema = PerpsPortfolioSchema;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFundingPaymentSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountFundingPayment = z.infer<\n typeof PerpsAccountFundingPaymentSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsFundingPaymentsResponseSchema = PerpsDataResponseSchema(\n PerpsAccountFundingPaymentSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFundingPaymentEntrySchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountConfigSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountConfig = z.infer<typeof PerpsAccountConfigSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsAccountConfigResponseSchema = z.array(\n PerpsAccountConfigSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsEquityPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, equity]) => ({ timestamp, equity }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsEquityPoint = z.infer<typeof PerpsEquityPointSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsEquityHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsEquityPointSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPnlPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, pnl]) => ({ timestamp, pnl }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPnlPoint = z.infer<typeof PerpsPnlPointSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsProxyKeySchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsProxyKey = z.infer<typeof PerpsProxyKeySchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCredentialsResponseSchema = z\n .object({\n address: EvmAddressSchema,\n keys: z.array(PerpsProxyKeySchema),\n })\n .transform((credentials) => ({\n address: credentials.address,\n keys: credentials.keys,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCreateProxyResponseSchema = z.object({\n secret: z.string().min(1),\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDeleteProxyResponseSchema = 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 PerpsTxHashSchema,\n PerpsWithdrawalIdSchema,\n PerpsWithdrawalStatusSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDepositSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsDeposit = z.infer<typeof PerpsDepositSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsDepositsResponseSchema =\n PerpsDataResponseSchema(PerpsDepositSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsDepositUpdateSchema = z\n .object({\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalSchema = z\n .object({\n withdraw_id: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsWithdrawal = z.infer<typeof PerpsWithdrawalSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsWithdrawalsResponseSchema = PerpsDataResponseSchema(\n PerpsWithdrawalSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawResponseSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsWithdrawalUpdateSchema = z\n .object({\n withdraw_id: PerpsWithdrawalIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n fee: DecimalStringSchema,\n status: PerpsWithdrawalStatusSchema,\n to: EvmAddressSchema,\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInternalTransfer = z.infer<typeof PerpsInternalTransferSchema>;\n","import { z } from 'zod';\nimport {\n type DecimalString,\n DecimalStringSchema,\n EpochMillisecondsSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsDataResponseSchema,\n PerpsFundingIntervalSchema,\n PerpsInstrumentCategorySchema,\n PerpsInstrumentIdSchema,\n PerpsInstrumentTypeSchema,\n PerpsSideSchema,\n PerpsTradeIdSchema,\n PerpsTxHashSchema,\n} from './common';\n\nexport {\n type PerpsFundingInterval,\n PerpsFundingIntervalSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsRiskTier = z.infer<typeof PerpsRiskTierSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsInstrumentSchema = 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: PerpsFundingIntervalSchema,\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 isolated_only: z.boolean(),\n risk_tiers: z.array(RawPerpsRiskTierSchema),\n })\n .transform((instrument) => ({\n id: instrument.instrument_id,\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 isolatedOnly: instrument.isolated_only,\n riskTiers: instrument.risk_tiers,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsInstrument = z.infer<typeof PerpsInstrumentSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsInstrumentsResponseSchema = z.array(\n PerpsInstrumentSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTickerSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTicker = z.infer<typeof PerpsTickerSchema> & {\n openPrice?: DecimalString;\n volume24h?: DecimalString;\n};\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsTickersResponseSchema = z.array(PerpsTickerSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTickerEntrySchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCandle = z.infer<typeof PerpsCandleSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsStatisticSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsStatistic = z.infer<typeof PerpsStatisticSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsStatisticsResponseSchema = z.array(PerpsStatisticSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsStatisticUpdateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBookLevelSchema = z\n .tuple([DecimalStringSchema, DecimalStringSchema])\n .transform(([price, quantity]) => ({ price, quantity }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBookLevel = z.infer<typeof PerpsBookLevelSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBookSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBook = z.infer<typeof PerpsBookSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBookUpdateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsBbo = z.infer<typeof PerpsBboSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsBboUpdateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPublicTradeSchema = 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: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPublicTrade = z.infer<typeof PerpsPublicTradeSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPublicTradeUpdateSchema = z\n .object({\n tid: PerpsTradeIdSchema,\n iid: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n p: DecimalStringSchema,\n qty: DecimalStringSchema,\n ts: EpochMillisecondsSchema,\n hash: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsTradesResponseSchema = PerpsDataResponseSchema(\n PerpsPublicTradeSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFundingRateSchema = 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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFundingRate = z.infer<typeof PerpsFundingRateSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsFundingHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsFundingRateSchema,\n);\n\nexport const PerpsFeeTierSchema = z\n .object({\n min_volume_30d: DecimalStringSchema,\n taker_fee_rate: DecimalStringSchema,\n maker_fee_rate: DecimalStringSchema,\n })\n .transform((tier) => ({\n minVolume30d: tier.min_volume_30d,\n takerFeeRate: tier.taker_fee_rate,\n makerFeeRate: tier.maker_fee_rate,\n }));\n\nexport type PerpsFeeTier = z.infer<typeof PerpsFeeTierSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFeeScheduleEntrySchema = z\n .object({\n instrument_type: PerpsInstrumentTypeSchema,\n category: PerpsInstrumentCategorySchema,\n taker_fee_rate: DecimalStringSchema,\n maker_fee_rate: DecimalStringSchema,\n tiers: z.array(PerpsFeeTierSchema),\n })\n .transform((fee) => ({\n category: fee.category,\n takerFeeRate: fee.taker_fee_rate,\n makerFeeRate: fee.maker_fee_rate,\n tiers: fee.tiers,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFeeScheduleEntry = z.infer<typeof PerpsFeeScheduleEntrySchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsFeesInfoSchema = z\n .object({\n fee_schedule: z.array(PerpsFeeScheduleEntrySchema),\n })\n .transform((fees) => ({\n feeSchedule: fees.fee_schedule,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsFeesInfo = z.infer<typeof PerpsFeesInfoSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsFeesResponseSchema = PerpsFeesInfoSchema;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsCandlesResponseSchema =\n PerpsDataResponseSchema(PerpsCandleSchema);\n","import { z } from 'zod';\nimport { DecimalStringSchema, EpochMillisecondsSchema } from '../shared';\nimport {\n PerpsInstrumentIdSchema,\n PerpsNotificationIdSchema,\n PerpsSideSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsNotificationType {\n PositionOpened = 'position_opened',\n PositionIncreased = 'position_increased',\n PositionReduced = 'position_reduced',\n PositionClosed = 'position_closed',\n LimitOrderCanceled = 'limit_order_canceled',\n LiquidationWarning = 'liquidation_warning',\n PositionLiquidated = 'position_liquidated',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationTypeSchema = z.enum(PerpsNotificationType);\n\n/**\n * Kind of order whose execution produced a fill-driven position notification.\n * A TP/SL-triggered order reports the trigger that fired it whether it\n * aggressed or rested; otherwise an aggressor submitted without a limit price\n * is `market` and everything else, including a maker's resting order, is\n * `limit`.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsNotificationOrderType {\n Market = 'market',\n Limit = 'limit',\n TakeProfit = 'take_profit',\n StopLoss = 'stop_loss',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationOrderTypeSchema = z.enum(\n PerpsNotificationOrderType,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsMarginType {\n Cross = 'cross',\n Isolated = 'isolated',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsMarginTypeSchema = z.enum(PerpsMarginType);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPositionChangeNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.enum([\n PerpsNotificationType.PositionOpened,\n PerpsNotificationType.PositionIncreased,\n PerpsNotificationType.PositionReduced,\n ]),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size: DecimalStringSchema,\n avg_price: DecimalStringSchema,\n leverage: z.number().int().positive(),\n order_type: PerpsNotificationOrderTypeSchema.optional(),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n size: notification.size,\n avgPrice: notification.avg_price,\n leverage: notification.leverage,\n orderType: notification.order_type,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPositionChangeNotification = z.infer<\n typeof PerpsPositionChangeNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPositionClosedNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.PositionClosed),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size: DecimalStringSchema,\n avg_price: DecimalStringSchema,\n pnl: DecimalStringSchema,\n order_type: PerpsNotificationOrderTypeSchema.optional(),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n size: notification.size,\n avgPrice: notification.avg_price,\n pnl: notification.pnl,\n orderType: notification.order_type,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPositionClosedNotification = z.infer<\n typeof PerpsPositionClosedNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsLimitOrderCanceledNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.LimitOrderCanceled),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size: DecimalStringSchema,\n price: DecimalStringSchema,\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n size: notification.size,\n price: notification.price,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsLimitOrderCanceledNotification = z.infer<\n typeof PerpsLimitOrderCanceledNotificationSchema\n>;\n\nconst PerpsIsolatedLiquidationWarningNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.LiquidationWarning),\n margin_type: z.literal(PerpsMarginType.Isolated),\n instrument_id: PerpsInstrumentIdSchema,\n mark_price: DecimalStringSchema,\n liq_price: DecimalStringSchema,\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n marginType: notification.margin_type,\n instrumentId: notification.instrument_id,\n markPrice: notification.mark_price,\n liquidationPrice: notification.liq_price,\n }));\n\nconst PerpsCrossLiquidationWarningNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.LiquidationWarning),\n margin_type: z.literal(PerpsMarginType.Cross),\n instrument_id: z.null(),\n mark_price: DecimalStringSchema,\n affected_instruments: z.array(PerpsInstrumentIdSchema),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n marginType: notification.margin_type,\n markPrice: notification.mark_price,\n affectedInstruments: notification.affected_instruments,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsLiquidationWarningNotificationSchema = z.discriminatedUnion(\n 'margin_type',\n [\n PerpsIsolatedLiquidationWarningNotificationSchema,\n PerpsCrossLiquidationWarningNotificationSchema,\n ],\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsLiquidationWarningNotification = z.infer<\n typeof PerpsLiquidationWarningNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPositionLiquidatedNotificationSchema = z\n .object({\n id: PerpsNotificationIdSchema,\n type: z.literal(PerpsNotificationType.PositionLiquidated),\n instrument_id: PerpsInstrumentIdSchema,\n side: PerpsSideSchema,\n size_closed: DecimalStringSchema,\n pnl: DecimalStringSchema.nullable(),\n margin_type: PerpsMarginTypeSchema,\n via_backstop: z.boolean(),\n })\n .transform((notification) => ({\n id: notification.id,\n type: notification.type,\n instrumentId: notification.instrument_id,\n side: notification.side,\n sizeClosed: notification.size_closed,\n pnl: notification.pnl,\n marginType: notification.margin_type,\n viaBackstop: notification.via_backstop,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPositionLiquidatedNotification = z.infer<\n typeof PerpsPositionLiquidatedNotificationSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationSchema = z.discriminatedUnion('type', [\n PerpsPositionChangeNotificationSchema,\n PerpsPositionClosedNotificationSchema,\n PerpsLimitOrderCanceledNotificationSchema,\n PerpsLiquidationWarningNotificationSchema,\n PerpsPositionLiquidatedNotificationSchema,\n]);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsNotification = z.infer<typeof PerpsNotificationSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsNotificationEntrySchema = z\n .object({\n notification: PerpsNotificationSchema,\n read_at: EpochMillisecondsSchema.nullable(),\n ts: EpochMillisecondsSchema,\n })\n .transform((entry) => ({\n notification: entry.notification,\n readAt: entry.read_at,\n timestamp: entry.ts,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsNotificationEntry = z.infer<\n typeof PerpsNotificationEntrySchema\n>;\n\n// Probes only the discriminator so list entries carrying notification types\n// unknown to this SDK version can be skipped without failing the page read.\nconst PerpsNotificationEntryTypeProbeSchema = z.object({\n notification: z.object({ type: PerpsNotificationTypeSchema }),\n});\n\nconst PerpsNotificationEntriesSchema = z\n .array(z.unknown())\n .transform((items, ctx) => {\n const entries: PerpsNotificationEntry[] = [];\n items.forEach((item, index) => {\n if (!PerpsNotificationEntryTypeProbeSchema.safeParse(item).success) {\n return;\n }\n const entry = PerpsNotificationEntrySchema.safeParse(item);\n if (entry.success) {\n entries.push(entry.data);\n return;\n }\n for (const issue of entry.error.issues) {\n ctx.addIssue({ ...issue, path: [index, ...issue.path] });\n }\n });\n return entries;\n });\n\n/**\n * Entries with notification types unknown to this SDK version are omitted\n * from `items` so newly introduced notification kinds cannot fail the read;\n * recognized types still validate strictly.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsNotificationsResponseSchema = z.object({\n items: PerpsNotificationEntriesSchema,\n unread: z.number().int().nonnegative(),\n durable_source_seq: z.number().int().nonnegative(),\n has_more: z.boolean(),\n next_cursor: z.string().nullable(),\n});\n\n/**\n * Projection of the notifications list response for unread-count reads.\n * Deliberately leaves `items` unvalidated so notification shapes unknown to\n * this SDK version cannot fail a read that only needs the counter.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsUnreadNotificationsCountResponseSchema = z.object({\n unread: z.number().int().nonnegative(),\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const MarkPerpsNotificationsReadResponseSchema = z.object({\n status: z.enum(['ok', 'err']),\n error: z.string().optional(),\n});\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n OrderSide,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsClientOrderIdSchema,\n PerpsDataResponseSchema,\n PerpsInstrumentIdSchema,\n PerpsOrderIdSchema,\n PerpsSideSchema,\n PerpsTimeInForceSchema,\n PerpsTpSlKindSchema,\n PerpsTpSlScopeSchema,\n PerpsTradeIdSchema,\n PerpsTxHashSchema,\n} from './common';\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsOrderStatus {\n Accepted = 'accepted',\n Open = 'open',\n Partial = 'partial',\n Filled = 'filled',\n Cancelled = 'cancelled',\n AutoCancelled = 'auto_cancelled',\n PostOnlyRejected = 'post_only_rejected',\n FokUnfilled = 'fok_unfilled',\n IocNoFill = 'ioc_no_fill',\n IocExpired = 'ioc_expired',\n StpCancelled = 'stp_cancelled',\n ZeroQuantity = 'zero_quantity',\n DuplicateOrder = 'duplicate_order',\n OrderNotFound = 'order_not_found',\n ReduceOnlyInvalid = 'reduce_only_invalid',\n ReduceOnlyExpired = 'reduce_only_expired',\n OrderExpired = 'order_expired',\n Untriggered = 'untriggered',\n Armed = 'armed',\n Triggered = 'triggered',\n ParentCancelled = 'parent_cancelled',\n PositionClosed = 'position_closed',\n PositionFlipped = 'position_flipped',\n ReduceOnlyInvalidAtTrigger = 'reduce_only_invalid_at_trigger',\n Expired = 'expired',\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsTpSlOrderFieldsSchema = z\n .object({\n kind: PerpsTpSlKindSchema,\n scope: PerpsTpSlScopeSchema,\n trp: DecimalStringSchema,\n parent_oid: PerpsOrderIdSchema.optional(),\n armed_qty: DecimalStringSchema.optional(),\n slip_bps: z.number().int().nonnegative().optional(),\n })\n .transform((fields) => ({\n kind: fields.kind,\n scope: fields.scope,\n triggerPrice: fields.trp,\n parentOrderId: fields.parent_oid,\n armedQuantity: fields.armed_qty,\n slippageBps: fields.slip_bps,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTpSlOrderFields = z.infer<typeof PerpsTpSlOrderFieldsSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderStatusSchema = z.enum(PerpsOrderStatus);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCommandStatusSchema = z.enum(['ok', 'err']);\n\nconst PerpsAckErrorSchema = z\n .string()\n .min(1)\n .optional()\n .transform(perpsAckError);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCommandAckSchema = z.discriminatedUnion('status', [\n z.object({ status: z.literal('ok') }),\n z.object({\n status: z.literal('err'),\n error: PerpsAckErrorSchema,\n }),\n]);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCommandAck = z.infer<typeof PerpsCommandAckSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsPostOrderAckSchema = z\n .object({\n status: PerpsCommandStatusSchema,\n oid: PerpsOrderIdSchema.optional(),\n coid: PerpsClientOrderIdSchema.optional(),\n error: z.string().optional(),\n })\n .transform((ack, ctx) => {\n if (ack.status === 'err') {\n return {\n status: 'err' as const,\n error: perpsAckError(ack.error),\n clientOrderId: ack.coid,\n };\n }\n\n if (ack.oid === undefined) {\n ctx.addIssue({\n code: 'custom',\n message: 'Expected Perps place order acknowledgement order id.',\n });\n return z.NEVER;\n }\n\n return {\n status: 'ok' as const,\n orderId: ack.oid,\n clientOrderId: ack.coid,\n };\n });\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCancelOrderResultSchema = z\n .object({\n status: PerpsCommandStatusSchema,\n oid: PerpsOrderIdSchema.optional(),\n coid: PerpsClientOrderIdSchema.optional(),\n error: z.string().optional(),\n })\n .transform((ack) => {\n if (ack.status === 'err') {\n return {\n status: 'err' as const,\n error: perpsAckError(ack.error),\n orderId: ack.oid,\n clientOrderId: ack.coid,\n };\n }\n\n return {\n status: 'ok' as const,\n orderId: ack.oid,\n clientOrderId: ack.coid,\n };\n });\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCancelOrderResult = z.infer<\n typeof PerpsCancelOrderResultSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsCancelAllOrdersResponseSchema = z.object({\n status: z.literal('ok'),\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsCancelAllOrdersResponse = z.infer<\n typeof PerpsCancelAllOrdersResponseSchema\n>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsUpdateLeverageResultSchema = z\n .object({\n status: z.literal('ok'),\n instrument_id: PerpsInstrumentIdSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n })\n .transform((result) => ({\n status: result.status,\n instrumentId: result.instrument_id,\n leverage: result.leverage,\n crossMargin: result.cross,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsUpdateLeverageResult = z.infer<\n typeof PerpsUpdateLeverageResultSchema\n>;\n\nfunction perpsAckError(error: string | undefined): string {\n return error ?? 'Perps command was rejected.';\n}\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderSchema = 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 ro: z.boolean(),\n status: PerpsOrderStatusSchema,\n resting_quantity: DecimalStringSchema,\n filled_quantity: DecimalStringSchema,\n created_timestamp: EpochMillisecondsSchema,\n updated_timestamp: EpochMillisecondsSchema,\n client_order_id: z.string().optional(),\n tpsl: PerpsTpSlOrderFieldsSchema.nullish(),\n })\n .transform((order) => ({\n id: order.order_id,\n instrumentId: order.instrument_id,\n side: order.buy ? OrderSide.BUY : OrderSide.SELL,\n price: order.price,\n quantity: order.quantity,\n timeInForce: order.tif,\n postOnly: order.post_only,\n reduceOnly: order.ro,\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 tpSl: order.tpsl ?? undefined,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsOrder = z.infer<typeof PerpsOrderSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsOrdersResponseSchema = z.array(PerpsOrderSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsOpenOrdersResponseSchema = z.array(PerpsOrderSchema);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsOrderUpdateSchema = 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 ro: z.boolean(),\n status: PerpsOrderStatusSchema,\n rest: DecimalStringSchema,\n fill: DecimalStringSchema,\n cts: EpochMillisecondsSchema,\n uts: EpochMillisecondsSchema,\n coid: z.string().optional(),\n tpsl: PerpsTpSlOrderFieldsSchema.nullish(),\n })\n .transform((order) => ({\n id: order.oid,\n instrumentId: order.iid,\n side: order.buy ? OrderSide.BUY : OrderSide.SELL,\n price: order.p,\n quantity: order.qty,\n timeInForce: order.tif,\n postOnly: order.po,\n reduceOnly: order.ro,\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 tpSl: order.tpsl ?? undefined,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFillSchema = 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: PerpsTxHashSchema,\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\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAccountFill = z.infer<typeof PerpsAccountFillSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const ListPerpsFillsResponseSchema = PerpsDataResponseSchema(\n PerpsAccountFillSchema,\n);\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAccountFillUpdateSchema = 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"]}