Documentation
¶
Index ¶
- Constants
- func Init(ctx context.Context) error
- func ParseSymbol(symbol string) (exchange.SwapSymbol, error)
- type CommisionRate
- type ExchangeInfo
- type Filter
- type Income
- type IncomeType
- type RestClient
- func (rc *RestClient) CommisionRate(ctx context.Context, symbol string) (*CommisionRate, error)
- 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) Finance(ctx context.Context, req *exchange.FinanceReqParam) ([]exchange.Finance, error)
- func (rc *RestClient) Income(ctx context.Context, symbol string, it IncomeType, st int64, et int64, ...) ([]Income, error)
- func (rc *RestClient) Property() exchange.Property
- func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SwapSymbol, error)
- func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
- func (rc *RestClient) UserTrades(ctx context.Context, symbol string, st int64, et int64, fid int64, limit int) ([]Trade, error)
- type SwapSymbol
- type Symbol
- type Trade
Constants ¶
View Source
const (
CommiionRateEndPoint = "/fapi/v1/commissionRate"
)
View Source
const (
IncomeEndPoint = "/fapi/v1/income"
)
View Source
const (
SwapAPIHost string = "fapi.binance.com"
)
View Source
const (
UserTradesEndPoint = "/fapi/v1/userTrades"
)
Variables ¶
This section is empty.
Functions ¶
func ParseSymbol ¶ added in v0.3.0
func ParseSymbol(symbol string) (exchange.SwapSymbol, error)
Types ¶
type CommisionRate ¶ added in v0.3.0
type ExchangeInfo ¶ added in v0.3.0
type ExchangeInfo struct { Timezone string `json:"timezone"` ServerTime int64 `json:"serverTime"` Symbols []Symbol `json:"symbols"` }
TODO add additinoal field parse
type Filter ¶ added in v0.3.0
type Filter struct { MinPrice decimal.Decimal `json:"minPrice"` MaxPrice decimal.Decimal `json:"maxPrice"` FilterType string `json:"filterType"` TickSize decimal.Decimal `json:"tickSize"` StepSize decimal.Decimal `json:"stepSize"` MaxQty decimal.Decimal `json:"maxQty"` MinQty decimal.Decimal `json:"minQty"` Limit int `json:"limit"` MultiplierDown decimal.Decimal `json:"multiplierDown"` MultiplierUp decimal.Decimal `json:"multiplierUp"` MultiplierDecimal decimal.Decimal `json:"multiplierDecimal"` }
type Income ¶ added in v0.3.0
type IncomeType ¶ added in v0.3.0
type IncomeType string
const ( IncomeTypeNone IncomeType = "" IncomeTypeTransfer IncomeType = "TRANSFER" IncomeTypeWelcomeBonus IncomeType = "WELCOME_BONUS" IncomeTypeRealizedPnl IncomeType = "REALIZED_PNL" IncomeTypeFundingFee IncomeType = "FUNDING_FEE" IncomeTypeCommission IncomeType = "COMMISSION" IncomeTypeInsuranceClear IncomeType = "INSURANCE_CLEAR" )
func (IncomeType) Parse ¶ added in v0.3.0
func (ic IncomeType) Parse() exchange.FinanceType
type RestClient ¶
type RestClient struct {
*binance.RestClient
}
RestClient struct
func NewRestClient ¶
func NewRestClient(key, secret string) *RestClient
func (*RestClient) CommisionRate ¶ added in v0.3.0
func (rc *RestClient) CommisionRate(ctx context.Context, symbol string) (*CommisionRate, error)
func (*RestClient) ExchangeInfo ¶ added in v0.3.0
func (rc *RestClient) ExchangeInfo(ctx context.Context) (*ExchangeInfo, error)
func (*RestClient) Finance ¶ added in v0.3.0
func (rc *RestClient) Finance(ctx context.Context, req *exchange.FinanceReqParam) ([]exchange.Finance, error)
func (*RestClient) Income ¶ added in v0.3.0
func (rc *RestClient) Income(ctx context.Context, symbol string, it IncomeType, st int64, et int64, limit int) ([]Income, error)
func (*RestClient) Property ¶ added in v0.3.0
func (rc *RestClient) Property() exchange.Property
func (*RestClient) Symbols ¶
func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SwapSymbol, error)
func (*RestClient) Trades ¶ added in v0.3.0
func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
type SwapSymbol ¶
type SwapSymbol struct { *exchange.BaseSwapSymbol Symbol string }
func (*SwapSymbol) String ¶
func (s *SwapSymbol) String() string
type Symbol ¶ added in v0.3.0
type Symbol struct { Symbol string `json:"symbol"` Status string `json:"status"` MaintMarginPercent decimal.Decimal `json:"maintMarginPercent"` RequiredMarginPercent decimal.Decimal `json:"requiredMarginPercent"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` PricePrecision int `json:"pricePrecision"` QuantityPrecision int `json:"quantityPrecision"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuotePrecision int `json:"quotePrecision"` UnderlyingType string `json:"COIN"` Filters []Filter `json:"filters"` OrderTypes []string `json:"orderTypes"` TimeInForce []string `json:"timeInForce"` }
type Trade ¶ added in v0.3.0
type Trade struct { Symbol string `json:"symbol"` ID int64 `json:"id"` OrderID int64 `json:"orderId"` Price decimal.Decimal `json:"price"` Qty decimal.Decimal `json:"qty"` QuoteQty decimal.Decimal `json:"quoteQty"` Commission decimal.Decimal `json:"commission"` CommissionAsset string `json:"commissionAsset"` RealizedPnl decimal.Decimal `json:"realizedPnl"` Side string `json:"SIDE"` PositionSide string `json:"positionSide"` Time int64 `json:"time"` Maker bool `json:"Maker"` }
Click to show internal directories.
Click to hide internal directories.