trade

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package trade provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func NewGetApiV5TradeFillsHistoryRequest

func NewGetApiV5TradeFillsHistoryRequest(server string, params *GetApiV5TradeFillsHistoryParams) (*http.Request, error)

NewGetApiV5TradeFillsHistoryRequest generates requests for GetApiV5TradeFillsHistory

func NewGetApiV5TradeFillsRequest

func NewGetApiV5TradeFillsRequest(server string, params *GetApiV5TradeFillsParams) (*http.Request, error)

NewGetApiV5TradeFillsRequest generates requests for GetApiV5TradeFills

func NewGetApiV5TradeOrderRequest

func NewGetApiV5TradeOrderRequest(server string, params *GetApiV5TradeOrderParams) (*http.Request, error)

NewGetApiV5TradeOrderRequest generates requests for GetApiV5TradeOrder

func NewGetApiV5TradeOrdersAlgoHistoryRequest

func NewGetApiV5TradeOrdersAlgoHistoryRequest(server string, params *GetApiV5TradeOrdersAlgoHistoryParams) (*http.Request, error)

NewGetApiV5TradeOrdersAlgoHistoryRequest generates requests for GetApiV5TradeOrdersAlgoHistory

func NewGetApiV5TradeOrdersAlgoPendingRequest

func NewGetApiV5TradeOrdersAlgoPendingRequest(server string, params *GetApiV5TradeOrdersAlgoPendingParams) (*http.Request, error)

NewGetApiV5TradeOrdersAlgoPendingRequest generates requests for GetApiV5TradeOrdersAlgoPending

func NewGetApiV5TradeOrdersHistoryArchiveRequest

func NewGetApiV5TradeOrdersHistoryArchiveRequest(server string, params *GetApiV5TradeOrdersHistoryArchiveParams) (*http.Request, error)

NewGetApiV5TradeOrdersHistoryArchiveRequest generates requests for GetApiV5TradeOrdersHistoryArchive

func NewGetApiV5TradeOrdersHistoryRequest

func NewGetApiV5TradeOrdersHistoryRequest(server string, params *GetApiV5TradeOrdersHistoryParams) (*http.Request, error)

NewGetApiV5TradeOrdersHistoryRequest generates requests for GetApiV5TradeOrdersHistory

func NewGetApiV5TradeOrdersPendingRequest

func NewGetApiV5TradeOrdersPendingRequest(server string, params *GetApiV5TradeOrdersPendingParams) (*http.Request, error)

NewGetApiV5TradeOrdersPendingRequest generates requests for GetApiV5TradeOrdersPending

func NewPostApiV5TradeAmendBatchOrdersRequest

func NewPostApiV5TradeAmendBatchOrdersRequest(server string, body PostApiV5TradeAmendBatchOrdersJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeAmendBatchOrdersRequest calls the generic PostApiV5TradeAmendBatchOrders builder with application/json body

func NewPostApiV5TradeAmendBatchOrdersRequestWithBody

func NewPostApiV5TradeAmendBatchOrdersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeAmendBatchOrdersRequestWithBody generates requests for PostApiV5TradeAmendBatchOrders with any type of body

func NewPostApiV5TradeAmendOrderRequest

func NewPostApiV5TradeAmendOrderRequest(server string, body PostApiV5TradeAmendOrderJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeAmendOrderRequest calls the generic PostApiV5TradeAmendOrder builder with application/json body

func NewPostApiV5TradeAmendOrderRequestWithBody

func NewPostApiV5TradeAmendOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeAmendOrderRequestWithBody generates requests for PostApiV5TradeAmendOrder with any type of body

func NewPostApiV5TradeBatchOrdersRequest

func NewPostApiV5TradeBatchOrdersRequest(server string, body PostApiV5TradeBatchOrdersJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeBatchOrdersRequest calls the generic PostApiV5TradeBatchOrders builder with application/json body

func NewPostApiV5TradeBatchOrdersRequestWithBody

func NewPostApiV5TradeBatchOrdersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeBatchOrdersRequestWithBody generates requests for PostApiV5TradeBatchOrders with any type of body

func NewPostApiV5TradeCancelAdvanceAlgosRequest

func NewPostApiV5TradeCancelAdvanceAlgosRequest(server string, body PostApiV5TradeCancelAdvanceAlgosJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeCancelAdvanceAlgosRequest calls the generic PostApiV5TradeCancelAdvanceAlgos builder with application/json body

func NewPostApiV5TradeCancelAdvanceAlgosRequestWithBody

func NewPostApiV5TradeCancelAdvanceAlgosRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeCancelAdvanceAlgosRequestWithBody generates requests for PostApiV5TradeCancelAdvanceAlgos with any type of body

func NewPostApiV5TradeCancelAlgosRequest

func NewPostApiV5TradeCancelAlgosRequest(server string, body PostApiV5TradeCancelAlgosJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeCancelAlgosRequest calls the generic PostApiV5TradeCancelAlgos builder with application/json body

func NewPostApiV5TradeCancelAlgosRequestWithBody

func NewPostApiV5TradeCancelAlgosRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeCancelAlgosRequestWithBody generates requests for PostApiV5TradeCancelAlgos with any type of body

func NewPostApiV5TradeCancelBatchOrdersRequest

func NewPostApiV5TradeCancelBatchOrdersRequest(server string, body PostApiV5TradeCancelBatchOrdersJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeCancelBatchOrdersRequest calls the generic PostApiV5TradeCancelBatchOrders builder with application/json body

func NewPostApiV5TradeCancelBatchOrdersRequestWithBody

func NewPostApiV5TradeCancelBatchOrdersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeCancelBatchOrdersRequestWithBody generates requests for PostApiV5TradeCancelBatchOrders with any type of body

func NewPostApiV5TradeCancelOrderRequest

func NewPostApiV5TradeCancelOrderRequest(server string, body PostApiV5TradeCancelOrderJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeCancelOrderRequest calls the generic PostApiV5TradeCancelOrder builder with application/json body

func NewPostApiV5TradeCancelOrderRequestWithBody

func NewPostApiV5TradeCancelOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeCancelOrderRequestWithBody generates requests for PostApiV5TradeCancelOrder with any type of body

func NewPostApiV5TradeClosePositionRequest

func NewPostApiV5TradeClosePositionRequest(server string, body PostApiV5TradeClosePositionJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeClosePositionRequest calls the generic PostApiV5TradeClosePosition builder with application/json body

func NewPostApiV5TradeClosePositionRequestWithBody

func NewPostApiV5TradeClosePositionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeClosePositionRequestWithBody generates requests for PostApiV5TradeClosePosition with any type of body

func NewPostApiV5TradeOrderAlgoRequest

func NewPostApiV5TradeOrderAlgoRequest(server string, body PostApiV5TradeOrderAlgoJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeOrderAlgoRequest calls the generic PostApiV5TradeOrderAlgo builder with application/json body

func NewPostApiV5TradeOrderAlgoRequestWithBody

func NewPostApiV5TradeOrderAlgoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeOrderAlgoRequestWithBody generates requests for PostApiV5TradeOrderAlgo with any type of body

func NewPostApiV5TradeOrderRequest

func NewPostApiV5TradeOrderRequest(server string, body PostApiV5TradeOrderJSONRequestBody) (*http.Request, error)

NewPostApiV5TradeOrderRequest calls the generic PostApiV5TradeOrder builder with application/json body

func NewPostApiV5TradeOrderRequestWithBody

func NewPostApiV5TradeOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiV5TradeOrderRequestWithBody generates requests for PostApiV5TradeOrder with any type of body

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type CancelAlgoOrder

type CancelAlgoOrder struct {
	// 必填<br>策略委托单ID
	AlgoId string `json:"algoId"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`
}

CancelAlgoOrder defines model for CancelAlgoOrder.

type CancelBatchOrder

type CancelBatchOrder struct {
	// 可选<br>客户自定义订单ID<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ClOrdId *string `json:"clOrdId,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 可选<br>订单ID, ordId和clOrdId必须传一个,若传两个,以ordId为主。
	OrdId *string `json:"ordId,omitempty"`
}

CancelBatchOrder defines model for CancelBatchOrder.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetApiV5TradeFills

func (c *Client) GetApiV5TradeFills(ctx context.Context, params *GetApiV5TradeFillsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeFillsHistory

func (c *Client) GetApiV5TradeFillsHistory(ctx context.Context, params *GetApiV5TradeFillsHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeOrder

func (c *Client) GetApiV5TradeOrder(ctx context.Context, params *GetApiV5TradeOrderParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeOrdersAlgoHistory

func (c *Client) GetApiV5TradeOrdersAlgoHistory(ctx context.Context, params *GetApiV5TradeOrdersAlgoHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeOrdersAlgoPending

func (c *Client) GetApiV5TradeOrdersAlgoPending(ctx context.Context, params *GetApiV5TradeOrdersAlgoPendingParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeOrdersHistory

func (c *Client) GetApiV5TradeOrdersHistory(ctx context.Context, params *GetApiV5TradeOrdersHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeOrdersHistoryArchive

func (c *Client) GetApiV5TradeOrdersHistoryArchive(ctx context.Context, params *GetApiV5TradeOrdersHistoryArchiveParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiV5TradeOrdersPending

func (c *Client) GetApiV5TradeOrdersPending(ctx context.Context, params *GetApiV5TradeOrdersPendingParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeAmendBatchOrders

func (c *Client) PostApiV5TradeAmendBatchOrders(ctx context.Context, body PostApiV5TradeAmendBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeAmendBatchOrdersWithBody

func (c *Client) PostApiV5TradeAmendBatchOrdersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeAmendOrder

func (c *Client) PostApiV5TradeAmendOrder(ctx context.Context, body PostApiV5TradeAmendOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeAmendOrderWithBody

func (c *Client) PostApiV5TradeAmendOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeBatchOrders

func (c *Client) PostApiV5TradeBatchOrders(ctx context.Context, body PostApiV5TradeBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeBatchOrdersWithBody

func (c *Client) PostApiV5TradeBatchOrdersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelAdvanceAlgos

func (c *Client) PostApiV5TradeCancelAdvanceAlgos(ctx context.Context, body PostApiV5TradeCancelAdvanceAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelAdvanceAlgosWithBody

func (c *Client) PostApiV5TradeCancelAdvanceAlgosWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelAlgos

func (c *Client) PostApiV5TradeCancelAlgos(ctx context.Context, body PostApiV5TradeCancelAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelAlgosWithBody

func (c *Client) PostApiV5TradeCancelAlgosWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelBatchOrders

func (c *Client) PostApiV5TradeCancelBatchOrders(ctx context.Context, body PostApiV5TradeCancelBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelBatchOrdersWithBody

func (c *Client) PostApiV5TradeCancelBatchOrdersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelOrder

func (c *Client) PostApiV5TradeCancelOrder(ctx context.Context, body PostApiV5TradeCancelOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeCancelOrderWithBody

func (c *Client) PostApiV5TradeCancelOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeClosePosition

func (c *Client) PostApiV5TradeClosePosition(ctx context.Context, body PostApiV5TradeClosePositionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeClosePositionWithBody

func (c *Client) PostApiV5TradeClosePositionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeOrder

func (c *Client) PostApiV5TradeOrder(ctx context.Context, body PostApiV5TradeOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeOrderAlgo

func (c *Client) PostApiV5TradeOrderAlgo(ctx context.Context, body PostApiV5TradeOrderAlgoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeOrderAlgoWithBody

func (c *Client) PostApiV5TradeOrderAlgoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiV5TradeOrderWithBody

func (c *Client) PostApiV5TradeOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// PostApiV5TradeAmendBatchOrders request with any body
	PostApiV5TradeAmendBatchOrdersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeAmendBatchOrders(ctx context.Context, body PostApiV5TradeAmendBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeAmendOrder request with any body
	PostApiV5TradeAmendOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeAmendOrder(ctx context.Context, body PostApiV5TradeAmendOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeBatchOrders request with any body
	PostApiV5TradeBatchOrdersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeBatchOrders(ctx context.Context, body PostApiV5TradeBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeCancelAdvanceAlgos request with any body
	PostApiV5TradeCancelAdvanceAlgosWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeCancelAdvanceAlgos(ctx context.Context, body PostApiV5TradeCancelAdvanceAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeCancelAlgos request with any body
	PostApiV5TradeCancelAlgosWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeCancelAlgos(ctx context.Context, body PostApiV5TradeCancelAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeCancelBatchOrders request with any body
	PostApiV5TradeCancelBatchOrdersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeCancelBatchOrders(ctx context.Context, body PostApiV5TradeCancelBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeCancelOrder request with any body
	PostApiV5TradeCancelOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeCancelOrder(ctx context.Context, body PostApiV5TradeCancelOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeClosePosition request with any body
	PostApiV5TradeClosePositionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeClosePosition(ctx context.Context, body PostApiV5TradeClosePositionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeFills request
	GetApiV5TradeFills(ctx context.Context, params *GetApiV5TradeFillsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeFillsHistory request
	GetApiV5TradeFillsHistory(ctx context.Context, params *GetApiV5TradeFillsHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeOrder request
	GetApiV5TradeOrder(ctx context.Context, params *GetApiV5TradeOrderParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeOrder request with any body
	PostApiV5TradeOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeOrder(ctx context.Context, body PostApiV5TradeOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiV5TradeOrderAlgo request with any body
	PostApiV5TradeOrderAlgoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiV5TradeOrderAlgo(ctx context.Context, body PostApiV5TradeOrderAlgoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeOrdersAlgoHistory request
	GetApiV5TradeOrdersAlgoHistory(ctx context.Context, params *GetApiV5TradeOrdersAlgoHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeOrdersAlgoPending request
	GetApiV5TradeOrdersAlgoPending(ctx context.Context, params *GetApiV5TradeOrdersAlgoPendingParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeOrdersHistory request
	GetApiV5TradeOrdersHistory(ctx context.Context, params *GetApiV5TradeOrdersHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeOrdersHistoryArchive request
	GetApiV5TradeOrdersHistoryArchive(ctx context.Context, params *GetApiV5TradeOrdersHistoryArchiveParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiV5TradeOrdersPending request
	GetApiV5TradeOrdersPending(ctx context.Context, params *GetApiV5TradeOrdersPendingParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetApiV5TradeFillsHistoryWithResponse

func (c *ClientWithResponses) GetApiV5TradeFillsHistoryWithResponse(ctx context.Context, params *GetApiV5TradeFillsHistoryParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeFillsHistoryResponse, error)

GetApiV5TradeFillsHistoryWithResponse request returning *GetApiV5TradeFillsHistoryResponse

func (*ClientWithResponses) GetApiV5TradeFillsWithResponse

func (c *ClientWithResponses) GetApiV5TradeFillsWithResponse(ctx context.Context, params *GetApiV5TradeFillsParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeFillsResponse, error)

GetApiV5TradeFillsWithResponse request returning *GetApiV5TradeFillsResponse

func (*ClientWithResponses) GetApiV5TradeOrderWithResponse

func (c *ClientWithResponses) GetApiV5TradeOrderWithResponse(ctx context.Context, params *GetApiV5TradeOrderParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrderResponse, error)

GetApiV5TradeOrderWithResponse request returning *GetApiV5TradeOrderResponse

func (*ClientWithResponses) GetApiV5TradeOrdersAlgoHistoryWithResponse

func (c *ClientWithResponses) GetApiV5TradeOrdersAlgoHistoryWithResponse(ctx context.Context, params *GetApiV5TradeOrdersAlgoHistoryParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersAlgoHistoryResponse, error)

GetApiV5TradeOrdersAlgoHistoryWithResponse request returning *GetApiV5TradeOrdersAlgoHistoryResponse

func (*ClientWithResponses) GetApiV5TradeOrdersAlgoPendingWithResponse

func (c *ClientWithResponses) GetApiV5TradeOrdersAlgoPendingWithResponse(ctx context.Context, params *GetApiV5TradeOrdersAlgoPendingParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersAlgoPendingResponse, error)

GetApiV5TradeOrdersAlgoPendingWithResponse request returning *GetApiV5TradeOrdersAlgoPendingResponse

func (*ClientWithResponses) GetApiV5TradeOrdersHistoryArchiveWithResponse

func (c *ClientWithResponses) GetApiV5TradeOrdersHistoryArchiveWithResponse(ctx context.Context, params *GetApiV5TradeOrdersHistoryArchiveParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersHistoryArchiveResponse, error)

GetApiV5TradeOrdersHistoryArchiveWithResponse request returning *GetApiV5TradeOrdersHistoryArchiveResponse

func (*ClientWithResponses) GetApiV5TradeOrdersHistoryWithResponse

func (c *ClientWithResponses) GetApiV5TradeOrdersHistoryWithResponse(ctx context.Context, params *GetApiV5TradeOrdersHistoryParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersHistoryResponse, error)

GetApiV5TradeOrdersHistoryWithResponse request returning *GetApiV5TradeOrdersHistoryResponse

func (*ClientWithResponses) GetApiV5TradeOrdersPendingWithResponse

func (c *ClientWithResponses) GetApiV5TradeOrdersPendingWithResponse(ctx context.Context, params *GetApiV5TradeOrdersPendingParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersPendingResponse, error)

GetApiV5TradeOrdersPendingWithResponse request returning *GetApiV5TradeOrdersPendingResponse

func (*ClientWithResponses) PostApiV5TradeAmendBatchOrdersWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeAmendBatchOrdersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendBatchOrdersResponse, error)

PostApiV5TradeAmendBatchOrdersWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeAmendBatchOrdersResponse

func (*ClientWithResponses) PostApiV5TradeAmendBatchOrdersWithResponse

func (c *ClientWithResponses) PostApiV5TradeAmendBatchOrdersWithResponse(ctx context.Context, body PostApiV5TradeAmendBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendBatchOrdersResponse, error)

func (*ClientWithResponses) PostApiV5TradeAmendOrderWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeAmendOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendOrderResponse, error)

PostApiV5TradeAmendOrderWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeAmendOrderResponse

func (*ClientWithResponses) PostApiV5TradeAmendOrderWithResponse

func (c *ClientWithResponses) PostApiV5TradeAmendOrderWithResponse(ctx context.Context, body PostApiV5TradeAmendOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendOrderResponse, error)

func (*ClientWithResponses) PostApiV5TradeBatchOrdersWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeBatchOrdersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeBatchOrdersResponse, error)

PostApiV5TradeBatchOrdersWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeBatchOrdersResponse

func (*ClientWithResponses) PostApiV5TradeBatchOrdersWithResponse

func (c *ClientWithResponses) PostApiV5TradeBatchOrdersWithResponse(ctx context.Context, body PostApiV5TradeBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeBatchOrdersResponse, error)

func (*ClientWithResponses) PostApiV5TradeCancelAdvanceAlgosWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelAdvanceAlgosWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAdvanceAlgosResponse, error)

PostApiV5TradeCancelAdvanceAlgosWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeCancelAdvanceAlgosResponse

func (*ClientWithResponses) PostApiV5TradeCancelAlgosWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelAlgosWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAlgosResponse, error)

PostApiV5TradeCancelAlgosWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeCancelAlgosResponse

func (*ClientWithResponses) PostApiV5TradeCancelAlgosWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelAlgosWithResponse(ctx context.Context, body PostApiV5TradeCancelAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAlgosResponse, error)

func (*ClientWithResponses) PostApiV5TradeCancelBatchOrdersWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelBatchOrdersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelBatchOrdersResponse, error)

PostApiV5TradeCancelBatchOrdersWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeCancelBatchOrdersResponse

func (*ClientWithResponses) PostApiV5TradeCancelBatchOrdersWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelBatchOrdersWithResponse(ctx context.Context, body PostApiV5TradeCancelBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelBatchOrdersResponse, error)

func (*ClientWithResponses) PostApiV5TradeCancelOrderWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelOrderResponse, error)

PostApiV5TradeCancelOrderWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeCancelOrderResponse

func (*ClientWithResponses) PostApiV5TradeCancelOrderWithResponse

func (c *ClientWithResponses) PostApiV5TradeCancelOrderWithResponse(ctx context.Context, body PostApiV5TradeCancelOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelOrderResponse, error)

func (*ClientWithResponses) PostApiV5TradeClosePositionWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeClosePositionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeClosePositionResponse, error)

PostApiV5TradeClosePositionWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeClosePositionResponse

func (*ClientWithResponses) PostApiV5TradeClosePositionWithResponse

func (c *ClientWithResponses) PostApiV5TradeClosePositionWithResponse(ctx context.Context, body PostApiV5TradeClosePositionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeClosePositionResponse, error)

func (*ClientWithResponses) PostApiV5TradeOrderAlgoWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeOrderAlgoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderAlgoResponse, error)

PostApiV5TradeOrderAlgoWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeOrderAlgoResponse

func (*ClientWithResponses) PostApiV5TradeOrderAlgoWithResponse

func (c *ClientWithResponses) PostApiV5TradeOrderAlgoWithResponse(ctx context.Context, body PostApiV5TradeOrderAlgoJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderAlgoResponse, error)

func (*ClientWithResponses) PostApiV5TradeOrderWithBodyWithResponse

func (c *ClientWithResponses) PostApiV5TradeOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderResponse, error)

PostApiV5TradeOrderWithBodyWithResponse request with arbitrary body returning *PostApiV5TradeOrderResponse

func (*ClientWithResponses) PostApiV5TradeOrderWithResponse

func (c *ClientWithResponses) PostApiV5TradeOrderWithResponse(ctx context.Context, body PostApiV5TradeOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostApiV5TradeAmendBatchOrders request with any body
	PostApiV5TradeAmendBatchOrdersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendBatchOrdersResponse, error)

	PostApiV5TradeAmendBatchOrdersWithResponse(ctx context.Context, body PostApiV5TradeAmendBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendBatchOrdersResponse, error)

	// PostApiV5TradeAmendOrder request with any body
	PostApiV5TradeAmendOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendOrderResponse, error)

	PostApiV5TradeAmendOrderWithResponse(ctx context.Context, body PostApiV5TradeAmendOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeAmendOrderResponse, error)

	// PostApiV5TradeBatchOrders request with any body
	PostApiV5TradeBatchOrdersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeBatchOrdersResponse, error)

	PostApiV5TradeBatchOrdersWithResponse(ctx context.Context, body PostApiV5TradeBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeBatchOrdersResponse, error)

	// PostApiV5TradeCancelAdvanceAlgos request with any body
	PostApiV5TradeCancelAdvanceAlgosWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAdvanceAlgosResponse, error)

	PostApiV5TradeCancelAdvanceAlgosWithResponse(ctx context.Context, body PostApiV5TradeCancelAdvanceAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAdvanceAlgosResponse, error)

	// PostApiV5TradeCancelAlgos request with any body
	PostApiV5TradeCancelAlgosWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAlgosResponse, error)

	PostApiV5TradeCancelAlgosWithResponse(ctx context.Context, body PostApiV5TradeCancelAlgosJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelAlgosResponse, error)

	// PostApiV5TradeCancelBatchOrders request with any body
	PostApiV5TradeCancelBatchOrdersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelBatchOrdersResponse, error)

	PostApiV5TradeCancelBatchOrdersWithResponse(ctx context.Context, body PostApiV5TradeCancelBatchOrdersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelBatchOrdersResponse, error)

	// PostApiV5TradeCancelOrder request with any body
	PostApiV5TradeCancelOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelOrderResponse, error)

	PostApiV5TradeCancelOrderWithResponse(ctx context.Context, body PostApiV5TradeCancelOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeCancelOrderResponse, error)

	// PostApiV5TradeClosePosition request with any body
	PostApiV5TradeClosePositionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeClosePositionResponse, error)

	PostApiV5TradeClosePositionWithResponse(ctx context.Context, body PostApiV5TradeClosePositionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeClosePositionResponse, error)

	// GetApiV5TradeFills request
	GetApiV5TradeFillsWithResponse(ctx context.Context, params *GetApiV5TradeFillsParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeFillsResponse, error)

	// GetApiV5TradeFillsHistory request
	GetApiV5TradeFillsHistoryWithResponse(ctx context.Context, params *GetApiV5TradeFillsHistoryParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeFillsHistoryResponse, error)

	// GetApiV5TradeOrder request
	GetApiV5TradeOrderWithResponse(ctx context.Context, params *GetApiV5TradeOrderParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrderResponse, error)

	// PostApiV5TradeOrder request with any body
	PostApiV5TradeOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderResponse, error)

	PostApiV5TradeOrderWithResponse(ctx context.Context, body PostApiV5TradeOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderResponse, error)

	// PostApiV5TradeOrderAlgo request with any body
	PostApiV5TradeOrderAlgoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderAlgoResponse, error)

	PostApiV5TradeOrderAlgoWithResponse(ctx context.Context, body PostApiV5TradeOrderAlgoJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiV5TradeOrderAlgoResponse, error)

	// GetApiV5TradeOrdersAlgoHistory request
	GetApiV5TradeOrdersAlgoHistoryWithResponse(ctx context.Context, params *GetApiV5TradeOrdersAlgoHistoryParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersAlgoHistoryResponse, error)

	// GetApiV5TradeOrdersAlgoPending request
	GetApiV5TradeOrdersAlgoPendingWithResponse(ctx context.Context, params *GetApiV5TradeOrdersAlgoPendingParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersAlgoPendingResponse, error)

	// GetApiV5TradeOrdersHistory request
	GetApiV5TradeOrdersHistoryWithResponse(ctx context.Context, params *GetApiV5TradeOrdersHistoryParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersHistoryResponse, error)

	// GetApiV5TradeOrdersHistoryArchive request
	GetApiV5TradeOrdersHistoryArchiveWithResponse(ctx context.Context, params *GetApiV5TradeOrdersHistoryArchiveParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersHistoryArchiveResponse, error)

	// GetApiV5TradeOrdersPending request
	GetApiV5TradeOrdersPendingWithResponse(ctx context.Context, params *GetApiV5TradeOrdersPendingParams, reqEditors ...RequestEditorFn) (*GetApiV5TradeOrdersPendingResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type GetApiV5TradeFillsHistoryParams

type GetApiV5TradeFillsHistoryParams struct {
	// 产品类型<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType string `json:"instType"`

	// 合约标的指数,如`BTC-USD`
	Uly *string `json:"uly,omitempty"`

	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 订单ID
	OrdId *string `json:"ordId,omitempty"`

	// 请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的`billId`
	After *string `json:"after,omitempty"`

	// 请求此ID之后(更新的数据)的分页内容,传的值为对应接口的`billId`
	Before *string `json:"before,omitempty"`

	// 返回结果的数量,默认100条
	Limit *string `json:"limit,omitempty"`
}

GetApiV5TradeFillsHistoryParams defines parameters for GetApiV5TradeFillsHistory.

type GetApiV5TradeFillsHistoryResponse

type GetApiV5TradeFillsHistoryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeFillsHistoryResponse

func ParseGetApiV5TradeFillsHistoryResponse(rsp *http.Response) (*GetApiV5TradeFillsHistoryResponse, error)

ParseGetApiV5TradeFillsHistoryResponse parses an HTTP response from a GetApiV5TradeFillsHistoryWithResponse call

func (GetApiV5TradeFillsHistoryResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeFillsHistoryResponse) StatusCode

func (r GetApiV5TradeFillsHistoryResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeFillsParams

type GetApiV5TradeFillsParams struct {
	// 产品类型<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType string `json:"instType"`

	// 合约标的指数,如`BTC-USD`
	Uly *string `json:"uly,omitempty"`

	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 订单ID
	OrdId *string `json:"ordId,omitempty"`

	// 请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的`billId`
	After *string `json:"after,omitempty"`

	// 请求此ID之后(更新的数据)的分页内容,传的值为对应接口的`billId`
	Before *string `json:"before,omitempty"`

	// 返回结果的数量,默认100条
	Limit *string `json:"limit,omitempty"`
}

GetApiV5TradeFillsParams defines parameters for GetApiV5TradeFills.

type GetApiV5TradeFillsResponse

type GetApiV5TradeFillsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeFillsResponse

func ParseGetApiV5TradeFillsResponse(rsp *http.Response) (*GetApiV5TradeFillsResponse, error)

ParseGetApiV5TradeFillsResponse parses an HTTP response from a GetApiV5TradeFillsWithResponse call

func (GetApiV5TradeFillsResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeFillsResponse) StatusCode

func (r GetApiV5TradeFillsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeOrderParams

type GetApiV5TradeOrderParams struct {
	// 产品ID,如 `BTC-USDT`
	InstId string `json:"instId"`

	// 订单ID,ordId和clOrdId必须传一个,若传两个,以ordId为主
	OrdId *string `json:"ordId,omitempty"`

	// 用户自定义ID
	ClOrdId *string `json:"clOrdId,omitempty"`
}

GetApiV5TradeOrderParams defines parameters for GetApiV5TradeOrder.

type GetApiV5TradeOrderResponse

type GetApiV5TradeOrderResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeOrderResponse

func ParseGetApiV5TradeOrderResponse(rsp *http.Response) (*GetApiV5TradeOrderResponse, error)

ParseGetApiV5TradeOrderResponse parses an HTTP response from a GetApiV5TradeOrderWithResponse call

func (GetApiV5TradeOrderResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeOrderResponse) StatusCode

func (r GetApiV5TradeOrderResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeOrdersAlgoHistoryParams

type GetApiV5TradeOrdersAlgoHistoryParams struct {
	// 订单类型<br>`conditional`:单向止盈止损,`oco`:双向止盈止损,`trigger`:计划委托,`iceberg`:冰山委托,`twap`:时间加权委托
	OrdType string `json:"ordType"`

	// 策略委托单ID<br>`state`和`algoId`必填且只能填其一
	AlgoId *string `json:"algoId,omitempty"`

	// 订单状态<br>`effective`:已生效,`canceled`:已经撤销,`order_failed`:委托失败<br>`state`和`algoId`必填且只能填其一
	State *string `json:"state,omitempty"`

	// 产品类型<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType *string `json:"instType,omitempty"`

	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的ordId
	After *string `json:"after,omitempty"`

	// 请求此ID之后(更新的数据)的分页内容,传的值为对应接口的`ordId`
	Before *string `json:"before,omitempty"`

	// 返回结果的数量,默认100条
	Limit *string `json:"limit,omitempty"`
}

GetApiV5TradeOrdersAlgoHistoryParams defines parameters for GetApiV5TradeOrdersAlgoHistory.

type GetApiV5TradeOrdersAlgoHistoryResponse

type GetApiV5TradeOrdersAlgoHistoryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeOrdersAlgoHistoryResponse

func ParseGetApiV5TradeOrdersAlgoHistoryResponse(rsp *http.Response) (*GetApiV5TradeOrdersAlgoHistoryResponse, error)

ParseGetApiV5TradeOrdersAlgoHistoryResponse parses an HTTP response from a GetApiV5TradeOrdersAlgoHistoryWithResponse call

func (GetApiV5TradeOrdersAlgoHistoryResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeOrdersAlgoHistoryResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeOrdersAlgoPendingParams

type GetApiV5TradeOrdersAlgoPendingParams struct {
	// 订单类型<br>`conditional`:单向止盈止损<br>`oco`:双向止盈止损<br>`trigger`:计划委托<br>`iceberg`:冰山委托<br>`twap`:时间加权委托
	OrdType string `json:"ordType"`

	// 策略委托单ID
	AlgoId *string `json:"algoId,omitempty"`

	// 产品类型<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType *string `json:"instType,omitempty"`

	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的ordId
	After *string `json:"after,omitempty"`

	// 请求此ID之后(更新的数据)的分页内容,传的值为对应接口的ordId
	Before *string `json:"before,omitempty"`

	// 返回结果的数量,默认100条
	Limit *string `json:"limit,omitempty"`
}

GetApiV5TradeOrdersAlgoPendingParams defines parameters for GetApiV5TradeOrdersAlgoPending.

type GetApiV5TradeOrdersAlgoPendingResponse

type GetApiV5TradeOrdersAlgoPendingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeOrdersAlgoPendingResponse

func ParseGetApiV5TradeOrdersAlgoPendingResponse(rsp *http.Response) (*GetApiV5TradeOrdersAlgoPendingResponse, error)

ParseGetApiV5TradeOrdersAlgoPendingResponse parses an HTTP response from a GetApiV5TradeOrdersAlgoPendingWithResponse call

func (GetApiV5TradeOrdersAlgoPendingResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeOrdersAlgoPendingResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeOrdersHistoryArchiveParams

type GetApiV5TradeOrdersHistoryArchiveParams struct {
	// 产品类型<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType string `json:"instType"`

	// 合约标的指数,如`BTC-USD`
	Uly *string `json:"uly,omitempty"`

	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 订单类型<br>`market`:市价单<br>`limit`:限价单<br>`post_only`:只做maker单<br>`fok`:全部成交或立即取消<br>`ioc`:立即成交并取消剩余<br>`optimal_limit_ioc`:市价委托立即成交并取消剩余(仅适用交割、永续)
	OrdType *string `json:"ordType,omitempty"`

	// 订单状态<br>`canceled`:撤单成功<br>`filled`:完全成交
	State *string `json:"state,omitempty"`

	// 订单种类<br>`twap`:TWAP自动换币<br>`adl`:ADL自动减仓<br>`full_liquidation`:强制平仓<br>`partial_liquidation`:强制减仓<br>`delivery`:交割
	Category *string `json:"category,omitempty"`

	// 请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的ordId
	After *string `json:"after,omitempty"`

	// 请求此ID之后(更新的数据)的分页内容,传的值为对应接口的ordId
	Before *string `json:"before,omitempty"`

	// 返回结果的数量,默认100条
	Limit *string `json:"limit,omitempty"`
}

GetApiV5TradeOrdersHistoryArchiveParams defines parameters for GetApiV5TradeOrdersHistoryArchive.

type GetApiV5TradeOrdersHistoryArchiveResponse

type GetApiV5TradeOrdersHistoryArchiveResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeOrdersHistoryArchiveResponse

func ParseGetApiV5TradeOrdersHistoryArchiveResponse(rsp *http.Response) (*GetApiV5TradeOrdersHistoryArchiveResponse, error)

ParseGetApiV5TradeOrdersHistoryArchiveResponse parses an HTTP response from a GetApiV5TradeOrdersHistoryArchiveWithResponse call

func (GetApiV5TradeOrdersHistoryArchiveResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeOrdersHistoryArchiveResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeOrdersHistoryParams

type GetApiV5TradeOrdersHistoryParams struct {
	// 产品类型<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType string `json:"instType"`

	// 合约标的指数,如`BTC-USD`
	Uly *string `json:"uly,omitempty"`

	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 订单类型<br>`market`:市价单<br>`limit`:限价单<br>`post_only`:只做maker单<br>`fok`:全部成交或立即取消<br>`ioc`:立即成交并取消剩余<br>`optimal_limit_ioc`:市价委托立即成交并取消剩余(仅适用交割、永续)
	OrdType *string `json:"ordType,omitempty"`

	// 订单状态<br>`canceled`:撤单成功<br>`filled`:完全成交
	State *string `json:"state,omitempty"`

	// 订单种类<br>`twap`:TWAP自动换币<br>`adl`:ADL自动减仓<br>`full_liquidation`:强制平仓<br>`partial_liquidation`:强制减仓<br>`delivery`:交割
	Category *string `json:"category,omitempty"`

	// 请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的ordId
	After *string `json:"after,omitempty"`

	// 请求此ID之后(更新的数据)的分页内容,传的值为对应接口的ordId
	Before *string `json:"before,omitempty"`

	// 返回结果的数量,默认100条
	Limit *string `json:"limit,omitempty"`
}

GetApiV5TradeOrdersHistoryParams defines parameters for GetApiV5TradeOrdersHistory.

type GetApiV5TradeOrdersHistoryResponse

type GetApiV5TradeOrdersHistoryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeOrdersHistoryResponse

func ParseGetApiV5TradeOrdersHistoryResponse(rsp *http.Response) (*GetApiV5TradeOrdersHistoryResponse, error)

ParseGetApiV5TradeOrdersHistoryResponse parses an HTTP response from a GetApiV5TradeOrdersHistoryWithResponse call

func (GetApiV5TradeOrdersHistoryResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeOrdersHistoryResponse) StatusCode

func (r GetApiV5TradeOrdersHistoryResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetApiV5TradeOrdersPendingParams

type GetApiV5TradeOrdersPendingParams struct {
	// 产品ID,如`BTC-USDT-SWAP`
	InstId *string `json:"instId,omitempty"`

	// 产品类型。<br>`SPOT`:币币<br>`MARGIN`:币币杠杆<br>`SWAP`:永续合约<br>`FUTURES`:交割合约<br>`OPTION`:期权
	InstType *string `json:"instType,omitempty"`

	// 合约标的指数,如`BTC-USD`
	Uly *string `json:"uly,omitempty"`

	// 订单类型<br>`market`:市价单<br>`limit`:限价单<br>`post_only`:只做maker单<br>`fok`:全部成交或立即取消<br>`ioc`:立即成交并取消剩余<br>`optimal_limit_ioc`:市价委托立即成交并取消剩余(仅适用交割、永续)
	OrdType *string `json:"ordType,omitempty"`
}

GetApiV5TradeOrdersPendingParams defines parameters for GetApiV5TradeOrdersPending.

type GetApiV5TradeOrdersPendingResponse

type GetApiV5TradeOrdersPendingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiV5TradeOrdersPendingResponse

func ParseGetApiV5TradeOrdersPendingResponse(rsp *http.Response) (*GetApiV5TradeOrdersPendingResponse, error)

ParseGetApiV5TradeOrdersPendingResponse parses an HTTP response from a GetApiV5TradeOrdersPendingWithResponse call

func (GetApiV5TradeOrdersPendingResponse) Status

Status returns HTTPResponse.Status

func (GetApiV5TradeOrdersPendingResponse) StatusCode

func (r GetApiV5TradeOrdersPendingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PostApiV5TradeAmendBatchOrdersJSONBody

type PostApiV5TradeAmendBatchOrdersJSONBody struct {
	// 可选<br>客户自定义订单ID<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ClOrdId *string `json:"clOrdId,omitempty"`

	// 非必填<br>`false`:不自动撤单 `true`:自动撤单 当订单修改失败时,该订单是否需要自动撤销。默认为`false`
	CxlOnFail *bool `json:"cxlOnFail,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 可选<br>修改的新价格
	NewPx *string `json:"newPx,omitempty"`

	// 可选<br>修改的新数量,newSz和newPx不可同时为空。对于部分成交订单,该数量应包含已成交数量。
	NewSz *string `json:"newSz,omitempty"`

	// 可选<br>订单ID, ordId和clOrdId必须传一个,若传两个,以ordId为主。
	OrdId *string `json:"ordId,omitempty"`

	// 非必填<br>用户自定义修改事件ID,字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ReqId *string `json:"reqId,omitempty"`
}

PostApiV5TradeAmendBatchOrdersJSONBody defines parameters for PostApiV5TradeAmendBatchOrders.

type PostApiV5TradeAmendBatchOrdersJSONRequestBody

type PostApiV5TradeAmendBatchOrdersJSONRequestBody = PostApiV5TradeAmendBatchOrdersJSONBody

PostApiV5TradeAmendBatchOrdersJSONRequestBody defines body for PostApiV5TradeAmendBatchOrders for application/json ContentType.

type PostApiV5TradeAmendBatchOrdersResponse

type PostApiV5TradeAmendBatchOrdersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeAmendBatchOrdersResponse

func ParsePostApiV5TradeAmendBatchOrdersResponse(rsp *http.Response) (*PostApiV5TradeAmendBatchOrdersResponse, error)

ParsePostApiV5TradeAmendBatchOrdersResponse parses an HTTP response from a PostApiV5TradeAmendBatchOrdersWithResponse call

func (PostApiV5TradeAmendBatchOrdersResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeAmendBatchOrdersResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeAmendOrderJSONBody

type PostApiV5TradeAmendOrderJSONBody struct {
	// 可选<br>客户自定义订单ID<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ClOrdId *string `json:"clOrdId,omitempty"`

	// 非必填<br>`false`:不自动撤单 `true`:自动撤单 当订单修改失败时,该订单是否需要自动撤销。默认为`false`
	CxlOnFail *bool `json:"cxlOnFail,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 可选<br>修改的新价格
	NewPx *string `json:"newPx,omitempty"`

	// 可选<br>修改的新数量,newSz和newPx不可同时为空。对于部分成交订单,该数量应包含已成交数量。
	NewSz *string `json:"newSz,omitempty"`

	// 可选<br>订单ID, ordId和clOrdId必须传一个,若传两个,以ordId为主。
	OrdId *string `json:"ordId,omitempty"`

	// 非必填<br>用户自定义修改事件ID,字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ReqId *string `json:"reqId,omitempty"`
}

PostApiV5TradeAmendOrderJSONBody defines parameters for PostApiV5TradeAmendOrder.

type PostApiV5TradeAmendOrderJSONRequestBody

type PostApiV5TradeAmendOrderJSONRequestBody = PostApiV5TradeAmendOrderJSONBody

PostApiV5TradeAmendOrderJSONRequestBody defines body for PostApiV5TradeAmendOrder for application/json ContentType.

type PostApiV5TradeAmendOrderResponse

type PostApiV5TradeAmendOrderResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeAmendOrderResponse

func ParsePostApiV5TradeAmendOrderResponse(rsp *http.Response) (*PostApiV5TradeAmendOrderResponse, error)

ParsePostApiV5TradeAmendOrderResponse parses an HTTP response from a PostApiV5TradeAmendOrderWithResponse call

func (PostApiV5TradeAmendOrderResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeAmendOrderResponse) StatusCode

func (r PostApiV5TradeAmendOrderResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeBatchOrdersJSONBody

type PostApiV5TradeBatchOrdersJSONBody struct {
	// 非必填<br>保证金币种,如:USDT<br>仅适用于单币种保证金模式下的全仓杠杆订单
	Ccy *string `json:"ccy,omitempty"`

	// 非必填<br>客户自定义订单ID<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ClOrdId *string `json:"clOrdId,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 必填<br>订单类型。<br>市价单:`market`<br>限价单:`limit`<br>只做maker单:`post_only`<br>全部成交或立即取消:`fok`<br>立即成交并取消剩余:`ioc`<br>市价委托立即成交并取消剩余:`optimal_limit_ioc`(仅适用交割、永续)
	OrdType string `json:"ordType"`

	// 可选<br>持仓方向<br>在双向持仓模式下必填,且仅可选择 `long` 或 `short`
	PosSide *string `json:"posSide,omitempty"`

	// 可选<br>委托价格<br>仅适用于`limit`、`post_only`、`fok`、`ioc`类型的订单
	Px *string `json:"px,omitempty"`

	// 非必填<br>是否只减仓,`true` 或 `false`,默认`false`<br>仅适用于币币杠杆订单
	ReduceOnly *bool `json:"reduceOnly,omitempty"`

	// 必填<br>订单方向。买:`buy` 卖:`sell`
	Side string `json:"side"`

	// 必填<br>委托数量
	Sz string `json:"sz"`

	// 非必填<br>订单标签<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字,且长度在1-8位之间。
	Tag *string `json:"tag,omitempty"`

	// 必填<br>交易模式<br>保证金模式:`isolated`:逐仓 ;`cross`<br>全仓非保证金模式:`cash`:非保证金
	TdMode string `json:"tdMode"`

	// 非必填<br>市价单委托数量的类型<br>交易货币:`base_ccy`<br>计价货币:`quote_ccy`<br>仅适用于币币订单
	TgtCcy *string `json:"tgtCcy,omitempty"`
}

PostApiV5TradeBatchOrdersJSONBody defines parameters for PostApiV5TradeBatchOrders.

type PostApiV5TradeBatchOrdersJSONRequestBody

type PostApiV5TradeBatchOrdersJSONRequestBody = PostApiV5TradeBatchOrdersJSONBody

PostApiV5TradeBatchOrdersJSONRequestBody defines body for PostApiV5TradeBatchOrders for application/json ContentType.

type PostApiV5TradeBatchOrdersResponse

type PostApiV5TradeBatchOrdersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeBatchOrdersResponse

func ParsePostApiV5TradeBatchOrdersResponse(rsp *http.Response) (*PostApiV5TradeBatchOrdersResponse, error)

ParsePostApiV5TradeBatchOrdersResponse parses an HTTP response from a PostApiV5TradeBatchOrdersWithResponse call

func (PostApiV5TradeBatchOrdersResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeBatchOrdersResponse) StatusCode

func (r PostApiV5TradeBatchOrdersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeCancelAdvanceAlgosJSONBody

type PostApiV5TradeCancelAdvanceAlgosJSONBody struct {
	// 必填<br>策略委托单ID
	AlgoId string `json:"algoId"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`
}

PostApiV5TradeCancelAdvanceAlgosJSONBody defines parameters for PostApiV5TradeCancelAdvanceAlgos.

type PostApiV5TradeCancelAdvanceAlgosJSONRequestBody

type PostApiV5TradeCancelAdvanceAlgosJSONRequestBody = PostApiV5TradeCancelAdvanceAlgosJSONBody

PostApiV5TradeCancelAdvanceAlgosJSONRequestBody defines body for PostApiV5TradeCancelAdvanceAlgos for application/json ContentType.

type PostApiV5TradeCancelAdvanceAlgosResponse

type PostApiV5TradeCancelAdvanceAlgosResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeCancelAdvanceAlgosResponse

func ParsePostApiV5TradeCancelAdvanceAlgosResponse(rsp *http.Response) (*PostApiV5TradeCancelAdvanceAlgosResponse, error)

ParsePostApiV5TradeCancelAdvanceAlgosResponse parses an HTTP response from a PostApiV5TradeCancelAdvanceAlgosWithResponse call

func (PostApiV5TradeCancelAdvanceAlgosResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeCancelAdvanceAlgosResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeCancelAlgosJSONBody

type PostApiV5TradeCancelAlgosJSONBody []CancelAlgoOrder

PostApiV5TradeCancelAlgosJSONBody defines parameters for PostApiV5TradeCancelAlgos.

type PostApiV5TradeCancelAlgosJSONRequestBody

type PostApiV5TradeCancelAlgosJSONRequestBody = PostApiV5TradeCancelAlgosJSONBody

PostApiV5TradeCancelAlgosJSONRequestBody defines body for PostApiV5TradeCancelAlgos for application/json ContentType.

type PostApiV5TradeCancelAlgosResponse

type PostApiV5TradeCancelAlgosResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeCancelAlgosResponse

func ParsePostApiV5TradeCancelAlgosResponse(rsp *http.Response) (*PostApiV5TradeCancelAlgosResponse, error)

ParsePostApiV5TradeCancelAlgosResponse parses an HTTP response from a PostApiV5TradeCancelAlgosWithResponse call

func (PostApiV5TradeCancelAlgosResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeCancelAlgosResponse) StatusCode

func (r PostApiV5TradeCancelAlgosResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeCancelBatchOrdersJSONBody

type PostApiV5TradeCancelBatchOrdersJSONBody []CancelBatchOrder

PostApiV5TradeCancelBatchOrdersJSONBody defines parameters for PostApiV5TradeCancelBatchOrders.

type PostApiV5TradeCancelBatchOrdersJSONRequestBody

type PostApiV5TradeCancelBatchOrdersJSONRequestBody = PostApiV5TradeCancelBatchOrdersJSONBody

PostApiV5TradeCancelBatchOrdersJSONRequestBody defines body for PostApiV5TradeCancelBatchOrders for application/json ContentType.

type PostApiV5TradeCancelBatchOrdersResponse

type PostApiV5TradeCancelBatchOrdersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeCancelBatchOrdersResponse

func ParsePostApiV5TradeCancelBatchOrdersResponse(rsp *http.Response) (*PostApiV5TradeCancelBatchOrdersResponse, error)

ParsePostApiV5TradeCancelBatchOrdersResponse parses an HTTP response from a PostApiV5TradeCancelBatchOrdersWithResponse call

func (PostApiV5TradeCancelBatchOrdersResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeCancelBatchOrdersResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeCancelOrderJSONBody

type PostApiV5TradeCancelOrderJSONBody struct {
	// 可选<br>客户自定义订单ID<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ClOrdId *string `json:"clOrdId,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 可选<br>订单ID, ordId和clOrdId必须传一个,若传两个,以ordId为主。
	OrdId *string `json:"ordId,omitempty"`
}

PostApiV5TradeCancelOrderJSONBody defines parameters for PostApiV5TradeCancelOrder.

type PostApiV5TradeCancelOrderJSONRequestBody

type PostApiV5TradeCancelOrderJSONRequestBody = PostApiV5TradeCancelOrderJSONBody

PostApiV5TradeCancelOrderJSONRequestBody defines body for PostApiV5TradeCancelOrder for application/json ContentType.

type PostApiV5TradeCancelOrderResponse

type PostApiV5TradeCancelOrderResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeCancelOrderResponse

func ParsePostApiV5TradeCancelOrderResponse(rsp *http.Response) (*PostApiV5TradeCancelOrderResponse, error)

ParsePostApiV5TradeCancelOrderResponse parses an HTTP response from a PostApiV5TradeCancelOrderWithResponse call

func (PostApiV5TradeCancelOrderResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeCancelOrderResponse) StatusCode

func (r PostApiV5TradeCancelOrderResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeClosePositionJSONBody

type PostApiV5TradeClosePositionJSONBody struct {
	// 可选<br>保证金币种,如:`USDT`。单币种保证金模式的全仓币币杠杆平仓必填
	Ccy *string `json:"ccy,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT-SWAP`
	InstId string `json:"instId"`

	// 必填<br>保证金模式。全仓:`cross`;逐仓:`isolated`
	MgnMode string `json:"mgnMode"`

	// 可选<br>持仓方向<br>单向持仓模式下:可不填写此参数,默认值`net`,如果填写,仅可以填写`net`<br>双向持仓模式下: 必须填写此参数,且仅可以填写 `long`:平多 ,`short`:平空
	PosSide *string `json:"posSide,omitempty"`
}

PostApiV5TradeClosePositionJSONBody defines parameters for PostApiV5TradeClosePosition.

type PostApiV5TradeClosePositionJSONRequestBody

type PostApiV5TradeClosePositionJSONRequestBody = PostApiV5TradeClosePositionJSONBody

PostApiV5TradeClosePositionJSONRequestBody defines body for PostApiV5TradeClosePosition for application/json ContentType.

type PostApiV5TradeClosePositionResponse

type PostApiV5TradeClosePositionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeClosePositionResponse

func ParsePostApiV5TradeClosePositionResponse(rsp *http.Response) (*PostApiV5TradeClosePositionResponse, error)

ParsePostApiV5TradeClosePositionResponse parses an HTTP response from a PostApiV5TradeClosePositionWithResponse call

func (PostApiV5TradeClosePositionResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeClosePositionResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeOrderAlgoJSONBody

type PostApiV5TradeOrderAlgoJSONBody struct {
	// 非必填<br>保证金币种,如:USDT<br>仅适用于单币种保证金模式下的全仓杠杆订单
	Ccy *string `json:"ccy,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 必填<br>订单类型。<br>`conditional`:单向止盈止损<br>`oco`:双向止盈止损<br>`trigger`:计划委托<br>`iceberg`:冰山委托<br>`twap`:时间加权委托
	OrdType string `json:"ordType"`

	// 非必填<br>委托价格<br>委托价格为-1时,执行市价委托<br>适用于`计划委托`
	OrderPx *string `json:"orderPx,omitempty"`

	// 可选<br>持仓方向<br>在双向持仓模式下必填,且仅可选择 `long` 或 `short`
	PosSide *string `json:"posSide,omitempty"`

	// 非必填<br>挂单限制价<br>适用于`冰山委托`和`时间加权委托`
	PxLimit *string `json:"pxLimit,omitempty"`

	// 非必填<br>距离盘口的比例价距<br>适用于`冰山委托`和`时间加权委托`
	PxSpread *string `json:"pxSpread,omitempty"`

	// 非必填<br>距离盘口的比例<br>pxVar和pxSpread只能传入一个<br>适用于`冰山委托`和`时间加权委托`
	PxVar *string `json:"pxVar,omitempty"`

	// 非必填<br>是否只减仓,`true` 或 `false`,默认`false`<br>仅适用于币币杠杆订单
	ReduceOnly *bool `json:"reduceOnly,omitempty"`

	// 必填<br>订单方向。买:`buy` 卖:`sell`
	Side string `json:"side"`

	// 非必填<br>止损委托价,如果填写此参数,必须填写止损触发价<br>委托价格为-1时,执行市价止损<br>适用于`止盈止损委托`
	SlOrdPx *string `json:"slOrdPx,omitempty"`

	// 非必填<br>止损触发价,如果填写此参数,必须填写止损委托价<br>适用于`止盈止损委托`
	SlTriggerPx *string `json:"slTriggerPx,omitempty"`

	// 必填<br>委托数量
	Sz string `json:"sz"`

	// 非必填<br>单笔数量<br>适用于`冰山委托`和`时间加权委托`
	SzLimit *string `json:"szLimit,omitempty"`

	// 必填<br>交易模式<br>保证金模式:`isolated`:逐仓 ;`cross`<br>全仓非保证金模式:`cash`:非保证金
	TdMode string `json:"tdMode"`

	// 非必填<br>市价单委托数量的类型<br>交易货币:`base_ccy`<br>计价货币:`quote_ccy`<br>仅适用于币币订单
	TgtCcy *string `json:"tgtCcy,omitempty"`

	// 非必填<br>挂单限制价<br>适用于`时间加权委托`
	TimeInterval *string `json:"timeInterval,omitempty"`

	// 非必填<br>止盈委托价,如果填写此参数,必须填写止盈触发价<br>委托价格为-1时,执行市价止盈<br>适用于`止盈止损委托`
	TpOrdPx *string `json:"tpOrdPx,omitempty"`

	// 非必填<br>止盈触发价,如果填写此参数,必须填写止盈委托价<br>适用于`止盈止损委托`
	TpTriggerPx *string `json:"tpTriggerPx,omitempty"`

	// 非必填<br>计划委托触发价格<br>适用于`计划委托`
	TriggerPx *string `json:"triggerPx,omitempty"`
}

PostApiV5TradeOrderAlgoJSONBody defines parameters for PostApiV5TradeOrderAlgo.

type PostApiV5TradeOrderAlgoJSONRequestBody

type PostApiV5TradeOrderAlgoJSONRequestBody = PostApiV5TradeOrderAlgoJSONBody

PostApiV5TradeOrderAlgoJSONRequestBody defines body for PostApiV5TradeOrderAlgo for application/json ContentType.

type PostApiV5TradeOrderAlgoResponse

type PostApiV5TradeOrderAlgoResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeOrderAlgoResponse

func ParsePostApiV5TradeOrderAlgoResponse(rsp *http.Response) (*PostApiV5TradeOrderAlgoResponse, error)

ParsePostApiV5TradeOrderAlgoResponse parses an HTTP response from a PostApiV5TradeOrderAlgoWithResponse call

func (PostApiV5TradeOrderAlgoResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeOrderAlgoResponse) StatusCode

func (r PostApiV5TradeOrderAlgoResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostApiV5TradeOrderJSONBody

type PostApiV5TradeOrderJSONBody struct {
	// 非必填<br>保证金币种,如:USDT<br>仅适用于单币种保证金模式下的全仓杠杆订单
	Ccy *string `json:"ccy,omitempty"`

	// 非必填<br>客户自定义订单ID<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字且长度要在1-32位之间。
	ClOrdId *string `json:"clOrdId,omitempty"`

	// 必填<br>产品ID,如:`BTC-USDT`
	InstId string `json:"instId"`

	// 必填<br>订单类型。<br>市价单:`market`<br>限价单:`limit`<br>只做maker单:`post_only`<br>全部成交或立即取消:`fok`<br>立即成交并取消剩余:`ioc`<br>市价委托立即成交并取消剩余:`optimal_limit_ioc`(仅适用交割、永续)
	OrdType string `json:"ordType"`

	// 可选<br>持仓方向<br>在双向持仓模式下必填,且仅可选择 `long` 或 `short`
	PosSide *string `json:"posSide,omitempty"`

	// 可选<br>委托价格<br>仅适用于`limit`、`post_only`、`fok`、`ioc`类型的订单
	Px *string `json:"px,omitempty"`

	// 非必填<br>是否只减仓,`true` 或 `false`,默认`false`<br>仅适用于币币杠杆订单
	ReduceOnly *bool `json:"reduceOnly,omitempty"`

	// 必填<br>订单方向。买:`buy` 卖:`sell`
	Side string `json:"side"`

	// 必填<br>委托数量
	Sz string `json:"sz"`

	// 非必填<br>订单标签<br>字母(区分大小写)与数字的组合,可以是纯字母、纯数字,且长度在1-8位之间。
	Tag *string `json:"tag,omitempty"`

	// 必填<br>交易模式<br>保证金模式:`isolated`:逐仓 ;`cross`<br>全仓非保证金模式:`cash`:非保证金
	TdMode string `json:"tdMode"`

	// 非必填<br>市价单委托数量的类型<br>交易货币:`base_ccy`<br>计价货币:`quote_ccy`<br>仅适用于币币订单
	TgtCcy *string `json:"tgtCcy,omitempty"`
}

PostApiV5TradeOrderJSONBody defines parameters for PostApiV5TradeOrder.

type PostApiV5TradeOrderJSONRequestBody

type PostApiV5TradeOrderJSONRequestBody = PostApiV5TradeOrderJSONBody

PostApiV5TradeOrderJSONRequestBody defines body for PostApiV5TradeOrder for application/json ContentType.

type PostApiV5TradeOrderResponse

type PostApiV5TradeOrderResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AdditionalProperties map[string]map[string]interface{} `json:"-"`
	}
}

func ParsePostApiV5TradeOrderResponse

func ParsePostApiV5TradeOrderResponse(rsp *http.Response) (*PostApiV5TradeOrderResponse, error)

ParsePostApiV5TradeOrderResponse parses an HTTP response from a PostApiV5TradeOrderWithResponse call

func (PostApiV5TradeOrderResponse) Status

Status returns HTTPResponse.Status

func (PostApiV5TradeOrderResponse) StatusCode

func (r PostApiV5TradeOrderResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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