Documentation
¶
Index ¶
- Constants
- func GetContractName(code string) string
- type AccountBalances
- type ContractsData
- type Huobidm
- func (e *Huobidm) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Huobidm) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Huobidm) CanDeposit(coin *coin.Coin) bool
- func (e *Huobidm) CanWithdraw(coin *coin.Coin) bool
- func (e *Huobidm) CancelAllOrder() error
- func (e *Huobidm) CancelOrder(order *exchange.Order) error
- func (e *Huobidm) DeleteCoin(coin *coin.Coin)
- func (e *Huobidm) DeletePair(pair *pair.Pair)
- func (e *Huobidm) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Huobidm) GetBalance(coin *coin.Coin) float64
- func (e *Huobidm) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Huobidm) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Huobidm) GetCoins() []*coin.Coin
- func (e *Huobidm) GetCoinsData() error
- func (e *Huobidm) GetConfirmation(coin *coin.Coin) int
- func (e *Huobidm) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Huobidm) GetFee(pair *pair.Pair) float64
- func (e *Huobidm) GetID() int
- func (e *Huobidm) GetLotSize(pair *pair.Pair) float64
- func (e *Huobidm) GetName() exchange.ExchangeName
- func (e *Huobidm) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Huobidm) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Huobidm) GetPairs() []*pair.Pair
- func (e *Huobidm) GetPairsData() error
- func (e *Huobidm) GetPriceFilter(pair *pair.Pair) float64
- func (e *Huobidm) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Huobidm) GetSymbolByPair(pair *pair.Pair) string
- func (e *Huobidm) GetTradingWebURL(pair *pair.Pair) string
- func (e *Huobidm) GetTxFee(coin *coin.Coin) float64
- func (e *Huobidm) HasPair(pair *pair.Pair) bool
- func (e *Huobidm) InitData() error
- func (e *Huobidm) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Huobidm) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Huobidm) ListOrders() ([]*exchange.Order, error)
- func (e *Huobidm) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Huobidm) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Huobidm) OrderStatus(order *exchange.Order) error
- func (e *Huobidm) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Huobidm) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Huobidm) UpdateAllBalances()
- func (e *Huobidm) UpdateConstraint()
- func (e *Huobidm) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type JsonResponse2
- type OrderBook
- type PairsData
- type PlaceOrder
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 42 DEFAULT_TAKER_FEE = 0.0003 DEFAULT_MAKER_FEE = 0.0002 DEFAULT_LOT_SIZE = 1 DEFAULT_PRICE_FILTER = 0.01 //PRICE FILTER DEFAULT_TXFEE = 0.05 DEFAULT_WITHDRAW = false DEFAULT_DEPOSIT = false DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL = "https://api.hbdm.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
func GetContractName ¶
Types ¶
type AccountBalances ¶
type AccountBalances []struct { Asset string `json:"asset"` Total float64 `json:"total"` Available float64 `json:"available"` Locked float64 `json:"locked"` }
********* Private API Structure*********
type ContractsData ¶
type ContractsData []struct { Symbol string `json:"symbol"` ContractCode string `json:"contract_code"` ContractType string `json:"contract_type"` ContractSize float64 `json:"contract_size"` PriceTick float64 `json:"price_tick"` DeliveryDate string `json:"delivery_date"` CreateDate string `json:"create_date"` ContractStatus int `json:"contract_status"` }
********* Public API Structure*********
type Huobidm ¶
type Huobidm 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 CreateHuobidm ¶
*************************************************
func (*Huobidm) 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 (*Huobidm) ApiKeyRequest ¶
func (e *Huobidm) 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 (*Huobidm) CancelAllOrder ¶
func (*Huobidm) DeleteCoin ¶
func (*Huobidm) DeletePair ¶
func (*Huobidm) DoAccountOperation ¶
func (e *Huobidm) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Huobidm) GetCoinConstraint ¶
func (e *Huobidm) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Huobidm) 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 (*Huobidm) GetConstraintFetchMethod ¶
func (e *Huobidm) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Huobidm) GetName ¶
func (e *Huobidm) GetName() exchange.ExchangeName
func (*Huobidm) GetPairConstraint ¶
func (e *Huobidm) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Huobidm) GetPairsData ¶
func (*Huobidm) LoadPublicData ¶
func (e *Huobidm) LoadPublicData(operation *exchange.PublicOperation) error
func (*Huobidm) 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 (*Huobidm) SetCoinConstraint ¶
func (e *Huobidm) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Huobidm) SetPairConstraint ¶
func (e *Huobidm) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Huobidm) UpdateAllBalances ¶
func (e *Huobidm) UpdateAllBalances()
func (*Huobidm) UpdateConstraint ¶
func (e *Huobidm) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Status string `json:"status"` Data json.RawMessage `json:"data"` Ts int64 `json:"ts"` }
type JsonResponse2 ¶
type JsonResponse2 struct { Ch string `json:"ch"` Status string `json:"status"` Tick json.RawMessage `json:"tick"` Ts int64 `json:"ts"` }
type PairsData ¶
type PairsData []struct { Symbol string `json:"symbol"` Status string `json:"status"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` MakerFee float64 `json:"makerFee"` TakerFee float64 `json:"takerFee"` PriceFilter float64 `json:"priceFilter"` LotSize float64 `json:"lotSize"` }
type PlaceOrder ¶
type PlaceOrder struct { Symbol string `json:"symbol"` OrderID string `json:"orderId"` Side string `json:"side"` Type string `json:"type"` Price string `json:"price"` AveragePrice string `json:"executedQty"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` }