ws

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package ws implements the authenticated Polymarket Combo RFQ quoter WebSocket.

Index

Constants

View Source
const DefaultHost = "wss://combos-rfq-gateway-quoter.polymarket.com/ws/rfq"

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelQuoteAck

type CancelQuoteAck = QuoteReference

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Client

func (*Client) Open

func (c *Client) Open(ctx context.Context) (*Session, error)

type ConfirmationAck

type ConfirmationAck struct {
	RFQID    combo.RFQID                `json:"rfq_id"`
	QuoteID  combo.QuoteID              `json:"quote_id"`
	Decision combo.ConfirmationDecision `json:"decision"`
}

type ConfirmationRequestEvent

type ConfirmationRequestEvent struct {
	RFQID          combo.RFQID            `json:"rfq_id"`
	QuoteID        combo.QuoteID          `json:"quote_id"`
	SignerAddress  string                 `json:"signer_address"`
	MakerAddress   string                 `json:"maker_address"`
	SignatureType  clob.SignatureType     `json:"signature_type"`
	LegPositionIDs []pmtypes.String       `json:"leg_position_ids"`
	ConditionID    combo.ComboConditionID `json:"condition_id"`
	YesPositionID  pmtypes.String         `json:"yes_position_id"`
	NoPositionID   pmtypes.String         `json:"no_position_id"`
	Direction      combo.Direction        `json:"direction"`
	Side           combo.Side             `json:"side"`
	FillSizeE6     pmtypes.String         `json:"fill_size_e6"`
	PriceE6        pmtypes.String         `json:"price_e6"`
	ConfirmBy      pmtypes.Int64          `json:"confirm_by"`
}

type Event

type Event interface {
	// contains filtered or unexported methods
}

type ExecutionUpdateEvent

type ExecutionUpdateEvent struct {
	RFQID           combo.RFQID           `json:"rfq_id"`
	Status          combo.ExecutionStatus `json:"status"`
	TransactionHash string                `json:"tx_hash"`
}

type Option

type Option func(*Client)

func WithAckTimeout

func WithAckTimeout(timeout time.Duration) Option

func WithAuthTimeout

func WithAuthTimeout(timeout time.Duration) Option

func WithChainID

func WithChainID(chainID int64) Option

func WithCredentials

func WithCredentials(credentials clob.Credentials) Option

func WithDialOptions

func WithDialOptions(options *websocket.DialOptions) Option

func WithEventBuffer

func WithEventBuffer(size int) Option

func WithHost

func WithHost(host string) Option

func WithIdentity

func WithIdentity(identity combo.Identity) Option

func WithMaxPending

func WithMaxPending(size int) Option

func WithSigner

func WithSigner(signer *polyauth.Signer) Option

type QuoteOptions

type QuoteOptions = combo.QuoteOptions

type QuoteReference

type QuoteReference struct {
	RFQID   combo.RFQID   `json:"rfq_id"`
	QuoteID combo.QuoteID `json:"quote_id"`
}

type QuoteRequestEvent

type QuoteRequestEvent struct{ combo.QuoteRequest }

type RFQError

type RFQError struct {
	Code        RFQErrorCode  `json:"code"`
	ErrorID     string        `json:"error_id"`
	RequestType string        `json:"request_type"`
	RFQID       combo.RFQID   `json:"rfq_id"`
	QuoteID     combo.QuoteID `json:"quote_id"`
	Message     string        `json:"error"`
}

func (*RFQError) Error

func (e *RFQError) Error() string

type RFQErrorCode

type RFQErrorCode string

type Session

type Session struct {
	// contains filtered or unexported fields
}

func (*Session) CancelQuote

func (s *Session) CancelQuote(ctx context.Context, ref QuoteReference) (CancelQuoteAck, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) Errors

func (s *Session) Errors() <-chan error

func (*Session) Events

func (s *Session) Events() <-chan Event

func (*Session) Quote

func (s *Session) Quote(ctx context.Context, request QuoteRequestEvent, opts QuoteOptions) (QuoteReference, error)

func (*Session) RespondConfirmation

func (s *Session) RespondConfirmation(ctx context.Context, rfqID combo.RFQID, quoteID combo.QuoteID, decision combo.ConfirmationDecision) (ConfirmationAck, error)

type TradeEvent

type TradeEvent struct {
	RFQID          combo.RFQID             `json:"rfq_id"`
	RequesterID    combo.RequestorPublicID `json:"requester_id"`
	ConditionID    combo.ComboConditionID  `json:"condition_id"`
	LegPositionIDs []pmtypes.String        `json:"leg_position_ids"`
	Direction      combo.Direction         `json:"direction"`
	Side           combo.Side              `json:"side"`
	PriceE6        pmtypes.String          `json:"price_e6"`
	SizeE6         pmtypes.String          `json:"size_e6"`
	ExecutedAt     pmtypes.Int64           `json:"executed_at"`
}

type UnknownEvent

type UnknownEvent struct {
	Type string
	Raw  json.RawMessage
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL