Documentation ¶
Index ¶
- Constants
- func ComputeHmac256(Message string, sec_key string) string
- type ApiResponse
- type BaseWsResp
- type Mexc
- func (m *Mexc) CancelOrder(orderId string, currencyPair CurrencyPair) (bool, error)
- func (m *Mexc) CreateListerKey() (string, error)
- func (m *Mexc) GetAccount() (*Account, error)
- func (m *Mexc) GetBestTicker(currencyPair CurrencyPair) (*BestTicker, error)
- func (m *Mexc) GetCurrencyPairs() ([]CurrencyPair, error)
- func (m *Mexc) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)
- func (g *Mexc) GetExchangeName() string
- func (m *Mexc) GetKlineRecords(currencyPair CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error)
- func (m *Mexc) GetListerKey() (string, error)
- func (m *Mexc) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Order, error)
- func (m *Mexc) GetOrderHistorys(currencyPair CurrencyPair, optional ...OptionalParameter) ([]Order, error)
- func (m *Mexc) GetSubAccount(coin Currency) (*SubAccount, error)
- func (m *Mexc) GetSubAccounts() ([]SubAccount, error)
- func (m *Mexc) GetTicker(currencyPair CurrencyPair) (*Ticker, error)
- func (m *Mexc) GetTradeFee(currencyPair CurrencyPair) (*TradeFee, error)
- func (m *Mexc) GetTrades(currencyPair CurrencyPair, size int64) ([]Trade, error)
- func (m *Mexc) GetUnfinishOrders(currencyPair CurrencyPair) ([]Order, error)
- func (m *Mexc) LimitBuy(amount, price string, currencyPair CurrencyPair, ...) (*Order, error)
- func (m *Mexc) LimitSell(amount, price string, currencyPair CurrencyPair, ...) (*Order, error)
- func (m *Mexc) MarketBuy(amount, price string, currencyPair CurrencyPair) (*Order, error)
- func (m *Mexc) MarketSell(amount, price string, currencyPair CurrencyPair) (*Order, error)
- func (m *Mexc) PlaceOrder(amount, price string, currencyPair CurrencyPair, orderType, orderSide string) (*Order, error)
- func (m *Mexc) PrivateDelete(uri string, param url.Values) ([]byte, error)
- func (m *Mexc) PrivateGet(uri string, param url.Values) ([]byte, error)
- func (m *Mexc) PrivatePost(uri string, param url.Values) ([]byte, error)
- func (m *Mexc) PrivatePut(uri string, param url.Values) ([]byte, error)
- func (m *Mexc) PublicGet(uri string, param url.Values) ([]byte, error)
- func (m *Mexc) PutListerKey() (string, error)
- func (m *Mexc) ServerTime() float64
- type SpotWs
- func (s *SpotWs) BestTickerCallback(f func(ticker *gocoinex.BestTicker, exchange string))
- func (s *SpotWs) DepthCallback(f func(depth *gocoinex.Depth, exchange string))
- func (s *SpotWs) HeartbeatData() []byte
- func (s *SpotWs) SubscribeBestTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeDepth(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeTrade(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) SubscribeUserBalance() error
- func (s *SpotWs) SubscribeUserOrder() error
- func (s *SpotWs) TickerCallback(f func(ticker *gocoinex.Ticker, exchange string))
- func (s *SpotWs) TradeCallback(f func(trade *gocoinex.Trade, exchange string))
- func (s *SpotWs) UnSubscribeBestTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeDepth(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeTicker(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeTrade(pair gocoinex.CurrencyPair) error
- func (s *SpotWs) UnSubscribeUserBalance() error
- func (s *SpotWs) UnSubscribeUserOrder() error
- func (s *SpotWs) UserBalanceCallback(f func(trade *gocoinex.SubAccount, exchange string))
- func (s *SpotWs) UserOrderCallback(f func(ticker *gocoinex.Order, exchange string))
- type WsReq
- type WsSubscribeBaseResponse
Constants ¶
View Source
const ( ChannelSpotOrderBook = "/spotMarket/level2Depth5:" ChannelSpotTicker = "/market/ticker:" ChannelSpotPublicTrade = "/market/match:" )
spot channels
View Source
const ( Subscribe = "SUBSCRIPTION" UnSubscribe = "UNSUBSCRIPTION" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiResponse ¶
返回的数据结构
type BaseWsResp ¶
type Mexc ¶
type Mexc struct {
// contains filtered or unexported fields
}
func (*Mexc) CancelOrder ¶
func (*Mexc) GetAccount ¶
func (*Mexc) GetBestTicker ¶
func (*Mexc) GetExchangeName ¶
func (*Mexc) GetKlineRecords ¶
func (*Mexc) GetOneOrder ¶
func (*Mexc) GetOrderHistorys ¶
func (*Mexc) GetSubAccount ¶
func (*Mexc) GetSubAccounts ¶
func (*Mexc) GetTradeFee ¶
私有权限
func (*Mexc) GetUnfinishOrders ¶
查询指定交易对所有挂单
func (*Mexc) LimitBuy ¶
func (m *Mexc) LimitBuy(amount, price string, currencyPair CurrencyPair, optional ...LimitOrderOptionalParameter) (*Order, error)
限价买单
func (*Mexc) MarketSell ¶
func (*Mexc) PlaceOrder ¶
func (m *Mexc) PlaceOrder(amount, price string, currencyPair CurrencyPair, orderType, orderSide string) (*Order, error)
限价买单
func (*Mexc) PrivateDelete ¶
私有delete请求
func (*Mexc) PrivateGet ¶
私有get请求
func (*Mexc) PrivatePost ¶
私有post请求
func (*Mexc) PrivatePut ¶
私有put请求
func (*Mexc) ServerTime ¶
type SpotWs ¶
type SpotWs struct {
// contains filtered or unexported fields
}
func (*SpotWs) BestTickerCallback ¶
func (s *SpotWs) BestTickerCallback(f func(ticker *gocoinex.BestTicker, exchange string))
func (*SpotWs) DepthCallback ¶
func (*SpotWs) HeartbeatData ¶
func (*SpotWs) SubscribeBestTicker ¶
func (s *SpotWs) SubscribeBestTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeDepth ¶
func (s *SpotWs) SubscribeDepth(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeTicker ¶
func (s *SpotWs) SubscribeTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeTrade ¶
func (s *SpotWs) SubscribeTrade(pair gocoinex.CurrencyPair) error
func (*SpotWs) SubscribeUserBalance ¶
func (*SpotWs) SubscribeUserOrder ¶
func (*SpotWs) TickerCallback ¶
func (*SpotWs) TradeCallback ¶
func (*SpotWs) UnSubscribeBestTicker ¶
func (s *SpotWs) UnSubscribeBestTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeDepth ¶
func (s *SpotWs) UnSubscribeDepth(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeTicker ¶
func (s *SpotWs) UnSubscribeTicker(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeTrade ¶
func (s *SpotWs) UnSubscribeTrade(pair gocoinex.CurrencyPair) error
func (*SpotWs) UnSubscribeUserBalance ¶
func (*SpotWs) UnSubscribeUserOrder ¶
func (*SpotWs) UserBalanceCallback ¶
func (s *SpotWs) UserBalanceCallback(f func(trade *gocoinex.SubAccount, exchange string))
type WsSubscribeBaseResponse ¶
type WsSubscribeBaseResponse struct { Id string `json:"id"` Code string `json:"code"` Message string `json:"msg"` }
webSocket 请求结构
Click to show internal directories.
Click to hide internal directories.