Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bitforex
- func (e *Bitforex) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Bitforex) ApiKeyPost(strRequestPath string, mapParams map[string]interface{}) string
- func (e *Bitforex) CanDeposit(coin *coin.Coin) bool
- func (e *Bitforex) CanWithdraw(coin *coin.Coin) bool
- func (e *Bitforex) CancelAllOrder() error
- func (e *Bitforex) CancelOrder(order *exchange.Order) error
- func (e *Bitforex) DeleteCoin(coin *coin.Coin)
- func (e *Bitforex) DeletePair(pair *pair.Pair)
- func (e *Bitforex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bitforex) GetBalance(coin *coin.Coin) float64
- func (e *Bitforex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bitforex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bitforex) GetCoins() []*coin.Coin
- func (e *Bitforex) GetCoinsData() error
- func (e *Bitforex) GetConfirmation(coin *coin.Coin) int
- func (e *Bitforex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bitforex) GetFee(pair *pair.Pair) float64
- func (e *Bitforex) GetID() int
- func (e *Bitforex) GetLotSize(pair *pair.Pair) float64
- func (e *Bitforex) GetName() exchange.ExchangeName
- func (e *Bitforex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bitforex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bitforex) GetPairs() []*pair.Pair
- func (e *Bitforex) GetPairsData() error
- func (e *Bitforex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bitforex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bitforex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bitforex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bitforex) GetTxFee(coin *coin.Coin) float64
- func (e *Bitforex) HasPair(pair *pair.Pair) bool
- func (e *Bitforex) InitData() error
- func (e *Bitforex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitforex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitforex) ListOrders() ([]*exchange.Order, error)
- func (e *Bitforex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bitforex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Bitforex) OrderStatus(order *exchange.Order) error
- func (e *Bitforex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bitforex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bitforex) UpdateAllBalances()
- func (e *Bitforex) UpdateConstraint()
- func (e *Bitforex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CancelOrder
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 22 DEFAULT_TAKER_FEE = 0.001 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 string = "https://api.bitforex.com/api"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Bitforex ¶
type Bitforex 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 CreateBitforex ¶
*************************************************
func (*Bitforex) ApiKeyPost ¶
************** 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 (*Bitforex) CancelAllOrder ¶
func (*Bitforex) DeleteCoin ¶
func (*Bitforex) DeletePair ¶
func (*Bitforex) DoAccountOperation ¶
func (e *Bitforex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bitforex) GetCoinConstraint ¶
func (e *Bitforex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bitforex) 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 (*Bitforex) GetConstraintFetchMethod ¶
func (e *Bitforex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bitforex) GetName ¶
func (e *Bitforex) GetName() exchange.ExchangeName
func (*Bitforex) GetPairConstraint ¶
func (e *Bitforex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bitforex) 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 (*Bitforex) LoadPublicData ¶
func (e *Bitforex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bitforex) 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 (*Bitforex) SetCoinConstraint ¶
func (e *Bitforex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bitforex) SetPairConstraint ¶
func (e *Bitforex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bitforex) UpdateAllBalances ¶
func (e *Bitforex) UpdateAllBalances()
func (*Bitforex) UpdateConstraint ¶
func (e *Bitforex) UpdateConstraint()
type CancelOrder ¶
type CancelOrder struct {
Cancel bool `json:"data"`
}
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Code string `json:"code"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus struct { AvgPrice int `json:"avgPrice"` CreateTime int64 `json:"createTime"` DealAmount interface{} `json:"dealAmount"` LastTime int64 `json:"lastTime"` OrderAmount interface{} `json:"orderAmount"` OrderID int `json:"orderId"` OrderPrice interface{} `json:"orderPrice"` OrderState int `json:"orderState"` Symbol string `json:"symbol"` TradeFee int `json:"tradeFee"` TradeType int `json:"tradeType"` }
type PlaceOrder ¶
type PlaceOrder struct {
OrderID int `json:"orderId"`
}