Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Hoo
- func (e *Hoo) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Hoo) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
- func (e *Hoo) CanDeposit(coin *coin.Coin) bool
- func (e *Hoo) CanWithdraw(coin *coin.Coin) bool
- func (e *Hoo) CancelAllOrder() error
- func (e *Hoo) CancelOrder(order *exchange.Order) error
- func (e *Hoo) DeleteCoin(coin *coin.Coin)
- func (e *Hoo) DeletePair(pair *pair.Pair)
- func (e *Hoo) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Hoo) GetBalance(coin *coin.Coin) float64
- func (e *Hoo) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Hoo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Hoo) GetCoins() []*coin.Coin
- func (e *Hoo) GetCoinsData() error
- func (e *Hoo) GetConfirmation(coin *coin.Coin) int
- func (e *Hoo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Hoo) GetFee(pair *pair.Pair) float64
- func (e *Hoo) GetID() int
- func (e *Hoo) GetLotSize(pair *pair.Pair) float64
- func (e *Hoo) GetName() exchange.ExchangeName
- func (e *Hoo) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Hoo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Hoo) GetPairs() []*pair.Pair
- func (e *Hoo) GetPairsData() error
- func (e *Hoo) GetPriceFilter(pair *pair.Pair) float64
- func (e *Hoo) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Hoo) GetSymbolByPair(pair *pair.Pair) string
- func (e *Hoo) GetTradingWebURL(pair *pair.Pair) string
- func (e *Hoo) GetTxFee(coin *coin.Coin) float64
- func (e *Hoo) HasPair(pair *pair.Pair) bool
- func (e *Hoo) InitData() error
- func (e *Hoo) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Hoo) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Hoo) ListOrders() ([]*exchange.Order, error)
- func (e *Hoo) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Hoo) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Hoo) OrderStatus(order *exchange.Order) error
- func (e *Hoo) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Hoo) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Hoo) UpdateAllBalances()
- func (e *Hoo) UpdateConstraint()
- func (e *Hoo) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 68 DEFAULT_TAKER_FEE = 0.002 DEFAULT_MAKER_FEE = 0.002 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 string = "https://api.hoo.co"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Hoo ¶
type Hoo 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 (*Hoo) ApiKeyGET ¶
************** 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 (*Hoo) ApiKeyRequest ¶
func (*Hoo) CancelAllOrder ¶
func (*Hoo) DeleteCoin ¶
func (*Hoo) DeletePair ¶
func (*Hoo) DoAccountOperation ¶
func (e *Hoo) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Hoo) GetCoinConstraint ¶
func (e *Hoo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Hoo) 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 (*Hoo) GetConstraintFetchMethod ¶
func (e *Hoo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Hoo) GetName ¶
func (e *Hoo) GetName() exchange.ExchangeName
func (*Hoo) GetPairConstraint ¶
func (e *Hoo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Hoo) 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 (*Hoo) LoadPublicData ¶
func (e *Hoo) LoadPublicData(operation *exchange.PublicOperation) error
************** Public API **************
func (*Hoo) 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 (*Hoo) OrderStatus ¶
order has delay, should not use OrderStatus immediately after order change
func (*Hoo) SetCoinConstraint ¶
func (e *Hoo) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Hoo) SetPairConstraint ¶
func (e *Hoo) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Hoo) UpdateAllBalances ¶
func (e *Hoo) UpdateAllBalances()
func (*Hoo) UpdateConstraint ¶
func (e *Hoo) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus struct { CreateAt int64 `json:"create_at"` Fee string `json:"fee"` MatchAmt string `json:"match_amt"` MatchPrice string `json:"match_price"` MatchQty string `json:"match_qty"` OrderID string `json:"order_id"` OrderType int `json:"order_type"` Price string `json:"price"` Quantity string `json:"quantity"` Side int `json:"side"` Status int `json:"status"` Ticker string `json:"ticker"` TradeNo string `json:"trade_no"` Trades []interface{} `json:"trades"` }