@polymarket/bindings 0.1.0-beta.8 → 0.1.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-PJWPI2GS.js → chunk-GYP7YNXL.js} +2 -2
- package/dist/{chunk-PJWPI2GS.js.map → chunk-GYP7YNXL.js.map} +1 -1
- package/dist/{chunk-WZTOZWYR.js → chunk-KYFSCD3H.js} +2 -2
- package/dist/chunk-KYFSCD3H.js.map +1 -0
- package/dist/chunk-VBHCYSM7.js +2 -0
- package/dist/chunk-VBHCYSM7.js.map +1 -0
- package/dist/clob/index.d.ts +6 -6
- package/dist/clob/index.js +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +1 -1
- package/dist/gamma/index.d.ts +23 -23
- package/dist/gamma/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{orders-ByouGgI5.d.ts → orders-B7JX0nMz.d.ts} +23 -6
- package/dist/perps/index.d.ts +2 -2
- package/dist/perps/index.js +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/rfq.d.ts +1 -1
- package/dist/rfq.js +1 -1
- package/dist/subscriptions/index.d.ts +7 -7
- package/dist/subscriptions/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-SB2LAVJ4.js +0 -2
- package/dist/chunk-SB2LAVJ4.js.map +0 -1
- package/dist/chunk-WZTOZWYR.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Ga,Ha,aa,$ as $$1,La,Ja,P}from'./chunk-SB2LAVJ4.js';import {z as z$1}from'zod';function I(e){return e}var p=z$1.number().int().nonnegative().transform(I),g=z$1.number().int().nonnegative().transform(I),F=z$1.string().regex(/^[0-9a-f]{32}$/).transform(e=>e),S=z$1.number().int().nonnegative().transform(I),T=z$1.number().int().nonnegative().transform(I),B=z$1.number().int().nonnegative().transform(I),M=z$1.string().regex(/^[1-9]\d*h$/).transform(e=>e),te=Ja,U=(l=>(l.Perpetual="perpetual",l))(U||{}),H=(h=>(h.Equity="equity",h.Commodity="commodity",h.Index="index",h.Crypto="crypto",h))(H||{}),L=(_=>(_.Long="long",_.Short="short",_))(L||{}),w=(c=>(c.GTC="gtc",c.IOC="ioc",c.FOK="fok",c))(w||{}),W=(c=>(c.Pending="pending",c.Confirmed="confirmed",c.Removed="removed",c))(W||{}),N=(c=>(c.Pending="pending",c.Confirmed="confirmed",c.Removed="removed",c))(N||{}),Q=(_=>(_.In="in",_.Out="out",_))(Q||{}),V=(P=>(P.OneSecond="1s",P.OneMinute="1m",P.FiveMinutes="5m",P.FifteenMinutes="15m",P.OneHour="1h",P.FourHours="4h",P.OneDay="1d",P.OneWeek="1w",P))(V||{}),$=(h=>(h.OneHour="1h",h.FourHours="4h",h.OneDay="1d",h.OneWeek="1w",h))($||{}),z=z$1.enum(U),R=z$1.enum(H),b=z$1.enum(L),A=z$1.enum(w),j=z$1.enum(W),k=z$1.enum(N),G=z$1.enum(Q),qe=z$1.enum(V),Fe=z$1.enum($),m=z$1.string().min(1),f=z$1.preprocess(e=>e==="0x"||e===""?void 0:e,Ga.optional()),d=e=>z$1.object({data:z$1.array(e),more:z$1.boolean()});function ze(e){return te.parse(e)}function Re(e){return La.parse(e)}function Ae(e){return P(e)}var re=z$1.object({asset:m,balance:Ha,value:Ha}),De=z$1.array(re),ne=z$1.object({instrument_id:p,symbol:z$1.string().min(1),size:Ha,entry_price:Ha,leverage:z$1.number().int().positive(),cross:z$1.boolean(),initial_margin:Ha,maintenance_margin:Ha,position_value:Ha,liquidation_price:Ha,unrealized_pnl:Ha,return_on_equity:Ha,cumulative_funding:Ha}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,size:e.size,entryPrice:e.entry_price,leverage:e.leverage,cross:e.cross,initialMargin:e.initial_margin,maintenanceMargin:e.maintenance_margin,positionValue:e.position_value,liquidationPrice:e.liquidation_price,unrealizedPnl:e.unrealized_pnl,returnOnEquity:e.return_on_equity,cumulativeFunding:e.cumulative_funding})),Oe=z$1.object({totalAccountValue:Ha,totalInitialMargin:Ha,totalMaintenanceMargin:Ha,totalPositionValue:Ha}),oe=z$1.object({total_account_value:Ha,total_initial_margin:Ha,total_maintenance_margin:Ha,total_position_value:Ha}).transform(e=>({totalAccountValue:e.total_account_value,totalInitialMargin:e.total_initial_margin,totalMaintenanceMargin:e.total_maintenance_margin,totalPositionValue:e.total_position_value})),se=z$1.object({positions:z$1.array(ne),margin:oe,withdrawable:Ha,in_liquidation:z$1.boolean(),timestamp:aa}).transform(e=>({positions:e.positions,margin:e.margin,withdrawable:e.withdrawable,inLiquidation:e.in_liquidation,timestamp:e.timestamp})),Be=se,ae=z$1.object({instrument_id:p,size:Ha,funding_rate:Ha,funding_asset:m,funding:Ha,timestamp:aa}).transform(e=>({instrumentId:e.instrument_id,size:e.size,fundingRate:e.funding_rate,fundingAsset:e.funding_asset,funding:e.funding,timestamp:e.timestamp})),Me=d(ae),Ue=z$1.object({iid:p,sz:Ha,fr:Ha,fund:Ha,fua:m,ts:aa}).transform(e=>({instrumentId:e.iid,size:e.sz,fundingRate:e.fr,fundingAsset:e.fua,funding:e.fund,timestamp:e.ts})),ie=z$1.object({instrument_id:p,leverage:z$1.number().int().positive(),cross:z$1.boolean()}).transform(e=>({instrumentId:e.instrument_id,leverage:e.leverage,cross:e.cross})),He=z$1.array(ie),pe=z$1.tuple([aa,Ha]).transform(([e,l])=>({timestamp:e,equity:l})),Le=d(pe),me=z$1.tuple([aa,Ha]).transform(([e,l])=>({timestamp:e,pnl:l})),we=d(me),ce=z$1.number().finite().positive().refine(e=>Number.isInteger(e),"Expected integer").transform(e=>e>Number.MAX_SAFE_INTEGER?Math.floor(e/1e6):e).pipe(aa),de=z$1.object({proxy:$$1,label:z$1.string().optional(),expiry:ce}).transform(e=>({proxy:e.proxy,label:e.label,expiresAt:e.expiry})),We=z$1.object({address:$$1,keys:z$1.array(de)}).transform(e=>({address:e.address,keys:e.keys})),Ne=z$1.object({secret:z$1.string().min(1)}),Qe=z$1.object({status:z$1.enum(["ok","err"]),error:z$1.string().optional()});var ue=z$1.object({hash:Ga,asset:m,amount:La,status:j,from:$$1,to:$$1,confirmations:z$1.number().int().nonnegative(),required_confirmations:z$1.number().int().nonnegative(),created_timestamp:aa,confirmed_timestamp:aa.optional()}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status,from:e.from,to:e.to,confirmations:e.confirmations,requiredConfirmations:e.required_confirmations,createdTimestamp:e.created_timestamp,confirmedTimestamp:e.confirmed_timestamp})),Xe=d(ue),Je=z$1.object({hash:f,asset:m,amount:La,status:j}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status})),le=z$1.object({withdraw_id:T,asset:m,amount:La,fee:Ha,status:k,to:$$1,hash:f,confirmations:z$1.number().int().nonnegative(),required_confirmations:z$1.number().int().nonnegative(),created_timestamp:aa,confirmed_timestamp:aa.optional()}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash,confirmations:e.confirmations,requiredConfirmations:e.required_confirmations,createdTimestamp:e.created_timestamp,confirmedTimestamp:e.confirmed_timestamp})),Ke=d(le),Ye=z$1.object({status:z$1.enum(["ok","err"]),withdraw_id:T.optional(),error:z$1.string().optional()}).transform(e=>({status:e.status,withdrawalId:e.withdraw_id,error:e.error})),et=z$1.object({withdraw_id:T,asset:m,amount:La,fee:Ha,status:k,to:$$1,hash:f}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash})),tt=z$1.object({transferId:B,asset:m,amount:La,direction:G,counterparty:$$1,label:z$1.string().optional(),createdTimestamp:aa});var at=z$1.object({lowerBound:Ha,maxLeverage:z$1.number().int().positive()}),he=z$1.object({lower_bound:Ha,max_leverage:z$1.number().int().positive()}).transform(e=>({lowerBound:e.lower_bound,maxLeverage:e.max_leverage})),ye=z$1.object({instrument_id:p,instrument_type:z,category:R,symbol:z$1.string().min(1),base_asset:m,quote_asset:m,funding_interval:M,quantity_decimals:z$1.number().int().nonnegative(),price_decimals:z$1.number().int().nonnegative(),price_bounds:Ha,liquidation_fee:Ha,max_order_count:z$1.number().int().positive(),min_notional:Ha,max_market_notional:Ha,max_limit_notional:Ha,max_leverage:z$1.number().int().positive(),risk_tiers:z$1.array(he)}).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,riskTiers:e.risk_tiers})),it=z$1.array(ye),fe=z$1.object({instrument_id:p,symbol:z$1.string().min(1),index_price:Ha,mark_price:Ha,last_price:Ha,mid_price:Ha,open_interest:Ha,funding_rate:Ha,next_funding:aa,timestamp:aa.optional()}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,indexPrice:e.index_price,markPrice:e.mark_price,lastPrice:e.last_price,midPrice:e.mid_price,openInterest:e.open_interest,fundingRate:e.funding_rate,nextFunding:e.next_funding,timestamp:e.timestamp})),pt=z$1.array(fe),mt=z$1.object({iid:p,idx:Ha,mark:Ha,last:Ha,mid:Ha,oi:Ha,fr:Ha,nxf:aa}).transform(e=>({instrumentId:e.iid,indexPrice:e.idx,markPrice:e.mark,lastPrice:e.last,midPrice:e.mid,openInterest:e.oi,fundingRate:e.fr,nextFunding:e.nxf})),C=z$1.tuple([aa,Ha,Ha,Ha,Ha,Ha,z$1.number().int().nonnegative()]).transform(([e,l,_,c,h,Y,ee])=>({timestamp:e,open:l,high:_,low:c,close:h,volume:Y,trades:ee})),Pe=z$1.object({instrument_id:p,symbol:z$1.string().min(1).optional(),volume:Ha,open_price:Ha,klines:z$1.array(C)}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,volume:e.volume,openPrice:e.open_price,klines:e.klines})),ct=z$1.array(Pe),dt=z$1.object({iid:p,vol:Ha,open:Ha,klines:z$1.array(C)}).transform(e=>({instrumentId:e.iid,volume:e.vol,openPrice:e.open,klines:e.klines})),q=z$1.tuple([Ha,Ha]).transform(([e,l])=>({price:e,quantity:l})),ut=z$1.object({instrument_id:p,bids:z$1.array(q),asks:z$1.array(q),timestamp:aa,sequence:z$1.number().int().nonnegative()}).transform(e=>({instrumentId:e.instrument_id,bids:e.bids,asks:e.asks,timestamp:e.timestamp,sequence:e.sequence})),lt=z$1.object({b:z$1.array(q),a:z$1.array(q)}).transform(e=>({bids:e.b,asks:e.a})),ht=z$1.object({instrumentId:p,bidPrice:Ha,bidQuantity:Ha,askPrice:Ha,askQuantity:Ha,timestamp:aa.optional()}),yt=z$1.object({iid:p,bp:Ha,bq:Ha,ap:Ha,aq:Ha}).transform(e=>({instrumentId:e.iid,bidPrice:e.bp,bidQuantity:e.bq,askPrice:e.ap,askQuantity:e.aq})),xe=z$1.object({trade_id:S,instrument_id:p,side:b,price:Ha,quantity:Ha,timestamp:aa,hash:f}).transform(e=>({tradeId:e.trade_id,instrumentId:e.instrument_id,side:e.side,price:e.price,quantity:e.quantity,timestamp:e.timestamp,hash:e.hash})),ft=z$1.object({tid:S,iid:p,side:b,p:Ha,qty:Ha,ts:aa,hash:f}).transform(e=>({tradeId:e.tid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,timestamp:e.ts,hash:e.hash})),Pt=d(xe),_e=z$1.object({funding_rate:Ha,timestamp:aa}).transform(e=>({fundingRate:e.funding_rate,timestamp:e.timestamp})),xt=d(_e),ge=z$1.object({instrument_type:z,category:R,taker_fee_rate:Ha,maker_fee_rate:Ha}).transform(e=>({category:e.category,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate})),Se=z$1.object({fee_schedule:z$1.array(ge)}).transform(e=>({feeSchedule:e.fee_schedule})),_t=Se,gt=d(C);var Z=(a=>(a.Accepted="accepted",a.Open="open",a.Partial="partial",a.Filled="filled",a.Cancelled="cancelled",a.AutoCancelled="auto_cancelled",a.PostOnlyRejected="post_only_rejected",a.FokUnfilled="fok_unfilled",a.IocNoFill="ioc_no_fill",a.IocExpired="ioc_expired",a.StpCancelled="stp_cancelled",a.ZeroQuantity="zero_quantity",a.DuplicateOrder="duplicate_order",a.OrderNotFound="order_not_found",a.ReduceOnlyInvalid="reduce_only_invalid",a.ReduceOnlyExpired="reduce_only_expired",a.OrderExpired="order_expired",a.Untriggered="untriggered",a.Armed="armed",a.Triggered="triggered",a.ParentCancelled="parent_cancelled",a.PositionClosed="position_closed",a.PositionFlipped="position_flipped",a.ReduceOnlyInvalidAtTrigger="reduce_only_invalid_at_trigger",a.Expired="expired",a))(Z||{}),X=z$1.enum(Z),J=z$1.enum(["ok","err"]),be=z$1.string().min(1).optional().transform(E),Tt=z$1.discriminatedUnion("status",[z$1.object({status:z$1.literal("ok")}),z$1.object({status:z$1.literal("err"),error:be})]),qt=z$1.object({status:J,oid:g.optional(),coid:F.optional(),error:z$1.string().optional()}).transform((e,l)=>e.status==="err"?{status:"err",error:E(e.error),clientOrderId:e.coid}:e.oid===void 0?(l.addIssue({code:"custom",message:"Expected Perps place order acknowledgement order id."}),z$1.NEVER):{status:"ok",orderId:e.oid,clientOrderId:e.coid}),Ft=z$1.object({status:J,oid:g.optional(),coid:F.optional(),error:z$1.string().optional()}).transform(e=>e.status==="err"?{status:"err",error:E(e.error),orderId:e.oid,clientOrderId:e.coid}:{status:"ok",orderId:e.oid,clientOrderId:e.coid});function E(e){return e??"Perps command was rejected."}var K=z$1.object({order_id:g,instrument_id:p,buy:z$1.boolean(),price:Ha,quantity:Ha,tif:A,post_only:z$1.boolean(),status:X,resting_quantity:Ha,filled_quantity:Ha,created_timestamp:aa,updated_timestamp:aa,client_order_id:z$1.string().optional()}).transform(e=>({id:e.order_id,instrumentId:e.instrument_id,buy:e.buy,price:e.price,quantity:e.quantity,timeInForce:e.tif,postOnly:e.post_only,status:e.status,restingQuantity:e.resting_quantity,filledQuantity:e.filled_quantity,createdTimestamp:e.created_timestamp,updatedTimestamp:e.updated_timestamp,clientOrderId:e.client_order_id})),zt=z$1.array(K),Rt=z$1.array(K),At=z$1.object({oid:g,iid:p,buy:z$1.boolean(),p:Ha,qty:Ha,tif:A,po:z$1.boolean(),status:X,rest:Ha,fill:Ha,cts:aa,uts:aa,coid:z$1.string().optional()}).transform(e=>({id:e.oid,instrumentId:e.iid,buy:e.buy,price:e.p,quantity:e.qty,timeInForce:e.tif,postOnly:e.po,status:e.status,restingQuantity:e.rest,filledQuantity:e.fill,createdTimestamp:e.cts,updatedTimestamp:e.uts,clientOrderId:e.coid})),Ie=z$1.object({trade_id:S,order_id:g,instrument_id:p,side:b,price:Ha,quantity:Ha,taker:z$1.boolean(),fee:Ha,fee_asset:m,previous_size:Ha,previous_entry_price:Ha,pnl:Ha,liquidation:z$1.boolean(),timestamp:aa,hash:f}).transform(e=>({tradeId:e.trade_id,orderId:e.order_id,instrumentId:e.instrument_id,side:e.side,price:e.price,quantity:e.quantity,taker:e.taker,fee:e.fee,feeAsset:e.fee_asset,previousSize:e.previous_size,previousEntryPrice:e.previous_entry_price,pnl:e.pnl,liquidation:e.liquidation,timestamp:e.timestamp,hash:e.hash})),jt=d(Ie),kt=z$1.object({tid:S,oid:g,iid:p,side:b,p:Ha,qty:Ha,taker:z$1.boolean(),fee:Ha,fea:m,psz:Ha,pep:Ha,pnl:Ha,liq:z$1.boolean(),ts:aa,coid:z$1.string().optional()}).transform(e=>({tradeId:e.tid,orderId:e.oid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,taker:e.taker,fee:e.fee,feeAsset:e.fea,previousSize:e.psz,previousEntryPrice:e.pep,pnl:e.pnl,liquidation:e.liq,timestamp:e.ts,clientOrderId:e.coid}));export{Je as $,m as A,Se as Aa,f as B,_t as Ba,d as C,gt as Ca,ze as D,Z as Da,Re as E,X as Ea,Ae as F,J as Fa,re as G,Tt as Ga,De as H,qt as Ha,ne as I,Ft as Ia,Oe as J,K as Ja,se as K,zt as Ka,Be as L,Rt as La,ae as M,At as Ma,Me as N,Ie as Na,Ue as O,jt as Oa,ie as P,kt as Pa,He as Q,pe as R,Le as S,me as T,we as U,de as V,We as W,Ne as X,Qe as Y,ue as Z,Xe as _,p as a,le as aa,g as b,Ke as ba,F as c,Ye as ca,S as d,et as da,T as e,tt as ea,B as f,at as fa,M as g,ye as ga,te as h,it as ha,U as i,fe as ia,H as j,pt as ja,L as k,mt as ka,w as l,C as la,W as m,Pe as ma,N as n,ct as na,Q as o,dt as oa,V as p,q as pa,$ as q,ut as qa,z as r,lt as ra,R as s,ht as sa,b as t,yt as ta,A as u,xe as ua,j as v,ft as va,k as w,Pt as wa,G as x,_e as xa,qe as y,xt as ya,Fe as z,ge as za};//# sourceMappingURL=chunk-WZTOZWYR.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {Ga,Ha,aa,$ as $$1,La,Ja,P}from'./chunk-VBHCYSM7.js';import {z as z$1}from'zod';function I(e){return e}var i=z$1.number().int().nonnegative().transform(I),g=z$1.number().int().nonnegative().transform(I),R=z$1.string().regex(/^[0-9a-f]{32}$/).transform(e=>e),S=z$1.number().int().nonnegative().transform(I),T=z$1.number().int().nonnegative().transform(I),B=z$1.number().int().nonnegative().transform(I),M=z$1.string().regex(/^[1-9]\d*h$/).transform(e=>e),te=Ja,U=(l=>(l.Perpetual="perpetual",l))(U||{}),L=(h=>(h.Equity="equity",h.Commodity="commodity",h.Index="index",h.Crypto="crypto",h))(L||{}),H=(_=>(_.Long="long",_.Short="short",_))(H||{}),w=(c=>(c.GTC="gtc",c.IOC="ioc",c.FOK="fok",c))(w||{}),W=(c=>(c.Pending="pending",c.Confirmed="confirmed",c.Removed="removed",c))(W||{}),N=(c=>(c.Pending="pending",c.Confirmed="confirmed",c.Removed="removed",c))(N||{}),Q=(_=>(_.In="in",_.Out="out",_))(Q||{}),V=(P=>(P.OneSecond="1s",P.OneMinute="1m",P.FiveMinutes="5m",P.FifteenMinutes="15m",P.OneHour="1h",P.FourHours="4h",P.OneDay="1d",P.OneWeek="1w",P))(V||{}),$=(h=>(h.OneHour="1h",h.FourHours="4h",h.OneDay="1d",h.OneWeek="1w",h))($||{}),F=z$1.enum(U),z=z$1.enum(L),b=z$1.enum(H),j=z$1.enum(w),A=z$1.enum(W),k=z$1.enum(N),G=z$1.enum(Q),qe=z$1.enum(V),Re=z$1.enum($),m=z$1.string().min(1),f=z$1.preprocess(e=>e==="0x"||e===""?void 0:e,Ga.optional()),d=e=>z$1.object({data:z$1.array(e),more:z$1.boolean()});function Fe(e){return te.parse(e)}function ze(e){return La.parse(e)}function je(e){return P(e)}var re=z$1.object({asset:m,balance:Ha,value:Ha}),De=z$1.array(re),ne=z$1.object({instrument_id:i,symbol:z$1.string().min(1),size:Ha,entry_price:Ha,leverage:z$1.number().int().positive(),cross:z$1.boolean(),initial_margin:Ha,maintenance_margin:Ha,position_value:Ha,liquidation_price:Ha,unrealized_pnl:Ha,return_on_equity:Ha,cumulative_funding:Ha}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,size:e.size,entryPrice:e.entry_price,leverage:e.leverage,cross:e.cross,initialMargin:e.initial_margin,maintenanceMargin:e.maintenance_margin,positionValue:e.position_value,liquidationPrice:e.liquidation_price,unrealizedPnl:e.unrealized_pnl,returnOnEquity:e.return_on_equity,cumulativeFunding:e.cumulative_funding})),Oe=z$1.object({totalAccountValue:Ha,totalInitialMargin:Ha,totalMaintenanceMargin:Ha,totalPositionValue:Ha}),se=z$1.object({total_account_value:Ha,total_initial_margin:Ha,total_maintenance_margin:Ha,total_position_value:Ha}).transform(e=>({totalAccountValue:e.total_account_value,totalInitialMargin:e.total_initial_margin,totalMaintenanceMargin:e.total_maintenance_margin,totalPositionValue:e.total_position_value})),oe=z$1.object({positions:z$1.array(ne),margin:se,withdrawable:Ha,in_liquidation:z$1.boolean(),timestamp:aa}).transform(e=>({positions:e.positions,margin:e.margin,withdrawable:e.withdrawable,inLiquidation:e.in_liquidation,timestamp:e.timestamp})),Be=oe,ae=z$1.object({instrument_id:i,size:Ha,funding_rate:Ha,funding_asset:m,funding:Ha,timestamp:aa}).transform(e=>({instrumentId:e.instrument_id,size:e.size,fundingRate:e.funding_rate,fundingAsset:e.funding_asset,funding:e.funding,timestamp:e.timestamp})),Me=d(ae),Ue=z$1.object({iid:i,sz:Ha,fr:Ha,fund:Ha,fua:m,ts:aa}).transform(e=>({instrumentId:e.iid,size:e.sz,fundingRate:e.fr,fundingAsset:e.fua,funding:e.fund,timestamp:e.ts})),ie=z$1.object({instrument_id:i,leverage:z$1.number().int().positive(),cross:z$1.boolean()}).transform(e=>({instrumentId:e.instrument_id,leverage:e.leverage,cross:e.cross})),Le=z$1.array(ie),pe=z$1.tuple([aa,Ha]).transform(([e,l])=>({timestamp:e,equity:l})),He=d(pe),me=z$1.tuple([aa,Ha]).transform(([e,l])=>({timestamp:e,pnl:l})),we=d(me),ce=z$1.number().finite().positive().refine(e=>Number.isInteger(e),"Expected integer").transform(e=>e>Number.MAX_SAFE_INTEGER?Math.floor(e/1e6):e).pipe(aa),de=z$1.object({proxy:$$1,label:z$1.string().optional(),expiry:ce}).transform(e=>({proxy:e.proxy,label:e.label,expiresAt:e.expiry})),We=z$1.object({address:$$1,keys:z$1.array(de)}).transform(e=>({address:e.address,keys:e.keys})),Ne=z$1.object({secret:z$1.string().min(1)}),Qe=z$1.object({status:z$1.enum(["ok","err"]),error:z$1.string().optional()});var ue=z$1.object({hash:Ga,asset:m,amount:La,status:A,from:$$1,to:$$1,confirmations:z$1.number().int().nonnegative(),required_confirmations:z$1.number().int().nonnegative(),created_timestamp:aa,confirmed_timestamp:aa.optional()}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status,from:e.from,to:e.to,confirmations:e.confirmations,requiredConfirmations:e.required_confirmations,createdTimestamp:e.created_timestamp,confirmedTimestamp:e.confirmed_timestamp})),Ze=d(ue),Xe=z$1.object({hash:f,asset:m,amount:La,status:A}).transform(e=>({hash:e.hash,asset:e.asset,amount:e.amount,status:e.status})),le=z$1.object({withdraw_id:T,asset:m,amount:La,fee:Ha,status:k,to:$$1,hash:f,confirmations:z$1.number().int().nonnegative(),required_confirmations:z$1.number().int().nonnegative(),created_timestamp:aa,confirmed_timestamp:aa.optional()}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash,confirmations:e.confirmations,requiredConfirmations:e.required_confirmations,createdTimestamp:e.created_timestamp,confirmedTimestamp:e.confirmed_timestamp})),Je=d(le),Ke=z$1.object({status:z$1.enum(["ok","err"]),withdraw_id:T.optional(),error:z$1.string().optional()}).transform(e=>({status:e.status,withdrawalId:e.withdraw_id,error:e.error})),et=z$1.object({withdraw_id:T,asset:m,amount:La,fee:Ha,status:k,to:$$1,hash:f}).transform(e=>({withdrawalId:e.withdraw_id,asset:e.asset,amount:e.amount,fee:e.fee,status:e.status,to:e.to,hash:e.hash})),tt=z$1.object({transferId:B,asset:m,amount:La,direction:G,counterparty:$$1,label:z$1.string().optional(),createdTimestamp:aa});var at=z$1.object({lowerBound:Ha,maxLeverage:z$1.number().int().positive()}),he=z$1.object({lower_bound:Ha,max_leverage:z$1.number().int().positive()}).transform(e=>({lowerBound:e.lower_bound,maxLeverage:e.max_leverage})),ye=z$1.object({instrument_id:i,instrument_type:F,category:z,symbol:z$1.string().min(1),base_asset:m,quote_asset:m,funding_interval:M,quantity_decimals:z$1.number().int().nonnegative(),price_decimals:z$1.number().int().nonnegative(),price_bounds:Ha,liquidation_fee:Ha,max_order_count:z$1.number().int().positive(),min_notional:Ha,max_market_notional:Ha,max_limit_notional:Ha,max_leverage:z$1.number().int().positive(),risk_tiers:z$1.array(he)}).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,riskTiers:e.risk_tiers})),it=z$1.array(ye),fe=z$1.object({instrument_id:i,symbol:z$1.string().min(1),index_price:Ha,mark_price:Ha,last_price:Ha,mid_price:Ha,open_interest:Ha,funding_rate:Ha,next_funding:aa,timestamp:aa.optional()}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,indexPrice:e.index_price,markPrice:e.mark_price,lastPrice:e.last_price,midPrice:e.mid_price,openInterest:e.open_interest,fundingRate:e.funding_rate,nextFunding:e.next_funding,timestamp:e.timestamp})),pt=z$1.array(fe),mt=z$1.object({iid:i,idx:Ha,mark:Ha,last:Ha,mid:Ha,oi:Ha,fr:Ha,nxf:aa}).transform(e=>({instrumentId:e.iid,indexPrice:e.idx,markPrice:e.mark,lastPrice:e.last,midPrice:e.mid,openInterest:e.oi,fundingRate:e.fr,nextFunding:e.nxf})),E=z$1.tuple([aa,Ha,Ha,Ha,Ha,Ha,z$1.number().int().nonnegative()]).transform(([e,l,_,c,h,K,ee])=>({timestamp:e,open:l,high:_,low:c,close:h,volume:K,trades:ee})),Pe=z$1.object({instrument_id:i,symbol:z$1.string().min(1).optional(),volume:Ha,open_price:Ha,klines:z$1.array(E)}).transform(e=>({instrumentId:e.instrument_id,symbol:e.symbol,volume:e.volume,openPrice:e.open_price,klines:e.klines})),ct=z$1.array(Pe),dt=z$1.object({iid:i,vol:Ha,open:Ha,klines:z$1.array(E)}).transform(e=>({instrumentId:e.iid,volume:e.vol,openPrice:e.open,klines:e.klines})),q=z$1.tuple([Ha,Ha]).transform(([e,l])=>({price:e,quantity:l})),ut=z$1.object({instrument_id:i,bids:z$1.array(q),asks:z$1.array(q),timestamp:aa,sequence:z$1.number().int().nonnegative()}).transform(e=>({instrumentId:e.instrument_id,bids:e.bids,asks:e.asks,timestamp:e.timestamp,sequence:e.sequence})),lt=z$1.object({b:z$1.array(q),a:z$1.array(q)}).transform(e=>({bids:e.b,asks:e.a})),ht=z$1.object({instrumentId:i,bidPrice:Ha,bidQuantity:Ha,askPrice:Ha,askQuantity:Ha,timestamp:aa.optional()}),yt=z$1.object({iid:i,bp:Ha,bq:Ha,ap:Ha,aq:Ha}).transform(e=>({instrumentId:e.iid,bidPrice:e.bp,bidQuantity:e.bq,askPrice:e.ap,askQuantity:e.aq})),xe=z$1.object({trade_id:S,instrument_id:i,side:b,price:Ha,quantity:Ha,timestamp:aa,hash:f}).transform(e=>({tradeId:e.trade_id,instrumentId:e.instrument_id,side:e.side,price:e.price,quantity:e.quantity,timestamp:e.timestamp,hash:e.hash})),ft=z$1.object({tid:S,iid:i,side:b,p:Ha,qty:Ha,ts:aa,hash:f}).transform(e=>({tradeId:e.tid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,timestamp:e.ts,hash:e.hash})),Pt=d(xe),_e=z$1.object({funding_rate:Ha,timestamp:aa}).transform(e=>({fundingRate:e.funding_rate,timestamp:e.timestamp})),xt=d(_e),ge=z$1.object({instrument_type:F,category:z,taker_fee_rate:Ha,maker_fee_rate:Ha}).transform(e=>({category:e.category,takerFeeRate:e.taker_fee_rate,makerFeeRate:e.maker_fee_rate})),Se=z$1.object({fee_schedule:z$1.array(ge)}).transform(e=>({feeSchedule:e.fee_schedule})),_t=Se,gt=d(E);var Y=(a=>(a.Accepted="accepted",a.Open="open",a.Partial="partial",a.Filled="filled",a.Cancelled="cancelled",a.AutoCancelled="auto_cancelled",a.PostOnlyRejected="post_only_rejected",a.FokUnfilled="fok_unfilled",a.IocNoFill="ioc_no_fill",a.IocExpired="ioc_expired",a.StpCancelled="stp_cancelled",a.ZeroQuantity="zero_quantity",a.DuplicateOrder="duplicate_order",a.OrderNotFound="order_not_found",a.ReduceOnlyInvalid="reduce_only_invalid",a.ReduceOnlyExpired="reduce_only_expired",a.OrderExpired="order_expired",a.Untriggered="untriggered",a.Armed="armed",a.Triggered="triggered",a.ParentCancelled="parent_cancelled",a.PositionClosed="position_closed",a.PositionFlipped="position_flipped",a.ReduceOnlyInvalidAtTrigger="reduce_only_invalid_at_trigger",a.Expired="expired",a))(Y||{}),Z=z$1.enum(Y),X=z$1.enum(["ok","err"]),be=z$1.string().min(1).optional().transform(C),qt=z$1.discriminatedUnion("status",[z$1.object({status:z$1.literal("ok")}),z$1.object({status:z$1.literal("err"),error:be})]),Rt=z$1.object({status:X,oid:g.optional(),coid:R.optional(),error:z$1.string().optional()}).transform((e,l)=>e.status==="err"?{status:"err",error:C(e.error),clientOrderId:e.coid}:e.oid===void 0?(l.addIssue({code:"custom",message:"Expected Perps place order acknowledgement order id."}),z$1.NEVER):{status:"ok",orderId:e.oid,clientOrderId:e.coid}),Ft=z$1.object({status:X,oid:g.optional(),coid:R.optional(),error:z$1.string().optional()}).transform(e=>e.status==="err"?{status:"err",error:C(e.error),orderId:e.oid,clientOrderId:e.coid}:{status:"ok",orderId:e.oid,clientOrderId:e.coid}),zt=z$1.object({status:z$1.literal("ok"),instrument_id:i,leverage:z$1.number().int().positive(),cross:z$1.boolean()}).transform(e=>({status:e.status,instrumentId:e.instrument_id,leverage:e.leverage,crossMargin:e.cross}));function C(e){return e??"Perps command was rejected."}var J=z$1.object({order_id:g,instrument_id:i,buy:z$1.boolean(),price:Ha,quantity:Ha,tif:j,post_only:z$1.boolean(),status:Z,resting_quantity:Ha,filled_quantity:Ha,created_timestamp:aa,updated_timestamp:aa,client_order_id:z$1.string().optional()}).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,status:e.status,restingQuantity:e.resting_quantity,filledQuantity:e.filled_quantity,createdTimestamp:e.created_timestamp,updatedTimestamp:e.updated_timestamp,clientOrderId:e.client_order_id})),jt=z$1.array(J),At=z$1.array(J),kt=z$1.object({oid:g,iid:i,buy:z$1.boolean(),p:Ha,qty:Ha,tif:j,po:z$1.boolean(),status:Z,rest:Ha,fill:Ha,cts:aa,uts:aa,coid:z$1.string().optional()}).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,status:e.status,restingQuantity:e.rest,filledQuantity:e.fill,createdTimestamp:e.cts,updatedTimestamp:e.uts,clientOrderId:e.coid})),Ie=z$1.object({trade_id:S,order_id:g,instrument_id:i,side:b,price:Ha,quantity:Ha,taker:z$1.boolean(),fee:Ha,fee_asset:m,previous_size:Ha,previous_entry_price:Ha,pnl:Ha,liquidation:z$1.boolean(),timestamp:aa,hash:f}).transform(e=>({tradeId:e.trade_id,orderId:e.order_id,instrumentId:e.instrument_id,side:e.side,price:e.price,quantity:e.quantity,taker:e.taker,fee:e.fee,feeAsset:e.fee_asset,previousSize:e.previous_size,previousEntryPrice:e.previous_entry_price,pnl:e.pnl,liquidation:e.liquidation,timestamp:e.timestamp,hash:e.hash})),Et=d(Ie),Ct=z$1.object({tid:S,oid:g,iid:i,side:b,p:Ha,qty:Ha,taker:z$1.boolean(),fee:Ha,fea:m,psz:Ha,pep:Ha,pnl:Ha,liq:z$1.boolean(),ts:aa,coid:z$1.string().optional()}).transform(e=>({tradeId:e.tid,orderId:e.oid,instrumentId:e.iid,side:e.side,price:e.p,quantity:e.qty,taker:e.taker,fee:e.fee,feeAsset:e.fea,previousSize:e.psz,previousEntryPrice:e.pep,pnl:e.pnl,liquidation:e.liq,timestamp:e.ts,clientOrderId:e.coid}));export{Xe as $,m as A,Se as Aa,f as B,_t as Ba,d as C,gt as Ca,Fe as D,Y as Da,ze as E,Z as Ea,je as F,X as Fa,re as G,qt as Ga,De as H,Rt as Ha,ne as I,Ft as Ia,Oe as J,zt as Ja,oe as K,J as Ka,Be as L,jt as La,ae as M,At as Ma,Me as N,kt as Na,Ue as O,Ie as Oa,ie as P,Et as Pa,Le as Q,Ct as Qa,pe as R,He as S,me as T,we as U,de as V,We as W,Ne as X,Qe as Y,ue as Z,Ze as _,i as a,le as aa,g as b,Je as ba,R as c,Ke as ca,S as d,et as da,T as e,tt as ea,B as f,at as fa,M as g,ye as ga,te as h,it as ha,U as i,fe as ia,L as j,pt as ja,H as k,mt as ka,w as l,E as la,W as m,Pe as ma,N as n,ct as na,Q as o,dt as oa,V as p,q as pa,$ as q,ut as qa,F as r,lt as ra,z as s,ht as sa,b as t,yt as ta,j as u,xe as ua,A as v,ft as va,k as w,Pt as wa,G as x,_e as xa,qe as y,xt as ya,Re as z,ge as za};//# sourceMappingURL=chunk-KYFSCD3H.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-KYFSCD3H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/perps/common.ts","../src/perps/account.ts","../src/perps/funds.ts","../src/perps/market.ts","../src/perps/orders.ts"],"names":["taggedInteger","value","PerpsInstrumentIdSchema","z","PerpsOrderIdSchema","PerpsClientOrderIdSchema","PerpsTradeIdSchema","PerpsWithdrawalIdSchema","PerpsInternalTransferIdSchema","PerpsFundingIntervalSchema","PerpsDecimalInputSchema","DecimalishSchema","PerpsInstrumentType","PerpsInstrumentCategory","PerpsSide","PerpsTimeInForce","PerpsDepositStatus","PerpsWithdrawalStatus","PerpsInternalTransferDirection","PerpsKlineInterval","PerpsPnlInterval","PerpsInstrumentTypeSchema","PerpsInstrumentCategorySchema","PerpsSideSchema","PerpsTimeInForceSchema","PerpsDepositStatusSchema","PerpsWithdrawalStatusSchema","PerpsInternalTransferDirectionSchema","PerpsKlineIntervalSchema","PerpsPnlIntervalSchema","PerpsAssetSchema","PerpsTxHashSchema","hash","TxHashSchema","PerpsDataResponseSchema","itemSchema","perpsDecimal","perpsBaseUnits","BaseUnitsSchema","decimalString","toDecimalString","PerpsBalanceSchema","DecimalStringSchema","FetchPerpsBalancesResponseSchema","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","PerpsFeeScheduleEntrySchema","fee","PerpsFeesInfoSchema","fees","FetchPerpsFeesResponseSchema","FetchPerpsCandlesResponseSchema","PerpsOrderStatus","PerpsOrderStatusSchema","PerpsCommandStatusSchema","PerpsAckErrorSchema","perpsAckError","PerpsCommandAckSchema","PerpsPostOrderAckSchema","ack","ctx","PerpsCancelOrderResultSchema","PerpsUpdateLeverageResultSchema","result","error","PerpsOrderSchema","order","FetchPerpsOrdersResponseSchema","FetchPerpsOpenOrdersResponseSchema","PerpsOrderUpdateSchema","PerpsAccountFillSchema","fill","ListPerpsFillsResponseSchema","PerpsAccountFillUpdateSchema"],"mappings":"uFAuBA,SAASA,EAAgCC,CAAAA,CAAkB,CACzD,OAAOA,CACT,CAEO,IAAMC,CAAAA,CAA0BC,GAAAA,CACpC,MAAA,GACA,GAAA,EAAI,CACJ,WAAA,EAAY,CACZ,UAAUH,CAAgC,CAAA,CAEhCI,CAAAA,CAAqBD,GAAAA,CAC/B,QAAO,CACP,GAAA,EAAI,CACJ,WAAA,GACA,SAAA,CAAUH,CAA2B,CAAA,CAE3BK,CAAAA,CAA2BF,IACrC,MAAA,EAAO,CACP,KAAA,CAAM,gBAAgB,EACtB,SAAA,CAAWF,CAAAA,EAAUA,CAA2B,CAAA,CAEtCK,EAAqBH,GAAAA,CAC/B,MAAA,EAAO,CACP,GAAA,GACA,WAAA,EAAY,CACZ,SAAA,CAAUH,CAA2B,EAE3BO,CAAAA,CAA0BJ,GAAAA,CACpC,MAAA,EAAO,CACP,KAAI,CACJ,WAAA,EAAY,CACZ,SAAA,CAAUH,CAAgC,CAAA,CAEhCQ,CAAAA,CAAgCL,GAAAA,CAC1C,MAAA,GACA,GAAA,EAAI,CACJ,WAAA,EAAY,CACZ,UAAUH,CAAsC,CAAA,CAEtCS,CAAAA,CAA6BN,GAAAA,CACvC,QAAO,CACP,KAAA,CAAM,aAAa,CAAA,CACnB,UAAWF,CAAAA,EAAUA,CAA6B,CAAA,CAExCS,EAAAA,CAA0BC,GAG3BC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,SAAA,CAAY,WAAA,CADFA,OAAA,EAAA,CAAA,CAIAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,MAAA,CAAS,SACTA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA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AA,CACL,IAAKA,EAAAA,CACL,GAAA,CAAKA,EAAAA,CACL,GAAA,CAAKvC,IAAE,OAAA,EAAQ,CACf,EAAA,CAAI+C,EAAAA,CACJ,KAAM/C,GAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EACnB,CAAC,CAAA,CACA,SAAA,CAAWgJ,CAAAA,GAAU,CACpB,OAAA,CAASA,CAAAA,CAAK,GAAA,CACd,OAAA,CAASA,EAAK,GAAA,CACd,YAAA,CAAcA,CAAAA,CAAK,GAAA,CACnB,KAAMA,CAAAA,CAAK,IAAA,CACX,KAAA,CAAOA,CAAAA,CAAK,EACZ,QAAA,CAAUA,CAAAA,CAAK,GAAA,CACf,KAAA,CAAOA,EAAK,KAAA,CACZ,GAAA,CAAKA,CAAAA,CAAK,GAAA,CACV,SAAUA,CAAAA,CAAK,GAAA,CACf,YAAA,CAAcA,CAAAA,CAAK,IACnB,kBAAA,CAAoBA,CAAAA,CAAK,GAAA,CACzB,GAAA,CAAKA,EAAK,GAAA,CACV,WAAA,CAAaA,CAAAA,CAAK,GAAA,CAClB,UAAWA,CAAAA,CAAK,EAAA,CAChB,aAAA,CAAeA,CAAAA,CAAK,IACtB,CAAA,CAAE","file":"chunk-KYFSCD3H.js","sourcesContent":["import type { PrivateKey } from '@polymarket/types';\nimport { z } from 'zod';\nimport {\n type BaseUnits,\n BaseUnitsSchema,\n DecimalishSchema,\n type DecimalString,\n type EvmAddress,\n type TxHash,\n TxHashSchema,\n toDecimalString,\n} from '../shared';\n\ntype Tagged<T, Tag extends string> = T & { readonly __tag: Tag };\n\nexport type PerpsInstrumentId = Tagged<number, 'PerpsInstrumentId'>;\nexport type PerpsOrderId = Tagged<number, 'PerpsOrderId'>;\nexport type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;\nexport type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;\nexport type PerpsWithdrawalId = Tagged<number, 'PerpsWithdrawalId'>;\nexport type PerpsInternalTransferId = Tagged<number, 'PerpsInternalTransferId'>;\nexport type PerpsFundingInterval = `${number}h`;\n\nfunction taggedInteger<T extends number>(value: number): T {\n return value as T;\n}\n\nexport const PerpsInstrumentIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInstrumentId>);\n\nexport const PerpsOrderIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsOrderId>);\n\nexport const PerpsClientOrderIdSchema = z\n .string()\n .regex(/^[0-9a-f]{32}$/)\n .transform((value) => value as PerpsClientOrderId);\n\nexport const PerpsTradeIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsTradeId>);\n\nexport const PerpsWithdrawalIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsWithdrawalId>);\n\nexport const PerpsInternalTransferIdSchema = z\n .number()\n .int()\n .nonnegative()\n .transform(taggedInteger<PerpsInternalTransferId>);\n\nexport const PerpsFundingIntervalSchema = z\n .string()\n .regex(/^[1-9]\\d*h$/)\n .transform((value) => value as PerpsFundingInterval);\n\nexport const PerpsDecimalInputSchema = DecimalishSchema;\nexport type PerpsDecimalInput = z.input<typeof PerpsDecimalInputSchema>;\n\nexport enum PerpsInstrumentType {\n Perpetual = 'perpetual',\n}\n\nexport enum PerpsInstrumentCategory {\n Equity = 'equity',\n Commodity = 'commodity',\n Index = 'index',\n Crypto = 'crypto',\n}\n\nexport enum PerpsSide {\n Long = 'long',\n Short = 'short',\n}\n\nexport enum PerpsTimeInForce {\n GTC = 'gtc',\n IOC = 'ioc',\n FOK = 'fok',\n}\n\nexport enum PerpsDepositStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n}\n\nexport enum PerpsWithdrawalStatus {\n Pending = 'pending',\n Confirmed = 'confirmed',\n Removed = 'removed',\n}\n\nexport enum PerpsInternalTransferDirection {\n In = 'in',\n Out = 'out',\n}\n\nexport enum PerpsKlineInterval {\n OneSecond = '1s',\n OneMinute = '1m',\n FiveMinutes = '5m',\n FifteenMinutes = '15m',\n OneHour = '1h',\n FourHours = '4h',\n OneDay = '1d',\n OneWeek = '1w',\n}\n\nexport enum PerpsPnlInterval {\n OneHour = '1h',\n FourHours = '4h',\n OneDay = '1d',\n OneWeek = '1w',\n}\n\nexport const PerpsInstrumentTypeSchema = z.enum(PerpsInstrumentType);\nexport const PerpsInstrumentCategorySchema = z.enum(PerpsInstrumentCategory);\nexport const PerpsSideSchema = z.enum(PerpsSide);\nexport const PerpsTimeInForceSchema = z.enum(PerpsTimeInForce);\nexport const PerpsDepositStatusSchema = z.enum(PerpsDepositStatus);\nexport const PerpsWithdrawalStatusSchema = z.enum(PerpsWithdrawalStatus);\nexport const PerpsInternalTransferDirectionSchema = z.enum(\n PerpsInternalTransferDirection,\n);\nexport const PerpsKlineIntervalSchema = z.enum(PerpsKlineInterval);\nexport const PerpsPnlIntervalSchema = z.enum(PerpsPnlInterval);\n\nexport const PerpsAssetSchema = z.string().min(1);\n\nexport const PerpsTxHashSchema = z.preprocess(\n (hash) => (hash === '0x' || hash === '' ? undefined : hash),\n TxHashSchema.optional(),\n);\n\nexport const PerpsDataResponseSchema = <T extends z.ZodType>(itemSchema: T) =>\n z.object({\n data: z.array(itemSchema),\n more: z.boolean(),\n });\n\nexport type PerpsCredentials = {\n proxy: EvmAddress;\n privateKey: PrivateKey;\n secret: string;\n expiresAt: number;\n};\n\nexport type PerpsDepositAmount = BaseUnits;\nexport type PerpsWithdrawalAmount = BaseUnits;\nexport type PerpsTxHash = TxHash;\nexport type PerpsDecimal = DecimalString;\n\nexport function perpsDecimal(value: string | number): DecimalString {\n return PerpsDecimalInputSchema.parse(value);\n}\n\nexport function perpsBaseUnits(value: string): BaseUnits {\n return BaseUnitsSchema.parse(value);\n}\n\nexport function decimalString(value: string): DecimalString {\n return toDecimalString(value);\n}\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n} from '../shared';\nimport {\n PerpsAssetSchema,\n PerpsDataResponseSchema,\n PerpsInstrumentIdSchema,\n} from './common';\n\nexport const PerpsBalanceSchema = z.object({\n asset: PerpsAssetSchema,\n balance: DecimalStringSchema,\n value: DecimalStringSchema,\n});\n\nexport type PerpsBalance = z.infer<typeof PerpsBalanceSchema>;\n\nexport const FetchPerpsBalancesResponseSchema = z.array(PerpsBalanceSchema);\n\nexport const PerpsPortfolioPositionSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n symbol: z.string().min(1),\n size: DecimalStringSchema,\n entry_price: DecimalStringSchema,\n leverage: z.number().int().positive(),\n cross: z.boolean(),\n initial_margin: DecimalStringSchema,\n maintenance_margin: DecimalStringSchema,\n position_value: DecimalStringSchema,\n liquidation_price: DecimalStringSchema,\n unrealized_pnl: DecimalStringSchema,\n return_on_equity: DecimalStringSchema,\n cumulative_funding: DecimalStringSchema,\n })\n .transform((position) => ({\n instrumentId: position.instrument_id,\n symbol: position.symbol,\n size: position.size,\n entryPrice: position.entry_price,\n leverage: position.leverage,\n cross: position.cross,\n initialMargin: position.initial_margin,\n maintenanceMargin: position.maintenance_margin,\n positionValue: position.position_value,\n liquidationPrice: position.liquidation_price,\n unrealizedPnl: position.unrealized_pnl,\n returnOnEquity: position.return_on_equity,\n cumulativeFunding: position.cumulative_funding,\n }));\n\nexport type PerpsPortfolioPosition = z.infer<\n typeof PerpsPortfolioPositionSchema\n>;\n\nexport const PerpsMarginSummarySchema = z.object({\n totalAccountValue: DecimalStringSchema,\n totalInitialMargin: DecimalStringSchema,\n totalMaintenanceMargin: DecimalStringSchema,\n totalPositionValue: DecimalStringSchema,\n});\n\nexport type PerpsMarginSummary = z.infer<typeof PerpsMarginSummarySchema>;\n\nconst RawPerpsMarginSummarySchema = z\n .object({\n total_account_value: DecimalStringSchema,\n total_initial_margin: DecimalStringSchema,\n total_maintenance_margin: DecimalStringSchema,\n total_position_value: DecimalStringSchema,\n })\n .transform((margin) => ({\n totalAccountValue: margin.total_account_value,\n totalInitialMargin: margin.total_initial_margin,\n totalMaintenanceMargin: margin.total_maintenance_margin,\n totalPositionValue: margin.total_position_value,\n }));\n\nexport const PerpsPortfolioSchema = z\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\nexport type PerpsPortfolio = z.infer<typeof PerpsPortfolioSchema>;\n\nexport const FetchPerpsPortfolioResponseSchema = PerpsPortfolioSchema;\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\nexport type PerpsAccountFundingPayment = z.infer<\n typeof PerpsAccountFundingPaymentSchema\n>;\n\nexport const ListPerpsFundingPaymentsResponseSchema = PerpsDataResponseSchema(\n PerpsAccountFundingPaymentSchema,\n);\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\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\nexport type PerpsAccountConfig = z.infer<typeof PerpsAccountConfigSchema>;\n\nexport const FetchPerpsAccountConfigResponseSchema = z.array(\n PerpsAccountConfigSchema,\n);\n\nexport const PerpsEquityPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, equity]) => ({ timestamp, equity }));\n\nexport type PerpsEquityPoint = z.infer<typeof PerpsEquityPointSchema>;\n\nexport const ListPerpsEquityHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsEquityPointSchema,\n);\n\nexport const PerpsPnlPointSchema = z\n .tuple([EpochMillisecondsSchema, DecimalStringSchema])\n .transform(([timestamp, pnl]) => ({ timestamp, pnl }));\n\nexport type PerpsPnlPoint = z.infer<typeof PerpsPnlPointSchema>;\n\nexport const ListPerpsPnlHistoryResponseSchema =\n PerpsDataResponseSchema(PerpsPnlPointSchema);\n\nconst RawPerpsProxyExpirySchema = z\n .number()\n .finite()\n .positive()\n .refine((value) => Number.isInteger(value), 'Expected integer')\n // The credentials endpoint currently returns proxy expiries in nanoseconds.\n .transform((value) =>\n value > Number.MAX_SAFE_INTEGER ? Math.floor(value / 1_000_000) : value,\n )\n .pipe(EpochMillisecondsSchema);\n\nexport const PerpsProxyKeySchema = z\n .object({\n proxy: EvmAddressSchema,\n label: z.string().optional(),\n expiry: RawPerpsProxyExpirySchema,\n })\n .transform((key) => ({\n proxy: key.proxy,\n label: key.label,\n expiresAt: key.expiry,\n }));\n\nexport type PerpsProxyKey = z.infer<typeof PerpsProxyKeySchema>;\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\nexport const PerpsCreateProxyResponseSchema = z.object({\n secret: z.string().min(1),\n});\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\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\nexport type PerpsDeposit = z.infer<typeof PerpsDepositSchema>;\n\nexport const ListPerpsDepositsResponseSchema =\n PerpsDataResponseSchema(PerpsDepositSchema);\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\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\nexport type PerpsWithdrawal = z.infer<typeof PerpsWithdrawalSchema>;\n\nexport const ListPerpsWithdrawalsResponseSchema = PerpsDataResponseSchema(\n PerpsWithdrawalSchema,\n);\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\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\nexport const PerpsInternalTransferSchema = z.object({\n transferId: PerpsInternalTransferIdSchema,\n asset: PerpsAssetSchema,\n amount: BaseUnitsSchema,\n direction: PerpsInternalTransferDirectionSchema,\n counterparty: EvmAddressSchema,\n label: z.string().optional(),\n createdTimestamp: EpochMillisecondsSchema,\n});\n\nexport type PerpsInternalTransfer = z.infer<typeof PerpsInternalTransferSchema>;\n","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\nexport const PerpsRiskTierSchema = z.object({\n lowerBound: DecimalStringSchema,\n maxLeverage: z.number().int().positive(),\n});\n\nconst RawPerpsRiskTierSchema = z\n .object({\n lower_bound: DecimalStringSchema,\n max_leverage: z.number().int().positive(),\n })\n .transform((tier) => ({\n lowerBound: tier.lower_bound,\n maxLeverage: tier.max_leverage,\n }));\n\nexport type PerpsRiskTier = z.infer<typeof PerpsRiskTierSchema>;\n\nexport const PerpsInstrumentSchema = z\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 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 riskTiers: instrument.risk_tiers,\n }));\n\nexport type PerpsInstrument = z.infer<typeof PerpsInstrumentSchema>;\n\nexport const FetchPerpsInstrumentsResponseSchema = z.array(\n PerpsInstrumentSchema,\n);\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\nexport type PerpsTicker = z.infer<typeof PerpsTickerSchema> & {\n openPrice?: DecimalString;\n volume24h?: DecimalString;\n};\n\nexport const FetchPerpsTickersResponseSchema = z.array(PerpsTickerSchema);\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\nexport const PerpsCandleSchema = z\n .tuple([\n EpochMillisecondsSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n DecimalStringSchema,\n z.number().int().nonnegative(),\n ])\n .transform(([timestamp, open, high, low, close, volume, trades]) => ({\n timestamp,\n open,\n high,\n low,\n close,\n volume,\n trades,\n }));\n\nexport type PerpsCandle = z.infer<typeof PerpsCandleSchema>;\n\nexport const PerpsStatisticSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n symbol: z.string().min(1).optional(),\n volume: DecimalStringSchema,\n open_price: DecimalStringSchema,\n klines: z.array(PerpsCandleSchema),\n })\n .transform((statistic) => ({\n instrumentId: statistic.instrument_id,\n symbol: statistic.symbol,\n volume: statistic.volume,\n openPrice: statistic.open_price,\n klines: statistic.klines,\n }));\n\nexport type PerpsStatistic = z.infer<typeof PerpsStatisticSchema>;\n\nexport const FetchPerpsStatisticsResponseSchema = z.array(PerpsStatisticSchema);\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\nexport const PerpsBookLevelSchema = z\n .tuple([DecimalStringSchema, DecimalStringSchema])\n .transform(([price, quantity]) => ({ price, quantity }));\n\nexport type PerpsBookLevel = z.infer<typeof PerpsBookLevelSchema>;\n\nexport const PerpsBookSchema = z\n .object({\n instrument_id: PerpsInstrumentIdSchema,\n bids: z.array(PerpsBookLevelSchema),\n asks: z.array(PerpsBookLevelSchema),\n timestamp: EpochMillisecondsSchema,\n sequence: z.number().int().nonnegative(),\n })\n .transform((book) => ({\n instrumentId: book.instrument_id,\n bids: book.bids,\n asks: book.asks,\n timestamp: book.timestamp,\n sequence: book.sequence,\n }));\n\nexport type PerpsBook = z.infer<typeof PerpsBookSchema>;\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\nexport const PerpsBboSchema = z.object({\n instrumentId: PerpsInstrumentIdSchema,\n bidPrice: DecimalStringSchema,\n bidQuantity: DecimalStringSchema,\n askPrice: DecimalStringSchema,\n askQuantity: DecimalStringSchema,\n timestamp: EpochMillisecondsSchema.optional(),\n});\n\nexport type PerpsBbo = z.infer<typeof PerpsBboSchema>;\n\nexport const 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\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\nexport type PerpsPublicTrade = z.infer<typeof PerpsPublicTradeSchema>;\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\nexport const FetchPerpsTradesResponseSchema = PerpsDataResponseSchema(\n PerpsPublicTradeSchema,\n);\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\nexport type PerpsFundingRate = z.infer<typeof PerpsFundingRateSchema>;\n\nexport const FetchPerpsFundingHistoryResponseSchema = PerpsDataResponseSchema(\n PerpsFundingRateSchema,\n);\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 })\n .transform((fee) => ({\n category: fee.category,\n takerFeeRate: fee.taker_fee_rate,\n makerFeeRate: fee.maker_fee_rate,\n }));\n\nexport type PerpsFeeScheduleEntry = z.infer<typeof PerpsFeeScheduleEntrySchema>;\n\nexport const PerpsFeesInfoSchema = z\n .object({\n fee_schedule: z.array(PerpsFeeScheduleEntrySchema),\n })\n .transform((fees) => ({\n feeSchedule: fees.fee_schedule,\n }));\n\nexport type PerpsFeesInfo = z.infer<typeof PerpsFeesInfoSchema>;\n\nexport const FetchPerpsFeesResponseSchema = PerpsFeesInfoSchema;\n\nexport const FetchPerpsCandlesResponseSchema =\n PerpsDataResponseSchema(PerpsCandleSchema);\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 PerpsTradeIdSchema,\n PerpsTxHashSchema,\n} from './common';\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\nexport const PerpsOrderStatusSchema = z.enum(PerpsOrderStatus);\n\nexport const PerpsCommandStatusSchema = z.enum(['ok', 'err']);\n\nconst PerpsAckErrorSchema = z\n .string()\n .min(1)\n .optional()\n .transform(perpsAckError);\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\nexport type PerpsCommandAck = z.infer<typeof PerpsCommandAckSchema>;\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\nexport type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;\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\nexport type PerpsCancelOrderResult = z.infer<\n typeof PerpsCancelOrderResultSchema\n>;\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\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\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 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 })\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 status: order.status,\n restingQuantity: order.resting_quantity,\n filledQuantity: order.filled_quantity,\n createdTimestamp: order.created_timestamp,\n updatedTimestamp: order.updated_timestamp,\n clientOrderId: order.client_order_id,\n }));\n\nexport type PerpsOrder = z.infer<typeof PerpsOrderSchema>;\n\nexport const FetchPerpsOrdersResponseSchema = z.array(PerpsOrderSchema);\n\nexport const FetchPerpsOpenOrdersResponseSchema = z.array(PerpsOrderSchema);\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 status: PerpsOrderStatusSchema,\n rest: DecimalStringSchema,\n fill: DecimalStringSchema,\n cts: EpochMillisecondsSchema,\n uts: EpochMillisecondsSchema,\n coid: z.string().optional(),\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 status: order.status,\n restingQuantity: order.rest,\n filledQuantity: order.fill,\n createdTimestamp: order.cts,\n updatedTimestamp: order.uts,\n clientOrderId: order.coid,\n }));\n\nexport const PerpsAccountFillSchema = z\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\nexport type PerpsAccountFill = z.infer<typeof PerpsAccountFillSchema>;\n\nexport const ListPerpsFillsResponseSchema = PerpsDataResponseSchema(\n PerpsAccountFillSchema,\n);\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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {expectEvmAddress,expectTxHash,isHexString}from'@polymarket/types';import {z as z$1}from'zod';var x=(r=>(r.Event="Event",r.Series="Series",r))(x||{}),u=(r=>(r.BUY="BUY",r.SELL="SELL",r))(u||{}),S=(s=>(s.GTC="GTC",s.FOK="FOK",s.GTD="GTD",s.FAK="FAK",s))(S||{});function i(t){if(!Number.isInteger(t))throw new TypeError(`Expected an integer, received: ${t}`);return t}function tt(t){return t}function y(t){if(!isHexString(t)||t.length!==66)throw new TypeError(`Expected a 32-byte hex string, received: ${t}`);return t}function et(t){return t}function E(t){return t}function b(t){return t}function nt(t){return t}function D(t){return t}function R(t){return t}function f(t){if(!isHexString(t)||t.length!==64&&t.length!==66)throw new TypeError(`Expected a 31-byte or 32-byte hex string, received: ${t}`);return t}var rt=f;function q(t){if(!isHexString(t))throw new TypeError(`Expected a protocol v2 combo condition ID, received: ${t}`);let n=t.toLowerCase();if(n.length===64&&n.startsWith("0x03"))return n;if(n.length===66&&n.startsWith("0x03")&&(n.endsWith("00")||n.endsWith("01")))return n.slice(0,-2);throw new TypeError(`Expected a protocol v2 combo condition ID, received: ${t}`)}function ot(t){return t}function it(t){return t}function st(t){return i(t)}function d(t){return i(t)}function P(t){return t}function M(t){return t}function w(t){return t}function m(t){return t}function o(t){return t}function k(t){return t}function B(t){return t}function U(t){return i(t)}function at(t){return i(t)}function dt(t){return t}function O(t){return t}function H(t){return l(t)}function L(t){return l(t)}function $(t){return t}function A(t){return t}function z(t){return t}function gt(t){return t}function pt(t){return i(t)}function N(t){return t}function ct(t){return i(t)}function It(t){return t}function Q(t){return t}function v(t){return t}function g(t){return t}function K(t){return t}var mt=z$1.string().transform(b),xt=z$1.string().transform(E),ut=z$1.string().transform(y),St=z$1.string().transform(D),ft=z$1.string().transform(R),Tt=z$1.string().transform(q),T=z$1.string().transform(f),_=z$1.preprocess(t=>t===""?void 0:t,T.optional()),lt=T,ht=_,Ct=z$1.string().transform(Z),yt=z$1.number().int().transform(d),Et=z$1.number().int().transform(t=>d(t*1e3)),p=z$1.union([z$1.number().int(),z$1.string().regex(/^\d+$/).transform(Number)]),c=z$1.string().transform(t=>/^\d{4}-\d{2}-\d{2}$/.test(t)?o(new Date(`${t}T00:00:00.000Z`).toISOString()):o(t)),bt=z$1.string().regex(/^\d+$/).transform(t=>d(Number(t))),F=z$1.union([p.transform(t=>o(new Date(t).toISOString())),c]),Dt=z$1.union([p.transform(t=>o(new Date(t<1e12?t*1e3:t).toISOString())),c]),G=z$1.union([p.transform(t=>t===0?void 0:o(new Date(t).toISOString())),c]),Rt=F,qt=G,Pt=z$1.union([z$1.string(),z$1.number().int().transform(String)]).transform(P),Mt=z$1.union([z$1.literal(.1),z$1.literal(.01),z$1.literal(.005),z$1.literal(.0025),z$1.literal(.001),z$1.literal(1e-4)]),V=z$1.string().transform(o).or(z$1.date().transform(t=>o(t.toISOString()))),W=z$1.string().transform(m).or(z$1.date().transform(t=>m(t.toISOString().slice(0,10)))),wt=z$1.string().transform(k),kt=V,Bt=W,Ut=z$1.string().transform(M),Ot=z$1.string().transform(w),Ht=z$1.string().transform(B),Lt=z$1.number().int().transform(U),$t=z$1.enum(x),At=z$1.enum(u),zt=z$1.enum(S),Nt=z$1.custom(t=>typeof t=="string"&&t.length>0,"Expected a non-empty pagination cursor"),Qt=z$1.string().transform(O),vt=z$1.string().transform(H),Kt=z$1.string().transform(L),_t=z$1.string().transform($),Ft=z$1.string().transform(A),Gt=z$1.string().transform(z),Vt=z$1.string().transform(N),Wt=z$1.string().transform(v),Yt=z$1.string().min(1).transform(Q),Zt=z$1.string().transform(j),Y=z$1.string().transform(g),jt=z$1.string().regex(/^\d+$/).transform(t=>{let n=BigInt(t),r=n/1000000n,I=(n%1000000n).toString().padStart(6,"0").replace(/0+$/,"");return g(`${r}${I===""?"":`.${I}`}`)}),Jt=z$1.union([Y,z$1.number().transform(t=>g(String(t)))]),Xt=z$1.union([z$1.number(),z$1.string().transform(Number)]).pipe(z$1.number().positive()),te=z$1.string().transform(K);function ee(t){return t===""?null:t}function Z(t){return expectEvmAddress(t)}function j(t){return expectTxHash(t)}function l(t){if(!isHexString(t)||t.length!==66)throw new TypeError(`Expected a 32-byte hex string, received: ${t}`);return t}export{Ct as $,at as A,_t as Aa,dt as B,Ft as Ba,O as C,Gt as Ca,H as D,Vt as Da,L as E,Wt as Ea,$ as F,Yt as Fa,A as G,Zt as Ga,z as H,Y as Ha,gt as I,jt as Ia,pt as J,Jt as Ja,N as K,Xt as Ka,ct as L,te as La,It as M,ee as Ma,Q as N,v as O,g as P,K as Q,mt as R,xt as S,ut as T,St as U,ft as V,Tt as W,T as X,_ as Y,lt as Z,ht as _,x as a,yt as aa,u as b,Et as ba,S as c,bt as ca,tt as d,F as da,y as e,Dt as ea,et as f,G as fa,E as g,Rt as ga,b as h,qt as ha,nt as i,Pt as ia,D as j,Mt as ja,R as k,V as ka,f as l,W as la,rt as m,wt as ma,q as n,kt as na,ot as o,Bt as oa,it as p,Ut as pa,st as q,Ot as qa,d as r,Ht as ra,P as s,Lt as sa,M as t,$t as ta,w as u,At as ua,m as v,zt as va,o as w,Nt as wa,k as x,Qt as xa,B as y,vt as ya,U as z,Kt as za};//# sourceMappingURL=chunk-VBHCYSM7.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-VBHCYSM7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared.ts"],"names":["CommentParentEntityType","OrderSide","OrderType","toTaggedInteger","value","toBestLineId","toBuilderCode","isHexString","toUuid","toApiKey","toCategoryId","toChatId","toClobRewardId","toCommentId","toCtfConditionId","toConditionId","toComboConditionId","normalized","toCollectionId","toEventCreatorId","toEventExternalPartnerMappingId","toEpochMilliseconds","toEventId","toImageOptimizationId","toInternalUserId","toIsoCalendarDateString","toIsoDateTimeString","toMixedDateTimeString","toMarketId","toNotificationId","toPartnerId","toPaginationCursor","toPositionId","toQuestionId","to32ByteHexString","toResolutionRequestId","toRfqId","toRfqQuoteId","toRfqRequestorPublicId","toSeriesId","toSportId","toTagId","toTeamId","toTemplateId","toTransactionId","toTokenId","toDecimalString","toBaseUnits","CategoryIdSchema","z","ApiKeySchema","BuilderCodeSchema","ClobRewardIdSchema","CommentIdSchema","ComboConditionIdSchema","CtfConditionIdSchema","OptionalCtfConditionIdSchema","ConditionIdSchema","OptionalConditionIdSchema","EvmAddressSchema","toEvmAddress","EpochMillisecondsSchema","EpochSecondsToMillisecondsSchema","EpochMillisecondsLikeSchema","DateLikeStringToIsoDateTimeStringSchema","EpochMillisecondsStringSchema","DateLikeToIsoDateTimeStringSchema","EpochLikeToIsoDateTimeStringSchema","OptionalDateLikeToIsoDateTimeStringSchema","EpochMillisecondsToIsoDateTimeStringSchema","OptionalEpochMillisecondsToIsoDateTimeStringSchema","EventIdSchema","TickSizeValueSchema","IsoDateTimeStringSchema","IsoCalendarDateStringSchema","MixedDateTimeStringSchema","ISODateStringSchema","ISOCalendarDateSchema","ImageOptimizationIdSchema","InternalUserIdSchema","MarketIdSchema","NotificationIdSchema","CommentParentEntityTypeSchema","OrderSideSchema","OrderTypeSchema","PaginationCursorSchema","PositionIdSchema","QuestionIdSchema","ResolutionRequestIdSchema","RfqIdSchema","RfqQuoteIdSchema","RfqRequestorPublicIdSchema","TagIdSchema","TokenIdSchema","TransactionIdSchema","TxHashSchema","toTxHash","DecimalStringSchema","E6BigIntStringToDecimalStringSchema","scaledValue","whole","fraction","DecimalishSchema","PositiveDecimalNumberSchema","BaseUnitsSchema","emptyStringToNull","expectEvmAddress","expectTxHash"],"mappings":"qGAYO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,MAAA,CAAS,QAAA,CAFCA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,IAAA,CAAO,MAAA,CAFGA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,GAAA,CAAM,KAAA,CAJIA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,EAWZ,SAASC,CAAAA,CAAkCC,CAAAA,CAAkB,CAC3D,GAAI,CAAC,MAAA,CAAO,SAAA,CAAUA,CAAK,CAAA,CACzB,MAAM,IAAI,SAAA,CAAU,CAAA,+BAAA,EAAkCA,CAAK,EAAE,C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AkBvD,GAAAA,CAAE,MAAA,EAAO,CAAE,SAAA,CAAUF,CAAW,EAaxD,SAAS0D,EAAAA,CAAkBrG,CAAAA,CAAyB,CACzD,OAAOA,CAAAA,GAAU,EAAA,CAAK,IAAA,CAAOA,CAC/B,CAEA,SAASwD,CAAAA,CAAaxD,CAAAA,CAA2B,CAC/C,OAAOsG,gBAAAA,CAAiBtG,CAAK,CAC/B,CAEA,SAAS4F,CAAAA,CAAS5F,CAAAA,CAAuB,CACvC,OAAOuG,YAAAA,CAAavG,CAAK,CAC3B,CAEA,SAAS8B,CAAAA,CAAkB9B,CAAAA,CAA0B,CACnD,GAAI,CAACG,WAAAA,CAAYH,CAAK,CAAA,EAAKA,CAAAA,CAAM,MAAA,GAAW,EAAA,CAC1C,MAAM,IAAI,SAAA,CAAU,CAAA,yCAAA,EAA4CA,CAAK,CAAA,CAAE,CAAA,CAGzE,OAAOA,CACT","file":"chunk-VBHCYSM7.js","sourcesContent":["import {\n type EvmAddress,\n expectEvmAddress,\n expectTxHash,\n type HexString,\n isHexString,\n type TxHash,\n} from '@polymarket/types';\nimport { z } from 'zod';\n\ntype Tagged<T, Tag extends string> = T & { readonly __tag: Tag };\n\nexport enum CommentParentEntityType {\n Event = 'Event',\n Series = 'Series',\n}\n\nexport enum OrderSide {\n BUY = 'BUY',\n SELL = 'SELL',\n}\n\nexport enum OrderType {\n GTC = 'GTC',\n FOK = 'FOK',\n GTD = 'GTD',\n FAK = 'FAK',\n}\n\nfunction toTaggedString<T extends string>(value: string): T {\n return value as T;\n}\n\nfunction toTaggedInteger<T extends number>(value: number): T {\n if (!Number.isInteger(value)) {\n throw new TypeError(`Expected an integer, received: ${value}`);\n }\n\n return value as T;\n}\n\nexport type BestLineId = Tagged<string, 'BestLineId'>;\nexport type BuilderCode = Tagged<HexString, 'BuilderCode'>;\nexport type Uuid = Tagged<string, 'Uuid'>;\nexport type ApiKey = Tagged<string, 'ApiKey'>;\nexport type CategoryId = Tagged<string, 'CategoryId'>;\nexport type ChatId = Tagged<string, 'ChatId'>;\nexport type ClobRewardId = Tagged<string, 'ClobRewardId'>;\nexport type CommentId = Tagged<string, 'CommentId'>;\nexport type ComboConditionId = Tagged<HexString, 'ComboConditionId'>;\nexport type CtfConditionId = Tagged<HexString, 'CtfConditionId'>;\n/** @deprecated Use {@link CtfConditionId}. */\nexport type ConditionId = CtfConditionId;\nexport type CollectionId = Tagged<string, 'CollectionId'>;\nexport type EventCreatorId = Tagged<string, 'EventCreatorId'>;\nexport type EventExternalPartnerMappingId = Tagged<\n number,\n 'EventExternalPartnerMappingId'\n>;\nexport type EpochMilliseconds = Tagged<number, 'EpochMilliseconds'>;\nexport type EventId = Tagged<string, 'EventId'>;\nexport type ImageOptimizationId = Tagged<string, 'ImageOptimizationId'>;\nexport type InternalUserId = Tagged<string, 'InternalUserId'>;\nexport type IsoCalendarDateString = Tagged<string, 'IsoCalendarDateString'>;\nexport type IsoDateTimeString = Tagged<string, 'IsoDateTimeString'>;\nexport type MarketId = Tagged<string, 'MarketId'>;\nexport type MixedDateTimeString = Tagged<string, 'MixedDateTimeString'>;\nexport type NotificationId = Tagged<number, 'NotificationId'>;\nexport type PartnerId = Tagged<number, 'PartnerId'>;\nexport type PaginationCursor = Tagged<string, 'PaginationCursor'>;\nexport type PositionId = Tagged<string, 'PositionId'>;\nexport type QuestionId = Tagged<HexString, 'QuestionId'>;\nexport type ResolutionRequestId = Tagged<HexString, 'ResolutionRequestId'>;\nexport type RfqId = Tagged<string, 'RfqId'>;\nexport type RfqQuoteId = Tagged<string, 'RfqQuoteId'>;\nexport type RfqRequestorPublicId = Tagged<string, 'RfqRequestorPublicId'>;\nexport type SeriesId = Tagged<string, 'SeriesId'>;\nexport type SportId = Tagged<number, 'SportId'>;\nexport type TagId = Tagged<string, 'TagId'>;\nexport type TeamId = Tagged<number, 'TeamId'>;\nexport type TemplateId = Tagged<string, 'TemplateId'>;\nexport type TransactionId = Tagged<string, 'TransactionId'>;\nexport type TokenId = Tagged<string, 'TokenId'>;\nexport type DecimalString = Tagged<string, 'DecimalString'>;\nexport type BaseUnits = Tagged<string, 'BaseUnits'>;\n\nexport function toBestLineId(value: string): BestLineId {\n return toTaggedString<BestLineId>(value);\n}\n\nexport function toBuilderCode(value: string): BuilderCode {\n if (!isHexString(value) || value.length !== 66) {\n throw new TypeError(`Expected a 32-byte hex string, received: ${value}`);\n }\n\n return value as BuilderCode;\n}\n\nexport function toUuid(value: string): Uuid {\n return toTaggedString<Uuid>(value);\n}\n\nexport function toApiKey(value: string): ApiKey {\n return toTaggedString<ApiKey>(value);\n}\n\nexport function toCategoryId(value: string): CategoryId {\n return toTaggedString<CategoryId>(value);\n}\n\nexport function toChatId(value: string): ChatId {\n return toTaggedString<ChatId>(value);\n}\n\nexport function toClobRewardId(value: string): ClobRewardId {\n return toTaggedString<ClobRewardId>(value);\n}\n\nexport function toCommentId(value: string): CommentId {\n return toTaggedString<CommentId>(value);\n}\n\nexport function toCtfConditionId(value: string): CtfConditionId {\n if (!isHexString(value) || (value.length !== 64 && value.length !== 66)) {\n throw new TypeError(\n `Expected a 31-byte or 32-byte hex string, received: ${value}`,\n );\n }\n\n return value as CtfConditionId;\n}\n\n/** @deprecated Use {@link toCtfConditionId}. */\nexport const toConditionId = toCtfConditionId;\n\nexport function toComboConditionId(value: string): ComboConditionId {\n if (!isHexString(value)) {\n throw new TypeError(\n `Expected a protocol v2 combo condition ID, received: ${value}`,\n );\n }\n\n const normalized = value.toLowerCase();\n\n if (normalized.length === 64 && normalized.startsWith('0x03')) {\n return normalized as ComboConditionId;\n }\n\n if (\n normalized.length === 66 &&\n normalized.startsWith('0x03') &&\n (normalized.endsWith('00') || normalized.endsWith('01'))\n ) {\n return normalized.slice(0, -2) as ComboConditionId;\n }\n\n throw new TypeError(\n `Expected a protocol v2 combo condition ID, received: ${value}`,\n );\n}\n\nexport function toCollectionId(value: string): CollectionId {\n return toTaggedString<CollectionId>(value);\n}\n\nexport function toEventCreatorId(value: string): EventCreatorId {\n return toTaggedString<EventCreatorId>(value);\n}\n\nexport function toEventExternalPartnerMappingId(\n value: number,\n): EventExternalPartnerMappingId {\n return toTaggedInteger<EventExternalPartnerMappingId>(value);\n}\n\nexport function toEpochMilliseconds(value: number): EpochMilliseconds {\n return toTaggedInteger<EpochMilliseconds>(value);\n}\n\nexport function toEventId(value: string): EventId {\n return toTaggedString<EventId>(value);\n}\n\nexport function toImageOptimizationId(value: string): ImageOptimizationId {\n return toTaggedString<ImageOptimizationId>(value);\n}\n\nexport function toInternalUserId(value: string): InternalUserId {\n return toTaggedString<InternalUserId>(value);\n}\n\nexport function toIsoCalendarDateString(value: string): IsoCalendarDateString {\n return toTaggedString<IsoCalendarDateString>(value);\n}\n\nexport function toIsoDateTimeString(value: string): IsoDateTimeString {\n return toTaggedString<IsoDateTimeString>(value);\n}\n\nexport function toMixedDateTimeString(value: string): MixedDateTimeString {\n return toTaggedString<MixedDateTimeString>(value);\n}\n\nexport function toMarketId(value: string): MarketId {\n return toTaggedString<MarketId>(value);\n}\n\nexport function toNotificationId(value: number): NotificationId {\n return toTaggedInteger<NotificationId>(value);\n}\n\nexport function toPartnerId(value: number): PartnerId {\n return toTaggedInteger<PartnerId>(value);\n}\n\nexport function toPaginationCursor(value: string): PaginationCursor {\n return toTaggedString<PaginationCursor>(value);\n}\n\nexport function toPositionId(value: string): PositionId {\n return toTaggedString<PositionId>(value);\n}\n\nexport function toQuestionId(value: string): QuestionId {\n return to32ByteHexString(value) as QuestionId;\n}\n\nexport function toResolutionRequestId(value: string): ResolutionRequestId {\n return to32ByteHexString(value) as ResolutionRequestId;\n}\n\nexport function toRfqId(value: string): RfqId {\n return toTaggedString<RfqId>(value);\n}\n\nexport function toRfqQuoteId(value: string): RfqQuoteId {\n return toTaggedString<RfqQuoteId>(value);\n}\n\nexport function toRfqRequestorPublicId(value: string): RfqRequestorPublicId {\n return toTaggedString<RfqRequestorPublicId>(value);\n}\n\nexport function toSeriesId(value: string): SeriesId {\n return toTaggedString<SeriesId>(value);\n}\n\nexport function toSportId(value: number): SportId {\n return toTaggedInteger<SportId>(value);\n}\n\nexport function toTagId(value: string): TagId {\n return toTaggedString<TagId>(value);\n}\n\nexport function toTeamId(value: number): TeamId {\n return toTaggedInteger<TeamId>(value);\n}\n\nexport function toTemplateId(value: string): TemplateId {\n return toTaggedString<TemplateId>(value);\n}\n\nexport function toTransactionId(value: string): TransactionId {\n return toTaggedString<TransactionId>(value);\n}\n\nexport function toTokenId(value: string): TokenId {\n return toTaggedString<TokenId>(value);\n}\n\nexport function toDecimalString(value: string): DecimalString {\n return toTaggedString<DecimalString>(value);\n}\n\nexport function toBaseUnits(value: string): BaseUnits {\n return toTaggedString<BaseUnits>(value);\n}\n\nexport const CategoryIdSchema = z.string().transform(toCategoryId);\nexport const ApiKeySchema = z.string().transform(toApiKey);\nexport const BuilderCodeSchema = z.string().transform(toBuilderCode);\nexport const ClobRewardIdSchema = z.string().transform(toClobRewardId);\nexport const CommentIdSchema = z.string().transform(toCommentId);\nexport const ComboConditionIdSchema = z.string().transform(toComboConditionId);\nexport const CtfConditionIdSchema = z.string().transform(toCtfConditionId);\nexport const OptionalCtfConditionIdSchema = z.preprocess(\n (value) => (value === '' ? undefined : value),\n CtfConditionIdSchema.optional(),\n);\n/** @deprecated Use {@link CtfConditionIdSchema}. */\nexport const ConditionIdSchema = CtfConditionIdSchema;\n/** @deprecated Use {@link OptionalCtfConditionIdSchema}. */\nexport const OptionalConditionIdSchema = OptionalCtfConditionIdSchema;\nexport const EvmAddressSchema = z.string().transform(toEvmAddress);\nexport const EpochMillisecondsSchema = z\n .number()\n .int()\n .transform(toEpochMilliseconds);\nexport const EpochSecondsToMillisecondsSchema = z\n .number()\n .int()\n .transform((value) => toEpochMilliseconds(value * 1000));\nconst EpochMillisecondsLikeSchema = z.union([\n z.number().int(),\n z.string().regex(/^\\d+$/).transform(Number),\n]);\nconst DateLikeStringToIsoDateTimeStringSchema = z\n .string()\n .transform((value) => {\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) {\n return toIsoDateTimeString(\n new Date(`${value}T00:00:00.000Z`).toISOString(),\n );\n }\n\n return toIsoDateTimeString(value);\n });\nexport const EpochMillisecondsStringSchema = z\n .string()\n .regex(/^\\d+$/)\n .transform((value) => toEpochMilliseconds(Number(value)));\nexport const DateLikeToIsoDateTimeStringSchema = z.union([\n EpochMillisecondsLikeSchema.transform((value) =>\n toIsoDateTimeString(new Date(value).toISOString()),\n ),\n DateLikeStringToIsoDateTimeStringSchema,\n]);\nexport const EpochLikeToIsoDateTimeStringSchema = z.union([\n EpochMillisecondsLikeSchema.transform((value) =>\n toIsoDateTimeString(\n new Date(value < 1_000_000_000_000 ? value * 1000 : value).toISOString(),\n ),\n ),\n DateLikeStringToIsoDateTimeStringSchema,\n]);\nexport const OptionalDateLikeToIsoDateTimeStringSchema = z.union([\n EpochMillisecondsLikeSchema.transform((value) =>\n value === 0\n ? undefined\n : toIsoDateTimeString(new Date(value).toISOString()),\n ),\n DateLikeStringToIsoDateTimeStringSchema,\n]);\nexport const EpochMillisecondsToIsoDateTimeStringSchema =\n DateLikeToIsoDateTimeStringSchema;\nexport const OptionalEpochMillisecondsToIsoDateTimeStringSchema =\n OptionalDateLikeToIsoDateTimeStringSchema;\nexport const EventIdSchema = z\n .union([z.string(), z.number().int().transform(String)])\n .transform(toEventId);\nexport const TickSizeValueSchema = z.union([\n z.literal(0.1),\n z.literal(0.01),\n z.literal(0.005),\n z.literal(0.0025),\n z.literal(0.001),\n z.literal(0.0001),\n]);\nexport const IsoDateTimeStringSchema = z\n .string()\n .transform(toIsoDateTimeString)\n .or(z.date().transform((value) => toIsoDateTimeString(value.toISOString())));\nexport const IsoCalendarDateStringSchema = z\n .string()\n .transform(toIsoCalendarDateString)\n .or(\n z\n .date()\n .transform((value) =>\n toIsoCalendarDateString(value.toISOString().slice(0, 10)),\n ),\n );\nexport const MixedDateTimeStringSchema = z\n .string()\n .transform(toMixedDateTimeString);\nexport const ISODateStringSchema = IsoDateTimeStringSchema;\nexport const ISOCalendarDateSchema = IsoCalendarDateStringSchema;\nexport const ImageOptimizationIdSchema = z\n .string()\n .transform(toImageOptimizationId);\nexport const InternalUserIdSchema = z.string().transform(toInternalUserId);\nexport const MarketIdSchema = z.string().transform(toMarketId);\nexport const NotificationIdSchema = z\n .number()\n .int()\n .transform(toNotificationId);\nexport const CommentParentEntityTypeSchema = z.enum(CommentParentEntityType);\nexport const OrderSideSchema = z.enum(OrderSide);\nexport const OrderTypeSchema = z.enum(OrderType);\nexport const PaginationCursorSchema = z.custom<PaginationCursor>(\n (value) => typeof value === 'string' && value.length > 0,\n 'Expected a non-empty pagination cursor',\n);\nexport const PositionIdSchema = z.string().transform(toPositionId);\nexport const QuestionIdSchema = z.string().transform(toQuestionId);\nexport const ResolutionRequestIdSchema = z\n .string()\n .transform(toResolutionRequestId);\nexport const RfqIdSchema = z.string().transform(toRfqId);\nexport const RfqQuoteIdSchema = z.string().transform(toRfqQuoteId);\nexport const RfqRequestorPublicIdSchema = z\n .string()\n .transform(toRfqRequestorPublicId);\nexport const TagIdSchema = z.string().transform(toTagId);\nexport const TokenIdSchema = z.string().transform(toTokenId);\nexport const TransactionIdSchema = z.string().min(1).transform(toTransactionId);\nexport const TxHashSchema = z.string().transform(toTxHash);\nexport const DecimalStringSchema = z.string().transform(toDecimalString);\nexport const E6BigIntStringToDecimalStringSchema = z\n .string()\n .regex(/^\\d+$/)\n .transform((value) => {\n const scaledValue = BigInt(value);\n const whole = scaledValue / 1_000_000n;\n const fraction = (scaledValue % 1_000_000n)\n .toString()\n .padStart(6, '0')\n .replace(/0+$/, '');\n\n return toDecimalString(`${whole}${fraction === '' ? '' : `.${fraction}`}`);\n });\nexport const DecimalishSchema = z.union([\n DecimalStringSchema,\n z.number().transform((value) => toDecimalString(String(value))),\n]);\nexport const PositiveDecimalNumberSchema = z\n .union([z.number(), z.string().transform(Number)])\n .pipe(z.number().positive());\nexport const BaseUnitsSchema = z.string().transform(toBaseUnits);\n\nexport type ISODateString = IsoDateTimeString;\nexport type ISOCalendarDateString = IsoCalendarDateString;\nexport type TickSizeValue = z.output<typeof TickSizeValueSchema>;\n\nexport type { EvmAddress, TxHash };\n\n/**\n * Preprocess helper for upstream fields that serialize missing values as empty\n * strings. Use as `z.preprocess(emptyStringToNull, Schema.nullable())`, or\n * with `.nullish()` when the field can also be absent.\n */\nexport function emptyStringToNull(value: unknown): unknown {\n return value === '' ? null : value;\n}\n\nfunction toEvmAddress(value: string): EvmAddress {\n return expectEvmAddress(value);\n}\n\nfunction toTxHash(value: string): TxHash {\n return expectTxHash(value);\n}\n\nfunction to32ByteHexString(value: string): HexString {\n if (!isHexString(value) || value.length !== 66) {\n throw new TypeError(`Expected a 32-byte hex string, received: ${value}`);\n }\n\n return value;\n}\n"]}
|
package/dist/clob/index.d.ts
CHANGED
|
@@ -2285,18 +2285,18 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2285
2285
|
type PaginatedMarketRewards = z.infer<typeof PaginatedMarketRewardsSchema>;
|
|
2286
2286
|
|
|
2287
2287
|
declare const TickSizeSchema: z.ZodPipe<z.ZodObject<{
|
|
2288
|
-
minimum_tick_size: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
2288
|
+
minimum_tick_size: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
2289
2289
|
}, z.core.$strip>, z.ZodTransform<{
|
|
2290
|
-
minimumTickSize: 0.1 | 0.01 | 0.001 | 0.0001;
|
|
2290
|
+
minimumTickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
2291
2291
|
}, {
|
|
2292
|
-
minimum_tick_size: 0.1 | 0.01 | 0.001 | 0.0001;
|
|
2292
|
+
minimum_tick_size: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
2293
2293
|
}>>;
|
|
2294
2294
|
declare const FetchTickSizeResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
2295
|
-
minimum_tick_size: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
2295
|
+
minimum_tick_size: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
2296
2296
|
}, z.core.$strip>, z.ZodTransform<{
|
|
2297
|
-
minimumTickSize: 0.1 | 0.01 | 0.001 | 0.0001;
|
|
2297
|
+
minimumTickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
2298
2298
|
}, {
|
|
2299
|
-
minimum_tick_size: 0.1 | 0.01 | 0.001 | 0.0001;
|
|
2299
|
+
minimum_tick_size: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
2300
2300
|
}>>;
|
|
2301
2301
|
type TickSize = z.infer<typeof TickSizeSchema>;
|
|
2302
2302
|
type FetchTickSizeResponse = z.infer<typeof FetchTickSizeResponseSchema>;
|
package/dist/clob/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {Ha,ha,ga,Ea,Ma,ea,aa,sa,La,$ as $$1,Ja,X as X$1,S,ua,ca,Ga,ja}from'../chunk-SB2LAVJ4.js';import {z as z$1}from'zod';import {never}from'@polymarket/types';function z(e){return z$1.object({count:z$1.number(),data:z$1.array(e),limit:z$1.number(),next_cursor:z$1.string()}).transform(({next_cursor:t,...a})=>({...a,nextCursor:t}))}var je=z$1.object({closed_only:z$1.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),X=z$1.object({asset_id:Ea,associate_trades:z$1.array(z$1.string()),created_at:ga,expiration:ha,id:z$1.string(),maker_address:z$1.string(),market:z$1.string(),order_type:z$1.string(),original_size:Ha,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size_matched:Ha,status:z$1.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:s,maker_address:f,order_type:c,original_size:u,size_matched:x,...k})=>{let h={...k,tokenId:e,associateTrades:t,createdAt:a,makerAddress:f,orderType:c,originalSize:u,sizeMatched:x};return s===void 0?h:{...h,expiresAt:s}}),Fe=z(X),Z=z$1.object({asset_id:Ea,fee_rate_bps:z$1.preprocess(Ma,Ha.nullable()),maker_address:z$1.string(),matched_amount:Ha,order_id:z$1.string(),outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:s,order_id:f,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:s,orderId:f})),$=z$1.object({asset_id:Ea,bucket_index:z$1.number(),fee_rate_bps:Ha,id:z$1.string(),last_update:ea,maker_address:z$1.string(),maker_orders:z$1.array(Z),market:z$1.string(),match_time:ea,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size:Ha,status:z$1.string(),taker_order_id:z$1.string(),trader_side:z$1.enum(["TAKER","MAKER"]),transaction_hash:z$1.string()}).transform(({asset_id:e,bucket_index:t,fee_rate_bps:a,last_update:s,maker_address:f,maker_orders:c,match_time:u,taker_order_id:x,trader_side:k,transaction_hash:h,...W})=>({...W,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:s,makerAddress:f,makerOrders:c,matchedAt:u,takerOrderId:x,traderSide:k,transactionHash:h})),Ue=z($),q=z$1.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),aa),G=z$1.object({id:sa,owner:z$1.string(),payload:z$1.unknown(),timestamp:q,type:z$1.number()}),Ke=z$1.array(G),L=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(L||{}),He=z$1.enum(L),ve=z$1.object({allowances:z$1.record($$1,z$1.string().transform(BigInt)),balance:La}),Ve=z$1.object({scoring:z$1.boolean()}),Ye=z$1.record(z$1.string(),z$1.boolean()),J=z$1.object({asset_address:z$1.string(),asset_rate:Ja,condition_id:X$1,date:ga,earnings:Ja,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:s,...f})=>({...f,assetAddress:e,assetRate:t,conditionId:a,makerAddress:s})),We=z(J),Q=z$1.object({asset_address:z$1.string(),asset_rate:Ja,date:ga,earnings:Ja,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...s})=>({...s,assetAddress:e,assetRate:t,makerAddress:a})),Xe=z$1.array(Q),Ze=z$1.record(X$1,z$1.number()),ee=z$1.object({outcome:z$1.string(),price:Ja,token_id:Ea}).transform(({token_id:e,...t})=>({...t,tokenId:e})),re=z$1.object({asset_address:z$1.string(),end_date:ga,rate_per_day:Ja,start_date:ga,total_rewards:Ja}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:s,total_rewards:f})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:s,totalRewards:f})),te=z$1.object({asset_address:z$1.string(),asset_rate:Ja,earnings:Ja}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),oe=z$1.object({condition_id:X$1,earning_percentage:z$1.number(),earnings:z$1.array(te),event_slug:z$1.string(),image:z$1.string(),maker_address:z$1.string(),market_competitiveness:z$1.number(),market_slug:z$1.string(),question:z$1.string(),rewards_config:z$1.array(re),rewards_max_spread:z$1.number(),rewards_min_size:Ja,tokens:z$1.array(ee)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:s,market_competitiveness:f,market_slug:c,rewards_config:u,rewards_max_spread:x,rewards_min_size:k,...h})=>({...h,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:s,marketCompetitiveness:f,marketSlug:c,rewardsConfig:u,rewardsMaxSpread:x,rewardsMinSize:k})),$e=z(oe);var Qe=z$1.object({apiKey:S,secret:z$1.string(),passphrase:z$1.string()}).transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),er=z$1.object({apiKeys:z$1.array(S)}),rr=z$1.object({key:S,secret:z$1.string(),passphrase:z$1.string()}),N=z$1.object({key:S,createdAt:ga.optional(),revokedAt:ga.nullable().optional()}),tr=z$1.array(z$1.union([S.transform(e=>({key:e})),N])).transform(e=>e.map(t=>N.parse(t)));var ae=z$1.object({id:z$1.string(),tradeType:z$1.string(),takerOrderHash:z$1.string(),builder:z$1.string(),market:z$1.string(),assetId:Ea,side:ua,size:Ha,sizeUsdc:Ha,price:Ha,status:z$1.string(),outcome:z$1.string(),outcomeIndex:z$1.number().int(),owner:z$1.string(),maker:z$1.string(),transactionHash:z$1.string(),matchTime:ea,bucketIndex:z$1.number().int(),fee:Ha,feeUsdc:Ha,err_msg:z$1.string().nullable().optional(),createdAt:ga.optional(),updatedAt:ga.optional()}).transform(({err_msg:e,assetId:t,matchTime:a,...s})=>({...s,tokenId:t,errMsg:e,matchedAt:a})),nr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(ae)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),j=1e4,se=z$1.object({builder_maker_fee_rate_bps:z$1.number(),builder_taker_fee_rate_bps:z$1.number()}).transform(({builder_maker_fee_rate_bps:e,builder_taker_fee_rate_bps:t})=>({maker:e/j,taker:t/j})),ir=se;var pr=z$1.object({canceled:z$1.array(z$1.string()),not_canceled:z$1.record(z$1.string(),z$1.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var F=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(F||{}),hr=z$1.enum(F),lr=z$1.object({mid:Ha}),yr=z$1.record(z$1.string(),Ha),gr=z$1.object({price:Ha}),ne=z$1.record(ua,Ha.optional()),ur=z$1.record(z$1.string(),ne),xr=z$1.object({spread:Ha}),kr=z$1.record(z$1.string(),Ha),_r=z$1.object({price:Ha,side:ua}),ie=z$1.object({price:Ha,side:ua,token_id:Ea}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z$1.object({tokenId:Ea,price:Ha,side:ua});var Or=z$1.array(ie),ce=z$1.object({t:z$1.number().int(),p:z$1.number()}),Tr=z$1.object({history:z$1.array(ce)}),de=z$1.object({condition_id:X$1}).transform(({condition_id:e})=>e),br=de,pe=z$1.object({r:z$1.number().default(0),e:z$1.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),me=z$1.object({t:Ea,o:z$1.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),fe=z$1.object({fd:pe.nullish(),t:z$1.array(me)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),zr=fe;var Se=z$1.object({neg_risk:z$1.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Cr=Se;var K=z$1.object({price:Ha,size:Ha}),he=z$1.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),H=z$1.object({market:X$1,asset_id:Ea,timestamp:ca.nullish(),bids:z$1.array(K),asks:z$1.array(K),min_order_size:Ha,tick_size:Ha,neg_risk:z$1.boolean(),last_trade_price:Ha.nullish(),hash:he}).transform(({asset_id:e,min_order_size:t,tick_size:a,neg_risk:s,last_trade_price:f,...c})=>({...c,tokenId:e,minOrderSize:t,tickSize:a,negRisk:s,lastTradePrice:f})),Dr=H,Br=z$1.array(H);var v=z$1.preprocess(e=>e===""?"0":e,Ha),ye=z$1.object({errorMsg:z$1.string(),makingAmount:v,orderID:z$1.string(),status:z$1.string(),success:z$1.boolean(),takingAmount:v,tradeIDs:z$1.array(z$1.string()).default([]),transactionsHashes:z$1.array(z$1.string()).default([])}),V=(s=>(s.LIVE="live",s.MATCHED="matched",s.DELAYED="delayed",s))(V||{}),ge=z$1.nativeEnum(V),Y=(h=>(h.UNMATCHED="unmatched",h.MARKET_NOT_READY="market_not_ready",h.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",h.INVALID_NONCE="invalid_nonce",h.INVALID_EXPIRATION="invalid_expiration",h.POST_ONLY_WOULD_CROSS="post_only_would_cross",h.FOK_NOT_FILLED="fok_not_filled",h.FAK_NOT_FILLED="fak_not_filled",h.UNKNOWN="unknown",h))(Y||{}),ue=z$1.nativeEnum(Y),xe=z$1.object({ok:z$1.literal(true),orderId:z$1.string().min(1),status:ge,makingAmount:Ha,takingAmount:Ha,tradeIds:z$1.array(z$1.string()),transactionsHashes:z$1.array(Ga)}),ke=z$1.object({ok:z$1.literal(false),code:ue,message:z$1.string().min(1)}),_e=ye.transform(Te),Fr=z$1.array(_e);function Re(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&ze(e.status)}function Oe(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function Te(e){return Re(e)?xe.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:Oe(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):ke.parse({code:be(e),message:e.errorMsg||"Unknown order failure",ok:false})}function be(e){if(e.status==="unmatched")return "unmatched";switch(e.errorMsg){case "the market is not yet ready to process new orders":return "market_not_ready";case "invalid nonce":return "invalid_nonce";case "invalid expiration":return "invalid_expiration";case "invalid post-only order: order crosses book":return "post_only_would_cross";case "order couldn't be fully filled. FOK orders are fully filled or killed.":return "fok_not_filled";case "no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.":return "fak_not_filled"}return e.errorMsg.includes("not enough balance / allowance")?"insufficient_balance_or_allowance":"unknown"}function ze(e){return e==="live"||e==="matched"||e==="delayed"}var Kr="LTE=";var Ae=z$1.object({id:z$1.number().int().optional(),asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ja,total_rewards:Ja.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Ie=z$1.object({condition_id:X$1,rewards_max_spread:z$1.number().optional(),rewards_min_size:Ja.optional(),rewards_config:z$1.array(Ae).optional(),sponsored_daily_rate:Ja.optional(),sponsors_count:z$1.number().int().optional(),native_daily_rate:Ja.optional(),total_daily_rate:Ja.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:s,sponsored_daily_rate:f,sponsors_count:c,native_daily_rate:u,total_daily_rate:x,...k})=>({...k,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:s,sponsoredDailyRate:f,sponsorsCount:c,nativeDailyRate:u,totalDailyRate:x})),Yr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Ie)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),Ce=z$1.object({token_id:Ea,outcome:z$1.string(),price:Ja}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Ee=z$1.object({asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ja,total_rewards:Ja.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Pe=z$1.object({condition_id:X$1,question:z$1.string(),market_slug:z$1.string().optional(),event_slug:z$1.string().optional(),image:z$1.string().optional(),rewards_max_spread:z$1.number().optional(),rewards_min_size:Ja.optional(),market_competitiveness:z$1.number().optional(),tokens:z$1.array(Ce),rewards_config:z$1.array(Ee).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:s,rewards_min_size:f,market_competitiveness:c,rewards_config:u,...x})=>({...x,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:s,rewardsMinSize:f,marketCompetitiveness:c,rewardsConfig:u})),Wr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Pe)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var De=z$1.object({minimum_tick_size:ja}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),qr=De;export{xe as AcceptedOrderResponseSchema,Qe as ApiKeyCredsSchema,er as ApiKeysResponseSchema,L as AssetType,He as AssetTypeSchema,ve as BalanceAllowanceResponseSchema,rr as BuilderApiKeyCredsSchema,N as BuilderApiKeySchema,tr as BuilderApiKeysResponseSchema,se as BuilderFeeRatesSchema,ae as BuilderTradeSchema,pr as CancelOrdersResponseSchema,$ as ClobTradeSchema,Ue as ClobTradesPageSchema,je as ClosedOnlyModeSchema,de as ConditionByTokenSchema,Ie as CurrentRewardSchema,Kr as END_CURSOR,te as EarningSchema,ir as FetchBuilderFeeRatesResponseSchema,zr as FetchMarketInfoResponseSchema,Cr as FetchNegRiskResponseSchema,Dr as FetchOrderBookResponseSchema,qr as FetchTickSizeResponseSchema,_r as LastTradePriceSchema,Or as LastTradePricesSchema,Z as MakerOrderSchema,pe as MarketFeeInfoSchema,fe as MarketInfoSchema,Pe as MarketRewardSchema,me as MarketTokenSchema,lr as MidpointSchema,yr as MidpointsSchema,Se as NegRiskSchema,G as NotificationSchema,Ke as NotificationsResponseSchema,X as OpenOrderSchema,Fe as OpenOrdersPageSchema,he as OrderBookHashSchema,K as OrderBookLevelSchema,H as OrderBookSchema,Br as OrderBooksSchema,V as OrderPostStatus,ge as OrderPostStatusSchema,Y as OrderResponseErrorCode,ue as OrderResponseErrorCodeSchema,_e as OrderResponseSchema,Fr as OrderResponsesSchema,Ve as OrderScoringResponseSchema,Ye as OrdersScoringResponseSchema,nr as PaginatedBuilderTradesSchema,Yr as PaginatedCurrentRewardsSchema,Wr as PaginatedMarketRewardsSchema,F as PriceHistoryInterval,hr as PriceHistoryIntervalSchema,Tr as PriceHistorySchema,gr as PriceSchema,ur as PricesSchema,ke as RejectedOrderResponseSchema,br as ResolveConditionByTokenResponseSchema,re as RewardsConfigSchema,Ze as RewardsPercentagesSchema,xr as SpreadSchema,kr as SpreadsSchema,De as TickSizeSchema,ee as TokenSchema,Q as TotalUserEarningSchema,Xe as TotalUserEarningsResponseSchema,J as UserEarningSchema,We as UserEarningsPageSchema,oe as UserRewardsEarningSchema,$e as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {Ha,ha,ga,Ea,Ma,ea,aa,sa,La,$ as $$1,Ja,X as X$1,S,ua,ca,Ga,ja}from'../chunk-VBHCYSM7.js';import {z as z$1}from'zod';import {never}from'@polymarket/types';function z(e){return z$1.object({count:z$1.number(),data:z$1.array(e),limit:z$1.number(),next_cursor:z$1.string()}).transform(({next_cursor:t,...a})=>({...a,nextCursor:t}))}var je=z$1.object({closed_only:z$1.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),X=z$1.object({asset_id:Ea,associate_trades:z$1.array(z$1.string()),created_at:ga,expiration:ha,id:z$1.string(),maker_address:z$1.string(),market:z$1.string(),order_type:z$1.string(),original_size:Ha,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size_matched:Ha,status:z$1.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:s,maker_address:f,order_type:c,original_size:u,size_matched:x,...k})=>{let h={...k,tokenId:e,associateTrades:t,createdAt:a,makerAddress:f,orderType:c,originalSize:u,sizeMatched:x};return s===void 0?h:{...h,expiresAt:s}}),Fe=z(X),Z=z$1.object({asset_id:Ea,fee_rate_bps:z$1.preprocess(Ma,Ha.nullable()),maker_address:z$1.string(),matched_amount:Ha,order_id:z$1.string(),outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:s,order_id:f,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:s,orderId:f})),$=z$1.object({asset_id:Ea,bucket_index:z$1.number(),fee_rate_bps:Ha,id:z$1.string(),last_update:ea,maker_address:z$1.string(),maker_orders:z$1.array(Z),market:z$1.string(),match_time:ea,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size:Ha,status:z$1.string(),taker_order_id:z$1.string(),trader_side:z$1.enum(["TAKER","MAKER"]),transaction_hash:z$1.string()}).transform(({asset_id:e,bucket_index:t,fee_rate_bps:a,last_update:s,maker_address:f,maker_orders:c,match_time:u,taker_order_id:x,trader_side:k,transaction_hash:h,...W})=>({...W,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:s,makerAddress:f,makerOrders:c,matchedAt:u,takerOrderId:x,traderSide:k,transactionHash:h})),Ue=z($),q=z$1.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),aa),G=z$1.object({id:sa,owner:z$1.string(),payload:z$1.unknown(),timestamp:q,type:z$1.number()}),Ke=z$1.array(G),L=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(L||{}),He=z$1.enum(L),ve=z$1.object({allowances:z$1.record($$1,z$1.string().transform(BigInt)),balance:La}),Ve=z$1.object({scoring:z$1.boolean()}),Ye=z$1.record(z$1.string(),z$1.boolean()),J=z$1.object({asset_address:z$1.string(),asset_rate:Ja,condition_id:X$1,date:ga,earnings:Ja,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:s,...f})=>({...f,assetAddress:e,assetRate:t,conditionId:a,makerAddress:s})),We=z(J),Q=z$1.object({asset_address:z$1.string(),asset_rate:Ja,date:ga,earnings:Ja,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...s})=>({...s,assetAddress:e,assetRate:t,makerAddress:a})),Xe=z$1.array(Q),Ze=z$1.record(X$1,z$1.number()),ee=z$1.object({outcome:z$1.string(),price:Ja,token_id:Ea}).transform(({token_id:e,...t})=>({...t,tokenId:e})),re=z$1.object({asset_address:z$1.string(),end_date:ga,rate_per_day:Ja,start_date:ga,total_rewards:Ja}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:s,total_rewards:f})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:s,totalRewards:f})),te=z$1.object({asset_address:z$1.string(),asset_rate:Ja,earnings:Ja}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),oe=z$1.object({condition_id:X$1,earning_percentage:z$1.number(),earnings:z$1.array(te),event_slug:z$1.string(),image:z$1.string(),maker_address:z$1.string(),market_competitiveness:z$1.number(),market_slug:z$1.string(),question:z$1.string(),rewards_config:z$1.array(re),rewards_max_spread:z$1.number(),rewards_min_size:Ja,tokens:z$1.array(ee)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:s,market_competitiveness:f,market_slug:c,rewards_config:u,rewards_max_spread:x,rewards_min_size:k,...h})=>({...h,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:s,marketCompetitiveness:f,marketSlug:c,rewardsConfig:u,rewardsMaxSpread:x,rewardsMinSize:k})),$e=z(oe);var Qe=z$1.object({apiKey:S,secret:z$1.string(),passphrase:z$1.string()}).transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),er=z$1.object({apiKeys:z$1.array(S)}),rr=z$1.object({key:S,secret:z$1.string(),passphrase:z$1.string()}),N=z$1.object({key:S,createdAt:ga.optional(),revokedAt:ga.nullable().optional()}),tr=z$1.array(z$1.union([S.transform(e=>({key:e})),N])).transform(e=>e.map(t=>N.parse(t)));var ae=z$1.object({id:z$1.string(),tradeType:z$1.string(),takerOrderHash:z$1.string(),builder:z$1.string(),market:z$1.string(),assetId:Ea,side:ua,size:Ha,sizeUsdc:Ha,price:Ha,status:z$1.string(),outcome:z$1.string(),outcomeIndex:z$1.number().int(),owner:z$1.string(),maker:z$1.string(),transactionHash:z$1.string(),matchTime:ea,bucketIndex:z$1.number().int(),fee:Ha,feeUsdc:Ha,err_msg:z$1.string().nullable().optional(),createdAt:ga.optional(),updatedAt:ga.optional()}).transform(({err_msg:e,assetId:t,matchTime:a,...s})=>({...s,tokenId:t,errMsg:e,matchedAt:a})),nr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(ae)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),j=1e4,se=z$1.object({builder_maker_fee_rate_bps:z$1.number(),builder_taker_fee_rate_bps:z$1.number()}).transform(({builder_maker_fee_rate_bps:e,builder_taker_fee_rate_bps:t})=>({maker:e/j,taker:t/j})),ir=se;var pr=z$1.object({canceled:z$1.array(z$1.string()),not_canceled:z$1.record(z$1.string(),z$1.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var F=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(F||{}),hr=z$1.enum(F),lr=z$1.object({mid:Ha}),yr=z$1.record(z$1.string(),Ha),gr=z$1.object({price:Ha}),ne=z$1.record(ua,Ha.optional()),ur=z$1.record(z$1.string(),ne),xr=z$1.object({spread:Ha}),kr=z$1.record(z$1.string(),Ha),_r=z$1.object({price:Ha,side:ua}),ie=z$1.object({price:Ha,side:ua,token_id:Ea}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z$1.object({tokenId:Ea,price:Ha,side:ua});var Or=z$1.array(ie),ce=z$1.object({t:z$1.number().int(),p:z$1.number()}),Tr=z$1.object({history:z$1.array(ce)}),de=z$1.object({condition_id:X$1}).transform(({condition_id:e})=>e),br=de,pe=z$1.object({r:z$1.number().default(0),e:z$1.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),me=z$1.object({t:Ea,o:z$1.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),fe=z$1.object({fd:pe.nullish(),t:z$1.array(me)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),zr=fe;var Se=z$1.object({neg_risk:z$1.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Cr=Se;var K=z$1.object({price:Ha,size:Ha}),he=z$1.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),H=z$1.object({market:X$1,asset_id:Ea,timestamp:ca.nullish(),bids:z$1.array(K),asks:z$1.array(K),min_order_size:Ha,tick_size:Ha,neg_risk:z$1.boolean(),last_trade_price:Ha.nullish(),hash:he}).transform(({asset_id:e,min_order_size:t,tick_size:a,neg_risk:s,last_trade_price:f,...c})=>({...c,tokenId:e,minOrderSize:t,tickSize:a,negRisk:s,lastTradePrice:f})),Dr=H,Br=z$1.array(H);var v=z$1.preprocess(e=>e===""?"0":e,Ha),ye=z$1.object({errorMsg:z$1.string(),makingAmount:v,orderID:z$1.string(),status:z$1.string(),success:z$1.boolean(),takingAmount:v,tradeIDs:z$1.array(z$1.string()).default([]),transactionsHashes:z$1.array(z$1.string()).default([])}),V=(s=>(s.LIVE="live",s.MATCHED="matched",s.DELAYED="delayed",s))(V||{}),ge=z$1.nativeEnum(V),Y=(h=>(h.UNMATCHED="unmatched",h.MARKET_NOT_READY="market_not_ready",h.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",h.INVALID_NONCE="invalid_nonce",h.INVALID_EXPIRATION="invalid_expiration",h.POST_ONLY_WOULD_CROSS="post_only_would_cross",h.FOK_NOT_FILLED="fok_not_filled",h.FAK_NOT_FILLED="fak_not_filled",h.UNKNOWN="unknown",h))(Y||{}),ue=z$1.nativeEnum(Y),xe=z$1.object({ok:z$1.literal(true),orderId:z$1.string().min(1),status:ge,makingAmount:Ha,takingAmount:Ha,tradeIds:z$1.array(z$1.string()),transactionsHashes:z$1.array(Ga)}),ke=z$1.object({ok:z$1.literal(false),code:ue,message:z$1.string().min(1)}),_e=ye.transform(Te),Fr=z$1.array(_e);function Re(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&ze(e.status)}function Oe(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function Te(e){return Re(e)?xe.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:Oe(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):ke.parse({code:be(e),message:e.errorMsg||"Unknown order failure",ok:false})}function be(e){if(e.status==="unmatched")return "unmatched";switch(e.errorMsg){case "the market is not yet ready to process new orders":return "market_not_ready";case "invalid nonce":return "invalid_nonce";case "invalid expiration":return "invalid_expiration";case "invalid post-only order: order crosses book":return "post_only_would_cross";case "order couldn't be fully filled. FOK orders are fully filled or killed.":return "fok_not_filled";case "no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.":return "fak_not_filled"}return e.errorMsg.includes("not enough balance / allowance")?"insufficient_balance_or_allowance":"unknown"}function ze(e){return e==="live"||e==="matched"||e==="delayed"}var Kr="LTE=";var Ae=z$1.object({id:z$1.number().int().optional(),asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ja,total_rewards:Ja.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Ie=z$1.object({condition_id:X$1,rewards_max_spread:z$1.number().optional(),rewards_min_size:Ja.optional(),rewards_config:z$1.array(Ae).optional(),sponsored_daily_rate:Ja.optional(),sponsors_count:z$1.number().int().optional(),native_daily_rate:Ja.optional(),total_daily_rate:Ja.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:s,sponsored_daily_rate:f,sponsors_count:c,native_daily_rate:u,total_daily_rate:x,...k})=>({...k,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:s,sponsoredDailyRate:f,sponsorsCount:c,nativeDailyRate:u,totalDailyRate:x})),Yr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Ie)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),Ce=z$1.object({token_id:Ea,outcome:z$1.string(),price:Ja}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Ee=z$1.object({asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ja,total_rewards:Ja.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Pe=z$1.object({condition_id:X$1,question:z$1.string(),market_slug:z$1.string().optional(),event_slug:z$1.string().optional(),image:z$1.string().optional(),rewards_max_spread:z$1.number().optional(),rewards_min_size:Ja.optional(),market_competitiveness:z$1.number().optional(),tokens:z$1.array(Ce),rewards_config:z$1.array(Ee).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:s,rewards_min_size:f,market_competitiveness:c,rewards_config:u,...x})=>({...x,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:s,rewardsMinSize:f,marketCompetitiveness:c,rewardsConfig:u})),Wr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Pe)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var De=z$1.object({minimum_tick_size:ja}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),qr=De;export{xe as AcceptedOrderResponseSchema,Qe as ApiKeyCredsSchema,er as ApiKeysResponseSchema,L as AssetType,He as AssetTypeSchema,ve as BalanceAllowanceResponseSchema,rr as BuilderApiKeyCredsSchema,N as BuilderApiKeySchema,tr as BuilderApiKeysResponseSchema,se as BuilderFeeRatesSchema,ae as BuilderTradeSchema,pr as CancelOrdersResponseSchema,$ as ClobTradeSchema,Ue as ClobTradesPageSchema,je as ClosedOnlyModeSchema,de as ConditionByTokenSchema,Ie as CurrentRewardSchema,Kr as END_CURSOR,te as EarningSchema,ir as FetchBuilderFeeRatesResponseSchema,zr as FetchMarketInfoResponseSchema,Cr as FetchNegRiskResponseSchema,Dr as FetchOrderBookResponseSchema,qr as FetchTickSizeResponseSchema,_r as LastTradePriceSchema,Or as LastTradePricesSchema,Z as MakerOrderSchema,pe as MarketFeeInfoSchema,fe as MarketInfoSchema,Pe as MarketRewardSchema,me as MarketTokenSchema,lr as MidpointSchema,yr as MidpointsSchema,Se as NegRiskSchema,G as NotificationSchema,Ke as NotificationsResponseSchema,X as OpenOrderSchema,Fe as OpenOrdersPageSchema,he as OrderBookHashSchema,K as OrderBookLevelSchema,H as OrderBookSchema,Br as OrderBooksSchema,V as OrderPostStatus,ge as OrderPostStatusSchema,Y as OrderResponseErrorCode,ue as OrderResponseErrorCodeSchema,_e as OrderResponseSchema,Fr as OrderResponsesSchema,Ve as OrderScoringResponseSchema,Ye as OrdersScoringResponseSchema,nr as PaginatedBuilderTradesSchema,Yr as PaginatedCurrentRewardsSchema,Wr as PaginatedMarketRewardsSchema,F as PriceHistoryInterval,hr as PriceHistoryIntervalSchema,Tr as PriceHistorySchema,gr as PriceSchema,ur as PricesSchema,ke as RejectedOrderResponseSchema,br as ResolveConditionByTokenResponseSchema,re as RewardsConfigSchema,Ze as RewardsPercentagesSchema,xr as SpreadSchema,kr as SpreadsSchema,De as TickSizeSchema,ee as TokenSchema,Q as TotalUserEarningSchema,Xe as TotalUserEarningsResponseSchema,J as UserEarningSchema,We as UserEarningsPageSchema,oe as UserRewardsEarningSchema,$e as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1524,7 +1524,7 @@ declare const ListComboPositionsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1524
1524
|
limit: z.ZodNumber;
|
|
1525
1525
|
offset: z.ZodNumber;
|
|
1526
1526
|
has_more: z.ZodBoolean;
|
|
1527
|
-
next_cursor: z.ZodOptional<z.ZodNullable<z.
|
|
1527
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodCustom<PaginationCursor, PaginationCursor>>>;
|
|
1528
1528
|
}, z.core.$strip>;
|
|
1529
1529
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1530
1530
|
pagination: {
|
package/dist/data/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Ma,ba,Ja,X as X$1,Ea,Ga,xa,W as W$1,ka,la,ma,wa}from'../chunk-SB2LAVJ4.js';import {z}from'zod';var p=z.string(),v=z.string(),C=(u=>(u.TRADE="TRADE",u.SPLIT="SPLIT",u.MERGE="MERGE",u.REDEEM="REDEEM",u.REWARD="REWARD",u.CONVERSION="CONVERSION",u.MAKER_REBATE="MAKER_REBATE",u.REFERRAL_REWARD="REFERRAL_REWARD",u.YIELD="YIELD",u))(C||{}),D=z.enum(C),P=z.enum(["BUY","SELL"]),ce=z.enum(["DAY","WEEK","MONTH","ALL"]),ue=z.enum(["OVERALL","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"]),me=z.enum(["PNL","VOL"]);var h=z.preprocess(e=>e===""?void 0:e,z.string().optional()),w=z.object({proxyWallet:p.nullish(),side:P.nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),size:Ja.nullish(),price:Ja.nullish(),timestamp:ba.nullish(),title:z.string().nullish(),slug:z.string().nullish(),icon:z.preprocess(Ma,z.string().nullish()),eventSlug:z.string().nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish(),name:z.string().nullish(),pseudonym:z.string().nullish(),bio:z.string().nullish(),profileImage:z.string().nullish(),profileImageOptimized:z.string().nullish(),transactionHash:z.string().nullish()}).transform(({asset:e,proxyWallet:i,...r})=>({...r,wallet:i,tokenId:e})),W=z.object({proxyWallet:p.nullish(),timestamp:ba.nullish(),conditionId:z.preprocess(e=>e===""?void 0:e,z.string().optional()),type:D,size:Ja.nullish(),usdcSize:Ja.nullish(),transactionHash:Ga.nullish(),price:Ja.nullish(),asset:z.preprocess(e=>e===""?void 0:e,z.string().optional()),side:z.preprocess(e=>e===""?void 0:e,P.nullish()),isCombo:z.boolean().optional(),outcomeIndex:z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),title:h,slug:h,icon:h,eventSlug:h,outcome:h,name:h,pseudonym:h,bio:h,profileImage:h,profileImageOptimized:h}),N=W.transform(F),Se=z.object({user:p.nullish(),traded:z.number().int().nullish()}),fe=z.array(w),xe=z.array(N);function F(e){let i=Y(e);switch(e.type){case "TRADE":return U(e,i);case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...i,type:e.type,conditionId:X$1.parse(l(e.conditionId,"conditionId")),amount:T(e),title:l(e.title,"title"),slug:l(e.slug,"slug"),icon:e.icon??null,eventSlug:l(e.eventSlug,"eventSlug")};case "REWARD":case "MAKER_REBATE":case "REFERRAL_REWARD":case "YIELD":return {...i,type:e.type,amount:T(e)}}}function U(e,i){let r={...i,type:"TRADE",side:l(e.side,"side"),shares:l(e.size,"size"),amount:T(e),price:l(e.price,"price"),title:l(e.title,"title"),icon:e.icon??null};return e.isCombo===true?{...r,isCombo:true,conditionId:W$1.parse(l(e.conditionId,"conditionId")),positionId:xa.parse(l(e.asset,"asset"))}:{...r,isCombo:false,conditionId:X$1.parse(l(e.conditionId,"conditionId")),tokenId:Ea.parse(l(e.asset,"asset")),outcome:l(e.outcome,"outcome"),outcomeIndex:l(e.outcomeIndex,"outcomeIndex"),slug:l(e.slug,"slug"),eventSlug:l(e.eventSlug,"eventSlug")}}function Y(e){return {wallet:l(e.proxyWallet,"proxyWallet"),timestamp:l(e.timestamp,"timestamp"),transactionHash:l(e.transactionHash,"transactionHash"),name:e.name??null,pseudonym:e.pseudonym??null,bio:e.bio??null,profileImage:e.profileImage??null,profileImageOptimized:e.profileImageOptimized??null}}function T(e){return l(e.usdcSize??e.size,"usdcSize")}function l(e,i){if(e==null)throw new TypeError(`Expected activity.${i} to be present`);return e}var K=z.object({proxyWallet:p.nullish(),bio:z.string().nullish(),asset:Ea.nullish(),pseudonym:z.string().nullish(),amount:Ja.nullish(),displayUsernamePublic:z.boolean().nullish(),outcomeIndex:z.number().int().nullish(),name:z.string().nullish(),profileImage:z.string().nullish(),profileImageOptimized:z.string().nullish()}).transform(({asset:e,proxyWallet:i,...r})=>({...r,wallet:i,tokenId:e})),G=z.object({token:z.string().nullish(),holders:z.array(K).nullish()}),Z=z.object({market:v.nullish(),value:Ja.nullish()}),$=z.object({market:v.nullish(),value:Ja.nullish()}),q=z.object({total:Ja.nullish(),markets:z.array($).nullish()}),Ee=z.array(G),Le=z.array(Z),ve=z.array(q);var J=z.object({rank:z.string().nullish(),builder:z.string().nullish(),volume:Ja.nullish(),activeUsers:z.number().int().nullish(),verified:z.boolean().nullish(),builderLogo:z.string().nullish()}),Q=z.object({dt:ka.nullish(),builder:z.string().nullish(),builderLogo:z.string().nullish(),verified:z.boolean().nullish(),volume:Ja.nullish(),activeUsers:z.number().int().nullish(),rank:z.string().nullish()}).transform(({dt:e,...i})=>({...i,bucketAt:e})),X=z.object({rank:z.string().nullish(),proxyWallet:p.nullish(),userName:z.string().nullish(),vol:Ja.nullish(),pnl:Ja.nullish(),profileImage:z.string().nullish(),xUsername:z.string().nullish(),verifiedBadge:z.boolean().nullish()}).transform(({proxyWallet:e,...i})=>({...i,wallet:e})),_e=z.array(J),Me=z.array(Q),ke=z.array(X);var O=(d=>(d.Open="OPEN",d.Partial="PARTIAL",d.ResolvedWin="RESOLVED_WIN",d.ResolvedLoss="RESOLVED_LOSS",d))(O||{}),B=z.enum(O),ee=z.object({proxyWallet:p.nullish(),asset:Ea.nullish(),conditionId:X$1,size:Ja.nullish(),avgPrice:Ja.nullish(),initialValue:Ja.nullish(),currentValue:Ja.nullish(),cashPnl:Ja.nullish(),percentPnl:z.number().nullish(),totalBought:Ja.nullish(),realizedPnl:Ja.nullish(),percentRealizedPnl:z.number().nullish(),curPrice:Ja.nullish(),redeemable:z.boolean().nullish(),mergeable:z.boolean().nullish(),title:z.string().nullish(),slug:z.string().nullish(),icon:z.preprocess(Ma,z.string().nullish()),eventId:z.string().nullish(),eventSlug:z.string().nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish(),oppositeOutcome:z.string().nullish(),oppositeAsset:Ea.nullish(),endDate:la.nullish(),negativeRisk:z.boolean().nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e,oppositeTokenId:i})),te=z.object({proxyWallet:p.nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),avgPrice:Ja.nullish(),totalBought:Ja.nullish(),realizedPnl:Ja.nullish(),curPrice:Ja.nullish(),timestamp:ba.nullish(),title:z.string().nullish(),slug:z.string().nullish(),icon:z.preprocess(Ma,z.string().nullish()),eventSlug:z.string().nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish(),oppositeOutcome:z.string().nullish(),oppositeAsset:Ea.nullish(),endDate:ma.nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e,oppositeTokenId:i})),oe=z.object({user:p.nullish(),value:Ja.nullish()}),ie=z.object({proxyWallet:p.nullish(),name:z.string().nullish(),profileImage:z.string().nullish(),verified:z.boolean().nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),avgPrice:Ja.nullish(),size:Ja.nullish(),currPrice:Ja.nullish(),currentValue:Ja.nullish(),cashPnl:Ja.nullish(),totalBought:Ja.nullish(),realizedPnl:Ja.nullish(),totalPnl:Ja.nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish()}).transform(({asset:e,proxyWallet:i,...r})=>({...r,wallet:i,tokenId:e})),ne=z.object({token:z.string().nullish(),positions:z.array(ie).nullish()}),se=z.object({event_id:z.string().nullish(),event_slug:z.string().nullish(),event_title:z.string().nullish(),event_image:z.string().nullish()}).transform(({event_id:e,event_slug:i,event_title:r,event_image:c})=>({eventId:e,eventSlug:i,eventTitle:r,eventImage:c})),re=z.object({market_id:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),outcome:z.string().nullish(),image_url:z.string().nullish(),icon_url:z.string().nullish(),category:z.string().nullish(),subcategory:z.string().nullish(),tags:z.array(z.string()).nullish(),end_date:ka.nullish(),event:se.nullish()}).transform(({market_id:e,image_url:i,icon_url:r,end_date:c,...d})=>({...d,marketId:e,imageUrl:i,iconUrl:r,endDate:c})),le=z.object({leg_index:z.number().int(),leg_position_id:xa,leg_condition_id:X$1,leg_outcome_index:z.number().int(),leg_outcome_label:z.string().nullish(),leg_status:B,leg_resolved_at:ka.nullish(),leg_current_price:Ja.nullish(),market:re.nullish()}).transform(({leg_index:e,leg_position_id:i,leg_condition_id:r,leg_outcome_index:c,leg_outcome_label:d,leg_status:I,leg_resolved_at:A,leg_current_price:E,...L})=>({...L,legIndex:e,legPositionId:i,legConditionId:r,legOutcomeIndex:c,legOutcomeLabel:d,legStatus:I,legResolvedAt:A,legCurrentPrice:E})),ae=z.object({combo_condition_id:W$1,combo_position_id:xa,module_id:z.number().int(),user_address:p,shares_balance:Ja,entry_avg_price_usdc:Ja.nullish(),entry_cost_usdc:Ja.nullish(),status:B,first_entry_at:ka,resolved_at:ka.nullish(),legs_total:z.number().int(),legs_resolved:z.number().int(),legs_pending:z.number().int(),legs:z.array(le)}).transform(({combo_condition_id:e,combo_position_id:i,module_id:r,user_address:c,shares_balance:d,entry_avg_price_usdc:I,entry_cost_usdc:A,first_entry_at:E,resolved_at:L,legs_total:u,legs_resolved:V,legs_pending:H,...j})=>({...j,conditionId:e,positionId:i,moduleId:r,userAddress:c,shares:d,entryAvgPriceUsdc:I,entryCostUsdc:A,firstEntryAt:E,resolvedAt:L,legsTotal:u,legsResolved:V,legsPending:H})),He=z.object({combos:z.array(ae),pagination:z.object({limit:z.number().int(),offset:z.number().int(),has_more:z.boolean(),next_cursor:wa.nullish()})}).transform(({pagination:e,...i})=>({...i,pagination:{limit:e.limit,offset:e.offset,hasMore:e.has_more,nextCursor:e.next_cursor}})),je=z.array(ee),we=z.array(te),We=z.array(oe),Ne=z.array(ne);export{N as ActivitySchema,C as ActivityType,D as ActivityTypeSchema,p as AddressSchema,Q as BuilderVolumeEntrySchema,te as ClosedPositionSchema,le as ComboPositionLegSchema,se as ComboPositionMarketEventSchema,re as ComboPositionMarketSchema,ae as ComboPositionSchema,O as ComboPositionStatus,B as ComboPositionStatusSchema,ve as FetchEventLiveVolumeResponseSchema,We as FetchPortfolioValueResponseSchema,v as Hash64Schema,K as HolderSchema,ue as LeaderboardCategorySchema,J as LeaderboardEntrySchema,me as LeaderboardOrderBySchema,xe as ListActivityResponseSchema,_e as ListBuilderLeaderboardResponseSchema,Me as ListBuilderVolumeResponseSchema,we as ListClosedPositionsResponseSchema,He as ListComboPositionsResponseSchema,Ee as ListMarketHoldersResponseSchema,Ne as ListMarketPositionsResponseSchema,Le as ListOpenInterestResponseSchema,je as ListPositionsResponseSchema,ke as ListTraderLeaderboardResponseSchema,fe as ListTradesResponseSchema,q as LiveVolumeSchema,ie as MarketPositionSchema,$ as MarketVolumeSchema,G as MetaHolderSchema,ne as MetaMarketPositionSchema,Z as OpenInterestSchema,ee as PositionSchema,P as SideSchema,ce as TimePeriodSchema,w as TradeSchema,Se as TradedSchema,X as TraderLeaderboardEntrySchema,oe as ValueSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {Ma,ba,Ja,X as X$1,Ea,Ga,xa,W as W$1,ka,la,ma,wa}from'../chunk-VBHCYSM7.js';import {z}from'zod';var p=z.string(),v=z.string(),C=(u=>(u.TRADE="TRADE",u.SPLIT="SPLIT",u.MERGE="MERGE",u.REDEEM="REDEEM",u.REWARD="REWARD",u.CONVERSION="CONVERSION",u.MAKER_REBATE="MAKER_REBATE",u.REFERRAL_REWARD="REFERRAL_REWARD",u.YIELD="YIELD",u))(C||{}),D=z.enum(C),P=z.enum(["BUY","SELL"]),ce=z.enum(["DAY","WEEK","MONTH","ALL"]),ue=z.enum(["OVERALL","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"]),me=z.enum(["PNL","VOL"]);var h=z.preprocess(e=>e===""?void 0:e,z.string().optional()),w=z.object({proxyWallet:p.nullish(),side:P.nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),size:Ja.nullish(),price:Ja.nullish(),timestamp:ba.nullish(),title:z.string().nullish(),slug:z.string().nullish(),icon:z.preprocess(Ma,z.string().nullish()),eventSlug:z.string().nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish(),name:z.string().nullish(),pseudonym:z.string().nullish(),bio:z.string().nullish(),profileImage:z.string().nullish(),profileImageOptimized:z.string().nullish(),transactionHash:z.string().nullish()}).transform(({asset:e,proxyWallet:i,...r})=>({...r,wallet:i,tokenId:e})),W=z.object({proxyWallet:p.nullish(),timestamp:ba.nullish(),conditionId:z.preprocess(e=>e===""?void 0:e,z.string().optional()),type:D,size:Ja.nullish(),usdcSize:Ja.nullish(),transactionHash:Ga.nullish(),price:Ja.nullish(),asset:z.preprocess(e=>e===""?void 0:e,z.string().optional()),side:z.preprocess(e=>e===""?void 0:e,P.nullish()),isCombo:z.boolean().optional(),outcomeIndex:z.preprocess(e=>e===999?void 0:e,z.number().int().optional()),title:h,slug:h,icon:h,eventSlug:h,outcome:h,name:h,pseudonym:h,bio:h,profileImage:h,profileImageOptimized:h}),N=W.transform(F),Se=z.object({user:p.nullish(),traded:z.number().int().nullish()}),fe=z.array(w),xe=z.array(N);function F(e){let i=Y(e);switch(e.type){case "TRADE":return U(e,i);case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...i,type:e.type,conditionId:X$1.parse(l(e.conditionId,"conditionId")),amount:T(e),title:l(e.title,"title"),slug:l(e.slug,"slug"),icon:e.icon??null,eventSlug:l(e.eventSlug,"eventSlug")};case "REWARD":case "MAKER_REBATE":case "REFERRAL_REWARD":case "YIELD":return {...i,type:e.type,amount:T(e)}}}function U(e,i){let r={...i,type:"TRADE",side:l(e.side,"side"),shares:l(e.size,"size"),amount:T(e),price:l(e.price,"price"),title:l(e.title,"title"),icon:e.icon??null};return e.isCombo===true?{...r,isCombo:true,conditionId:W$1.parse(l(e.conditionId,"conditionId")),positionId:xa.parse(l(e.asset,"asset"))}:{...r,isCombo:false,conditionId:X$1.parse(l(e.conditionId,"conditionId")),tokenId:Ea.parse(l(e.asset,"asset")),outcome:l(e.outcome,"outcome"),outcomeIndex:l(e.outcomeIndex,"outcomeIndex"),slug:l(e.slug,"slug"),eventSlug:l(e.eventSlug,"eventSlug")}}function Y(e){return {wallet:l(e.proxyWallet,"proxyWallet"),timestamp:l(e.timestamp,"timestamp"),transactionHash:l(e.transactionHash,"transactionHash"),name:e.name??null,pseudonym:e.pseudonym??null,bio:e.bio??null,profileImage:e.profileImage??null,profileImageOptimized:e.profileImageOptimized??null}}function T(e){return l(e.usdcSize??e.size,"usdcSize")}function l(e,i){if(e==null)throw new TypeError(`Expected activity.${i} to be present`);return e}var K=z.object({proxyWallet:p.nullish(),bio:z.string().nullish(),asset:Ea.nullish(),pseudonym:z.string().nullish(),amount:Ja.nullish(),displayUsernamePublic:z.boolean().nullish(),outcomeIndex:z.number().int().nullish(),name:z.string().nullish(),profileImage:z.string().nullish(),profileImageOptimized:z.string().nullish()}).transform(({asset:e,proxyWallet:i,...r})=>({...r,wallet:i,tokenId:e})),G=z.object({token:z.string().nullish(),holders:z.array(K).nullish()}),Z=z.object({market:v.nullish(),value:Ja.nullish()}),$=z.object({market:v.nullish(),value:Ja.nullish()}),q=z.object({total:Ja.nullish(),markets:z.array($).nullish()}),Ee=z.array(G),Le=z.array(Z),ve=z.array(q);var J=z.object({rank:z.string().nullish(),builder:z.string().nullish(),volume:Ja.nullish(),activeUsers:z.number().int().nullish(),verified:z.boolean().nullish(),builderLogo:z.string().nullish()}),Q=z.object({dt:ka.nullish(),builder:z.string().nullish(),builderLogo:z.string().nullish(),verified:z.boolean().nullish(),volume:Ja.nullish(),activeUsers:z.number().int().nullish(),rank:z.string().nullish()}).transform(({dt:e,...i})=>({...i,bucketAt:e})),X=z.object({rank:z.string().nullish(),proxyWallet:p.nullish(),userName:z.string().nullish(),vol:Ja.nullish(),pnl:Ja.nullish(),profileImage:z.string().nullish(),xUsername:z.string().nullish(),verifiedBadge:z.boolean().nullish()}).transform(({proxyWallet:e,...i})=>({...i,wallet:e})),_e=z.array(J),Me=z.array(Q),ke=z.array(X);var O=(d=>(d.Open="OPEN",d.Partial="PARTIAL",d.ResolvedWin="RESOLVED_WIN",d.ResolvedLoss="RESOLVED_LOSS",d))(O||{}),B=z.enum(O),ee=z.object({proxyWallet:p.nullish(),asset:Ea.nullish(),conditionId:X$1,size:Ja.nullish(),avgPrice:Ja.nullish(),initialValue:Ja.nullish(),currentValue:Ja.nullish(),cashPnl:Ja.nullish(),percentPnl:z.number().nullish(),totalBought:Ja.nullish(),realizedPnl:Ja.nullish(),percentRealizedPnl:z.number().nullish(),curPrice:Ja.nullish(),redeemable:z.boolean().nullish(),mergeable:z.boolean().nullish(),title:z.string().nullish(),slug:z.string().nullish(),icon:z.preprocess(Ma,z.string().nullish()),eventId:z.string().nullish(),eventSlug:z.string().nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish(),oppositeOutcome:z.string().nullish(),oppositeAsset:Ea.nullish(),endDate:la.nullish(),negativeRisk:z.boolean().nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e,oppositeTokenId:i})),te=z.object({proxyWallet:p.nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),avgPrice:Ja.nullish(),totalBought:Ja.nullish(),realizedPnl:Ja.nullish(),curPrice:Ja.nullish(),timestamp:ba.nullish(),title:z.string().nullish(),slug:z.string().nullish(),icon:z.preprocess(Ma,z.string().nullish()),eventSlug:z.string().nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish(),oppositeOutcome:z.string().nullish(),oppositeAsset:Ea.nullish(),endDate:ma.nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e,oppositeTokenId:i})),oe=z.object({user:p.nullish(),value:Ja.nullish()}),ie=z.object({proxyWallet:p.nullish(),name:z.string().nullish(),profileImage:z.string().nullish(),verified:z.boolean().nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),avgPrice:Ja.nullish(),size:Ja.nullish(),currPrice:Ja.nullish(),currentValue:Ja.nullish(),cashPnl:Ja.nullish(),totalBought:Ja.nullish(),realizedPnl:Ja.nullish(),totalPnl:Ja.nullish(),outcome:z.string().nullish(),outcomeIndex:z.number().int().nullish()}).transform(({asset:e,proxyWallet:i,...r})=>({...r,wallet:i,tokenId:e})),ne=z.object({token:z.string().nullish(),positions:z.array(ie).nullish()}),se=z.object({event_id:z.string().nullish(),event_slug:z.string().nullish(),event_title:z.string().nullish(),event_image:z.string().nullish()}).transform(({event_id:e,event_slug:i,event_title:r,event_image:c})=>({eventId:e,eventSlug:i,eventTitle:r,eventImage:c})),re=z.object({market_id:z.string().nullish(),slug:z.string().nullish(),title:z.string().nullish(),outcome:z.string().nullish(),image_url:z.string().nullish(),icon_url:z.string().nullish(),category:z.string().nullish(),subcategory:z.string().nullish(),tags:z.array(z.string()).nullish(),end_date:ka.nullish(),event:se.nullish()}).transform(({market_id:e,image_url:i,icon_url:r,end_date:c,...d})=>({...d,marketId:e,imageUrl:i,iconUrl:r,endDate:c})),le=z.object({leg_index:z.number().int(),leg_position_id:xa,leg_condition_id:X$1,leg_outcome_index:z.number().int(),leg_outcome_label:z.string().nullish(),leg_status:B,leg_resolved_at:ka.nullish(),leg_current_price:Ja.nullish(),market:re.nullish()}).transform(({leg_index:e,leg_position_id:i,leg_condition_id:r,leg_outcome_index:c,leg_outcome_label:d,leg_status:I,leg_resolved_at:A,leg_current_price:E,...L})=>({...L,legIndex:e,legPositionId:i,legConditionId:r,legOutcomeIndex:c,legOutcomeLabel:d,legStatus:I,legResolvedAt:A,legCurrentPrice:E})),ae=z.object({combo_condition_id:W$1,combo_position_id:xa,module_id:z.number().int(),user_address:p,shares_balance:Ja,entry_avg_price_usdc:Ja.nullish(),entry_cost_usdc:Ja.nullish(),status:B,first_entry_at:ka,resolved_at:ka.nullish(),legs_total:z.number().int(),legs_resolved:z.number().int(),legs_pending:z.number().int(),legs:z.array(le)}).transform(({combo_condition_id:e,combo_position_id:i,module_id:r,user_address:c,shares_balance:d,entry_avg_price_usdc:I,entry_cost_usdc:A,first_entry_at:E,resolved_at:L,legs_total:u,legs_resolved:V,legs_pending:H,...j})=>({...j,conditionId:e,positionId:i,moduleId:r,userAddress:c,shares:d,entryAvgPriceUsdc:I,entryCostUsdc:A,firstEntryAt:E,resolvedAt:L,legsTotal:u,legsResolved:V,legsPending:H})),He=z.object({combos:z.array(ae),pagination:z.object({limit:z.number().int(),offset:z.number().int(),has_more:z.boolean(),next_cursor:wa.nullish()})}).transform(({pagination:e,...i})=>({...i,pagination:{limit:e.limit,offset:e.offset,hasMore:e.has_more,nextCursor:e.next_cursor}})),je=z.array(ee),we=z.array(te),We=z.array(oe),Ne=z.array(ne);export{N as ActivitySchema,C as ActivityType,D as ActivityTypeSchema,p as AddressSchema,Q as BuilderVolumeEntrySchema,te as ClosedPositionSchema,le as ComboPositionLegSchema,se as ComboPositionMarketEventSchema,re as ComboPositionMarketSchema,ae as ComboPositionSchema,O as ComboPositionStatus,B as ComboPositionStatusSchema,ve as FetchEventLiveVolumeResponseSchema,We as FetchPortfolioValueResponseSchema,v as Hash64Schema,K as HolderSchema,ue as LeaderboardCategorySchema,J as LeaderboardEntrySchema,me as LeaderboardOrderBySchema,xe as ListActivityResponseSchema,_e as ListBuilderLeaderboardResponseSchema,Me as ListBuilderVolumeResponseSchema,we as ListClosedPositionsResponseSchema,He as ListComboPositionsResponseSchema,Ee as ListMarketHoldersResponseSchema,Ne as ListMarketPositionsResponseSchema,Le as ListOpenInterestResponseSchema,je as ListPositionsResponseSchema,ke as ListTraderLeaderboardResponseSchema,fe as ListTradesResponseSchema,q as LiveVolumeSchema,ie as MarketPositionSchema,$ as MarketVolumeSchema,G as MetaHolderSchema,ne as MetaMarketPositionSchema,Z as OpenInterestSchema,ee as PositionSchema,P as SideSchema,ce as TimePeriodSchema,w as TradeSchema,Se as TradedSchema,X as TraderLeaderboardEntrySchema,oe as ValueSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|