Documentation
¶
Index ¶
- type AccountsData
- type AccountsReturn
- type Balance
- type BalanceReturn
- type CurrencysReturn
- type KLineData
- type KLineReturn
- type MarketDepth
- type MarketDepthReturn
- type MarketDetail
- type MarketDetailReturn
- type OrderDetail
- type OrderDetailReturn
- type OrdersReturn
- type PlaceRequestParams
- type PlaceReturn
- type SubAccount
- type SymbolsData
- type SymbolsReturn
- type Ticker
- type TickerReturn
- type TimestampReturn
- type TradeData
- type TradeDetail
- type TradeDetailData
- type TradeDetailReturn
- type TradeReturn
- type TradeTick
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountsData ¶
type AccountsReturn ¶
type AccountsReturn struct {
Status string `json:"status"` // 请求状态
Data []AccountsData `json:"data"` // 用户数据
ErrCode string `json:"err-code"`
ErrMsg string `json:"err-msg"`
}
type Balance ¶
type Balance struct {
ID int64 `json:"id"` // 账户ID
State string `json:"state"` // 账户状态, working: 正常, lock: 账户被锁定
Type string `json:"type"` // 账户类型, spot: 现货账户
List []SubAccount `json:"list"` // 子账户数组
UserID int64 `json:"user-id"`
}
type BalanceReturn ¶
type CurrencysReturn ¶
type KLineData ¶
type KLineData struct {
ID int64 `json:"id"` // K线ID
Amount float64 `json:"amount"` // 成交量
Count int64 `json:"count"` // 成交笔数
Open float64 `json:"open"` // 开盘价
Close float64 `json:"close"` // 收盘价, 当K线为最晚的一根时, 时最新成交价
Low float64 `json:"low"` // 最低价
High float64 `json:"high"` // 最高价
Vol float64 `json:"vol"` // 成交额, 即SUM(每一笔成交价 * 该笔的成交数量)
}
type KLineReturn ¶
type KLineReturn struct {
Status string `json:"status"` // 请求处理结果, "ok"、"error"
Ts int64 `json:"ts"` // 响应生成时间点, 单位毫秒
Data []KLineData `json:"data"` // KLine数据
Ch string `json:"ch"` // 数据所属的Channel, 格式: market.$symbol.kline.$period
ErrCode string `json:"err-code"` // 错误代码
ErrMsg string `json:"err-msg"` // 错误提示
}
type MarketDepth ¶
type MarketDepthReturn ¶
type MarketDetail ¶
type MarketDetail struct {
ID int64 `json:"id"` // 消息ID
Ts int64 `json:"ts"` // 24小时统计时间
Amount float64 `json:"amount"` // 24小时成交量
Open float64 `json:"open"` // 前24小时成交价
Close float64 `json:"close"` // 当前成交价
High float64 `json:"high"` // 近24小时最高价
Low float64 `json:"low"` // 近24小时最低价
Count int64 `json:"count"` // 近24小时累计成交数
Vol float64 `json:"vol"` // 近24小时累计成交额, 即SUM(每一笔成交价 * 该笔的成交量)
}
type MarketDetailReturn ¶
type OrderDetail ¶
type OrderDetailReturn ¶
type OrderDetailReturn struct {
Status string `json:"status"` // 请求状态
Data OrderDetail `json:"data"` // 订单详情
ErrCode string `json:"err-code"`
ErrMsg string `json:"err-msg"`
}
type OrdersReturn ¶
type OrdersReturn struct {
Status string `json:"status"` // 请求状态
Data []OrderDetail `json:"data"` // 订单列表
ErrCode string `json:"err-code"`
ErrMsg string `json:"err-msg"`
}
type PlaceRequestParams ¶
type PlaceRequestParams struct {
AccountID string `json:"account-id"` // 账户ID
Amount string `json:"amount"` // 限价表示下单数量, 市价买单时表示买多少钱, 市价卖单时表示卖多少币
Price string `json:"price"` // 下单价格, 市价单不传该参数
Source string `json:"source"` // 订单来源, api: API调用, margin-api: 借贷资产交易
Symbol string `json:"symbol"` // 交易对, btcusdt, bccbtc......
Type string `json:"type"` // 订单类型, buy-market: 市价买, sell-market: 市价卖, buy-limit: 限价买, sell-limit: 限价卖
}
type PlaceReturn ¶
type SubAccount ¶
type SubAccount struct {
Currency string `json:"currency"` // 币种
Balance string `json:"balance"` // 结余
Type string `json:"type"` // 类型, trade: 交易余额, frozen: 冻结余额
}
子账户结构
type SymbolsData ¶
type SymbolsData struct {
BaseCurrency string `json:"base-currency"` // 基础币种
QuoteCurrency string `json:"quote-currency"` // 计价币种
PricePrecision int `json:"price-precision"` // 价格精度位数(0为个位)
AmountPrecision int `json:"amount-precision"` // 数量精度位数(0为个位)
SymbolPartition string `json:"symbol-partition"` // 交易区, main: 主区, innovation: 创新区, bifurcation: 分叉区
}
type SymbolsReturn ¶
type SymbolsReturn struct {
Status string `json:"status"` // 请求状态
Data []SymbolsData `json:"data"` // 交易及精度数据
ErrCode string `json:"err-code"`
ErrMsg string `json:"err-msg"`
}
type Ticker ¶
type Ticker struct {
ID int64 `json:"id"` // K线ID
Amount float64 `json:"amount"` // 成交量
Count int64 `json:"count"` // 成交笔数
Open float64 `json:"open"` // 开盘价
Close float64 `json:"close"` // 收盘价
Low float64 `json:"low"` // 最低价
High float64 `json:"high"` // 最高价
Vol float64 `json:"vol"` // 成交额
Bid []float64 `json:"bid"` // [买1价, 买1量]
Ask []float64 `json:"ask"` // [卖1价, 卖1量]
}
type TickerReturn ¶
type TimestampReturn ¶
type TradeDetail ¶
type TradeDetail struct {
ID int64 `json:"id"` // 消息ID
Ts int64 `json:"ts"` // 最新成交时间
Data []TradeDetailData `json:"data"` // 交易细节数据
}
type TradeDetailData ¶
type TradeDetailReturn ¶
type TradeDetailReturn struct {
Status string `json:"status"` // 请求处理结果, "ok"、"error"
Ts int64 `json:"ts"` // 响应生成时间点, 单位毫秒
Tick TradeDetail `json:"tick"` // TradeDetail数据
Ch string `json:"ch"` // 数据所属的Channel, 格式: market.$symbol.trade.detail
ErrCode string `json:"err-code"` // 错误代码
ErrMsg string `json:"err-msg"` // 错误提示
}
type TradeReturn ¶
Click to show internal directories.
Click to hide internal directories.