order

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationType

type ConfigurationType struct {
	QuoteSize     string     `json:"quote_size,omitempty"`
	BaseSize      string     `json:"base_size,omitempty"`
	LimitPrice    string     `json:"limit_price,omitempty"`
	PostOnly      bool       `json:"post_only,omitempty"`
	EndTime       *time.Time `json:"end_time,omitempty"`
	StopDirection string     `json:"stop_direction,omitempty"`
	StopPrice     string     `json:"stop_price,omitempty"`
}

type ErrorResponseType

type ErrorResponseType struct {
	Error                 string `json:"error"`
	Message               string `json:"message"`
	ErrorDetails          string `json:"error_details"`
	PreviewFailureReason  string `json:"preview_failure_reason"`
	NewOrderFailureReason string `json:"new_order_failure_reason"`
}

type Fill

type Fill struct {
	EntryID            string                 `json:"entry_id"`
	TradeID            string                 `json:"trade_id"`
	OrderID            string                 `json:"order_id"`
	TradeTime          time.Time              `json:"trade_time"`
	TradeType          FillType               `json:"trade_type"`
	Price              string                 `json:"price"`
	Size               string                 `json:"size"`
	Commission         string                 `json:"commission"`
	ProductID          string                 `json:"product_id"`
	SequenceTimestamp  time.Time              `json:"sequence_timestamp"`
	LiquidityIndicator LiquidityIndicatorType `json:"liquidity_indicator"`
	SizeInQuote        bool                   `json:"size_in_quote"`
	UserID             string                 `json:"user_id"`
	Side               OrderSide              `json:"side"`
}

type FillType

type FillType string
const (
	FILL_TYPE       FillType = "FILL"
	REVERSAL_TYPE   FillType = "REVERSAL"
	CORRECTION_TYPE FillType = "CORRECTION"
	SYNTHETIC_TYPE  FillType = "SYNTHETIC"
)

type LiquidityIndicatorType

type LiquidityIndicatorType string
const (
	UNKNOWN_LIQUIDITY_INDICATOR_TYPE LiquidityIndicatorType = "UNKNOWN_LIQUIDITY_INDICATOR"
	MAKER_TYPE                       LiquidityIndicatorType = "MAKER"
	TAKER_TYPE                       LiquidityIndicatorType = "TAKER"
)

type Order

type Order struct {
	OrderId              string                                `json:"order_id"`
	ProductID            string                                `json:"product_id"`
	UserId               string                                `json:"user_id"`
	OrderConfiguration   map[OrderTypeConfig]ConfigurationType `json:"order_configuration"`
	Side                 OrderSide                             `json:"side"`
	ClientOrderId        string                                `json:"client_order_id"`
	Status               OrderStatus                           `json:"status"`
	TimeInForce          string                                `json:"time_in_force"`
	CreatedTime          time.Time                             `json:"created_time"`
	CompletionPercentage string                                `json:"completion_percentage"`
	FilledSize           string                                `json:"filled_size"`
	AverageFilledPrice   string                                `json:"average_filled_price"`
	Fee                  string                                `json:"fee"`
	NumberOfFills        string                                `json:"number_of_fills"`
	FilledValue          string                                `json:"filled_value"`
	PendingCancel        bool                                  `json:"pending_cancel"`
	SizeInQuote          bool                                  `json:"size_in_quote"`
	TotalFees            string                                `json:"total_fees"`
	SizeInclusiveOfFees  bool                                  `json:"size_inclusive_of_fees"`
	TotalValueAfterFees  string                                `json:"total_value_after_fees"`
	TriggerStatus        string                                `json:"trigger_status"`
	OrderType            string                                `json:"order_type"`
	RejectReason         string                                `json:"reject_reason"`
	Settled              bool                                  `json:"settled"`
	ProductType          string                                `json:"product_type"`
	RejectMessage        string                                `json:"reject_message"`
	CancelMessage        string                                `json:"cancel_message"`
}

type OrderSide

type OrderSide string
const (
	UNKNOWN_ORDER_SIDE OrderSide = "UNKNOWN_ORDER_SIDE"
	BUY_ORDER_SIDE     OrderSide = "BUY"
	SELL_ORDER_SIDE    OrderSide = "SELL"
)

type OrderStatus

type OrderStatus string
const (
	OPEN_STATUS          OrderStatus = "OPEN"
	FILLED_STATUS        OrderStatus = "FILLED"
	CANCELLED_STATUS     OrderStatus = "CANCELLED"
	EXPIRED_STATUS       OrderStatus = "EXPIRED"
	FAILED_STATUS        OrderStatus = "FAILED"
	UNKNOWN_ORDER_STATUS OrderStatus = "UNKNOWN_ORDER_STATUS"
)

type OrderTypeConfig

type OrderTypeConfig string
const (
	MarketMarketIoc       OrderTypeConfig = "market_market_ioc"
	LimitLimitGtc         OrderTypeConfig = "limit_limit_gtc"
	LimitLimitGtd         OrderTypeConfig = "limit_limit_gtd"
	StopLimitStopLimitGtc OrderTypeConfig = "stop_limit_stop_limit_gtc"
	StopLimitStopLimitGtd OrderTypeConfig = "stop_limit_stop_limit_gtd"
)

type RequestForCancelOrders

type RequestForCancelOrders struct {
	OrderIds []string `json:"order_ids"`
}

func (*RequestForCancelOrders) Method

func (req *RequestForCancelOrders) Method() string

func (*RequestForCancelOrders) Path

func (req *RequestForCancelOrders) Path() string

func (*RequestForCancelOrders) Payload

func (req *RequestForCancelOrders) Payload() []byte

func (*RequestForCancelOrders) Query

func (req *RequestForCancelOrders) Query() string

type RequestForCreateOrder

type RequestForCreateOrder struct {
	ClientOrderID      string                                `json:"client_order_id"`
	ProductID          string                                `json:"product_id"`
	Side               OrderSide                             `json:"side"`
	OrderConfiguration map[OrderTypeConfig]ConfigurationType `json:"order_configuration,omitempty"`
}

func (*RequestForCreateOrder) Method

func (req *RequestForCreateOrder) Method() string

func (*RequestForCreateOrder) Path

func (req *RequestForCreateOrder) Path() string

func (*RequestForCreateOrder) Payload

func (req *RequestForCreateOrder) Payload() []byte

func (*RequestForCreateOrder) Query

func (req *RequestForCreateOrder) Query() string

type RequestForGetOrder

type RequestForGetOrder struct {
	OrderId string `json:"order_id"`
}

func (*RequestForGetOrder) Method

func (req *RequestForGetOrder) Method() string

func (*RequestForGetOrder) Path

func (req *RequestForGetOrder) Path() string

func (*RequestForGetOrder) Payload

func (req *RequestForGetOrder) Payload() []byte

func (*RequestForGetOrder) Query

func (req *RequestForGetOrder) Query() string

type RequestForListFills

type RequestForListFills struct {
	generic.AdvancedTradePaginationRequest
	OrderID                string    `url:"order_id"`
	ProductID              string    `url:"product_id"`
	StartSequenceTimestamp time.Time `url:"start_sequence_timestamp"`
	EndSequenceTimestamp   time.Time `url:"end_sequence_timestamp"`
}

func (*RequestForListFills) Method

func (req *RequestForListFills) Method() string

func (*RequestForListFills) Path

func (req *RequestForListFills) Path() string

func (*RequestForListFills) Payload

func (req *RequestForListFills) Payload() []byte

func (*RequestForListFills) Query

func (req *RequestForListFills) Query() string

type RequestForListOrders

type RequestForListOrders struct {
	ProductId            string                                `url:"product_id, omitempty"`
	OrderConfiguration   map[OrderTypeConfig]ConfigurationType `url:"order_configuration, omitempty"`
	OrderSide            OrderSide                             `url:"order_side, omitempty"`
	ClientOrderId        string                                `url:"client_order_id, omitempty"`
	Status               OrderStatus                           `url:"status, omitempty"`
	TimeInForce          string                                `url:"time_in_force, omitempty"`
	CreatedTime          time.Time                             `url:"created_time, omitempty"`
	CompletionPercentage string                                `url:"completion_percentage, omitempty"`
	FilledSize           string                                `url:"filled_size, omitempty"`
	AverageFilledPrice   string                                `url:"average_filled_price, omitempty"`
	Fee                  string                                `url:"fee, omitempty"`
	NumberOfFills        string                                `url:"number_of_fills, omitempty"`
	FilledValue          string                                `url:"filled_value, omitempty"`
	PendingCancel        bool                                  `url:"pending_cancel, omitempty"`
	SizeInQuote          bool                                  `url:"size_in_quote, omitempty"`
	TotalFees            string                                `url:"total_fees, omitempty"`
}

func (*RequestForListOrders) Method

func (req *RequestForListOrders) Method() string

func (*RequestForListOrders) Path

func (req *RequestForListOrders) Path() string

func (*RequestForListOrders) Payload

func (req *RequestForListOrders) Payload() []byte

func (*RequestForListOrders) Query

func (req *RequestForListOrders) Query() string

type ResponseForCancelOrders

type ResponseForCancelOrders struct {
	Results []ResultType `json:"results"`
}

type ResponseForCreateOrder

type ResponseForCreateOrder struct {
	Success            bool                                  `json:"success"`
	FailureReason      string                                `json:"failure_reason,omitempty"`
	OrderId            string                                `json:"order_id"`
	SuccessResponse    SuccessResponseType                   `json:"success_response,omitempty"`
	ErrorResponse      ErrorResponseType                     `json:"error_response,omitempty"`
	OrderConfiguration map[OrderTypeConfig]ConfigurationType `json:"order_configuration,omitempty"`
}

type ResponseForGetOrder

type ResponseForGetOrder struct {
	Order Order `json:"order"`
}

type ResponseForListFills

type ResponseForListFills struct {
	generic.AdvancedTradePaginationResponse
	Fills []Fill `json:"fills"`
}

type ResponseForListOrders

type ResponseForListOrders struct {
	Orders []Order `json:"orders,omitempty"`
}

type ResultType

type ResultType struct {
	Success       bool   `json:"success"`
	FailureReason string `json:"failure_reason,omitempty"`
	OrderId       string `json:"order_id"`
}

type SuccessResponseType

type SuccessResponseType struct {
	OrderId       string    `json:"order_id"`
	ProductID     string    `json:"product_id"`
	Side          OrderSide `json:"side"`
	ClientOrderID string    `json:"client_order_id"`
}

Jump to

Keyboard shortcuts

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