Documentation
¶
Index ¶
- Constants
- type AccountsData
- type AccountsResponse
- type BaseResponse
- type BaseResponsePagination
- type FutureAccountData
- type FutureAccountResponse
- type FutureOrderCancelData
- type FutureOrderCancelResponse
- type FutureOrderData
- type FutureOrderFillsData
- type FutureOrderFillsItem
- type FutureOrderFillsRequest
- type FutureOrderFillsResponse
- type FutureOrderListData
- type FutureOrderListRequest
- type FutureOrderListResponse
- type FutureOrderOneData
- type FutureOrderOneResponse
- type FutureOrderRequest
- type FutureOrderResponse
- type FuturePositionData
- type FuturePositionResponse
- type FutureSymbolData
- type FutureSymbolResponse
- type KcSigner
- type Kucoin
- func (kc *Kucoin) FutureAccount(currency string) (*FutureAccountData, error)
- func (kc *Kucoin) FutureOrder(req *FutureOrderRequest) (*FutureOrderData, error)
- func (kc *Kucoin) FutureOrderCancel(orderId string) (*FutureOrderCancelData, error)
- func (kc *Kucoin) FutureOrderFills(req *FutureOrderFillsRequest, currentPage, pageSize int) (*FutureOrderFillsData, error)
- func (kc *Kucoin) FutureOrderList(req *FutureOrderListRequest, currentPage, pageSize int) (*FutureOrderListData, error)
- func (kc *Kucoin) FutureOrderOne(orderId string) (*FutureOrderOneData, error)
- func (kc *Kucoin) FuturePosition(symbol string) (*FuturePositionData, error)
- func (kc *Kucoin) FutureSymbols() ([]FutureSymbolData, error)
- func (kc *Kucoin) Set(options ...Option) error
- func (kc *Kucoin) SpotAccount(currency, _type string) ([]AccountsData, error)
- func (kc *Kucoin) SpotMarginOrder(req *SpotMarginOrderRequest) (*SpotMarginOrderData, error)
- func (kc *Kucoin) SpotOrder(req *SpotOrdersRequest) (*SpotOrderData, error)
- func (kc *Kucoin) SpotOrderCancel(orderId string) (*SpotOrderCancelData, error)
- func (kc *Kucoin) SpotOrderFills(req *SpotOrderFillsRequest, currentPage, pageSize int) (*SpotOrderFillsData, error)
- func (kc *Kucoin) SpotOrderList(req *SpotOrderListRequest, currentPage, pageSize int) (*SpotOrderListData, error)
- func (kc *Kucoin) SpotOrderOne(orderId string) (*SpotOrderOneData, error)
- func (kc *Kucoin) SpotSymbols(market string) ([]SymbolsData, error)
- type Option
- func SetApiKey(accessKey, secretKey, passphrase string) Option
- func SetClient(client *http.Client) Option
- func SetDebug(debug bool) Option
- func SetFutureEndpoint(futureEndpoint string) Option
- func SetRequestLog(l func(...interface{})) Option
- func SetResponseLog(l func(...interface{})) Option
- func SetSpotEndpoint(spotEndpoint string) Option
- type Sha256Signer
- type Signer
- type SpotMarginOrderData
- type SpotMarginOrderRequest
- type SpotMarginOrderResponse
- type SpotOrderCancelData
- type SpotOrderCancelResponse
- type SpotOrderData
- type SpotOrderFillsData
- type SpotOrderFillsItem
- type SpotOrderFillsRequest
- type SpotOrderFillsResponse
- type SpotOrderListData
- type SpotOrderListRequest
- type SpotOrderListResponse
- type SpotOrderOneData
- type SpotOrderOneResponse
- type SpotOrderResponse
- type SpotOrdersRequest
- type SymbolsData
- type SymbolsResponse
Constants ¶
const ( UriSpotSymbols = "/api/v2/symbols" UriSpotAccount = "/api/v1/accounts" UriSpotOrders = "/api/v1/orders" UriSpotMarginOrder = "/api/v1/margin/order" UriSpotOrderFills = "/api/v1/fills" UriSpotOrderCancel = "/api/v1/orders/%s" UriSpotOrderOne = "/api/v1/orders/%s" UriFutureAccount = "/api/v1/account-overview" UriFutureOrders = "/api/v1/orders" UriFutureOrderCancel = "/api/v1/orders/%s" UriFutureOrderOne = "/api/v1/orders/%s" UriFutureOrderFills = "/api/v1/fills" UriFuturePosition = "/api/v1/position" UriFutureSymbols = "/api/v1/contracts/active" )
URI
const ApiKeyVersionV2 = "2"
const FutureEndpoint = "https://api-futures.kucoin.com"
const SpotEndpoint = "https://api.kucoin.com"
SpotEndpoint Base URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountsData ¶
type AccountsResponse ¶
type AccountsResponse struct { BaseResponse Data []AccountsData `json:"data"` }
AccountsResponse Response of GET /api/v2/accounts
type BaseResponse ¶
type BaseResponsePagination ¶
type FutureAccountData ¶
type FutureAccountData struct { AccountEquity decimal.Decimal `json:"accountEquity"` // Account equity = marginBalance + Unrealised PNL UnrealisedPNL decimal.Decimal `json:"unrealisedPNL"` // Unrealised profit and loss MarginBalance decimal.Decimal `json:"marginBalance"` // Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL PositionMargin decimal.Decimal `json:"positionMargin"` OrderMargin decimal.Decimal `json:"orderMargin"` FrozenFunds decimal.Decimal `json:"frozenFunds"` // Frozen funds for withdrawal and out-transfer AvailableBalance decimal.Decimal `json:"availableBalance"` Currency string `json:"currency"` }
type FutureAccountResponse ¶
type FutureAccountResponse struct { BaseResponse Data FutureAccountData `json:"data"` }
FutureAccountResponse Response of GET /api/v1/account-overview
type FutureOrderCancelData ¶
type FutureOrderCancelData struct {
CancelledOrderIds []string `json:"cancelledOrderIds"`
}
type FutureOrderCancelResponse ¶
type FutureOrderCancelResponse struct { BaseResponse Data FutureOrderCancelData `json:"data"` }
FutureOrderCancelResponse Response of DELETE /api/v1/orders/{orderId}
type FutureOrderData ¶
type FutureOrderData struct {
OrderId string `json:"orderId"`
}
type FutureOrderFillsData ¶
type FutureOrderFillsData struct { BaseResponsePagination Items []FutureOrderFillsItem `json:"items"` }
type FutureOrderFillsItem ¶
type FutureOrderFillsItem struct { Symbol string `json:"symbol"` TradeId string `json:"tradeId"` OrderId string `json:"orderId"` Side string `json:"side"` Liquidity string `json:"liquidity"` ForceTaker bool `json:"forceTaker"` Price decimal.Decimal `json:"price"` Size int `json:"size"` // Cont Value decimal.Decimal `json:"value"` FeeRate decimal.Decimal `json:"feeRate"` FixFee decimal.Decimal `json:"fixFee"` FeeCurrency string `json:"feeCurrency"` Stop string `json:"stop"` Fee decimal.Decimal `json:"fee"` OrderType string `json:"orderType"` TradeType string `json:"tradeType"` // trade, liquidation, ADL or settlement CreatedAt int64 `json:"createdAt"` SettleCurrency string `json:"settleCurrency"` TradeTime int64 `json:"tradeTime"` }
type FutureOrderFillsRequest ¶
type FutureOrderFillsRequest struct { OrderId string `json:"orderId,omitempty"` // If you specify orderId, other parameters can be ignored Symbol string `json:"symbol,omitempty"` Side string `json:"side,omitempty"` // buy or sell Type string `json:"type,omitempty"` // limit, market, limit_stop or market_stop StartAt int64 `json:"startAt,omitempty"` // Start time (millisecond) EndAt int64 `json:"endAt,omitempty"` // End time (millisecond) }
FutureOrderFillsRequest Request of GET /api/v1/fills
type FutureOrderFillsResponse ¶
type FutureOrderFillsResponse struct { BaseResponse Data FutureOrderFillsData `json:"data"` }
FutureOrderFillsResponse Response of GET /api/v1/fills
type FutureOrderListData ¶
type FutureOrderListData struct { BaseResponsePagination Items []FutureOrderOneData `json:"items"` }
type FutureOrderListRequest ¶
type FutureOrderListRequest struct { Status string `json:"status"` // [Optional] active or done Symbol string `json:"symbol"` // [Optional] Side string `json:"side"` // [Optional] buy or sell Type string `json:"type"` // [Optional] limit, market, limit_stop or market_stop StartAt int64 `json:"startAt"` // [Optional] Start time (millisecond) EndAt int64 `json:"endAt"` // [Optional] End time (millisecond) }
FutureOrderListRequest Request of GET /api/v1/orders
type FutureOrderListResponse ¶
type FutureOrderListResponse struct { BaseResponse Data FutureOrderListData `json:"data"` }
FutureOrderListResponse Response of GET /api/v1/orders
type FutureOrderOneData ¶
type FutureOrderOneData struct { Id string `json:"id"` Symbol string `json:"symbol"` Type string `json:"type"` Side string `json:"side"` Price decimal.Decimal `json:"price"` Size int `json:"size"` // Cont Value decimal.Decimal `json:"value"` DealValue decimal.Decimal `json:"dealValue"` DealSize decimal.Decimal `json:"dealSize"` Stp string `json:"stp"` Stop string `json:"stop"` StopPriceType string `json:"stopPriceType"` StopTriggered bool `json:"stopTriggered"` StopPrice decimal.Decimal `json:"stopPrice"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` Leverage decimal.Decimal `json:"leverage"` ForceHold bool `json:"forceHold"` CloseOrder bool `json:"closeOrder"` VisibleSize decimal.Decimal `json:"visibleSize"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` IsActive bool `json:"isActive"` CancelExist bool `json:"cancelExist"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"UpdatedAt"` EndAt int64 `json:"endAt"` OrderTime int64 `json:"orderTime"` SettleCurrency string `json:"SettleCurrency"` Status string `json:"status"` FilledSize decimal.Decimal `json:"filledSize"` FilledValue decimal.Decimal `json:"filledValue"` ReduceOnly bool `json:"reduceOnly"` }
type FutureOrderOneResponse ¶
type FutureOrderOneResponse struct { BaseResponse Data FutureOrderOneData `json:"data"` }
FutureOrderOneResponse Response of GET /api/v1/orders/{order-id}
type FutureOrderRequest ¶
type FutureOrderRequest struct { ClientOid string `json:"clientOid,omitempty"` Side string `json:"side,omitempty"` // buy or sell Symbol string `json:"symbol,omitempty"` // e.g. BTC-USDT Type string `json:"type,omitempty"` // limit or market Leverage decimal.Decimal `json:"leverage,omitempty"` Remark string `json:"remark,omitempty"` Stop string `json:"stop,omitempty"` StopPriceType string `json:"stopPriceType,omitempty"` // TP, IP or MP StopPrice decimal.Decimal `json:"stopPrice,omitempty"` ReduceOnly bool `json:"reduceOnly,omitempty"` CloseOrder bool `json:"closeOrder,omitempty"` ForceHold bool `json:"forceHold,omitempty"` Price decimal.Decimal `json:"price,omitempty"` Size int `json:"size,omitempty"` // Cont TimeInForce string `json:"timeInForce,omitempty"` // GTC, GTT, IOC or FOK PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` VisibleSize string `json:"visibleSize,omitempty"` }
FutureOrderRequest Request of POST /api/v1/orders
type FutureOrderResponse ¶
type FutureOrderResponse struct { BaseResponse Data FutureOrderData `json:"data"` }
FutureOrderResponse Response of POST /api/v1/orders
type FuturePositionData ¶
type FuturePositionData struct { Id string `json:"id"` Symbol string `json:"symbol"` AutoDeposit bool `json:"autoDeposit"` MaintMarginReq decimal.Decimal `json:"maintMarginReq"` RiskLimit int `json:"riskLimit"` RealLeverage decimal.Decimal `json:"realLeverage"` CrossMode bool `json:"crossMode"` DelevPercentage decimal.Decimal `json:"delevPercentage"` OpeningTimestamp int64 `json:"openingTimestamp"` CurrentTimestamp int64 `json:"currentTimestamp"` CurrentQty int `json:"currentQty"` CurrentCost decimal.Decimal `json:"currentCost"` CurrentComm decimal.Decimal `json:"currentComm"` UnrealisedCost decimal.Decimal `json:"unrealisedCost"` RealisedGrossCost decimal.Decimal `json:"realisedGrossCost"` RealisedCost decimal.Decimal `json:"realisedCost"` IsOpen bool `json:"isOpen"` MarkPrice decimal.Decimal `json:"markPrice"` MarkValue decimal.Decimal `json:"markValue"` PosCost decimal.Decimal `json:"posCost"` PosCross decimal.Decimal `json:"posCross"` PosInit decimal.Decimal `json:"posInit"` PosComm decimal.Decimal `json:"posComm"` PosLoss decimal.Decimal `json:"posLoss"` PosMargin decimal.Decimal `json:"posMargin"` PosMaint decimal.Decimal `json:"posMaint"` MaintMargin decimal.Decimal `json:"maintMargin"` RealisedGrossPnl decimal.Decimal `json:"realisedGrossPnl"` RealisedPnl decimal.Decimal `json:"realisedPnl"` UnrealisedPnl decimal.Decimal `json:"unrealisedPnl"` UnrealisedPnlPcnt decimal.Decimal `json:"unrealisedPnlPcnt"` UnrealisedRoePcnt decimal.Decimal `json:"unrealisedRoePcnt"` AvgEntryPrice decimal.Decimal `json:"avgEntryPrice"` LiquidationPrice decimal.Decimal `json:"liquidationPrice"` BankruptPrice decimal.Decimal `json:"bankruptPrice"` SettleCurrency string `json:"settleCurrency"` MaintainMargin decimal.Decimal `json:"maintainMargin"` RiskLimitLevel int `json:"riskLimitLevel"` }
type FuturePositionResponse ¶
type FuturePositionResponse struct { BaseResponse Data FuturePositionData `json:"data"` }
FuturePositionResponse Response of /api/v1/position
type FutureSymbolData ¶
type FutureSymbolData struct { Symbol string `json:"symbol"` RootSymbol string `json:"rootSymbol"` Type string `json:"type"` FirstOpenDate int64 `json:"firstOpenDate"` ExpireDate interface{} `json:"expireDate"` SettleDate interface{} `json:"settleDate"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` SettleCurrency string `json:"settleCurrency"` MaxOrderQty decimal.Decimal `json:"maxOrderQty"` MaxPrice decimal.Decimal `json:"maxPrice"` LotSize decimal.Decimal `json:"lotSize"` TickSize decimal.Decimal `json:"tickSize"` IndexPriceTickSize decimal.Decimal `json:"indexPriceTickSize"` Multiplier decimal.Decimal `json:"multiplier"` InitialMargin decimal.Decimal `json:"initialMargin"` MaintainMargin decimal.Decimal `json:"maintainMargin"` MaxRiskLimit decimal.Decimal `json:"maxRiskLimit"` MinRiskLimit decimal.Decimal `json:"minRiskLimit"` RiskStep decimal.Decimal `json:"riskStep"` MakerFeeRate decimal.Decimal `json:"makerFeeRate"` TakerFeeRate decimal.Decimal `json:"takerFeeRate"` TakerFixFee decimal.Decimal `json:"takerFixFee"` MakerFixFee decimal.Decimal `json:"makerFixFee"` SettlementFee decimal.Decimal `json:"settlementFee"` IsDeleverage bool `json:"isDeleverage"` IsQuanto bool `json:"isQuanto"` IsInverse bool `json:"isInverse"` MarkMethod string `json:"markMethod"` FairMethod string `json:"fairMethod"` FundingBaseSymbol string `json:"fundingBaseSymbol"` FundingQuoteSymbol string `json:"fundingQuoteSymbol"` FundingRateSymbol string `json:"fundingRateSymbol"` IndexSymbol string `json:"indexSymbol"` SettlementSymbol string `json:"settlementSymbol"` Status string `json:"status"` FundingFeeRate decimal.Decimal `json:"fundingFeeRate"` PredictedFundingFeeRate decimal.Decimal `json:"predictedFundingFeeRate"` OpenInterest decimal.Decimal `json:"openInterest"` TurnoverOf24H decimal.Decimal `json:"turnoverOf24h"` VolumeOf24H decimal.Decimal `json:"volumeOf24h"` MarkPrice decimal.Decimal `json:"markPrice"` IndexPrice decimal.Decimal `json:"indexPrice"` LastTradePrice decimal.Decimal `json:"lastTradePrice"` NextFundingRateTime decimal.Decimal `json:"nextFundingRateTime"` MaxLeverage decimal.Decimal `json:"maxLeverage"` SourceExchanges []string `json:"sourceExchanges"` PremiumsSymbol1M string `json:"premiumsSymbol1M"` PremiumsSymbol8H string `json:"premiumsSymbol8H"` FundingBaseSymbol1M string `json:"fundingBaseSymbol1M"` FundingQuoteSymbol1M string `json:"fundingQuoteSymbol1M"` LowPrice decimal.Decimal `json:"lowPrice"` HighPrice decimal.Decimal `json:"highPrice"` PriceChgPct decimal.Decimal `json:"priceChgPct"` PriceChg decimal.Decimal `json:"priceChg"` }
type FutureSymbolResponse ¶
type FutureSymbolResponse struct { BaseResponse Data []FutureSymbolData `json:"data"` }
FutureSymbolResponse Response of /api/v1/contracts/active
type KcSigner ¶
type KcSigner struct { Sha256Signer // contains filtered or unexported fields }
KcSigner is the implement of Signer for KuCoin.
func NewKcSignerV2 ¶
NewKcSignerV2 creates a instance of KcSigner.
type Kucoin ¶
type Kucoin struct {
// contains filtered or unexported fields
}
func (*Kucoin) FutureAccount ¶
func (kc *Kucoin) FutureAccount(currency string) (*FutureAccountData, error)
FutureAccount GET /api/v1/account-overview
func (*Kucoin) FutureOrder ¶
func (kc *Kucoin) FutureOrder(req *FutureOrderRequest) (*FutureOrderData, error)
FutureOrder POST /api/v1/orders
func (*Kucoin) FutureOrderCancel ¶
func (kc *Kucoin) FutureOrderCancel(orderId string) (*FutureOrderCancelData, error)
FutureOrderCancel DELETE /api/v1/orders/{orderId}
func (*Kucoin) FutureOrderFills ¶
func (kc *Kucoin) FutureOrderFills(req *FutureOrderFillsRequest, currentPage, pageSize int) (*FutureOrderFillsData, error)
FutureOrderFills GET /api/v1/fills
func (*Kucoin) FutureOrderList ¶
func (kc *Kucoin) FutureOrderList(req *FutureOrderListRequest, currentPage, pageSize int) (*FutureOrderListData, error)
FutureOrderList GET /api/v1/orders
func (*Kucoin) FutureOrderOne ¶
func (kc *Kucoin) FutureOrderOne(orderId string) (*FutureOrderOneData, error)
FutureOrderOne GET /api/v1/orders/{orderId}
func (*Kucoin) FuturePosition ¶
func (kc *Kucoin) FuturePosition(symbol string) (*FuturePositionData, error)
FuturePosition GET /api/v1/position
func (*Kucoin) FutureSymbols ¶
func (kc *Kucoin) FutureSymbols() ([]FutureSymbolData, error)
FutureSymbols GET /api/v1/contracts/active
func (*Kucoin) SpotAccount ¶
func (kc *Kucoin) SpotAccount(currency, _type string) ([]AccountsData, error)
SpotAccount GET /api/v1/accounts
func (*Kucoin) SpotMarginOrder ¶
func (kc *Kucoin) SpotMarginOrder(req *SpotMarginOrderRequest) (*SpotMarginOrderData, error)
SpotMarginOrder POST /api/v1/margin/order
func (*Kucoin) SpotOrder ¶
func (kc *Kucoin) SpotOrder(req *SpotOrdersRequest) (*SpotOrderData, error)
SpotOrder POST /api/v1/orders
func (*Kucoin) SpotOrderCancel ¶
func (kc *Kucoin) SpotOrderCancel(orderId string) (*SpotOrderCancelData, error)
SpotOrderCancel DELETE /api/v1/orders/{orderId}
func (*Kucoin) SpotOrderFills ¶
func (kc *Kucoin) SpotOrderFills(req *SpotOrderFillsRequest, currentPage, pageSize int) (*SpotOrderFillsData, error)
SpotOrderFills GET /api/v1/fills
func (*Kucoin) SpotOrderList ¶
func (kc *Kucoin) SpotOrderList(req *SpotOrderListRequest, currentPage, pageSize int) (*SpotOrderListData, error)
SpotOrderList GET /api/v1/orders
func (*Kucoin) SpotOrderOne ¶
func (kc *Kucoin) SpotOrderOne(orderId string) (*SpotOrderOneData, error)
SpotOrderOne GET /api/v1/orders/{orderId}
func (*Kucoin) SpotSymbols ¶
func (kc *Kucoin) SpotSymbols(market string) ([]SymbolsData, error)
SpotSymbols GET /api/v2/symbols
type Option ¶
func SetFutureEndpoint ¶
SetFutureEndpoint Use the specified base URL to access the Kucoin future API interface
func SetRequestLog ¶
func SetRequestLog(l func(...interface{})) Option
SetRequestLog Set the HTTP request log printing method. Set debug to true for it to work
func SetResponseLog ¶
func SetResponseLog(l func(...interface{})) Option
SetResponseLog Set the HTTP response log printing method. Set debug to true for it to work
func SetSpotEndpoint ¶
SetSpotEndpoint Use the specified base URL to access the Kucoin spot API interface
type Sha256Signer ¶
type Sha256Signer struct {
// contains filtered or unexported fields
}
Sha256Signer is the sha256 Signer.
func (*Sha256Signer) Sign ¶
func (ss *Sha256Signer) Sign(plain []byte) []byte
Sign makes a signature by sha256.
type SpotMarginOrderData ¶
type SpotMarginOrderRequest ¶
type SpotMarginOrderRequest struct { ClientOid string `json:"clientOid,omitempty"` Side string `json:"side,omitempty"` // buy or sell Symbol string `json:"symbol,omitempty"` // e.g. BTC-USDT Type string `json:"type,omitempty"` // limit or market Remark string `json:"remark,omitempty"` Stp string `json:"stp,omitempty"` // CN, CO, CB or DC MarginModel string `json:"marginModel"` // cross or isolated AutoBorrow bool `json:"autoBorrow"` Price decimal.Decimal `json:"price,omitempty"` Size decimal.Decimal `json:"size,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` // GTC, GTT, IOC or FOK CancelAfter int64 `json:"cancelAfter,omitempty"` PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` VisibleSize string `json:"visibleSize,omitempty"` Funds string `json:"funds,omitempty"` // MARKET order only, It is required that you use one of the two parameters, size or funds. }
SpotMarginOrderRequest Request of POST /api/v1/margin/order
type SpotMarginOrderResponse ¶
type SpotMarginOrderResponse struct { BaseResponse Data SpotMarginOrderData `json:"data"` }
SpotMarginOrderResponse Response of POST /api/v1/margin/order
type SpotOrderCancelData ¶
type SpotOrderCancelData struct {
CancelledOrderIds []string `json:"cancelledOrderIds"`
}
type SpotOrderCancelResponse ¶
type SpotOrderCancelResponse struct { BaseResponse Data SpotOrderCancelData `json:"data"` }
SpotOrderCancelResponse Response of DELETE /api/v1/orders/{orderId}
type SpotOrderData ¶
type SpotOrderData struct {
OrderId string `json:"orderId"`
}
type SpotOrderFillsData ¶
type SpotOrderFillsData struct { BaseResponsePagination Items []SpotOrderFillsItem `json:"items"` }
type SpotOrderFillsItem ¶
type SpotOrderFillsItem struct { Symbol string `json:"symbol"` TradeId string `json:"tradeId"` OrderId string `json:"orderId"` CounterOrderId string `json:"counterOrderId"` Side string `json:"side"` Liquidity string `json:"liquidity"` ForceTaker bool `json:"forceTaker"` Price decimal.Decimal `json:"price"` Size decimal.Decimal `json:"size"` Funds decimal.Decimal `json:"funds"` Fee decimal.Decimal `json:"fee"` FeeRate decimal.Decimal `json:"feeRate"` FeeCurrency string `json:"feeCurrency"` Stop string `json:"stop"` Type string `json:"type"` CreatedAt int64 `json:"createdAt"` TradeType string `json:"tradeType"` }
type SpotOrderFillsRequest ¶
type SpotOrderFillsRequest struct { OrderId string `json:"orderId,omitempty"` // If you specify orderId, other parameters can be ignored Symbol string `json:"symbol,omitempty"` Side string `json:"side,omitempty"` // buy or sell Type string `json:"type,omitempty"` // limit, market, limit_stop or market_stop StartAt int64 `json:"startAt,omitempty"` // Start time (millisecond) EndAt int64 `json:"endAt,omitempty"` // End time (millisecond) TradeType string `json:"tradeType,omitempty"` // TRADE(Spot Trading), MARGIN_TRADE (Margin Trading), TRADE as default. }
SpotOrderFillsRequest Request of GET /api/v1/fills
type SpotOrderFillsResponse ¶
type SpotOrderFillsResponse struct { BaseResponse Data SpotOrderFillsData `json:"data"` }
SpotOrderFillsResponse Response of GET /api/v1/fills
type SpotOrderListData ¶
type SpotOrderListData struct { BaseResponsePagination Items []SpotOrderOneData `json:"items"` }
type SpotOrderListRequest ¶
type SpotOrderListRequest struct { Status string `json:"status"` // [Optional] active or done Symbol string `json:"symbol"` // [Optional] Side string `json:"side"` // [Optional] buy or sell Type string `json:"type"` // [Optional] limit, market, limit_stop or market_stop TradeType string `json:"tradeType"` // TRADE, MARGIN_TRADE or MARGIN_ISOLATED_TRADE StartAt int64 `json:"startAt"` // [Optional] Start time (millisecond) EndAt int64 `json:"endAt"` // [Optional] End time (millisecond) }
SpotOrderListRequest Request of GET /api/v1/orders
type SpotOrderListResponse ¶
type SpotOrderListResponse struct { BaseResponse Data SpotOrderListData `json:"data"` }
SpotOrderListResponse Response of GET /api/v1/orders
type SpotOrderOneData ¶
type SpotOrderOneData struct { Id string `json:"id"` Symbol string `json:"symbol"` OpType string `json:"opType"` Type string `json:"type"` Side string `json:"side"` Price decimal.Decimal `json:"price"` Size decimal.Decimal `json:"size"` Funds decimal.Decimal `json:"funds"` DealFunds decimal.Decimal `json:"dealFunds"` DealSize decimal.Decimal `json:"dealSize"` Fee decimal.Decimal `json:"fee"` FeeCurrency string `json:"feeCurrency"` Stp string `json:"stp"` Stop string `json:"stop"` StopTriggered bool `json:"stopTriggered"` StopPrice decimal.Decimal `json:"stopPrice"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` VisibleSize decimal.Decimal `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 SpotOrderOneResponse ¶
type SpotOrderOneResponse struct { BaseResponse Data SpotOrderOneData `json:"data"` }
SpotOrderOneResponse Response of GET /api/v1/orders/{order-id}
type SpotOrderResponse ¶
type SpotOrderResponse struct { BaseResponse Data SpotOrderData `json:"data"` }
SpotOrderResponse Response of POST /api/v1/orders
type SpotOrdersRequest ¶
type SpotOrdersRequest struct { ClientOid string `json:"clientOid,omitempty"` Side string `json:"side,omitempty"` // buy or sell Symbol string `json:"symbol,omitempty"` // e.g. BTC-USDT Type string `json:"type,omitempty"` // limit or market Remark string `json:"remark,omitempty"` Stp string `json:"stp,omitempty"` TradeType string `json:"tradeType,omitempty"` Price decimal.Decimal `json:"price,omitempty"` Size decimal.Decimal `json:"size,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` // GTC, GTT, IOC or FOK CancelAfter int64 `json:"cancelAfter,omitempty"` PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` VisibleSize string `json:"visibleSize,omitempty"` Funds string `json:"funds,omitempty"` // MARKET order only, It is required that you use one of the two parameters, size or funds. }
SpotOrdersRequest Request of POST /api/v1/orders
type SymbolsData ¶
type SymbolsData struct { Symbol string `json:"symbol"` Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` FeeCurrency string `json:"feeCurrency"` Market string `json:"market"` BaseMinSize decimal.Decimal `json:"baseMinSize"` QuoteMinSize decimal.Decimal `json:"quoteMinSize"` BaseMaxSize decimal.Decimal `json:"baseMaxSize"` QuoteMaxSize decimal.Decimal `json:"quoteMaxSize"` BaseIncrement decimal.Decimal `json:"baseIncrement"` QuoteIncrement decimal.Decimal `json:"quoteIncrement"` PriceIncrement decimal.Decimal `json:"priceIncrement"` PriceLimitRate decimal.Decimal `json:"priceLimitRate"` MinFunds decimal.Decimal `json:"minFunds"` IsMarginEnabled bool `json:"isMarginEnabled"` EnableTrading bool `json:"enableTrading"` }
type SymbolsResponse ¶
type SymbolsResponse struct { BaseResponse Data []SymbolsData `json:"data"` }
SymbolsResponse Response of GET /api/v2/symbols