Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bgogo
- func (e *Bgogo) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Bgogo) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Bgogo) CanDeposit(coin *coin.Coin) bool
- func (e *Bgogo) CanWithdraw(coin *coin.Coin) bool
- func (e *Bgogo) CancelAllOrder() error
- func (e *Bgogo) CancelOrder(order *exchange.Order) error
- func (e *Bgogo) DeleteCoin(coin *coin.Coin)
- func (e *Bgogo) DeletePair(pair *pair.Pair)
- func (e *Bgogo) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bgogo) GetBalance(coin *coin.Coin) float64
- func (e *Bgogo) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bgogo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bgogo) GetCoins() []*coin.Coin
- func (e *Bgogo) GetCoinsData() error
- func (e *Bgogo) GetConfirmation(coin *coin.Coin) int
- func (e *Bgogo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bgogo) GetFee(pair *pair.Pair) float64
- func (e *Bgogo) GetID() int
- func (e *Bgogo) GetLotSize(pair *pair.Pair) float64
- func (e *Bgogo) GetName() exchange.ExchangeName
- func (e *Bgogo) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bgogo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bgogo) GetPairs() []*pair.Pair
- func (e *Bgogo) GetPairsData() error
- func (e *Bgogo) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bgogo) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bgogo) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bgogo) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bgogo) GetTxFee(coin *coin.Coin) float64
- func (e *Bgogo) HasPair(pair *pair.Pair) bool
- func (e *Bgogo) InitData() error
- func (e *Bgogo) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bgogo) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bgogo) ListOrders() ([]*exchange.Order, error)
- func (e *Bgogo) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bgogo) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Bgogo) OrderStatus(order *exchange.Order) error
- func (e *Bgogo) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bgogo) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bgogo) UpdateAllBalances()
- func (e *Bgogo) UpdateConstraint()
- func (e *Bgogo) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CoinsData
- type JsonResponse
- type OrderBook
- type OrderItem
- type PairsData
- type PlaceOrder
- type SnapshotData
- type SnapshotJson
- type Ticker
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 61 DEFAULT_TAKER_FEE = 0.002 DEFAULT_MAKER_FEE = 0.001 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 = "https://bgogo.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 Bgogo ¶
type Bgogo 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 CreateBgogo ¶
*************************************************
func (*Bgogo) 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 (*Bgogo) 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 (*Bgogo) CancelAllOrder ¶
func (*Bgogo) DeleteCoin ¶
func (*Bgogo) DeletePair ¶
func (*Bgogo) DoAccountOperation ¶
func (e *Bgogo) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bgogo) GetCoinConstraint ¶
func (e *Bgogo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bgogo) 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 (*Bgogo) GetConstraintFetchMethod ¶
func (e *Bgogo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bgogo) GetName ¶
func (e *Bgogo) GetName() exchange.ExchangeName
func (*Bgogo) GetPairConstraint ¶
func (e *Bgogo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bgogo) 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 (*Bgogo) LoadPublicData ¶
func (e *Bgogo) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bgogo) 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 (*Bgogo) SetCoinConstraint ¶
func (e *Bgogo) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bgogo) SetPairConstraint ¶
func (e *Bgogo) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bgogo) UpdateAllBalances ¶
func (e *Bgogo) UpdateAllBalances()
func (*Bgogo) UpdateConstraint ¶
func (e *Bgogo) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
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"` }
type SnapshotData ¶
type SnapshotData struct { PriceStep string `json:"price_step"` AmountStep string `json:"amount_step"` AllSymbols interface{} `json:"all_symbols"` LastPrices interface{} `json:"last_prices"` Past24hrsPriceChanges interface{} `json:"past_24hrs_price_changes"` Past24hrsHighPrice interface{} `json:"past_24hrs_high_price"` Past24hrsLowPrice interface{} `json:"past_24hrs_low_price"` Past24hrsVolumes interface{} `json:"past_24hrs_volumes"` Past24hrsTurnovers interface{} `json:"past_24hrs_turnovers"` OrderBooks OrderBook `json:"order_book"` TradeHistory interface{} `json:"trade_history"` QuoteCurrencyToFiatCurrencyPrice string `json:"quote_currency_to_fiat_currency_price"` FiatCurrency string `json:"fiat_currency"` MyAccountBalances interface{} `json:"my_account_balances"` MyOrders interface{} `json:"my_orders"` Superpower bool `json:"superpower"` FeeRate string `json:"fee_rate"` EstimatedBtc string `json:"estimated_btc"` EstimatedUsd string `json:"estimated_usd"` MyFeeRate string `json:"my_fee_rate"` BaseIntroLink string `json:"base_intro_link"` Quota string `json:"quota"` NextTimes int `json:"next_time_s"` IeoStatus int `json:"ieo_status"` QuotaCurrency string `json:"quota_currency"` Category interface{} `json:"category"` }
type SnapshotJson ¶
type SnapshotJson struct { StatusCode int `json:"status_code"` Message string `json:"message"` Time int `json:"time"` Data json.RawMessage `json:"data"` }
type Ticker ¶
type Ticker struct { LastPrice string `json:"last_price"` LowestAskPrice string `json:"lowest_ask_price"` HighestBidPrice string `json:"highest_bid_price"` Past24hrsPriceChange string `json:"past_24hrs_price_change"` Past24hrsBaseVolume string `json:"past_24hrs_base_volume"` Past24hrsQuoteTurnover string `json:"past_24hrs_quote_turnover"` Past24hrsHighPrice string `json:"past_24hrs_high_price"` Past24hrsLowPrice string `json:"past_24hrs_low_price"` }
********* Public API Structure*********