Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Goko
- func (e *Goko) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Goko) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Goko) CanDeposit(coin *coin.Coin) bool
- func (e *Goko) CanWithdraw(coin *coin.Coin) bool
- func (e *Goko) CancelAllOrder() error
- func (e *Goko) CancelOrder(order *exchange.Order) error
- func (e *Goko) DeleteCoin(coin *coin.Coin)
- func (e *Goko) DeletePair(pair *pair.Pair)
- func (e *Goko) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Goko) GetBalance(coin *coin.Coin) float64
- func (e *Goko) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Goko) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Goko) GetCoins() []*coin.Coin
- func (e *Goko) GetCoinsData() error
- func (e *Goko) GetConfirmation(coin *coin.Coin) int
- func (e *Goko) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Goko) GetFee(pair *pair.Pair) float64
- func (e *Goko) GetID() int
- func (e *Goko) GetLotSize(pair *pair.Pair) float64
- func (e *Goko) GetName() exchange.ExchangeName
- func (e *Goko) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Goko) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Goko) GetPairs() []*pair.Pair
- func (e *Goko) GetPairsData() error
- func (e *Goko) GetPriceFilter(pair *pair.Pair) float64
- func (e *Goko) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Goko) GetSymbolByPair(pair *pair.Pair) string
- func (e *Goko) GetTradingWebURL(pair *pair.Pair) string
- func (e *Goko) GetTxFee(coin *coin.Coin) float64
- func (e *Goko) HasPair(pair *pair.Pair) bool
- func (e *Goko) InitData() error
- func (e *Goko) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Goko) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Goko) ListOrders() ([]*exchange.Order, error)
- func (e *Goko) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Goko) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Goko) OrderStatus(order *exchange.Order) error
- func (e *Goko) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Goko) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Goko) UpdateAllBalances()
- func (e *Goko) UpdateConstraint()
- func (e *Goko) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type PairsData
- type PlaceOrder
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 46 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 //PRICE FILTER DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL = "https://openapi.goko.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 Goko ¶
type Goko 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 CreateGoko ¶
*************************************************
func (*Goko) 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 (*Goko) ApiKeyRequest ¶
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 (*Goko) CancelAllOrder ¶
func (*Goko) DeleteCoin ¶
func (*Goko) DeletePair ¶
func (*Goko) DoAccountOperation ¶
func (e *Goko) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Goko) GetCoinConstraint ¶
func (e *Goko) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Goko) 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 (*Goko) GetConstraintFetchMethod ¶
func (e *Goko) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Goko) GetName ¶
func (e *Goko) GetName() exchange.ExchangeName
func (*Goko) GetPairConstraint ¶
func (e *Goko) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Goko) 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 (*Goko) LoadPublicData ¶
func (e *Goko) LoadPublicData(operation *exchange.PublicOperation) error
func (*Goko) 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 (*Goko) SetCoinConstraint ¶
func (e *Goko) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Goko) SetPairConstraint ¶
func (e *Goko) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Goko) UpdateAllBalances ¶
func (e *Goko) UpdateAllBalances()
func (*Goko) UpdateConstraint ¶
func (e *Goko) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code string `json:"code"` Msg string `json:"msg"` Message interface{} `json:"message"` Data json.RawMessage `json:"data"` }
type PairsData ¶
type PairsData []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*********
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"` }