Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CoinsData
- type Dragonex
- func (e *Dragonex) ApiKeyRequest(strMethod string, mapParams map[string]interface{}, strRequestPath string, ...) string
- func (e *Dragonex) CanDeposit(coin *coin.Coin) bool
- func (e *Dragonex) CanWithdraw(coin *coin.Coin) bool
- func (e *Dragonex) CancelAllOrder() error
- func (e *Dragonex) CancelOrder(order *exchange.Order) error
- func (e *Dragonex) DeleteCoin(coin *coin.Coin)
- func (e *Dragonex) DeletePair(pair *pair.Pair)
- func (e *Dragonex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Dragonex) GetBalance(coin *coin.Coin) float64
- func (e *Dragonex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Dragonex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Dragonex) GetCoins() []*coin.Coin
- func (e *Dragonex) GetCoinsData() error
- func (e *Dragonex) GetConfirmation(coin *coin.Coin) int
- func (e *Dragonex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Dragonex) GetFee(pair *pair.Pair) float64
- func (e *Dragonex) GetID() int
- func (e *Dragonex) GetLotSize(pair *pair.Pair) float64
- func (e *Dragonex) GetName() exchange.ExchangeName
- func (e *Dragonex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Dragonex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Dragonex) GetPairs() []*pair.Pair
- func (e *Dragonex) GetPairsData() error
- func (e *Dragonex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Dragonex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Dragonex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Dragonex) GetToken()
- func (e *Dragonex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Dragonex) GetTxFee(coin *coin.Coin) float64
- func (e *Dragonex) HasPair(pair *pair.Pair) bool
- func (e *Dragonex) InitData() error
- func (e *Dragonex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Dragonex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Dragonex) ListOrders() ([]*exchange.Order, error)
- func (e *Dragonex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Dragonex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Dragonex) OrderStatus(order *exchange.Order) error
- func (e *Dragonex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Dragonex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Dragonex) UpdateAllBalances()
- func (e *Dragonex) UpdateConstraint()
- func (e *Dragonex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type Token
Constants ¶
const ( DEFAULT_ID = 16 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.0005 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://openapi.dragonex.io"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Dragonex ¶
type Dragonex struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string LastDay int LastHour int Token string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateDragonex ¶
*************************************************
func (*Dragonex) ApiKeyRequest ¶
func (*Dragonex) CancelAllOrder ¶
func (*Dragonex) DeleteCoin ¶
func (*Dragonex) DeletePair ¶
func (*Dragonex) DoAccountOperation ¶
func (e *Dragonex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Dragonex) GetCoinConstraint ¶
func (e *Dragonex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Dragonex) 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 (*Dragonex) GetConstraintFetchMethod ¶
func (e *Dragonex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Dragonex) GetName ¶
func (e *Dragonex) GetName() exchange.ExchangeName
func (*Dragonex) GetPairConstraint ¶
func (e *Dragonex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Dragonex) 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 (*Dragonex) GetToken ¶
func (e *Dragonex) GetToken()
************** 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 token limit 100 times/day, valid 24h
func (*Dragonex) LoadPublicData ¶
func (e *Dragonex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Dragonex) 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 (*Dragonex) SetCoinConstraint ¶
func (e *Dragonex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Dragonex) SetPairConstraint ¶
func (e *Dragonex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Dragonex) UpdateAllBalances ¶
func (e *Dragonex) UpdateAllBalances()
func (*Dragonex) UpdateConstraint ¶
func (e *Dragonex) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code int `json:"code"` Msg string `json:"msg"` Ok bool `json:"ok"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus struct { OrderID string `json:"order_id"` OrderType int `json:"order_type"` Price string `json:"price"` Status int `json:"status"` SymbolID int `json:"symbol_id"` Timestamp int `json:"timestamp"` TradeVolume string `json:"trade_volume"` Volume string `json:"volume"` ActualAmount string `json:"actual_amount"` ActualFee string `json:"actual_fee"` }
type PairsData ¶
type PairsData struct { Columns []string `json:"columns"` List [][]interface{} `json:"list"` }