Documentation
¶
Overview ¶
Package combo implements Polymarket Combo market discovery and maker RFQ REST APIs.
Index ¶
- Constants
- type BuiltQuote
- type CancelQuoteRequest
- type CancelQuoteResponse
- type Client
- func (c *Client) AuthAddress() string
- func (c *Client) CancelQuote(ctx context.Context, req CancelQuoteRequest, out *CancelQuoteResponse) error
- func (c *Client) ChainID() int64
- func (c *Client) Credentials() *clob.Credentials
- func (c *Client) GetMarkets(ctx context.Context, params MarketParams, out *MarketPage) error
- func (c *Client) Host() string
- func (c *Client) Identity() Identity
- func (c *Client) RespondLastLook(ctx context.Context, req LastLookRequest, out *LastLookResponse) error
- func (c *Client) Signer() *polyauth.Signer
- func (c *Client) SubmitQuote(ctx context.Context, req SubmitQuoteRequest, out *QuoteResponse) error
- type ComboConditionID
- type ConfirmationDecision
- type Direction
- type ExecutionStatus
- type Identity
- type LastLookRequest
- type LastLookResponse
- type Market
- type MarketOutcome
- type MarketPage
- type MarketParams
- type Option
- func WithAuthAddress(address string) Option
- func WithChainID(chainID int64) Option
- func WithCredentials(credentials clob.Credentials) Option
- func WithHTTPClient(client *http.Client) Option
- func WithIdentity(identity Identity) Option
- func WithServerTime(enabled bool) Option
- func WithSigner(signer *polyauth.Signer) Option
- type QuoteBuilder
- type QuoteID
- type QuoteOptions
- type QuoteRequest
- type QuoteResponse
- type QuoteSource
- type RFQID
- type RequestedSize
- type RequestedSizeUnit
- type RequestorPublicID
- type Side
- type SignedOrder
- type SubmitQuoteRequest
Constants ¶
View Source
const ( DefaultHost = "https://combos-rfq-api.polymarket.com" ZeroBytes32 = clob.ZeroBytes32 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltQuote ¶
type BuiltQuote struct {
PriceE6 pmtypes.String
SizeE6 pmtypes.String
SignedOrder SignedOrder
}
type CancelQuoteRequest ¶
type CancelQuoteResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AuthAddress ¶
func (*Client) CancelQuote ¶
func (c *Client) CancelQuote(ctx context.Context, req CancelQuoteRequest, out *CancelQuoteResponse) error
func (*Client) Credentials ¶
func (c *Client) Credentials() *clob.Credentials
func (*Client) GetMarkets ¶
func (c *Client) GetMarkets(ctx context.Context, params MarketParams, out *MarketPage) error
func (*Client) RespondLastLook ¶
func (c *Client) RespondLastLook(ctx context.Context, req LastLookRequest, out *LastLookResponse) error
func (*Client) SubmitQuote ¶
func (c *Client) SubmitQuote(ctx context.Context, req SubmitQuoteRequest, out *QuoteResponse) error
type ComboConditionID ¶
type ComboConditionID string
func NormalizeConditionID ¶
func NormalizeConditionID(value string) (ComboConditionID, error)
type ConfirmationDecision ¶
type ConfirmationDecision string
const ( ConfirmationConfirm ConfirmationDecision = "CONFIRM" ConfirmationDecline ConfirmationDecision = "DECLINE" )
type ExecutionStatus ¶
type ExecutionStatus string
const ( ExecutionMatched ExecutionStatus = "MATCHED" ExecutionMined ExecutionStatus = "MINED" ExecutionConfirmed ExecutionStatus = "CONFIRMED" ExecutionRetrying ExecutionStatus = "RETRYING" ExecutionFailed ExecutionStatus = "FAILED" )
func (ExecutionStatus) Terminal ¶
func (s ExecutionStatus) Terminal() bool
type Identity ¶
type Identity struct {
SignerAddress string `json:"signer_address"`
MakerAddress string `json:"maker_address"`
SignatureType clob.SignatureType `json:"signature_type"`
}
type LastLookRequest ¶
type LastLookRequest struct {
RFQID RFQID `json:"rfq_id"`
QuoteID QuoteID `json:"quote_id"`
Identity
Decision ConfirmationDecision `json:"decision"`
}
type LastLookResponse ¶
type Market ¶
type Market struct {
ID pmtypes.String `json:"id"`
ConditionID string `json:"condition_id"`
Slug string `json:"slug"`
Title string `json:"title"`
Yes MarketOutcome `json:"yes"`
No MarketOutcome `json:"no"`
Image string `json:"image"`
Volume pmtypes.Float64 `json:"volume"`
Tags []string `json:"tags"`
}
func (*Market) UnmarshalJSON ¶
type MarketOutcome ¶
type MarketPage ¶
type MarketParams ¶
type Option ¶
type Option func(*Client)
func WithAuthAddress ¶
WithAuthAddress sets the EOA that owns the configured CLOB API credentials. It is distinct from the order identity for POLY_1271 deposit wallets.
func WithChainID ¶
func WithCredentials ¶
func WithCredentials(credentials clob.Credentials) Option
func WithHTTPClient ¶
func WithIdentity ¶
func WithServerTime ¶
func WithSigner ¶
type QuoteBuilder ¶
type QuoteBuilder struct {
// contains filtered or unexported fields
}
func NewQuoteBuilder ¶
func NewQuoteBuilder(client *Client) *QuoteBuilder
func (*QuoteBuilder) BuildAndSign ¶
func (b *QuoteBuilder) BuildAndSign(request QuoteRequest, opts QuoteOptions) (*BuiltQuote, error)
type QuoteOptions ¶
type QuoteOptions struct {
Price string
Size string
Source QuoteSource
}
type QuoteRequest ¶
type QuoteRequest struct {
RFQID RFQID `json:"rfq_id"`
RequestorPublicID RequestorPublicID `json:"requestor_public_id"`
LegPositionIDs []pmtypes.String `json:"leg_position_ids"`
ConditionID ComboConditionID `json:"condition_id"`
YesPositionID pmtypes.String `json:"yes_position_id"`
NoPositionID pmtypes.String `json:"no_position_id"`
Direction Direction `json:"direction"`
Side Side `json:"side"`
RequestedSize RequestedSize `json:"requested_size"`
SubmissionDeadline pmtypes.Int64 `json:"submission_deadline"`
}
type QuoteResponse ¶
type QuoteSource ¶
type QuoteSource string
const ( QuoteSourceCollateral QuoteSource = "collateral" QuoteSourceInventory QuoteSource = "inventory" )
type RequestedSize ¶
type RequestedSize struct {
Unit RequestedSizeUnit `json:"unit"`
ValueE6 pmtypes.String `json:"value_e6"`
}
type RequestedSizeUnit ¶
type RequestedSizeUnit string
const ( RequestedSizeNotional RequestedSizeUnit = "notional" )
type RequestorPublicID ¶
type RequestorPublicID string
type SignedOrder ¶
type SignedOrder struct {
Salt pmtypes.String `json:"salt"`
Maker string `json:"maker"`
Signer string `json:"signer"`
TokenID pmtypes.String `json:"tokenId"`
MakerAmount pmtypes.String `json:"makerAmount"`
TakerAmount pmtypes.String `json:"takerAmount"`
Side int `json:"side"`
SignatureType clob.SignatureType `json:"signatureType"`
Timestamp pmtypes.String `json:"timestamp"`
Expiration pmtypes.String `json:"expiration,omitempty"`
Metadata string `json:"metadata,omitempty"`
Builder string `json:"builder,omitempty"`
Signature string `json:"signature"`
}
type SubmitQuoteRequest ¶
Click to show internal directories.
Click to hide internal directories.