@polymarket/bindings 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QX4CCP47.js → chunk-BAQM5QBB.js} +2 -2
- package/dist/{chunk-QX4CCP47.js.map → chunk-BAQM5QBB.js.map} +1 -1
- package/dist/chunk-NFJUONUG.js +2 -0
- package/dist/{chunk-UDKFL2IM.js.map → chunk-NFJUONUG.js.map} +1 -1
- package/dist/chunk-WVVJ3WNL.js +2 -0
- package/dist/chunk-WVVJ3WNL.js.map +1 -0
- package/dist/clob/index.d.ts +2499 -182
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/combos/index.d.ts +10 -10
- package/dist/combos/index.js +1 -1
- package/dist/combos/index.js.map +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +17 -8
- package/dist/index.js +1 -1
- package/dist/{orders-BDfNkzav.d.ts → orders-CAELACaR.d.ts} +1 -1
- package/dist/perps/index.d.ts +11 -11
- package/dist/perps/index.js +1 -1
- package/dist/relayer/index.d.ts +43 -2
- package/dist/relayer/index.js +1 -1
- package/dist/relayer/index.js.map +1 -1
- package/dist/subscriptions/index.d.ts +11 -11
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-AY4D74DC.js +0 -2
- package/dist/chunk-AY4D74DC.js.map +0 -1
- package/dist/chunk-UDKFL2IM.js +0 -2
package/dist/combos/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'../chunk-HOD4LKZU.js';import {$ as $$1,xa,Pa,Fa,Ea,Qa,ea,fa,_,Ka,Ia,Ja,Oa,T,W as W$1,oa}from'../chunk-AY4D74DC.js';import {z as z$1}from'zod';import {expectHexString}from'@polymarket/types';var f=(d=>(d.Buy="BUY",d.Sell="SELL",d))(f||{}),h=(d=>(d.Yes="YES",d.No="NO",d))(h||{}),k=(d=>(d.Confirm="CONFIRM",d.Decline="DECLINE",d))(k||{}),g=(E=>(E.Matched="MATCHED",E.Mined="MINED",E.Confirmed="CONFIRMED",E.Retrying="RETRYING",E.Failed="FAILED",E))(g||{}),O=(d=>(d.Notional="notional",d.Shares="shares",d))(O||{}),G=(t=>(t.AddressMismatch="ADDRESS_MISMATCH",t.AllowanceValidationFailed="ALLOWANCE_VALIDATION_FAILED",t.BalanceValidationFailed="BALANCE_VALIDATION_FAILED",t.ContradictoryLegs="CONTRADICTORY_LEGS",t.ExpiredRfq="EXPIRED_RFQ",t.InvalidAcceptance="INVALID_ACCEPTANCE",t.InvalidConfirmation="INVALID_CONFIRMATION",t.InvalidExecutionResult="INVALID_EXECUTION_RESULT",t.InvalidIdentity="INVALID_IDENTITY",t.InvalidMessage="INVALID_MESSAGE",t.InvalidOrderSide="INVALID_ORDER_SIDE",t.InvalidQuote="INVALID_QUOTE",t.InvalidRfq="INVALID_RFQ",t.InvalidRfqState="INVALID_RFQ_STATE",t.InvalidRole="INVALID_ROLE",t.InvalidSignature="INVALID_SIGNATURE",t.InvalidSignatureType="INVALID_SIGNATURE_TYPE",t.InternalError="INTERNAL_ERROR",t.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",t.MakerAlreadyResponded="MAKER_ALREADY_RESPONDED",t.MakerDeclined="MAKER_DECLINED",t.MakerNotRequired="MAKER_NOT_REQUIRED",t.MakerQuoteLimited="MAKER_QUOTE_LIMITED",t.MissingMakerAddressInQuote="MISSING_MAKER_ADDRESS_IN_QUOTE",t.MissingMakerAmountInSignedOrder="MISSING_MAKER_AMOUNT_IN_SIGNED_ORDER",t.MissingMakerInSignedOrder="MISSING_MAKER_IN_SIGNED_ORDER",t.MissingQuoteId="MISSING_QUOTE_ID",t.MissingRfqId="MISSING_RFQ_ID",t.MissingSaltInSignedOrder="MISSING_SALT_IN_SIGNED_ORDER",t.MissingSignatureInSignedOrder="MISSING_SIGNATURE_IN_SIGNED_ORDER",t.MissingSignerAddressInQuote="MISSING_SIGNER_ADDRESS_IN_QUOTE",t.MissingSignerInSignedOrder="MISSING_SIGNER_IN_SIGNED_ORDER",t.MissingTakerAmountInSignedOrder="MISSING_TAKER_AMOUNT_IN_SIGNED_ORDER",t.MissingTimestampInSignedOrder="MISSING_TIMESTAMP_IN_SIGNED_ORDER",t.MissingTokenIdInSignedOrder="MISSING_TOKEN_ID_IN_SIGNED_ORDER",t.NoQuotes="NO_QUOTES",t.OrderSideOrTokenDoesNotMatchRequest="ORDER_SIDE_OR_TOKEN_DOES_NOT_MATCH_REQUEST",t.PreExecutionBalanceReservationFailed="PRE_EXECUTION_BALANCE_RESERVATION_FAILED",t.PriceE6NotPositive="PRICE_E6_NOT_POSITIVE",t.QuoteMismatch="QUOTE_MISMATCH",t.QuoteUnavailable="QUOTE_UNAVAILABLE",t.QuotedPriceAboveSafetyThreshold="QUOTED_PRICE_ABOVE_SAFETY_THRESHOLD",t.QuotedPriceOutOfRange="QUOTED_PRICE_OUT_OF_RANGE",t.RateLimited="RATE_LIMITED",t.RequestFailed="REQUEST_FAILED",t.ServiceUnavailable="SERVICE_UNAVAILABLE",t.SignedOrderMakerAmountNotPositive="SIGNED_ORDER_MAKER_AMOUNT_NOT_POSITIVE",t.SignedOrderMakerDoesNotMatchAuth="SIGNED_ORDER_MAKER_DOES_NOT_MATCH_AUTH",t.SignedOrderPriceWorseThanQuote="SIGNED_ORDER_PRICE_WORSE_THAN_QUOTE",t.SignedOrderSignatureTypeDoesNotMatchAuth="SIGNED_ORDER_SIGNATURE_TYPE_DOES_NOT_MATCH_AUTH",t.SignedOrderSignerDoesNotMatchAuth="SIGNED_ORDER_SIGNER_DOES_NOT_MATCH_AUTH",t.SignedOrderSizeDoesNotCoverQuote="SIGNED_ORDER_SIZE_DOES_NOT_COVER_QUOTE",t.SignedOrderTakerAmountNotPositive="SIGNED_ORDER_TAKER_AMOUNT_NOT_POSITIVE",t.SizeE6NotPositive="SIZE_E6_NOT_POSITIVE",t.SizeTooLarge="SIZE_TOO_LARGE",t.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",t.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",t.Unauthenticated="UNAUTHENTICATED",t.UnauthorizedRole="UNAUTHORIZED_ROLE",t.UnknownRfq="UNKNOWN_RFQ",t))(G||{}),D=z$1.enum(f),y=z$1.literal("YES"),V=z$1.enum(k),H=z$1.enum(g),W=z$1.string().transform(e=>e),Y=z$1.object({id:xa,condition_id:$$1,position_ids:z$1.array(Fa),slug:z$1.string(),title:z$1.string(),outcomes:z$1.array(z$1.string()),outcome_prices:z$1.array(Pa),image:z$1.string(),volume:z$1.number(),tags:z$1.array(z$1.string())}).superRefine((e,N)=>{e.outcomes.length!==2&&N.addIssue({code:"custom",message:`Expected binary combo market outcomes, received ${e.outcomes.length}.`,path:["outcomes"]}),e.position_ids.length!==e.outcomes.length&&N.addIssue({code:"custom",message:"Expected position_ids and outcomes to have matching lengths.",path:["position_ids"]}),e.outcome_prices.length!==e.outcomes.length&&N.addIssue({code:"custom",message:"Expected outcome_prices and outcomes to have matching lengths.",path:["outcome_prices"]});}).transform(e=>({conditionId:e.condition_id,id:e.id,image:e.image,outcomes:{yes:{label:e.outcomes[0],positionId:e.position_ids[0],price:e.outcome_prices[0]},no:{label:e.outcomes[1],positionId:e.position_ids[1],price:e.outcome_prices[1]}},slug:e.slug,tags:e.tags,title:e.title,volume:e.volume})),fe=z$1.object({markets:z$1.array(Y),next_cursor:Ea.nullish()}).transform(e=>({markets:e.markets,nextCursor:e.next_cursor??void 0})),X=z$1.discriminatedUnion("unit",[z$1.object({unit:z$1.literal("notional"),value_e6:Qa}),z$1.object({unit:z$1.literal("shares"),value_e6:Qa})]).transform(e=>({unit:e.unit,value:e.value_e6})),Z=(c=>(c.Auth="auth",c.QuoteRequest="RFQ_REQUEST",c.QuoteAck="ACK_RFQ_QUOTE",c.QuoteCancelAck="ACK_RFQ_QUOTE_CANCEL",c.ConfirmationRequest="RFQ_CONFIRMATION_REQUEST",c.ConfirmationAck="ACK_RFQ_CONFIRMATION_RESPONSE",c.ExecutionUpdate="RFQ_EXECUTION_UPDATE",c.Trade="RFQ_TRADE",c.Error="RFQ_ERROR",c))(Z||{}),j=z$1.object({type:z$1.literal("auth"),success:z$1.boolean(),address:ea.optional(),role:z$1.string().optional(),error:z$1.string().optional()}),$=z$1.object({type:z$1.literal("RFQ_REQUEST"),rfq_id:Ia,requestor_public_id:Ka,leg_position_ids:z$1.array(Fa),condition_id:_,yes_position_id:Fa,no_position_id:Fa,direction:D,side:y,requested_size:X,submission_deadline:fa}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestorPublicId:e.requestor_public_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,submissionDeadline:e.submission_deadline,type:"quote_request",yesPositionId:e.yes_position_id})),J=z$1.object({type:z$1.literal("ACK_RFQ_QUOTE"),rfq_id:Ia,quote_id:Ja}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_ack"})),w=z$1.object({type:z$1.literal("ACK_RFQ_QUOTE_CANCEL"),rfq_id:Ia,quote_id:Ja}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_cancel_ack"})),K=z$1.object({type:z$1.literal("RFQ_CONFIRMATION_REQUEST"),rfq_id:Ia,quote_id:Ja,signer_address:ea,maker_address:ea,signature_type:b,leg_position_ids:z$1.array(Fa),condition_id:_,yes_position_id:Fa,no_position_id:Fa,direction:D,side:y,fill_size_e6:Qa,price_e6:Qa,confirm_by:fa}).transform(e=>({conditionId:e.condition_id,confirmBy:e.confirm_by,direction:e.direction,fillSize:e.fill_size_e6,legPositionIds:e.leg_position_ids,makerAddress:e.maker_address,noPositionId:e.no_position_id,price:e.price_e6,quoteId:e.quote_id,rfqId:e.rfq_id,side:e.side,signatureType:e.signature_type,signerAddress:e.signer_address,type:"confirmation_request",yesPositionId:e.yes_position_id})),ee=z$1.object({type:z$1.literal("ACK_RFQ_CONFIRMATION_RESPONSE"),rfq_id:Ia,quote_id:Ja,decision:V}).transform(e=>({decision:e.decision,quoteId:e.quote_id,rfqId:e.rfq_id,type:"confirmation_ack"})),te=z$1.object({type:z$1.literal("RFQ_EXECUTION_UPDATE"),rfq_id:Ia,status:H,tx_hash:Oa.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.tx_hash===void 0?{}:{txHash:e.tx_hash},type:"execution_update"})),ie=z$1.object({type:z$1.literal("RFQ_TRADE"),rfq_id:Ia,requester_id:Ka,condition_id:_,leg_position_ids:z$1.array(Fa),direction:D,side:y,price_e6:Qa,size_e6:Qa,executed_at:fa}).transform(e=>({conditionId:e.condition_id,direction:e.direction,executedAt:e.executed_at,legPositionIds:e.leg_position_ids,price:e.price_e6,requesterId:e.requester_id,rfqId:e.rfq_id,side:e.side,size:e.size_e6,type:"trade"})),oe=z$1.object({type:z$1.literal("RFQ_ERROR"),error_id:z$1.string().optional(),request_type:z$1.string().optional(),rfq_id:Ia.optional(),quote_id:Ja.optional(),code:W,error:z$1.string(),request:z$1.unknown().optional()}).transform(e=>({code:e.code,errorId:e.error_id,message:e.error,quoteId:e.quote_id,requestType:e.request_type,rfqId:e.rfq_id,type:"rfq_error"})),ge=z$1.discriminatedUnion("type",[j,$,J,w,K,ee,te,ie,oe]);var B=(m=>(m.AwaitingRequesterAcceptance="AWAITING_REQUESTER_ACCEPTANCE",m.AwaitingMakerConfirmation="AWAITING_MAKER_CONFIRMATION",m.Executing="EXECUTING",m.Filled="FILLED",m.Failed="FAILED",m.Expired="EXPIRED",m.Canceled="CANCELED",m))(B||{}),re=(o=>(o.InvalidJson="INVALID_JSON",o.InvalidMessage="INVALID_MESSAGE",o.InvalidRole="INVALID_ROLE",o.UnauthorizedRole="UNAUTHORIZED_ROLE",o.Unauthenticated="UNAUTHENTICATED",o.AddressMismatch="ADDRESS_MISMATCH",o.InvalidRfq="INVALID_RFQ",o.ContradictoryLegs="CONTRADICTORY_LEGS",o.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",o.InvalidAcceptance="INVALID_ACCEPTANCE",o.InvalidQuote="INVALID_QUOTE",o.InvalidSignature="INVALID_SIGNATURE",o.InvalidIdentity="INVALID_IDENTITY",o.UnknownRfq="UNKNOWN_RFQ",o.ExpiredRfq="EXPIRED_RFQ",o.InvalidRfqState="INVALID_RFQ_STATE",o.QuoteMismatch="QUOTE_MISMATCH",o.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",o.ServiceUnavailable="SERVICE_UNAVAILABLE",o.PreExecutionBalanceReservationFailed="PRE_EXECUTION_BALANCE_RESERVATION_FAILED",o.BalanceValidationFailed="BALANCE_VALIDATION_FAILED",o.AllowanceValidationFailed="ALLOWANCE_VALIDATION_FAILED",o.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",o.RequestFailed="REQUEST_FAILED",o))(re||{}),ne=(d=>(d.NoQuotes="NO_QUOTES",d.SizeTooLarge="SIZE_TOO_LARGE",d))(ne||{}),se=(q=>(q.MakerDeclined="MAKER_DECLINED",q.AcceptanceWindowExpired="ACCEPTANCE_WINDOW_EXPIRED",q.ExecutionFailed="EXECUTION_FAILED",q))(se||{}),F=z$1.object({code:z$1.string().transform(e=>e),message:z$1.string()}).transform(e=>({code:e.code,message:e.message})),ae=z$1.object({quote_id:Ja,blended_price_e6:Qa,maker_amount_e6:Qa,taker_amount_e6:Qa,total_required_e6:Qa,net_receive_e6:Qa.optional()}).transform(e=>({blendedPrice:e.blended_price_e6,makerAmount:e.maker_amount_e6,quoteId:e.quote_id,takerAmount:e.taker_amount_e6,totalRequired:e.total_required_e6,...e.net_receive_e6===void 0?{}:{netReceive:e.net_receive_e6}})),de=z$1.object({unit:z$1.enum(O),value_e6:z$1.string().regex(/^\d+$/).transform(e=>T(BigInt(e).toString()))}).transform(e=>({unit:e.unit,valueE6:e.value_e6})),_e=z$1.object({rfq_id:Ia,leg_position_ids:z$1.array(Fa),condition_id:_,yes_position_id:Fa,no_position_id:Fa,direction:z$1.enum(f),side:z$1.enum(h),requested_size:de}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,yesPositionId:e.yes_position_id})),ue=z$1.object({rfq_id:Ia,status:z$1.literal("AWAITING_REQUESTER_ACCEPTANCE"),expires_at:fa,builder_code:W$1,request:_e,quote:ae}).transform(e=>({builderCode:e.builder_code,expiresAt:e.expires_at,quote:e.quote,request:e.request,rfqId:e.rfq_id,status:e.status})),ce=z$1.object({rfq_id:Ia,status:z$1.enum(["FAILED","EXPIRED","CANCELED"]),error:F.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.error===void 0?{}:{error:e.error}})),Oe=z$1.union([ue,ce]),De=z$1.object({rfq_id:Ia,status:z$1.union([z$1.enum(B),z$1.enum(g)]),taker_order_hash:z$1.string().optional(),tx_hash:Oa.optional(),error:F.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.taker_order_hash===void 0?{}:{takerOrderHash:e.taker_order_hash},...e.tx_hash===void 0?{}:{txHash:e.tx_hash},...e.error===void 0?{}:{error:e.error}}));var x=z$1.string().transform(e=>expectHexString(e)),le=(u=>(u.Split="split",u.Merge="merge",u.Redeem="redeem",u.SplitOnCondition="split_on_condition",u.MergeOnCondition="merge_on_condition",u.SplitOnEvent="split_on_event",u.MergeOnEvent="merge_on_event",u.ConvertOnEvent="convert_on_event",u.Extract="extract",u.Inject="inject",u.ConvertToYesBasket="convert_to_yes_basket",u.MergeFromYesBasket="merge_from_yes_basket",u.Compress="compress",u))(le||{}),pe=z$1.string().transform(e=>e),me=z$1.object({kind:pe,condition_id:_.optional(),event_id:oa.optional(),position_id:Fa.optional(),condition_index:z$1.number().int().nonnegative().optional().default(0),amount:Qa}).transform(e=>({amount:e.amount,conditionId:e.condition_id,conditionIndex:e.condition_index,eventId:e.event_id,kind:e.kind,positionId:e.position_id})),M=z$1.object({position_id:Fa,amount:Qa}).transform(e=>({amount:e.amount,positionId:e.position_id})),Se=z$1.object({consumed:z$1.array(M),created:z$1.array(M)}).transform(e=>({consumed:e.consumed,created:e.created})),z=z$1.object({to:ea,data:x}).transform(e=>({data:e.data,to:e.to})),Qe=z$1.looseObject({planHash:x,chainId:z$1.number().int(),wallet:ea,routerCall:z}),Le=z$1.object({plan_hash:x,chain_id:z$1.number().int(),wallet:ea,block_number:z$1.string().regex(/^\d+$/).transform(BigInt),starting_pusd:Pa,net_pusd_out:Pa,final_pusd:Pa,operations:z$1.array(me),operation_count:z$1.number().int(),truncated:z$1.boolean(),estimated_cost:z$1.number(),required_pusd_input:Pa,required_positions:z$1.array(M),position_summary:Se.optional(),candidate_position_ids:z$1.array(Fa),router_call:z}).transform(e=>({blockNumber:e.block_number,candidatePositionIds:e.candidate_position_ids,chainId:e.chain_id,estimatedCost:e.estimated_cost,finalPusd:e.final_pusd,netPusdOut:e.net_pusd_out,operationCount:e.operation_count,operations:e.operations,planHash:e.plan_hash,positionSummary:e.position_summary??{consumed:[],created:[]},requiredPositions:e.required_positions,requiredPusdInput:e.required_pusd_input,routerCall:e.router_call,startingPusd:e.starting_pusd,truncated:e.truncated,wallet:e.wallet}));export{Oe as BuilderRfqCreateResponseSchema,De as BuilderRfqStatusResponseSchema,le as CollateralReturnKnownOperationKind,Le as CollateralReturnPlanResponseSchema,Qe as CollateralReturnPlanSchema,se as ComboAcceptFailureReason,ne as ComboQuoteUnavailableReason,fe as ListComboMarketsResponseSchema,k as RfqConfirmationDecision,f as RfqDirection,g as RfqExecutionStatus,G as RfqKnownErrorCode,Z as RfqKnownInboundType,ge as RfqQuoterInboundMessageSchema,re as RfqRejectionCode,O as RfqRequestedSizeUnit,h as RfqSide,B as RfqStatus};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {b}from'../chunk-HOD4LKZU.js';import {aa,va,Na,Da,Ca,Oa,ca,da,$ as $$1,Ia,Ga,Ha,Ma,U,X as X$1,ma}from'../chunk-WVVJ3WNL.js';import {z as z$1}from'zod';import {expectHexString}from'@polymarket/types';var f=(d=>(d.Buy="BUY",d.Sell="SELL",d))(f||{}),h=(d=>(d.Yes="YES",d.No="NO",d))(h||{}),k=(d=>(d.Confirm="CONFIRM",d.Decline="DECLINE",d))(k||{}),g=(E=>(E.Matched="MATCHED",E.Mined="MINED",E.Confirmed="CONFIRMED",E.Retrying="RETRYING",E.Failed="FAILED",E))(g||{}),O=(d=>(d.Notional="notional",d.Shares="shares",d))(O||{}),G=(t=>(t.AddressMismatch="ADDRESS_MISMATCH",t.AllowanceValidationFailed="ALLOWANCE_VALIDATION_FAILED",t.BalanceValidationFailed="BALANCE_VALIDATION_FAILED",t.ContradictoryLegs="CONTRADICTORY_LEGS",t.ExpiredRfq="EXPIRED_RFQ",t.InvalidAcceptance="INVALID_ACCEPTANCE",t.InvalidConfirmation="INVALID_CONFIRMATION",t.InvalidExecutionResult="INVALID_EXECUTION_RESULT",t.InvalidIdentity="INVALID_IDENTITY",t.InvalidMessage="INVALID_MESSAGE",t.InvalidOrderSide="INVALID_ORDER_SIDE",t.InvalidQuote="INVALID_QUOTE",t.InvalidRfq="INVALID_RFQ",t.InvalidRfqState="INVALID_RFQ_STATE",t.InvalidRole="INVALID_ROLE",t.InvalidSignature="INVALID_SIGNATURE",t.InvalidSignatureType="INVALID_SIGNATURE_TYPE",t.InternalError="INTERNAL_ERROR",t.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",t.MakerAlreadyResponded="MAKER_ALREADY_RESPONDED",t.MakerDeclined="MAKER_DECLINED",t.MakerNotRequired="MAKER_NOT_REQUIRED",t.MakerQuoteLimited="MAKER_QUOTE_LIMITED",t.MissingMakerAddressInQuote="MISSING_MAKER_ADDRESS_IN_QUOTE",t.MissingMakerAmountInSignedOrder="MISSING_MAKER_AMOUNT_IN_SIGNED_ORDER",t.MissingMakerInSignedOrder="MISSING_MAKER_IN_SIGNED_ORDER",t.MissingQuoteId="MISSING_QUOTE_ID",t.MissingRfqId="MISSING_RFQ_ID",t.MissingSaltInSignedOrder="MISSING_SALT_IN_SIGNED_ORDER",t.MissingSignatureInSignedOrder="MISSING_SIGNATURE_IN_SIGNED_ORDER",t.MissingSignerAddressInQuote="MISSING_SIGNER_ADDRESS_IN_QUOTE",t.MissingSignerInSignedOrder="MISSING_SIGNER_IN_SIGNED_ORDER",t.MissingTakerAmountInSignedOrder="MISSING_TAKER_AMOUNT_IN_SIGNED_ORDER",t.MissingTimestampInSignedOrder="MISSING_TIMESTAMP_IN_SIGNED_ORDER",t.MissingTokenIdInSignedOrder="MISSING_TOKEN_ID_IN_SIGNED_ORDER",t.NoQuotes="NO_QUOTES",t.OrderSideOrTokenDoesNotMatchRequest="ORDER_SIDE_OR_TOKEN_DOES_NOT_MATCH_REQUEST",t.PreExecutionBalanceReservationFailed="PRE_EXECUTION_BALANCE_RESERVATION_FAILED",t.PriceE6NotPositive="PRICE_E6_NOT_POSITIVE",t.QuoteMismatch="QUOTE_MISMATCH",t.QuoteUnavailable="QUOTE_UNAVAILABLE",t.QuotedPriceAboveSafetyThreshold="QUOTED_PRICE_ABOVE_SAFETY_THRESHOLD",t.QuotedPriceOutOfRange="QUOTED_PRICE_OUT_OF_RANGE",t.RateLimited="RATE_LIMITED",t.RequestFailed="REQUEST_FAILED",t.ServiceUnavailable="SERVICE_UNAVAILABLE",t.SignedOrderMakerAmountNotPositive="SIGNED_ORDER_MAKER_AMOUNT_NOT_POSITIVE",t.SignedOrderMakerDoesNotMatchAuth="SIGNED_ORDER_MAKER_DOES_NOT_MATCH_AUTH",t.SignedOrderPriceWorseThanQuote="SIGNED_ORDER_PRICE_WORSE_THAN_QUOTE",t.SignedOrderSignatureTypeDoesNotMatchAuth="SIGNED_ORDER_SIGNATURE_TYPE_DOES_NOT_MATCH_AUTH",t.SignedOrderSignerDoesNotMatchAuth="SIGNED_ORDER_SIGNER_DOES_NOT_MATCH_AUTH",t.SignedOrderSizeDoesNotCoverQuote="SIGNED_ORDER_SIZE_DOES_NOT_COVER_QUOTE",t.SignedOrderTakerAmountNotPositive="SIGNED_ORDER_TAKER_AMOUNT_NOT_POSITIVE",t.SizeE6NotPositive="SIZE_E6_NOT_POSITIVE",t.SizeTooLarge="SIZE_TOO_LARGE",t.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",t.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",t.Unauthenticated="UNAUTHENTICATED",t.UnauthorizedRole="UNAUTHORIZED_ROLE",t.UnknownRfq="UNKNOWN_RFQ",t))(G||{}),D=z$1.enum(f),y=z$1.literal("YES"),V=z$1.enum(k),H=z$1.enum(g),W=z$1.string().transform(e=>e),Y=z$1.object({id:va,condition_id:aa,position_ids:z$1.array(Da),slug:z$1.string(),title:z$1.string(),outcomes:z$1.array(z$1.string()),outcome_prices:z$1.array(Na),image:z$1.string(),volume:z$1.number(),tags:z$1.array(z$1.string())}).superRefine((e,N)=>{e.outcomes.length!==2&&N.addIssue({code:"custom",message:`Expected binary combo market outcomes, received ${e.outcomes.length}.`,path:["outcomes"]}),e.position_ids.length!==e.outcomes.length&&N.addIssue({code:"custom",message:"Expected position_ids and outcomes to have matching lengths.",path:["position_ids"]}),e.outcome_prices.length!==e.outcomes.length&&N.addIssue({code:"custom",message:"Expected outcome_prices and outcomes to have matching lengths.",path:["outcome_prices"]});}).transform(e=>({conditionId:e.condition_id,id:e.id,image:e.image,outcomes:{yes:{label:e.outcomes[0],positionId:e.position_ids[0],price:e.outcome_prices[0]},no:{label:e.outcomes[1],positionId:e.position_ids[1],price:e.outcome_prices[1]}},slug:e.slug,tags:e.tags,title:e.title,volume:e.volume})),fe=z$1.object({markets:z$1.array(Y),next_cursor:Ca.nullish()}).transform(e=>({markets:e.markets,nextCursor:e.next_cursor??void 0})),X=z$1.discriminatedUnion("unit",[z$1.object({unit:z$1.literal("notional"),value_e6:Oa}),z$1.object({unit:z$1.literal("shares"),value_e6:Oa})]).transform(e=>({unit:e.unit,value:e.value_e6})),Z=(c=>(c.Auth="auth",c.QuoteRequest="RFQ_REQUEST",c.QuoteAck="ACK_RFQ_QUOTE",c.QuoteCancelAck="ACK_RFQ_QUOTE_CANCEL",c.ConfirmationRequest="RFQ_CONFIRMATION_REQUEST",c.ConfirmationAck="ACK_RFQ_CONFIRMATION_RESPONSE",c.ExecutionUpdate="RFQ_EXECUTION_UPDATE",c.Trade="RFQ_TRADE",c.Error="RFQ_ERROR",c))(Z||{}),j=z$1.object({type:z$1.literal("auth"),success:z$1.boolean(),address:ca.optional(),role:z$1.string().optional(),error:z$1.string().optional()}),$=z$1.object({type:z$1.literal("RFQ_REQUEST"),rfq_id:Ga,requestor_public_id:Ia,leg_position_ids:z$1.array(Da),condition_id:$$1,yes_position_id:Da,no_position_id:Da,direction:D,side:y,requested_size:X,submission_deadline:da}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestorPublicId:e.requestor_public_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,submissionDeadline:e.submission_deadline,type:"quote_request",yesPositionId:e.yes_position_id})),J=z$1.object({type:z$1.literal("ACK_RFQ_QUOTE"),rfq_id:Ga,quote_id:Ha}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_ack"})),w=z$1.object({type:z$1.literal("ACK_RFQ_QUOTE_CANCEL"),rfq_id:Ga,quote_id:Ha}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_cancel_ack"})),K=z$1.object({type:z$1.literal("RFQ_CONFIRMATION_REQUEST"),rfq_id:Ga,quote_id:Ha,signer_address:ca,maker_address:ca,signature_type:b,leg_position_ids:z$1.array(Da),condition_id:$$1,yes_position_id:Da,no_position_id:Da,direction:D,side:y,fill_size_e6:Oa,price_e6:Oa,confirm_by:da}).transform(e=>({conditionId:e.condition_id,confirmBy:e.confirm_by,direction:e.direction,fillSize:e.fill_size_e6,legPositionIds:e.leg_position_ids,makerAddress:e.maker_address,noPositionId:e.no_position_id,price:e.price_e6,quoteId:e.quote_id,rfqId:e.rfq_id,side:e.side,signatureType:e.signature_type,signerAddress:e.signer_address,type:"confirmation_request",yesPositionId:e.yes_position_id})),ee=z$1.object({type:z$1.literal("ACK_RFQ_CONFIRMATION_RESPONSE"),rfq_id:Ga,quote_id:Ha,decision:V}).transform(e=>({decision:e.decision,quoteId:e.quote_id,rfqId:e.rfq_id,type:"confirmation_ack"})),te=z$1.object({type:z$1.literal("RFQ_EXECUTION_UPDATE"),rfq_id:Ga,status:H,tx_hash:Ma.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.tx_hash===void 0?{}:{txHash:e.tx_hash},type:"execution_update"})),ie=z$1.object({type:z$1.literal("RFQ_TRADE"),rfq_id:Ga,requester_id:Ia,condition_id:$$1,leg_position_ids:z$1.array(Da),direction:D,side:y,price_e6:Oa,size_e6:Oa,executed_at:da}).transform(e=>({conditionId:e.condition_id,direction:e.direction,executedAt:e.executed_at,legPositionIds:e.leg_position_ids,price:e.price_e6,requesterId:e.requester_id,rfqId:e.rfq_id,side:e.side,size:e.size_e6,type:"trade"})),oe=z$1.object({type:z$1.literal("RFQ_ERROR"),error_id:z$1.string().optional(),request_type:z$1.string().optional(),rfq_id:Ga.optional(),quote_id:Ha.optional(),code:W,error:z$1.string(),request:z$1.unknown().optional()}).transform(e=>({code:e.code,errorId:e.error_id,message:e.error,quoteId:e.quote_id,requestType:e.request_type,rfqId:e.rfq_id,type:"rfq_error"})),ge=z$1.discriminatedUnion("type",[j,$,J,w,K,ee,te,ie,oe]);var B=(m=>(m.AwaitingRequesterAcceptance="AWAITING_REQUESTER_ACCEPTANCE",m.AwaitingMakerConfirmation="AWAITING_MAKER_CONFIRMATION",m.Executing="EXECUTING",m.Filled="FILLED",m.Failed="FAILED",m.Expired="EXPIRED",m.Canceled="CANCELED",m))(B||{}),re=(o=>(o.InvalidJson="INVALID_JSON",o.InvalidMessage="INVALID_MESSAGE",o.InvalidRole="INVALID_ROLE",o.UnauthorizedRole="UNAUTHORIZED_ROLE",o.Unauthenticated="UNAUTHENTICATED",o.AddressMismatch="ADDRESS_MISMATCH",o.InvalidRfq="INVALID_RFQ",o.ContradictoryLegs="CONTRADICTORY_LEGS",o.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",o.InvalidAcceptance="INVALID_ACCEPTANCE",o.InvalidQuote="INVALID_QUOTE",o.InvalidSignature="INVALID_SIGNATURE",o.InvalidIdentity="INVALID_IDENTITY",o.UnknownRfq="UNKNOWN_RFQ",o.ExpiredRfq="EXPIRED_RFQ",o.InvalidRfqState="INVALID_RFQ_STATE",o.QuoteMismatch="QUOTE_MISMATCH",o.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",o.ServiceUnavailable="SERVICE_UNAVAILABLE",o.PreExecutionBalanceReservationFailed="PRE_EXECUTION_BALANCE_RESERVATION_FAILED",o.BalanceValidationFailed="BALANCE_VALIDATION_FAILED",o.AllowanceValidationFailed="ALLOWANCE_VALIDATION_FAILED",o.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",o.RequestFailed="REQUEST_FAILED",o))(re||{}),ne=(d=>(d.NoQuotes="NO_QUOTES",d.SizeTooLarge="SIZE_TOO_LARGE",d))(ne||{}),se=(q=>(q.MakerDeclined="MAKER_DECLINED",q.AcceptanceWindowExpired="ACCEPTANCE_WINDOW_EXPIRED",q.ExecutionFailed="EXECUTION_FAILED",q))(se||{}),F=z$1.object({code:z$1.string().transform(e=>e),message:z$1.string()}).transform(e=>({code:e.code,message:e.message})),ae=z$1.object({quote_id:Ha,blended_price_e6:Oa,maker_amount_e6:Oa,taker_amount_e6:Oa,total_required_e6:Oa,net_receive_e6:Oa.optional()}).transform(e=>({blendedPrice:e.blended_price_e6,makerAmount:e.maker_amount_e6,quoteId:e.quote_id,takerAmount:e.taker_amount_e6,totalRequired:e.total_required_e6,...e.net_receive_e6===void 0?{}:{netReceive:e.net_receive_e6}})),de=z$1.object({unit:z$1.enum(O),value_e6:z$1.string().regex(/^\d+$/).transform(e=>U(BigInt(e).toString()))}).transform(e=>({unit:e.unit,valueE6:e.value_e6})),_e=z$1.object({rfq_id:Ga,leg_position_ids:z$1.array(Da),condition_id:$$1,yes_position_id:Da,no_position_id:Da,direction:z$1.enum(f),side:z$1.enum(h),requested_size:de}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,yesPositionId:e.yes_position_id})),ue=z$1.object({rfq_id:Ga,status:z$1.literal("AWAITING_REQUESTER_ACCEPTANCE"),expires_at:da,builder_code:X$1,request:_e,quote:ae}).transform(e=>({builderCode:e.builder_code,expiresAt:e.expires_at,quote:e.quote,request:e.request,rfqId:e.rfq_id,status:e.status})),ce=z$1.object({rfq_id:Ga,status:z$1.enum(["FAILED","EXPIRED","CANCELED"]),error:F.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.error===void 0?{}:{error:e.error}})),Oe=z$1.union([ue,ce]),De=z$1.object({rfq_id:Ga,status:z$1.union([z$1.enum(B),z$1.enum(g)]),taker_order_hash:z$1.string().optional(),tx_hash:Ma.optional(),error:F.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.taker_order_hash===void 0?{}:{takerOrderHash:e.taker_order_hash},...e.tx_hash===void 0?{}:{txHash:e.tx_hash},...e.error===void 0?{}:{error:e.error}}));var x=z$1.string().transform(e=>expectHexString(e)),le=(u=>(u.Split="split",u.Merge="merge",u.Redeem="redeem",u.SplitOnCondition="split_on_condition",u.MergeOnCondition="merge_on_condition",u.SplitOnEvent="split_on_event",u.MergeOnEvent="merge_on_event",u.ConvertOnEvent="convert_on_event",u.Extract="extract",u.Inject="inject",u.ConvertToYesBasket="convert_to_yes_basket",u.MergeFromYesBasket="merge_from_yes_basket",u.Compress="compress",u))(le||{}),pe=z$1.string().transform(e=>e),me=z$1.object({kind:pe,condition_id:$$1.optional(),event_id:ma.optional(),position_id:Da.optional(),condition_index:z$1.number().int().nonnegative().optional().default(0),amount:Oa}).transform(e=>({amount:e.amount,conditionId:e.condition_id,conditionIndex:e.condition_index,eventId:e.event_id,kind:e.kind,positionId:e.position_id})),M=z$1.object({position_id:Da,amount:Oa}).transform(e=>({amount:e.amount,positionId:e.position_id})),Se=z$1.object({consumed:z$1.array(M),created:z$1.array(M)}).transform(e=>({consumed:e.consumed,created:e.created})),z=z$1.object({to:ca,data:x}).transform(e=>({data:e.data,to:e.to})),Qe=z$1.looseObject({planHash:x,chainId:z$1.number().int(),wallet:ca,routerCall:z}),Le=z$1.object({plan_hash:x,chain_id:z$1.number().int(),wallet:ca,block_number:z$1.string().regex(/^\d+$/).transform(BigInt),starting_pusd:Na,net_pusd_out:Na,final_pusd:Na,operations:z$1.array(me),operation_count:z$1.number().int(),truncated:z$1.boolean(),estimated_cost:z$1.number(),required_pusd_input:Na,required_positions:z$1.array(M),position_summary:Se.optional(),candidate_position_ids:z$1.array(Da),router_call:z}).transform(e=>({blockNumber:e.block_number,candidatePositionIds:e.candidate_position_ids,chainId:e.chain_id,estimatedCost:e.estimated_cost,finalPusd:e.final_pusd,netPusdOut:e.net_pusd_out,operationCount:e.operation_count,operations:e.operations,planHash:e.plan_hash,positionSummary:e.position_summary??{consumed:[],created:[]},requiredPositions:e.required_positions,requiredPusdInput:e.required_pusd_input,routerCall:e.router_call,startingPusd:e.starting_pusd,truncated:e.truncated,wallet:e.wallet}));export{Oe as BuilderRfqCreateResponseSchema,De as BuilderRfqStatusResponseSchema,le as CollateralReturnKnownOperationKind,Le as CollateralReturnPlanResponseSchema,Qe as CollateralReturnPlanSchema,se as ComboAcceptFailureReason,ne as ComboQuoteUnavailableReason,fe as ListComboMarketsResponseSchema,k as RfqConfirmationDecision,f as RfqDirection,g as RfqExecutionStatus,G as RfqKnownErrorCode,Z as RfqKnownInboundType,ge as RfqQuoterInboundMessageSchema,re as RfqRejectionCode,O as RfqRequestedSizeUnit,h as RfqSide,B as RfqStatus};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/combos/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/combos/rfq.ts","../../src/combos/builder-rfq.ts","../../src/combos/plan.ts"],"names":["RfqDirection","RfqSide","RfqConfirmationDecision","RfqExecutionStatus","RfqRequestedSizeUnit","RfqKnownErrorCode","RfqDirectionSchema","z","RfqSideSchema","RfqConfirmationDecisionSchema","RfqExecutionStatusSchema","RfqErrorCodeSchema","value","ComboMarketSchema","MarketIdSchema","ConditionIdSchema","PositionIdSchema","DecimalStringSchema","market","context","ListComboMarketsResponseSchema","PaginationCursorSchema","response","RfqRequestedSizeSchema","E6BigIntStringToDecimalStringSchema","size","RfqKnownInboundType","RfqAuthResponseMessageSchema","EvmAddressSchema","RfqQuoteRequestSchema","RfqIdSchema","RfqRequestorPublicIdSchema","ComboConditionIdSchema","EpochMillisecondsSchema","message","RfqQuoteAckSchema","RfqQuoteIdSchema","RfqQuoteCancelAckSchema","RfqConfirmationRequestSchema","SignatureTypeSchema","RfqConfirmationAckSchema","RfqExecutionUpdateSchema","TxHashSchema","RfqTradeSchema","RfqErrorMessageSchema","RfqQuoterInboundMessageSchema","RfqStatus","RfqRejectionCode","ComboQuoteUnavailableReason","ComboAcceptFailureReason","BuilderRfqErrorSchema","error","BuilderRfqQuoteSchema","quote","BuilderRfqResponseRequestedSizeSchema","toBaseUnits","BuilderRfqResponseRequestSchema","request","BuilderRfqQuoteReadyResponseSchema","BuilderCodeSchema","BuilderRfqFinalStateResponseSchema","BuilderRfqCreateResponseSchema","BuilderRfqStatusResponseSchema","HexStringSchema","expectHexString","CollateralReturnKnownOperationKind","CollateralReturnOperationKindSchema","CollateralReturnOperationSchema","EventIdSchema","operation","CollateralReturnPositionAmountSchema","position","CollateralReturnPositionSummarySchema","summary","CollateralReturnRouterCallSchema","call","CollateralReturnPlanSchema","CollateralReturnPlanResponseSchema"],"mappings":"6MA4CO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,EAAA,IAAA,CAAO,MAAA,CAFGA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,IAAM,KAAA,CACNA,CAAAA,CAAA,EAAA,CAAK,IAAA,CAFKA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,OACVA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,CAAAA,CAAA,OAAA,CAAU,SAAA,CAFAA,OAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,CAAAA,CAAA,MAAQ,OAAA,CACRA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,QAAA,CAAW,UAAA,CACXA,CAAAA,CAAA,MAAA,CAAS,QAAA,CALCA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAQAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,SAAW,UAAA,CACXA,CAAAA,CAAA,MAAA,CAAS,QAAA,CAFCA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,OACVA,CAAAA,CAAA,eAAA,CAAkB,kBAAA,CAClBA,CAAAA,CAAA,yBAAA,CAA4B,6BAAA,CAC5BA,EAAA,uBAAA,CAA0B,2BAAA,CAC1BA,CAAAA,CAAA,iBAAA,CAAoB,oBAAA,CACpBA,CAAAA,CAAA,UAAA,CAAa,aAAA,CACbA,CAAAA,CAAA,iBAAA,CAAoB,oBAAA,CACpBA,CAAAA,CAAA,mBA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CAAAA,CAAS,YAAA,CACtB,oBAAA,CAAsBA,CAAAA,CAAS,sBAAA,CAC/B,OAAA,CAASA,EAAS,QAAA,CAClB,aAAA,CAAeA,CAAAA,CAAS,cAAA,CACxB,SAAA,CAAWA,CAAAA,CAAS,WACpB,UAAA,CAAYA,CAAAA,CAAS,YAAA,CACrB,cAAA,CAAgBA,CAAAA,CAAS,eAAA,CACzB,UAAA,CAAYA,CAAAA,CAAS,UAAA,CACrB,QAAA,CAAUA,CAAAA,CAAS,SAAA,CACnB,eAAA,CAAiBA,CAAAA,CAAS,kBAAoB,CAC5C,QAAA,CAAU,EAAC,CACX,OAAA,CAAS,EACX,CAAA,CACA,iBAAA,CAAmBA,CAAAA,CAAS,kBAAA,CAC5B,iBAAA,CAAmBA,CAAAA,CAAS,oBAC5B,UAAA,CAAYA,CAAAA,CAAS,WAAA,CACrB,YAAA,CAAcA,CAAAA,CAAS,aAAA,CACvB,SAAA,CAAWA,CAAAA,CAAS,SAAA,CACpB,MAAA,CAAQA,CAAAA,CAAS,MACnB,CAAA,CACF","file":"index.js","sourcesContent":["import type {\n Erc1271Signature,\n EvmSignature,\n HexString,\n} from '@polymarket/types';\nimport { z } from 'zod';\nimport {\n type SignatureType,\n SignatureTypeSchema,\n} from '../clob/signature-type';\nimport type {\n BaseUnits,\n ConditionId,\n DecimalString,\n EvmAddress,\n MarketId,\n TokenId,\n} from '../shared';\nimport {\n ComboConditionIdSchema,\n ConditionIdSchema,\n DecimalStringSchema,\n E6BigIntStringToDecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n MarketIdSchema,\n type OrderSide,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\n type RfqId,\n RfqIdSchema,\n type RfqQuoteId,\n RfqQuoteIdSchema,\n RfqRequestorPublicIdSchema,\n TxHashSchema,\n} from '../shared';\n\nexport type {\n RfqId,\n RfqQuoteId,\n RfqRequestorPublicId,\n} from '../shared';\n\nexport enum RfqDirection {\n Buy = 'BUY',\n Sell = 'SELL',\n}\n\nexport enum RfqSide {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport enum RfqConfirmationDecision {\n Confirm = 'CONFIRM',\n Decline = 'DECLINE',\n}\n\nexport enum RfqExecutionStatus {\n Matched = 'MATCHED',\n Mined = 'MINED',\n Confirmed = 'CONFIRMED',\n Retrying = 'RETRYING',\n Failed = 'FAILED',\n}\n\nexport enum RfqRequestedSizeUnit {\n Notional = 'notional',\n Shares = 'shares',\n}\n\nexport enum RfqKnownErrorCode {\n AddressMismatch = 'ADDRESS_MISMATCH',\n AllowanceValidationFailed = 'ALLOWANCE_VALIDATION_FAILED',\n BalanceValidationFailed = 'BALANCE_VALIDATION_FAILED',\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n ExpiredRfq = 'EXPIRED_RFQ',\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n InvalidConfirmation = 'INVALID_CONFIRMATION',\n InvalidExecutionResult = 'INVALID_EXECUTION_RESULT',\n InvalidIdentity = 'INVALID_IDENTITY',\n InvalidMessage = 'INVALID_MESSAGE',\n InvalidOrderSide = 'INVALID_ORDER_SIDE',\n InvalidQuote = 'INVALID_QUOTE',\n InvalidRfq = 'INVALID_RFQ',\n InvalidRfqState = 'INVALID_RFQ_STATE',\n InvalidRole = 'INVALID_ROLE',\n InvalidSignature = 'INVALID_SIGNATURE',\n InvalidSignatureType = 'INVALID_SIGNATURE_TYPE',\n InternalError = 'INTERNAL_ERROR',\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n MakerAlreadyResponded = 'MAKER_ALREADY_RESPONDED',\n MakerDeclined = 'MAKER_DECLINED',\n MakerNotRequired = 'MAKER_NOT_REQUIRED',\n MakerQuoteLimited = 'MAKER_QUOTE_LIMITED',\n MissingMakerAddressInQuote = 'MISSING_MAKER_ADDRESS_IN_QUOTE',\n MissingMakerAmountInSignedOrder = 'MISSING_MAKER_AMOUNT_IN_SIGNED_ORDER',\n MissingMakerInSignedOrder = 'MISSING_MAKER_IN_SIGNED_ORDER',\n MissingQuoteId = 'MISSING_QUOTE_ID',\n MissingRfqId = 'MISSING_RFQ_ID',\n MissingSaltInSignedOrder = 'MISSING_SALT_IN_SIGNED_ORDER',\n MissingSignatureInSignedOrder = 'MISSING_SIGNATURE_IN_SIGNED_ORDER',\n MissingSignerAddressInQuote = 'MISSING_SIGNER_ADDRESS_IN_QUOTE',\n MissingSignerInSignedOrder = 'MISSING_SIGNER_IN_SIGNED_ORDER',\n MissingTakerAmountInSignedOrder = 'MISSING_TAKER_AMOUNT_IN_SIGNED_ORDER',\n MissingTimestampInSignedOrder = 'MISSING_TIMESTAMP_IN_SIGNED_ORDER',\n MissingTokenIdInSignedOrder = 'MISSING_TOKEN_ID_IN_SIGNED_ORDER',\n NoQuotes = 'NO_QUOTES',\n OrderSideOrTokenDoesNotMatchRequest = 'ORDER_SIDE_OR_TOKEN_DOES_NOT_MATCH_REQUEST',\n PreExecutionBalanceReservationFailed = 'PRE_EXECUTION_BALANCE_RESERVATION_FAILED',\n PriceE6NotPositive = 'PRICE_E6_NOT_POSITIVE',\n QuoteMismatch = 'QUOTE_MISMATCH',\n QuoteUnavailable = 'QUOTE_UNAVAILABLE',\n QuotedPriceAboveSafetyThreshold = 'QUOTED_PRICE_ABOVE_SAFETY_THRESHOLD',\n QuotedPriceOutOfRange = 'QUOTED_PRICE_OUT_OF_RANGE',\n RateLimited = 'RATE_LIMITED',\n RequestFailed = 'REQUEST_FAILED',\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n SignedOrderMakerAmountNotPositive = 'SIGNED_ORDER_MAKER_AMOUNT_NOT_POSITIVE',\n SignedOrderMakerDoesNotMatchAuth = 'SIGNED_ORDER_MAKER_DOES_NOT_MATCH_AUTH',\n SignedOrderPriceWorseThanQuote = 'SIGNED_ORDER_PRICE_WORSE_THAN_QUOTE',\n SignedOrderSignatureTypeDoesNotMatchAuth = 'SIGNED_ORDER_SIGNATURE_TYPE_DOES_NOT_MATCH_AUTH',\n SignedOrderSignerDoesNotMatchAuth = 'SIGNED_ORDER_SIGNER_DOES_NOT_MATCH_AUTH',\n SignedOrderSizeDoesNotCoverQuote = 'SIGNED_ORDER_SIZE_DOES_NOT_COVER_QUOTE',\n SignedOrderTakerAmountNotPositive = 'SIGNED_ORDER_TAKER_AMOUNT_NOT_POSITIVE',\n SizeE6NotPositive = 'SIZE_E6_NOT_POSITIVE',\n SizeTooLarge = 'SIZE_TOO_LARGE',\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n Unauthenticated = 'UNAUTHENTICATED',\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n UnknownRfq = 'UNKNOWN_RFQ',\n}\n\n/**\n * An RFQ error code. Known codes are enumerated in {@link RfqKnownErrorCode};\n * newly introduced codes flow through as plain strings so they can be handled\n * before a client release that enumerates them.\n */\nexport type RfqErrorCode = RfqKnownErrorCode | (string & {});\n\nconst RfqDirectionSchema = z.enum(RfqDirection);\nconst RfqSideSchema = z.literal(RfqSide.Yes);\nconst RfqConfirmationDecisionSchema = z.enum(RfqConfirmationDecision);\nconst RfqExecutionStatusSchema = z.enum(RfqExecutionStatus);\n\n// Error codes evolve independently of released clients. Codes not yet\n// enumerated in RfqKnownErrorCode must still parse and flow through as-is.\nconst RfqErrorCodeSchema = z.string().transform((value): RfqErrorCode => value);\n\nexport type ComboMarket = {\n id: MarketId;\n conditionId: ConditionId;\n slug: string;\n title: string;\n outcomes: ComboMarketOutcomes;\n image: string;\n volume: number;\n tags: string[];\n};\n\nexport type ComboMarketOutcome = {\n label: string;\n positionId: PositionId;\n price: DecimalString;\n};\n\nexport type ComboMarketOutcomes = {\n yes: ComboMarketOutcome;\n no: ComboMarketOutcome;\n};\n\nconst ComboMarketSchema = z\n .object({\n id: MarketIdSchema,\n condition_id: ConditionIdSchema,\n position_ids: z.array(PositionIdSchema),\n slug: z.string(),\n title: z.string(),\n outcomes: z.array(z.string()),\n outcome_prices: z.array(DecimalStringSchema),\n image: z.string(),\n volume: z.number(),\n tags: z.array(z.string()),\n })\n .superRefine((market, context) => {\n if (market.outcomes.length !== 2) {\n context.addIssue({\n code: 'custom',\n message: `Expected binary combo market outcomes, received ${market.outcomes.length}.`,\n path: ['outcomes'],\n });\n }\n\n if (market.position_ids.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message: 'Expected position_ids and outcomes to have matching lengths.',\n path: ['position_ids'],\n });\n }\n\n if (market.outcome_prices.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message:\n 'Expected outcome_prices and outcomes to have matching lengths.',\n path: ['outcome_prices'],\n });\n }\n })\n .transform(\n (market): ComboMarket => ({\n conditionId: market.condition_id,\n id: market.id,\n image: market.image,\n outcomes: {\n yes: {\n label: market.outcomes[0] as string,\n positionId: market.position_ids[0] as PositionId,\n price: market.outcome_prices[0] as DecimalString,\n },\n no: {\n label: market.outcomes[1] as string,\n positionId: market.position_ids[1] as PositionId,\n price: market.outcome_prices[1] as DecimalString,\n },\n },\n slug: market.slug,\n tags: market.tags,\n title: market.title,\n volume: market.volume,\n }),\n );\n\nexport const ListComboMarketsResponseSchema = z\n .object({\n markets: z.array(ComboMarketSchema),\n next_cursor: PaginationCursorSchema.nullish(),\n })\n .transform((response) => ({\n markets: response.markets,\n nextCursor: response.next_cursor ?? undefined,\n }));\n\nexport type ListComboMarketsResponse = z.infer<\n typeof ListComboMarketsResponseSchema\n>;\n\nexport type RfqRequestedSize =\n | {\n unit: RfqRequestedSizeUnit.Notional;\n value: DecimalString;\n }\n | {\n unit: RfqRequestedSizeUnit.Shares;\n value: DecimalString;\n };\n\nconst RfqRequestedSizeSchema = z\n .discriminatedUnion('unit', [\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Notional),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Shares),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n ])\n .transform(\n (size): RfqRequestedSize => ({\n unit: size.unit,\n value: size.value_e6,\n }),\n ) satisfies z.ZodType<RfqRequestedSize>;\n\nexport type RfqSignedOrder = {\n salt: string;\n maker: EvmAddress;\n signer: EvmAddress;\n tokenId: PositionId | TokenId;\n makerAmount: BaseUnits;\n takerAmount: BaseUnits;\n side: RfqOrderSide;\n signatureType: SignatureType;\n timestamp: string;\n builder?: HexString;\n expiration?: string;\n metadata?: HexString;\n signature: EvmSignature | Erc1271Signature;\n};\n\nexport type RfqOrderSide = OrderSide | 0 | 1;\n\nexport type RfqAuthMessage = {\n type: 'auth';\n auth: {\n apiKey: string;\n passphrase: string;\n secret: string;\n };\n identity: {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n };\n};\n\nexport enum RfqKnownInboundType {\n Auth = 'auth',\n QuoteRequest = 'RFQ_REQUEST',\n QuoteAck = 'ACK_RFQ_QUOTE',\n QuoteCancelAck = 'ACK_RFQ_QUOTE_CANCEL',\n ConfirmationRequest = 'RFQ_CONFIRMATION_REQUEST',\n ConfirmationAck = 'ACK_RFQ_CONFIRMATION_RESPONSE',\n ExecutionUpdate = 'RFQ_EXECUTION_UPDATE',\n Trade = 'RFQ_TRADE',\n Error = 'RFQ_ERROR',\n}\n\nconst RfqAuthResponseMessageSchema = z.object({\n type: z.literal(RfqKnownInboundType.Auth),\n success: z.boolean(),\n address: EvmAddressSchema.optional(),\n role: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport type RfqAuthResponseMessage = z.infer<\n typeof RfqAuthResponseMessageSchema\n>;\n\nconst RfqQuoteRequestSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.QuoteRequest),\n rfq_id: RfqIdSchema,\n requestor_public_id: RfqRequestorPublicIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n requested_size: RfqRequestedSizeSchema,\n submission_deadline: EpochMillisecondsSchema,\n })\n .transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n legPositionIds: message.leg_position_ids,\n noPositionId: message.no_position_id,\n requestorPublicId: message.requestor_public_id,\n requestedSize: message.requested_size,\n rfqId: message.rfq_id,\n side: message.side,\n submissionDeadline: message.submission_deadline,\n type: 'quote_request' as const,\n yesPositionId: message.yes_position_id,\n }));\n\nexport type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;\n\nexport type RfqQuoteMessage = {\n type: 'RFQ_QUOTE';\n rfq_id: RfqId;\n price_e6: string;\n size_e6: string;\n signed_order: RfqSignedOrder;\n};\n\nexport type RfqQuoteCancelMessage = {\n type: 'RFQ_QUOTE_CANCEL';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n};\n\nconst RfqQuoteAckSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.QuoteAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n })\n .transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_ack' as const,\n }));\n\nexport type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;\n\nconst RfqQuoteCancelAckSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.QuoteCancelAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n })\n .transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_cancel_ack' as const,\n }));\n\nexport type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;\n\nconst RfqConfirmationRequestSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.ConfirmationRequest),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n signer_address: EvmAddressSchema,\n maker_address: EvmAddressSchema,\n signature_type: SignatureTypeSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n fill_size_e6: E6BigIntStringToDecimalStringSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n confirm_by: EpochMillisecondsSchema,\n })\n .transform((message) => ({\n conditionId: message.condition_id,\n confirmBy: message.confirm_by,\n direction: message.direction,\n fillSize: message.fill_size_e6,\n legPositionIds: message.leg_position_ids,\n makerAddress: message.maker_address,\n noPositionId: message.no_position_id,\n price: message.price_e6,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n side: message.side,\n signatureType: message.signature_type,\n signerAddress: message.signer_address,\n type: 'confirmation_request' as const,\n yesPositionId: message.yes_position_id,\n }));\n\nexport type RfqConfirmationRequest = z.infer<\n typeof RfqConfirmationRequestSchema\n>;\n\nexport type RfqConfirmationResponseMessage = {\n type: 'RFQ_CONFIRMATION_RESPONSE';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n decision: RfqConfirmationDecision;\n};\n\nconst RfqConfirmationAckSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.ConfirmationAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n decision: RfqConfirmationDecisionSchema,\n })\n .transform((message) => ({\n decision: message.decision,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'confirmation_ack' as const,\n }));\n\nexport type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;\n\nconst RfqExecutionUpdateSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.ExecutionUpdate),\n rfq_id: RfqIdSchema,\n status: RfqExecutionStatusSchema,\n tx_hash: TxHashSchema.optional(),\n })\n .transform((message) => ({\n rfqId: message.rfq_id,\n status: message.status,\n ...(message.tx_hash === undefined ? {} : { txHash: message.tx_hash }),\n type: 'execution_update' as const,\n }));\n\nexport type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;\n\nconst RfqTradeSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.Trade),\n rfq_id: RfqIdSchema,\n requester_id: RfqRequestorPublicIdSchema,\n condition_id: ComboConditionIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n size_e6: E6BigIntStringToDecimalStringSchema,\n executed_at: EpochMillisecondsSchema,\n })\n .transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n executedAt: message.executed_at,\n legPositionIds: message.leg_position_ids,\n price: message.price_e6,\n requesterId: message.requester_id,\n rfqId: message.rfq_id,\n side: message.side,\n size: message.size_e6,\n type: 'trade' as const,\n }));\n\nexport type RfqTrade = z.infer<typeof RfqTradeSchema>;\n\nconst RfqErrorMessageSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.Error),\n error_id: z.string().optional(),\n request_type: z.string().optional(),\n rfq_id: RfqIdSchema.optional(),\n quote_id: RfqQuoteIdSchema.optional(),\n code: RfqErrorCodeSchema,\n error: z.string(),\n request: z.unknown().optional(),\n })\n .transform((message) => ({\n code: message.code,\n errorId: message.error_id,\n message: message.error,\n quoteId: message.quote_id,\n requestType: message.request_type,\n rfqId: message.rfq_id,\n type: 'rfq_error' as const,\n }));\n\nexport type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;\n\nexport const RfqQuoterInboundMessageSchema = z.discriminatedUnion('type', [\n RfqAuthResponseMessageSchema,\n RfqQuoteRequestSchema,\n RfqQuoteAckSchema,\n RfqQuoteCancelAckSchema,\n RfqConfirmationRequestSchema,\n RfqConfirmationAckSchema,\n RfqExecutionUpdateSchema,\n RfqTradeSchema,\n RfqErrorMessageSchema,\n]);\n\nexport type RfqQuoterInboundMessage = z.infer<\n typeof RfqQuoterInboundMessageSchema\n>;\n\nexport type RfqQuoterOutboundMessage =\n | RfqQuoteMessage\n | RfqQuoteCancelMessage\n | RfqConfirmationResponseMessage;\n","import { z } from 'zod';\nimport type { SignatureType } from '../clob/signature-type';\nimport type {\n BaseUnits,\n BuilderCode,\n ComboConditionId,\n DecimalString,\n EpochMilliseconds,\n EvmAddress,\n PositionId,\n RfqId,\n RfqQuoteId,\n TxHash,\n} from '../shared';\nimport {\n BuilderCodeSchema,\n ComboConditionIdSchema,\n E6BigIntStringToDecimalStringSchema,\n EpochMillisecondsSchema,\n PositionIdSchema,\n RfqIdSchema,\n RfqQuoteIdSchema,\n TxHashSchema,\n toBaseUnits,\n} from '../shared';\nimport {\n RfqDirection,\n type RfqErrorCode,\n RfqExecutionStatus,\n RfqRequestedSizeUnit,\n RfqSide,\n type RfqSignedOrder,\n} from './rfq';\n\n/** Lifecycle status of an RFQ. */\nexport enum RfqStatus {\n AwaitingRequesterAcceptance = 'AWAITING_REQUESTER_ACCEPTANCE',\n AwaitingMakerConfirmation = 'AWAITING_MAKER_CONFIRMATION',\n Executing = 'EXECUTING',\n Filled = 'FILLED',\n Failed = 'FAILED',\n Expired = 'EXPIRED',\n Canceled = 'CANCELED',\n}\n\n/**\n * Machine-readable reason an RFQ request or acceptance was rejected.\n *\n * @remarks\n * Codes not enumerated in this SDK release are classified as\n * {@link RfqRejectionCode.RequestFailed} with the original error preserved on\n * `cause`.\n */\nexport enum RfqRejectionCode {\n /** The request body could not be decoded as JSON. */\n InvalidJson = 'INVALID_JSON',\n /** The request message is malformed. */\n InvalidMessage = 'INVALID_MESSAGE',\n /** The authenticated role is not valid for this request. */\n InvalidRole = 'INVALID_ROLE',\n /** The authenticated role is not authorized for this request. */\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n /** Authentication credentials are missing or invalid. */\n Unauthenticated = 'UNAUTHENTICATED',\n /** The authenticated address does not match the request. */\n AddressMismatch = 'ADDRESS_MISMATCH',\n /** The request is malformed or references invalid legs. */\n InvalidRfq = 'INVALID_RFQ',\n /** The legs are mutually exclusive (e.g. YES and NO on the same market). */\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n /** Leg metadata is temporarily unavailable; the request may be retried. */\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n /** The acceptance is invalid (unknown RFQ, wrong state, quote/builder mismatch). */\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n /** The referenced quote is invalid or no longer available. */\n InvalidQuote = 'INVALID_QUOTE',\n /** The order signature failed verification. */\n InvalidSignature = 'INVALID_SIGNATURE',\n /** The request identity is invalid. */\n InvalidIdentity = 'INVALID_IDENTITY',\n /** The RFQ does not exist for the authenticated requester. */\n UnknownRfq = 'UNKNOWN_RFQ',\n /** The RFQ acceptance window has expired. */\n ExpiredRfq = 'EXPIRED_RFQ',\n /** The RFQ is not in a state that permits this operation. */\n InvalidRfqState = 'INVALID_RFQ_STATE',\n /** The quote does not match the RFQ being accepted. */\n QuoteMismatch = 'QUOTE_MISMATCH',\n /** The submission window is closed. */\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n /** A required service is temporarily unavailable. */\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n /** Balance reservation failed before execution. */\n PreExecutionBalanceReservationFailed = 'PRE_EXECUTION_BALANCE_RESERVATION_FAILED',\n /** The requester does not have sufficient balance. */\n BalanceValidationFailed = 'BALANCE_VALIDATION_FAILED',\n /** The requester does not have sufficient allowance. */\n AllowanceValidationFailed = 'ALLOWANCE_VALIDATION_FAILED',\n /** The accepted trade could not be submitted for execution. */\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n /** The request failed without a more specific classification. */\n RequestFailed = 'REQUEST_FAILED',\n}\n\n/** Reason no quote was returned for a combo quote request. */\nexport enum ComboQuoteUnavailableReason {\n NoQuotes = 'NO_QUOTES',\n SizeTooLarge = 'SIZE_TOO_LARGE',\n}\n\n/** Reason an accepted combo quote did not proceed to a fill. */\nexport enum ComboAcceptFailureReason {\n MakerDeclined = 'MAKER_DECLINED',\n AcceptanceWindowExpired = 'ACCEPTANCE_WINDOW_EXPIRED',\n /** The trade failed before or during onchain execution handoff. */\n ExecutionFailed = 'EXECUTION_FAILED',\n}\n\nexport type BuilderRfqRequestedSize = {\n unit: RfqRequestedSizeUnit;\n value_e6: string;\n};\n\nexport type BuilderRfqCreateRequest = {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n leg_position_ids: string[];\n direction: RfqDirection;\n side: RfqSide;\n requested_size: BuilderRfqRequestedSize;\n};\n\nexport type BuilderRfqAcceptRequest = {\n quote_id: string;\n signed_order: RfqSignedOrder;\n};\n\n/** Structured error carried inside combo RFQ responses. */\nexport type BuilderRfqError = {\n code: RfqErrorCode;\n message: string;\n};\n\n// Error codes evolve independently of released clients. Codes not yet\n// enumerated in RfqKnownErrorCode must still parse and flow through as-is.\nconst BuilderRfqErrorSchema = z\n .object({\n code: z.string().transform((value): RfqErrorCode => value),\n message: z.string(),\n })\n .transform(\n (error): BuilderRfqError => ({\n code: error.code,\n message: error.message,\n }),\n );\n\n/** The winning quote for an RFQ. */\nexport type BuilderRfqQuote = {\n quoteId: RfqQuoteId;\n /** Blended price across legs, in collateral per outcome token. */\n blendedPrice: DecimalString;\n /** Signed-order collateral for BUY, or position shares for SELL. */\n makerAmount: DecimalString;\n /** Signed-order shares for BUY, or gross collateral limit for SELL. */\n takerAmount: DecimalString;\n /** Total collateral (BUY) or position-share (SELL) balance required to accept. */\n totalRequired: DecimalString;\n /** Exact collateral proceeds after fees. Present only for SELL quotes. */\n netReceive?: DecimalString;\n};\n\nconst BuilderRfqQuoteSchema = z\n .object({\n quote_id: RfqQuoteIdSchema,\n blended_price_e6: E6BigIntStringToDecimalStringSchema,\n maker_amount_e6: E6BigIntStringToDecimalStringSchema,\n taker_amount_e6: E6BigIntStringToDecimalStringSchema,\n total_required_e6: E6BigIntStringToDecimalStringSchema,\n net_receive_e6: E6BigIntStringToDecimalStringSchema.optional(),\n })\n .transform(\n (quote): BuilderRfqQuote => ({\n blendedPrice: quote.blended_price_e6,\n makerAmount: quote.maker_amount_e6,\n quoteId: quote.quote_id,\n takerAmount: quote.taker_amount_e6,\n totalRequired: quote.total_required_e6,\n ...(quote.net_receive_e6 === undefined\n ? {}\n : { netReceive: quote.net_receive_e6 }),\n }),\n );\n\nexport type BuilderRfqResponseRequestedSize = {\n unit: RfqRequestedSizeUnit;\n valueE6: BaseUnits;\n};\n\nconst BuilderRfqResponseRequestedSizeSchema = z\n .object({\n unit: z.enum(RfqRequestedSizeUnit),\n value_e6: z\n .string()\n .regex(/^\\d+$/)\n .transform((value) => toBaseUnits(BigInt(value).toString())),\n })\n .transform(\n (size): BuilderRfqResponseRequestedSize => ({\n unit: size.unit,\n valueE6: size.value_e6,\n }),\n );\n\n/** Original request echoed by a quote-ready builder RFQ response. */\nexport type BuilderRfqResponseRequest = {\n rfqId: RfqId;\n legPositionIds: PositionId[];\n conditionId: ComboConditionId;\n yesPositionId: PositionId;\n noPositionId: PositionId;\n direction: RfqDirection;\n side: RfqSide;\n requestedSize: BuilderRfqResponseRequestedSize;\n};\n\nconst BuilderRfqResponseRequestSchema = z\n .object({\n rfq_id: RfqIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: z.enum(RfqDirection),\n side: z.enum(RfqSide),\n requested_size: BuilderRfqResponseRequestedSizeSchema,\n })\n .transform(\n (request): BuilderRfqResponseRequest => ({\n conditionId: request.condition_id,\n direction: request.direction,\n legPositionIds: request.leg_position_ids,\n noPositionId: request.no_position_id,\n requestedSize: request.requested_size,\n rfqId: request.rfq_id,\n side: request.side,\n yesPositionId: request.yes_position_id,\n }),\n );\n\nexport type BuilderRfqQuoteReadyResponse = {\n rfqId: RfqId;\n status: RfqStatus.AwaitingRequesterAcceptance;\n /** Acceptance deadline (Unix ms). */\n expiresAt: EpochMilliseconds;\n builderCode: BuilderCode;\n request: BuilderRfqResponseRequest;\n quote: BuilderRfqQuote;\n};\n\nconst BuilderRfqQuoteReadyResponseSchema = z\n .object({\n rfq_id: RfqIdSchema,\n status: z.literal(RfqStatus.AwaitingRequesterAcceptance),\n expires_at: EpochMillisecondsSchema,\n builder_code: BuilderCodeSchema,\n request: BuilderRfqResponseRequestSchema,\n quote: BuilderRfqQuoteSchema,\n })\n .transform(\n (response): BuilderRfqQuoteReadyResponse => ({\n builderCode: response.builder_code,\n expiresAt: response.expires_at,\n quote: response.quote,\n request: response.request,\n rfqId: response.rfq_id,\n status: response.status,\n }),\n );\n\nexport type BuilderRfqFinalStateResponse = {\n rfqId: RfqId;\n status: RfqStatus.Failed | RfqStatus.Expired | RfqStatus.Canceled;\n error?: BuilderRfqError;\n};\n\nconst BuilderRfqFinalStateResponseSchema = z\n .object({\n rfq_id: RfqIdSchema,\n status: z.enum([RfqStatus.Failed, RfqStatus.Expired, RfqStatus.Canceled]),\n error: BuilderRfqErrorSchema.optional(),\n })\n .transform(\n (response): BuilderRfqFinalStateResponse => ({\n rfqId: response.rfq_id,\n status: response.status,\n ...(response.error === undefined ? {} : { error: response.error }),\n }),\n );\n\nexport const BuilderRfqCreateResponseSchema = z.union([\n BuilderRfqQuoteReadyResponseSchema,\n BuilderRfqFinalStateResponseSchema,\n]);\n\nexport type BuilderRfqCreateResponse =\n | BuilderRfqQuoteReadyResponse\n | BuilderRfqFinalStateResponse;\n\n/**\n * Status projection returned on accept responses and post-acceptance status\n * reads.\n *\n * @remarks\n * Onchain execution progress is merged into the top-level `status`:\n * {@link RfqExecutionStatus} values surface alongside the RFQ lifecycle\n * (`MATCHED` is reported as {@link RfqStatus.Executing}).\n */\nexport type BuilderRfqStatusResponse = {\n rfqId: RfqId;\n status: RfqStatus | RfqExecutionStatus;\n takerOrderHash?: string;\n txHash?: TxHash;\n error?: BuilderRfqError;\n};\n\nexport const BuilderRfqStatusResponseSchema = z\n .object({\n rfq_id: RfqIdSchema,\n status: z.union([z.enum(RfqStatus), z.enum(RfqExecutionStatus)]),\n taker_order_hash: z.string().optional(),\n tx_hash: TxHashSchema.optional(),\n error: BuilderRfqErrorSchema.optional(),\n })\n .transform(\n (response): BuilderRfqStatusResponse => ({\n rfqId: response.rfq_id,\n status: response.status,\n ...(response.taker_order_hash === undefined\n ? {}\n : { takerOrderHash: response.taker_order_hash }),\n ...(response.tx_hash === undefined ? {} : { txHash: response.tx_hash }),\n ...(response.error === undefined ? {} : { error: response.error }),\n }),\n );\n","import { expectHexString, type HexString } from '@polymarket/types';\nimport { z } from 'zod';\nimport type {\n ComboConditionId,\n DecimalString,\n EventId,\n EvmAddress,\n PositionId,\n} from '../shared';\nimport {\n ComboConditionIdSchema,\n DecimalStringSchema,\n E6BigIntStringToDecimalStringSchema,\n EventIdSchema,\n EvmAddressSchema,\n PositionIdSchema,\n} from '../shared';\n\nconst HexStringSchema = z.string().transform((value) => expectHexString(value));\n\n/**\n * Known collateral-return plan operation kinds.\n *\n * The service evolves this set independently of released clients, so plan\n * parsing accepts unknown kinds as plain strings; see\n * {@link CollateralReturnOperationKind}.\n */\nexport enum CollateralReturnKnownOperationKind {\n Split = 'split',\n Merge = 'merge',\n Redeem = 'redeem',\n SplitOnCondition = 'split_on_condition',\n MergeOnCondition = 'merge_on_condition',\n SplitOnEvent = 'split_on_event',\n MergeOnEvent = 'merge_on_event',\n ConvertOnEvent = 'convert_on_event',\n Extract = 'extract',\n Inject = 'inject',\n ConvertToYesBasket = 'convert_to_yes_basket',\n MergeFromYesBasket = 'merge_from_yes_basket',\n Compress = 'compress',\n}\n\n/**\n * A collateral-return operation kind. Known kinds are enumerated in\n * {@link CollateralReturnKnownOperationKind}; newly introduced kinds flow\n * through as plain strings so plans keep parsing before a client release that\n * enumerates them.\n */\nexport type CollateralReturnOperationKind =\n | CollateralReturnKnownOperationKind\n | (string & {});\n\nconst CollateralReturnOperationKindSchema = z\n .string()\n .transform((value): CollateralReturnOperationKind => value);\n\nexport type CollateralReturnOperation = {\n kind: CollateralReturnOperationKind;\n conditionId?: ComboConditionId;\n eventId?: EventId;\n positionId?: PositionId;\n conditionIndex: number;\n amount: DecimalString;\n};\n\nconst CollateralReturnOperationSchema = z\n .object({\n kind: CollateralReturnOperationKindSchema,\n condition_id: ComboConditionIdSchema.optional(),\n event_id: EventIdSchema.optional(),\n position_id: PositionIdSchema.optional(),\n // The wire format omits zero values, so an absent index means 0.\n condition_index: z.number().int().nonnegative().optional().default(0),\n amount: E6BigIntStringToDecimalStringSchema,\n })\n .transform(\n (operation): CollateralReturnOperation => ({\n amount: operation.amount,\n conditionId: operation.condition_id,\n conditionIndex: operation.condition_index,\n eventId: operation.event_id,\n kind: operation.kind,\n positionId: operation.position_id,\n }),\n );\n\nexport type CollateralReturnPositionAmount = {\n positionId: PositionId;\n amount: DecimalString;\n};\n\nconst CollateralReturnPositionAmountSchema = z\n .object({\n position_id: PositionIdSchema,\n amount: E6BigIntStringToDecimalStringSchema,\n })\n .transform(\n (position): CollateralReturnPositionAmount => ({\n amount: position.amount,\n positionId: position.position_id,\n }),\n );\n\nexport type CollateralReturnPositionSummary = {\n consumed: CollateralReturnPositionAmount[];\n created: CollateralReturnPositionAmount[];\n};\n\nconst CollateralReturnPositionSummarySchema = z\n .object({\n consumed: z.array(CollateralReturnPositionAmountSchema),\n created: z.array(CollateralReturnPositionAmountSchema),\n })\n .transform(\n (summary): CollateralReturnPositionSummary => ({\n consumed: summary.consumed,\n created: summary.created,\n }),\n );\n\nexport type CollateralReturnRouterCall = {\n to: EvmAddress;\n data: HexString;\n};\n\nconst CollateralReturnRouterCallSchema = z\n .object({\n to: EvmAddressSchema,\n data: HexStringSchema,\n })\n .transform(\n (call): CollateralReturnRouterCall => ({\n data: call.data,\n to: call.to,\n }),\n );\n\n/**\n * The plan fields execution consumes: the plan identifier round-tripped to\n * the service, the chain and wallet the plan was computed for, and the exact\n * Router call the execution signs and submits.\n */\nexport const CollateralReturnPlanSchema = z.looseObject({\n planHash: HexStringSchema,\n chainId: z.number().int(),\n wallet: EvmAddressSchema,\n routerCall: CollateralReturnRouterCallSchema,\n});\n\nexport type CollateralReturnPlanResponse = {\n planHash: HexString;\n chainId: number;\n wallet: EvmAddress;\n blockNumber: bigint;\n startingPusd: DecimalString;\n netPusdOut: DecimalString;\n finalPusd: DecimalString;\n operations: CollateralReturnOperation[];\n operationCount: number;\n truncated: boolean;\n estimatedCost: number;\n requiredPusdInput: DecimalString;\n requiredPositions: CollateralReturnPositionAmount[];\n positionSummary: CollateralReturnPositionSummary;\n candidatePositionIds: PositionId[];\n routerCall: CollateralReturnRouterCall;\n};\n\nexport const CollateralReturnPlanResponseSchema = z\n .object({\n plan_hash: HexStringSchema,\n chain_id: z.number().int(),\n wallet: EvmAddressSchema,\n block_number: z.string().regex(/^\\d+$/).transform(BigInt),\n starting_pusd: DecimalStringSchema,\n net_pusd_out: DecimalStringSchema,\n final_pusd: DecimalStringSchema,\n operations: z.array(CollateralReturnOperationSchema),\n operation_count: z.number().int(),\n truncated: z.boolean(),\n estimated_cost: z.number(),\n required_pusd_input: DecimalStringSchema,\n required_positions: z.array(CollateralReturnPositionAmountSchema),\n // Tolerate older service builds that predate the summary field.\n position_summary: CollateralReturnPositionSummarySchema.optional(),\n candidate_position_ids: z.array(PositionIdSchema),\n router_call: CollateralReturnRouterCallSchema,\n })\n .transform(\n (response): CollateralReturnPlanResponse => ({\n blockNumber: response.block_number,\n candidatePositionIds: response.candidate_position_ids,\n chainId: response.chain_id,\n estimatedCost: response.estimated_cost,\n finalPusd: response.final_pusd,\n netPusdOut: response.net_pusd_out,\n operationCount: response.operation_count,\n operations: response.operations,\n planHash: response.plan_hash,\n positionSummary: response.position_summary ?? {\n consumed: [],\n created: [],\n },\n requiredPositions: response.required_positions,\n requiredPusdInput: response.required_pusd_input,\n routerCall: response.router_call,\n startingPusd: response.starting_pusd,\n truncated: response.truncated,\n wallet: response.wallet,\n }),\n );\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/combos/rfq.ts","../../src/combos/builder-rfq.ts","../../src/combos/plan.ts"],"names":["RfqDirection","RfqSide","RfqConfirmationDecision","RfqExecutionStatus","RfqRequestedSizeUnit","RfqKnownErrorCode","RfqDirectionSchema","z","RfqSideSchema","RfqConfirmationDecisionSchema","RfqExecutionStatusSchema","RfqErrorCodeSchema","value","ComboMarketSchema","MarketIdSchema","ConditionIdSchema","PositionIdSchema","DecimalStringSchema","market","context","ListComboMarketsResponseSchema","PaginationCursorSchema","response","RfqRequestedSizeSchema","E6BigIntStringToDecimalStringSchema","size","RfqKnownInboundType","RfqAuthResponseMessageSchema","EvmAddressSchema","RfqQuoteRequestSchema","RfqIdSchema","RfqRequestorPublicIdSchema","ComboConditionIdSchema","EpochMillisecondsSchema","message","RfqQuoteAckSchema","RfqQuoteIdSchema","RfqQuoteCancelAckSchema","RfqConfirmationRequestSchema","SignatureTypeSchema","RfqConfirmationAckSchema","RfqExecutionUpdateSchema","TxHashSchema","RfqTradeSchema","RfqErrorMessageSchema","RfqQuoterInboundMessageSchema","RfqStatus","RfqRejectionCode","ComboQuoteUnavailableReason","ComboAcceptFailureReason","BuilderRfqErrorSchema","error","BuilderRfqQuoteSchema","quote","BuilderRfqResponseRequestedSizeSchema","toBaseUnits","BuilderRfqResponseRequestSchema","request","BuilderRfqQuoteReadyResponseSchema","BuilderCodeSchema","BuilderRfqFinalStateResponseSchema","BuilderRfqCreateResponseSchema","BuilderRfqStatusResponseSchema","HexStringSchema","expectHexString","CollateralReturnKnownOperationKind","CollateralReturnOperationKindSchema","CollateralReturnOperationSchema","EventIdSchema","operation","CollateralReturnPositionAmountSchema","position","CollateralReturnPositionSummarySchema","summary","CollateralReturnRouterCallSchema","call","CollateralReturnPlanSchema","CollateralReturnPlanResponseSchema"],"mappings":"8MA4CO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,EAAA,IAAA,CAAO,MAAA,CAFGA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,IAAM,KAAA,CACNA,CAAAA,CAAA,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,kBAAoB,CAC5C,QAAA,CAAU,EAAC,CACX,OAAA,CAAS,EACX,CAAA,CACA,iBAAA,CAAmBA,CAAAA,CAAS,kBAAA,CAC5B,iBAAA,CAAmBA,CAAAA,CAAS,oBAC5B,UAAA,CAAYA,CAAAA,CAAS,WAAA,CACrB,YAAA,CAAcA,CAAAA,CAAS,aAAA,CACvB,SAAA,CAAWA,CAAAA,CAAS,SAAA,CACpB,MAAA,CAAQA,CAAAA,CAAS,MACnB,CAAA,CACF","file":"index.js","sourcesContent":["import type {\n Erc1271Signature,\n EvmSignature,\n HexString,\n} from '@polymarket/types';\nimport { z } from 'zod';\nimport {\n type SignatureType,\n SignatureTypeSchema,\n} from '../clob/signature-type';\nimport type {\n BaseUnits,\n ConditionId,\n DecimalString,\n EvmAddress,\n MarketId,\n TokenId,\n} from '../shared';\nimport {\n ComboConditionIdSchema,\n ConditionIdSchema,\n DecimalStringSchema,\n E6BigIntStringToDecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n MarketIdSchema,\n type OrderSide,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\n type RfqId,\n RfqIdSchema,\n type RfqQuoteId,\n RfqQuoteIdSchema,\n RfqRequestorPublicIdSchema,\n TxHashSchema,\n} from '../shared';\n\nexport type {\n RfqId,\n RfqQuoteId,\n RfqRequestorPublicId,\n} from '../shared';\n\nexport enum RfqDirection {\n Buy = 'BUY',\n Sell = 'SELL',\n}\n\nexport enum RfqSide {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport enum RfqConfirmationDecision {\n Confirm = 'CONFIRM',\n Decline = 'DECLINE',\n}\n\nexport enum RfqExecutionStatus {\n Matched = 'MATCHED',\n Mined = 'MINED',\n Confirmed = 'CONFIRMED',\n Retrying = 'RETRYING',\n Failed = 'FAILED',\n}\n\nexport enum RfqRequestedSizeUnit {\n Notional = 'notional',\n Shares = 'shares',\n}\n\nexport enum RfqKnownErrorCode {\n AddressMismatch = 'ADDRESS_MISMATCH',\n AllowanceValidationFailed = 'ALLOWANCE_VALIDATION_FAILED',\n BalanceValidationFailed = 'BALANCE_VALIDATION_FAILED',\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n ExpiredRfq = 'EXPIRED_RFQ',\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n InvalidConfirmation = 'INVALID_CONFIRMATION',\n InvalidExecutionResult = 'INVALID_EXECUTION_RESULT',\n InvalidIdentity = 'INVALID_IDENTITY',\n InvalidMessage = 'INVALID_MESSAGE',\n InvalidOrderSide = 'INVALID_ORDER_SIDE',\n InvalidQuote = 'INVALID_QUOTE',\n InvalidRfq = 'INVALID_RFQ',\n InvalidRfqState = 'INVALID_RFQ_STATE',\n InvalidRole = 'INVALID_ROLE',\n InvalidSignature = 'INVALID_SIGNATURE',\n InvalidSignatureType = 'INVALID_SIGNATURE_TYPE',\n InternalError = 'INTERNAL_ERROR',\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n MakerAlreadyResponded = 'MAKER_ALREADY_RESPONDED',\n MakerDeclined = 'MAKER_DECLINED',\n MakerNotRequired = 'MAKER_NOT_REQUIRED',\n MakerQuoteLimited = 'MAKER_QUOTE_LIMITED',\n MissingMakerAddressInQuote = 'MISSING_MAKER_ADDRESS_IN_QUOTE',\n MissingMakerAmountInSignedOrder = 'MISSING_MAKER_AMOUNT_IN_SIGNED_ORDER',\n MissingMakerInSignedOrder = 'MISSING_MAKER_IN_SIGNED_ORDER',\n MissingQuoteId = 'MISSING_QUOTE_ID',\n MissingRfqId = 'MISSING_RFQ_ID',\n MissingSaltInSignedOrder = 'MISSING_SALT_IN_SIGNED_ORDER',\n MissingSignatureInSignedOrder = 'MISSING_SIGNATURE_IN_SIGNED_ORDER',\n MissingSignerAddressInQuote = 'MISSING_SIGNER_ADDRESS_IN_QUOTE',\n MissingSignerInSignedOrder = 'MISSING_SIGNER_IN_SIGNED_ORDER',\n MissingTakerAmountInSignedOrder = 'MISSING_TAKER_AMOUNT_IN_SIGNED_ORDER',\n MissingTimestampInSignedOrder = 'MISSING_TIMESTAMP_IN_SIGNED_ORDER',\n MissingTokenIdInSignedOrder = 'MISSING_TOKEN_ID_IN_SIGNED_ORDER',\n NoQuotes = 'NO_QUOTES',\n OrderSideOrTokenDoesNotMatchRequest = 'ORDER_SIDE_OR_TOKEN_DOES_NOT_MATCH_REQUEST',\n PreExecutionBalanceReservationFailed = 'PRE_EXECUTION_BALANCE_RESERVATION_FAILED',\n PriceE6NotPositive = 'PRICE_E6_NOT_POSITIVE',\n QuoteMismatch = 'QUOTE_MISMATCH',\n QuoteUnavailable = 'QUOTE_UNAVAILABLE',\n QuotedPriceAboveSafetyThreshold = 'QUOTED_PRICE_ABOVE_SAFETY_THRESHOLD',\n QuotedPriceOutOfRange = 'QUOTED_PRICE_OUT_OF_RANGE',\n RateLimited = 'RATE_LIMITED',\n RequestFailed = 'REQUEST_FAILED',\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n SignedOrderMakerAmountNotPositive = 'SIGNED_ORDER_MAKER_AMOUNT_NOT_POSITIVE',\n SignedOrderMakerDoesNotMatchAuth = 'SIGNED_ORDER_MAKER_DOES_NOT_MATCH_AUTH',\n SignedOrderPriceWorseThanQuote = 'SIGNED_ORDER_PRICE_WORSE_THAN_QUOTE',\n SignedOrderSignatureTypeDoesNotMatchAuth = 'SIGNED_ORDER_SIGNATURE_TYPE_DOES_NOT_MATCH_AUTH',\n SignedOrderSignerDoesNotMatchAuth = 'SIGNED_ORDER_SIGNER_DOES_NOT_MATCH_AUTH',\n SignedOrderSizeDoesNotCoverQuote = 'SIGNED_ORDER_SIZE_DOES_NOT_COVER_QUOTE',\n SignedOrderTakerAmountNotPositive = 'SIGNED_ORDER_TAKER_AMOUNT_NOT_POSITIVE',\n SizeE6NotPositive = 'SIZE_E6_NOT_POSITIVE',\n SizeTooLarge = 'SIZE_TOO_LARGE',\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n Unauthenticated = 'UNAUTHENTICATED',\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n UnknownRfq = 'UNKNOWN_RFQ',\n}\n\n/**\n * An RFQ error code. Known codes are enumerated in {@link RfqKnownErrorCode};\n * newly introduced codes flow through as plain strings so they can be handled\n * before a client release that enumerates them.\n */\nexport type RfqErrorCode = RfqKnownErrorCode | (string & {});\n\nconst RfqDirectionSchema = z.enum(RfqDirection);\nconst RfqSideSchema = z.literal(RfqSide.Yes);\nconst RfqConfirmationDecisionSchema = z.enum(RfqConfirmationDecision);\nconst RfqExecutionStatusSchema = z.enum(RfqExecutionStatus);\n\n// Error codes evolve independently of released clients. Codes not yet\n// enumerated in RfqKnownErrorCode must still parse and flow through as-is.\nconst RfqErrorCodeSchema = z.string().transform((value): RfqErrorCode => value);\n\nexport type ComboMarket = {\n id: MarketId;\n conditionId: ConditionId;\n slug: string;\n title: string;\n outcomes: ComboMarketOutcomes;\n image: string;\n volume: number;\n tags: string[];\n};\n\nexport type ComboMarketOutcome = {\n label: string;\n positionId: PositionId;\n price: DecimalString;\n};\n\nexport type ComboMarketOutcomes = {\n yes: ComboMarketOutcome;\n no: ComboMarketOutcome;\n};\n\nconst ComboMarketSchema = z\n .object({\n id: MarketIdSchema,\n condition_id: ConditionIdSchema,\n position_ids: z.array(PositionIdSchema),\n slug: z.string(),\n title: z.string(),\n outcomes: z.array(z.string()),\n outcome_prices: z.array(DecimalStringSchema),\n image: z.string(),\n volume: z.number(),\n tags: z.array(z.string()),\n })\n .superRefine((market, context) => {\n if (market.outcomes.length !== 2) {\n context.addIssue({\n code: 'custom',\n message: `Expected binary combo market outcomes, received ${market.outcomes.length}.`,\n path: ['outcomes'],\n });\n }\n\n if (market.position_ids.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message: 'Expected position_ids and outcomes to have matching lengths.',\n path: ['position_ids'],\n });\n }\n\n if (market.outcome_prices.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message:\n 'Expected outcome_prices and outcomes to have matching lengths.',\n path: ['outcome_prices'],\n });\n }\n })\n .transform(\n (market): ComboMarket => ({\n conditionId: market.condition_id,\n id: market.id,\n image: market.image,\n outcomes: {\n yes: {\n label: market.outcomes[0] as string,\n positionId: market.position_ids[0] as PositionId,\n price: market.outcome_prices[0] as DecimalString,\n },\n no: {\n label: market.outcomes[1] as string,\n positionId: market.position_ids[1] as PositionId,\n price: market.outcome_prices[1] as DecimalString,\n },\n },\n slug: market.slug,\n tags: market.tags,\n title: market.title,\n volume: market.volume,\n }),\n );\n\nexport const ListComboMarketsResponseSchema = z\n .object({\n markets: z.array(ComboMarketSchema),\n next_cursor: PaginationCursorSchema.nullish(),\n })\n .transform((response) => ({\n markets: response.markets,\n nextCursor: response.next_cursor ?? undefined,\n }));\n\nexport type ListComboMarketsResponse = z.infer<\n typeof ListComboMarketsResponseSchema\n>;\n\nexport type RfqRequestedSize =\n | {\n unit: RfqRequestedSizeUnit.Notional;\n value: DecimalString;\n }\n | {\n unit: RfqRequestedSizeUnit.Shares;\n value: DecimalString;\n };\n\nconst RfqRequestedSizeSchema = z\n .discriminatedUnion('unit', [\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Notional),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Shares),\n value_e6: E6BigIntStringToDecimalStringSchema,\n }),\n ])\n .transform(\n (size): RfqRequestedSize => ({\n unit: size.unit,\n value: size.value_e6,\n }),\n ) satisfies z.ZodType<RfqRequestedSize>;\n\nexport type RfqSignedOrder = {\n salt: string;\n maker: EvmAddress;\n signer: EvmAddress;\n tokenId: PositionId | TokenId;\n makerAmount: BaseUnits;\n takerAmount: BaseUnits;\n side: RfqOrderSide;\n signatureType: SignatureType;\n timestamp: string;\n builder?: HexString;\n expiration?: string;\n metadata?: HexString;\n signature: EvmSignature | Erc1271Signature;\n};\n\nexport type RfqOrderSide = OrderSide | 0 | 1;\n\nexport type RfqAuthMessage = {\n type: 'auth';\n auth: {\n apiKey: string;\n passphrase: string;\n secret: string;\n };\n identity: {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n };\n};\n\nexport enum RfqKnownInboundType {\n Auth = 'auth',\n QuoteRequest = 'RFQ_REQUEST',\n QuoteAck = 'ACK_RFQ_QUOTE',\n QuoteCancelAck = 'ACK_RFQ_QUOTE_CANCEL',\n ConfirmationRequest = 'RFQ_CONFIRMATION_REQUEST',\n ConfirmationAck = 'ACK_RFQ_CONFIRMATION_RESPONSE',\n ExecutionUpdate = 'RFQ_EXECUTION_UPDATE',\n Trade = 'RFQ_TRADE',\n Error = 'RFQ_ERROR',\n}\n\nconst RfqAuthResponseMessageSchema = z.object({\n type: z.literal(RfqKnownInboundType.Auth),\n success: z.boolean(),\n address: EvmAddressSchema.optional(),\n role: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport type RfqAuthResponseMessage = z.infer<\n typeof RfqAuthResponseMessageSchema\n>;\n\nconst RfqQuoteRequestSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.QuoteRequest),\n rfq_id: RfqIdSchema,\n requestor_public_id: RfqRequestorPublicIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n requested_size: RfqRequestedSizeSchema,\n submission_deadline: EpochMillisecondsSchema,\n })\n .transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n legPositionIds: message.leg_position_ids,\n noPositionId: message.no_position_id,\n requestorPublicId: message.requestor_public_id,\n requestedSize: message.requested_size,\n rfqId: message.rfq_id,\n side: message.side,\n submissionDeadline: message.submission_deadline,\n type: 'quote_request' as const,\n yesPositionId: message.yes_position_id,\n }));\n\nexport type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;\n\nexport type RfqQuoteMessage = {\n type: 'RFQ_QUOTE';\n rfq_id: RfqId;\n price_e6: string;\n size_e6: string;\n signed_order: RfqSignedOrder;\n};\n\nexport type RfqQuoteCancelMessage = {\n type: 'RFQ_QUOTE_CANCEL';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n};\n\nconst RfqQuoteAckSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.QuoteAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n })\n .transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_ack' as const,\n }));\n\nexport type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;\n\nconst RfqQuoteCancelAckSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.QuoteCancelAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n })\n .transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_cancel_ack' as const,\n }));\n\nexport type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;\n\nconst RfqConfirmationRequestSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.ConfirmationRequest),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n signer_address: EvmAddressSchema,\n maker_address: EvmAddressSchema,\n signature_type: SignatureTypeSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n fill_size_e6: E6BigIntStringToDecimalStringSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n confirm_by: EpochMillisecondsSchema,\n })\n .transform((message) => ({\n conditionId: message.condition_id,\n confirmBy: message.confirm_by,\n direction: message.direction,\n fillSize: message.fill_size_e6,\n legPositionIds: message.leg_position_ids,\n makerAddress: message.maker_address,\n noPositionId: message.no_position_id,\n price: message.price_e6,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n side: message.side,\n signatureType: message.signature_type,\n signerAddress: message.signer_address,\n type: 'confirmation_request' as const,\n yesPositionId: message.yes_position_id,\n }));\n\nexport type RfqConfirmationRequest = z.infer<\n typeof RfqConfirmationRequestSchema\n>;\n\nexport type RfqConfirmationResponseMessage = {\n type: 'RFQ_CONFIRMATION_RESPONSE';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n decision: RfqConfirmationDecision;\n};\n\nconst RfqConfirmationAckSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.ConfirmationAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n decision: RfqConfirmationDecisionSchema,\n })\n .transform((message) => ({\n decision: message.decision,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'confirmation_ack' as const,\n }));\n\nexport type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;\n\nconst RfqExecutionUpdateSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.ExecutionUpdate),\n rfq_id: RfqIdSchema,\n status: RfqExecutionStatusSchema,\n tx_hash: TxHashSchema.optional(),\n })\n .transform((message) => ({\n rfqId: message.rfq_id,\n status: message.status,\n ...(message.tx_hash === undefined ? {} : { txHash: message.tx_hash }),\n type: 'execution_update' as const,\n }));\n\nexport type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;\n\nconst RfqTradeSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.Trade),\n rfq_id: RfqIdSchema,\n requester_id: RfqRequestorPublicIdSchema,\n condition_id: ComboConditionIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n price_e6: E6BigIntStringToDecimalStringSchema,\n size_e6: E6BigIntStringToDecimalStringSchema,\n executed_at: EpochMillisecondsSchema,\n })\n .transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n executedAt: message.executed_at,\n legPositionIds: message.leg_position_ids,\n price: message.price_e6,\n requesterId: message.requester_id,\n rfqId: message.rfq_id,\n side: message.side,\n size: message.size_e6,\n type: 'trade' as const,\n }));\n\nexport type RfqTrade = z.infer<typeof RfqTradeSchema>;\n\nconst RfqErrorMessageSchema = z\n .object({\n type: z.literal(RfqKnownInboundType.Error),\n error_id: z.string().optional(),\n request_type: z.string().optional(),\n rfq_id: RfqIdSchema.optional(),\n quote_id: RfqQuoteIdSchema.optional(),\n code: RfqErrorCodeSchema,\n error: z.string(),\n request: z.unknown().optional(),\n })\n .transform((message) => ({\n code: message.code,\n errorId: message.error_id,\n message: message.error,\n quoteId: message.quote_id,\n requestType: message.request_type,\n rfqId: message.rfq_id,\n type: 'rfq_error' as const,\n }));\n\nexport type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;\n\nexport const RfqQuoterInboundMessageSchema = z.discriminatedUnion('type', [\n RfqAuthResponseMessageSchema,\n RfqQuoteRequestSchema,\n RfqQuoteAckSchema,\n RfqQuoteCancelAckSchema,\n RfqConfirmationRequestSchema,\n RfqConfirmationAckSchema,\n RfqExecutionUpdateSchema,\n RfqTradeSchema,\n RfqErrorMessageSchema,\n]);\n\nexport type RfqQuoterInboundMessage = z.infer<\n typeof RfqQuoterInboundMessageSchema\n>;\n\nexport type RfqQuoterOutboundMessage =\n | RfqQuoteMessage\n | RfqQuoteCancelMessage\n | RfqConfirmationResponseMessage;\n","import { z } from 'zod';\nimport type { SignatureType } from '../clob/signature-type';\nimport type {\n BaseUnits,\n BuilderCode,\n ComboConditionId,\n DecimalString,\n EpochMilliseconds,\n EvmAddress,\n PositionId,\n RfqId,\n RfqQuoteId,\n TxHash,\n} from '../shared';\nimport {\n BuilderCodeSchema,\n ComboConditionIdSchema,\n E6BigIntStringToDecimalStringSchema,\n EpochMillisecondsSchema,\n PositionIdSchema,\n RfqIdSchema,\n RfqQuoteIdSchema,\n TxHashSchema,\n toBaseUnits,\n} from '../shared';\nimport {\n RfqDirection,\n type RfqErrorCode,\n RfqExecutionStatus,\n RfqRequestedSizeUnit,\n RfqSide,\n type RfqSignedOrder,\n} from './rfq';\n\n/** Lifecycle status of an RFQ. */\nexport enum RfqStatus {\n AwaitingRequesterAcceptance = 'AWAITING_REQUESTER_ACCEPTANCE',\n AwaitingMakerConfirmation = 'AWAITING_MAKER_CONFIRMATION',\n Executing = 'EXECUTING',\n Filled = 'FILLED',\n Failed = 'FAILED',\n Expired = 'EXPIRED',\n Canceled = 'CANCELED',\n}\n\n/**\n * Machine-readable reason an RFQ request or acceptance was rejected.\n *\n * @remarks\n * Codes not enumerated in this SDK release are classified as\n * {@link RfqRejectionCode.RequestFailed} with the original error preserved on\n * `cause`.\n */\nexport enum RfqRejectionCode {\n /** The request body could not be decoded as JSON. */\n InvalidJson = 'INVALID_JSON',\n /** The request message is malformed. */\n InvalidMessage = 'INVALID_MESSAGE',\n /** The authenticated role is not valid for this request. */\n InvalidRole = 'INVALID_ROLE',\n /** The authenticated role is not authorized for this request. */\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n /** Authentication credentials are missing or invalid. */\n Unauthenticated = 'UNAUTHENTICATED',\n /** The authenticated address does not match the request. */\n AddressMismatch = 'ADDRESS_MISMATCH',\n /** The request is malformed or references invalid legs. */\n InvalidRfq = 'INVALID_RFQ',\n /** The legs are mutually exclusive (e.g. YES and NO on the same market). */\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n /** Leg metadata is temporarily unavailable; the request may be retried. */\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n /** The acceptance is invalid (unknown RFQ, wrong state, quote/builder mismatch). */\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n /** The referenced quote is invalid or no longer available. */\n InvalidQuote = 'INVALID_QUOTE',\n /** The order signature failed verification. */\n InvalidSignature = 'INVALID_SIGNATURE',\n /** The request identity is invalid. */\n InvalidIdentity = 'INVALID_IDENTITY',\n /** The RFQ does not exist for the authenticated requester. */\n UnknownRfq = 'UNKNOWN_RFQ',\n /** The RFQ acceptance window has expired. */\n ExpiredRfq = 'EXPIRED_RFQ',\n /** The RFQ is not in a state that permits this operation. */\n InvalidRfqState = 'INVALID_RFQ_STATE',\n /** The quote does not match the RFQ being accepted. */\n QuoteMismatch = 'QUOTE_MISMATCH',\n /** The submission window is closed. */\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n /** A required service is temporarily unavailable. */\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n /** Balance reservation failed before execution. */\n PreExecutionBalanceReservationFailed = 'PRE_EXECUTION_BALANCE_RESERVATION_FAILED',\n /** The requester does not have sufficient balance. */\n BalanceValidationFailed = 'BALANCE_VALIDATION_FAILED',\n /** The requester does not have sufficient allowance. */\n AllowanceValidationFailed = 'ALLOWANCE_VALIDATION_FAILED',\n /** The accepted trade could not be submitted for execution. */\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n /** The request failed without a more specific classification. */\n RequestFailed = 'REQUEST_FAILED',\n}\n\n/** Reason no quote was returned for a combo quote request. */\nexport enum ComboQuoteUnavailableReason {\n NoQuotes = 'NO_QUOTES',\n SizeTooLarge = 'SIZE_TOO_LARGE',\n}\n\n/** Reason an accepted combo quote did not proceed to a fill. */\nexport enum ComboAcceptFailureReason {\n MakerDeclined = 'MAKER_DECLINED',\n AcceptanceWindowExpired = 'ACCEPTANCE_WINDOW_EXPIRED',\n /** The trade failed before or during onchain execution handoff. */\n ExecutionFailed = 'EXECUTION_FAILED',\n}\n\nexport type BuilderRfqRequestedSize = {\n unit: RfqRequestedSizeUnit;\n value_e6: string;\n};\n\nexport type BuilderRfqCreateRequest = {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n leg_position_ids: string[];\n direction: RfqDirection;\n side: RfqSide;\n requested_size: BuilderRfqRequestedSize;\n};\n\nexport type BuilderRfqAcceptRequest = {\n quote_id: string;\n signed_order: RfqSignedOrder;\n};\n\n/** Structured error carried inside combo RFQ responses. */\nexport type BuilderRfqError = {\n code: RfqErrorCode;\n message: string;\n};\n\n// Error codes evolve independently of released clients. Codes not yet\n// enumerated in RfqKnownErrorCode must still parse and flow through as-is.\nconst BuilderRfqErrorSchema = z\n .object({\n code: z.string().transform((value): RfqErrorCode => value),\n message: z.string(),\n })\n .transform(\n (error): BuilderRfqError => ({\n code: error.code,\n message: error.message,\n }),\n );\n\n/** The winning quote for an RFQ. */\nexport type BuilderRfqQuote = {\n quoteId: RfqQuoteId;\n /** Blended price across legs, in collateral per outcome token. */\n blendedPrice: DecimalString;\n /** Signed-order collateral for BUY, or position shares for SELL. */\n makerAmount: DecimalString;\n /** Signed-order shares for BUY, or gross collateral limit for SELL. */\n takerAmount: DecimalString;\n /** Total collateral (BUY) or position-share (SELL) balance required to accept. */\n totalRequired: DecimalString;\n /** Exact collateral proceeds after fees. Present only for SELL quotes. */\n netReceive?: DecimalString;\n};\n\nconst BuilderRfqQuoteSchema = z\n .object({\n quote_id: RfqQuoteIdSchema,\n blended_price_e6: E6BigIntStringToDecimalStringSchema,\n maker_amount_e6: E6BigIntStringToDecimalStringSchema,\n taker_amount_e6: E6BigIntStringToDecimalStringSchema,\n total_required_e6: E6BigIntStringToDecimalStringSchema,\n net_receive_e6: E6BigIntStringToDecimalStringSchema.optional(),\n })\n .transform(\n (quote): BuilderRfqQuote => ({\n blendedPrice: quote.blended_price_e6,\n makerAmount: quote.maker_amount_e6,\n quoteId: quote.quote_id,\n takerAmount: quote.taker_amount_e6,\n totalRequired: quote.total_required_e6,\n ...(quote.net_receive_e6 === undefined\n ? {}\n : { netReceive: quote.net_receive_e6 }),\n }),\n );\n\nexport type BuilderRfqResponseRequestedSize = {\n unit: RfqRequestedSizeUnit;\n valueE6: BaseUnits;\n};\n\nconst BuilderRfqResponseRequestedSizeSchema = z\n .object({\n unit: z.enum(RfqRequestedSizeUnit),\n value_e6: z\n .string()\n .regex(/^\\d+$/)\n .transform((value) => toBaseUnits(BigInt(value).toString())),\n })\n .transform(\n (size): BuilderRfqResponseRequestedSize => ({\n unit: size.unit,\n valueE6: size.value_e6,\n }),\n );\n\n/** Original request echoed by a quote-ready builder RFQ response. */\nexport type BuilderRfqResponseRequest = {\n rfqId: RfqId;\n legPositionIds: PositionId[];\n conditionId: ComboConditionId;\n yesPositionId: PositionId;\n noPositionId: PositionId;\n direction: RfqDirection;\n side: RfqSide;\n requestedSize: BuilderRfqResponseRequestedSize;\n};\n\nconst BuilderRfqResponseRequestSchema = z\n .object({\n rfq_id: RfqIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: z.enum(RfqDirection),\n side: z.enum(RfqSide),\n requested_size: BuilderRfqResponseRequestedSizeSchema,\n })\n .transform(\n (request): BuilderRfqResponseRequest => ({\n conditionId: request.condition_id,\n direction: request.direction,\n legPositionIds: request.leg_position_ids,\n noPositionId: request.no_position_id,\n requestedSize: request.requested_size,\n rfqId: request.rfq_id,\n side: request.side,\n yesPositionId: request.yes_position_id,\n }),\n );\n\nexport type BuilderRfqQuoteReadyResponse = {\n rfqId: RfqId;\n status: RfqStatus.AwaitingRequesterAcceptance;\n /** Acceptance deadline (Unix ms). */\n expiresAt: EpochMilliseconds;\n builderCode: BuilderCode;\n request: BuilderRfqResponseRequest;\n quote: BuilderRfqQuote;\n};\n\nconst BuilderRfqQuoteReadyResponseSchema = z\n .object({\n rfq_id: RfqIdSchema,\n status: z.literal(RfqStatus.AwaitingRequesterAcceptance),\n expires_at: EpochMillisecondsSchema,\n builder_code: BuilderCodeSchema,\n request: BuilderRfqResponseRequestSchema,\n quote: BuilderRfqQuoteSchema,\n })\n .transform(\n (response): BuilderRfqQuoteReadyResponse => ({\n builderCode: response.builder_code,\n expiresAt: response.expires_at,\n quote: response.quote,\n request: response.request,\n rfqId: response.rfq_id,\n status: response.status,\n }),\n );\n\nexport type BuilderRfqFinalStateResponse = {\n rfqId: RfqId;\n status: RfqStatus.Failed | RfqStatus.Expired | RfqStatus.Canceled;\n error?: BuilderRfqError;\n};\n\nconst BuilderRfqFinalStateResponseSchema = z\n .object({\n rfq_id: RfqIdSchema,\n status: z.enum([RfqStatus.Failed, RfqStatus.Expired, RfqStatus.Canceled]),\n error: BuilderRfqErrorSchema.optional(),\n })\n .transform(\n (response): BuilderRfqFinalStateResponse => ({\n rfqId: response.rfq_id,\n status: response.status,\n ...(response.error === undefined ? {} : { error: response.error }),\n }),\n );\n\nexport const BuilderRfqCreateResponseSchema = z.union([\n BuilderRfqQuoteReadyResponseSchema,\n BuilderRfqFinalStateResponseSchema,\n]);\n\nexport type BuilderRfqCreateResponse =\n | BuilderRfqQuoteReadyResponse\n | BuilderRfqFinalStateResponse;\n\n/**\n * Status projection returned on accept responses and post-acceptance status\n * reads.\n *\n * @remarks\n * Onchain execution progress is merged into the top-level `status`:\n * {@link RfqExecutionStatus} values surface alongside the RFQ lifecycle\n * (`MATCHED` is reported as {@link RfqStatus.Executing}).\n */\nexport type BuilderRfqStatusResponse = {\n rfqId: RfqId;\n status: RfqStatus | RfqExecutionStatus;\n takerOrderHash?: string;\n txHash?: TxHash;\n error?: BuilderRfqError;\n};\n\nexport const BuilderRfqStatusResponseSchema = z\n .object({\n rfq_id: RfqIdSchema,\n status: z.union([z.enum(RfqStatus), z.enum(RfqExecutionStatus)]),\n taker_order_hash: z.string().optional(),\n tx_hash: TxHashSchema.optional(),\n error: BuilderRfqErrorSchema.optional(),\n })\n .transform(\n (response): BuilderRfqStatusResponse => ({\n rfqId: response.rfq_id,\n status: response.status,\n ...(response.taker_order_hash === undefined\n ? {}\n : { takerOrderHash: response.taker_order_hash }),\n ...(response.tx_hash === undefined ? {} : { txHash: response.tx_hash }),\n ...(response.error === undefined ? {} : { error: response.error }),\n }),\n );\n","import { expectHexString, type HexString } from '@polymarket/types';\nimport { z } from 'zod';\nimport type {\n ComboConditionId,\n DecimalString,\n EventId,\n EvmAddress,\n PositionId,\n} from '../shared';\nimport {\n ComboConditionIdSchema,\n DecimalStringSchema,\n E6BigIntStringToDecimalStringSchema,\n EventIdSchema,\n EvmAddressSchema,\n PositionIdSchema,\n} from '../shared';\n\nconst HexStringSchema = z.string().transform((value) => expectHexString(value));\n\n/**\n * Known collateral-return plan operation kinds.\n *\n * The service evolves this set independently of released clients, so plan\n * parsing accepts unknown kinds as plain strings; see\n * {@link CollateralReturnOperationKind}.\n */\nexport enum CollateralReturnKnownOperationKind {\n Split = 'split',\n Merge = 'merge',\n Redeem = 'redeem',\n SplitOnCondition = 'split_on_condition',\n MergeOnCondition = 'merge_on_condition',\n SplitOnEvent = 'split_on_event',\n MergeOnEvent = 'merge_on_event',\n ConvertOnEvent = 'convert_on_event',\n Extract = 'extract',\n Inject = 'inject',\n ConvertToYesBasket = 'convert_to_yes_basket',\n MergeFromYesBasket = 'merge_from_yes_basket',\n Compress = 'compress',\n}\n\n/**\n * A collateral-return operation kind. Known kinds are enumerated in\n * {@link CollateralReturnKnownOperationKind}; newly introduced kinds flow\n * through as plain strings so plans keep parsing before a client release that\n * enumerates them.\n */\nexport type CollateralReturnOperationKind =\n | CollateralReturnKnownOperationKind\n | (string & {});\n\nconst CollateralReturnOperationKindSchema = z\n .string()\n .transform((value): CollateralReturnOperationKind => value);\n\nexport type CollateralReturnOperation = {\n kind: CollateralReturnOperationKind;\n conditionId?: ComboConditionId;\n eventId?: EventId;\n positionId?: PositionId;\n conditionIndex: number;\n amount: DecimalString;\n};\n\nconst CollateralReturnOperationSchema = z\n .object({\n kind: CollateralReturnOperationKindSchema,\n condition_id: ComboConditionIdSchema.optional(),\n event_id: EventIdSchema.optional(),\n position_id: PositionIdSchema.optional(),\n // The wire format omits zero values, so an absent index means 0.\n condition_index: z.number().int().nonnegative().optional().default(0),\n amount: E6BigIntStringToDecimalStringSchema,\n })\n .transform(\n (operation): CollateralReturnOperation => ({\n amount: operation.amount,\n conditionId: operation.condition_id,\n conditionIndex: operation.condition_index,\n eventId: operation.event_id,\n kind: operation.kind,\n positionId: operation.position_id,\n }),\n );\n\nexport type CollateralReturnPositionAmount = {\n positionId: PositionId;\n amount: DecimalString;\n};\n\nconst CollateralReturnPositionAmountSchema = z\n .object({\n position_id: PositionIdSchema,\n amount: E6BigIntStringToDecimalStringSchema,\n })\n .transform(\n (position): CollateralReturnPositionAmount => ({\n amount: position.amount,\n positionId: position.position_id,\n }),\n );\n\nexport type CollateralReturnPositionSummary = {\n consumed: CollateralReturnPositionAmount[];\n created: CollateralReturnPositionAmount[];\n};\n\nconst CollateralReturnPositionSummarySchema = z\n .object({\n consumed: z.array(CollateralReturnPositionAmountSchema),\n created: z.array(CollateralReturnPositionAmountSchema),\n })\n .transform(\n (summary): CollateralReturnPositionSummary => ({\n consumed: summary.consumed,\n created: summary.created,\n }),\n );\n\nexport type CollateralReturnRouterCall = {\n to: EvmAddress;\n data: HexString;\n};\n\nconst CollateralReturnRouterCallSchema = z\n .object({\n to: EvmAddressSchema,\n data: HexStringSchema,\n })\n .transform(\n (call): CollateralReturnRouterCall => ({\n data: call.data,\n to: call.to,\n }),\n );\n\n/**\n * The plan fields execution consumes: the plan identifier round-tripped to\n * the service, the chain and wallet the plan was computed for, and the exact\n * Router call the execution signs and submits.\n */\nexport const CollateralReturnPlanSchema = z.looseObject({\n planHash: HexStringSchema,\n chainId: z.number().int(),\n wallet: EvmAddressSchema,\n routerCall: CollateralReturnRouterCallSchema,\n});\n\nexport type CollateralReturnPlanResponse = {\n planHash: HexString;\n chainId: number;\n wallet: EvmAddress;\n blockNumber: bigint;\n startingPusd: DecimalString;\n netPusdOut: DecimalString;\n finalPusd: DecimalString;\n operations: CollateralReturnOperation[];\n operationCount: number;\n truncated: boolean;\n estimatedCost: number;\n requiredPusdInput: DecimalString;\n requiredPositions: CollateralReturnPositionAmount[];\n positionSummary: CollateralReturnPositionSummary;\n candidatePositionIds: PositionId[];\n routerCall: CollateralReturnRouterCall;\n};\n\nexport const CollateralReturnPlanResponseSchema = z\n .object({\n plan_hash: HexStringSchema,\n chain_id: z.number().int(),\n wallet: EvmAddressSchema,\n block_number: z.string().regex(/^\\d+$/).transform(BigInt),\n starting_pusd: DecimalStringSchema,\n net_pusd_out: DecimalStringSchema,\n final_pusd: DecimalStringSchema,\n operations: z.array(CollateralReturnOperationSchema),\n operation_count: z.number().int(),\n truncated: z.boolean(),\n estimated_cost: z.number(),\n required_pusd_input: DecimalStringSchema,\n required_positions: z.array(CollateralReturnPositionAmountSchema),\n // Tolerate older service builds that predate the summary field.\n position_summary: CollateralReturnPositionSummarySchema.optional(),\n candidate_position_ids: z.array(PositionIdSchema),\n router_call: CollateralReturnRouterCallSchema,\n })\n .transform(\n (response): CollateralReturnPlanResponse => ({\n blockNumber: response.block_number,\n candidatePositionIds: response.candidate_position_ids,\n chainId: response.chain_id,\n estimatedCost: response.estimated_cost,\n finalPusd: response.final_pusd,\n netPusdOut: response.net_pusd_out,\n operationCount: response.operation_count,\n operations: response.operations,\n planHash: response.plan_hash,\n positionSummary: response.position_summary ?? {\n consumed: [],\n created: [],\n },\n requiredPositions: response.required_positions,\n requiredPusdInput: response.required_pusd_input,\n routerCall: response.router_call,\n startingPusd: response.starting_pusd,\n truncated: response.truncated,\n wallet: response.wallet,\n }),\n );\n"]}
|
package/dist/data/index.d.ts
CHANGED
|
@@ -24,10 +24,10 @@ declare const SideSchema: z.ZodEnum<{
|
|
|
24
24
|
SELL: "SELL";
|
|
25
25
|
}>;
|
|
26
26
|
declare const TimePeriodSchema: z.ZodEnum<{
|
|
27
|
+
ALL: "ALL";
|
|
27
28
|
DAY: "DAY";
|
|
28
29
|
WEEK: "WEEK";
|
|
29
30
|
MONTH: "MONTH";
|
|
30
|
-
ALL: "ALL";
|
|
31
31
|
}>;
|
|
32
32
|
declare const LeaderboardCategorySchema: z.ZodEnum<{
|
|
33
33
|
OVERALL: "OVERALL";
|
package/dist/data/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {$ as $$1,ra,Ma,Ua,Ra,sa,ga,qa,Fa,_ as _$1,Ea,Oa,Z as Z$1}from'../chunk-AY4D74DC.js';import {z as z$1}from'zod';var m=z$1.string(),L=z$1.string(),_=(p=>(p.TRADE="TRADE",p.SPLIT="SPLIT",p.MERGE="MERGE",p.REDEEM="REDEEM",p.REWARD="REWARD",p.CONVERSION="CONVERSION",p.MAKER_REBATE="MAKER_REBATE",p.REFERRAL_REWARD="REFERRAL_REWARD",p.YIELD="YIELD",p.DEPOSIT="DEPOSIT",p.WITHDRAWAL="WITHDRAWAL",p.TAKER_REBATE="TAKER_REBATE",p))(_||{}),O=z$1.enum(_),P=z$1.enum(["BUY","SELL"]),Ce=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||{}),W=z$1.enum(w),V=(s=>(s.Yes="YES",s.No="NO",s))(V||{}),Z=z$1.enum(V),$=z$1.object({proxyWallet:m.nullish(),asset:Ma.nullish(),conditionId:$$1,size:Ra.nullish(),avgPrice:Ra.nullish(),initialValue:Ra.nullish(),currentValue:Ra.nullish(),cashPnl:Ra.nullish(),percentPnl:z$1.number().nullish(),totalBought:Ra.nullish(),realizedPnl:Ra.nullish(),percentRealizedPnl:z$1.number().nullish(),curPrice:Ra.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(Ua,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:Ma.nullish(),endDate:ra.nullish(),negativeRisk:z$1.boolean().nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:s,...c})=>({...c,wallet:s,tokenId:e,oppositeTokenId:i})),q=z$1.object({proxyWallet:m.nullish(),asset:Ma.nullish(),conditionId:$$1.nullish(),avgPrice:Ra.nullish(),totalBought:Ra.nullish(),realizedPnl:Ra.nullish(),curPrice:Ra.nullish(),timestamp:ga.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Ua,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:Ma.nullish(),endDate:sa.nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:s,...c})=>({...c,wallet:s,tokenId:e,oppositeTokenId:i})),J=z$1.object({user:m.nullish(),value:Ra.nullish()}),Q=z$1.object({proxyWallet:m.nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),verified:z$1.boolean().nullish(),asset:Ma.nullish(),conditionId:$$1.nullish(),avgPrice:Ra.nullish(),size:Ra.nullish(),currPrice:Ra.nullish(),currentValue:Ra.nullish(),cashPnl:Ra.nullish(),totalBought:Ra.nullish(),realizedPnl:Ra.nullish(),totalPnl:Ra.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:c})=>({eventId:e,eventSlug:i,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:qa.nullish(),event:ee.nullish()}).transform(({market_id:e,image_url:i,icon_url:s,end_date:c,...x})=>({...x,marketId:e,imageUrl:i,iconUrl:s,endDate:c})),z=z$1.object({leg_index:z$1.number().int(),leg_position_id:Fa,leg_condition_id:$$1,leg_outcome_index:z$1.number().int(),leg_outcome_label:z$1.string().nullish(),leg_status:W,leg_resolved_at:qa.nullish(),leg_current_price:Ra.nullish(),market:te.nullish()}).transform(({leg_index:e,leg_position_id:i,leg_condition_id:s,leg_outcome_index:c,leg_outcome_label:x,leg_status:g,leg_resolved_at:v,leg_current_price:u,...E})=>({...E,legIndex:e,legPositionId:i,legConditionId:s,legOutcomeIndex:c,legOutcomeLabel:x,legStatus:g,legResolvedAt:v,legCurrentPrice:u})),oe=z$1.object({combo_condition_id:_$1,combo_position_id:Fa,side:Z,module_id:z$1.number().int(),user_address:m,shares_balance:Ra,entry_avg_price_usdc:Ra.nullish(),entry_cost_usdc:Ra.nullish(),realized_payout_usdc:Ra.nullish(),total_cost_usdc:Ra.nullish(),status:W,redeemable:z$1.boolean(),first_entry_at:qa,resolved_at:qa.nullish(),updated_at:qa.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:c,user_address:x,shares_balance:g,entry_avg_price_usdc:v,entry_cost_usdc:u,realized_payout_usdc:E,total_cost_usdc:N,first_entry_at:j,resolved_at:U,updated_at:p,legs_total:F,legs_resolved:Y,legs_pending:K,...G})=>({...G,conditionId:e,positionId:i,outcome:s,moduleId:c,wallet:x,shares:g,entryAvgPriceUsdc:v,entryCostUsdc:u,realizedPayoutUsdc:E,totalCostUsdc:N,firstEntryAt:j,resolvedAt:U,updatedAt:p,legsTotal:F,legsResolved:Y,legsPending:K})),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:Ea.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($),De=z$1.array(q),Me=z$1.array(J),ke=z$1.array(X);var H=(u=>(u.Split="SPLIT",u.Merge="MERGE",u.Convert="CONVERT",u.Compress="COMPRESS",u.Wrap="WRAP",u.Unwrap="UNWRAP",u.Redeem="REDEEM",u))(H||{}),ie=z$1.enum(H),ne=z$1.object({id:Z$1,type:ie,user_address:m,combo_condition_id:_$1,combo_position_id:Fa,module_id:z$1.number().int(),amount_usdc:Ra.nullable(),payout_usdc:Ra.nullable(),timestamp:ga,tx_dttm:qa,tx_hash:Oa,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:Ma.nullish(),conditionId:$$1.nullish(),size:Ra.nullish(),price:Ra.nullish(),timestamp:ga.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Ua,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:ga.nullish(),conditionId:z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),type:O,size:Ra.nullish(),usdcSize:Ra.nullish(),transactionHash:Oa.nullish(),price:Ra.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:Ea.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:$$1.parse(l(e.conditionId,"conditionId")),amount:D(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":case "DEPOSIT":case "WITHDRAWAL":case "TAKER_REBATE":return {...i,type:e.type,amount:D(e)}}}function ue(e,i){let s={...i,type:"TRADE",side:l(e.side,"side"),shares:l(e.size,"size"),amount:D(e),price:l(e.price,"price"),title:l(e.title,"title"),icon:e.icon??null};return e.isCombo===true?{...s,isCombo:true,conditionId:_$1.parse(l(e.conditionId,"conditionId")),positionId:Fa.parse(l(e.asset,"asset"))}:{...s,isCombo:false,conditionId:$$1.parse(l(e.conditionId,"conditionId")),tokenId:Ma.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 D(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:Ma.nullish(),pseudonym:z$1.string().nullish(),amount:Ra.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:L.nullish(),value:Ra.nullish()}),be=z$1.object({market:L.nullish(),value:Ra.nullish()}),Se=z$1.object({total:Ra.nullish(),markets:z$1.array(be).nullish()}),Ze=z$1.array(ye),$e=z$1.array(ge),qe=z$1.array(Se);var Ae=z$1.object({rank:z$1.string().nullish(),builder:z$1.string().nullish(),volume:Ra.nullish(),activeUsers:z$1.number().int().nullish(),verified:z$1.boolean().nullish(),builderLogo:z$1.string().nullish()}),fe=z$1.object({dt:qa.nullish(),builder:z$1.string().nullish(),builderLogo:z$1.string().nullish(),verified:z$1.boolean().nullish(),volume:Ra.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:Ra.nullish(),pnl:Ra.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(Ae),ot=z$1.array(fe),it=z$1.array(xe);export{ae as ActivitySchema,_ as ActivityType,O as ActivityTypeSchema,m as AddressSchema,fe as BuilderVolumeEntrySchema,q as ClosedPositionSchema,se as ComboActivitySchema,H as ComboActivityType,z as ComboPositionLegSchema,ee as ComboPositionMarketEventSchema,te as ComboPositionMarketSchema,V as ComboPositionOutcome,Z as ComboPositionOutcomeSchema,oe as ComboPositionSchema,w as ComboPositionStatus,W as ComboPositionStatusSchema,qe as FetchEventLiveVolumeResponseSchema,Me as FetchPortfolioValueResponseSchema,L as Hash64Schema,he as HolderSchema,Ie as LeaderboardCategorySchema,Ae as LeaderboardEntrySchema,ve as LeaderboardOrderBySchema,je as ListActivityResponseSchema,tt as ListBuilderLeaderboardResponseSchema,ot as ListBuilderVolumeResponseSchema,De 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,Ce as TimePeriodSchema,re as TradeSchema,He as TradedSchema,xe as TraderLeaderboardEntrySchema,J as ValueSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {aa,pa,Ka,Sa,Pa,qa,ea,oa,Da,$ as $$1,Ca,Ma,_ as _$1}from'../chunk-WVVJ3WNL.js';import {z as z$1}from'zod';var m=z$1.string(),L=z$1.string(),_=(p=>(p.TRADE="TRADE",p.SPLIT="SPLIT",p.MERGE="MERGE",p.REDEEM="REDEEM",p.REWARD="REWARD",p.CONVERSION="CONVERSION",p.MAKER_REBATE="MAKER_REBATE",p.REFERRAL_REWARD="REFERRAL_REWARD",p.YIELD="YIELD",p.DEPOSIT="DEPOSIT",p.WITHDRAWAL="WITHDRAWAL",p.TAKER_REBATE="TAKER_REBATE",p))(_||{}),O=z$1.enum(_),P=z$1.enum(["BUY","SELL"]),Ce=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||{}),W=z$1.enum(w),V=(s=>(s.Yes="YES",s.No="NO",s))(V||{}),Z=z$1.enum(V),$=z$1.object({proxyWallet:m.nullish(),asset:Ka.nullish(),conditionId:aa,size:Pa.nullish(),avgPrice:Pa.nullish(),initialValue:Pa.nullish(),currentValue:Pa.nullish(),cashPnl:Pa.nullish(),percentPnl:z$1.number().nullish(),totalBought:Pa.nullish(),realizedPnl:Pa.nullish(),percentRealizedPnl:z$1.number().nullish(),curPrice:Pa.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(Sa,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:Ka.nullish(),endDate:pa.nullish(),negativeRisk:z$1.boolean().nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:s,...c})=>({...c,wallet:s,tokenId:e,oppositeTokenId:i})),q=z$1.object({proxyWallet:m.nullish(),asset:Ka.nullish(),conditionId:aa.nullish(),avgPrice:Pa.nullish(),totalBought:Pa.nullish(),realizedPnl:Pa.nullish(),curPrice:Pa.nullish(),timestamp:ea.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Sa,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:Ka.nullish(),endDate:qa.nullish()}).transform(({asset:e,oppositeAsset:i,proxyWallet:s,...c})=>({...c,wallet:s,tokenId:e,oppositeTokenId:i})),J=z$1.object({user:m.nullish(),value:Pa.nullish()}),Q=z$1.object({proxyWallet:m.nullish(),name:z$1.string().nullish(),profileImage:z$1.string().nullish(),verified:z$1.boolean().nullish(),asset:Ka.nullish(),conditionId:aa.nullish(),avgPrice:Pa.nullish(),size:Pa.nullish(),currPrice:Pa.nullish(),currentValue:Pa.nullish(),cashPnl:Pa.nullish(),totalBought:Pa.nullish(),realizedPnl:Pa.nullish(),totalPnl:Pa.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:c})=>({eventId:e,eventSlug:i,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:oa.nullish(),event:ee.nullish()}).transform(({market_id:e,image_url:i,icon_url:s,end_date:c,...x})=>({...x,marketId:e,imageUrl:i,iconUrl:s,endDate:c})),z=z$1.object({leg_index:z$1.number().int(),leg_position_id:Da,leg_condition_id:aa,leg_outcome_index:z$1.number().int(),leg_outcome_label:z$1.string().nullish(),leg_status:W,leg_resolved_at:oa.nullish(),leg_current_price:Pa.nullish(),market:te.nullish()}).transform(({leg_index:e,leg_position_id:i,leg_condition_id:s,leg_outcome_index:c,leg_outcome_label:x,leg_status:g,leg_resolved_at:v,leg_current_price:u,...E})=>({...E,legIndex:e,legPositionId:i,legConditionId:s,legOutcomeIndex:c,legOutcomeLabel:x,legStatus:g,legResolvedAt:v,legCurrentPrice:u})),oe=z$1.object({combo_condition_id:$$1,combo_position_id:Da,side:Z,module_id:z$1.number().int(),user_address:m,shares_balance:Pa,entry_avg_price_usdc:Pa.nullish(),entry_cost_usdc:Pa.nullish(),realized_payout_usdc:Pa.nullish(),total_cost_usdc:Pa.nullish(),status:W,redeemable:z$1.boolean(),first_entry_at:oa,resolved_at:oa.nullish(),updated_at:oa.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:c,user_address:x,shares_balance:g,entry_avg_price_usdc:v,entry_cost_usdc:u,realized_payout_usdc:E,total_cost_usdc:N,first_entry_at:j,resolved_at:U,updated_at:p,legs_total:F,legs_resolved:Y,legs_pending:K,...G})=>({...G,conditionId:e,positionId:i,outcome:s,moduleId:c,wallet:x,shares:g,entryAvgPriceUsdc:v,entryCostUsdc:u,realizedPayoutUsdc:E,totalCostUsdc:N,firstEntryAt:j,resolvedAt:U,updatedAt:p,legsTotal:F,legsResolved:Y,legsPending:K})),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:Ca.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($),De=z$1.array(q),Me=z$1.array(J),ke=z$1.array(X);var H=(u=>(u.Split="SPLIT",u.Merge="MERGE",u.Convert="CONVERT",u.Compress="COMPRESS",u.Wrap="WRAP",u.Unwrap="UNWRAP",u.Redeem="REDEEM",u))(H||{}),ie=z$1.enum(H),ne=z$1.object({id:_$1,type:ie,user_address:m,combo_condition_id:$$1,combo_position_id:Da,module_id:z$1.number().int(),amount_usdc:Pa.nullable(),payout_usdc:Pa.nullable(),timestamp:ea,tx_dttm:oa,tx_hash:Ma,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:Ka.nullish(),conditionId:aa.nullish(),size:Pa.nullish(),price:Pa.nullish(),timestamp:ea.nullish(),title:z$1.string().nullish(),slug:z$1.string().nullish(),icon:z$1.preprocess(Sa,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:ea.nullish(),conditionId:z$1.preprocess(e=>e===""?void 0:e,z$1.string().optional()),type:O,size:Pa.nullish(),usdcSize:Pa.nullish(),transactionHash:Ma.nullish(),price:Pa.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:Ca.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:aa.parse(l(e.conditionId,"conditionId")),amount:D(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":case "DEPOSIT":case "WITHDRAWAL":case "TAKER_REBATE":return {...i,type:e.type,amount:D(e)}}}function ue(e,i){let s={...i,type:"TRADE",side:l(e.side,"side"),shares:l(e.size,"size"),amount:D(e),price:l(e.price,"price"),title:l(e.title,"title"),icon:e.icon??null};return e.isCombo===true?{...s,isCombo:true,conditionId:$$1.parse(l(e.conditionId,"conditionId")),positionId:Da.parse(l(e.asset,"asset"))}:{...s,isCombo:false,conditionId:aa.parse(l(e.conditionId,"conditionId")),tokenId:Ka.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 D(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:Ka.nullish(),pseudonym:z$1.string().nullish(),amount:Pa.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:L.nullish(),value:Pa.nullish()}),be=z$1.object({market:L.nullish(),value:Pa.nullish()}),Se=z$1.object({total:Pa.nullish(),markets:z$1.array(be).nullish()}),Ze=z$1.array(ye),$e=z$1.array(ge),qe=z$1.array(Se);var Ae=z$1.object({rank:z$1.string().nullish(),builder:z$1.string().nullish(),volume:Pa.nullish(),activeUsers:z$1.number().int().nullish(),verified:z$1.boolean().nullish(),builderLogo:z$1.string().nullish()}),fe=z$1.object({dt:oa.nullish(),builder:z$1.string().nullish(),builderLogo:z$1.string().nullish(),verified:z$1.boolean().nullish(),volume:Pa.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:Pa.nullish(),pnl:Pa.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(Ae),ot=z$1.array(fe),it=z$1.array(xe);export{ae as ActivitySchema,_ as ActivityType,O as ActivityTypeSchema,m as AddressSchema,fe as BuilderVolumeEntrySchema,q as ClosedPositionSchema,se as ComboActivitySchema,H as ComboActivityType,z as ComboPositionLegSchema,ee as ComboPositionMarketEventSchema,te as ComboPositionMarketSchema,V as ComboPositionOutcome,Z as ComboPositionOutcomeSchema,oe as ComboPositionSchema,w as ComboPositionStatus,W as ComboPositionStatusSchema,qe as FetchEventLiveVolumeResponseSchema,Me as FetchPortfolioValueResponseSchema,L as Hash64Schema,he as HolderSchema,Ie as LeaderboardCategorySchema,Ae as LeaderboardEntrySchema,ve as LeaderboardOrderBySchema,je as ListActivityResponseSchema,tt as ListBuilderLeaderboardResponseSchema,ot as ListBuilderVolumeResponseSchema,De 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,Ce as TimePeriodSchema,re as TradeSchema,He as TradedSchema,xe as TraderLeaderboardEntrySchema,J as ValueSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|