Files
exchange_go/models/spot/spotdto.go
2025-02-06 11:14:33 +08:00

73 lines
5.1 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package spot
type SpotTicker24h struct {
Symbol string `json:"symbol"` // 交易对符号 (e.g., BNBBTC)
PriceChange string `json:"priceChange"` // 24小时价格变动
PriceChangePercent string `json:"priceChangePercent"` // 24小时价格变动百分比
WeightedAvgPrice string `json:"weightedAvgPrice"` // 加权平均价
PrevClosePrice string `json:"prevClosePrice"` // 前一个收盘价
LastPrice string `json:"lastPrice"` // 最近一次成交价
LastQty string `json:"lastQty"` // 最近一次成交量
BidPrice string `json:"bidPrice"` // 当前买单价
BidQty string `json:"bidQty"` // 当前买单量
AskPrice string `json:"askPrice"` // 当前卖单价
AskQty string `json:"askQty"` // 当前卖单量
OpenPrice string `json:"openPrice"` // 24小时内第一次成交的价格
HighPrice string `json:"highPrice"` // 24小时最高价
LowPrice string `json:"lowPrice"` // 24小时最低价
Volume string `json:"volume"` // 24小时成交量
QuoteVolume string `json:"quoteVolume"` // 24小时成交额
OpenTime int64 `json:"openTime"` // 24小时内第一笔交易的发生时间 (Unix timestamp)
CloseTime int64 `json:"closeTime"` // 24小时内最后一笔交易的发生时间 (Unix timestamp)
FirstId int `json:"firstId"` // 首笔成交id
LastId int `json:"lastId"` // 末笔成交id
Count int `json:"count"` // 成交笔数
}
type RateLimit struct {
// 定义在 "限制种类 (rateLimitType)" 部分的限制
}
type ExchangeFilter struct {
// 定义在 "过滤器" 部分的过滤器
FilterType string `json:"filterType"` //类别
MinPrice string `json:"minPrice"` //最小金额
MaxPrice string `json:"maxPrice"` //最大金额
TickSize string `json:"tickSize"` //最小精度
MinQty string `json:"minQty"` //最小购买数量
MaxQty string `json:"maxQty"` //最大购买数量
StepSize string `json:"stepSize"` //数量最小精度
}
type Symbol struct {
Symbol string `json:"symbol"` // 交易对符号 (e.g., ETHBTC)
Status string `json:"status"` // 当前状态 (e.g., TRADING)
BaseAsset string `json:"baseAsset"` // 基础资产 (e.g., ETH)
BaseAssetPrecision int `json:"baseAssetPrecision"` // 基础资产精度
QuoteAsset string `json:"quoteAsset"` // 报价资产 (e.g., BTC)
QuotePrecision int `json:"quotePrecision"` // 报价资产精度
QuoteAssetPrecision int `json:"quoteAssetPrecision"` // 报价资产的精度
OrderTypes []string `json:"orderTypes"` // 支持的订单类型
IcebergAllowed bool `json:"icebergAllowed"` // 是否允许冰山订单
OcoAllowed bool `json:"ocoAllowed"` // 是否允许 OCO (One Cancels the Other) 订单
QuoteOrderQtyMarketAllowed bool `json:"quoteOrderQtyMarketAllowed"` // 是否允许市场单的报价订单数量
AllowTrailingStop bool `json:"allowTrailingStop"` // 是否允许跟踪止损
IsSpotTradingAllowed bool `json:"isSpotTradingAllowed"` // 是否允许现货交易
IsMarginTradingAllowed bool `json:"isMarginTradingAllowed"` // 是否允许保证金交易
CancelReplaceAllowed bool `json:"cancelReplaceAllowed"` // 是否允许取消替代
Filters []ExchangeFilter `json:"filters"` // 过滤器,定义在 "过滤器" 部分
Permissions []string `json:"permissions"` // 权限
PermissionSets [][]string `json:"permissionSets"` // 权限集
DefaultSelfTradePreventionMode string `json:"defaultSelfTradePreventionMode"` // 默认的自我交易防止模式
AllowedSelfTradePreventionModes []string `json:"allowedSelfTradePreventionModes"` // 允许的自我交易防止模式
}
type ExchangeInfo struct {
Timezone string `json:"timezone"` // 时区 (e.g., UTC)
ServerTime int64 `json:"serverTime"` // 服务器时间 (Unix timestamp)
RateLimits []RateLimit `json:"rateLimits"` // 速率限制,定义在 "限制种类" 部分
ExchangeFilters []ExchangeFilter `json:"exchangeFilters"` // 交易所过滤器,定义在 "过滤器" 部分
Symbols []Symbol `json:"symbols"` // 交易对列表
}