Documentation
¶
Index ¶
- Constants
- type AccountBalances
- type Coinbene
- func (e *Coinbene) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Coinbene) ApiKeyPost(strRequestPath string, mapParams map[string]string) string
- func (e *Coinbene) ApiKeyWithdraw(strRequestPath string, mapParams map[string]string) string
- func (e *Coinbene) CanDeposit(coin *coin.Coin) bool
- func (e *Coinbene) CanWithdraw(coin *coin.Coin) bool
- func (e *Coinbene) CancelAllOrder() error
- func (e *Coinbene) CancelOrder(order *exchange.Order) error
- func (e *Coinbene) DeleteCoin(coin *coin.Coin)
- func (e *Coinbene) DeletePair(pair *pair.Pair)
- func (e *Coinbene) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Coinbene) GetBalance(coin *coin.Coin) float64
- func (e *Coinbene) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Coinbene) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Coinbene) GetCoins() []*coin.Coin
- func (e *Coinbene) GetCoinsData() error
- func (e *Coinbene) GetConfirmation(coin *coin.Coin) int
- func (e *Coinbene) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Coinbene) GetFee(pair *pair.Pair) float64
- func (e *Coinbene) GetID() int
- func (e *Coinbene) GetLotSize(pair *pair.Pair) float64
- func (e *Coinbene) GetName() exchange.ExchangeName
- func (e *Coinbene) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Coinbene) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Coinbene) GetPairs() []*pair.Pair
- func (e *Coinbene) GetPairsData() error
- func (e *Coinbene) GetPriceFilter(pair *pair.Pair) float64
- func (e *Coinbene) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Coinbene) GetSymbolByPair(pair *pair.Pair) string
- func (e *Coinbene) GetTradingWebURL(pair *pair.Pair) string
- func (e *Coinbene) GetTxFee(coin *coin.Coin) float64
- func (e *Coinbene) HasPair(pair *pair.Pair) bool
- func (e *Coinbene) InitData() error
- func (e *Coinbene) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coinbene) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coinbene) ListOrders() ([]*exchange.Order, error)
- func (e *Coinbene) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Coinbene) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Coinbene) OrderStatus(order *exchange.Order) error
- func (e *Coinbene) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Coinbene) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Coinbene) UpdateAllBalances()
- func (e *Coinbene) UpdateConstraint()
- func (e *Coinbene) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type Trade
- type TradeHistory
- type Withdraw
Constants ¶
const ( DEFAULT_ID = 32 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://openapi-exchange.coinbene.com" //"http://api.coinbene.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Coinbene ¶
type Coinbene 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 CreateCoinbene ¶
*************************************************
func (*Coinbene) 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 (*Coinbene) ApiKeyWithdraw ¶
func (*Coinbene) CancelAllOrder ¶
func (*Coinbene) DeleteCoin ¶
func (*Coinbene) DeletePair ¶
func (*Coinbene) DoAccountOperation ¶
func (e *Coinbene) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Coinbene) GetCoinConstraint ¶
func (e *Coinbene) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Coinbene) 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 (*Coinbene) GetConstraintFetchMethod ¶
func (e *Coinbene) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Coinbene) GetName ¶
func (e *Coinbene) GetName() exchange.ExchangeName
func (*Coinbene) GetPairConstraint ¶
func (e *Coinbene) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Coinbene) 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 (*Coinbene) LoadPublicData ¶
func (e *Coinbene) LoadPublicData(operation *exchange.PublicOperation) error
************** PUBLIC API **************
func (*Coinbene) 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 (*Coinbene) SetCoinConstraint ¶
func (e *Coinbene) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Coinbene) SetPairConstraint ¶
func (e *Coinbene) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Coinbene) UpdateAllBalances ¶
func (e *Coinbene) UpdateAllBalances()
func (*Coinbene) UpdateConstraint ¶
func (e *Coinbene) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code int `json:"code"` Message interface{} `json:"message"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus struct { OrderID string `json:"orderId"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` OrderDirection string `json:"orderDirection"` Quantity string `json:"quantity"` Amount string `json:"amount"` FilledAmount string `json:"filledAmount"` AvgPrice string `json:"avgPrice"` OrderPrice string `json:"orderPrice"` TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` OrderStatus string `json:"orderStatus"` OrderTime time.Time `json:"orderTime"` TotalFee string `json:"totalFee"` }
type PairsData ¶
type PairsData []struct { Symbol string `json:"symbol"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` PricePrecision string `json:"pricePrecision"` AmountPrecision string `json:"amountPrecision"` TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` MinAmount string `json:"minAmount"` PriceFluctuation string `json:"priceFluctuation"` Site string `json:"site"` }
type PlaceOrder ¶
type TradeHistory ¶
type TradeHistory [][]Trade