Documentation
¶
Index ¶
- Constants
- func Init(ctx context.Context) error
- func ParseSymbol(symbol string) (exchange.SpotSymbol, error)
- type Direct
- type MatchResult
- type RestClient
- func (rc *RestClient) FeeRate(ctx context.Context, symbols []exchange.Symbol) ([]*exchange.TradeFee, error)
- func (rc *RestClient) FetchSymbols(ctx context.Context) ([]Symbol, error)
- func (rc *RestClient) MatchResults(ctx context.Context, symbol string, types []string, st int64, et int64, ...) ([]MatchResult, error)
- func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SpotSymbol, error)
- func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
- func (rc *RestClient) TransactFeeRate(ctx context.Context, symbols []string) ([]TransactFeeRate, error)
- type SpotSymbol
- type Symbol
- type SymbolResp
- type TransactFeeRate
Constants ¶
View Source
const ( DirectNone Direct = "" DirectPrev Direct = "forward" DirectNext Direct = "next" MatchResutEndPoint = "/v1/order/matchresults" MatchRoleMaker = "maker" MatchRoleTaker = "taker" )
View Source
const (
SpotHost = "api.huobi.pro"
)
View Source
const (
TransactFeeRateEndPoint = "/v2/reference/transact-fee-rate"
)
Variables ¶
This section is empty.
Functions ¶
func ParseSymbol ¶ added in v0.3.0
func ParseSymbol(symbol string) (exchange.SpotSymbol, error)
Types ¶
type MatchResult ¶ added in v0.3.0
type MatchResult struct { ID int64 `json:"id"` MatchID int64 `json:"match-id"` OrderID int64 `json:"order-id"` TradeID int64 `json:"trade-id"` CreatedAt int64 `json:"created-at"` FilledAmount decimal.Decimal `json:"filled-amount"` FilledFees decimal.Decimal `json:"filled-fees"` FilledPoints decimal.Decimal `json:"filled-points"` FeeCurrency string `json:"fee-currency"` Price decimal.Decimal `json:"price"` Source string `json:"source"` Symbol string `json:"symbol"` Type string `json:"type"` Role string `json:"role"` FeeDeductCurrency string `json:"fee-deduct-currency"` FeeDeductState string `json:"fee-deduct-state"` }
type RestClient ¶
type RestClient struct {
*huobi.RestClient
}
func NewRestClient ¶
func NewRestClient(key, secret string) *RestClient
func (*RestClient) FetchSymbols ¶ added in v0.3.0
func (rc *RestClient) FetchSymbols(ctx context.Context) ([]Symbol, error)
func (*RestClient) MatchResults ¶ added in v0.3.0
func (*RestClient) Symbols ¶ added in v0.3.0
func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SpotSymbol, error)
func (*RestClient) Trades ¶ added in v0.3.0
func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
func (*RestClient) TransactFeeRate ¶ added in v0.3.0
func (rc *RestClient) TransactFeeRate(ctx context.Context, symbols []string) ([]TransactFeeRate, error)
type SpotSymbol ¶
type SpotSymbol struct { *exchange.BaseSpotSymbol Symbol string }
func (*SpotSymbol) String ¶
func (ss *SpotSymbol) String() string
type Symbol ¶
type Symbol struct { BaseCurrency string `json:"base-currency"` QuoteCurreny string `json:"quote-currency"` Symbol string `json:"symbol"` }
TODO add precision
type SymbolResp ¶
Click to show internal directories.
Click to hide internal directories.