Documentation
¶
Index ¶
- Constants
- Variables
- func Init(ctx context.Context) error
- func NewSymbol(base, quote string) exchange.SpotSymbol
- func ParseSymbol(sym string) (exchange.SpotSymbol, error)
- type ExchangeInfo
- type RestClient
- func (rc *RestClient) ExchangeInfo(ctx context.Context) (*ExchangeInfo, error)
- func (rc *RestClient) FeeRate(ctx context.Context, symbols []exchange.Symbol) ([]*exchange.TradeFee, error)
- func (rc *RestClient) MyTrades(ctx context.Context, symbol string, st int64, et int64, fid int64, limit int) ([]Trade, error)
- func (rc *RestClient) Property() exchange.Property
- func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SpotSymbol, error)
- func (rc *RestClient) TradeFee(ctx context.Context, symbol string) ([]TradeFee, error)
- func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
- type SpotSymbol
- type Symbol
- type Trade
- type TradeFee
- type TradeFeeResp
Constants ¶
View Source
const (
MyTradesEndPoint = "/api/v3/myTrades"
)
View Source
const (
TradeFeeEndPoint = "/wapi/v3/tradeFee.html"
)
Variables ¶
View Source
var (
ErrPair = errors.New("symbol pair not support")
)
Functions ¶
func NewSymbol ¶
func NewSymbol(base, quote string) exchange.SpotSymbol
func ParseSymbol ¶
func ParseSymbol(sym string) (exchange.SpotSymbol, error)
Types ¶
type ExchangeInfo ¶
type ExchangeInfo struct {
Symbols []Symbol `json:"symbols"`
}
type RestClient ¶
type RestClient struct {
*binance.RestClient
}
func NewRestClient ¶
func NewRestClient(key, secret string) *RestClient
func (*RestClient) ExchangeInfo ¶
func (rc *RestClient) ExchangeInfo(ctx context.Context) (*ExchangeInfo, error)
func (*RestClient) Property ¶
func (rc *RestClient) Property() exchange.Property
func (*RestClient) Symbols ¶
func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SpotSymbol, error)
func (*RestClient) Trades ¶
func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
type SpotSymbol ¶
type SpotSymbol struct { *exchange.BaseSpotSymbol Symbol string }
func (*SpotSymbol) String ¶
func (ss *SpotSymbol) String() string
type Symbol ¶
type Symbol struct { Symbol string `json:"symbol"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAssetPrecision int `json:"quoteAssetPrecision"` }
Symbol info TODO: refactor Symbol add more info pricePrecison ...
type Trade ¶
type Trade struct { Symbol string `json:"symbol"` ID int64 `json:"id"` OrderID int64 `json:"orderId"` OrderListID int64 `json:"orderListId"` Price decimal.Decimal `json:"price"` Qty decimal.Decimal `json:"qty"` QuoteQty decimal.Decimal `json:"quoteQty"` Commission decimal.Decimal `json:"commission"` CommissionAsset string `json:"commissionAsset"` Time int64 `json:"time"` IsBuyer bool `json:"isBuyer"` IsMaker bool `json:"isMaker"` IsBestMatch bool `json:"isBestMatch"` }
type TradeFeeResp ¶
Click to show internal directories.
Click to hide internal directories.