Documentation
¶
Index ¶
- Constants
- Variables
- func Close(klines []Kline) (data []float64)
- func CloseLog()
- func Error(format string, v ...interface{})
- func FlateUnCompress(data []byte) ([]byte, error)
- func FloatToString(v float64, n int) string
- func GetCurrencyMap(ssm map[string]SymbolSetting) (cm map[string]struct{})
- func GetParamHmacMD5Sign(secret, params string) (string, error)
- func GetParamHmacSHA1Sign(secret, params string) (string, error)
- func GetParamHmacSHA256Base64Sign(secret, params string) (string, error)
- func GetParamHmacSHA256Sign(secret, params string) (string, error)
- func GetParamHmacSHA512Base64Sign(hmac_key string, hmac_data string) string
- func GetParamHmacSHA512Sign(secret, params string) (string, error)
- func GetParamHmacSha384Sign(secret, params string) (string, error)
- func GetParamMD5Sign(secret, params string) (string, error)
- func GetSHA(text string) (string, error)
- func GzipUnCompress(data []byte) ([]byte, error)
- func High(klines []Kline) (data []float64)
- func HttpDeleteForm(client *http.Client, reqUrl string, postData url.Values, ...) ([]byte, error)
- func HttpDeleteForm2(client *http.Client, reqUrl string, postData string, headers map[string]string) ([]byte, error)
- func HttpGet(client *http.Client, reqUrl string) (map[string]interface{}, error)
- func HttpGet2(client *http.Client, reqUrl string, headers map[string]string) (map[string]interface{}, error)
- func HttpGet3(client *http.Client, reqUrl string, headers map[string]string) ([]interface{}, error)
- func HttpGet4(client *http.Client, reqUrl string, headers map[string]string, ...) error
- func HttpGet5(client *http.Client, reqUrl string, headers map[string]string) ([]byte, error)
- func HttpPostForm(client *http.Client, reqUrl string, postData url.Values) ([]byte, error)
- func HttpPostForm2(client *http.Client, reqUrl string, postData url.Values, ...) ([]byte, error)
- func HttpPostForm3(client *http.Client, reqUrl string, postData string, headers map[string]string) ([]byte, error)
- func HttpPostForm4(client *http.Client, reqUrl string, postData map[string]string, ...) ([]byte, error)
- func HttpPostForm5(client *http.Client, reqUrl string, postData string, headers map[string]string) ([]byte, error)
- func HttpPostForm6(client *http.Client, reqUrl string, postData map[string]interface{}, ...) ([]byte, error)
- func IntersectCurrencies(a, b map[string]struct{}) (currencies map[string]struct{})
- func IntersectSymbols(a, b map[string]SymbolSetting) (symbols map[string]SymbolSetting)
- func IsLoging() bool
- func Log(format string, v ...interface{})
- func Low(klines []Kline) (data []float64)
- func NewHttpRequest(client *http.Client, reqType string, reqUrl string, postData string, ...) ([]byte, error)
- func Open(klines []Kline) (data []float64)
- func OpenLog()
- func SetLogger(l Logger)
- func ToBool(v interface{}) bool
- func ToFloat64(v interface{}) float64
- func ToInt(v interface{}) int
- func ToInt64(v interface{}) int64
- func ToString(v interface{}) string
- func ToUint64(v interface{}) uint64
- func ValuesToJson(v url.Values) ([]byte, error)
- type APIConfig
- type Account
- type Connection
- type Currency
- type CurrencyPair
- func (pair CurrencyPair) AdaptBccToBch() CurrencyPair
- func (pair CurrencyPair) AdaptBchToBcc() CurrencyPair
- func (pair CurrencyPair) AdaptUsdToUsdt() CurrencyPair
- func (pair CurrencyPair) AdaptUsdtToUsd() CurrencyPair
- func (pair CurrencyPair) Equal(c2 CurrencyPair) bool
- func (pair CurrencyPair) Reverse() CurrencyPair
- func (pair CurrencyPair) String() string
- func (pair CurrencyPair) ToLowerSymbol(sep string) string
- func (pair CurrencyPair) ToSymbol(sep string) string
- type CurrencyStatus
- type Depth
- type DepthRecord
- type DepthRecords
- type FutureAccount
- type FutureKline
- type FutureOrder
- type FuturePosition
- type FutureSubAccount
- type FutureTicker
- type Kline
- type KlinePeriod
- type Logger
- type Order
- type OrderDeal
- type SpotAPI
- type SpotWebsocket
- type SpotWsBase
- func (ws *SpotWsBase) Close()
- func (ws *SpotWsBase) GetPairByStream(topic string) (pair CurrencyPair)
- func (ws *SpotWsBase) GetProxyURL() string
- func (ws *SpotWsBase) GetURL() string
- func (ws *SpotWsBase) Loop()
- func (ws *SpotWsBase) Pack(topic interface{}) []byte
- func (ws *SpotWsBase) Resubscribe() (err error)
- func (ws *SpotWsBase) SetConnectHandler(h func(*Connection) error)
- func (ws *SpotWsBase) SetDisconnected(disconnected bool)
- func (ws *SpotWsBase) SetHeartBeatHandler(h func(*Connection) error)
- func (ws *SpotWsBase) SetProxyURL(proxyURL string)
- func (ws *SpotWsBase) SetURL(exURL string)
- func (ws *SpotWsBase) SubDepth(pair CurrencyPair, cb func(*Depth) error) (err error)
- func (ws *SpotWsBase) SubTicker(pair CurrencyPair, cb func(*Ticker) error) (err error)
- func (ws *SpotWsBase) SubTrade(pair CurrencyPair, cb func([]Trade) error) (err error)
- func (ws *SpotWsBase) Unsubscribe() (err error)
- type StreamType
- type SubAccount
- type SymbolSetting
- type Ticker
- type TopicMap
- func (m *TopicMap) Delete(k string)
- func (m *TopicMap) Load(k string) (pair CurrencyPair, ok bool)
- func (m *TopicMap) LoadOrStore(k string, pair CurrencyPair) (actualPair CurrencyPair, loaded bool)
- func (m *TopicMap) Range(f func(k string, v CurrencyPair) bool)
- func (m *TopicMap) Store(k string, v CurrencyPair)
- type Trade
- type TradeSide
- type TradeStatus
Constants ¶
View Source
const ( Depth_Default = 0 // 默认深度 Depth5 = 5 // 5档 Depth10 = 10 // 10档 Depth20 = 20 // 20档 Depth50 = 50 // 50档 Depth100 = 100 // 100档 )
深度挡位。 有些挡位,在一些交易所不支持时,会置为Depth_Default,按交易所实际的挡位输出。
View Source
const ( Depth_Aggregate_Default = 0 // 默认深度 Depth_Aggregate1 = 1 // 5档 Depth_Aggregate2 = 2 // 10档 Depth_Aggregate3 = 3 // 20档 Depth_Aggregate4 = 4 // 50档 Depth_Aggregate5 = 5 // 100档 )
深度聚合。 挡位价格的聚合。
View Source
const ( OPEN_BUY = 1 + iota //开多 OPEN_SELL //开空 CLOSE_BUY //平多 CLOSE_SELL //平空 )
View Source
const ( KLINE_PERIOD_1MIN = 1 + iota KLINE_PERIOD_3MIN KLINE_PERIOD_5MIN KLINE_PERIOD_15MIN KLINE_PERIOD_30MIN KLINE_PERIOD_60MIN KLINE_PERIOD_1H KLINE_PERIOD_2H KLINE_PERIOD_4H KLINE_PERIOD_6H KLINE_PERIOD_8H KLINE_PERIOD_12H KLINE_PERIOD_1DAY KLINE_PERIOD_3DAY KLINE_PERIOD_1WEEK KLINE_PERIOD_1MONTH KLINE_PERIOD_1YEAR )
k线周期
View Source
const ( HUOBI = "huobi" BINANCE = "binance" OKEX = "okex" ZB = "zb" ET = "et" COINEX = "coinex" OKCOIN_CN = "okcoin" OKCOIN_COM = "okcoin" OKEX_FUTURE = "okex" OKEX_SWAP = "okex" BITSTAMP = "bitstamp" KRAKEN = "kraken" BITFINEX = "bitfinex" POLONIEX = "poloniex" BITHUMB = "bithumb" GATE = "gate" BITTREX = "bittrex" GDAX = "gdax" WEX_NZ = "wex" BIGONE = "bigone" COIN58 = "58coin" FCOIN = "fcoin" HITBTC = "hitbtc" BITMEX = "bitmex" CRYPTOPIA = "cryptopia" HBDM = "hbdm" BITZ = "bitz" AOFEX = "aofex" JBEX = "jbex" UPEX = "upex" )
exchanges const
View Source
const ( STREAM_TICKER = "__TICKER" STREAM_DEPTH = "__DEPTH" STREAM_TRADE = "__TRADE" )
Variables ¶
View Source
var ( THIS_WEEK_CONTRACT = "this_week" //周合约 NEXT_WEEK_CONTRACT = "next_week" //次周合约 QUARTER_CONTRACT = "quarter" //季度合约 )
View Source
var ( UNKNOWN = Currency{"UNKNOWN"} CNY = Currency{"CNY"} USD = Currency{"USD"} USDT = Currency{"USDT"} PAX = Currency{"PAX"} USDC = Currency{"USDC"} BCC = Currency{"BCC"} BCH = Currency{"BCH"} UNKNOWN_PAIR = CurrencyPair{UNKNOWN, UNKNOWN} )
View Source
var ErrorAssetNotFound = errors.New("Asset not found")
币种未找到
View Source
var ErrorUnsupported = errors.New("Unsupported")
接口暂不支持的错误
Functions ¶
func FlateUnCompress ¶
func GetCurrencyMap ¶
func GetCurrencyMap(ssm map[string]SymbolSetting) (cm map[string]struct{})
func GetParamHmacMD5Sign ¶
func GetParamHmacSHA1Sign ¶
func GetParamHmacSHA256Sign ¶
func GetParamHmacSHA512Sign ¶
func GetParamHmacSha384Sign ¶
for bitfinex.com
func GzipUnCompress ¶
func HttpDeleteForm ¶
func HttpDeleteForm2 ¶ added in v1.0.5
func HttpPostForm ¶
func HttpPostForm2 ¶
func HttpPostForm3 ¶
func HttpPostForm4 ¶
func HttpPostForm5 ¶
func HttpPostForm6 ¶
func IntersectCurrencies ¶
func IntersectSymbols ¶
func IntersectSymbols(a, b map[string]SymbolSetting) (symbols map[string]SymbolSetting)
func NewHttpRequest ¶
Types ¶
type Account ¶
type Account struct {
Exchange string `json:"exchange,string"` // 交易所名字
Asset float64 `json:"asset,string"` //总资产
NetAsset float64 `json:"netasset,string"` //净资产
SubAccounts map[Currency]SubAccount `json:"sub_accounts"` // 每个币种账本
}
type Connection ¶
type Connection struct {
// 互斥锁
sync.Mutex
// 消息处理函数,当有数据时调用,当断开连接时,data传nil
OnMessage func([]byte) error
// contains filtered or unexported fields
}
封装websocket连接,可双工读写
func NewConnection ¶
func NewConnection(wsConn *websocket.Conn, onMessage func([]byte) error) (conn *Connection, err error)
初始化长连接
func NewConnectionWithURL ¶
func NewConnectionWithURL(wsurl, proxyurl string, onMessage func([]byte) error) (conn *Connection, err error)
初始化长连接
func (*Connection) ReceiveMessage ¶
func (conn *Connection) ReceiveMessage() (data []byte, err error)
接收数据
type Currency ¶
type Currency struct {
Name string `json:"name"`
}
func NewCurrency ¶
func (Currency) AdaptBccToBch ¶
func (Currency) AdaptBchToBcc ¶
BCC就是BCH的别名,很多交易所已经移除了BCC的叫法。
func (Currency) LowerSymbol ¶
type CurrencyPair ¶
func NewCurrencyPair ¶
func NewCurrencyPair(stock Currency, money Currency) CurrencyPair
func NewCurrencyPairFromString ¶
func NewCurrencyPairFromString(market string) CurrencyPair
func (CurrencyPair) AdaptBccToBch ¶
func (pair CurrencyPair) AdaptBccToBch() CurrencyPair
func (CurrencyPair) AdaptBchToBcc ¶
func (pair CurrencyPair) AdaptBchToBcc() CurrencyPair
It is currently applicable to binance and zb
func (CurrencyPair) AdaptUsdToUsdt ¶
func (pair CurrencyPair) AdaptUsdToUsdt() CurrencyPair
func (CurrencyPair) AdaptUsdtToUsd ¶
func (pair CurrencyPair) AdaptUsdtToUsd() CurrencyPair
func (CurrencyPair) Equal ¶
func (pair CurrencyPair) Equal(c2 CurrencyPair) bool
func (CurrencyPair) Reverse ¶
func (pair CurrencyPair) Reverse() CurrencyPair
func (CurrencyPair) String ¶
func (pair CurrencyPair) String() string
func (CurrencyPair) ToLowerSymbol ¶
func (pair CurrencyPair) ToLowerSymbol(sep string) string
func (CurrencyPair) ToSymbol ¶
func (pair CurrencyPair) ToSymbol(sep string) string
type CurrencyStatus ¶
type Depth ¶
type Depth struct {
ContractType string `json:"contract_type"` // for future
Market CurrencyPair `json:"market"` // 交易对
Symbol string `json:"symbol"` // 交易对
TS int64 `json:"ts"` // 时间,单位为毫秒(millisecond)
AskList DepthRecords `json:"asks"` // 卖方订单列表,价格从低到高排序
BidList DepthRecords `json:"bids"` // 买方订单列表,价格从高到底排序
}
type DepthRecord ¶
type DepthRecords ¶
type DepthRecords []DepthRecord
func (DepthRecords) Len ¶
func (dr DepthRecords) Len() int
func (DepthRecords) Less ¶
func (dr DepthRecords) Less(i, j int) bool
func (DepthRecords) Swap ¶
func (dr DepthRecords) Swap(i, j int)
type FutureAccount ¶
type FutureAccount struct {
FutureSubAccounts map[Currency]FutureSubAccount
}
type FutureKline ¶
type FutureOrder ¶
type FuturePosition ¶
type FuturePosition struct {
BuyAmount float64
BuyAvailable float64
BuyPriceAvg float64
BuyPriceCost float64
BuyProfitReal float64
CreateDate int64
LeverRate int
SellAmount float64
SellAvailable float64
SellPriceAvg float64
SellPriceCost float64
SellProfitReal float64
Symbol CurrencyPair //btc_usd:比特币,ltc_usd:莱特币
ContractType string
ContractId int64
ForceLiquPrice float64 //预估爆仓价
}
type FutureSubAccount ¶
type FutureTicker ¶
type Kline ¶
type Kline struct {
Market CurrencyPair `json:"market"` // 交易对
Symbol string `json:"symbol"` // 交易对
TS int64 `json:"ts"` // 开盘时间,单位为秒(second)
Open float64 `json:"open,string"` // 开盘价
Close float64 `json:"close,string"` // 收盘价
High float64 `json:"high,string"` // 最高价
Low float64 `json:"low,string"` // 最低价
Vol float64 `json:"vol,string"` // 报价币种成交量
}
type KlinePeriod ¶
type KlinePeriod int
K线周期。
const ( KLINE_M1 KlinePeriod = iota // k线,周期1分钟 KLINE_M5 // k线,周期5分钟 KLINE_M15 // k线,周期15分钟 KLINE_M30 // k线,周期30分钟 KLINE_H1 // k线,周期1小时 KLINE_H4 // k线,周期4小时 KLINE_DAY // k线,周期1天 KLINE_WEEK // k线,周期1星期 KLINE_MONTH // k线,周期1个月 )
type Order ¶
type Order struct {
OrderID string `json:"order_id"` // 订单id
Price float64 `json:"price,string"` // 委托价格
Amount float64 `json:"amount,string"` // 委托量
AvgPrice float64 `json:"avg_price,string"` // 平均成交价
DealAmount float64 `json:"deal_amount,string"` // 成交量
Fee float64 `json:"fee,string"` // 手续费
TS int64 `json:"ts"` // 时间,单位为毫秒(millisecond)
Status TradeStatus `json:"status"` // 订单状态
Market CurrencyPair `json:"market"` // 交易对
Symbol string `json:"symbol"` // 交易对
Side TradeSide `json:"side"` // 交易方向
}
type OrderDeal ¶
type OrderDeal struct {
OrderID string `json:"order_id"` // 订单id
DealID string `json:"deal_id"` // 本次成交id
TS int64 `json:"ts"` // 时间,单位为毫秒(millisecond)
Price float64 `json:"price,string"` // 委托价格
FilledAmount float64 `json:"filled_amount,string"` // 本次成交量
FilledCashAmount float64 `json:"filled_cash_amount,string"` // 本次成交金额
UnFilledAmount float64 `json:"unfilled_amount,string"` // 未成交的量
Side TradeSide `json:"side"` // 交易方向
Market CurrencyPair `json:"market"` // 交易对
Symbol string `json:"symbol"` // 交易对
}
type SpotAPI ¶
type SpotAPI interface {
// 获取交易所名称
GetExchangeName() string
// 设置交易所地址,仅在初始化时设置,不支持后续动态更改
SetURL(exurl string)
// 获取交易所地址
GetURL() string
// 获取支持的交易对
GetAllCurrencyPair() (map[string]SymbolSetting, error)
// 获取此币种是否可以充提币
GetCurrencyStatus(currency Currency) (CurrencyStatus, error)
// 获取所有币种是否可以充提币
GetAllCurrencyStatus() (map[string]CurrencyStatus, error)
// 公共行情
// 获取单一币种对的行情
GetTicker(pair CurrencyPair) (*Ticker, error)
// 获取所有币种对的行情
GetAllTicker() ([]Ticker, error)
//获取单一币种对的深度
GetDepth(pair CurrencyPair, size int, step int) (*Depth, error)
// 获取单一币种对的成交记录
GetTrades(pair CurrencyPair, size int) ([]Trade, error)
// 获取单一币种对的K线记录,按时间升序排列
GetKlineRecords(pair CurrencyPair, period KlinePeriod, size, since int) ([]Kline, error)
// 交易相关
// 限价单
LimitBuy(pair CurrencyPair, price, amount string) (*Order, error)
LimitSell(pair CurrencyPair, price, amount string) (*Order, error)
// 市价单,下单后返回的数据不准,需要调用GetOrder获取准确信息
// 买入金额,单位为计价货币
MarketBuy(pair CurrencyPair, amount string) (*Order, error)
// 卖出数量,单位为基础货币
MarketSell(pair CurrencyPair, amount string) (*Order, error)
// 撤单
Cancel(orderId string, pair CurrencyPair) (bool, error)
// 获取订单详情
GetOrder(orderId string, pair CurrencyPair) (*Order, error)
// 获取当前未完成订单列表
GetPendingOrders(pair CurrencyPair) ([]Order, error)
// 获取最近完成订单
GetFinishedOrders(pair CurrencyPair) ([]Order, error)
// 获取订单的成交明细
GetOrderDeal(orderId string, pair CurrencyPair) ([]OrderDeal, error)
// 获取单一币种对的最近成交明细
GetUserTrades(pair CurrencyPair) ([]Trade, error)
// 获取账户余额
GetAccount() (*Account, error)
}
spot api interface
type SpotWebsocket ¶
type SpotWebsocket interface {
// 设置交易所地址,仅在初始化时设置,不支持后续动态更改
SetURL(exURL string)
// 获取交易所地址
GetURL() string
// 设置代理地址
SetProxyURL(proxyURL string)
// 获取代理地址
GetProxyURL() string
// 订阅或取消行情,cb传nil为取消,目前cb只有最后一次设置的生效
SubTicker(pair CurrencyPair, cb func(*Ticker) error) (err error)
SubDepth(pair CurrencyPair, cb func(*Depth) error) (err error)
SubTrade(pair CurrencyPair, cb func([]Trade) error) (err error)
//SubKline(pair CurrencyPair, period KlinePeriod, cb func([]Kline) error) (err error)
// 全部重新订阅
Resubscribe() (err error)
// 全部取消订阅
Unsubscribe() (err error)
// 设置初始化函数,当连接建立时调用
SetConnectHandler(h func(*Connection) error)
// 设置心跳函数
SetHeartBeatHandler(h func(*Connection) error)
// 关闭连接
Close()
// 以下为需要单独定制的接口
// 获取交易所名称
GetExchangeName() string
// 格式化主题名称
FormatTopicName(topic string, pair CurrencyPair) string
// 格式化主题订阅消息
FormatTopicSubData(topic string, pair CurrencyPair) []byte
// 格式化主题取消订阅消息
FormatTopicUnsubData(topic string, pair CurrencyPair) []byte
// 消息解析函数
OnMessage([]byte) error
}
type SpotWsBase ¶
type SpotWsBase struct {
SpotWebsocket
// 交易所地址
WsURL string
// 代理地址
ProxyURL string
// 心跳时长
HeartbeatIntervalTime time.Duration
// 底层websocket连接
Conn *Connection
// 消息主题的map
TopicMap TopicMap
// 连接建立处理函数
OnConnect func(*Connection) error
// 心跳处理函数
OnHeartBeat func(*Connection) error
// callbacks
OnTicker func(*Ticker) error
OnDepth func(*Depth) error
OnTrade func([]Trade) error
// contains filtered or unexported fields
}
func (*SpotWsBase) GetPairByStream ¶
func (ws *SpotWsBase) GetPairByStream(topic string) (pair CurrencyPair)
func (*SpotWsBase) GetProxyURL ¶
func (ws *SpotWsBase) GetProxyURL() string
func (*SpotWsBase) GetURL ¶
func (ws *SpotWsBase) GetURL() string
func (*SpotWsBase) Loop ¶
func (ws *SpotWsBase) Loop()
func (*SpotWsBase) Pack ¶
func (ws *SpotWsBase) Pack(topic interface{}) []byte
func (*SpotWsBase) SetConnectHandler ¶
func (ws *SpotWsBase) SetConnectHandler(h func(*Connection) error)
设置初始化函数,当连接建立时调用
func (*SpotWsBase) SetDisconnected ¶
func (ws *SpotWsBase) SetDisconnected(disconnected bool)
func (*SpotWsBase) SetHeartBeatHandler ¶
func (ws *SpotWsBase) SetHeartBeatHandler(h func(*Connection) error)
设置心跳处理函数
func (*SpotWsBase) SetProxyURL ¶
func (ws *SpotWsBase) SetProxyURL(proxyURL string)
func (*SpotWsBase) SetURL ¶
func (ws *SpotWsBase) SetURL(exURL string)
func (*SpotWsBase) SubDepth ¶
func (ws *SpotWsBase) SubDepth(pair CurrencyPair, cb func(*Depth) error) (err error)
func (*SpotWsBase) SubTicker ¶
func (ws *SpotWsBase) SubTicker(pair CurrencyPair, cb func(*Ticker) error) (err error)
func (*SpotWsBase) SubTrade ¶
func (ws *SpotWsBase) SubTrade(pair CurrencyPair, cb func([]Trade) error) (err error)
type SubAccount ¶
type SymbolSetting ¶
type SymbolSetting struct {
Symbol string `json:"symbol"` // 币对名称
Base string `json:"base"` // 基础币种
Quote string `json:"quote"` // 报价币种
MinSize float64 `json:"min_size"` // 最小交易量
MinPrice float64 `json:"min_price"` // 最小价格
MinNotional float64 `json:"min_notional"` // 最小成交量,价格和数量相乘必须要大于此值
MakerFee float64 `json:"maker_fee"` // 挂单手续费
TakerFee float64 `json:"taker_fee"` // 吃单手续费
}
币对基本信息
type Ticker ¶
type Ticker struct {
//Symbol string `json:"symbol"` // 交易对
Market CurrencyPair `json:"market"` // 交易对
Symbol string `json:"symbol"` // 交易对
Open float64 `json:"open,string"` // 开盘价
Last float64 `json:"last,string"` // 收盘价
High float64 `json:"high,string"` // 最高价
Low float64 `json:"low,string"` // 最低价
Vol float64 `json:"vol,string"` // 基础币种成交量
Buy float64 `json:"buy,string"` // 最优买价
Sell float64 `json:"sell,string"` // 最优卖家
TS int64 `json:"ts"` // 最新时间,单位为毫秒(millisecond)
}
type TopicMap ¶
type TopicMap struct {
// contains filtered or unexported fields
}
// 订单id到订单的映射
func NewStreamMap ¶
func NewStreamMap() *TopicMap
func (*TopicMap) LoadOrStore ¶
func (m *TopicMap) LoadOrStore(k string, pair CurrencyPair) (actualPair CurrencyPair, loaded bool)
func (*TopicMap) Store ¶
func (m *TopicMap) Store(k string, v CurrencyPair)
type Trade ¶
type Trade struct {
Tid int64 `json:"tid"` // 交易id
Side TradeSide `json:"type"` // 交易方向
Amount float64 `json:"amount,string"` // 成交量
Price float64 `json:"price,string"` // 成交价
TS int64 `json:"ts"` // 时间,单位为毫秒(millisecond)
Market CurrencyPair `json:"market"` // 交易对
Symbol string `json:"symbol"` // 交易对
}
type TradeStatus ¶
type TradeStatus int
const ( ORDER_UNFINISH TradeStatus = iota ORDER_PART_FINISH ORDER_FINISH ORDER_CANCEL ORDER_REJECT ORDER_CANCEL_ING ORDER_FAIL )
func (TradeStatus) String ¶
func (ts TradeStatus) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.