Documentation ¶
Index ¶
- type Balance
- type Client
- func (c *Client) CancelOrder(req global.CancelReq) error
- func (c *Client) DepositAddr(currency string) (string, error)
- func (c *Client) DepositsWithdrawals() ([]DWInfo, []DWInfo, error)
- func (c *Client) GetAllSymbol() ([]global.TradeSymbol, error)
- func (c *Client) GetDepth(sreq global.TradeSymbol) (global.Depth, error)
- func (c *Client) GetFund(global.FundReq) ([]global.Fund, error)
- func (c *Client) GetKline(req global.KlineReq) ([]global.Kline, error)
- func (c *Client) HangingOrderInfo() ([]HangingOrder, error)
- func (c *Client) InsertOrder(req global.InsertReq) (global.InsertRsp, error)
- func (c *Client) LateTradeInfo(base, quote string) ([]LateTrade, error)
- func (c *Client) MatchInfo(symbol, orderNo string) ([]Match, error)
- func (c *Client) OrderStatus(req global.StatusReq) (global.StatusRsp, error)
- func (c *Client) SetLogger(logger core.Logger)
- func (c *Client) SubDepth(sreq global.TradeSymbol) (chan global.Depth, error)
- func (c *Client) SubLateTrade(sreq global.TradeSymbol) (chan global.LateTrade, error)
- func (c *Client) SubTicker(sreq global.TradeSymbol) (chan global.Ticker, error)
- func (c *Client) TickerInfo(base, quote string) (TickerResponse, error)
- func (c *Client) Withdraws(currency, address string, num float64) error
- type DWInfo
- type Depth5
- type HangingOrder
- type InsertOrderRsp
- type Kline
- type LateTrade
- type MarketListResponse
- type Match
- type OrderInfo
- type PSpair
- type TickerResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 提供gate API的调用客户端
func (*Client) CancelOrder ¶
CancelOrder 取消订单 通过测试,第一个参数对结果没有影响,只要orderno正确就能取消订单, 但是如果第一个参数填入错误的代码将返回错误,但是订单依然被取消了
func (*Client) DepositAddr ¶
DepositAddr 获取充值地址
func (*Client) DepositsWithdrawals ¶
DepositsWithdrawals 获取充值提现历史 return1 充值, return2 提现
func (*Client) GetAllSymbol ¶
func (c *Client) GetAllSymbol() ([]global.TradeSymbol, error)
GetAllSymbol 交易市场详细行情接口
func (*Client) HangingOrderInfo ¶
func (c *Client) HangingOrderInfo() ([]HangingOrder, error)
HangingOrderInfo 获取我的当前挂单列表
func (*Client) InsertOrder ¶
InsertOrder 下单交易 @parm direction 0 - buy, 1 - sell @parm price 买卖价格 ps: minimum 10 usdt. @parm num 买卖币数量
func (*Client) LateTradeInfo ¶
LateTradeInfo 获取最近80条成交
func (*Client) OrderStatus ¶
OrderStatus 获取订单状态
func (*Client) SubLateTrade ¶
SubLateTrade 查询交易详细数据
func (*Client) TickerInfo ¶
func (c *Client) TickerInfo(base, quote string) (TickerResponse, error)
TickerInfo 获取行情ticker
type DWInfo ¶
type DWInfo struct { ID string `json:"id"` Currency string `json:"currency"` Address string `json:"address"` Amount string `json:"amount"` Txid string `json:"txid"` Timestamp string `json:"timestamp"` Status string `json:"status"` //DONE:完成; CANCEL:取消; REQUEST:请求中 }
DWInfo ...
type Depth5 ¶
type Depth5 struct { Base string `json:"base"` Quote string `json:"quote"` Asks []PSpair `json:"asks"` // 卖方 Bids []PSpair `json:"bids"` // 买方 }
Depth5 ...
type HangingOrder ¶
type HangingOrder struct { LeftNum string `json:"amount"` // 订单总数量 剩余未成交数量 Symbol string `json:"currencyPair"` // 订单交易对 TradeNum string `json:"filledAmount"` // 已成交量 TradePrice string `json:"filledRate"` // 成交价格 InsertNum string `json:"initialAmount"` // 下单量 InsertPrice string `json:"initialRate"` // 下单价格 OrderNo string `json:"orderNumber"` // 订单号 Price string `json:"rate"` // 交易单价 Status string `json:"status"` // 订单状态 Timestamp string `json:"timestamp"` // 时间戳 Total string `json:"total"` //总计 Direction string `json:"type"` // 买卖类型 buy:买入;sell:卖出 }
HangingOrder ...
type InsertOrderRsp ¶
type InsertOrderRsp struct { Result string `json:"result"` // "true" 表示调用成功 OrderNo string `json:"orderNumber"` // orderNumber可用于查询,取消订单。 InsertPrice float64 `json:"rate"` Direction int `json:"_"` LeftNum float64 `json:"leftAmount"` FilledNum float64 `json:"filledAmount"` FilledPrice float64 `json:"filledRate"` Msg string `json:"message"` }
InsertOrderRsp ...
type Kline ¶
type Kline struct { Base string Quote string Timestamp float64 // 时间戳 Volume float64 // 交易量 Close float64 // 收盘价 High float64 // 最高价 Low float64 // 最低价 Open float64 // 开盘价 }
Kline k线数据
type LateTrade ¶
type LateTrade struct { Base string Quote string DateTime string `json:"date"` // 订单时间 Num float64 `json:"amount"` // 成交币种数量 Price float64 `json:"rate"` // 币种单价 Dircetion string `json:"type"` // 买卖类型, buy买 sell卖 Total float64 `json:"total"` // 订单总额 }
LateTrade 最近成交记录
type MarketListResponse ¶
type MarketListResponse struct { No int `json:"no"` Symbol string `json:"symbol"` Name string `json:"name"` NameEn string `json:"name_en"` NameCn string `json:"name_cn"` Pair string `json:"pair"` Rate string `json:"rate"` VolA float64 `json:"vol_a"` VolB string `json:"vol_b"` CurrA string `json:"curr_a"` CurrB string `json:"curr_b"` CurrSuffix string `json:"curr_suffix"` RatePercent string `json:"rate_percent"` Trend string `json:"trend"` Supply int64 `json:"supply"` MarketCap string `json:"marketcap"` }
MarketListResponse 是MarketList接口的返回值
type Match ¶
type Match struct { OrderNo string `json:"orderid"` // 订单id Symbol string `json:"pair"` // 交易对 Direction string `json:"type"` // 买卖类型 TradePrice string `json:"rate"` // 买卖价格 TradeNum string `json:"amount"` // 订单买卖币种数量 //TradeTime string `json:"time"` // 订单时间 TradeTime string `json:"time_unix"` // 订单unix时间戳 }
Match ...
type OrderInfo ¶
type OrderInfo struct { OrderNo string `json:"orderNumber"` // Status string `json:"status"` // 订单状态 cancelled已取消 done已完成 Symbol string `json:"currencyPair"` // 交易对 Dircetion string `json:"type"` //买卖类型 sell卖出, buy买入 TradePrice float64 `json:"rate"` //价格 TradeNum string `json:"amount"` //买卖数量 InsertPrice float64 `json:"initialRate"` //下单价格 InsertNum string `json:"initialAmount"` //下单量 }
OrderInfo ...
type TickerResponse ¶
type TickerResponse struct { Base string `json:"base"` Quote string `json:"quote"` BaseVolume float64 `josn:"baseVolume"` // 交易量 High24hr float64 `json:"high24hr"` // 24小时最高价 Low24hr float64 `json:"low24hr"` // 24小时最低价 HighestBid float64 `json:"highestBid"` // 买方最高价 LowestAsk float64 `json:"lowestAsk"` // 卖方最低价 Last float64 `json:"last"` // 最新成交价 PercentChange float64 `json:"percentChange"` // 涨跌百分比 QuoteVolume float64 `json:"quoteVolume"` // 兑换货币交易量 }
TickerResponse ...
Click to show internal directories.
Click to hide internal directories.