import * as _polymarket_types from '@polymarket/types'; import { EvmAddress, HexString, EvmSignature, Erc1271Signature, TxHash } from '@polymarket/types'; import { PositionId, TokenId, BaseUnits, OrderSide, MarketId, ConditionId, DecimalString, PaginationCursor, RfqId, RfqQuoteId, ComboConditionId, EpochMilliseconds, RfqRequestorPublicId, BuilderCode, EventId } from '../index.js'; import { z } from 'zod'; import { S as SignatureType } from '../signature-type-CrLAA9AN.js'; declare enum RfqDirection { Buy = "BUY", Sell = "SELL" } declare enum RfqSide { Yes = "YES", No = "NO" } declare enum RfqConfirmationDecision { Confirm = "CONFIRM", Decline = "DECLINE" } declare enum RfqExecutionStatus { Matched = "MATCHED", Mined = "MINED", Confirmed = "CONFIRMED", Retrying = "RETRYING", Failed = "FAILED" } declare enum RfqRequestedSizeUnit { Notional = "notional", Shares = "shares" } declare enum RfqKnownErrorCode { AddressMismatch = "ADDRESS_MISMATCH", AllowanceValidationFailed = "ALLOWANCE_VALIDATION_FAILED", BalanceValidationFailed = "BALANCE_VALIDATION_FAILED", ContradictoryLegs = "CONTRADICTORY_LEGS", ExpiredRfq = "EXPIRED_RFQ", InvalidAcceptance = "INVALID_ACCEPTANCE", InvalidConfirmation = "INVALID_CONFIRMATION", InvalidExecutionResult = "INVALID_EXECUTION_RESULT", InvalidIdentity = "INVALID_IDENTITY", InvalidMessage = "INVALID_MESSAGE", InvalidOrderSide = "INVALID_ORDER_SIDE", InvalidQuote = "INVALID_QUOTE", InvalidRfq = "INVALID_RFQ", InvalidRfqState = "INVALID_RFQ_STATE", InvalidRole = "INVALID_ROLE", InvalidSignature = "INVALID_SIGNATURE", InvalidSignatureType = "INVALID_SIGNATURE_TYPE", InternalError = "INTERNAL_ERROR", LegMetadataUnavailable = "LEG_METADATA_UNAVAILABLE", MakerAlreadyResponded = "MAKER_ALREADY_RESPONDED", MakerDeclined = "MAKER_DECLINED", MakerNotRequired = "MAKER_NOT_REQUIRED", MakerQuoteLimited = "MAKER_QUOTE_LIMITED", MissingMakerAddressInQuote = "MISSING_MAKER_ADDRESS_IN_QUOTE", MissingMakerAmountInSignedOrder = "MISSING_MAKER_AMOUNT_IN_SIGNED_ORDER", MissingMakerInSignedOrder = "MISSING_MAKER_IN_SIGNED_ORDER", MissingQuoteId = "MISSING_QUOTE_ID", MissingRfqId = "MISSING_RFQ_ID", MissingSaltInSignedOrder = "MISSING_SALT_IN_SIGNED_ORDER", MissingSignatureInSignedOrder = "MISSING_SIGNATURE_IN_SIGNED_ORDER", MissingSignerAddressInQuote = "MISSING_SIGNER_ADDRESS_IN_QUOTE", MissingSignerInSignedOrder = "MISSING_SIGNER_IN_SIGNED_ORDER", MissingTakerAmountInSignedOrder = "MISSING_TAKER_AMOUNT_IN_SIGNED_ORDER", MissingTimestampInSignedOrder = "MISSING_TIMESTAMP_IN_SIGNED_ORDER", MissingTokenIdInSignedOrder = "MISSING_TOKEN_ID_IN_SIGNED_ORDER", NoQuotes = "NO_QUOTES", OrderSideOrTokenDoesNotMatchRequest = "ORDER_SIDE_OR_TOKEN_DOES_NOT_MATCH_REQUEST", PreExecutionBalanceReservationFailed = "PRE_EXECUTION_BALANCE_RESERVATION_FAILED", PriceE6NotPositive = "PRICE_E6_NOT_POSITIVE", QuoteMismatch = "QUOTE_MISMATCH", QuoteUnavailable = "QUOTE_UNAVAILABLE", QuotedPriceAboveSafetyThreshold = "QUOTED_PRICE_ABOVE_SAFETY_THRESHOLD", QuotedPriceOutOfRange = "QUOTED_PRICE_OUT_OF_RANGE", RateLimited = "RATE_LIMITED", RequestFailed = "REQUEST_FAILED", ServiceUnavailable = "SERVICE_UNAVAILABLE", SignedOrderMakerAmountNotPositive = "SIGNED_ORDER_MAKER_AMOUNT_NOT_POSITIVE", SignedOrderMakerDoesNotMatchAuth = "SIGNED_ORDER_MAKER_DOES_NOT_MATCH_AUTH", SignedOrderPriceWorseThanQuote = "SIGNED_ORDER_PRICE_WORSE_THAN_QUOTE", SignedOrderSignatureTypeDoesNotMatchAuth = "SIGNED_ORDER_SIGNATURE_TYPE_DOES_NOT_MATCH_AUTH", SignedOrderSignerDoesNotMatchAuth = "SIGNED_ORDER_SIGNER_DOES_NOT_MATCH_AUTH", SignedOrderSizeDoesNotCoverQuote = "SIGNED_ORDER_SIZE_DOES_NOT_COVER_QUOTE", SignedOrderTakerAmountNotPositive = "SIGNED_ORDER_TAKER_AMOUNT_NOT_POSITIVE", SizeE6NotPositive = "SIZE_E6_NOT_POSITIVE", SizeTooLarge = "SIZE_TOO_LARGE", SubmissionWindowClosed = "SUBMISSION_WINDOW_CLOSED", TradeSubmissionFailed = "TRADE_SUBMISSION_FAILED", Unauthenticated = "UNAUTHENTICATED", UnauthorizedRole = "UNAUTHORIZED_ROLE", UnknownRfq = "UNKNOWN_RFQ" } /** * An RFQ error code. Known codes are enumerated in {@link RfqKnownErrorCode}; * newly introduced codes flow through as plain strings so they can be handled * before a client release that enumerates them. */ type RfqErrorCode = RfqKnownErrorCode | (string & {}); type ComboMarket = { id: MarketId; conditionId: ConditionId; slug: string; title: string; outcomes: ComboMarketOutcomes; image: string; volume: number; tags: string[]; }; type ComboMarketOutcome = { label: string; positionId: PositionId; price: DecimalString; }; type ComboMarketOutcomes = { yes: ComboMarketOutcome; no: ComboMarketOutcome; }; declare const ListComboMarketsResponseSchema: z.ZodPipe>; condition_id: z.ZodPipe>; position_ids: z.ZodArray>>; slug: z.ZodString; title: z.ZodString; outcomes: z.ZodArray; outcome_prices: z.ZodArray>>; image: z.ZodString; volume: z.ZodNumber; tags: z.ZodArray; }, z.core.$strip>, z.ZodTransform>>; next_cursor: z.ZodOptional>>; }, z.core.$strip>, z.ZodTransform<{ markets: ComboMarket[]; nextCursor: PaginationCursor | undefined; }, { markets: ComboMarket[]; next_cursor?: PaginationCursor | null | undefined; }>>; type ListComboMarketsResponse = z.infer; type RfqRequestedSize = { unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }; type RfqSignedOrder = { salt: string; maker: EvmAddress; signer: EvmAddress; tokenId: PositionId | TokenId; makerAmount: BaseUnits; takerAmount: BaseUnits; side: RfqOrderSide; signatureType: SignatureType; timestamp: string; builder?: HexString; expiration?: string; metadata?: HexString; signature: EvmSignature | Erc1271Signature; }; type RfqOrderSide = OrderSide | 0 | 1; type RfqAuthMessage = { type: 'auth'; auth: { apiKey: string; passphrase: string; secret: string; }; identity: { signer_address: EvmAddress; maker_address: EvmAddress; signature_type: SignatureType; }; }; declare enum RfqKnownInboundType { Auth = "auth", QuoteRequest = "RFQ_REQUEST", QuoteAck = "ACK_RFQ_QUOTE", QuoteCancelAck = "ACK_RFQ_QUOTE_CANCEL", ConfirmationRequest = "RFQ_CONFIRMATION_REQUEST", ConfirmationAck = "ACK_RFQ_CONFIRMATION_RESPONSE", ExecutionUpdate = "RFQ_EXECUTION_UPDATE", Trade = "RFQ_TRADE", Error = "RFQ_ERROR" } declare const RfqAuthResponseMessageSchema: z.ZodObject<{ type: z.ZodLiteral; success: z.ZodBoolean; address: z.ZodOptional>>; role: z.ZodOptional; error: z.ZodOptional; }, z.core.$strip>; type RfqAuthResponseMessage = z.infer; declare const RfqQuoteRequestSchema: z.ZodPipe; rfq_id: z.ZodPipe>; requestor_public_id: z.ZodPipe>; leg_position_ids: z.ZodArray>>; condition_id: z.ZodPipe>; yes_position_id: z.ZodPipe>; no_position_id: z.ZodPipe>; direction: z.ZodEnum; side: z.ZodLiteral; requested_size: z.ZodPipe; value_e6: z.ZodPipe>; }, z.core.$strip>, z.ZodObject<{ unit: z.ZodLiteral; value_e6: z.ZodPipe>; }, z.core.$strip>], "unit">, z.ZodTransform<{ unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }, { unit: RfqRequestedSizeUnit.Notional; value_e6: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value_e6: DecimalString; }>>; submission_deadline: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ conditionId: ComboConditionId; direction: RfqDirection; legPositionIds: PositionId[]; noPositionId: PositionId; requestorPublicId: RfqRequestorPublicId; requestedSize: { unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }; rfqId: RfqId; side: RfqSide.Yes; submissionDeadline: EpochMilliseconds; type: "quote_request"; yesPositionId: PositionId; }, { type: RfqKnownInboundType.QuoteRequest; rfq_id: RfqId; requestor_public_id: RfqRequestorPublicId; leg_position_ids: PositionId[]; condition_id: ComboConditionId; yes_position_id: PositionId; no_position_id: PositionId; direction: RfqDirection; side: RfqSide.Yes; requested_size: { unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }; submission_deadline: EpochMilliseconds; }>>; type RfqQuoteRequest = z.infer; type RfqQuoteMessage = { type: 'RFQ_QUOTE'; rfq_id: RfqId; price_e6: string; size_e6: string; signed_order: RfqSignedOrder; }; type RfqQuoteCancelMessage = { type: 'RFQ_QUOTE_CANCEL'; rfq_id: RfqId; quote_id: RfqQuoteId; signer_address: EvmAddress; maker_address: EvmAddress; }; declare const RfqQuoteAckSchema: z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ quoteId: RfqQuoteId; rfqId: RfqId; type: "quote_ack"; }, { type: RfqKnownInboundType.QuoteAck; rfq_id: RfqId; quote_id: RfqQuoteId; }>>; type RfqQuoteAck = z.infer; declare const RfqQuoteCancelAckSchema: z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ quoteId: RfqQuoteId; rfqId: RfqId; type: "quote_cancel_ack"; }, { type: RfqKnownInboundType.QuoteCancelAck; rfq_id: RfqId; quote_id: RfqQuoteId; }>>; type RfqQuoteCancelAck = z.infer; declare const RfqConfirmationRequestSchema: z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; signer_address: z.ZodPipe>; maker_address: z.ZodPipe>; signature_type: z.ZodEnum; leg_position_ids: z.ZodArray>>; condition_id: z.ZodPipe>; yes_position_id: z.ZodPipe>; no_position_id: z.ZodPipe>; direction: z.ZodEnum; side: z.ZodLiteral; fill_size_e6: z.ZodPipe>; price_e6: z.ZodPipe>; confirm_by: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ conditionId: ComboConditionId; confirmBy: EpochMilliseconds; direction: RfqDirection; fillSize: DecimalString; legPositionIds: PositionId[]; makerAddress: EvmAddress; noPositionId: PositionId; price: DecimalString; quoteId: RfqQuoteId; rfqId: RfqId; side: RfqSide.Yes; signatureType: SignatureType; signerAddress: EvmAddress; type: "confirmation_request"; yesPositionId: PositionId; }, { type: RfqKnownInboundType.ConfirmationRequest; rfq_id: RfqId; quote_id: RfqQuoteId; signer_address: EvmAddress; maker_address: EvmAddress; signature_type: SignatureType; leg_position_ids: PositionId[]; condition_id: ComboConditionId; yes_position_id: PositionId; no_position_id: PositionId; direction: RfqDirection; side: RfqSide.Yes; fill_size_e6: DecimalString; price_e6: DecimalString; confirm_by: EpochMilliseconds; }>>; type RfqConfirmationRequest = z.infer; type RfqConfirmationResponseMessage = { type: 'RFQ_CONFIRMATION_RESPONSE'; rfq_id: RfqId; quote_id: RfqQuoteId; decision: RfqConfirmationDecision; }; declare const RfqConfirmationAckSchema: z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; decision: z.ZodEnum; }, z.core.$strip>, z.ZodTransform<{ decision: RfqConfirmationDecision; quoteId: RfqQuoteId; rfqId: RfqId; type: "confirmation_ack"; }, { type: RfqKnownInboundType.ConfirmationAck; rfq_id: RfqId; quote_id: RfqQuoteId; decision: RfqConfirmationDecision; }>>; type RfqConfirmationAck = z.infer; declare const RfqExecutionUpdateSchema: z.ZodPipe; rfq_id: z.ZodPipe>; status: z.ZodEnum; tx_hash: z.ZodOptional>>; }, z.core.$strip>, z.ZodTransform<{ type: "execution_update"; txHash?: _polymarket_types.TxHash | undefined; rfqId: RfqId; status: RfqExecutionStatus; }, { type: RfqKnownInboundType.ExecutionUpdate; rfq_id: RfqId; status: RfqExecutionStatus; tx_hash?: _polymarket_types.TxHash | undefined; }>>; type RfqExecutionUpdate = z.infer; declare const RfqTradeSchema: z.ZodPipe; rfq_id: z.ZodPipe>; requester_id: z.ZodPipe>; condition_id: z.ZodPipe>; leg_position_ids: z.ZodArray>>; direction: z.ZodEnum; side: z.ZodLiteral; price_e6: z.ZodPipe>; size_e6: z.ZodPipe>; executed_at: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ conditionId: ComboConditionId; direction: RfqDirection; executedAt: EpochMilliseconds; legPositionIds: PositionId[]; price: DecimalString; requesterId: RfqRequestorPublicId; rfqId: RfqId; side: RfqSide.Yes; size: DecimalString; type: "trade"; }, { type: RfqKnownInboundType.Trade; rfq_id: RfqId; requester_id: RfqRequestorPublicId; condition_id: ComboConditionId; leg_position_ids: PositionId[]; direction: RfqDirection; side: RfqSide.Yes; price_e6: DecimalString; size_e6: DecimalString; executed_at: EpochMilliseconds; }>>; type RfqTrade = z.infer; declare const RfqErrorMessageSchema: z.ZodPipe; error_id: z.ZodOptional; request_type: z.ZodOptional; rfq_id: z.ZodOptional>>; quote_id: z.ZodOptional>>; code: z.ZodPipe>; error: z.ZodString; request: z.ZodOptional; }, z.core.$strip>, z.ZodTransform<{ code: RfqKnownErrorCode | (string & {}); errorId: string | undefined; message: string; quoteId: RfqQuoteId | undefined; requestType: string | undefined; rfqId: RfqId | undefined; type: "rfq_error"; }, { type: RfqKnownInboundType.Error; code: RfqKnownErrorCode | (string & {}); error: string; error_id?: string | undefined; request_type?: string | undefined; rfq_id?: RfqId | undefined; quote_id?: RfqQuoteId | undefined; request?: unknown; }>>; type RfqErrorMessage = z.infer; declare const RfqQuoterInboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral; success: z.ZodBoolean; address: z.ZodOptional>>; role: z.ZodOptional; error: z.ZodOptional; }, z.core.$strip>, z.ZodPipe; rfq_id: z.ZodPipe>; requestor_public_id: z.ZodPipe>; leg_position_ids: z.ZodArray>>; condition_id: z.ZodPipe>; yes_position_id: z.ZodPipe>; no_position_id: z.ZodPipe>; direction: z.ZodEnum; side: z.ZodLiteral; requested_size: z.ZodPipe; value_e6: z.ZodPipe>; }, z.core.$strip>, z.ZodObject<{ unit: z.ZodLiteral; value_e6: z.ZodPipe>; }, z.core.$strip>], "unit">, z.ZodTransform<{ unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }, { unit: RfqRequestedSizeUnit.Notional; value_e6: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value_e6: DecimalString; }>>; submission_deadline: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ conditionId: ComboConditionId; direction: RfqDirection; legPositionIds: PositionId[]; noPositionId: PositionId; requestorPublicId: RfqRequestorPublicId; requestedSize: { unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }; rfqId: RfqId; side: RfqSide.Yes; submissionDeadline: EpochMilliseconds; type: "quote_request"; yesPositionId: PositionId; }, { type: RfqKnownInboundType.QuoteRequest; rfq_id: RfqId; requestor_public_id: RfqRequestorPublicId; leg_position_ids: PositionId[]; condition_id: ComboConditionId; yes_position_id: PositionId; no_position_id: PositionId; direction: RfqDirection; side: RfqSide.Yes; requested_size: { unit: RfqRequestedSizeUnit.Notional; value: DecimalString; } | { unit: RfqRequestedSizeUnit.Shares; value: DecimalString; }; submission_deadline: EpochMilliseconds; }>>, z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ quoteId: RfqQuoteId; rfqId: RfqId; type: "quote_ack"; }, { type: RfqKnownInboundType.QuoteAck; rfq_id: RfqId; quote_id: RfqQuoteId; }>>, z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ quoteId: RfqQuoteId; rfqId: RfqId; type: "quote_cancel_ack"; }, { type: RfqKnownInboundType.QuoteCancelAck; rfq_id: RfqId; quote_id: RfqQuoteId; }>>, z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; signer_address: z.ZodPipe>; maker_address: z.ZodPipe>; signature_type: z.ZodEnum; leg_position_ids: z.ZodArray>>; condition_id: z.ZodPipe>; yes_position_id: z.ZodPipe>; no_position_id: z.ZodPipe>; direction: z.ZodEnum; side: z.ZodLiteral; fill_size_e6: z.ZodPipe>; price_e6: z.ZodPipe>; confirm_by: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ conditionId: ComboConditionId; confirmBy: EpochMilliseconds; direction: RfqDirection; fillSize: DecimalString; legPositionIds: PositionId[]; makerAddress: EvmAddress; noPositionId: PositionId; price: DecimalString; quoteId: RfqQuoteId; rfqId: RfqId; side: RfqSide.Yes; signatureType: SignatureType; signerAddress: EvmAddress; type: "confirmation_request"; yesPositionId: PositionId; }, { type: RfqKnownInboundType.ConfirmationRequest; rfq_id: RfqId; quote_id: RfqQuoteId; signer_address: EvmAddress; maker_address: EvmAddress; signature_type: SignatureType; leg_position_ids: PositionId[]; condition_id: ComboConditionId; yes_position_id: PositionId; no_position_id: PositionId; direction: RfqDirection; side: RfqSide.Yes; fill_size_e6: DecimalString; price_e6: DecimalString; confirm_by: EpochMilliseconds; }>>, z.ZodPipe; rfq_id: z.ZodPipe>; quote_id: z.ZodPipe>; decision: z.ZodEnum; }, z.core.$strip>, z.ZodTransform<{ decision: RfqConfirmationDecision; quoteId: RfqQuoteId; rfqId: RfqId; type: "confirmation_ack"; }, { type: RfqKnownInboundType.ConfirmationAck; rfq_id: RfqId; quote_id: RfqQuoteId; decision: RfqConfirmationDecision; }>>, z.ZodPipe; rfq_id: z.ZodPipe>; status: z.ZodEnum; tx_hash: z.ZodOptional>>; }, z.core.$strip>, z.ZodTransform<{ type: "execution_update"; txHash?: _polymarket_types.TxHash | undefined; rfqId: RfqId; status: RfqExecutionStatus; }, { type: RfqKnownInboundType.ExecutionUpdate; rfq_id: RfqId; status: RfqExecutionStatus; tx_hash?: _polymarket_types.TxHash | undefined; }>>, z.ZodPipe; rfq_id: z.ZodPipe>; requester_id: z.ZodPipe>; condition_id: z.ZodPipe>; leg_position_ids: z.ZodArray>>; direction: z.ZodEnum; side: z.ZodLiteral; price_e6: z.ZodPipe>; size_e6: z.ZodPipe>; executed_at: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform<{ conditionId: ComboConditionId; direction: RfqDirection; executedAt: EpochMilliseconds; legPositionIds: PositionId[]; price: DecimalString; requesterId: RfqRequestorPublicId; rfqId: RfqId; side: RfqSide.Yes; size: DecimalString; type: "trade"; }, { type: RfqKnownInboundType.Trade; rfq_id: RfqId; requester_id: RfqRequestorPublicId; condition_id: ComboConditionId; leg_position_ids: PositionId[]; direction: RfqDirection; side: RfqSide.Yes; price_e6: DecimalString; size_e6: DecimalString; executed_at: EpochMilliseconds; }>>, z.ZodPipe; error_id: z.ZodOptional; request_type: z.ZodOptional; rfq_id: z.ZodOptional>>; quote_id: z.ZodOptional>>; code: z.ZodPipe>; error: z.ZodString; request: z.ZodOptional; }, z.core.$strip>, z.ZodTransform<{ code: RfqKnownErrorCode | (string & {}); errorId: string | undefined; message: string; quoteId: RfqQuoteId | undefined; requestType: string | undefined; rfqId: RfqId | undefined; type: "rfq_error"; }, { type: RfqKnownInboundType.Error; code: RfqKnownErrorCode | (string & {}); error: string; error_id?: string | undefined; request_type?: string | undefined; rfq_id?: RfqId | undefined; quote_id?: RfqQuoteId | undefined; request?: unknown; }>>], "type">; type RfqQuoterInboundMessage = z.infer; type RfqQuoterOutboundMessage = RfqQuoteMessage | RfqQuoteCancelMessage | RfqConfirmationResponseMessage; /** Lifecycle status of an RFQ. */ declare enum RfqStatus { AwaitingRequesterAcceptance = "AWAITING_REQUESTER_ACCEPTANCE", AwaitingMakerConfirmation = "AWAITING_MAKER_CONFIRMATION", Executing = "EXECUTING", Filled = "FILLED", Failed = "FAILED", Expired = "EXPIRED", Canceled = "CANCELED" } /** * Machine-readable reason an RFQ request or acceptance was rejected. * * @remarks * Codes not enumerated in this SDK release are classified as * {@link RfqRejectionCode.RequestFailed} with the original error preserved on * `cause`. */ declare enum RfqRejectionCode { /** The request body could not be decoded as JSON. */ InvalidJson = "INVALID_JSON", /** The request message is malformed. */ InvalidMessage = "INVALID_MESSAGE", /** The authenticated role is not valid for this request. */ InvalidRole = "INVALID_ROLE", /** The authenticated role is not authorized for this request. */ UnauthorizedRole = "UNAUTHORIZED_ROLE", /** Authentication credentials are missing or invalid. */ Unauthenticated = "UNAUTHENTICATED", /** The authenticated address does not match the request. */ AddressMismatch = "ADDRESS_MISMATCH", /** The request is malformed or references invalid legs. */ InvalidRfq = "INVALID_RFQ", /** The legs are mutually exclusive (e.g. YES and NO on the same market). */ ContradictoryLegs = "CONTRADICTORY_LEGS", /** Leg metadata is temporarily unavailable; the request may be retried. */ LegMetadataUnavailable = "LEG_METADATA_UNAVAILABLE", /** The acceptance is invalid (unknown RFQ, wrong state, quote/builder mismatch). */ InvalidAcceptance = "INVALID_ACCEPTANCE", /** The referenced quote is invalid or no longer available. */ InvalidQuote = "INVALID_QUOTE", /** The order signature failed verification. */ InvalidSignature = "INVALID_SIGNATURE", /** The request identity is invalid. */ InvalidIdentity = "INVALID_IDENTITY", /** The RFQ does not exist for the authenticated requester. */ UnknownRfq = "UNKNOWN_RFQ", /** The RFQ acceptance window has expired. */ ExpiredRfq = "EXPIRED_RFQ", /** The RFQ is not in a state that permits this operation. */ InvalidRfqState = "INVALID_RFQ_STATE", /** The quote does not match the RFQ being accepted. */ QuoteMismatch = "QUOTE_MISMATCH", /** The submission window is closed. */ SubmissionWindowClosed = "SUBMISSION_WINDOW_CLOSED", /** A required service is temporarily unavailable. */ ServiceUnavailable = "SERVICE_UNAVAILABLE", /** Balance reservation failed before execution. */ PreExecutionBalanceReservationFailed = "PRE_EXECUTION_BALANCE_RESERVATION_FAILED", /** The requester does not have sufficient balance. */ BalanceValidationFailed = "BALANCE_VALIDATION_FAILED", /** The requester does not have sufficient allowance. */ AllowanceValidationFailed = "ALLOWANCE_VALIDATION_FAILED", /** The accepted trade could not be submitted for execution. */ TradeSubmissionFailed = "TRADE_SUBMISSION_FAILED", /** The request failed without a more specific classification. */ RequestFailed = "REQUEST_FAILED" } /** Reason no quote was returned for a combo quote request. */ declare enum ComboQuoteUnavailableReason { NoQuotes = "NO_QUOTES", SizeTooLarge = "SIZE_TOO_LARGE" } /** Reason an accepted combo quote did not proceed to a fill. */ declare enum ComboAcceptFailureReason { MakerDeclined = "MAKER_DECLINED", AcceptanceWindowExpired = "ACCEPTANCE_WINDOW_EXPIRED", /** The trade failed before or during onchain execution handoff. */ ExecutionFailed = "EXECUTION_FAILED" } type BuilderRfqRequestedSize = { unit: RfqRequestedSizeUnit; value_e6: string; }; type BuilderRfqCreateRequest = { signer_address: EvmAddress; maker_address: EvmAddress; signature_type: SignatureType; leg_position_ids: string[]; direction: RfqDirection; side: RfqSide; requested_size: BuilderRfqRequestedSize; }; type BuilderRfqAcceptRequest = { quote_id: string; signed_order: RfqSignedOrder; }; /** Structured error carried inside combo RFQ responses. */ type BuilderRfqError = { code: RfqErrorCode; message: string; }; /** The winning quote for an RFQ. */ type BuilderRfqQuote = { quoteId: RfqQuoteId; /** Blended price across legs, in collateral per outcome token. */ blendedPrice: DecimalString; /** Signed-order collateral for BUY, or position shares for SELL. */ makerAmount: DecimalString; /** Signed-order shares for BUY, or gross collateral limit for SELL. */ takerAmount: DecimalString; /** Total collateral (BUY) or position-share (SELL) balance required to accept. */ totalRequired: DecimalString; /** Exact collateral proceeds after fees. Present only for SELL quotes. */ netReceive?: DecimalString; }; type BuilderRfqResponseRequestedSize = { unit: RfqRequestedSizeUnit; valueE6: BaseUnits; }; /** Original request echoed by a quote-ready builder RFQ response. */ type BuilderRfqResponseRequest = { rfqId: RfqId; legPositionIds: PositionId[]; conditionId: ComboConditionId; yesPositionId: PositionId; noPositionId: PositionId; direction: RfqDirection; side: RfqSide; requestedSize: BuilderRfqResponseRequestedSize; }; type BuilderRfqQuoteReadyResponse = { rfqId: RfqId; status: RfqStatus.AwaitingRequesterAcceptance; /** Acceptance deadline (Unix ms). */ expiresAt: EpochMilliseconds; builderCode: BuilderCode; request: BuilderRfqResponseRequest; quote: BuilderRfqQuote; }; type BuilderRfqFinalStateResponse = { rfqId: RfqId; status: RfqStatus.Failed | RfqStatus.Expired | RfqStatus.Canceled; error?: BuilderRfqError; }; declare const BuilderRfqCreateResponseSchema: z.ZodUnion>; status: z.ZodLiteral; expires_at: z.ZodPipe>; builder_code: z.ZodPipe>; request: z.ZodPipe>; leg_position_ids: z.ZodArray>>; condition_id: z.ZodPipe>; yes_position_id: z.ZodPipe>; no_position_id: z.ZodPipe>; direction: z.ZodEnum; side: z.ZodEnum; requested_size: z.ZodPipe; value_e6: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>; }, z.core.$strip>, z.ZodTransform>; quote: z.ZodPipe>; blended_price_e6: z.ZodPipe>; maker_amount_e6: z.ZodPipe>; taker_amount_e6: z.ZodPipe>; total_required_e6: z.ZodPipe>; net_receive_e6: z.ZodOptional>>; }, z.core.$strip>, z.ZodTransform>; }, z.core.$strip>, z.ZodTransform>, z.ZodPipe>; status: z.ZodEnum<{ FAILED: RfqStatus.Failed; EXPIRED: RfqStatus.Expired; CANCELED: RfqStatus.Canceled; }>; error: z.ZodOptional>; message: z.ZodString; }, z.core.$strip>, z.ZodTransform>>; }, z.core.$strip>, z.ZodTransform>]>; type BuilderRfqCreateResponse = BuilderRfqQuoteReadyResponse | BuilderRfqFinalStateResponse; /** * Status projection returned on accept responses and post-acceptance status * reads. * * @remarks * Onchain execution progress is merged into the top-level `status`: * {@link RfqExecutionStatus} values surface alongside the RFQ lifecycle * (`MATCHED` is reported as {@link RfqStatus.Executing}). */ type BuilderRfqStatusResponse = { rfqId: RfqId; status: RfqStatus | RfqExecutionStatus; takerOrderHash?: string; txHash?: TxHash; error?: BuilderRfqError; }; declare const BuilderRfqStatusResponseSchema: z.ZodPipe>; status: z.ZodUnion, z.ZodEnum]>; taker_order_hash: z.ZodOptional; tx_hash: z.ZodOptional>>; error: z.ZodOptional>; message: z.ZodString; }, z.core.$strip>, z.ZodTransform>>; }, z.core.$strip>, z.ZodTransform>; /** * Known collateral-return plan operation kinds. * * The service evolves this set independently of released clients, so plan * parsing accepts unknown kinds as plain strings; see * {@link CollateralReturnOperationKind}. */ declare enum CollateralReturnKnownOperationKind { Split = "split", Merge = "merge", Redeem = "redeem", SplitOnCondition = "split_on_condition", MergeOnCondition = "merge_on_condition", SplitOnEvent = "split_on_event", MergeOnEvent = "merge_on_event", ConvertOnEvent = "convert_on_event", Extract = "extract", Inject = "inject", ConvertToYesBasket = "convert_to_yes_basket", MergeFromYesBasket = "merge_from_yes_basket", Compress = "compress" } /** * A collateral-return operation kind. Known kinds are enumerated in * {@link CollateralReturnKnownOperationKind}; newly introduced kinds flow * through as plain strings so plans keep parsing before a client release that * enumerates them. */ type CollateralReturnOperationKind = CollateralReturnKnownOperationKind | (string & {}); type CollateralReturnOperation = { kind: CollateralReturnOperationKind; conditionId?: ComboConditionId; eventId?: EventId; positionId?: PositionId; conditionIndex: number; amount: DecimalString; }; type CollateralReturnPositionAmount = { positionId: PositionId; amount: DecimalString; }; type CollateralReturnPositionSummary = { consumed: CollateralReturnPositionAmount[]; created: CollateralReturnPositionAmount[]; }; type CollateralReturnRouterCall = { to: EvmAddress; data: HexString; }; /** * The plan fields execution consumes: the plan identifier round-tripped to * the service, the chain and wallet the plan was computed for, and the exact * Router call the execution signs and submits. */ declare const CollateralReturnPlanSchema: z.ZodObject<{ planHash: z.ZodPipe>; chainId: z.ZodNumber; wallet: z.ZodPipe>; routerCall: z.ZodPipe>; data: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>; }, z.core.$loose>; type CollateralReturnPlanResponse = { planHash: HexString; chainId: number; wallet: EvmAddress; blockNumber: bigint; startingPusd: DecimalString; netPusdOut: DecimalString; finalPusd: DecimalString; operations: CollateralReturnOperation[]; operationCount: number; truncated: boolean; estimatedCost: number; requiredPusdInput: DecimalString; requiredPositions: CollateralReturnPositionAmount[]; positionSummary: CollateralReturnPositionSummary; candidatePositionIds: PositionId[]; routerCall: CollateralReturnRouterCall; }; declare const CollateralReturnPlanResponseSchema: z.ZodPipe>; chain_id: z.ZodNumber; wallet: z.ZodPipe>; block_number: z.ZodPipe>; starting_pusd: z.ZodPipe>; net_pusd_out: z.ZodPipe>; final_pusd: z.ZodPipe>; operations: z.ZodArray>; condition_id: z.ZodOptional>>; event_id: z.ZodOptional>]>, z.ZodTransform>>; position_id: z.ZodOptional>>; condition_index: z.ZodDefault>; amount: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>>; operation_count: z.ZodNumber; truncated: z.ZodBoolean; estimated_cost: z.ZodNumber; required_pusd_input: z.ZodPipe>; required_positions: z.ZodArray>; amount: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>>; position_summary: z.ZodOptional>; amount: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>>; created: z.ZodArray>; amount: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>>; }, z.core.$strip>, z.ZodTransform>>; candidate_position_ids: z.ZodArray>>; router_call: z.ZodPipe>; data: z.ZodPipe>; }, z.core.$strip>, z.ZodTransform>; }, z.core.$strip>, z.ZodTransform>; export { type BuilderRfqAcceptRequest, type BuilderRfqCreateRequest, type BuilderRfqCreateResponse, BuilderRfqCreateResponseSchema, type BuilderRfqError, type BuilderRfqFinalStateResponse, type BuilderRfqQuote, type BuilderRfqQuoteReadyResponse, type BuilderRfqRequestedSize, type BuilderRfqResponseRequest, type BuilderRfqResponseRequestedSize, type BuilderRfqStatusResponse, BuilderRfqStatusResponseSchema, CollateralReturnKnownOperationKind, type CollateralReturnOperation, type CollateralReturnOperationKind, type CollateralReturnPlanResponse, CollateralReturnPlanResponseSchema, CollateralReturnPlanSchema, type CollateralReturnPositionAmount, type CollateralReturnPositionSummary, type CollateralReturnRouterCall, ComboAcceptFailureReason, type ComboMarket, type ComboMarketOutcome, type ComboMarketOutcomes, ComboQuoteUnavailableReason, type ListComboMarketsResponse, ListComboMarketsResponseSchema, type RfqAuthMessage, type RfqAuthResponseMessage, type RfqConfirmationAck, RfqConfirmationDecision, type RfqConfirmationRequest, type RfqConfirmationResponseMessage, RfqDirection, type RfqErrorCode, type RfqErrorMessage, RfqExecutionStatus, type RfqExecutionUpdate, RfqId, RfqKnownErrorCode, RfqKnownInboundType, type RfqOrderSide, type RfqQuoteAck, type RfqQuoteCancelAck, type RfqQuoteCancelMessage, RfqQuoteId, type RfqQuoteMessage, type RfqQuoteRequest, type RfqQuoterInboundMessage, RfqQuoterInboundMessageSchema, type RfqQuoterOutboundMessage, RfqRejectionCode, type RfqRequestedSize, RfqRequestedSizeUnit, RfqRequestorPublicId, RfqSide, type RfqSignedOrder, RfqStatus, type RfqTrade };