Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bw
- func (e *Bw) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Bw) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Bw) CanDeposit(coin *coin.Coin) bool
- func (e *Bw) CanWithdraw(coin *coin.Coin) bool
- func (e *Bw) CancelAllOrder() error
- func (e *Bw) CancelOrder(order *exchange.Order) error
- func (e *Bw) DeleteCoin(coin *coin.Coin)
- func (e *Bw) DeletePair(pair *pair.Pair)
- func (e *Bw) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bw) GetBalance(coin *coin.Coin) float64
- func (e *Bw) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bw) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bw) GetCoins() []*coin.Coin
- func (e *Bw) GetCoinsData() error
- func (e *Bw) GetConfirmation(coin *coin.Coin) int
- func (e *Bw) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bw) GetFee(pair *pair.Pair) float64
- func (e *Bw) GetID() int
- func (e *Bw) GetLotSize(pair *pair.Pair) float64
- func (e *Bw) GetName() exchange.ExchangeName
- func (e *Bw) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bw) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bw) GetPairs() []*pair.Pair
- func (e *Bw) GetPairsData() error
- func (e *Bw) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bw) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bw) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bw) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bw) GetTxFee(coin *coin.Coin) float64
- func (e *Bw) HasPair(pair *pair.Pair) bool
- func (e *Bw) InitData() error
- func (e *Bw) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bw) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bw) ListOrders() ([]*exchange.Order, error)
- func (e *Bw) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bw) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Bw) OrderStatus(order *exchange.Order) error
- func (e *Bw) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bw) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bw) UpdateAllBalances()
- func (e *Bw) UpdateConstraint()
- func (e *Bw) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CoinsData
- type JsonResponse
- type OrderBook
- type PairsData
- type PlaceOrder
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 43 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 //PRICE FILTER DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 )
const (
API_URL = "https://www.bw.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 Bw ¶
type Bw 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 (*Bw) 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 (*Bw) 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 (*Bw) CancelAllOrder ¶
func (*Bw) DeleteCoin ¶
func (*Bw) DeletePair ¶
func (*Bw) DoAccountOperation ¶
func (e *Bw) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bw) GetCoinConstraint ¶
func (e *Bw) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bw) 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 (*Bw) GetConstraintFetchMethod ¶
func (e *Bw) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bw) GetName ¶
func (e *Bw) GetName() exchange.ExchangeName
func (*Bw) GetPairConstraint ¶
func (e *Bw) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bw) 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 (*Bw) LoadPublicData ¶
func (e *Bw) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bw) 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 (*Bw) SetCoinConstraint ¶
func (e *Bw) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bw) SetPairConstraint ¶
func (e *Bw) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bw) UpdateAllBalances ¶
func (e *Bw) UpdateAllBalances()
func (*Bw) UpdateConstraint ¶
func (e *Bw) UpdateConstraint()
type CoinsData ¶
type CoinsData []struct { CurrencyID string `json:"currencyId"` Name string `json:"name"` Alias string `json:"alias"` Logo string `json:"logo"` Description string `json:"description"` DescriptionEnglish string `json:"descriptionEnglish"` DefaultDecimal int `json:"defaultDecimal"` CreateUID interface{} `json:"createUid"` CreateTime int64 `json:"createTime"` ModifyUID interface{} `json:"modifyUid"` ModifyTime int `json:"modifyTime"` State int `json:"state"` Mark string `json:"mark"` TotalNumber float64 `json:"totalNumber"` PublishNumber float64 `json:"publishNumber"` MarketValue float64 `json:"marketValue"` IsLegalCoin int `json:"isLegalCoin"` NeedBlockURL int `json:"needBlockUrl"` BlockChainURL string `json:"blockChainUrl"` TradeSearchURL interface{} `json:"tradeSearchUrl"` TokenCoinsID int `json:"tokenCoinsId"` IsMining string `json:"isMining"` Arithmetic interface{} `json:"arithmetic"` Founder string `json:"founder"` TeamAddress interface{} `json:"teamAddress"` Remark interface{} `json:"remark"` TokenName string `json:"tokenName"` IsMemo int `json:"isMemo"` WebsiteCurrencyID string `json:"websiteCurrencyId"` DrawFlag int `json:"drawFlag"` RechargeFlag int `json:"rechargeFlag"` DrawFee float64 `json:"drawFee"` OnceDrawLimit int `json:"onceDrawLimit"` DailyDrawLimit int `json:"dailyDrawLimit"` TimesFreetrial float64 `json:"timesFreetrial"` HourFreetrial float64 `json:"hourFreetrial"` DayFreetrial float64 `json:"dayFreetrial"` MinFee float64 `json:"minFee"` InConfigTimes int `json:"inConfigTimes"` OutConfigTimes int `json:"outConfigTimes"` MinCash float64 `json:"minCash"` LimitAmount float64 `json:"limitAmount"` ZbExist bool `json:"zbExist"` Zone int `json:"zone"` }
type JsonResponse ¶
type JsonResponse struct { Datas json.RawMessage `json:"datas"` ResMsg struct { Message string `json:"message"` Method string `json:"method"` Code string `json:"code"` } }
type PairsData ¶
type PairsData []struct { MarketID string `json:"marketId"` WebID string `json:"webId"` ServerID string `json:"serverId"` Name string `json:"name"` LeverType string `json:"leverType"` BuyerCurrencyID string `json:"buyerCurrencyId"` SellerCurrencyID string `json:"sellerCurrencyId"` AmountDecimal int `json:"amountDecimal"` PriceDecimal int `json:"priceDecimal"` MinAmount string `json:"minAmount"` State int `json:"state"` OpenTime int64 `json:"openTime"` DefaultFee string `json:"defaultFee"` CreateUID string `json:"createUid"` CreateTime int `json:"createTime"` ModifyUID string `json:"modifyUid"` ModifyTime int64 `json:"modifyTime"` CombineMarketID string `json:"combineMarketId"` IsCombine int `json:"isCombine"` IsMining int `json:"isMining"` }
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"` }