Documentation
¶
Index ¶
- Constants
- func ComputeHmac512(strMessage string, strSecret string) string
- type AccountBalances
- type CancelOrder
- type CoinsConstrain
- type CoinsData
- type Constrain
- type FreeBalance
- type Gateio
- func (e *Gateio) ApiKeyPost(strRequestPath string, mapParams map[string]string) string
- func (e *Gateio) CanDeposit(coin *coin.Coin) bool
- func (e *Gateio) CanWithdraw(coin *coin.Coin) bool
- func (e *Gateio) CancelAllOrder() error
- func (e *Gateio) CancelOrder(order *exchange.Order) error
- func (e *Gateio) DeleteCoin(coin *coin.Coin)
- func (e *Gateio) DeletePair(pair *pair.Pair)
- func (e *Gateio) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Gateio) GetBalance(coin *coin.Coin) float64
- func (e *Gateio) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Gateio) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Gateio) GetCoins() []*coin.Coin
- func (e *Gateio) GetCoinsData() error
- func (e *Gateio) GetConfirmation(coin *coin.Coin) int
- func (e *Gateio) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Gateio) GetFee(pair *pair.Pair) float64
- func (e *Gateio) GetID() int
- func (e *Gateio) GetLotSize(pair *pair.Pair) float64
- func (e *Gateio) GetName() exchange.ExchangeName
- func (e *Gateio) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Gateio) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Gateio) GetPairs() []*pair.Pair
- func (e *Gateio) GetPairsData() error
- func (e *Gateio) GetPriceFilter(pair *pair.Pair) float64
- func (e *Gateio) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Gateio) GetSymbolByPair(pair *pair.Pair) string
- func (e *Gateio) GetTradingWebURL(pair *pair.Pair) string
- func (e *Gateio) GetTxFee(coin *coin.Coin) float64
- func (e *Gateio) HasPair(pair *pair.Pair) bool
- func (e *Gateio) InitData() error
- func (e *Gateio) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Gateio) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Gateio) ListOrders() ([]*exchange.Order, error)
- func (e *Gateio) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Gateio) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Gateio) OrderStatus(order *exchange.Order) error
- func (e *Gateio) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Gateio) SetConstraint() error
- func (e *Gateio) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Gateio) UpdateAllBalances()
- func (e *Gateio) UpdateConstraint()
- func (e *Gateio) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- func (e *Gateio) WithdrawKeyRequest(strRequestPath string, mapParams map[string]string) string
- type OrderBook
- type OrderStatus
- type Pair
- type PairsData
- type PlaceOrder
- type TradeHistory
- type WithdrawResponse
Constants ¶
const ( API_URL string = "https://data.gate.io" Private_URL string = "https://api.gateio.io" )
const ( DEFAULT_ID = 19 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
Variables ¶
This section is empty.
Functions ¶
func ComputeHmac512 ¶
Types ¶
type AccountBalances ¶
type AccountBalances struct { Result string `json:"result"` Available json.RawMessage `json:"available"` Locked json.RawMessage `json:"locked"` Code int `json:"code"` Message string `json:"message"` }
type CancelOrder ¶
type CancelOrder struct { Result bool `json:"result"` Order struct { OrderNumber string `json:"orderNumber"` Status string `json:"status"` CurrencyPair string `json:"currencyPair"` Type string `json:"type"` Rate string `json:"rate"` Amount string `json:"amount"` InitialRate string `json:"initialRate"` InitialAmount string `json:"initialAmount"` FilledAmount string `json:"filledAmount"` FilledRate string `json:"filledRate"` FeePercentage float64 `json:"feePercentage"` FeeValue string `json:"feeValue"` FeeCurrency string `json:"feeCurrency"` Fee string `json:"fee"` Timestamp int `json:"timestamp"` } `json:"order"` Message string `json:"message"` Code int `json:"code"` Elapsed string `json:"elapsed"` }
type CoinsConstrain ¶
type CoinsData ¶
type CoinsData struct { Result string `json:"result"` Data []struct { No int `json:"no"` Symbol string `json:"symbol"` Name string `json:"name"` NameEn string `json:"name_en"` NameCn string `json:"name_cn"` Pair string `json:"pair"` Rate string `json:"rate"` VolA string `json:"vol_a"` VolB string `json:"vol_b"` CurrA string `json:"curr_a"` CurrB string `json:"curr_b"` CurrSuffix string `json:"curr_suffix"` RatePercent string `json:"rate_percent"` Trend string `json:"trend"` Supply interface{} `json:"supply"` Marketcap interface{} `json:"marketcap"` Lq string `json:"lq"` } `json:"data"` }
type FreeBalance ¶
type Gateio ¶
type Gateio 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 CreateGateio ¶
*************************************************
func (*Gateio) 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 (*Gateio) CancelAllOrder ¶
func (*Gateio) DeleteCoin ¶
func (*Gateio) DeletePair ¶
func (*Gateio) DoAccountOperation ¶
func (e *Gateio) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Gateio) GetCoinConstraint ¶
func (e *Gateio) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Gateio) 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 (*Gateio) GetConstraintFetchMethod ¶
func (e *Gateio) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Gateio) GetName ¶
func (e *Gateio) GetName() exchange.ExchangeName
func (*Gateio) GetPairConstraint ¶
func (e *Gateio) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Gateio) 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 (*Gateio) LoadPublicData ¶
func (e *Gateio) LoadPublicData(operation *exchange.PublicOperation) error
func (*Gateio) 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 (*Gateio) SetCoinConstraint ¶
func (e *Gateio) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Gateio) SetConstraint ¶
func (*Gateio) SetPairConstraint ¶
func (e *Gateio) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Gateio) UpdateAllBalances ¶
func (e *Gateio) UpdateAllBalances()
func (*Gateio) UpdateConstraint ¶
func (e *Gateio) UpdateConstraint()
type OrderStatus ¶
type OrderStatus struct { Result string `json:"result"` Order struct { ID string `json:"id"` Status string `json:"status"` Pair string `json:"pair"` Type string `json:"type"` Rate string `json:"rate"` Amount string `json:"amount"` InitialRate string `json:"initial_rate"` InitialAmount string `json:"initial_amount"` } `json:"order"` Message string `json:"message"` }
type PlaceOrder ¶
type PlaceOrder struct { Result string `json:"result"` Message string `json:"message"` Code int `json:"code"` Ctime float64 `json:"ctime"` Side int `json:"side"` OrderNumber int `json:"orderNumber"` Rate string `json:"rate"` LeftAmount string `json:"leftAmount"` DealStock string `json:"deal_stock"` DealMoney string `json:"deal_money"` FilledAmount string `json:"filledAmount"` FilledRate string `json:"filledRate"` FeePercentage float64 `json:"feePercentage"` FeeValue string `json:"feeValue"` FeeCurrency string `json:"feeCurrency"` Fee string `json:"fee"` }
type TradeHistory ¶
type TradeHistory struct { Elapsed string `json:"elapsed"` Result string `json:"result"` Data []struct { TradeID string `json:"tradeID"` Total string `json:"total"` Date string `json:"date"` Rate string `json:"rate"` Amount string `json:"amount"` Timestamp string `json:"timestamp"` Type string `json:"type"` } `json:"data"` }