Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bitrue
- func (e *Bitrue) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Bitrue) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
- func (e *Bitrue) CanDeposit(coin *coin.Coin) bool
- func (e *Bitrue) CanWithdraw(coin *coin.Coin) bool
- func (e *Bitrue) CancelAllOrder() error
- func (e *Bitrue) CancelOrder(order *exchange.Order) error
- func (e *Bitrue) DeleteCoin(coin *coin.Coin)
- func (e *Bitrue) DeletePair(pair *pair.Pair)
- func (e *Bitrue) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bitrue) GetBalance(coin *coin.Coin) float64
- func (e *Bitrue) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bitrue) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bitrue) GetCoins() []*coin.Coin
- func (e *Bitrue) GetCoinsData() error
- func (e *Bitrue) GetConfirmation(coin *coin.Coin) int
- func (e *Bitrue) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bitrue) GetFee(pair *pair.Pair) float64
- func (e *Bitrue) GetID() int
- func (e *Bitrue) GetLotSize(pair *pair.Pair) float64
- func (e *Bitrue) GetName() exchange.ExchangeName
- func (e *Bitrue) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bitrue) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bitrue) GetPairs() []*pair.Pair
- func (e *Bitrue) GetPairsData() error
- func (e *Bitrue) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bitrue) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bitrue) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bitrue) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bitrue) GetTxFee(coin *coin.Coin) float64
- func (e *Bitrue) HasPair(pair *pair.Pair) bool
- func (e *Bitrue) InitData() error
- func (e *Bitrue) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitrue) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitrue) ListOrders() ([]*exchange.Order, error)
- func (e *Bitrue) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bitrue) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Bitrue) OrderStatus(order *exchange.Order) error
- func (e *Bitrue) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bitrue) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bitrue) UpdateAllBalances()
- func (e *Bitrue) UpdateConstraint()
- func (e *Bitrue) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 25 DEFAULT_TAKER_FEE = 0.00098 DEFAULT_MAKER_FEE = 0.00098 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://www.bitrue.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances struct { MakerCommission int `json:"makerCommission"` TakerCommission int `json:"takerCommission"` BuyerCommission int `json:"buyerCommission"` SellerCommission int `json:"sellerCommission"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` CanDeposit bool `json:"canDeposit"` UpdateTime int `json:"updateTime"` Balances []struct { Asset string `json:"asset"` Free string `json:"free"` Locked string `json:"locked"` } `json:"balances"` }
type Bitrue ¶
type Bitrue 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 CreateBitrue ¶
*************************************************
func (*Bitrue) ApiKeyRequest ¶
func (e *Bitrue) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
************** 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 (*Bitrue) CancelAllOrder ¶
func (*Bitrue) DeleteCoin ¶
func (*Bitrue) DeletePair ¶
func (*Bitrue) DoAccountOperation ¶
func (e *Bitrue) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bitrue) GetCoinConstraint ¶
func (e *Bitrue) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bitrue) 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 (*Bitrue) GetConstraintFetchMethod ¶
func (e *Bitrue) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bitrue) GetName ¶
func (e *Bitrue) GetName() exchange.ExchangeName
func (*Bitrue) GetPairConstraint ¶
func (e *Bitrue) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bitrue) 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 (*Bitrue) LoadPublicData ¶
func (e *Bitrue) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bitrue) 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 (*Bitrue) SetCoinConstraint ¶
func (e *Bitrue) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bitrue) SetPairConstraint ¶
func (e *Bitrue) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bitrue) UpdateAllBalances ¶
func (e *Bitrue) UpdateAllBalances()
func (*Bitrue) UpdateConstraint ¶
func (e *Bitrue) UpdateConstraint()
type JsonResponse ¶
type OrderBook ¶
type OrderBook struct { LastUpdateID int64 `json:"lastUpdateId"` Bids [][]interface{} `json:"bids"` Asks [][]interface{} `json:"asks"` }
type OrderStatus ¶
type OrderStatus struct { Symbol string `json:"symbol"` OrderID string `json:"orderId"` ClientOrderID string `json:"clientOrderId"` Price string `json:"price"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` CummulativeQuoteQty string `json:"cummulativeQuoteQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` StopPrice string `json:"stopPrice"` IcebergQty string `json:"icebergQty"` Time int64 `json:"time"` UpdateTime int64 `json:"updateTime"` IsWorking bool `json:"isWorking"` }
type PairsData ¶
type PairsData struct { Timezone string `json:"timezone"` ServerTime int64 `json:"serverTime"` RateLimits []struct { RateLimitType string `json:"rateLimitType"` Interval string `json:"interval"` Limit int `json:"limit"` } `json:"rateLimits"` ExchangeFilters []interface{} `json:"exchangeFilters"` Symbols []struct { Symbol string `json:"symbol"` Status string `json:"status"` BaseAsset string `json:"baseAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAsset string `json:"quoteAsset"` QuotePrecision int `json:"quotePrecision"` OrderTypes []string `json:"orderTypes"` IcebergAllowed bool `json:"icebergAllowed"` Filters []struct { FilterType string `json:"filterType"` MinPrice string `json:"minPrice,omitempty"` MaxPrice string `json:"maxPrice,omitempty"` PriceScale int `json:"priceScale,omitempty"` MinQty string `json:"minQty,omitempty"` MaxQty string `json:"maxQty,omitempty"` VolumeScale int `json:"volumeScale,omitempty"` } `json:"filters"` } `json:"symbols"` }