Documentation ¶
Index ¶
- Constants
- type HuobiOTC
- func (e *HuobiOTC) ApiKeyPost(strRequestPath string, mapParams map[string]string) string
- func (e *HuobiOTC) CanDeposit(coin *coin.Coin) bool
- func (e *HuobiOTC) CanWithdraw(coin *coin.Coin) bool
- func (e *HuobiOTC) CancelAllOrder() error
- func (e *HuobiOTC) CancelOrder(order *exchange.Order) error
- func (e *HuobiOTC) DeleteCoin(coin *coin.Coin)
- func (e *HuobiOTC) DeletePair(pair *pair.Pair)
- func (e *HuobiOTC) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *HuobiOTC) GetBalance(coin *coin.Coin) float64
- func (e *HuobiOTC) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *HuobiOTC) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *HuobiOTC) GetCoins() []*coin.Coin
- func (e *HuobiOTC) GetCoinsData() error
- func (e *HuobiOTC) GetConfirmation(coin *coin.Coin) int
- func (e *HuobiOTC) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *HuobiOTC) GetFee(pair *pair.Pair) float64
- func (e *HuobiOTC) GetID() int
- func (e *HuobiOTC) GetLotSize(pair *pair.Pair) float64
- func (e *HuobiOTC) GetName() exchange.ExchangeName
- func (e *HuobiOTC) GetPairBySymbol(symbol string) *pair.Pair
- func (e *HuobiOTC) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *HuobiOTC) GetPairs() []*pair.Pair
- func (e *HuobiOTC) GetPairsData() error
- func (e *HuobiOTC) GetPriceFilter(pair *pair.Pair) float64
- func (e *HuobiOTC) GetSymbolByCoin(coin *coin.Coin) string
- func (e *HuobiOTC) GetSymbolByPair(pair *pair.Pair) string
- func (e *HuobiOTC) GetTradingWebURL(pair *pair.Pair) string
- func (e *HuobiOTC) GetTxFee(coin *coin.Coin) float64
- func (e *HuobiOTC) HasPair(pair *pair.Pair) bool
- func (e *HuobiOTC) InitData() error
- func (e *HuobiOTC) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *HuobiOTC) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *HuobiOTC) ListOrders() ([]*exchange.Order, error)
- func (e *HuobiOTC) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *HuobiOTC) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *HuobiOTC) OrderStatus(order *exchange.Order) error
- func (e *HuobiOTC) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *HuobiOTC) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *HuobiOTC) UpdateAllBalances()
- func (e *HuobiOTC) UpdateConstraint()
- func (e *HuobiOTC) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
Constants ¶
const ( DEFAULT_ID = 8 DEFAULT_TAKER_FEE = 0.0 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.000001 DEFAULT_PRICE_FILTER = 0.01 //PRICE FILTER DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 )
const (
API_URL = "https://otc-api.eiijo.cn/v1/data"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HuobiOTC ¶
type HuobiOTC 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 CreateHuobiOTC ¶
*************************************************
func (*HuobiOTC) ApiKeyPost ¶
************** 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 (*HuobiOTC) CancelAllOrder ¶
func (*HuobiOTC) DeleteCoin ¶
func (*HuobiOTC) DeletePair ¶
func (*HuobiOTC) DoAccountOperation ¶
func (e *HuobiOTC) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*HuobiOTC) GetCoinConstraint ¶
func (e *HuobiOTC) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*HuobiOTC) 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 (*HuobiOTC) GetConstraintFetchMethod ¶
func (e *HuobiOTC) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*HuobiOTC) GetName ¶
func (e *HuobiOTC) GetName() exchange.ExchangeName
func (*HuobiOTC) GetPairConstraint ¶
func (e *HuobiOTC) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*HuobiOTC) 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 (*HuobiOTC) LoadPublicData ¶
func (e *HuobiOTC) LoadPublicData(operation *exchange.PublicOperation) error
func (*HuobiOTC) 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 (*HuobiOTC) SetCoinConstraint ¶
func (e *HuobiOTC) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*HuobiOTC) SetPairConstraint ¶
func (e *HuobiOTC) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*HuobiOTC) UpdateAllBalances ¶
func (e *HuobiOTC) UpdateAllBalances()
func (*HuobiOTC) UpdateConstraint ¶
func (e *HuobiOTC) UpdateConstraint()
type JsonResponse ¶
type OrderBook ¶
type OrderBook []struct { ID int `json:"id"` UID int `json:"uid"` UserName string `json:"userName"` MerchantLevel int `json:"merchantLevel"` CoinID int `json:"coinId"` Currency int `json:"currency"` TradeType int `json:"tradeType"` BlockType int `json:"blockType"` PayMethod string `json:"payMethod"` PayTerm int `json:"payTerm"` PayName string `json:"payName"` MinTradeLimit float64 `json:"minTradeLimit"` MaxTradeLimit float64 `json:"maxTradeLimit"` Price float64 `json:"price"` TradeCount float64 `json:"tradeCount"` IsOnline bool `json:"isOnline"` TradeMonthTimes int `json:"tradeMonthTimes"` OrderCompleteRate int `json:"orderCompleteRate"` TakerLimit int `json:"takerLimit"` GmtSort int64 `json:"gmtSort"` }