Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bitbay
- func (e *Bitbay) ApiKeyGET(strRequestPath string, mapParams map[string]interface{}) string
- func (e *Bitbay) CanDeposit(coin *coin.Coin) bool
- func (e *Bitbay) CanWithdraw(coin *coin.Coin) bool
- func (e *Bitbay) CancelAllOrder() error
- func (e *Bitbay) CancelOrder(order *exchange.Order) error
- func (e *Bitbay) DeleteCoin(coin *coin.Coin)
- func (e *Bitbay) DeletePair(pair *pair.Pair)
- func (e *Bitbay) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bitbay) GetBalance(coin *coin.Coin) float64
- func (e *Bitbay) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bitbay) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bitbay) GetCoins() []*coin.Coin
- func (e *Bitbay) GetCoinsData() error
- func (e *Bitbay) GetConfirmation(coin *coin.Coin) int
- func (e *Bitbay) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bitbay) GetFee(pair *pair.Pair) float64
- func (e *Bitbay) GetID() int
- func (e *Bitbay) GetLotSize(pair *pair.Pair) float64
- func (e *Bitbay) GetName() exchange.ExchangeName
- func (e *Bitbay) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bitbay) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bitbay) GetPairs() []*pair.Pair
- func (e *Bitbay) GetPairsData() error
- func (e *Bitbay) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bitbay) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bitbay) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bitbay) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bitbay) GetTxFee(coin *coin.Coin) float64
- func (e *Bitbay) HasPair(pair *pair.Pair) bool
- func (e *Bitbay) InitData() error
- func (e *Bitbay) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitbay) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitbay) ListOrders() ([]*exchange.Order, error)
- func (e *Bitbay) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bitbay) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Bitbay) OrderStatus(order *exchange.Order) error
- func (e *Bitbay) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bitbay) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bitbay) UpdateAllBalances()
- func (e *Bitbay) UpdateConstraint()
- func (e *Bitbay) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CancelOrder
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairInfo
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 41 DEFAULT_TAKER_FEE = 0.0043 DEFAULT_MAKER_FEE = 0.003 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://api.bitbay.net/rest"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances struct { Status string `json:"status"` Balances []struct { ID string `json:"id"` UserID string `json:"userId"` AvailableFunds float64 `json:"availableFunds"` TotalFunds float64 `json:"totalFunds"` LockedFunds int `json:"lockedFunds"` Currency string `json:"currency"` Type string `json:"type"` Name string `json:"name"` BalanceEngine string `json:"balanceEngine"` } `json:"balances"` Errors interface{} `json:"errors"` }
type Bitbay ¶
type Bitbay 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 CreateBitbay ¶
*************************************************
func (*Bitbay) ApiKeyGET ¶
************** 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 ------------------ TODO
func (*Bitbay) CancelAllOrder ¶
func (*Bitbay) DeleteCoin ¶
func (*Bitbay) DeletePair ¶
func (*Bitbay) DoAccountOperation ¶
func (e *Bitbay) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bitbay) GetCoinConstraint ¶
func (e *Bitbay) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bitbay) 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 (*Bitbay) GetConstraintFetchMethod ¶
func (e *Bitbay) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bitbay) GetName ¶
func (e *Bitbay) GetName() exchange.ExchangeName
func (*Bitbay) GetPairConstraint ¶
func (e *Bitbay) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bitbay) 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 (*Bitbay) LoadPublicData ¶
func (e *Bitbay) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bitbay) 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 (*Bitbay) SetCoinConstraint ¶
func (e *Bitbay) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bitbay) SetPairConstraint ¶
func (e *Bitbay) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bitbay) UpdateAllBalances ¶
func (e *Bitbay) UpdateAllBalances()
func (*Bitbay) UpdateConstraint ¶
func (e *Bitbay) UpdateConstraint()
type CancelOrder ¶
type CancelOrder struct { Status string `json:"status"` Errors []interface{} `json:"errors"` }
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Result json.RawMessage `json:"result"` }
type OrderBook ¶
type OrderBook struct { Status string `json:"status"` Sell []struct { Ra string `json:"ra"` Ca string `json:"ca"` Sa string `json:"sa"` Pa string `json:"pa"` Co int `json:"co"` } `json:"sell"` Buy []struct { Ra string `json:"ra"` Ca string `json:"ca"` Sa string `json:"sa"` Pa string `json:"pa"` Co int `json:"co"` } `json:"buy"` Timestamp string `json:"timestamp"` }
type OrderStatus ¶
type OrderStatus struct { Status string `json:"status"` Items []struct { Market string `json:"market"` OfferType string `json:"offerType"` ID string `json:"id"` CurrentAmount string `json:"currentAmount"` LockedAmount string `json:"lockedAmount"` Rate string `json:"rate"` StartAmount string `json:"startAmount"` Time string `json:"time"` PostOnly bool `json:"postOnly"` Mode string `json:"mode"` ReceivedAmount string `json:"receivedAmount"` FirstBalanceID string `json:"firstBalanceId"` SecondBalanceID string `json:"secondBalanceId"` } `json:"items"` }
type PairInfo ¶
type PairInfo struct { Market struct { Code string `json:"code"` First struct { Currency string `json:"currency"` MinOffer string `json:"minOffer"` Scale int `json:"scale"` } `json:"first"` Second struct { Currency string `json:"currency"` MinOffer string `json:"minOffer"` Scale int `json:"scale"` } `json:"second"` } `json:"market"` Time string `json:"time"` HighestBid string `json:"highestBid"` LowestAsk string `json:"lowestAsk"` Rate string `json:"rate"` PreviousRate string `json:"previousRate"` }