@polymarket/bindings 0.1.0-beta.12 → 0.1.0-beta.14
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/data/index.d.ts +1 -0
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/package.json +1 -1
package/dist/data/index.d.ts
CHANGED
package/dist/data/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Z as Z$1,na,Ga,Oa,La,oa,da,ma,za,Y,ya,Ia,X as X$1}from'../chunk-GTLPG5HR.js';import {z as z$1}from'zod';var p=z$1.string(),L=z$1.string(),_=(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))(_||{}),O=z$1.enum(_),P=z$1.enum(["BUY","SELL"]),Ie=z$1.enum(["DAY","WEEK","MONTH","ALL"]),Ee=z$1.enum(["OVERALL","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"]),Te=z$1.enum(["PNL","VOL"]);var w=(h=>(h.Open="OPEN",h.Partial="PARTIAL",h.ResolvedWin="RESOLVED_WIN",h.ResolvedLoss="RESOLVED_LOSS",h))(w||{}),V=z$1.enum(w),W=(s=>(s.Yes="YES",s.No="NO",s))(W||{}),Z=z$1.enum(W),$=z$1.object({proxyWallet:p.nullish(),asset:Ga.nullish(),conditionId:Z$1,size:La.nullish(),avgPrice:La.nullish(),initialValue:La.nullish(),currentValue:La.nullish(),cashPnl:La.nullish(),percentPnl:z$1.number().nullish(),totalBought:La.nullish(),realizedPnl:La.nullish(),percentRealizedPnl:z$1.number().nullish(),curPrice:La.nullish(),redeemable:z$1.boolean().nullish(),mergeable:z$1.boolean().nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Oa,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:Ga.nullish(),endDate:na.nullish(),negativeRisk:z$1.boolean().nullish()}).transform(({asset:e,oppositeAsset:n,proxyWallet:s,...c})=>({...c,wallet:s,tokenId:e,oppositeTokenId:n})),q=z$1.object({proxyWallet:p.nullish(),asset:Ga.nullish(),conditionId:Z$1.nullish(),avgPrice:La.nullish(),totalBought:La.nullish(),realizedPnl:La.nullish(),curPrice:La.nullish(),timestamp:da.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Oa,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:Ga.nullish(),endDate:oa.nullish()}).transform(({asset:e,oppositeAsset:n,proxyWallet:s,...c})=>({...c,wallet:s,tokenId:e,oppositeTokenId:n})),J=z$1.object({user:p.nullish(),value:La.nullish()}),Q=z$1.object({proxyWallet:p.nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),verified:z$1.boolean().nullish(),asset:Ga.nullish(),conditionId:Z$1.nullish(),avgPrice:La.nullish(),size:La.nullish(),currPrice:La.nullish(),currentValue:La.nullish(),cashPnl:La.nullish(),totalBought:La.nullish(),realizedPnl:La.nullish(),totalPnl:La.nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish()}).transform(({asset:e,proxyWallet:n,...s})=>({...s,wallet:n,tokenId:e})),X=z$1.object({token:z$1.string().nullish(),positions:z$1.array(Q).nullish()}),ee=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:n,event_title:s,event_image:c})=>({eventId:e,eventSlug:n,eventTitle:s,eventImage:c})),te=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:ma.nullish(),event:ee.nullish()}).transform(({market_id:e,image_url:n,icon_url:s,end_date:c,...h})=>({...h,marketId:e,imageUrl:n,iconUrl:s,endDate:c})),z=z$1.object({leg_index:z$1.number().int(),leg_position_id:za,leg_condition_id:Z$1,leg_outcome_index:z$1.number().int(),leg_outcome_label:z$1.string().nullish(),leg_status:V,leg_resolved_at:ma.nullish(),leg_current_price:La.nullish(),market:te.nullish()}).transform(({leg_index:e,leg_position_id:n,leg_condition_id:s,leg_outcome_index:c,leg_outcome_label:h,leg_status:v,leg_resolved_at:I,leg_current_price:a,...E})=>({...E,legIndex:e,legPositionId:n,legConditionId:s,legOutcomeIndex:c,legOutcomeLabel:h,legStatus:v,legResolvedAt:I,legCurrentPrice:a})),oe=z$1.object({combo_condition_id:Y,combo_position_id:za,side:Z,module_id:z$1.number().int(),user_address:p,shares_balance:La,entry_avg_price_usdc:La.nullish(),entry_cost_usdc:La.nullish(),realized_payout_usdc:La.nullish(),total_cost_usdc:La.nullish(),status:V,redeemable:z$1.boolean(),first_entry_at:ma,resolved_at:ma.nullish(),updated_at:ma.optional(),legs_total:z$1.number().int(),legs_resolved:z$1.number().int(),legs_pending:z$1.number().int(),legs:z$1.array(z)}).transform(({combo_condition_id:e,combo_position_id:n,side:s,module_id:c,user_address:h,shares_balance:v,entry_avg_price_usdc:I,entry_cost_usdc:a,realized_payout_usdc:E,total_cost_usdc:u,first_entry_at:U,resolved_at:N,updated_at:j,legs_total:F,legs_resolved:Y,legs_pending:G,...K})=>({...K,conditionId:e,positionId:n,outcome:s,moduleId:c,wallet:h,shares:v,entryAvgPriceUsdc:I,entryCostUsdc:a,realizedPayoutUsdc:E,totalCostUsdc:u,firstEntryAt:U,resolvedAt:N,updatedAt:j,legsTotal:F,legsResolved:Y,legsPending:G})),Me=z$1.object({combos:z$1.array(oe),pagination:z$1.object({limit:z$1.number().int(),offset:z$1.number().int(),has_more:z$1.boolean(),next_cursor:ya.nullish()})}).transform(({pagination:e,...n})=>({...n,pagination:{limit:e.limit,offset:e.offset,hasMore:e.has_more,nextCursor:e.next_cursor}})),ke=z$1.array($),De=z$1.array(q),Be=z$1.array(J),Oe=z$1.array(X);var ie=(a=>(a.Split="SPLIT",a.Merge="MERGE",a.Convert="CONVERT",a.Compress="COMPRESS",a.Wrap="WRAP",a.Unwrap="UNWRAP",a.Redeem="REDEEM",a))(ie||{}),H=(a=>(a.Split="Split",a.Merge="Merge",a.Convert="Convert",a.Compress="Compress",a.Wrap="Wrap",a.Unwrap="Unwrap",a.Redeem="Redeem",a))(H||{}),ne={Split:"SPLIT",Merge:"MERGE",Convert:"CONVERT",Compress:"COMPRESS",Wrap:"WRAP",Unwrap:"UNWRAP",Redeem:"REDEEM"},se=z$1.enum(H).transform(e=>ne[e]),re=z$1.object({id:X$1,side:se,module_kind:z$1.string(),user_address:p,combo_condition_id:Y,combo_position_id:za,module_id:z$1.number().int(),amount_usdc:La.nullable(),payout_usdc:La.nullable(),timestamp:da,tx_dttm:ma,tx_hash:Ia,log_index:z$1.number().int(),block_number:z$1.number().int(),legs:z$1.array(z)}),le=re.transform(ce),g=z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),ae=z$1.object({proxyWallet:p.nullish(),side:P.nullish(),asset:Ga.nullish(),conditionId:Z$1.nullish(),size:La.nullish(),price:La.nullish(),timestamp:da.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Oa,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:n,...s})=>({...s,wallet:n,tokenId:e})),me=z$1.object({proxyWallet:p.nullish(),timestamp:da.nullish(),conditionId:z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),type:O,size:La.nullish(),usdcSize:La.nullish(),transactionHash:Ia.nullish(),price:La.nullish(),asset:z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),side:z$1.preprocess(e=>e===""?void 0:e,P.nullish()),isCombo:z$1.boolean().optional(),outcomeIndex:z$1.preprocess(e=>e===999?void 0:e,z$1.number().int().optional()),title:g,slug:g,icon:g,eventSlug:g,outcome:g,name:g,pseudonym:g,bio:g,profileImage:g,profileImageOptimized:g}),pe=me.transform(de),Ne=z$1.object({user:p.nullish(),traded:z$1.number().int().nullish()}),je=z$1.array(ae),Fe=z$1.array(pe),Ye=z$1.object({activity:z$1.array(le),pagination:z$1.object({limit:z$1.number().int(),offset:z$1.number().int(),has_more:z$1.boolean(),next_cursor:ya.nullish()})}).transform(({pagination:e,...n})=>({...n,pagination:{limit:e.limit,offset:e.offset,hasMore:e.has_more,nextCursor:e.next_cursor}}));function ce(e){let n=ue(e);switch(e.side){case "SPLIT":return {...n,type:"SPLIT"};case "MERGE":return {...n,type:"MERGE"};case "CONVERT":return {...n,type:"CONVERT"};case "COMPRESS":return {...n,type:"COMPRESS"};case "WRAP":return {...n,type:"WRAP"};case "UNWRAP":return {...n,type:"UNWRAP"};case "REDEEM":return {...n,type:"REDEEM",positionId:e.combo_position_id,payout:e.payout_usdc}}}function ue(e){return {id:e.id,type:e.side,wallet:e.user_address,conditionId:e.combo_condition_id,moduleId:e.module_id,amount:e.amount_usdc,timestamp:e.timestamp,transactionAt:e.tx_dttm,transactionHash:e.tx_hash,logIndex:e.log_index,blockNumber:e.block_number,legs:e.legs}}function de(e){let n=ye(e);switch(e.type){case "TRADE":return he(e,n);case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...n,type:e.type,conditionId:Z$1.parse(l(e.conditionId,"conditionId")),amount:M(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 {...n,type:e.type,amount:M(e)}}}function he(e,n){let s={...n,type:"TRADE",side:l(e.side,"side"),shares:l(e.size,"size"),amount:M(e),price:l(e.price,"price"),title:l(e.title,"title"),icon:e.icon??null};return e.isCombo===true?{...s,isCombo:true,conditionId:Y.parse(l(e.conditionId,"conditionId")),positionId:za.parse(l(e.asset,"asset"))}:{...s,isCombo:false,conditionId:Z$1.parse(l(e.conditionId,"conditionId")),tokenId:Ga.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 ye(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 M(e){return l(e.usdcSize??e.size,"usdcSize")}function l(e,n){if(e==null)throw new TypeError(`Expected activity.${n} to be present`);return e}var ge=z$1.object({proxyWallet:p.nullish(),bio:z$1.string().nullish(),asset:Ga.nullish(),pseudonym:z$1.string().nullish(),amount:La.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:n,...s})=>({...s,wallet:n,tokenId:e})),be=z$1.object({token:z$1.string().nullish(),holders:z$1.array(ge).nullish()}),Se=z$1.object({market:L.nullish(),value:La.nullish()}),fe=z$1.object({market:L.nullish(),value:La.nullish()}),Ae=z$1.object({total:La.nullish(),markets:z$1.array(fe).nullish()}),qe=z$1.array(be),Je=z$1.array(Se),Qe=z$1.array(Ae);var Ce=z$1.object({rank:z$1.string().nullish(),builder:z$1.string().nullish(),volume:La.nullish(),activeUsers:z$1.number().int().nullish(),verified:z$1.boolean().nullish(),builderLogo:z$1.string().nullish()}),xe=z$1.object({dt:ma.nullish(),builder:z$1.string().nullish(),builderLogo:z$1.string().nullish(),verified:z$1.boolean().nullish(),volume:La.nullish(),activeUsers:z$1.number().int().nullish(),rank:z$1.string().nullish()}).transform(({dt:e,...n})=>({...n,bucketAt:e})),Re=z$1.object({rank:z$1.string().nullish(),proxyWallet:p.nullish(),userName:z$1.string().nullish(),vol:La.nullish(),pnl:La.nullish(),profileImage:z$1.string().nullish(),xUsername:z$1.string().nullish(),verifiedBadge:z$1.boolean().nullish()}).transform(({proxyWallet:e,...n})=>({...n,wallet:e})),it=z$1.array(Ce),nt=z$1.array(xe),st=z$1.array(Re);export{pe as ActivitySchema,_ as ActivityType,O as ActivityTypeSchema,p as AddressSchema,xe as BuilderVolumeEntrySchema,q as ClosedPositionSchema,le as ComboActivitySchema,ie as ComboActivityType,z as ComboPositionLegSchema,ee as ComboPositionMarketEventSchema,te as ComboPositionMarketSchema,W as ComboPositionOutcome,Z as ComboPositionOutcomeSchema,oe as ComboPositionSchema,w as ComboPositionStatus,V as ComboPositionStatusSchema,Qe as FetchEventLiveVolumeResponseSchema,Be as FetchPortfolioValueResponseSchema,L as Hash64Schema,ge as HolderSchema,Ee as LeaderboardCategorySchema,Ce as LeaderboardEntrySchema,Te as LeaderboardOrderBySchema,Fe as ListActivityResponseSchema,it as ListBuilderLeaderboardResponseSchema,nt as ListBuilderVolumeResponseSchema,De as ListClosedPositionsResponseSchema,Ye as ListComboActivityResponseSchema,Me as ListComboPositionsResponseSchema,qe as ListMarketHoldersResponseSchema,Oe as ListMarketPositionsResponseSchema,Je as ListOpenInterestResponseSchema,ke as ListPositionsResponseSchema,st as ListTraderLeaderboardResponseSchema,je as ListTradesResponseSchema,Ae as LiveVolumeSchema,Q as MarketPositionSchema,fe as MarketVolumeSchema,be as MetaHolderSchema,X as MetaMarketPositionSchema,Se as OpenInterestSchema,$ as PositionSchema,P as SideSchema,Ie as TimePeriodSchema,ae as TradeSchema,Ne as TradedSchema,Re as TraderLeaderboardEntrySchema,J as ValueSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {Z as Z$1,na,Ga,Oa,La,oa,da,ma,za,Y,ya,Ia,X as X$1}from'../chunk-GTLPG5HR.js';import {z as z$1}from'zod';var m=z$1.string(),T=z$1.string(),_=(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))(_||{}),O=z$1.enum(_),P=z$1.enum(["BUY","SELL"]),Re=z$1.enum(["DAY","WEEK","MONTH","ALL"]),Ie=z$1.enum(["OVERALL","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"]),ve=z$1.enum(["PNL","VOL"]);var w=(g=>(g.Open="OPEN",g.Partial="PARTIAL",g.ResolvedPartial="RESOLVED_PARTIAL",g.ResolvedWin="RESOLVED_WIN",g.ResolvedLoss="RESOLVED_LOSS",g))(w||{}),V=z$1.enum(w),W=(s=>(s.Yes="YES",s.No="NO",s))(W||{}),Z=z$1.enum(W),$=z$1.object({proxyWallet:m.nullish(),asset:Ga.nullish(),conditionId:Z$1,size:La.nullish(),avgPrice:La.nullish(),initialValue:La.nullish(),currentValue:La.nullish(),cashPnl:La.nullish(),percentPnl:z$1.number().nullish(),totalBought:La.nullish(),realizedPnl:La.nullish(),percentRealizedPnl:z$1.number().nullish(),curPrice:La.nullish(),redeemable:z$1.boolean().nullish(),mergeable:z$1.boolean().nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Oa,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:Ga.nullish(),endDate:na.nullish(),negativeRisk:z$1.boolean().nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:s,...p})=>({...p,wallet:s,tokenId:e,oppositeTokenId:i})),q=z$1.object({proxyWallet:m.nullish(),asset:Ga.nullish(),conditionId:Z$1.nullish(),avgPrice:La.nullish(),totalBought:La.nullish(),realizedPnl:La.nullish(),curPrice:La.nullish(),timestamp:da.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Oa,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:Ga.nullish(),endDate:oa.nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:s,...p})=>({...p,wallet:s,tokenId:e,oppositeTokenId:i})),J=z$1.object({user:m.nullish(),value:La.nullish()}),Q=z$1.object({proxyWallet:m.nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),verified:z$1.boolean().nullish(),asset:Ga.nullish(),conditionId:Z$1.nullish(),avgPrice:La.nullish(),size:La.nullish(),currPrice:La.nullish(),currentValue:La.nullish(),cashPnl:La.nullish(),totalBought:La.nullish(),realizedPnl:La.nullish(),totalPnl:La.nullish(),outcome:z$1.string().nullish(),outcomeIndex:z$1.number().int().nullish()}).transform(({asset:e,proxyWallet:i,...s})=>({...s,wallet:i,tokenId:e})),X=z$1.object({token:z$1.string().nullish(),positions:z$1.array(Q).nullish()}),ee=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:s,event_image:p})=>({eventId:e,eventSlug:i,eventTitle:s,eventImage:p})),te=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:ma.nullish(),event:ee.nullish()}).transform(({market_id:e,image_url:i,icon_url:s,end_date:p,...x})=>({...x,marketId:e,imageUrl:i,iconUrl:s,endDate:p})),z=z$1.object({leg_index:z$1.number().int(),leg_position_id:za,leg_condition_id:Z$1,leg_outcome_index:z$1.number().int(),leg_outcome_label:z$1.string().nullish(),leg_status:V,leg_resolved_at:ma.nullish(),leg_current_price:La.nullish(),market:te.nullish()}).transform(({leg_index:e,leg_position_id:i,leg_condition_id:s,leg_outcome_index:p,leg_outcome_label:x,leg_status:g,leg_resolved_at:v,leg_current_price:c,...E})=>({...E,legIndex:e,legPositionId:i,legConditionId:s,legOutcomeIndex:p,legOutcomeLabel:x,legStatus:g,legResolvedAt:v,legCurrentPrice:c})),oe=z$1.object({combo_condition_id:Y,combo_position_id:za,side:Z,module_id:z$1.number().int(),user_address:m,shares_balance:La,entry_avg_price_usdc:La.nullish(),entry_cost_usdc:La.nullish(),realized_payout_usdc:La.nullish(),total_cost_usdc:La.nullish(),status:V,redeemable:z$1.boolean(),first_entry_at:ma,resolved_at:ma.nullish(),updated_at:ma.optional(),legs_total:z$1.number().int(),legs_resolved:z$1.number().int(),legs_pending:z$1.number().int(),legs:z$1.array(z)}).transform(({combo_condition_id:e,combo_position_id:i,side:s,module_id:p,user_address:x,shares_balance:g,entry_avg_price_usdc:v,entry_cost_usdc:c,realized_payout_usdc:E,total_cost_usdc:u,first_entry_at:N,resolved_at:j,updated_at:U,legs_total:F,legs_resolved:Y,legs_pending:G,...K})=>({...K,conditionId:e,positionId:i,outcome:s,moduleId:p,wallet:x,shares:g,entryAvgPriceUsdc:v,entryCostUsdc:c,realizedPayoutUsdc:E,totalCostUsdc:u,firstEntryAt:N,resolvedAt:j,updatedAt:U,legsTotal:F,legsResolved:Y,legsPending:G})),Pe=z$1.object({combos:z$1.array(oe),pagination:z$1.object({limit:z$1.number().int(),offset:z$1.number().int(),has_more:z$1.boolean(),next_cursor:ya.nullish()})}).transform(({pagination:e,...i})=>({...i,pagination:{limit:e.limit,offset:e.offset,hasMore:e.has_more,nextCursor:e.next_cursor}})),ze=z$1.array($),Me=z$1.array(q),De=z$1.array(J),ke=z$1.array(X);var H=(c=>(c.Split="SPLIT",c.Merge="MERGE",c.Convert="CONVERT",c.Compress="COMPRESS",c.Wrap="WRAP",c.Unwrap="UNWRAP",c.Redeem="REDEEM",c))(H||{}),ie=z$1.enum(H),ne=z$1.object({id:X$1,type:ie,user_address:m,combo_condition_id:Y,combo_position_id:za,module_id:z$1.number().int(),amount_usdc:La.nullable(),payout_usdc:La.nullable(),timestamp:da,tx_dttm:ma,tx_hash:Ia,log_index:z$1.number().int(),block_number:z$1.number().int(),legs:z$1.array(z)}),se=ne.transform(me),y=z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),re=z$1.object({proxyWallet:m.nullish(),side:P.nullish(),asset:Ga.nullish(),conditionId:Z$1.nullish(),size:La.nullish(),price:La.nullish(),timestamp:da.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Oa,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,...s})=>({...s,wallet:i,tokenId:e})),le=z$1.object({proxyWallet:m.nullish(),timestamp:da.nullish(),conditionId:z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),type:O,size:La.nullish(),usdcSize:La.nullish(),transactionHash:Ia.nullish(),price:La.nullish(),asset:z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),side:z$1.preprocess(e=>e===""?void 0:e,P.nullish()),isCombo:z$1.boolean().optional(),outcomeIndex:z$1.preprocess(e=>e===999?void 0:e,z$1.number().int().optional()),title:y,slug:y,icon:y,eventSlug:y,outcome:y,name:y,pseudonym:y,bio:y,profileImage:y,profileImageOptimized:y}),ae=le.transform(ce),He=z$1.object({user:m.nullish(),traded:z$1.number().int().nullish()}),Ne=z$1.array(re),je=z$1.array(ae),Ue=z$1.object({activity:z$1.array(se),pagination:z$1.object({limit:z$1.number().int(),offset:z$1.number().int(),has_more:z$1.boolean(),next_cursor:ya.nullish()})}).transform(({pagination:e,...i})=>({...i,pagination:{limit:e.limit,offset:e.offset,hasMore:e.has_more,nextCursor:e.next_cursor}}));function me(e){let i=pe(e);switch(e.type){case "SPLIT":return {...i,type:"SPLIT"};case "MERGE":return {...i,type:"MERGE"};case "CONVERT":return {...i,type:"CONVERT"};case "COMPRESS":return {...i,type:"COMPRESS"};case "WRAP":return {...i,type:"WRAP"};case "UNWRAP":return {...i,type:"UNWRAP"};case "REDEEM":return {...i,type:"REDEEM",positionId:e.combo_position_id,payout:e.payout_usdc}}}function pe(e){return {id:e.id,type:e.type,wallet:e.user_address,conditionId:e.combo_condition_id,moduleId:e.module_id,amount:e.amount_usdc,timestamp:e.timestamp,transactionAt:e.tx_dttm,transactionHash:e.tx_hash,logIndex:e.log_index,blockNumber:e.block_number,legs:e.legs}}function ce(e){let i=de(e);switch(e.type){case "TRADE":return ue(e,i);case "SPLIT":case "MERGE":case "REDEEM":case "CONVERSION":return {...i,type:e.type,conditionId:Z$1.parse(l(e.conditionId,"conditionId")),amount:M(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:M(e)}}}function ue(e,i){let s={...i,type:"TRADE",side:l(e.side,"side"),shares:l(e.size,"size"),amount:M(e),price:l(e.price,"price"),title:l(e.title,"title"),icon:e.icon??null};return e.isCombo===true?{...s,isCombo:true,conditionId:Y.parse(l(e.conditionId,"conditionId")),positionId:za.parse(l(e.asset,"asset"))}:{...s,isCombo:false,conditionId:Z$1.parse(l(e.conditionId,"conditionId")),tokenId:Ga.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 de(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 M(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 he=z$1.object({proxyWallet:m.nullish(),bio:z$1.string().nullish(),asset:Ga.nullish(),pseudonym:z$1.string().nullish(),amount:La.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,...s})=>({...s,wallet:i,tokenId:e})),ye=z$1.object({token:z$1.string().nullish(),holders:z$1.array(he).nullish()}),ge=z$1.object({market:T.nullish(),value:La.nullish()}),be=z$1.object({market:T.nullish(),value:La.nullish()}),Se=z$1.object({total:La.nullish(),markets:z$1.array(be).nullish()}),Ze=z$1.array(ye),$e=z$1.array(ge),qe=z$1.array(Se);var fe=z$1.object({rank:z$1.string().nullish(),builder:z$1.string().nullish(),volume:La.nullish(),activeUsers:z$1.number().int().nullish(),verified:z$1.boolean().nullish(),builderLogo:z$1.string().nullish()}),Ae=z$1.object({dt:ma.nullish(),builder:z$1.string().nullish(),builderLogo:z$1.string().nullish(),verified:z$1.boolean().nullish(),volume:La.nullish(),activeUsers:z$1.number().int().nullish(),rank:z$1.string().nullish()}).transform(({dt:e,...i})=>({...i,bucketAt:e})),xe=z$1.object({rank:z$1.string().nullish(),proxyWallet:m.nullish(),userName:z$1.string().nullish(),vol:La.nullish(),pnl:La.nullish(),profileImage:z$1.string().nullish(),xUsername:z$1.string().nullish(),verifiedBadge:z$1.boolean().nullish()}).transform(({proxyWallet:e,...i})=>({...i,wallet:e})),tt=z$1.array(fe),ot=z$1.array(Ae),it=z$1.array(xe);export{ae as ActivitySchema,_ as ActivityType,O as ActivityTypeSchema,m as AddressSchema,Ae as BuilderVolumeEntrySchema,q as ClosedPositionSchema,se as ComboActivitySchema,H as ComboActivityType,z as ComboPositionLegSchema,ee as ComboPositionMarketEventSchema,te as ComboPositionMarketSchema,W as ComboPositionOutcome,Z as ComboPositionOutcomeSchema,oe as ComboPositionSchema,w as ComboPositionStatus,V as ComboPositionStatusSchema,qe as FetchEventLiveVolumeResponseSchema,De as FetchPortfolioValueResponseSchema,T as Hash64Schema,he as HolderSchema,Ie as LeaderboardCategorySchema,fe as LeaderboardEntrySchema,ve as LeaderboardOrderBySchema,je as ListActivityResponseSchema,tt as ListBuilderLeaderboardResponseSchema,ot as ListBuilderVolumeResponseSchema,Me as ListClosedPositionsResponseSchema,Ue as ListComboActivityResponseSchema,Pe as ListComboPositionsResponseSchema,Ze as ListMarketHoldersResponseSchema,ke as ListMarketPositionsResponseSchema,$e as ListOpenInterestResponseSchema,ze as ListPositionsResponseSchema,it as ListTraderLeaderboardResponseSchema,Ne as ListTradesResponseSchema,Se as LiveVolumeSchema,Q as MarketPositionSchema,be as MarketVolumeSchema,ye as MetaHolderSchema,X as MetaMarketPositionSchema,ge as OpenInterestSchema,$ as PositionSchema,P as SideSchema,Re as TimePeriodSchema,re as TradeSchema,He as TradedSchema,xe as TraderLeaderboardEntrySchema,J as ValueSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/data/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/common.ts","../../src/data/portfolio.ts","../../src/data/activity.ts","../../src/data/analytics.ts","../../src/data/leaderboard.ts"],"names":["AddressSchema","z","Hash64Schema","ActivityType","ActivityTypeSchema","SideSchema","TimePeriodSchema","LeaderboardCategorySchema","LeaderboardOrderBySchema","ComboPositionStatus","ComboPositionStatusSchema","ComboPositionOutcome","ComboPositionOutcomeSchema","PositionSchema","TokenIdSchema","CtfConditionIdSchema","DecimalishSchema","emptyStringToNull","IsoCalendarDateStringSchema","asset","oppositeAsset","proxyWallet","rest","ClosedPositionSchema","EpochSecondsToMillisecondsSchema","MixedDateTimeStringSchema","ValueSchema","MarketPositionSchema","MetaMarketPositionSchema","ComboPositionMarketEventSchema","event_id","event_slug","event_title","event_image","ComboPositionMarketSchema","IsoDateTimeStringSchema","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","side","module_id","user_address","shares_balance","entry_avg_price_usdc","entry_cost_usdc","realized_payout_usdc","total_cost_usdc","first_entry_at","resolved_at","updated_at","legs_total","legs_resolved","legs_pending","ListComboPositionsResponseSchema","PaginationCursorSchema","pagination","ListPositionsResponseSchema","ListClosedPositionsResponseSchema","FetchPortfolioValueResponseSchema","ListMarketPositionsResponseSchema","ComboActivityType","UpstreamComboActivityType","ComboActivityTypeByUpstream","UpstreamComboActivityTypeSchema","value","RawComboActivitySchema","ComboActivityIdSchema","TxHashSchema","ComboActivitySchema","normalizeComboActivity","OptionalTextSchema","TradeSchema","RawActivitySchema","ActivitySchema","normalizeActivity","TradedSchema","ListTradesResponseSchema","ListActivityResponseSchema","ListComboActivityResponseSchema","activity","base","normalizeComboActivityBase","normalizeActivityBase","normalizeTradeActivity","expectPresent","inferAmount","trade","field","HolderSchema","MetaHolderSchema","OpenInterestSchema","MarketVolumeSchema","LiveVolumeSchema","ListMarketHoldersResponseSchema","ListOpenInterestResponseSchema","FetchEventLiveVolumeResponseSchema","LeaderboardEntrySchema","BuilderVolumeEntrySchema","dt","TraderLeaderboardEntrySchema","ListBuilderLeaderboardResponseSchema","ListBuilderVolumeResponseSchema","ListTraderLeaderboardResponseSchema"],"mappings":"gHAEO,IAAMA,CAAAA,CAAgBC,GAAAA,CAAE,MAAA,EAAO,CACzBC,EAAeD,GAAAA,CAAE,MAAA,EAAO,CAEzBE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,MAAQ,OAAA,CACRA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,OAAS,QAAA,CACTA,CAAAA,CAAA,UAAA,CAAa,YAAA,CACbA,CAAAA,CAAA,YAAA,CAAe,cAAA,CACfA,CAAAA,CAAA,gBAAkB,iBAAA,CAClBA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CATEA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAYCC,CAAAA,CAAqBH,GAAAA,CAAE,KAAKE,CAAY,CAAA,CAExCE,CAAAA,CAAaJ,GAAAA,CAAE,IAAA,CAAK,CAAC,KAAA,CAAO,MAAM,CAAC,CAAA,CAEnCK,EAAAA,CAAmBL,GAAAA,CAAE,IAAA,CAAK,CAAC,KAAA,CAAO,MAAA,CAAQ,OAAA,CAAS,KAAK,CAAC,CAAA,CAEzDM,EAAAA,CAA4BN,GAAAA,CAAE,IAAA,CAAK,CAC9C,SAAA,CACA,UAAA,CACA,QAAA,CACA,QAAA,CACA,SAAA,CACA,UAAA,CACA,SAAA,CACA,WAAA,CACA,MAAA,CACA,SACF,CAAC,CAAA,CAEYO,EAAAA,CAA2BP,GAAAA,CAAE,IAAA,CAAK,CAAC,KAAA,CAAO,KAAK,CAAC,ECpBtD,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,CAAE,GAAA,EAAI,CAAE,OAAA,GAC9B,IAAA,CAAMA,GAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EACnB,CAAC,CAAA,CACA,UAAU,CAAC,CAAE,EAAA,CAAAgH,CAAAA,CAAI,GAAG3F,CAAK,CAAA,IAAO,CAC/B,GAAGA,CAAAA,CACH,QAAA,CAAU2F,CACZ,CAAA,CAAE,CAAA,CAESC,EAAAA,CAA+BjH,GAAAA,CACzC,MAAA,CAAO,CACN,IAAA,CAAMA,GAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ,CACzB,WAAA,CAAaD,CAAAA,CAAc,SAAQ,CACnC,QAAA,CAAUC,GAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ,CAC7B,GAAA,CAAKe,GAAiB,OAAA,EAAQ,CAC9B,GAAA,CAAKA,EAAAA,CAAiB,OAAA,EAAQ,CAC9B,YAAA,CAAcf,GAAAA,CAAE,QAAO,CAAE,OAAA,EAAQ,CACjC,SAAA,CAAWA,GAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,GACtB,aAAA,CAAeA,GAAAA,CAAE,OAAA,EAAQ,CAAE,OAAA,EAC7B,CAAC,CAAA,CACA,UAAU,CAAC,CAAE,WAAA,CAAAoB,CAAAA,CAAa,GAAGC,CAAK,CAAA,IAAO,CACxC,GAAGA,CAAAA,CACH,MAAA,CAAQD,CACV,CAAA,CAAE,CAAA,CAES8F,EAAAA,CAAuClH,GAAAA,CAAE,KAAA,CACpD8G,EACF,CAAA,CACaK,EAAAA,CAAkCnH,GAAAA,CAAE,KAAA,CAC/C+G,EACF,CAAA,CACaK,EAAAA,CAAsCpH,GAAAA,CAAE,MACnDiH,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 ComboConditionIdSchema,\n CtfConditionIdSchema,\n DecimalishSchema,\n EpochSecondsToMillisecondsSchema,\n emptyStringToNull,\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 enum ComboPositionOutcome {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport const ComboPositionOutcomeSchema = z.enum(ComboPositionOutcome);\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.preprocess(emptyStringToNull, 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.preprocess(emptyStringToNull, 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 side: ComboPositionOutcomeSchema,\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 realized_payout_usdc: DecimalishSchema.nullish(),\n total_cost_usdc: DecimalishSchema.nullish(),\n status: ComboPositionStatusSchema,\n redeemable: z.boolean(),\n first_entry_at: IsoDateTimeStringSchema,\n resolved_at: IsoDateTimeStringSchema.nullish(),\n updated_at: IsoDateTimeStringSchema.optional(),\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 side,\n module_id,\n user_address,\n shares_balance,\n entry_avg_price_usdc,\n entry_cost_usdc,\n realized_payout_usdc,\n total_cost_usdc,\n first_entry_at,\n resolved_at,\n updated_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 outcome: side,\n moduleId: module_id,\n wallet: user_address,\n shares: shares_balance,\n entryAvgPriceUsdc: entry_avg_price_usdc,\n entryCostUsdc: entry_cost_usdc,\n realizedPayoutUsdc: realized_payout_usdc,\n totalCostUsdc: total_cost_usdc,\n firstEntryAt: first_entry_at,\n resolvedAt: resolved_at,\n updatedAt: updated_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","import { z } from 'zod';\nimport {\n type ComboActivityId,\n ComboActivityIdSchema,\n type ComboConditionId,\n ComboConditionIdSchema,\n type CtfConditionId,\n CtfConditionIdSchema,\n DecimalishSchema,\n type DecimalString,\n type EpochMilliseconds,\n EpochSecondsToMillisecondsSchema,\n emptyStringToNull,\n type IsoDateTimeString,\n IsoDateTimeStringSchema,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\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';\nimport { type ComboPositionLeg, ComboPositionLegSchema } from './portfolio';\n\nexport enum ComboActivityType {\n Split = 'SPLIT',\n Merge = 'MERGE',\n Convert = 'CONVERT',\n Compress = 'COMPRESS',\n Wrap = 'WRAP',\n Unwrap = 'UNWRAP',\n Redeem = 'REDEEM',\n}\n\nenum UpstreamComboActivityType {\n Split = 'Split',\n Merge = 'Merge',\n Convert = 'Convert',\n Compress = 'Compress',\n Wrap = 'Wrap',\n Unwrap = 'Unwrap',\n Redeem = 'Redeem',\n}\n\nconst ComboActivityTypeByUpstream = {\n [UpstreamComboActivityType.Split]: ComboActivityType.Split,\n [UpstreamComboActivityType.Merge]: ComboActivityType.Merge,\n [UpstreamComboActivityType.Convert]: ComboActivityType.Convert,\n [UpstreamComboActivityType.Compress]: ComboActivityType.Compress,\n [UpstreamComboActivityType.Wrap]: ComboActivityType.Wrap,\n [UpstreamComboActivityType.Unwrap]: ComboActivityType.Unwrap,\n [UpstreamComboActivityType.Redeem]: ComboActivityType.Redeem,\n} satisfies Record<UpstreamComboActivityType, ComboActivityType>;\n\nconst UpstreamComboActivityTypeSchema = z\n .enum(UpstreamComboActivityType)\n .transform((value) => ComboActivityTypeByUpstream[value]);\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\ntype TradeActivityBase = ActivityBase & {\n /** A directional outcome-token trade. */\n type: ActivityType.TRADE;\n /** Whether this trade is for a Combo position instead of a binary market token. */\n isCombo: boolean;\n /** Direction of the wallet's trade. */\n side: Side;\n /** Number of 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 share in USD. */\n price: DecimalString;\n /** Human-readable title of the traded market or Combo. */\n title: string;\n /** Icon URL for the traded market or Combo, when available. */\n icon: string | null;\n};\n\nexport type ClobTradeActivity = TradeActivityBase & {\n /** CLOB market trades are binary market outcome-token trades. */\n isCombo: false;\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 /** 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 /** URL slug of the market traded by the wallet. */\n slug: string;\n /** URL slug of the event containing the traded market. */\n eventSlug: string;\n};\n\nexport type ComboTradeActivity = TradeActivityBase & {\n /** Combo trades are protocol v2 Combo position trades. */\n isCombo: true;\n /** Combo condition id traded by the wallet. */\n conditionId: ComboConditionId;\n /** Combo position id bought or sold by the wallet. */\n positionId: PositionId;\n};\n\nexport type TradeActivity = ClobTradeActivity | ComboTradeActivity;\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\ntype ComboActivityBase = {\n /** Stable row id derived from the transaction hash and log index. */\n id: ComboActivityId;\n /** Normalized lifecycle activity type. */\n type: ComboActivityType;\n /** Wallet address whose account history contains this activity. */\n wallet: Address;\n /** Combo condition id involved in this activity. */\n conditionId: ComboConditionId;\n /** Combo module id. */\n moduleId: number;\n /** Amount associated with the lifecycle event in USD. */\n amount: DecimalString | null;\n /** Activity time as Unix epoch milliseconds. */\n timestamp: EpochMilliseconds;\n /** Activity transaction time as an ISO date-time string. */\n transactionAt: IsoDateTimeString;\n /** Polygon transaction hash that produced this activity. */\n transactionHash: TxHash;\n /** Log index within the transaction. */\n logIndex: number;\n /** Polygon block number. */\n blockNumber: number;\n /** Combo legs enriched with market metadata at read time. */\n legs: ComboPositionLeg[];\n};\n\nexport type ComboSplitActivity = ComboActivityBase & {\n type: ComboActivityType.Split;\n};\n\nexport type ComboMergeActivity = ComboActivityBase & {\n type: ComboActivityType.Merge;\n};\n\nexport type ComboConvertActivity = ComboActivityBase & {\n type: ComboActivityType.Convert;\n};\n\nexport type ComboCompressActivity = ComboActivityBase & {\n type: ComboActivityType.Compress;\n};\n\nexport type ComboWrapActivity = ComboActivityBase & {\n type: ComboActivityType.Wrap;\n};\n\nexport type ComboUnwrapActivity = ComboActivityBase & {\n type: ComboActivityType.Unwrap;\n};\n\nexport type ComboRedeemActivity = ComboActivityBase & {\n type: ComboActivityType.Redeem;\n /** Redeemed Combo position id. Only redeem rows carry a source position id. */\n positionId: PositionId;\n /** Payout from the redemption in USD. Only redeem rows carry payout semantics. */\n payout: DecimalString | null;\n};\n\nexport type ComboActivity =\n | ComboSplitActivity\n | ComboMergeActivity\n | ComboConvertActivity\n | ComboCompressActivity\n | ComboWrapActivity\n | ComboUnwrapActivity\n | ComboRedeemActivity;\n\nconst RawComboActivitySchema = z.object({\n id: ComboActivityIdSchema,\n side: UpstreamComboActivityTypeSchema,\n module_kind: z.string(),\n user_address: AddressSchema,\n combo_condition_id: ComboConditionIdSchema,\n combo_position_id: PositionIdSchema,\n module_id: z.number().int(),\n amount_usdc: DecimalishSchema.nullable(),\n payout_usdc: DecimalishSchema.nullable(),\n timestamp: EpochSecondsToMillisecondsSchema,\n tx_dttm: IsoDateTimeStringSchema,\n tx_hash: TxHashSchema,\n log_index: z.number().int(),\n block_number: z.number().int(),\n legs: z.array(ComboPositionLegSchema),\n});\n\nexport const ComboActivitySchema: z.ZodType<ComboActivity> =\n RawComboActivitySchema.transform(normalizeComboActivity);\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.preprocess(emptyStringToNull, 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 z.string().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 z.string().optional(),\n ),\n side: z.preprocess(\n (value) => (value === '' ? undefined : value),\n SideSchema.nullish(),\n ),\n isCombo: z.boolean().optional(),\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);\nexport const ListComboActivityResponseSchema = z\n .object({\n activity: z.array(ComboActivitySchema),\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 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>;\nexport type ListComboActivityResponse = z.infer<\n typeof ListComboActivityResponseSchema\n>;\n\ntype RawComboActivity = z.infer<typeof RawComboActivitySchema>;\ntype RawActivity = z.infer<typeof RawActivitySchema>;\n\nfunction normalizeComboActivity(activity: RawComboActivity): ComboActivity {\n const base = normalizeComboActivityBase(activity);\n\n switch (activity.side) {\n case ComboActivityType.Split:\n return { ...base, type: ComboActivityType.Split };\n case ComboActivityType.Merge:\n return { ...base, type: ComboActivityType.Merge };\n case ComboActivityType.Convert:\n return { ...base, type: ComboActivityType.Convert };\n case ComboActivityType.Compress:\n return { ...base, type: ComboActivityType.Compress };\n case ComboActivityType.Wrap:\n return { ...base, type: ComboActivityType.Wrap };\n case ComboActivityType.Unwrap:\n return { ...base, type: ComboActivityType.Unwrap };\n case ComboActivityType.Redeem:\n return {\n ...base,\n type: ComboActivityType.Redeem,\n positionId: activity.combo_position_id,\n payout: activity.payout_usdc,\n };\n }\n}\n\nfunction normalizeComboActivityBase(\n activity: RawComboActivity,\n): ComboActivityBase {\n return {\n id: activity.id,\n type: activity.side,\n wallet: activity.user_address,\n conditionId: activity.combo_condition_id,\n moduleId: activity.module_id,\n amount: activity.amount_usdc,\n timestamp: activity.timestamp,\n transactionAt: activity.tx_dttm,\n transactionHash: activity.tx_hash,\n logIndex: activity.log_index,\n blockNumber: activity.block_number,\n legs: activity.legs,\n };\n}\n\nfunction normalizeActivity(activity: RawActivity): Activity {\n const base = normalizeActivityBase(activity);\n\n switch (activity.type) {\n case ActivityType.TRADE:\n return normalizeTradeActivity(activity, base);\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: CtfConditionIdSchema.parse(\n expectPresent(activity.conditionId, 'conditionId'),\n ),\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 normalizeTradeActivity(\n activity: RawActivity,\n base: ActivityBase,\n): TradeActivity {\n const trade = {\n ...base,\n type: ActivityType.TRADE as ActivityType.TRADE,\n side: expectPresent(activity.side, 'side'),\n shares: expectPresent(activity.size, 'size'),\n amount: inferAmount(activity),\n price: expectPresent(activity.price, 'price'),\n title: expectPresent(activity.title, 'title'),\n icon: activity.icon ?? null,\n };\n\n if (activity.isCombo === true) {\n return {\n ...trade,\n isCombo: true,\n conditionId: ComboConditionIdSchema.parse(\n expectPresent(activity.conditionId, 'conditionId'),\n ),\n positionId: PositionIdSchema.parse(\n expectPresent(activity.asset, 'asset'),\n ),\n };\n }\n\n return {\n ...trade,\n isCombo: false,\n conditionId: CtfConditionIdSchema.parse(\n expectPresent(activity.conditionId, 'conditionId'),\n ),\n tokenId: TokenIdSchema.parse(expectPresent(activity.asset, 'asset')),\n outcome: expectPresent(activity.outcome, 'outcome'),\n outcomeIndex: expectPresent(activity.outcomeIndex, 'outcomeIndex'),\n slug: expectPresent(activity.slug, 'slug'),\n eventSlug: expectPresent(activity.eventSlug, 'eventSlug'),\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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/data/common.ts","../../src/data/portfolio.ts","../../src/data/activity.ts","../../src/data/analytics.ts","../../src/data/leaderboard.ts"],"names":["AddressSchema","z","Hash64Schema","ActivityType","ActivityTypeSchema","SideSchema","TimePeriodSchema","LeaderboardCategorySchema","LeaderboardOrderBySchema","ComboPositionStatus","ComboPositionStatusSchema","ComboPositionOutcome","ComboPositionOutcomeSchema","PositionSchema","TokenIdSchema","CtfConditionIdSchema","DecimalishSchema","emptyStringToNull","IsoCalendarDateStringSchema","asset","oppositeAsset","proxyWallet","rest","ClosedPositionSchema","EpochSecondsToMillisecondsSchema","MixedDateTimeStringSchema","ValueSchema","MarketPositionSchema","MetaMarketPositionSchema","ComboPositionMarketEventSchema","event_id","event_slug","event_title","event_image","ComboPositionMarketSchema","IsoDateTimeStringSchema","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","side","module_id","user_address","shares_balance","entry_avg_price_usdc","entry_cost_usdc","realized_payout_usdc","total_cost_usdc","first_entry_at","resolved_at","updated_at","legs_total","legs_resolved","legs_pending","ListComboPositionsResponseSchema","PaginationCursorSchema","pagination","ListPositionsResponseSchema","ListClosedPositionsResponseSchema","FetchPortfolioValueResponseSchema","ListMarketPositionsResponseSchema","ComboActivityType","ComboActivityTypeSchema","RawComboActivitySchema","ComboActivityIdSchema","TxHashSchema","ComboActivitySchema","normalizeComboActivity","OptionalTextSchema","value","TradeSchema","RawActivitySchema","ActivitySchema","normalizeActivity","TradedSchema","ListTradesResponseSchema","ListActivityResponseSchema","ListComboActivityResponseSchema","activity","base","normalizeComboActivityBase","normalizeActivityBase","normalizeTradeActivity","expectPresent","inferAmount","trade","field","HolderSchema","MetaHolderSchema","OpenInterestSchema","MarketVolumeSchema","LiveVolumeSchema","ListMarketHoldersResponseSchema","ListOpenInterestResponseSchema","FetchEventLiveVolumeResponseSchema","LeaderboardEntrySchema","BuilderVolumeEntrySchema","dt","TraderLeaderboardEntrySchema","ListBuilderLeaderboardResponseSchema","ListBuilderVolumeResponseSchema","ListTraderLeaderboardResponseSchema"],"mappings":"gHAEO,IAAMA,CAAAA,CAAgBC,GAAAA,CAAE,MAAA,EAAO,CACzBC,EAAeD,GAAAA,CAAE,MAAA,EAAO,CAEzBE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,EAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,UAAA,CAAa,YAAA,CACbA,CAAAA,CAAA,YAAA,CAAe,cAAA,CACfA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CATEA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAYCC,EAAqBH,GAAAA,CAAE,IAAA,CAAKE,CAAY,CAAA,CAExCE,CAAAA,CAAaJ,GAAAA,CAAE,IAAA,CAAK,CAAC,MAAO,MAAM,CAAC,CAAA,CAEnCK,EAAAA,CAAmBL,GAAAA,CAAE,IAAA,CAAK,CAAC,KAAA,CAAO,OAAQ,OAAA,CAAS,KAAK,CAAC,CAAA,CAEzDM,EAAAA,CAA4BN,GAAAA,CAAE,IAAA,CAAK,CAC9C,SAAA,CACA,UAAA,CACA,QAAA,CACA,QAAA,CACA,SAAA,CACA,UAA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AAAA,CAAI,GAAGzF,CAAK,CAAA,IAAO,CAC/B,GAAGA,CAAAA,CACH,SAAUyF,CACZ,CAAA,CAAE,CAAA,CAESC,EAAAA,CAA+B/G,GAAAA,CACzC,MAAA,CAAO,CACN,IAAA,CAAMA,IAAE,MAAA,EAAO,CAAE,OAAA,EAAQ,CACzB,WAAA,CAAaD,CAAAA,CAAc,OAAA,EAAQ,CACnC,QAAA,CAAUC,GAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ,CAC7B,GAAA,CAAKe,EAAAA,CAAiB,SAAQ,CAC9B,GAAA,CAAKA,EAAAA,CAAiB,OAAA,EAAQ,CAC9B,YAAA,CAAcf,GAAAA,CAAE,MAAA,GAAS,OAAA,EAAQ,CACjC,SAAA,CAAWA,GAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ,CAC9B,cAAeA,GAAAA,CAAE,OAAA,EAAQ,CAAE,OAAA,EAC7B,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,WAAA,CAAAoB,CAAAA,CAAa,GAAGC,CAAK,CAAA,IAAO,CACxC,GAAGA,CAAAA,CACH,MAAA,CAAQD,CACV,CAAA,CAAE,CAAA,CAES4F,EAAAA,CAAuChH,GAAAA,CAAE,KAAA,CACpD4G,EACF,CAAA,CACaK,EAAAA,CAAkCjH,GAAAA,CAAE,KAAA,CAC/C6G,EACF,CAAA,CACaK,EAAAA,CAAsClH,GAAAA,CAAE,MACnD+G,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 ComboConditionIdSchema,\n CtfConditionIdSchema,\n DecimalishSchema,\n EpochSecondsToMillisecondsSchema,\n emptyStringToNull,\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 ResolvedPartial = 'RESOLVED_PARTIAL',\n ResolvedWin = 'RESOLVED_WIN',\n ResolvedLoss = 'RESOLVED_LOSS',\n}\n\nexport const ComboPositionStatusSchema = z.enum(ComboPositionStatus);\n\nexport enum ComboPositionOutcome {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport const ComboPositionOutcomeSchema = z.enum(ComboPositionOutcome);\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.preprocess(emptyStringToNull, 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.preprocess(emptyStringToNull, 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 side: ComboPositionOutcomeSchema,\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 realized_payout_usdc: DecimalishSchema.nullish(),\n total_cost_usdc: DecimalishSchema.nullish(),\n status: ComboPositionStatusSchema,\n redeemable: z.boolean(),\n first_entry_at: IsoDateTimeStringSchema,\n resolved_at: IsoDateTimeStringSchema.nullish(),\n updated_at: IsoDateTimeStringSchema.optional(),\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 side,\n module_id,\n user_address,\n shares_balance,\n entry_avg_price_usdc,\n entry_cost_usdc,\n realized_payout_usdc,\n total_cost_usdc,\n first_entry_at,\n resolved_at,\n updated_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 outcome: side,\n moduleId: module_id,\n wallet: user_address,\n shares: shares_balance,\n entryAvgPriceUsdc: entry_avg_price_usdc,\n entryCostUsdc: entry_cost_usdc,\n realizedPayoutUsdc: realized_payout_usdc,\n totalCostUsdc: total_cost_usdc,\n firstEntryAt: first_entry_at,\n resolvedAt: resolved_at,\n updatedAt: updated_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","import { z } from 'zod';\nimport {\n type ComboActivityId,\n ComboActivityIdSchema,\n type ComboConditionId,\n ComboConditionIdSchema,\n type CtfConditionId,\n CtfConditionIdSchema,\n DecimalishSchema,\n type DecimalString,\n type EpochMilliseconds,\n EpochSecondsToMillisecondsSchema,\n emptyStringToNull,\n type IsoDateTimeString,\n IsoDateTimeStringSchema,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\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';\nimport { type ComboPositionLeg, ComboPositionLegSchema } from './portfolio';\n\nexport enum ComboActivityType {\n Split = 'SPLIT',\n Merge = 'MERGE',\n Convert = 'CONVERT',\n Compress = 'COMPRESS',\n Wrap = 'WRAP',\n Unwrap = 'UNWRAP',\n Redeem = 'REDEEM',\n}\n\nconst ComboActivityTypeSchema = z.enum(ComboActivityType);\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\ntype TradeActivityBase = ActivityBase & {\n /** A directional outcome-token trade. */\n type: ActivityType.TRADE;\n /** Whether this trade is for a Combo position instead of a binary market token. */\n isCombo: boolean;\n /** Direction of the wallet's trade. */\n side: Side;\n /** Number of 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 share in USD. */\n price: DecimalString;\n /** Human-readable title of the traded market or Combo. */\n title: string;\n /** Icon URL for the traded market or Combo, when available. */\n icon: string | null;\n};\n\nexport type ClobTradeActivity = TradeActivityBase & {\n /** CLOB market trades are binary market outcome-token trades. */\n isCombo: false;\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 /** 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 /** URL slug of the market traded by the wallet. */\n slug: string;\n /** URL slug of the event containing the traded market. */\n eventSlug: string;\n};\n\nexport type ComboTradeActivity = TradeActivityBase & {\n /** Combo trades are protocol v2 Combo position trades. */\n isCombo: true;\n /** Combo condition id traded by the wallet. */\n conditionId: ComboConditionId;\n /** Combo position id bought or sold by the wallet. */\n positionId: PositionId;\n};\n\nexport type TradeActivity = ClobTradeActivity | ComboTradeActivity;\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\ntype ComboActivityBase = {\n /** Stable row id derived from the transaction hash and log index. */\n id: ComboActivityId;\n /** Normalized lifecycle activity type. */\n type: ComboActivityType;\n /** Wallet address whose account history contains this activity. */\n wallet: Address;\n /** Combo condition id involved in this activity. */\n conditionId: ComboConditionId;\n /** Combo module id. */\n moduleId: number;\n /** Amount associated with the lifecycle event in USD. */\n amount: DecimalString | null;\n /** Activity time as Unix epoch milliseconds. */\n timestamp: EpochMilliseconds;\n /** Activity transaction time as an ISO date-time string. */\n transactionAt: IsoDateTimeString;\n /** Polygon transaction hash that produced this activity. */\n transactionHash: TxHash;\n /** Log index within the transaction. */\n logIndex: number;\n /** Polygon block number. */\n blockNumber: number;\n /** Combo legs enriched with market metadata at read time. */\n legs: ComboPositionLeg[];\n};\n\nexport type ComboSplitActivity = ComboActivityBase & {\n type: ComboActivityType.Split;\n};\n\nexport type ComboMergeActivity = ComboActivityBase & {\n type: ComboActivityType.Merge;\n};\n\nexport type ComboConvertActivity = ComboActivityBase & {\n type: ComboActivityType.Convert;\n};\n\nexport type ComboCompressActivity = ComboActivityBase & {\n type: ComboActivityType.Compress;\n};\n\nexport type ComboWrapActivity = ComboActivityBase & {\n type: ComboActivityType.Wrap;\n};\n\nexport type ComboUnwrapActivity = ComboActivityBase & {\n type: ComboActivityType.Unwrap;\n};\n\nexport type ComboRedeemActivity = ComboActivityBase & {\n type: ComboActivityType.Redeem;\n /** Redeemed Combo position id. Only redeem rows carry a source position id. */\n positionId: PositionId;\n /** Payout from the redemption in USD. Only redeem rows carry payout semantics. */\n payout: DecimalString | null;\n};\n\nexport type ComboActivity =\n | ComboSplitActivity\n | ComboMergeActivity\n | ComboConvertActivity\n | ComboCompressActivity\n | ComboWrapActivity\n | ComboUnwrapActivity\n | ComboRedeemActivity;\n\nconst RawComboActivitySchema = z.object({\n id: ComboActivityIdSchema,\n type: ComboActivityTypeSchema,\n user_address: AddressSchema,\n combo_condition_id: ComboConditionIdSchema,\n combo_position_id: PositionIdSchema,\n module_id: z.number().int(),\n amount_usdc: DecimalishSchema.nullable(),\n payout_usdc: DecimalishSchema.nullable(),\n timestamp: EpochSecondsToMillisecondsSchema,\n tx_dttm: IsoDateTimeStringSchema,\n tx_hash: TxHashSchema,\n log_index: z.number().int(),\n block_number: z.number().int(),\n legs: z.array(ComboPositionLegSchema),\n});\n\nexport const ComboActivitySchema: z.ZodType<ComboActivity> =\n RawComboActivitySchema.transform(normalizeComboActivity);\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.preprocess(emptyStringToNull, 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 z.string().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 z.string().optional(),\n ),\n side: z.preprocess(\n (value) => (value === '' ? undefined : value),\n SideSchema.nullish(),\n ),\n isCombo: z.boolean().optional(),\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);\nexport const ListComboActivityResponseSchema = z\n .object({\n activity: z.array(ComboActivitySchema),\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 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>;\nexport type ListComboActivityResponse = z.infer<\n typeof ListComboActivityResponseSchema\n>;\n\ntype RawComboActivity = z.infer<typeof RawComboActivitySchema>;\ntype RawActivity = z.infer<typeof RawActivitySchema>;\n\nfunction normalizeComboActivity(activity: RawComboActivity): ComboActivity {\n const base = normalizeComboActivityBase(activity);\n\n switch (activity.type) {\n case ComboActivityType.Split:\n return { ...base, type: ComboActivityType.Split };\n case ComboActivityType.Merge:\n return { ...base, type: ComboActivityType.Merge };\n case ComboActivityType.Convert:\n return { ...base, type: ComboActivityType.Convert };\n case ComboActivityType.Compress:\n return { ...base, type: ComboActivityType.Compress };\n case ComboActivityType.Wrap:\n return { ...base, type: ComboActivityType.Wrap };\n case ComboActivityType.Unwrap:\n return { ...base, type: ComboActivityType.Unwrap };\n case ComboActivityType.Redeem:\n return {\n ...base,\n type: ComboActivityType.Redeem,\n positionId: activity.combo_position_id,\n payout: activity.payout_usdc,\n };\n }\n}\n\nfunction normalizeComboActivityBase(\n activity: RawComboActivity,\n): ComboActivityBase {\n return {\n id: activity.id,\n type: activity.type,\n wallet: activity.user_address,\n conditionId: activity.combo_condition_id,\n moduleId: activity.module_id,\n amount: activity.amount_usdc,\n timestamp: activity.timestamp,\n transactionAt: activity.tx_dttm,\n transactionHash: activity.tx_hash,\n logIndex: activity.log_index,\n blockNumber: activity.block_number,\n legs: activity.legs,\n };\n}\n\nfunction normalizeActivity(activity: RawActivity): Activity {\n const base = normalizeActivityBase(activity);\n\n switch (activity.type) {\n case ActivityType.TRADE:\n return normalizeTradeActivity(activity, base);\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: CtfConditionIdSchema.parse(\n expectPresent(activity.conditionId, 'conditionId'),\n ),\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 normalizeTradeActivity(\n activity: RawActivity,\n base: ActivityBase,\n): TradeActivity {\n const trade = {\n ...base,\n type: ActivityType.TRADE as ActivityType.TRADE,\n side: expectPresent(activity.side, 'side'),\n shares: expectPresent(activity.size, 'size'),\n amount: inferAmount(activity),\n price: expectPresent(activity.price, 'price'),\n title: expectPresent(activity.title, 'title'),\n icon: activity.icon ?? null,\n };\n\n if (activity.isCombo === true) {\n return {\n ...trade,\n isCombo: true,\n conditionId: ComboConditionIdSchema.parse(\n expectPresent(activity.conditionId, 'conditionId'),\n ),\n positionId: PositionIdSchema.parse(\n expectPresent(activity.asset, 'asset'),\n ),\n };\n }\n\n return {\n ...trade,\n isCombo: false,\n conditionId: CtfConditionIdSchema.parse(\n expectPresent(activity.conditionId, 'conditionId'),\n ),\n tokenId: TokenIdSchema.parse(expectPresent(activity.asset, 'asset')),\n outcome: expectPresent(activity.outcome, 'outcome'),\n outcomeIndex: expectPresent(activity.outcomeIndex, 'outcomeIndex'),\n slug: expectPresent(activity.slug, 'slug'),\n eventSlug: expectPresent(activity.eventSlug, 'eventSlug'),\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"]}
|
package/package.json
CHANGED