Documentation
¶
Index ¶
- Constants
- type AccountBalances
- type CoinsData
- type ErrResponse
- type Hitbtc
- func (e *Hitbtc) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
- func (e *Hitbtc) CanDeposit(coin *coin.Coin) bool
- func (e *Hitbtc) CanWithdraw(coin *coin.Coin) bool
- func (e *Hitbtc) CancelAllOrder() error
- func (e *Hitbtc) CancelOrder(order *exchange.Order) error
- func (e *Hitbtc) DeleteCoin(coin *coin.Coin)
- func (e *Hitbtc) DeletePair(pair *pair.Pair)
- func (e *Hitbtc) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Hitbtc) GetBalance(coin *coin.Coin) float64
- func (e *Hitbtc) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Hitbtc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Hitbtc) GetCoins() []*coin.Coin
- func (e *Hitbtc) GetCoinsData() error
- func (e *Hitbtc) GetConfirmation(coin *coin.Coin) int
- func (e *Hitbtc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Hitbtc) GetFee(pair *pair.Pair) float64
- func (e *Hitbtc) GetID() int
- func (e *Hitbtc) GetLotSize(pair *pair.Pair) float64
- func (e *Hitbtc) GetName() exchange.ExchangeName
- func (e *Hitbtc) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Hitbtc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Hitbtc) GetPairs() []*pair.Pair
- func (e *Hitbtc) GetPairsData() error
- func (e *Hitbtc) GetPriceFilter(pair *pair.Pair) float64
- func (e *Hitbtc) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Hitbtc) GetSymbolByPair(pair *pair.Pair) string
- func (e *Hitbtc) GetTradingWebURL(pair *pair.Pair) string
- func (e *Hitbtc) GetTxFee(coin *coin.Coin) float64
- func (e *Hitbtc) HasPair(pair *pair.Pair) bool
- func (e *Hitbtc) InitData() error
- func (e *Hitbtc) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Hitbtc) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Hitbtc) ListOrders() ([]*exchange.Order, error)
- func (e *Hitbtc) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Hitbtc) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Hitbtc) OrderStatus(order *exchange.Order) error
- func (e *Hitbtc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Hitbtc) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Hitbtc) UpdateAllBalances()
- func (e *Hitbtc) UpdateConstraint()
- func (e *Hitbtc) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type PairsData
- type PlaceOrder
- type TradeHistory
- type Withdraw
Constants ¶
const ( DEFAULT_ID = 15 DEFAULT_LISTED = true )
const (
API_URL string = "https://api.hitbtc.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type CoinsData ¶
type CoinsData []struct { ID string `json:"id"` FullName string `json:"fullName"` Crypto bool `json:"crypto"` PayinEnabled bool `json:"payinEnabled"` PayinPaymentID bool `json:"payinPaymentId"` PayinConfirmations int `json:"payinConfirmations"` PayoutEnabled bool `json:"payoutEnabled"` PayoutIsPaymentID bool `json:"payoutIsPaymentId"` TransferEnabled bool `json:"transferEnabled"` Delisted bool `json:"delisted"` PayoutFee string `json:"payoutFee"` }
type ErrResponse ¶
type Hitbtc ¶
type Hitbtc struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateHitbtc ¶
*************************************************
func (*Hitbtc) ApiKeyRequest ¶
func (e *Hitbtc) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
************** Signature Http Request ************** Method: API Request and Signature is required Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Create mapParams Depend on API Signature request Step 3: Add HttpGetRequest below strUrl if API has different requests
func (*Hitbtc) CancelAllOrder ¶
func (*Hitbtc) DeleteCoin ¶
func (*Hitbtc) DeletePair ¶
func (*Hitbtc) DoAccountOperation ¶
func (e *Hitbtc) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Hitbtc) GetCoinConstraint ¶
func (e *Hitbtc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Hitbtc) GetCoinsData ¶
************** Public API ************** Get Coins Information (If API provide) Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)
func (*Hitbtc) GetConstraintFetchMethod ¶
func (e *Hitbtc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Hitbtc) GetName ¶
func (e *Hitbtc) GetName() exchange.ExchangeName
func (*Hitbtc) GetPairConstraint ¶
func (e *Hitbtc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Hitbtc) GetPairsData ¶
GetPairsData - Get Pairs Information (If API provide)
Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)
func (*Hitbtc) LoadPublicData ¶
func (e *Hitbtc) LoadPublicData(operation *exchange.PublicOperation) error
func (*Hitbtc) OrderBook ¶
Get Pair Market Depth Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Get Exchange Pair Code ex. symbol := e.GetPairCode(p) Step 4: Modify API Path(strRequestUrl) Step 5: Add Params - Depend on API request Step 6: Convert the response to Standard Maker struct
func (*Hitbtc) SetCoinConstraint ¶
func (e *Hitbtc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Hitbtc) SetPairConstraint ¶
func (e *Hitbtc) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Hitbtc) UpdateAllBalances ¶
func (e *Hitbtc) UpdateAllBalances()
func (*Hitbtc) UpdateConstraint ¶
func (e *Hitbtc) UpdateConstraint()
type PairsData ¶
type PairsData []struct { ID string `json:"id"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` QuantityIncrement string `json:"quantityIncrement"` TickSize string `json:"tickSize"` TakeLiquidityRate string `json:"takeLiquidityRate"` ProvideLiquidityRate string `json:"provideLiquidityRate"` FeeCurrency string `json:"feeCurrency"` }
type PlaceOrder ¶
type PlaceOrder struct { ID int64 `json:"id"` ClientOrderID string `json:"clientOrderId"` Symbol string `json:"symbol"` Side string `json:"side"` Status string `json:"status"` Type string `json:"type"` TimeInForce string `json:"timeInForce"` Quantity string `json:"quantity"` Price string `json:"price"` CumQuantity string `json:"cumQuantity"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` PostOnly bool `json:"postOnly"` }
type TradeHistory ¶
type TradeHistory []struct { ID int `json:"id"` ClientOrderID string `json:"clientOrderId"` OrderID int `json:"orderId"` Symbol string `json:"symbol"` Side string `json:"side"` Quantity string `json:"quantity"` Price string `json:"price"` Fee string `json:"fee"` Timestamp time.Time `json:"timestamp"` }