Documentation
¶
Index ¶
- Constants
- type AccountBalance
- type ErrorResponse
- type OrderBook
- type Otcbtc
- func (e *Otcbtc) ApiKeyGET(mapParams map[string]string, strRequestPath string) string
- func (e *Otcbtc) ApiKeyPost(strRequestPath string, mapParams map[string]string) string
- func (e *Otcbtc) CanDeposit(coin *coin.Coin) bool
- func (e *Otcbtc) CanWithdraw(coin *coin.Coin) bool
- func (e *Otcbtc) CancelAllOrder() error
- func (e *Otcbtc) CancelOrder(order *exchange.Order) error
- func (e *Otcbtc) DeleteCoin(coin *coin.Coin)
- func (e *Otcbtc) DeletePair(pair *pair.Pair)
- func (e *Otcbtc) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Otcbtc) GetBalance(coin *coin.Coin) float64
- func (e *Otcbtc) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Otcbtc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Otcbtc) GetCoins() []*coin.Coin
- func (e *Otcbtc) GetCoinsData() error
- func (e *Otcbtc) GetConfirmation(coin *coin.Coin) int
- func (e *Otcbtc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Otcbtc) GetFee(pair *pair.Pair) float64
- func (e *Otcbtc) GetID() int
- func (e *Otcbtc) GetLotSize(pair *pair.Pair) float64
- func (e *Otcbtc) GetName() exchange.ExchangeName
- func (e *Otcbtc) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Otcbtc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Otcbtc) GetPairs() []*pair.Pair
- func (e *Otcbtc) GetPairsData() error
- func (e *Otcbtc) GetPriceFilter(pair *pair.Pair) float64
- func (e *Otcbtc) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Otcbtc) GetSymbolByPair(pair *pair.Pair) string
- func (e *Otcbtc) GetTradingWebURL(pair *pair.Pair) string
- func (e *Otcbtc) GetTxFee(coin *coin.Coin) float64
- func (e *Otcbtc) HasPair(pair *pair.Pair) bool
- func (e *Otcbtc) InitData() error
- func (e *Otcbtc) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Otcbtc) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Otcbtc) ListOrders() ([]*exchange.Order, error)
- func (e *Otcbtc) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Otcbtc) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Otcbtc) OrderStatus(order *exchange.Order) error
- func (e *Otcbtc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Otcbtc) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Otcbtc) UpdateAllBalances()
- func (e *Otcbtc) UpdateConstraint()
- func (e *Otcbtc) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 10 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://bb.otcbtc.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalance ¶
type AccountBalance struct { UserName string `json:"user_name"` Email string `json:"email"` Icon string `json:"icon"` OtbFeeEnabled bool `json:"otb_fee_enabled"` Accounts []struct { Currency string `json:"currency"` Balance string `json:"balance"` Locked string `json:"locked"` Saving string `json:"saving"` } `json:"accounts"` }
type ErrorResponse ¶
type Otcbtc ¶
type Otcbtc 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 CreateOtcbtc ¶
*************************************************
func (*Otcbtc) 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
func (*Otcbtc) ApiKeyPost ¶
func (*Otcbtc) CancelAllOrder ¶
func (*Otcbtc) DeleteCoin ¶
func (*Otcbtc) DeletePair ¶
func (*Otcbtc) DoAccountOperation ¶
func (e *Otcbtc) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Otcbtc) GetCoinConstraint ¶
func (e *Otcbtc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Otcbtc) 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 (*Otcbtc) GetConstraintFetchMethod ¶
func (e *Otcbtc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Otcbtc) GetName ¶
func (e *Otcbtc) GetName() exchange.ExchangeName
func (*Otcbtc) GetPairConstraint ¶
func (e *Otcbtc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Otcbtc) 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 (*Otcbtc) LoadPublicData ¶
func (e *Otcbtc) LoadPublicData(operation *exchange.PublicOperation) error
func (*Otcbtc) 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 (*Otcbtc) SetCoinConstraint ¶
func (e *Otcbtc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Otcbtc) SetPairConstraint ¶
func (e *Otcbtc) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Otcbtc) UpdateAllBalances ¶
func (e *Otcbtc) UpdateAllBalances()
func (*Otcbtc) UpdateConstraint ¶
func (e *Otcbtc) UpdateConstraint()
type PairsData ¶
type PairsData []struct { ID string `json:"id"` TickerID string `json:"ticker_id"` Name string `json:"name"` MinimalTotalVolume float64 `json:"minimal_total_volume"` TradingRule struct { MinAmount float64 `json:"min_amount"` MinPrice float64 `json:"min_price"` MinOrderVolume float64 `json:"min_order_volume"` } `json:"trading_rule"` }
type PlaceOrder ¶
type PlaceOrder struct { ID int `json:"id"` Side string `json:"side"` OrdType string `json:"ord_type"` Price string `json:"price"` AvgPrice string `json:"avg_price"` State string `json:"state"` Market string `json:"market"` CreatedAt time.Time `json:"created_at"` Volume string `json:"volume"` RemainingVolume string `json:"remaining_volume"` ExecutedVolume string `json:"executed_volume"` TradesCount int `json:"trades_count"` }