Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bkex
- func (e *Bkex) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Bkex) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Bkex) CanDeposit(coin *coin.Coin) bool
- func (e *Bkex) CanWithdraw(coin *coin.Coin) bool
- func (e *Bkex) CancelAllOrder() error
- func (e *Bkex) CancelOrder(order *exchange.Order) error
- func (e *Bkex) DeleteCoin(coin *coin.Coin)
- func (e *Bkex) DeletePair(pair *pair.Pair)
- func (e *Bkex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bkex) GetBalance(coin *coin.Coin) float64
- func (e *Bkex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bkex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bkex) GetCoins() []*coin.Coin
- func (e *Bkex) GetCoinsData() error
- func (e *Bkex) GetConfirmation(coin *coin.Coin) int
- func (e *Bkex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bkex) GetFee(pair *pair.Pair) float64
- func (e *Bkex) GetID() int
- func (e *Bkex) GetLotSize(pair *pair.Pair) float64
- func (e *Bkex) GetName() exchange.ExchangeName
- func (e *Bkex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bkex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bkex) GetPairs() []*pair.Pair
- func (e *Bkex) GetPairsData() error
- func (e *Bkex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bkex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bkex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bkex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bkex) GetTxFee(coin *coin.Coin) float64
- func (e *Bkex) HasPair(pair *pair.Pair) bool
- func (e *Bkex) InitData() error
- func (e *Bkex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bkex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bkex) ListOrders() ([]*exchange.Order, error)
- func (e *Bkex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bkex) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Bkex) OrderStatus(order *exchange.Order) error
- func (e *Bkex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bkex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bkex) UpdateAllBalances()
- func (e *Bkex) UpdateConstraint()
- func (e *Bkex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type Coin
- type CoinsData
- type ExchangeData
- type JsonResponse
- type OrderBook
- type OrderDetail
- type OrderItem
- type OrderStatus
- type OrdersPage
- type Pair
- type PairsData
- type TradeHistory
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 57 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://api.bkex.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Bkex ¶
type Bkex 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 CreateBkex ¶
*************************************************
func (*Bkex) 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 (*Bkex) 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 (*Bkex) CancelAllOrder ¶
func (*Bkex) DeleteCoin ¶
func (*Bkex) DeletePair ¶
func (*Bkex) DoAccountOperation ¶
func (e *Bkex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bkex) GetCoinConstraint ¶
func (e *Bkex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bkex) 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 (*Bkex) GetConstraintFetchMethod ¶
func (e *Bkex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bkex) GetName ¶
func (e *Bkex) GetName() exchange.ExchangeName
func (*Bkex) GetPairConstraint ¶
func (e *Bkex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bkex) 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 (*Bkex) LoadPublicData ¶
func (e *Bkex) LoadPublicData(operation *exchange.PublicOperation) error
************** PUBLIC API **************
func (*Bkex) 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 (*Bkex) OrderStatus ¶
unfinished order, need finished order after this
func (*Bkex) SetCoinConstraint ¶
func (e *Bkex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bkex) SetPairConstraint ¶
func (e *Bkex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bkex) UpdateAllBalances ¶
func (e *Bkex) UpdateAllBalances()
func (*Bkex) UpdateConstraint ¶
func (e *Bkex) UpdateConstraint()
type Coin ¶
type Coin struct { CoinType string `json:"coinType"` MaxWithdrawOneDay float64 `json:"maxWithdrawOneDay"` MaxWithdrawSingle float64 `json:"maxWithdrawSingle"` MinWithdrawSingle float64 `json:"minWithdrawSingle"` SupportDeposit bool `json:"supportDeposit"` SupportTrade bool `json:"supportTrade"` SupportWithdraw bool `json:"supportWithdraw"` WithdrawFee float64 `json:"withdrawFee"` }
********* Public API Structure*********
type ExchangeData ¶
type JsonResponse ¶
type JsonResponse struct { Code int `json:"code"` Data json.RawMessage `json:"data"` Msg string `json:"msg"` }
type OrderDetail ¶
type OrderDetail struct { CreatedTime int `json:"createdTime"` DealAmount float64 `json:"dealAmount"` DealAvgPrice float64 `json:"dealAvgPrice"` Direction string `json:"direction"` FrozenAmountByOrder float64 `json:"frozenAmountByOrder"` Id string `json:"id"` OrderType string `json:"orderType"` Pair string `json:"pair"` Price float64 `json:"price"` Status int `json:"status"` TotalAmount float64 `json:"totalAmount"` UpdateTime interface{} `json:"updateTime"` }
type OrderStatus ¶
type OrderStatus struct { CreatedTime int64 `json:"createdTime"` DealAmount float64 `json:"dealAmount"` DealAvgPrice float64 `json:"dealAvgPrice"` Direction string `json:"direction"` FrozenAmountByOrder float64 `json:"frozenAmountByOrder"` ID string `json:"id"` OrderType string `json:"orderType"` Pair string `json:"pair"` Price float64 `json:"price"` Status int `json:"status"` TotalAmount float64 `json:"totalAmount"` UpdateTime interface{} `json:"updateTime"` }
type OrdersPage ¶
type OrdersPage struct { Data []OrderDetail `json:"data"` PageRequest interface{} `json:"pageRequest"` Total int `json:"total"` }