Documentation
¶
Index ¶
- Constants
- type ComplexArg
- type NoParamRequest
- type Order
- type OrderType
- type PlaceOrderRequest
- func (p *PlaceOrderRequest) ClientOrderID(clientOrderID string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) ComplexArg(complexArg ComplexArg) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Do(ctx context.Context) (interface{}, error)
- func (p *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
- func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
- func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
- func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
- func (p *PlaceOrderRequest) OrdType(ordType OrderType) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Page(page int64) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) StartTime(startTime time.Time) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Symbol(symbol string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Tag(tag string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) TimeInForce(timeInForce TimeInForceType) *PlaceOrderRequest
- type Response
- type RestClient
- func (c *RestClient) Auth(key, secret, passphrase string)
- func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestClient) NewRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestClient) SendRequest(req *http.Request) (*requestgen.Response, error)
- type SideType
- type TimeInForceType
Constants ¶
View Source
const RestBaseURL = "https://api.kucoin.com/api"
View Source
const SandboxRestBaseURL = "https://openapi-sandbox.kucoin.com/api"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComplexArg ¶
type ComplexArg struct {
A, B int
}
type NoParamRequest ¶ added in v1.0.1
type NoParamRequest struct {
// contains filtered or unexported fields
}
type Order ¶
type Order struct {
Id string `json:"id"`
Symbol string `json:"symbol"`
OpType string `json:"opType"`
Type string `json:"type"`
Side string `json:"side"`
Price string `json:"price"`
Size string `json:"size"`
Funds string `json:"funds"`
DealFunds string `json:"dealFunds"`
DealSize string `json:"dealSize"`
Fee string `json:"fee"`
FeeCurrency string `json:"feeCurrency"`
Stp string `json:"stp"`
Stop string `json:"stop"`
StopTriggered bool `json:"stopTriggered"`
StopPrice string `json:"stopPrice"`
TimeInForce string `json:"timeInForce"`
PostOnly bool `json:"postOnly"`
Hidden bool `json:"hidden"`
Iceberg bool `json:"iceberg"`
VisibleSize string `json:"visibleSize"`
CancelAfter int `json:"cancelAfter"`
Channel string `json:"channel"`
ClientOid string `json:"clientOid"`
Remark string `json:"remark"`
Tags string `json:"tags"`
IsActive bool `json:"isActive"`
CancelExist bool `json:"cancelExist"`
CreatedAt int64 `json:"createdAt"`
TradeType string `json:"tradeType"`
}
type PlaceOrderRequest ¶
type PlaceOrderRequest struct {
// contains filtered or unexported fields
}
func (*PlaceOrderRequest) ClientOrderID ¶
func (p *PlaceOrderRequest) ClientOrderID(clientOrderID string) *PlaceOrderRequest
func (*PlaceOrderRequest) ComplexArg ¶
func (p *PlaceOrderRequest) ComplexArg(complexArg ComplexArg) *PlaceOrderRequest
func (*PlaceOrderRequest) Do ¶
func (p *PlaceOrderRequest) Do(ctx context.Context) (interface{}, error)
func (*PlaceOrderRequest) GetParameters ¶
func (p *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*PlaceOrderRequest) GetParametersJSON ¶
func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*PlaceOrderRequest) GetParametersQuery ¶
func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*PlaceOrderRequest) GetQueryParameters ¶
func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*PlaceOrderRequest) OrdType ¶
func (p *PlaceOrderRequest) OrdType(ordType OrderType) *PlaceOrderRequest
func (*PlaceOrderRequest) Page ¶
func (p *PlaceOrderRequest) Page(page int64) *PlaceOrderRequest
func (*PlaceOrderRequest) Price ¶
func (p *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
func (*PlaceOrderRequest) Side ¶
func (p *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
func (*PlaceOrderRequest) Size ¶
func (p *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
func (*PlaceOrderRequest) StartTime ¶
func (p *PlaceOrderRequest) StartTime(startTime time.Time) *PlaceOrderRequest
func (*PlaceOrderRequest) Symbol ¶
func (p *PlaceOrderRequest) Symbol(symbol string) *PlaceOrderRequest
func (*PlaceOrderRequest) Tag ¶
func (p *PlaceOrderRequest) Tag(tag string) *PlaceOrderRequest
func (*PlaceOrderRequest) TimeInForce ¶
func (p *PlaceOrderRequest) TimeInForce(timeInForce TimeInForceType) *PlaceOrderRequest
type RestClient ¶
type RestClient struct {
BaseURL *url.URL
Key, Secret, Passphrase string
KeyVersion string
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() *RestClient
func (*RestClient) Auth ¶
func (c *RestClient) Auth(key, secret, passphrase string)
func (*RestClient) NewAuthenticatedRequest ¶
func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
NewAuthenticatedRequest creates new http request for authenticated routes.
func (*RestClient) NewRequest ¶
func (c *RestClient) NewRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
NewRequest create new API request. Relative url can be provided in refURL.
func (*RestClient) SendRequest ¶
func (c *RestClient) SendRequest(req *http.Request) (*requestgen.Response, error)
SendRequest sends the request to the API server and handle the response
type TimeInForceType ¶
type TimeInForceType string
const ( // TimeInForceGTC GTC Good Till Canceled orders remain open on the book until canceled. This is the default behavior if no policy is specified. TimeInForceGTC TimeInForceType = "GTC" // TimeInForceGTT GTT Good Till Time orders remain open on the book until canceled or the allotted cancelAfter is depleted on the matching engine. GTT orders are guaranteed to cancel before any other order is processed after the cancelAfter seconds placed in order book. TimeInForceGTT TimeInForceType = "GTT" // TimeInForceFOK FOK Fill Or Kill orders are rejected if the entire size cannot be matched. TimeInForceFOK TimeInForceType = "FOK" // TimeInForceIOC IOC Immediate Or Cancel orders instantly cancel the remaining size of the limit order instead of opening it on the book. TimeInForceIOC TimeInForceType = "IOC" )
Click to show internal directories.
Click to hide internal directories.