binance_struct

package
v0.0.0-...-a4de9da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	MakerCommission            int             `json:"makerCommission"`            // 制造商委员会
	TakerCommission            int             `json:"takerCommission"`            // 接受者委员会
	BuyerCommission            int             `json:"buyerCommission"`            // 买家委员会
	SellerCommission           int             `json:"sellerCommission"`           // 卖家的佣金
	CommissionRates            CommissionRates `json:"commissionRates"`            // 佣金率
	CanTrade                   bool            `json:"canTrade"`                   // 可以交易
	CanWithdraw                bool            `json:"canWithdraw"`                // 可以提币
	CanDeposit                 bool            `json:"canDeposit"`                 // 可以充值
	Brokered                   bool            `json:"brokered"`                   // 是否代理
	RequireSelfTradePrevention bool            `json:"requireSelfTradePrevention"` // 要求自我贸易防范
	UpdateTime                 int             `json:"updateTime"`                 // 更新时间
	AccountType                string          `json:"accountType"`                // 账户类型
	Balances                   []Balance       `json:"balances"`                   // 账户余额
	Permissions                []string        `json:"permissions"`                // 权限
}

AccountInfo

type ApiRestrictions

type ApiRestrictions struct {
	IpRestrict                     bool `json:"ipRestrict"`                     // 是否限制ip访问
	CreateTime                     int  `json:"createTime"`                     // 创建时间
	EnableWithdrawals              bool `json:"enableWithdrawals"`              // 此选项允许通过此api提现。开启提现选项必须添加IP访问限制过滤器
	EnableInternalTransfer         bool `json:"enableInternalTransfer"`         // 此选项授权此密钥在您的母账户和子账户之间划转资金
	PermitsUniversalTransfer       bool `json:"permitsUniversalTransfer"`       // 授权该密钥可用于专用的万向划转接口,用以操作其支持的多种类型资金划转。各业务自身的划转接口使用权限,不受本授权影响
	EnableVanillaOptions           bool `json:"enableVanillaOptions"`           // 欧式期权交易权限
	EnableReading                  bool `json:"enableReading"`                  // 整体的读取权限
	EnableFutures                  bool `json:"enableFutures"`                  // 合约交易权限,需注意开通合约账户之前创建的API Key不支持合约API功能
	EnableMargin                   bool `json:"enableMargin"`                   // 此选项在全仓账户完成划转后可编辑
	EnableSpotAndMarginTrading     bool `json:"enableSpotAndMarginTrading"`     // 现货和杠杆交易权限
	TradingAuthorityExpirationTime int  `json:"tradingAuthorityExpirationTime"` // 现货和杠杆交易权限到期时间,如果没有则不返回该字段
}

type Asset

type Asset struct {
	Asset             string `json:"asset"`             //  资产名称
	MarginAvailable   bool   `json:"marginAvailable"`   // 是否可用作保证金
	AutoAssetExchange int    `json:"autoAssetExchange"` // 保证金资产自动兑换阈值
}

type Balance

type Balance struct {
	Asset  string `json:"asset"`  // 资产名称(币名)
	Free   string `json:"free"`   // 可以金额
	Locked string `json:"locked"` // 冻结金额
}

type CommissionRates

type CommissionRates struct {
	Maker  string `json:"maker"`  // 制造商
	Taker  string `json:"taker"`  // 接受者
	Buyer  string `json:"buyer"`  // 买家
	Seller string `json:"seller"` // 卖方
}

type ExchangeInfo

type ExchangeInfo struct {
	ExchangeFilters []interface{} `json:"exchangeFilters"`
	RateLimits      []*RateLimit  `json:"rateLimits"` // API访问的限制
	ServerTime      time.Time     `json:"serverTime"` // 请忽略。如果需要获取当前系统时间,请查询接口 "GET /fapi/v1/time"
	Assets          []*Asset      `json:"assets"`     // 资产信息
	Symbols         []*Symbol     `json:"symbols"`    // 交易对信息
	Timezone        string        `json:"timezone"`   // 服务器所用的时间区域
}

type FilerType

type FilerType string
const (

	// "filterType": "PRICE_FILTER", // 价格限制
	// "maxPrice": "300", // 价格上限, 最大价格
	// "minPrice": "0.0001", // 价格下限, 最小价格
	// "tickSize": "0.0001" // 订单最小价格间隔
	PRICE_FILTER FilerType = "PRICE_FILTER"

	// "filterType": "LOT_SIZE", // 数量限制
	// "maxQty": "10000000", // 数量上限, 最大数量
	// "minQty": "1", // 数量下限, 最小数量
	// "stepSize": "1" // 订单最小数量间隔
	LOT_SIZE FilerType = "LOT_SIZE"

	// "filterType": "MARKET_LOT_SIZE", // 市价订单数量限制
	// "maxQty": "590119", // 数量上限, 最大数量
	// "minQty": "1", // 数量下限, 最小数量
	// "stepSize": "1" // 允许的步进值
	MARKET_LOT_SIZE FilerType = "MARKET_LOT_SIZE"

	// "filterType": "MAX_NUM_ORDERS", // 最多订单数限制
	// "limit": 200
	MAX_NUM_ORDERS FilerType = "MAX_NUM_ORDERS"

	// "filterType": "MAX_NUM_ALGO_ORDERS", // 最多条件订单数限制
	// "limit": 100
	MAX_NUM_ALGO_ORDERS FilerType = "MAX_NUM_ALGO_ORDERS"

	// "filterType": "MIN_NOTIONAL",  // 最小名义价值
	// "notional": "5.0",
	MIN_NOTIONAL FilerType = "MIN_NOTIONAL"

	// "filterType": "PERCENT_PRICE", // 价格比限制
	// "multiplierUp": "1.1500", // 价格上限百分比
	// "multiplierDown": "0.8500", // 价格下限百分比
	// "multiplierDecimal": 4
	PERCENT_PRICE FilerType = "PERCENT_PRICE"
)

type Klines

type Klines struct {
	OpenTime             time.Time  `json:"0"`  // k线开盘时间
	OpenPrice            *big.Float `json:"1"`  // 开盘价
	HighPrice            *big.Float `json:"2"`  // 最高价
	LowPrice             *big.Float `json:"3"`  // 最低价
	ClosePrice           *big.Float `json:"4"`  // 收盘价
	Volume               *big.Float `json:"5"`  // 成交量
	ClosingTime          time.Time  `json:"6"`  // 收盘价(当前K线未结束的即为最新价)
	VolumeOfBusiness     *big.Float `json:"7"`  // 成交额
	TxNumber             int        `json:"8"`  // 成交笔数
	ActiveBuyingVolume   *big.Float `json:"9"`  // 主动买入成交量
	ActiveBuyingTurnover *big.Float `json:"10"` // 主动买入成交额
	Ignore               *big.Float `json:"11"` // 请忽略该参数
}

type RateLimit

type RateLimit struct {
	Interval      string `json:"interval"`      // 按照分钟计算
	IntervalNum   int    `json:"intervalNum"`   // 按照1分钟计算
	Limit         int    `json:"limit"`         // 上限次数
	RateLimitType string `json:"rateLimitType"` // 按照访问权重来计算
}

type Symbol

type Symbol struct {
	Symbol                string     `json:"symbol"`                // 交易对
	Pair                  string     `json:"pair"`                  // 标的交易对
	ContractType          string     `json:"contractType"`          // 合约类型
	DeliveryDate          time.Time  `json:"deliveryDate"`          // 交割日期
	OnboardDate           time.Time  `json:"onboardDate"`           // 上线日期
	Status                string     `json:"status"`                // 交易对状态
	MaintMarginPercent    *big.Float `json:"maintMarginPercent"`    // 请忽略
	RequiredMarginPercent *big.Float `json:"requiredMarginPercent"` // 请忽略
	BaseAsset             string     `json:"baseAsset"`             // 标的资产
	QuoteAsset            string     `json:"quoteAsset"`            // 报价资产
	MarginAsset           string     `json:"marginAsset"`           // 保证金资产
	PricePrecision        int        `json:"pricePrecision"`        // 价格小数点位数(仅作为系统精度使用,注意同tickSize 区分)
	QuantityPrecision     int        `json:"quantityPrecision"`     // 数量小数点位数(仅作为系统精度使用,注意同stepSize 区分)
	BaseAssetPrecision    int        `json:"baseAssetPrecision"`    // 标的资产精度
	QuotePrecision        int        `json:"quotePrecision"`        // 报价资产精度
	UnderlyingType        string     `json:"underlyingType"`
	UnderlyingSubType     []string   `json:"underlyingSubType"`
	SettlePlan            int        `json:"settlePlan"`
	TriggerProtect        *big.Float `json:"triggerProtect"` // 开启"priceProtect"的条件订单的触发阈值
	Filters               []*filter  `json:"filters"`

	//	"OrderType": [ // 订单类型
	// 		"LIMIT",  // 限价单
	// 		"MARKET",  // 市价单
	//		"STOP", // 止损单
	// 		"STOP_MARKET", // 止损市价单
	//		"TAKE_PROFIT", // 止盈单
	// 		"TAKE_PROFIT_MARKET", // 止盈暑市价单
	//     	"TRAILING_STOP_MARKET" // 跟踪止损市价单
	//	]
	OrderType []string `json:"OrderType"` // 订单类型

	//	"timeInForce": [ // 有效方式
	//  	"GTC", // 成交为止, 一直有效
	//     	"IOC", // 无法立即成交(吃单)的部分就撤销
	//    	"FOK", // 无法全部立即成交就撤销
	//  	"GTX" // 无法成为挂单方就撤销
	//	],
	TimeInForce     []string   `json:"timeInForce"`     // 订单类型
	LiquidationFee  *big.Float `json:"liquidationFee"`  // 强平费率
	MarketTakeBound *big.Float `json:"marketTakeBound"` //  市价吃单(相对于标记价格)允许可造成的最大价格偏离比例
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL