bgogo

package
v0.0.0-...-db5ea55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
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 CreateBgogo(config *exchange.Config) *Bgogo

*************************************************

func (*Bgogo) ApiKeyGet

func (e *Bgogo) ApiKeyGet(strRequestPath string, mapParams map[string]string) string

************** 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

func (e *Bgogo) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string

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) CanDeposit

func (e *Bgogo) CanDeposit(coin *coin.Coin) bool

func (*Bgogo) CanWithdraw

func (e *Bgogo) CanWithdraw(coin *coin.Coin) bool

func (*Bgogo) CancelAllOrder

func (e *Bgogo) CancelAllOrder() error

func (*Bgogo) CancelOrder

func (e *Bgogo) CancelOrder(order *exchange.Order) error

func (*Bgogo) DeleteCoin

func (e *Bgogo) DeleteCoin(coin *coin.Coin)

func (*Bgogo) DeletePair

func (e *Bgogo) DeletePair(pair *pair.Pair)

func (*Bgogo) DoAccountOperation

func (e *Bgogo) DoAccountOperation(operation *exchange.AccountOperation) error

************** Private API **************

func (*Bgogo) GetBalance

func (e *Bgogo) GetBalance(coin *coin.Coin) float64

func (*Bgogo) GetCoinBySymbol

func (e *Bgogo) GetCoinBySymbol(symbol string) *coin.Coin

func (*Bgogo) GetCoinConstraint

func (e *Bgogo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint

************** Coins on the Exchanges **************

func (*Bgogo) GetCoins

func (e *Bgogo) GetCoins() []*coin.Coin

func (*Bgogo) GetCoinsData

func (e *Bgogo) GetCoinsData() error

************** 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) GetConfirmation

func (e *Bgogo) GetConfirmation(coin *coin.Coin) int

func (*Bgogo) GetConstraintFetchMethod

func (e *Bgogo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod

*************** Exchange Constraint ***************

func (*Bgogo) GetFee

func (e *Bgogo) GetFee(pair *pair.Pair) float64

*************** Pair Constraint ***************

func (*Bgogo) GetID

func (e *Bgogo) GetID() int

*************** Exchange Information ***************

func (*Bgogo) GetLotSize

func (e *Bgogo) GetLotSize(pair *pair.Pair) float64

func (*Bgogo) GetName

func (e *Bgogo) GetName() exchange.ExchangeName

func (*Bgogo) GetPairBySymbol

func (e *Bgogo) GetPairBySymbol(symbol string) *pair.Pair

func (*Bgogo) GetPairConstraint

func (e *Bgogo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint

************** Pairs on the Exchanges **************

func (*Bgogo) GetPairs

func (e *Bgogo) GetPairs() []*pair.Pair

func (*Bgogo) GetPairsData

func (e *Bgogo) GetPairsData() error
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) GetPriceFilter

func (e *Bgogo) GetPriceFilter(pair *pair.Pair) float64

func (*Bgogo) GetSymbolByCoin

func (e *Bgogo) GetSymbolByCoin(coin *coin.Coin) string

func (*Bgogo) GetSymbolByPair

func (e *Bgogo) GetSymbolByPair(pair *pair.Pair) string

func (*Bgogo) GetTradingWebURL

func (e *Bgogo) GetTradingWebURL(pair *pair.Pair) string

func (*Bgogo) GetTxFee

func (e *Bgogo) GetTxFee(coin *coin.Coin) float64

*************** Coin Constraint ***************

func (*Bgogo) HasPair

func (e *Bgogo) HasPair(pair *pair.Pair) bool

func (*Bgogo) InitData

func (e *Bgogo) InitData() error

func (*Bgogo) LimitBuy

func (e *Bgogo) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Bgogo) LimitSell

func (e *Bgogo) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Bgogo) ListOrders

func (e *Bgogo) ListOrders() ([]*exchange.Order, error)

func (*Bgogo) LoadPublicData

func (e *Bgogo) LoadPublicData(operation *exchange.PublicOperation) error

func (*Bgogo) OrderBook

func (e *Bgogo) OrderBook(p *pair.Pair) (*exchange.Maker, error)

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) OrderStatus

func (e *Bgogo) OrderStatus(order *exchange.Order) error

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()

func (*Bgogo) Withdraw

func (e *Bgogo) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool

Withdraw(coin *coin.Coin, quantity float64, addr, tag string)

type CoinsData

type CoinsData map[string]Ticker

type JsonResponse

type JsonResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data"`
}

type OrderBook

type OrderBook struct {
	Bids []OrderItem `json:"bids"`
	Asks []OrderItem `json:"asks"`
}

type OrderItem

type OrderItem struct {
	Price  string `json:"price"`
	Amount string `json:"amount"`
}

type PairsData

type PairsData map[string]Ticker

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*********

type WithdrawResponse

type WithdrawResponse struct {
	Msg     string `json:"msg"`
	Success bool   `json:"success"`
	ID      string `json:"id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL