Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CoinsData
- type Hibitex
- func (e *Hibitex) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Hibitex) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Hibitex) CanDeposit(coin *coin.Coin) bool
- func (e *Hibitex) CanWithdraw(coin *coin.Coin) bool
- func (e *Hibitex) CancelAllOrder() error
- func (e *Hibitex) CancelOrder(order *exchange.Order) error
- func (e *Hibitex) DeleteCoin(coin *coin.Coin)
- func (e *Hibitex) DeletePair(pair *pair.Pair)
- func (e *Hibitex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Hibitex) GetBalance(coin *coin.Coin) float64
- func (e *Hibitex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Hibitex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Hibitex) GetCoins() []*coin.Coin
- func (e *Hibitex) GetCoinsData() error
- func (e *Hibitex) GetConfirmation(coin *coin.Coin) int
- func (e *Hibitex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Hibitex) GetFee(pair *pair.Pair) float64
- func (e *Hibitex) GetID() int
- func (e *Hibitex) GetLotSize(pair *pair.Pair) float64
- func (e *Hibitex) GetName() exchange.ExchangeName
- func (e *Hibitex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Hibitex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Hibitex) GetPairs() []*pair.Pair
- func (e *Hibitex) GetPairsData() error
- func (e *Hibitex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Hibitex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Hibitex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Hibitex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Hibitex) GetTxFee(coin *coin.Coin) float64
- func (e *Hibitex) HasPair(pair *pair.Pair) bool
- func (e *Hibitex) InitData() error
- func (e *Hibitex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Hibitex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Hibitex) ListOrders() ([]*exchange.Order, error)
- func (e *Hibitex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Hibitex) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Hibitex) OrderStatus(order *exchange.Order) error
- func (e *Hibitex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Hibitex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Hibitex) UpdateAllBalances()
- func (e *Hibitex) UpdateConstraint()
- func (e *Hibitex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type Ticker
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 60 DEFAULT_TAKER_FEE = 0.002 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL = "https://openapi.hibitex.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances struct { TotalAsset float64 `json:"total_asset"` CoinList []struct { Coin string `json:"coin"` Normal float64 `json:"normal"` Locked float64 `json:"locked"` BtcValuatin float64 `json:"btcValuatin"` } `json:"coin_list"` }
********* Private API Structure*********
type Hibitex ¶
type Hibitex 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 CreateHibitex ¶
*************************************************
func (*Hibitex) ApiKeyGet ¶
************** Signature Http Request ************** Method: API Get 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 (*Hibitex) ApiKeyRequest ¶
func (e *Hibitex) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
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
func (*Hibitex) CancelAllOrder ¶
func (*Hibitex) DeleteCoin ¶
func (*Hibitex) DeletePair ¶
func (*Hibitex) DoAccountOperation ¶
func (e *Hibitex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Hibitex) GetCoinConstraint ¶
func (e *Hibitex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Hibitex) 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(strRequestPath)
func (*Hibitex) GetConstraintFetchMethod ¶
func (e *Hibitex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Hibitex) GetName ¶
func (e *Hibitex) GetName() exchange.ExchangeName
func (*Hibitex) GetPairConstraint ¶
func (e *Hibitex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Hibitex) 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 (*Hibitex) LoadPublicData ¶
func (e *Hibitex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Hibitex) 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.GetSymbolByPair(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 (*Hibitex) SetCoinConstraint ¶
func (e *Hibitex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Hibitex) SetPairConstraint ¶
func (e *Hibitex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Hibitex) UpdateAllBalances ¶
func (e *Hibitex) UpdateAllBalances()
func (*Hibitex) UpdateConstraint ¶
func (e *Hibitex) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code string `json:"code"` Msg string `json:"msg"` Message interface{} `json:"message"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus struct { Count int `json:"count"` ResultList []struct { Side string `json:"side"` TotalPrice string `json:"total_price"` CreatedAt int64 `json:"created_at"` AvgPrice string `json:"avg_price"` CountCoin string `json:"countCoin"` Source int `json:"source"` Type int `json:"type"` SideMsg string `json:"side_msg"` Volume string `json:"volume"` Price string `json:"price"` SourceMsg string `json:"source_msg"` StatusMsg string `json:"status_msg"` DealVolume string `json:"deal_volume"` ID int `json:"id"` RemainVolume string `json:"remain_volume"` BaseCoin string `json:"baseCoin"` Status int `json:"status"` } `json:"resultList"` }
type PlaceOrder ¶
type PlaceOrder struct {
OrderID int `json:"order_id"`
}
type Ticker ¶
type Ticker struct { Symbol string `json:"symbol"` CountCoin string `json:"count_coin"` AmountPrecision int `json:"amount_precision"` BaseCoin string `json:"base_coin"` PricePrecision int `json:"price_precision"` }
********* Public API Structure*********