@polymarket/bindings 0.1.0-beta.2 → 0.1.0-beta.4

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.
@@ -1,2 +1,2 @@
1
- import {U as U$1,ua,Q as Q$1,qa,sa,aa,ba,ca}from'../chunk-TM2ZY32Q.js';import {z as z$1}from'zod';var a=z$1.string(),g=z$1.string(),f=(m=>(m.TRADE="TRADE",m.SPLIT="SPLIT",m.MERGE="MERGE",m.REDEEM="REDEEM",m.REWARD="REWARD",m.CONVERSION="CONVERSION",m.MAKER_REBATE="MAKER_REBATE",m.REFERRAL_REWARD="REFERRAL_REWARD",m.YIELD="YIELD",m))(f||{}),b=z$1.enum(f),x=z$1.enum(["BUY","SELL"]),U=z$1.enum(["DAY","WEEK","MONTH","ALL"]),K=z$1.enum(["OVERALL","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"]),G=z$1.enum(["PNL","VOL"]);var u=z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),z=z$1.object({proxyWallet:a.nullish(),side:x.nullish(),asset:qa.nullish(),conditionId:Q$1.nullish(),size:ua.nullish(),price:ua.nullish(),timestamp:U$1.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.string().nullish(),eventSlug:z$1.string().nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish(),name:z$1.string().nullish(),pseudonym:z$1.string().nullish(),bio:z$1.string().nullish(),profileImage:z$1.string().nullish(),profileImageOptimized:z$1.string().nullish(),transactionHash:z$1.string().nullish()}).transform(({asset:e,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e})),T=z$1.object({proxyWallet:a.nullish(),timestamp:U$1.nullish(),conditionId:z$1.preprocess(e=>e===""?void 0:e,Q$1.optional()),type:b,size:ua.nullish(),usdcSize:ua.nullish(),transactionHash:sa.nullish(),price:ua.nullish(),asset:z$1.preprocess(e=>e===""?void 0:e,qa.optional()),side:z$1.preprocess(e=>e===""?void 0:e,x.nullish()),outcomeIndex:z$1.preprocess(e=>e===999?void 0:e,z$1.number().int().optional()),title:u,slug:u,icon:u,eventSlug:u,outcome:u,name:u,pseudonym:u,bio:u,profileImage:u,profileImageOptimized:u}),P=T.transform(M),Q=z$1.object({user:a.nullish(),traded:z$1.number().int().nullish()}),X=z$1.array(z),ee=z$1.array(P);function M(e){let r=v(e);switch(e.type){case "TRADE":return {...r,type:e.type,conditionId:s(e.conditionId,"conditionId"),tokenId:s(e.asset,"asset"),side:s(e.side,"side"),shares:s(e.size,"size"),amount:R(e),price:s(e.price,"price"),outcome:s(e.outcome,"outcome"),outcomeIndex:s(e.outcomeIndex,"outcomeIndex"),title:s(e.title,"title"),slug:s(e.slug,"slug"),icon:s(e.icon,"icon"),eventSlug:s(e.eventSlug,"eventSlug")};case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...r,type:e.type,conditionId:s(e.conditionId,"conditionId"),amount:R(e),title:s(e.title,"title"),slug:s(e.slug,"slug"),icon:s(e.icon,"icon"),eventSlug:s(e.eventSlug,"eventSlug")};case "REWARD":case "MAKER_REBATE":case "REFERRAL_REWARD":case "YIELD":return {...r,type:e.type,amount:R(e)}}}function v(e){return {wallet:s(e.proxyWallet,"proxyWallet"),timestamp:s(e.timestamp,"timestamp"),transactionHash:s(e.transactionHash,"transactionHash"),name:e.name??null,pseudonym:e.pseudonym??null,bio:e.bio??null,profileImage:e.profileImage??null,profileImageOptimized:e.profileImageOptimized??null}}function R(e){return s(e.usdcSize??e.size,"usdcSize")}function s(e,r){if(e==null)throw new TypeError(`Expected activity.${r} to be present`);return e}var D=z$1.object({proxyWallet:a.nullish(),bio:z$1.string().nullish(),asset:qa.nullish(),pseudonym:z$1.string().nullish(),amount:ua.nullish(),displayUsernamePublic:z$1.boolean().nullish(),outcomeIndex:z$1.number().int().nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),profileImageOptimized:z$1.string().nullish()}).transform(({asset:e,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e})),k=z$1.object({token:z$1.string().nullish(),holders:z$1.array(D).nullish()}),O=z$1.object({market:g.nullish(),value:ua.nullish()}),B=z$1.object({market:g.nullish(),value:ua.nullish()}),C=z$1.object({total:ua.nullish(),markets:z$1.array(B).nullish()}),se=z$1.array(k),re=z$1.array(O),le=z$1.array(C);var V=z$1.object({rank:z$1.string().nullish(),builder:z$1.string().nullish(),volume:ua.nullish(),activeUsers:z$1.number().int().nullish(),verified:z$1.boolean().nullish(),builderLogo:z$1.string().nullish()}),H=z$1.object({dt:aa.nullish(),builder:z$1.string().nullish(),builderLogo:z$1.string().nullish(),verified:z$1.boolean().nullish(),volume:ua.nullish(),activeUsers:z$1.number().int().nullish(),rank:z$1.string().nullish()}).transform(({dt:e,...r})=>({...r,bucketAt:e})),w=z$1.object({rank:z$1.string().nullish(),proxyWallet:a.nullish(),userName:z$1.string().nullish(),vol:ua.nullish(),pnl:ua.nullish(),profileImage:z$1.string().nullish(),xUsername:z$1.string().nullish(),verifiedBadge:z$1.boolean().nullish()}).transform(({proxyWallet:e,...r})=>({...r,wallet:e})),me=z$1.array(V),he=z$1.array(H),de=z$1.array(w);var W=z$1.object({proxyWallet:a.nullish(),asset:qa.nullish(),conditionId:Q$1,size:ua.nullish(),avgPrice:ua.nullish(),initialValue:ua.nullish(),currentValue:ua.nullish(),cashPnl:ua.nullish(),percentPnl:z$1.number().nullish(),totalBought:ua.nullish(),realizedPnl:ua.nullish(),percentRealizedPnl:z$1.number().nullish(),curPrice:ua.nullish(),redeemable:z$1.boolean().nullish(),mergeable:z$1.boolean().nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.string().nullish(),eventId:z$1.string().nullish(),eventSlug:z$1.string().nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish(),oppositeOutcome:z$1.string().nullish(),oppositeAsset:qa.nullish(),endDate:ba.nullish(),negativeRisk:z$1.boolean().nullish()}).transform(({asset:e,oppositeAsset:r,proxyWallet:c,...S})=>({...S,wallet:c,tokenId:e,oppositeTokenId:r})),j=z$1.object({proxyWallet:a.nullish(),asset:qa.nullish(),conditionId:Q$1.nullish(),avgPrice:ua.nullish(),totalBought:ua.nullish(),realizedPnl:ua.nullish(),curPrice:ua.nullish(),timestamp:U$1.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.string().nullish(),eventSlug:z$1.string().nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish(),oppositeOutcome:z$1.string().nullish(),oppositeAsset:qa.nullish(),endDate:ca.nullish()}).transform(({asset:e,oppositeAsset:r,proxyWallet:c,...S})=>({...S,wallet:c,tokenId:e,oppositeTokenId:r})),N=z$1.object({user:a.nullish(),value:ua.nullish()}),F=z$1.object({proxyWallet:a.nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),verified:z$1.boolean().nullish(),asset:qa.nullish(),conditionId:Q$1.nullish(),avgPrice:ua.nullish(),size:ua.nullish(),currPrice:ua.nullish(),currentValue:ua.nullish(),cashPnl:ua.nullish(),totalBought:ua.nullish(),realizedPnl:ua.nullish(),totalPnl:ua.nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish()}).transform(({asset:e,proxyWallet:r,...c})=>({...c,wallet:r,tokenId:e})),Y=z$1.object({token:z$1.string().nullish(),positions:z$1.array(F).nullish()}),xe=z$1.array(W),Re=z$1.array(j),Ee=z$1.array(N),Ie=z$1.array(Y);export{P as ActivitySchema,f as ActivityType,b as ActivityTypeSchema,a as AddressSchema,H as BuilderVolumeEntrySchema,j as ClosedPositionSchema,le as FetchEventLiveVolumeResponseSchema,Ee as FetchPortfolioValueResponseSchema,g as Hash64Schema,D as HolderSchema,K as LeaderboardCategorySchema,V as LeaderboardEntrySchema,G as LeaderboardOrderBySchema,ee as ListActivityResponseSchema,me as ListBuilderLeaderboardResponseSchema,he as ListBuilderVolumeResponseSchema,Re as ListClosedPositionsResponseSchema,se as ListMarketHoldersResponseSchema,Ie as ListMarketPositionsResponseSchema,re as ListOpenInterestResponseSchema,xe as ListPositionsResponseSchema,de as ListTraderLeaderboardResponseSchema,X as ListTradesResponseSchema,C as LiveVolumeSchema,F as MarketPositionSchema,B as MarketVolumeSchema,k as MetaHolderSchema,Y as MetaMarketPositionSchema,O as OpenInterestSchema,W as PositionSchema,x as SideSchema,U as TimePeriodSchema,z as TradeSchema,Q as TradedSchema,w as TraderLeaderboardEntrySchema,N as ValueSchema};//# sourceMappingURL=index.js.map
1
+ import {ba,Ia,X as X$1,Ea,Ga,ka,la,ma,xa,W as W$1,wa}from'../chunk-IHJYHHWK.js';import {z as z$1}from'zod';var u=z$1.string(),L=z$1.string(),A=(m=>(m.TRADE="TRADE",m.SPLIT="SPLIT",m.MERGE="MERGE",m.REDEEM="REDEEM",m.REWARD="REWARD",m.CONVERSION="CONVERSION",m.MAKER_REBATE="MAKER_REBATE",m.REFERRAL_REWARD="REFERRAL_REWARD",m.YIELD="YIELD",m))(A||{}),k=z$1.enum(A),P=z$1.enum(["BUY","SELL"]),ae=z$1.enum(["DAY","WEEK","MONTH","ALL"]),ue=z$1.enum(["OVERALL","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"]),pe=z$1.enum(["PNL","VOL"]);var h=z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),j=z$1.object({proxyWallet:u.nullish(),side:P.nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),size:Ia.nullish(),price:Ia.nullish(),timestamp:ba.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.string().nullish(),eventSlug:z$1.string().nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish(),name:z$1.string().nullish(),pseudonym:z$1.string().nullish(),bio:z$1.string().nullish(),profileImage:z$1.string().nullish(),profileImageOptimized:z$1.string().nullish(),transactionHash:z$1.string().nullish()}).transform(({asset:e,proxyWallet:i,...a})=>({...a,wallet:i,tokenId:e})),w=z$1.object({proxyWallet:u.nullish(),timestamp:ba.nullish(),conditionId:z$1.preprocess(e=>e===""?void 0:e,X$1.optional()),type:k,size:Ia.nullish(),usdcSize:Ia.nullish(),transactionHash:Ga.nullish(),price:Ia.nullish(),asset:z$1.preprocess(e=>e===""?void 0:e,Ea.optional()),side:z$1.preprocess(e=>e===""?void 0:e,P.nullish()),outcomeIndex:z$1.preprocess(e=>e===999?void 0:e,z$1.number().int().optional()),title:h,slug:h,icon:h,eventSlug:h,outcome:h,name:h,pseudonym:h,bio:h,profileImage:h,profileImageOptimized:h}),W=w.transform(N),ge=z$1.object({user:u.nullish(),traded:z$1.number().int().nullish()}),ye=z$1.array(j),Se=z$1.array(W);function N(e){let i=F(e);switch(e.type){case "TRADE":return {...i,type:e.type,conditionId:r(e.conditionId,"conditionId"),tokenId:r(e.asset,"asset"),side:r(e.side,"side"),shares:r(e.size,"size"),amount:z(e),price:r(e.price,"price"),outcome:r(e.outcome,"outcome"),outcomeIndex:r(e.outcomeIndex,"outcomeIndex"),title:r(e.title,"title"),slug:r(e.slug,"slug"),icon:e.icon??null,eventSlug:r(e.eventSlug,"eventSlug")};case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...i,type:e.type,conditionId:r(e.conditionId,"conditionId"),amount:z(e),title:r(e.title,"title"),slug:r(e.slug,"slug"),icon:e.icon??null,eventSlug:r(e.eventSlug,"eventSlug")};case "REWARD":case "MAKER_REBATE":case "REFERRAL_REWARD":case "YIELD":return {...i,type:e.type,amount:z(e)}}}function F(e){return {wallet:r(e.proxyWallet,"proxyWallet"),timestamp:r(e.timestamp,"timestamp"),transactionHash:r(e.transactionHash,"transactionHash"),name:e.name??null,pseudonym:e.pseudonym??null,bio:e.bio??null,profileImage:e.profileImage??null,profileImageOptimized:e.profileImageOptimized??null}}function z(e){return r(e.usdcSize??e.size,"usdcSize")}function r(e,i){if(e==null)throw new TypeError(`Expected activity.${i} to be present`);return e}var U=z$1.object({proxyWallet:u.nullish(),bio:z$1.string().nullish(),asset:Ea.nullish(),pseudonym:z$1.string().nullish(),amount:Ia.nullish(),displayUsernamePublic:z$1.boolean().nullish(),outcomeIndex:z$1.number().int().nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),profileImageOptimized:z$1.string().nullish()}).transform(({asset:e,proxyWallet:i,...a})=>({...a,wallet:i,tokenId:e})),Y=z$1.object({token:z$1.string().nullish(),holders:z$1.array(U).nullish()}),K=z$1.object({market:L.nullish(),value:Ia.nullish()}),G=z$1.object({market:L.nullish(),value:Ia.nullish()}),Z=z$1.object({total:Ia.nullish(),markets:z$1.array(G).nullish()}),Ie=z$1.array(Y),Ee=z$1.array(K),Le=z$1.array(Z);var $=z$1.object({rank:z$1.string().nullish(),builder:z$1.string().nullish(),volume:Ia.nullish(),activeUsers:z$1.number().int().nullish(),verified:z$1.boolean().nullish(),builderLogo:z$1.string().nullish()}),q=z$1.object({dt:ka.nullish(),builder:z$1.string().nullish(),builderLogo:z$1.string().nullish(),verified:z$1.boolean().nullish(),volume:Ia.nullish(),activeUsers:z$1.number().int().nullish(),rank:z$1.string().nullish()}).transform(({dt:e,...i})=>({...i,bucketAt:e})),J=z$1.object({rank:z$1.string().nullish(),proxyWallet:u.nullish(),userName:z$1.string().nullish(),vol:Ia.nullish(),pnl:Ia.nullish(),profileImage:z$1.string().nullish(),xUsername:z$1.string().nullish(),verifiedBadge:z$1.boolean().nullish()}).transform(({proxyWallet:e,...i})=>({...i,wallet:e})),Ce=z$1.array($),Te=z$1.array(q),_e=z$1.array(J);var D=(d=>(d.Open="OPEN",d.Partial="PARTIAL",d.ResolvedWin="RESOLVED_WIN",d.ResolvedLoss="RESOLVED_LOSS",d))(D||{}),O=z$1.enum(D),Q=z$1.object({proxyWallet:u.nullish(),asset:Ea.nullish(),conditionId:X$1,size:Ia.nullish(),avgPrice:Ia.nullish(),initialValue:Ia.nullish(),currentValue:Ia.nullish(),cashPnl:Ia.nullish(),percentPnl:z$1.number().nullish(),totalBought:Ia.nullish(),realizedPnl:Ia.nullish(),percentRealizedPnl:z$1.number().nullish(),curPrice:Ia.nullish(),redeemable:z$1.boolean().nullish(),mergeable:z$1.boolean().nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.string().nullish(),eventId:z$1.string().nullish(),eventSlug:z$1.string().nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish(),oppositeOutcome:z$1.string().nullish(),oppositeAsset:Ea.nullish(),endDate:la.nullish(),negativeRisk:z$1.boolean().nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:a,...p})=>({...p,wallet:a,tokenId:e,oppositeTokenId:i})),X=z$1.object({proxyWallet:u.nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),avgPrice:Ia.nullish(),totalBought:Ia.nullish(),realizedPnl:Ia.nullish(),curPrice:Ia.nullish(),timestamp:ba.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.string().nullish(),eventSlug:z$1.string().nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish(),oppositeOutcome:z$1.string().nullish(),oppositeAsset:Ea.nullish(),endDate:ma.nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:a,...p})=>({...p,wallet:a,tokenId:e,oppositeTokenId:i})),ee=z$1.object({user:u.nullish(),value:Ia.nullish()}),te=z$1.object({proxyWallet:u.nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),verified:z$1.boolean().nullish(),asset:Ea.nullish(),conditionId:X$1.nullish(),avgPrice:Ia.nullish(),size:Ia.nullish(),currPrice:Ia.nullish(),currentValue:Ia.nullish(),cashPnl:Ia.nullish(),totalBought:Ia.nullish(),realizedPnl:Ia.nullish(),totalPnl:Ia.nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish()}).transform(({asset:e,proxyWallet:i,...a})=>({...a,wallet:i,tokenId:e})),ne=z$1.object({token:z$1.string().nullish(),positions:z$1.array(te).nullish()}),ie=z$1.object({event_id:z$1.string().nullish(),event_slug:z$1.string().nullish(),event_title:z$1.string().nullish(),event_image:z$1.string().nullish()}).transform(({event_id:e,event_slug:i,event_title:a,event_image:p})=>({eventId:e,eventSlug:i,eventTitle:a,eventImage:p})),oe=z$1.object({market_id:z$1.string().nullish(),slug:z$1.string().nullish(),title:z$1.string().nullish(),outcome:z$1.string().nullish(),image_url:z$1.string().nullish(),icon_url:z$1.string().nullish(),category:z$1.string().nullish(),subcategory:z$1.string().nullish(),tags:z$1.array(z$1.string()).nullish(),end_date:ka.nullish(),event:ie.nullish()}).transform(({market_id:e,image_url:i,icon_url:a,end_date:p,...d})=>({...d,marketId:e,imageUrl:i,iconUrl:a,endDate:p})),se=z$1.object({leg_index:z$1.number().int(),leg_position_id:xa,leg_condition_id:X$1,leg_outcome_index:z$1.number().int(),leg_outcome_label:z$1.string().nullish(),leg_status:O,leg_resolved_at:ka.nullish(),leg_current_price:Ia.nullish(),market:oe.nullish()}).transform(({leg_index:e,leg_position_id:i,leg_condition_id:a,leg_outcome_index:p,leg_outcome_label:d,leg_status:x,leg_resolved_at:R,leg_current_price:b,...I})=>({...I,legIndex:e,legPositionId:i,legConditionId:a,legOutcomeIndex:p,legOutcomeLabel:d,legStatus:x,legResolvedAt:R,legCurrentPrice:b})),re=z$1.object({combo_condition_id:W$1,combo_position_id:xa,module_id:z$1.number().int(),user_address:u,shares_balance:Ia,entry_avg_price_usdc:Ia.nullish(),entry_cost_usdc:Ia.nullish(),status:O,first_entry_at:ka,resolved_at:ka.nullish(),legs_total:z$1.number().int(),legs_resolved:z$1.number().int(),legs_pending:z$1.number().int(),legs:z$1.array(se)}).transform(({combo_condition_id:e,combo_position_id:i,module_id:a,user_address:p,shares_balance:d,entry_avg_price_usdc:x,entry_cost_usdc:R,first_entry_at:b,resolved_at:I,legs_total:m,legs_resolved:B,legs_pending:V,...H})=>({...H,conditionId:e,positionId:i,moduleId:a,userAddress:p,shares:d,entryAvgPriceUsdc:x,entryCostUsdc:R,firstEntryAt:b,resolvedAt:I,legsTotal:m,legsResolved:B,legsPending:V})),Be=z$1.object({combos:z$1.array(re),pagination:z$1.object({limit:z$1.number().int(),offset:z$1.number().int(),has_more:z$1.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}})),Ve=z$1.array(Q),He=z$1.array(X),je=z$1.array(ee),we=z$1.array(ne);export{W as ActivitySchema,A as ActivityType,k as ActivityTypeSchema,u as AddressSchema,q as BuilderVolumeEntrySchema,X as ClosedPositionSchema,se as ComboPositionLegSchema,ie as ComboPositionMarketEventSchema,oe as ComboPositionMarketSchema,re as ComboPositionSchema,D as ComboPositionStatus,O as ComboPositionStatusSchema,Le as FetchEventLiveVolumeResponseSchema,je as FetchPortfolioValueResponseSchema,L as Hash64Schema,U as HolderSchema,ue as LeaderboardCategorySchema,$ as LeaderboardEntrySchema,pe as LeaderboardOrderBySchema,Se as ListActivityResponseSchema,Ce as ListBuilderLeaderboardResponseSchema,Te as ListBuilderVolumeResponseSchema,He as ListClosedPositionsResponseSchema,Be as ListComboPositionsResponseSchema,Ie as ListMarketHoldersResponseSchema,we as ListMarketPositionsResponseSchema,Ee as ListOpenInterestResponseSchema,Ve as ListPositionsResponseSchema,_e as ListTraderLeaderboardResponseSchema,ye as ListTradesResponseSchema,Z as LiveVolumeSchema,te as MarketPositionSchema,G as MarketVolumeSchema,Y as MetaHolderSchema,ne as MetaMarketPositionSchema,K as OpenInterestSchema,Q as PositionSchema,P as SideSchema,ae as TimePeriodSchema,j as TradeSchema,ge as TradedSchema,J as TraderLeaderboardEntrySchema,ee as ValueSchema};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/data/common.ts","../../src/data/activity.ts","../../src/data/analytics.ts","../../src/data/leaderboard.ts","../../src/data/portfolio.ts"],"names":["AddressSchema","z","Hash64Schema","ActivityType","ActivityTypeSchema","SideSchema","TimePeriodSchema","LeaderboardCategorySchema","LeaderboardOrderBySchema","OptionalTextSchema","value","TradeSchema","TokenIdSchema","ConditionIdSchema","DecimalishSchema","EpochSecondsToMillisecondsSchema","asset","proxyWallet","rest","RawActivitySchema","TxHashSchema","ActivitySchema","normalizeActivity","TradedSchema","ListTradesResponseSchema","ListActivityResponseSchema","activity","base","normalizeActivityBase","expectPresent","inferAmount","field","HolderSchema","MetaHolderSchema","OpenInterestSchema","MarketVolumeSchema","LiveVolumeSchema","ListMarketHoldersResponseSchema","ListOpenInterestResponseSchema","FetchEventLiveVolumeResponseSchema","LeaderboardEntrySchema","BuilderVolumeEntrySchema","IsoDateTimeStringSchema","dt","TraderLeaderboardEntrySchema","ListBuilderLeaderboardResponseSchema","ListBuilderVolumeResponseSchema","ListTraderLeaderboardResponseSchema","PositionSchema","IsoCalendarDateStringSchema","oppositeAsset","ClosedPositionSchema","MixedDateTimeStringSchema","ValueSchema","MarketPositionSchema","MetaMarketPositionSchema","ListPositionsResponseSchema","ListClosedPositionsResponseSchema","FetchPortfolioValueResponseSchema","ListMarketPositionsResponseSchema"],"mappings":"kGAEO,IAAMA,CAAAA,CAAgBC,GAAAA,CAAE,QAAO,CACzBC,CAAAA,CAAeD,IAAE,MAAA,EAAO,CAEzBE,OACVA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,MAAQ,OAAA,CACRA,CAAAA,CAAA,MAAQ,OAAA,CACRA,CAAAA,CAAA,OAAS,QAAA,CACTA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,EAAA,UAAA,CAAa,YAAA,CACbA,EAAA,YAAA,CAAe,cAAA,CACfA,EAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,KAAA,CAAQ,QATEA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAYCC,CAAAA,CAAqBH,GAAAA,CAAE,KAAKE,C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AAGC,CAAK,CAAA,IAAO,CAC/C,GAAGA,CAAAA,CACH,MAAA,CAAQD,CAAAA,CACR,OAAA,CAASD,CACX,CAAA,CAAE,CAAA,CAESuC,EAA2BtD,GAAAA,CAAE,MAAA,CAAO,CAC/C,KAAA,CAAOA,GAAAA,CAAE,MAAA,EAAO,CAAE,SAAQ,CAC1B,SAAA,CAAWA,IAAE,KAAA,CAAMqD,CAAoB,EAAE,OAAA,EAC3C,CAAC,CAAA,CAEYE,GAA8BvD,GAAAA,CAAE,KAAA,CAAM+C,CAAc,CAAA,CACpDS,EAAAA,CAAoCxD,IAAE,KAAA,CAAMkD,CAAoB,CAAA,CAChEO,EAAAA,CAAoCzD,IAAE,KAAA,CAAMoD,CAAW,EACvDM,EAAAA,CAAoC1D,GAAAA,CAAE,MACjDsD,CACF","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const AddressSchema = z.string();\nexport const Hash64Schema = z.string();\n\nexport enum ActivityType {\n TRADE = 'TRADE',\n SPLIT = 'SPLIT',\n MERGE = 'MERGE',\n REDEEM = 'REDEEM',\n REWARD = 'REWARD',\n CONVERSION = 'CONVERSION',\n MAKER_REBATE = 'MAKER_REBATE',\n REFERRAL_REWARD = 'REFERRAL_REWARD',\n YIELD = 'YIELD',\n}\n\nexport const ActivityTypeSchema = z.enum(ActivityType);\n\nexport const SideSchema = z.enum(['BUY', 'SELL']);\n\nexport const TimePeriodSchema = z.enum(['DAY', 'WEEK', 'MONTH', 'ALL']);\n\nexport const LeaderboardCategorySchema = z.enum([\n 'OVERALL',\n 'POLITICS',\n 'SPORTS',\n 'CRYPTO',\n 'CULTURE',\n 'MENTIONS',\n 'WEATHER',\n 'ECONOMICS',\n 'TECH',\n 'FINANCE',\n]);\n\nexport const LeaderboardOrderBySchema = z.enum(['PNL', 'VOL']);\n\nexport type Address = z.infer<typeof AddressSchema>;\nexport type Hash64 = z.infer<typeof Hash64Schema>;\nexport type Side = z.infer<typeof SideSchema>;\nexport type TimePeriod = z.infer<typeof TimePeriodSchema>;\nexport type LeaderboardCategory = z.infer<typeof LeaderboardCategorySchema>;\nexport type LeaderboardOrderBy = z.infer<typeof LeaderboardOrderBySchema>;\n","import { z } from 'zod';\nimport {\n type ConditionId,\n ConditionIdSchema,\n DecimalishSchema,\n type DecimalString,\n type EpochMilliseconds,\n EpochSecondsToMillisecondsSchema,\n type TokenId,\n TokenIdSchema,\n type TxHash,\n TxHashSchema,\n} from '../shared';\nimport {\n ActivityType,\n ActivityTypeSchema,\n type Address,\n AddressSchema,\n type Side,\n SideSchema,\n} from './common';\n\nexport type ActivityBase = {\n /** Wallet address whose account history contains this activity. */\n wallet: Address;\n /** Activity time as Unix epoch milliseconds. */\n timestamp: EpochMilliseconds;\n /** Polygon transaction hash that produced or records this activity. */\n transactionHash: TxHash;\n /** Display name of the wallet owner at the time returned by the API. */\n name: string | null;\n /** Public pseudonym of the wallet owner at the time returned by the API. */\n pseudonym: string | null;\n /** Profile biography of the wallet owner at the time returned by the API. */\n bio: string | null;\n /** Source profile image URL for the wallet owner. */\n profileImage: string | null;\n /** Optimized profile image URL for the wallet owner. */\n profileImageOptimized: string | null;\n};\n\nexport type TradeActivity = ActivityBase & {\n /** A directional outcome-token trade. */\n type: 'TRADE';\n /** Condition id of the market traded by the wallet. */\n conditionId: ConditionId;\n /** Outcome token id bought or sold by the wallet. */\n tokenId: TokenId;\n /** Direction of the wallet's trade in the outcome token. */\n side: Side;\n /** Number of outcome-token shares traded by the wallet. */\n shares: DecimalString;\n /** The notional value of the traded shares in USD. */\n amount: DecimalString;\n /** The execution price per outcome-token share in USD. */\n price: DecimalString;\n /** Display label of the outcome token traded by the wallet. */\n outcome: string;\n /** Zero-based index of the outcome token in the market's outcome list. */\n outcomeIndex: number;\n /** Human-readable title of the market traded by the wallet. */\n title: string;\n /** URL slug of the market traded by the wallet. */\n slug: string;\n /** Icon URL for the market traded by the wallet. */\n icon: string;\n /** URL slug of the event containing the traded market. */\n eventSlug: string;\n};\n\nexport type SplitActivity = ActivityBase & {\n /** Splitting collateral into a complete market set. */\n type: 'SPLIT';\n /** Condition id of the market whose complete set was created. */\n conditionId: ConditionId;\n /** The collateral amount split into the complete set in USD. */\n amount: DecimalString;\n /** Human-readable title of the market whose complete set was created. */\n title: string;\n /** URL slug of the market whose complete set was created. */\n slug: string;\n /** Icon URL for the market whose complete set was created. */\n icon: string;\n /** URL slug of the event containing the split market. */\n eventSlug: string;\n};\n\nexport type MergeActivity = ActivityBase & {\n /** Merging a complete market set into collateral. */\n type: 'MERGE';\n /** Condition id of the market whose complete set was merged. */\n conditionId: ConditionId;\n /** The collateral amount received from merging the complete set in USD. */\n amount: DecimalString;\n /** Human-readable title of the market whose complete set was merged. */\n title: string;\n /** URL slug of the market whose complete set was merged. */\n slug: string;\n /** Icon URL for the market whose complete set was merged. */\n icon: string;\n /** URL slug of the event containing the merged market. */\n eventSlug: string;\n};\n\nexport type RedeemActivity = ActivityBase & {\n /** Redeeming resolved market proceeds. */\n type: 'REDEEM';\n /** Condition id of the market redeemed by the wallet. */\n conditionId: ConditionId;\n /** The proceeds redeemed from the resolved market in USD. */\n amount: DecimalString;\n /** Human-readable title of the market redeemed by the wallet. */\n title: string;\n /** URL slug of the market redeemed by the wallet. */\n slug: string;\n /** Icon URL for the market redeemed by the wallet. */\n icon: string;\n /** URL slug of the event containing the redeemed market. */\n eventSlug: string;\n};\n\nexport type ConversionActivity = ActivityBase & {\n /** A market conversion or migration activity. */\n type: 'CONVERSION';\n /** Condition id of the market involved in the conversion. */\n conditionId: ConditionId;\n /** The amount converted or migrated for the market in USD. */\n amount: DecimalString;\n /** Human-readable title of the market involved in the conversion. */\n title: string;\n /** URL slug of the market involved in the conversion. */\n slug: string;\n /** Icon URL for the market involved in the conversion. */\n icon: string;\n /** URL slug of the event containing the converted market. */\n eventSlug: string;\n};\n\nexport type RewardActivity = ActivityBase & {\n /** An account-level reward credit. */\n type: 'REWARD';\n /** The reward amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type MakerRebateActivity = ActivityBase & {\n /** An account-level maker rebate credit. */\n type: 'MAKER_REBATE';\n /** The maker rebate amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type ReferralRewardActivity = ActivityBase & {\n /** An account-level referral reward credit. */\n type: 'REFERRAL_REWARD';\n /** The referral reward amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type YieldActivity = ActivityBase & {\n /** An account-level yield credit. */\n type: 'YIELD';\n /** The yield amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type Activity =\n | TradeActivity\n | SplitActivity\n | MergeActivity\n | RedeemActivity\n | ConversionActivity\n | RewardActivity\n | MakerRebateActivity\n | ReferralRewardActivity\n | YieldActivity;\n\nconst OptionalTextSchema = z.preprocess(\n (value) => (value === '' ? undefined : value),\n z.string().optional(),\n);\n\nexport const TradeSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n side: SideSchema.nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: ConditionIdSchema.nullish(),\n size: DecimalishSchema.nullish(),\n price: DecimalishSchema.nullish(),\n timestamp: EpochSecondsToMillisecondsSchema.nullish(),\n title: z.string().nullish(),\n slug: z.string().nullish(),\n icon: z.string().nullish(),\n eventSlug: z.string().nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n name: z.string().nullish(),\n pseudonym: z.string().nullish(),\n bio: z.string().nullish(),\n profileImage: z.string().nullish(),\n profileImageOptimized: z.string().nullish(),\n transactionHash: z.string().nullish(),\n })\n .transform(({ asset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n }));\n\nconst RawActivitySchema = z.object({\n proxyWallet: AddressSchema.nullish(),\n timestamp: EpochSecondsToMillisecondsSchema.nullish(),\n conditionId: z.preprocess(\n (value) => (value === '' ? undefined : value),\n ConditionIdSchema.optional(),\n ),\n type: ActivityTypeSchema,\n size: DecimalishSchema.nullish(),\n usdcSize: DecimalishSchema.nullish(),\n transactionHash: TxHashSchema.nullish(),\n price: DecimalishSchema.nullish(),\n asset: z.preprocess(\n (value) => (value === '' ? undefined : value),\n TokenIdSchema.optional(),\n ),\n side: z.preprocess(\n (value) => (value === '' ? undefined : value),\n SideSchema.nullish(),\n ),\n outcomeIndex: z.preprocess(\n (value) => (value === 999 ? undefined : value),\n z.number().int().optional(),\n ),\n title: OptionalTextSchema,\n slug: OptionalTextSchema,\n icon: OptionalTextSchema,\n eventSlug: OptionalTextSchema,\n outcome: OptionalTextSchema,\n name: OptionalTextSchema,\n pseudonym: OptionalTextSchema,\n bio: OptionalTextSchema,\n profileImage: OptionalTextSchema,\n profileImageOptimized: OptionalTextSchema,\n});\n\nexport const ActivitySchema: z.ZodType<Activity> =\n RawActivitySchema.transform(normalizeActivity);\n\nexport const TradedSchema = z.object({\n user: AddressSchema.nullish(),\n traded: z.number().int().nullish(),\n});\n\nexport const ListTradesResponseSchema = z.array(TradeSchema);\nexport const ListActivityResponseSchema = z.array(ActivitySchema);\n\nexport type Trade = z.infer<typeof TradeSchema>;\nexport type Traded = z.infer<typeof TradedSchema>;\nexport type ListTradesResponse = z.infer<typeof ListTradesResponseSchema>;\nexport type ListActivityResponse = z.infer<typeof ListActivityResponseSchema>;\n\ntype RawActivity = z.infer<typeof RawActivitySchema>;\n\nfunction normalizeActivity(activity: RawActivity): Activity {\n const base = normalizeActivityBase(activity);\n\n switch (activity.type) {\n case ActivityType.TRADE:\n return {\n ...base,\n type: activity.type,\n conditionId: expectPresent(activity.conditionId, 'conditionId'),\n tokenId: expectPresent(activity.asset, 'asset'),\n side: expectPresent(activity.side, 'side'),\n shares: expectPresent(activity.size, 'size'),\n amount: inferAmount(activity),\n price: expectPresent(activity.price, 'price'),\n outcome: expectPresent(activity.outcome, 'outcome'),\n outcomeIndex: expectPresent(activity.outcomeIndex, 'outcomeIndex'),\n title: expectPresent(activity.title, 'title'),\n slug: expectPresent(activity.slug, 'slug'),\n icon: expectPresent(activity.icon, 'icon'),\n eventSlug: expectPresent(activity.eventSlug, 'eventSlug'),\n };\n case ActivityType.SPLIT:\n case ActivityType.MERGE:\n case ActivityType.REDEEM:\n case ActivityType.CONVERSION:\n return {\n ...base,\n type: activity.type,\n conditionId: expectPresent(activity.conditionId, 'conditionId'),\n amount: inferAmount(activity),\n title: expectPresent(activity.title, 'title'),\n slug: expectPresent(activity.slug, 'slug'),\n icon: expectPresent(activity.icon, 'icon'),\n eventSlug: expectPresent(activity.eventSlug, 'eventSlug'),\n };\n case ActivityType.REWARD:\n case ActivityType.MAKER_REBATE:\n case ActivityType.REFERRAL_REWARD:\n case ActivityType.YIELD:\n return {\n ...base,\n type: activity.type,\n amount: inferAmount(activity),\n };\n }\n}\n\nfunction normalizeActivityBase(activity: RawActivity): ActivityBase {\n return {\n wallet: expectPresent(activity.proxyWallet, 'proxyWallet'),\n timestamp: expectPresent(activity.timestamp, 'timestamp'),\n transactionHash: expectPresent(activity.transactionHash, 'transactionHash'),\n name: activity.name ?? null,\n pseudonym: activity.pseudonym ?? null,\n bio: activity.bio ?? null,\n profileImage: activity.profileImage ?? null,\n profileImageOptimized: activity.profileImageOptimized ?? null,\n };\n}\n\nfunction inferAmount(activity: RawActivity): DecimalString {\n return expectPresent(activity.usdcSize ?? activity.size, 'usdcSize');\n}\n\nfunction expectPresent<T>(value: T | null | undefined, field: string): T {\n if (value === null || value === undefined) {\n throw new TypeError(`Expected activity.${field} to be present`);\n }\n\n return value;\n}\n","import { z } from 'zod';\nimport { DecimalishSchema, TokenIdSchema } from '../shared';\nimport { AddressSchema, Hash64Schema } from './common';\n\nexport const HolderSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n bio: z.string().nullish(),\n asset: TokenIdSchema.nullish(),\n pseudonym: z.string().nullish(),\n amount: DecimalishSchema.nullish(),\n displayUsernamePublic: z.boolean().nullish(),\n outcomeIndex: z.number().int().nullish(),\n name: z.string().nullish(),\n profileImage: z.string().nullish(),\n profileImageOptimized: z.string().nullish(),\n })\n .transform(({ asset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n }));\n\nexport const MetaHolderSchema = z.object({\n token: z.string().nullish(),\n holders: z.array(HolderSchema).nullish(),\n});\n\nexport const OpenInterestSchema = z.object({\n market: Hash64Schema.nullish(),\n value: DecimalishSchema.nullish(),\n});\n\nexport const MarketVolumeSchema = z.object({\n market: Hash64Schema.nullish(),\n value: DecimalishSchema.nullish(),\n});\n\nexport const LiveVolumeSchema = z.object({\n total: DecimalishSchema.nullish(),\n markets: z.array(MarketVolumeSchema).nullish(),\n});\n\nexport const ListMarketHoldersResponseSchema = z.array(MetaHolderSchema);\nexport const ListOpenInterestResponseSchema = z.array(OpenInterestSchema);\nexport const FetchEventLiveVolumeResponseSchema = z.array(LiveVolumeSchema);\n\nexport type Holder = z.infer<typeof HolderSchema>;\nexport type MetaHolder = z.infer<typeof MetaHolderSchema>;\nexport type OpenInterest = z.infer<typeof OpenInterestSchema>;\nexport type MarketVolume = z.infer<typeof MarketVolumeSchema>;\nexport type LiveVolume = z.infer<typeof LiveVolumeSchema>;\nexport type ListMarketHoldersResponse = z.infer<\n typeof ListMarketHoldersResponseSchema\n>;\nexport type ListOpenInterestResponse = z.infer<\n typeof ListOpenInterestResponseSchema\n>;\nexport type FetchEventLiveVolumeResponse = z.infer<\n typeof FetchEventLiveVolumeResponseSchema\n>;\n","import { z } from 'zod';\nimport { DecimalishSchema, IsoDateTimeStringSchema } from '../shared';\nimport { AddressSchema } from './common';\n\nexport const LeaderboardEntrySchema = z.object({\n rank: z.string().nullish(),\n builder: z.string().nullish(),\n volume: DecimalishSchema.nullish(),\n activeUsers: z.number().int().nullish(),\n verified: z.boolean().nullish(),\n builderLogo: z.string().nullish(),\n});\n\nexport const BuilderVolumeEntrySchema = z\n .object({\n dt: IsoDateTimeStringSchema.nullish(),\n builder: z.string().nullish(),\n builderLogo: z.string().nullish(),\n verified: z.boolean().nullish(),\n volume: DecimalishSchema.nullish(),\n activeUsers: z.number().int().nullish(),\n rank: z.string().nullish(),\n })\n .transform(({ dt, ...rest }) => ({\n ...rest,\n bucketAt: dt,\n }));\n\nexport const TraderLeaderboardEntrySchema = z\n .object({\n rank: z.string().nullish(),\n proxyWallet: AddressSchema.nullish(),\n userName: z.string().nullish(),\n vol: DecimalishSchema.nullish(),\n pnl: DecimalishSchema.nullish(),\n profileImage: z.string().nullish(),\n xUsername: z.string().nullish(),\n verifiedBadge: z.boolean().nullish(),\n })\n .transform(({ proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n }));\n\nexport const ListBuilderLeaderboardResponseSchema = z.array(\n LeaderboardEntrySchema,\n);\nexport const ListBuilderVolumeResponseSchema = z.array(\n BuilderVolumeEntrySchema,\n);\nexport const ListTraderLeaderboardResponseSchema = z.array(\n TraderLeaderboardEntrySchema,\n);\n\nexport type LeaderboardEntry = z.infer<typeof LeaderboardEntrySchema>;\nexport type BuilderVolumeEntry = z.infer<typeof BuilderVolumeEntrySchema>;\nexport type TraderLeaderboardEntry = z.infer<\n typeof TraderLeaderboardEntrySchema\n>;\nexport type ListBuilderLeaderboardResponse = z.infer<\n typeof ListBuilderLeaderboardResponseSchema\n>;\nexport type ListBuilderVolumeResponse = z.infer<\n typeof ListBuilderVolumeResponseSchema\n>;\nexport type ListTraderLeaderboardResponse = z.infer<\n typeof ListTraderLeaderboardResponseSchema\n>;\n","import { z } from 'zod';\nimport {\n ConditionIdSchema,\n DecimalishSchema,\n EpochSecondsToMillisecondsSchema,\n IsoCalendarDateStringSchema,\n MixedDateTimeStringSchema,\n TokenIdSchema,\n} from '../shared';\nimport { AddressSchema } from './common';\n\nexport const PositionSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: ConditionIdSchema,\n size: DecimalishSchema.nullish(),\n avgPrice: DecimalishSchema.nullish(),\n initialValue: DecimalishSchema.nullish(),\n currentValue: DecimalishSchema.nullish(),\n cashPnl: DecimalishSchema.nullish(),\n percentPnl: z.number().nullish(),\n totalBought: DecimalishSchema.nullish(),\n realizedPnl: DecimalishSchema.nullish(),\n percentRealizedPnl: z.number().nullish(),\n curPrice: DecimalishSchema.nullish(),\n redeemable: z.boolean().nullish(),\n mergeable: z.boolean().nullish(),\n title: z.string().nullish(),\n slug: z.string().nullish(),\n icon: z.string().nullish(),\n eventId: z.string().nullish(),\n eventSlug: z.string().nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n oppositeOutcome: z.string().nullish(),\n oppositeAsset: TokenIdSchema.nullish(),\n endDate: IsoCalendarDateStringSchema.nullish(),\n negativeRisk: z.boolean().nullish(),\n })\n .transform(({ asset, oppositeAsset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n oppositeTokenId: oppositeAsset,\n }));\n\nexport const ClosedPositionSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: ConditionIdSchema.nullish(),\n avgPrice: DecimalishSchema.nullish(),\n totalBought: DecimalishSchema.nullish(),\n realizedPnl: DecimalishSchema.nullish(),\n curPrice: DecimalishSchema.nullish(),\n timestamp: EpochSecondsToMillisecondsSchema.nullish(),\n title: z.string().nullish(),\n slug: z.string().nullish(),\n icon: z.string().nullish(),\n eventSlug: z.string().nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n oppositeOutcome: z.string().nullish(),\n oppositeAsset: TokenIdSchema.nullish(),\n endDate: MixedDateTimeStringSchema.nullish(),\n })\n .transform(({ asset, oppositeAsset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n oppositeTokenId: oppositeAsset,\n }));\n\nexport const ValueSchema = z.object({\n user: AddressSchema.nullish(),\n value: DecimalishSchema.nullish(),\n});\n\nexport const MarketPositionSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n name: z.string().nullish(),\n profileImage: z.string().nullish(),\n verified: z.boolean().nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: ConditionIdSchema.nullish(),\n avgPrice: DecimalishSchema.nullish(),\n size: DecimalishSchema.nullish(),\n currPrice: DecimalishSchema.nullish(),\n currentValue: DecimalishSchema.nullish(),\n cashPnl: DecimalishSchema.nullish(),\n totalBought: DecimalishSchema.nullish(),\n realizedPnl: DecimalishSchema.nullish(),\n totalPnl: DecimalishSchema.nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n })\n .transform(({ asset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n }));\n\nexport const MetaMarketPositionSchema = z.object({\n token: z.string().nullish(),\n positions: z.array(MarketPositionSchema).nullish(),\n});\n\nexport const ListPositionsResponseSchema = z.array(PositionSchema);\nexport const ListClosedPositionsResponseSchema = z.array(ClosedPositionSchema);\nexport const FetchPortfolioValueResponseSchema = z.array(ValueSchema);\nexport const ListMarketPositionsResponseSchema = z.array(\n MetaMarketPositionSchema,\n);\n\nexport type Position = z.infer<typeof PositionSchema>;\nexport type ClosedPosition = z.infer<typeof ClosedPositionSchema>;\nexport type Value = z.infer<typeof ValueSchema>;\nexport type MarketPosition = z.infer<typeof MarketPositionSchema>;\nexport type MetaMarketPosition = z.infer<typeof MetaMarketPositionSchema>;\nexport type ListPositionsResponse = z.infer<typeof ListPositionsResponseSchema>;\nexport type ListClosedPositionsResponse = z.infer<\n typeof ListClosedPositionsResponseSchema\n>;\nexport type FetchPortfolioValueResponse = z.infer<\n typeof FetchPortfolioValueResponseSchema\n>;\nexport type ListMarketPositionsResponse = z.infer<\n typeof ListMarketPositionsResponseSchema\n>;\n"]}
1
+ {"version":3,"sources":["../../src/data/common.ts","../../src/data/activity.ts","../../src/data/analytics.ts","../../src/data/leaderboard.ts","../../src/data/portfolio.ts"],"names":["AddressSchema","z","Hash64Schema","ActivityType","ActivityTypeSchema","SideSchema","TimePeriodSchema","LeaderboardCategorySchema","LeaderboardOrderBySchema","OptionalTextSchema","value","TradeSchema","TokenIdSchema","CtfConditionIdSchema","DecimalishSchema","EpochSecondsToMillisecondsSchema","asset","proxyWallet","rest","RawActivitySchema","TxHashSchema","ActivitySchema","normalizeActivity","TradedSchema","ListTradesResponseSchema","ListActivityResponseSchema","activity","base","normalizeActivityBase","expectPresent","inferAmount","field","HolderSchema","MetaHolderSchema","OpenInterestSchema","MarketVolumeSchema","LiveVolumeSchema","ListMarketHoldersResponseSchema","ListOpenInterestResponseSchema","FetchEventLiveVolumeResponseSchema","LeaderboardEntrySchema","BuilderVolumeEntrySchema","IsoDateTimeStringSchema","dt","TraderLeaderboardEntrySchema","ListBuilderLeaderboardResponseSchema","ListBuilderVolumeResponseSchema","ListTraderLeaderboardResponseSchema","ComboPositionStatus","ComboPositionStatusSchema","PositionSchema","IsoCalendarDateStringSchema","oppositeAsset","ClosedPositionSchema","MixedDateTimeStringSchema","ValueSchema","MarketPositionSchema","MetaMarketPositionSchema","ComboPositionMarketEventSchema","event_id","event_slug","event_title","event_image","ComboPositionMarketSchema","market_id","image_url","icon_url","end_date","ComboPositionLegSchema","PositionIdSchema","leg_index","leg_position_id","leg_condition_id","leg_outcome_index","leg_outcome_label","leg_status","leg_resolved_at","leg_current_price","ComboPositionSchema","ComboConditionIdSchema","combo_condition_id","combo_position_id","module_id","user_address","shares_balance","entry_avg_price_usdc","entry_cost_usdc","first_entry_at","resolved_at","legs_total","legs_resolved","legs_pending","ListComboPositionsResponseSchema","PaginationCursorSchema","pagination","ListPositionsResponseSchema","ListClosedPositionsResponseSchema","FetchPortfolioValueResponseSchema","ListMarketPositionsResponseSchema"],"mappings":"2GAEO,IAAMA,CAAAA,CAAgBC,GAAAA,CAAE,MAAA,EAAO,CACzBC,EAAeD,GAAAA,CAAE,MAAA,EAAO,CAEzBE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,KAAA,CAAQ,QACRA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,KAAA,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E,CAAAA,CAAW,KAAA,CAClB,MAAA,CAAQA,CAAAA,CAAW,MAAA,CACnB,QAASA,CAAAA,CAAW,QAAA,CACpB,UAAA,CAAYA,CAAAA,CAAW,WACzB,CACF,EAAE,CAAA,CAESC,EAAAA,CAA8B9F,GAAAA,CAAE,KAAA,CAAMiD,CAAc,CAAA,CACpD8C,GAAoC/F,GAAAA,CAAE,KAAA,CAAMoD,CAAoB,CAAA,CAChE4C,EAAAA,CAAoChG,GAAAA,CAAE,KAAA,CAAMsD,EAAW,CAAA,CACvD2C,EAAAA,CAAoCjG,GAAAA,CAAE,KAAA,CACjDwD,EACF","file":"index.js","sourcesContent":["import { z } from 'zod';\n\nexport const AddressSchema = z.string();\nexport const Hash64Schema = z.string();\n\nexport enum ActivityType {\n TRADE = 'TRADE',\n SPLIT = 'SPLIT',\n MERGE = 'MERGE',\n REDEEM = 'REDEEM',\n REWARD = 'REWARD',\n CONVERSION = 'CONVERSION',\n MAKER_REBATE = 'MAKER_REBATE',\n REFERRAL_REWARD = 'REFERRAL_REWARD',\n YIELD = 'YIELD',\n}\n\nexport const ActivityTypeSchema = z.enum(ActivityType);\n\nexport const SideSchema = z.enum(['BUY', 'SELL']);\n\nexport const TimePeriodSchema = z.enum(['DAY', 'WEEK', 'MONTH', 'ALL']);\n\nexport const LeaderboardCategorySchema = z.enum([\n 'OVERALL',\n 'POLITICS',\n 'SPORTS',\n 'CRYPTO',\n 'CULTURE',\n 'MENTIONS',\n 'WEATHER',\n 'ECONOMICS',\n 'TECH',\n 'FINANCE',\n]);\n\nexport const LeaderboardOrderBySchema = z.enum(['PNL', 'VOL']);\n\nexport type Address = z.infer<typeof AddressSchema>;\nexport type Hash64 = z.infer<typeof Hash64Schema>;\nexport type Side = z.infer<typeof SideSchema>;\nexport type TimePeriod = z.infer<typeof TimePeriodSchema>;\nexport type LeaderboardCategory = z.infer<typeof LeaderboardCategorySchema>;\nexport type LeaderboardOrderBy = z.infer<typeof LeaderboardOrderBySchema>;\n","import { z } from 'zod';\nimport {\n type CtfConditionId,\n CtfConditionIdSchema,\n DecimalishSchema,\n type DecimalString,\n type EpochMilliseconds,\n EpochSecondsToMillisecondsSchema,\n type TokenId,\n TokenIdSchema,\n type TxHash,\n TxHashSchema,\n} from '../shared';\nimport {\n ActivityType,\n ActivityTypeSchema,\n type Address,\n AddressSchema,\n type Side,\n SideSchema,\n} from './common';\n\nexport type ActivityBase = {\n /** Wallet address whose account history contains this activity. */\n wallet: Address;\n /** Activity time as Unix epoch milliseconds. */\n timestamp: EpochMilliseconds;\n /** Polygon transaction hash that produced or records this activity. */\n transactionHash: TxHash;\n /** Display name of the wallet owner at the time returned by the API. */\n name: string | null;\n /** Public pseudonym of the wallet owner at the time returned by the API. */\n pseudonym: string | null;\n /** Profile biography of the wallet owner at the time returned by the API. */\n bio: string | null;\n /** Source profile image URL for the wallet owner. */\n profileImage: string | null;\n /** Optimized profile image URL for the wallet owner. */\n profileImageOptimized: string | null;\n};\n\nexport type TradeActivity = ActivityBase & {\n /** A directional outcome-token trade. */\n type: 'TRADE';\n /** Condition id of the market traded by the wallet. */\n conditionId: CtfConditionId;\n /** Outcome token id bought or sold by the wallet. */\n tokenId: TokenId;\n /** Direction of the wallet's trade in the outcome token. */\n side: Side;\n /** Number of outcome-token shares traded by the wallet. */\n shares: DecimalString;\n /** The notional value of the traded shares in USD. */\n amount: DecimalString;\n /** The execution price per outcome-token share in USD. */\n price: DecimalString;\n /** Display label of the outcome token traded by the wallet. */\n outcome: string;\n /** Zero-based index of the outcome token in the market's outcome list. */\n outcomeIndex: number;\n /** Human-readable title of the market traded by the wallet. */\n title: string;\n /** URL slug of the market traded by the wallet. */\n slug: string;\n /** Icon URL for the market traded by the wallet, when available. */\n icon: string | null;\n /** URL slug of the event containing the traded market. */\n eventSlug: string;\n};\n\nexport type SplitActivity = ActivityBase & {\n /** Splitting collateral into a complete market set. */\n type: 'SPLIT';\n /** Condition id of the market whose complete set was created. */\n conditionId: CtfConditionId;\n /** The collateral amount split into the complete set in USD. */\n amount: DecimalString;\n /** Human-readable title of the market whose complete set was created. */\n title: string;\n /** URL slug of the market whose complete set was created. */\n slug: string;\n /** Icon URL for the market whose complete set was created, when available. */\n icon: string | null;\n /** URL slug of the event containing the split market. */\n eventSlug: string;\n};\n\nexport type MergeActivity = ActivityBase & {\n /** Merging a complete market set into collateral. */\n type: 'MERGE';\n /** Condition id of the market whose complete set was merged. */\n conditionId: CtfConditionId;\n /** The collateral amount received from merging the complete set in USD. */\n amount: DecimalString;\n /** Human-readable title of the market whose complete set was merged. */\n title: string;\n /** URL slug of the market whose complete set was merged. */\n slug: string;\n /** Icon URL for the market whose complete set was merged, when available. */\n icon: string | null;\n /** URL slug of the event containing the merged market. */\n eventSlug: string;\n};\n\nexport type RedeemActivity = ActivityBase & {\n /** Redeeming resolved market proceeds. */\n type: 'REDEEM';\n /** Condition id of the market redeemed by the wallet. */\n conditionId: CtfConditionId;\n /** The proceeds redeemed from the resolved market in USD. */\n amount: DecimalString;\n /** Human-readable title of the market redeemed by the wallet. */\n title: string;\n /** URL slug of the market redeemed by the wallet. */\n slug: string;\n /** Icon URL for the market redeemed by the wallet, when available. */\n icon: string | null;\n /** URL slug of the event containing the redeemed market. */\n eventSlug: string;\n};\n\nexport type ConversionActivity = ActivityBase & {\n /** A market conversion or migration activity. */\n type: 'CONVERSION';\n /** Condition id of the market involved in the conversion. */\n conditionId: CtfConditionId;\n /** The amount converted or migrated for the market in USD. */\n amount: DecimalString;\n /** Human-readable title of the market involved in the conversion. */\n title: string;\n /** URL slug of the market involved in the conversion. */\n slug: string;\n /** Icon URL for the market involved in the conversion, when available. */\n icon: string | null;\n /** URL slug of the event containing the converted market. */\n eventSlug: string;\n};\n\nexport type RewardActivity = ActivityBase & {\n /** An account-level reward credit. */\n type: 'REWARD';\n /** The reward amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type MakerRebateActivity = ActivityBase & {\n /** An account-level maker rebate credit. */\n type: 'MAKER_REBATE';\n /** The maker rebate amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type ReferralRewardActivity = ActivityBase & {\n /** An account-level referral reward credit. */\n type: 'REFERRAL_REWARD';\n /** The referral reward amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type YieldActivity = ActivityBase & {\n /** An account-level yield credit. */\n type: 'YIELD';\n /** The yield amount credited to the wallet in USD. */\n amount: DecimalString;\n};\n\nexport type Activity =\n | TradeActivity\n | SplitActivity\n | MergeActivity\n | RedeemActivity\n | ConversionActivity\n | RewardActivity\n | MakerRebateActivity\n | ReferralRewardActivity\n | YieldActivity;\n\nconst OptionalTextSchema = z.preprocess(\n (value) => (value === '' ? undefined : value),\n z.string().optional(),\n);\n\nexport const TradeSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n side: SideSchema.nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: CtfConditionIdSchema.nullish(),\n size: DecimalishSchema.nullish(),\n price: DecimalishSchema.nullish(),\n timestamp: EpochSecondsToMillisecondsSchema.nullish(),\n title: z.string().nullish(),\n slug: z.string().nullish(),\n icon: z.string().nullish(),\n eventSlug: z.string().nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n name: z.string().nullish(),\n pseudonym: z.string().nullish(),\n bio: z.string().nullish(),\n profileImage: z.string().nullish(),\n profileImageOptimized: z.string().nullish(),\n transactionHash: z.string().nullish(),\n })\n .transform(({ asset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n }));\n\nconst RawActivitySchema = z.object({\n proxyWallet: AddressSchema.nullish(),\n timestamp: EpochSecondsToMillisecondsSchema.nullish(),\n conditionId: z.preprocess(\n (value) => (value === '' ? undefined : value),\n CtfConditionIdSchema.optional(),\n ),\n type: ActivityTypeSchema,\n size: DecimalishSchema.nullish(),\n usdcSize: DecimalishSchema.nullish(),\n transactionHash: TxHashSchema.nullish(),\n price: DecimalishSchema.nullish(),\n asset: z.preprocess(\n (value) => (value === '' ? undefined : value),\n TokenIdSchema.optional(),\n ),\n side: z.preprocess(\n (value) => (value === '' ? undefined : value),\n SideSchema.nullish(),\n ),\n outcomeIndex: z.preprocess(\n (value) => (value === 999 ? undefined : value),\n z.number().int().optional(),\n ),\n title: OptionalTextSchema,\n slug: OptionalTextSchema,\n icon: OptionalTextSchema,\n eventSlug: OptionalTextSchema,\n outcome: OptionalTextSchema,\n name: OptionalTextSchema,\n pseudonym: OptionalTextSchema,\n bio: OptionalTextSchema,\n profileImage: OptionalTextSchema,\n profileImageOptimized: OptionalTextSchema,\n});\n\nexport const ActivitySchema: z.ZodType<Activity> =\n RawActivitySchema.transform(normalizeActivity);\n\nexport const TradedSchema = z.object({\n user: AddressSchema.nullish(),\n traded: z.number().int().nullish(),\n});\n\nexport const ListTradesResponseSchema = z.array(TradeSchema);\nexport const ListActivityResponseSchema = z.array(ActivitySchema);\n\nexport type Trade = z.infer<typeof TradeSchema>;\nexport type Traded = z.infer<typeof TradedSchema>;\nexport type ListTradesResponse = z.infer<typeof ListTradesResponseSchema>;\nexport type ListActivityResponse = z.infer<typeof ListActivityResponseSchema>;\n\ntype RawActivity = z.infer<typeof RawActivitySchema>;\n\nfunction normalizeActivity(activity: RawActivity): Activity {\n const base = normalizeActivityBase(activity);\n\n switch (activity.type) {\n case ActivityType.TRADE:\n return {\n ...base,\n type: activity.type,\n conditionId: expectPresent(activity.conditionId, 'conditionId'),\n tokenId: expectPresent(activity.asset, 'asset'),\n side: expectPresent(activity.side, 'side'),\n shares: expectPresent(activity.size, 'size'),\n amount: inferAmount(activity),\n price: expectPresent(activity.price, 'price'),\n outcome: expectPresent(activity.outcome, 'outcome'),\n outcomeIndex: expectPresent(activity.outcomeIndex, 'outcomeIndex'),\n title: expectPresent(activity.title, 'title'),\n slug: expectPresent(activity.slug, 'slug'),\n icon: activity.icon ?? null,\n eventSlug: expectPresent(activity.eventSlug, 'eventSlug'),\n };\n case ActivityType.SPLIT:\n case ActivityType.MERGE:\n case ActivityType.REDEEM:\n case ActivityType.CONVERSION:\n return {\n ...base,\n type: activity.type,\n conditionId: expectPresent(activity.conditionId, 'conditionId'),\n amount: inferAmount(activity),\n title: expectPresent(activity.title, 'title'),\n slug: expectPresent(activity.slug, 'slug'),\n icon: activity.icon ?? null,\n eventSlug: expectPresent(activity.eventSlug, 'eventSlug'),\n };\n case ActivityType.REWARD:\n case ActivityType.MAKER_REBATE:\n case ActivityType.REFERRAL_REWARD:\n case ActivityType.YIELD:\n return {\n ...base,\n type: activity.type,\n amount: inferAmount(activity),\n };\n }\n}\n\nfunction normalizeActivityBase(activity: RawActivity): ActivityBase {\n return {\n wallet: expectPresent(activity.proxyWallet, 'proxyWallet'),\n timestamp: expectPresent(activity.timestamp, 'timestamp'),\n transactionHash: expectPresent(activity.transactionHash, 'transactionHash'),\n name: activity.name ?? null,\n pseudonym: activity.pseudonym ?? null,\n bio: activity.bio ?? null,\n profileImage: activity.profileImage ?? null,\n profileImageOptimized: activity.profileImageOptimized ?? null,\n };\n}\n\nfunction inferAmount(activity: RawActivity): DecimalString {\n return expectPresent(activity.usdcSize ?? activity.size, 'usdcSize');\n}\n\nfunction expectPresent<T>(value: T | null | undefined, field: string): T {\n if (value === null || value === undefined) {\n throw new TypeError(`Expected activity.${field} to be present`);\n }\n\n return value;\n}\n","import { z } from 'zod';\nimport { DecimalishSchema, TokenIdSchema } from '../shared';\nimport { AddressSchema, Hash64Schema } from './common';\n\nexport const HolderSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n bio: z.string().nullish(),\n asset: TokenIdSchema.nullish(),\n pseudonym: z.string().nullish(),\n amount: DecimalishSchema.nullish(),\n displayUsernamePublic: z.boolean().nullish(),\n outcomeIndex: z.number().int().nullish(),\n name: z.string().nullish(),\n profileImage: z.string().nullish(),\n profileImageOptimized: z.string().nullish(),\n })\n .transform(({ asset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n }));\n\nexport const MetaHolderSchema = z.object({\n token: z.string().nullish(),\n holders: z.array(HolderSchema).nullish(),\n});\n\nexport const OpenInterestSchema = z.object({\n market: Hash64Schema.nullish(),\n value: DecimalishSchema.nullish(),\n});\n\nexport const MarketVolumeSchema = z.object({\n market: Hash64Schema.nullish(),\n value: DecimalishSchema.nullish(),\n});\n\nexport const LiveVolumeSchema = z.object({\n total: DecimalishSchema.nullish(),\n markets: z.array(MarketVolumeSchema).nullish(),\n});\n\nexport const ListMarketHoldersResponseSchema = z.array(MetaHolderSchema);\nexport const ListOpenInterestResponseSchema = z.array(OpenInterestSchema);\nexport const FetchEventLiveVolumeResponseSchema = z.array(LiveVolumeSchema);\n\nexport type Holder = z.infer<typeof HolderSchema>;\nexport type MetaHolder = z.infer<typeof MetaHolderSchema>;\nexport type OpenInterest = z.infer<typeof OpenInterestSchema>;\nexport type MarketVolume = z.infer<typeof MarketVolumeSchema>;\nexport type LiveVolume = z.infer<typeof LiveVolumeSchema>;\nexport type ListMarketHoldersResponse = z.infer<\n typeof ListMarketHoldersResponseSchema\n>;\nexport type ListOpenInterestResponse = z.infer<\n typeof ListOpenInterestResponseSchema\n>;\nexport type FetchEventLiveVolumeResponse = z.infer<\n typeof FetchEventLiveVolumeResponseSchema\n>;\n","import { z } from 'zod';\nimport { DecimalishSchema, IsoDateTimeStringSchema } from '../shared';\nimport { AddressSchema } from './common';\n\nexport const LeaderboardEntrySchema = z.object({\n rank: z.string().nullish(),\n builder: z.string().nullish(),\n volume: DecimalishSchema.nullish(),\n activeUsers: z.number().int().nullish(),\n verified: z.boolean().nullish(),\n builderLogo: z.string().nullish(),\n});\n\nexport const BuilderVolumeEntrySchema = z\n .object({\n dt: IsoDateTimeStringSchema.nullish(),\n builder: z.string().nullish(),\n builderLogo: z.string().nullish(),\n verified: z.boolean().nullish(),\n volume: DecimalishSchema.nullish(),\n activeUsers: z.number().int().nullish(),\n rank: z.string().nullish(),\n })\n .transform(({ dt, ...rest }) => ({\n ...rest,\n bucketAt: dt,\n }));\n\nexport const TraderLeaderboardEntrySchema = z\n .object({\n rank: z.string().nullish(),\n proxyWallet: AddressSchema.nullish(),\n userName: z.string().nullish(),\n vol: DecimalishSchema.nullish(),\n pnl: DecimalishSchema.nullish(),\n profileImage: z.string().nullish(),\n xUsername: z.string().nullish(),\n verifiedBadge: z.boolean().nullish(),\n })\n .transform(({ proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n }));\n\nexport const ListBuilderLeaderboardResponseSchema = z.array(\n LeaderboardEntrySchema,\n);\nexport const ListBuilderVolumeResponseSchema = z.array(\n BuilderVolumeEntrySchema,\n);\nexport const ListTraderLeaderboardResponseSchema = z.array(\n TraderLeaderboardEntrySchema,\n);\n\nexport type LeaderboardEntry = z.infer<typeof LeaderboardEntrySchema>;\nexport type BuilderVolumeEntry = z.infer<typeof BuilderVolumeEntrySchema>;\nexport type TraderLeaderboardEntry = z.infer<\n typeof TraderLeaderboardEntrySchema\n>;\nexport type ListBuilderLeaderboardResponse = z.infer<\n typeof ListBuilderLeaderboardResponseSchema\n>;\nexport type ListBuilderVolumeResponse = z.infer<\n typeof ListBuilderVolumeResponseSchema\n>;\nexport type ListTraderLeaderboardResponse = z.infer<\n typeof ListTraderLeaderboardResponseSchema\n>;\n","import { z } from 'zod';\nimport {\n ComboConditionIdSchema,\n CtfConditionIdSchema,\n DecimalishSchema,\n EpochSecondsToMillisecondsSchema,\n IsoCalendarDateStringSchema,\n IsoDateTimeStringSchema,\n MixedDateTimeStringSchema,\n PaginationCursorSchema,\n PositionIdSchema,\n TokenIdSchema,\n} from '../shared';\nimport { AddressSchema } from './common';\n\nexport enum ComboPositionStatus {\n Open = 'OPEN',\n Partial = 'PARTIAL',\n ResolvedWin = 'RESOLVED_WIN',\n ResolvedLoss = 'RESOLVED_LOSS',\n}\n\nexport const ComboPositionStatusSchema = z.enum(ComboPositionStatus);\n\nexport const PositionSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: CtfConditionIdSchema,\n size: DecimalishSchema.nullish(),\n avgPrice: DecimalishSchema.nullish(),\n initialValue: DecimalishSchema.nullish(),\n currentValue: DecimalishSchema.nullish(),\n cashPnl: DecimalishSchema.nullish(),\n percentPnl: z.number().nullish(),\n totalBought: DecimalishSchema.nullish(),\n realizedPnl: DecimalishSchema.nullish(),\n percentRealizedPnl: z.number().nullish(),\n curPrice: DecimalishSchema.nullish(),\n redeemable: z.boolean().nullish(),\n mergeable: z.boolean().nullish(),\n title: z.string().nullish(),\n slug: z.string().nullish(),\n icon: z.string().nullish(),\n eventId: z.string().nullish(),\n eventSlug: z.string().nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n oppositeOutcome: z.string().nullish(),\n oppositeAsset: TokenIdSchema.nullish(),\n endDate: IsoCalendarDateStringSchema.nullish(),\n negativeRisk: z.boolean().nullish(),\n })\n .transform(({ asset, oppositeAsset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n oppositeTokenId: oppositeAsset,\n }));\n\nexport const ClosedPositionSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: CtfConditionIdSchema.nullish(),\n avgPrice: DecimalishSchema.nullish(),\n totalBought: DecimalishSchema.nullish(),\n realizedPnl: DecimalishSchema.nullish(),\n curPrice: DecimalishSchema.nullish(),\n timestamp: EpochSecondsToMillisecondsSchema.nullish(),\n title: z.string().nullish(),\n slug: z.string().nullish(),\n icon: z.string().nullish(),\n eventSlug: z.string().nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n oppositeOutcome: z.string().nullish(),\n oppositeAsset: TokenIdSchema.nullish(),\n endDate: MixedDateTimeStringSchema.nullish(),\n })\n .transform(({ asset, oppositeAsset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n oppositeTokenId: oppositeAsset,\n }));\n\nexport const ValueSchema = z.object({\n user: AddressSchema.nullish(),\n value: DecimalishSchema.nullish(),\n});\n\nexport const MarketPositionSchema = z\n .object({\n proxyWallet: AddressSchema.nullish(),\n name: z.string().nullish(),\n profileImage: z.string().nullish(),\n verified: z.boolean().nullish(),\n asset: TokenIdSchema.nullish(),\n conditionId: CtfConditionIdSchema.nullish(),\n avgPrice: DecimalishSchema.nullish(),\n size: DecimalishSchema.nullish(),\n currPrice: DecimalishSchema.nullish(),\n currentValue: DecimalishSchema.nullish(),\n cashPnl: DecimalishSchema.nullish(),\n totalBought: DecimalishSchema.nullish(),\n realizedPnl: DecimalishSchema.nullish(),\n totalPnl: DecimalishSchema.nullish(),\n outcome: z.string().nullish(),\n outcomeIndex: z.number().int().nullish(),\n })\n .transform(({ asset, proxyWallet, ...rest }) => ({\n ...rest,\n wallet: proxyWallet,\n tokenId: asset,\n }));\n\nexport const MetaMarketPositionSchema = z.object({\n token: z.string().nullish(),\n positions: z.array(MarketPositionSchema).nullish(),\n});\n\nexport const ComboPositionMarketEventSchema = z\n .object({\n event_id: z.string().nullish(),\n event_slug: z.string().nullish(),\n event_title: z.string().nullish(),\n event_image: z.string().nullish(),\n })\n .transform(({ event_id, event_slug, event_title, event_image }) => ({\n eventId: event_id,\n eventSlug: event_slug,\n eventTitle: event_title,\n eventImage: event_image,\n }));\n\nexport const ComboPositionMarketSchema = z\n .object({\n market_id: z.string().nullish(),\n slug: z.string().nullish(),\n title: z.string().nullish(),\n outcome: z.string().nullish(),\n image_url: z.string().nullish(),\n icon_url: z.string().nullish(),\n category: z.string().nullish(),\n subcategory: z.string().nullish(),\n tags: z.array(z.string()).nullish(),\n end_date: IsoDateTimeStringSchema.nullish(),\n event: ComboPositionMarketEventSchema.nullish(),\n })\n .transform(({ market_id, image_url, icon_url, end_date, ...rest }) => ({\n ...rest,\n marketId: market_id,\n imageUrl: image_url,\n iconUrl: icon_url,\n endDate: end_date,\n }));\n\nexport const ComboPositionLegSchema = z\n .object({\n leg_index: z.number().int(),\n leg_position_id: PositionIdSchema,\n leg_condition_id: CtfConditionIdSchema,\n leg_outcome_index: z.number().int(),\n leg_outcome_label: z.string().nullish(),\n leg_status: ComboPositionStatusSchema,\n leg_resolved_at: IsoDateTimeStringSchema.nullish(),\n leg_current_price: DecimalishSchema.nullish(),\n market: ComboPositionMarketSchema.nullish(),\n })\n .transform(\n ({\n leg_index,\n leg_position_id,\n leg_condition_id,\n leg_outcome_index,\n leg_outcome_label,\n leg_status,\n leg_resolved_at,\n leg_current_price,\n ...rest\n }) => ({\n ...rest,\n legIndex: leg_index,\n legPositionId: leg_position_id,\n legConditionId: leg_condition_id,\n legOutcomeIndex: leg_outcome_index,\n legOutcomeLabel: leg_outcome_label,\n legStatus: leg_status,\n legResolvedAt: leg_resolved_at,\n legCurrentPrice: leg_current_price,\n }),\n );\n\nexport const ComboPositionSchema = z\n .object({\n combo_condition_id: ComboConditionIdSchema,\n combo_position_id: PositionIdSchema,\n module_id: z.number().int(),\n user_address: AddressSchema,\n shares_balance: DecimalishSchema,\n entry_avg_price_usdc: DecimalishSchema.nullish(),\n entry_cost_usdc: DecimalishSchema.nullish(),\n status: ComboPositionStatusSchema,\n first_entry_at: IsoDateTimeStringSchema,\n resolved_at: IsoDateTimeStringSchema.nullish(),\n legs_total: z.number().int(),\n legs_resolved: z.number().int(),\n legs_pending: z.number().int(),\n legs: z.array(ComboPositionLegSchema),\n })\n .transform(\n ({\n combo_condition_id,\n combo_position_id,\n module_id,\n user_address,\n shares_balance,\n entry_avg_price_usdc,\n entry_cost_usdc,\n first_entry_at,\n resolved_at,\n legs_total,\n legs_resolved,\n legs_pending,\n ...rest\n }) => ({\n ...rest,\n conditionId: combo_condition_id,\n positionId: combo_position_id,\n moduleId: module_id,\n userAddress: user_address,\n shares: shares_balance,\n entryAvgPriceUsdc: entry_avg_price_usdc,\n entryCostUsdc: entry_cost_usdc,\n firstEntryAt: first_entry_at,\n resolvedAt: resolved_at,\n legsTotal: legs_total,\n legsResolved: legs_resolved,\n legsPending: legs_pending,\n }),\n );\n\nexport const ListComboPositionsResponseSchema = z\n .object({\n combos: z.array(ComboPositionSchema),\n pagination: z.object({\n limit: z.number().int(),\n offset: z.number().int(),\n has_more: z.boolean(),\n next_cursor: PaginationCursorSchema.nullish(),\n }),\n })\n .transform(({ pagination, ...rest }) => ({\n ...rest,\n pagination: {\n limit: pagination.limit,\n offset: pagination.offset,\n hasMore: pagination.has_more,\n nextCursor: pagination.next_cursor,\n },\n }));\n\nexport const ListPositionsResponseSchema = z.array(PositionSchema);\nexport const ListClosedPositionsResponseSchema = z.array(ClosedPositionSchema);\nexport const FetchPortfolioValueResponseSchema = z.array(ValueSchema);\nexport const ListMarketPositionsResponseSchema = z.array(\n MetaMarketPositionSchema,\n);\n\nexport type Position = z.infer<typeof PositionSchema>;\nexport type ClosedPosition = z.infer<typeof ClosedPositionSchema>;\nexport type Value = z.infer<typeof ValueSchema>;\nexport type MarketPosition = z.infer<typeof MarketPositionSchema>;\nexport type MetaMarketPosition = z.infer<typeof MetaMarketPositionSchema>;\nexport type ComboPositionMarketEvent = z.infer<\n typeof ComboPositionMarketEventSchema\n>;\nexport type ComboPositionMarket = z.infer<typeof ComboPositionMarketSchema>;\nexport type ComboPositionLeg = z.infer<typeof ComboPositionLegSchema>;\nexport type ComboPosition = z.infer<typeof ComboPositionSchema>;\nexport type ListPositionsResponse = z.infer<typeof ListPositionsResponseSchema>;\nexport type ListClosedPositionsResponse = z.infer<\n typeof ListClosedPositionsResponseSchema\n>;\nexport type FetchPortfolioValueResponse = z.infer<\n typeof FetchPortfolioValueResponseSchema\n>;\nexport type ListMarketPositionsResponse = z.infer<\n typeof ListMarketPositionsResponseSchema\n>;\nexport type ListComboPositionsResponse = z.infer<\n typeof ListComboPositionsResponseSchema\n>;\n"]}