Documentation
¶
Index ¶
- Constants
- func BuildResponse(code int, payload []byte) *http.Response
- func BuildResponseJson(code int, payload interface{}) *http.Response
- func BuildResponseString(code int, payload string) *http.Response
- func MockWithJsonReply(url string, rawData interface{}) *http.Client
- type ComplexArg
- type CustomResponseUnmarshalerRequest
- func (c *CustomResponseUnmarshalerRequest) Do(ctx context.Context) (*CustomUnmarshalerResponse, error)
- func (c *CustomResponseUnmarshalerRequest) GetParameters() (map[string]interface{}, error)
- func (c *CustomResponseUnmarshalerRequest) GetParametersJSON() ([]byte, error)
- func (c *CustomResponseUnmarshalerRequest) GetParametersQuery() (url.Values, error)
- func (c *CustomResponseUnmarshalerRequest) GetPath() string
- func (c *CustomResponseUnmarshalerRequest) GetQueryParameters() (url.Values, error)
- func (c *CustomResponseUnmarshalerRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CustomResponseUnmarshalerRequest) GetSlugsMap() (map[string]string, error)
- type CustomUnmarshalerResponse
- type Meta
- type MockTransport
- func (transport *MockTransport) DELETE(path string, f RoundTripFunc)
- func (transport *MockTransport) GET(path string, f RoundTripFunc)
- func (transport *MockTransport) POST(path string, f RoundTripFunc)
- func (transport *MockTransport) PUT(path string, f RoundTripFunc)
- func (transport *MockTransport) RoundTrip(req *http.Request) (*http.Response, error)
- type NoParamRequest
- func (n *NoParamRequest) Do(ctx context.Context) (interface{}, error)
- func (n *NoParamRequest) GetParameters() (map[string]interface{}, error)
- func (n *NoParamRequest) GetParametersJSON() ([]byte, error)
- func (n *NoParamRequest) GetParametersQuery() (url.Values, error)
- func (n *NoParamRequest) GetQueryParameters() (url.Values, error)
- func (n *NoParamRequest) GetSlugParameters() (map[string]interface{}, error)
- func (n *NoParamRequest) GetSlugsMap() (map[string]string, error)
- type Order
- type OrderType
- type PlaceOrderRequest
- func (p *PlaceOrderRequest) ClientOrderID(clientOrderID string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) ComplexArg(complexArg ComplexArg) *PlaceOrderRequest
- func (r *PlaceOrderRequest) GetDefaultMeta() *Meta
- 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) GetSlugParameters() (map[string]interface{}, error)
- func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
- func (p *PlaceOrderRequest) Meta(meta Meta) *PlaceOrderRequest
- 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 QueryOrderRequest
- func (q *QueryOrderRequest) AddId(id ...int) *QueryOrderRequest
- func (q *QueryOrderRequest) GetParameters() (map[string]interface{}, error)
- func (q *QueryOrderRequest) GetParametersJSON() ([]byte, error)
- func (q *QueryOrderRequest) GetParametersQuery() (url.Values, error)
- func (q *QueryOrderRequest) GetQueryParameters() (url.Values, error)
- func (q *QueryOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (q *QueryOrderRequest) GetSlugsMap() (map[string]string, error)
- func (q *QueryOrderRequest) Id(id []int) *QueryOrderRequest
- type Response
- type RestClient
- type RoundTripFunc
- type SideType
- type TimeInForceType
- type WalletType
Constants ¶
const RestBaseURL = "https://api.kucoin.com/api"
const SandboxRestBaseURL = "https://openapi-sandbox.kucoin.com/api"
Variables ¶
This section is empty.
Functions ¶
func BuildResponseJson ¶ added in v1.4.0
func BuildResponseString ¶ added in v1.4.0
func MockWithJsonReply ¶ added in v1.4.0
Types ¶
type ComplexArg ¶
type ComplexArg struct {
A, B int
}
type CustomResponseUnmarshalerRequest ¶ added in v1.4.0
type CustomResponseUnmarshalerRequest struct {
// contains filtered or unexported fields
}
func (*CustomResponseUnmarshalerRequest) Do ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) Do(ctx context.Context) (*CustomUnmarshalerResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*CustomResponseUnmarshalerRequest) GetParameters ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CustomResponseUnmarshalerRequest) GetParametersJSON ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CustomResponseUnmarshalerRequest) GetParametersQuery ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CustomResponseUnmarshalerRequest) GetPath ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetPath() string
GetPath returns the request path of the API
func (*CustomResponseUnmarshalerRequest) GetQueryParameters ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CustomResponseUnmarshalerRequest) GetSlugParameters ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CustomResponseUnmarshalerRequest) GetSlugsMap ¶ added in v1.4.0
func (c *CustomResponseUnmarshalerRequest) GetSlugsMap() (map[string]string, error)
type CustomUnmarshalerResponse ¶ added in v1.4.0
func (*CustomUnmarshalerResponse) Unmarshal ¶ added in v1.4.0
func (r *CustomUnmarshalerResponse) Unmarshal(data []byte) error
type MockTransport ¶ added in v1.4.0
type MockTransport struct {
// contains filtered or unexported fields
}
func (*MockTransport) DELETE ¶ added in v1.4.0
func (transport *MockTransport) DELETE(path string, f RoundTripFunc)
func (*MockTransport) GET ¶ added in v1.4.0
func (transport *MockTransport) GET(path string, f RoundTripFunc)
func (*MockTransport) POST ¶ added in v1.4.0
func (transport *MockTransport) POST(path string, f RoundTripFunc)
func (*MockTransport) PUT ¶ added in v1.4.0
func (transport *MockTransport) PUT(path string, f RoundTripFunc)
type NoParamRequest ¶ added in v1.0.1
type NoParamRequest struct {
// contains filtered or unexported fields
}
func (*NoParamRequest) Do ¶ added in v1.0.1
func (n *NoParamRequest) Do(ctx context.Context) (interface{}, error)
func (*NoParamRequest) GetParameters ¶ added in v1.2.0
func (n *NoParamRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*NoParamRequest) GetParametersJSON ¶ added in v1.2.0
func (n *NoParamRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*NoParamRequest) GetParametersQuery ¶ added in v1.2.0
func (n *NoParamRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*NoParamRequest) GetQueryParameters ¶ added in v1.2.0
func (n *NoParamRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*NoParamRequest) GetSlugParameters ¶ added in v1.2.0
func (n *NoParamRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*NoParamRequest) GetSlugsMap ¶ added in v1.2.0
func (n *NoParamRequest) GetSlugsMap() (map[string]string, error)
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
* ClientOrderID sets clientOrderID A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters.
func (*PlaceOrderRequest) ComplexArg ¶
func (p *PlaceOrderRequest) ComplexArg(complexArg ComplexArg) *PlaceOrderRequest
* ComplexArg sets
func (*PlaceOrderRequest) GetDefaultMeta ¶ added in v1.5.0
func (r *PlaceOrderRequest) GetDefaultMeta() *Meta
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) GetSlugParameters ¶ added in v1.2.0
func (p *PlaceOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*PlaceOrderRequest) GetSlugsMap ¶ added in v1.2.0
func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
func (*PlaceOrderRequest) Meta ¶ added in v1.5.0
func (p *PlaceOrderRequest) Meta(meta Meta) *PlaceOrderRequest
* Meta sets
func (*PlaceOrderRequest) OrdType ¶
func (p *PlaceOrderRequest) OrdType(ordType OrderType) *PlaceOrderRequest
* OrdType sets
func (*PlaceOrderRequest) Page ¶
func (p *PlaceOrderRequest) Page(page int64) *PlaceOrderRequest
* Page sets page defines the query parameters for something like '?page=123'
func (*PlaceOrderRequest) Price ¶
func (p *PlaceOrderRequest) Price(price string) *PlaceOrderRequest
* Price sets limit order parameters
func (*PlaceOrderRequest) Side ¶
func (p *PlaceOrderRequest) Side(side SideType) *PlaceOrderRequest
* Side sets side is "buy" or "sell"
func (*PlaceOrderRequest) Size ¶
func (p *PlaceOrderRequest) Size(size string) *PlaceOrderRequest
* Size sets
func (*PlaceOrderRequest) StartTime ¶
func (p *PlaceOrderRequest) StartTime(startTime time.Time) *PlaceOrderRequest
* StartTime sets
func (*PlaceOrderRequest) Symbol ¶
func (p *PlaceOrderRequest) Symbol(symbol string) *PlaceOrderRequest
* Symbol sets symbol is the trading pair symbol, e.g., "BTC-USDT", "ETH-BTC".
func (*PlaceOrderRequest) Tag ¶
func (p *PlaceOrderRequest) Tag(tag string) *PlaceOrderRequest
* Tag sets A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 8 characters.
func (*PlaceOrderRequest) TimeInForce ¶
func (p *PlaceOrderRequest) TimeInForce(timeInForce TimeInForceType) *PlaceOrderRequest
* TimeInForce sets
type QueryOrderRequest ¶ added in v1.4.7
type QueryOrderRequest struct {
// contains filtered or unexported fields
}
func (*QueryOrderRequest) AddId ¶ added in v1.4.7
func (q *QueryOrderRequest) AddId(id ...int) *QueryOrderRequest
func (*QueryOrderRequest) GetParameters ¶ added in v1.4.7
func (q *QueryOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*QueryOrderRequest) GetParametersJSON ¶ added in v1.4.7
func (q *QueryOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*QueryOrderRequest) GetParametersQuery ¶ added in v1.4.7
func (q *QueryOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*QueryOrderRequest) GetQueryParameters ¶ added in v1.4.7
func (q *QueryOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*QueryOrderRequest) GetSlugParameters ¶ added in v1.4.7
func (q *QueryOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*QueryOrderRequest) GetSlugsMap ¶ added in v1.4.7
func (q *QueryOrderRequest) GetSlugsMap() (map[string]string, error)
func (*QueryOrderRequest) Id ¶ added in v1.4.7
func (q *QueryOrderRequest) Id(id []int) *QueryOrderRequest
type RestClient ¶
type RestClient struct {
requestgen.BaseAPIClient
Key, Secret, Passphrase string
KeyVersion string
}
func NewClient ¶
func NewClient() *RestClient
func (*RestClient) Auth ¶
func (c *RestClient) Auth(key, secret, passphrase string)
type RoundTripFunc ¶ added in v1.4.0
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" )
type WalletType ¶ added in v1.2.0
type WalletType int
const ( WalletTypeSpot WalletType = 0 WalletTypeMargin WalletType = 1 WalletTypeFunding WalletType = 2 )