Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CancelOrder
- type CoinDetails
- type CoinsData
- type Error
- type Idex
- func (e *Idex) ApiKeyPOST(strRequestPath string, mapParams map[string]interface{}) string
- func (e *Idex) CanDeposit(coin *coin.Coin) bool
- func (e *Idex) CanWithdraw(coin *coin.Coin) bool
- func (e *Idex) CancelAllOrder() error
- func (e *Idex) CancelOrder(order *exchange.Order) error
- func (e *Idex) DeleteCoin(coin *coin.Coin)
- func (e *Idex) DeletePair(pair *pair.Pair)
- func (e *Idex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Idex) GetBalance(coin *coin.Coin) float64
- func (e *Idex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Idex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Idex) GetCoins() []*coin.Coin
- func (e *Idex) GetCoinsData() error
- func (e *Idex) GetConfirmation(coin *coin.Coin) int
- func (e *Idex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Idex) GetFee(pair *pair.Pair) float64
- func (e *Idex) GetID() int
- func (e *Idex) GetLotSize(pair *pair.Pair) float64
- func (e *Idex) GetName() exchange.ExchangeName
- func (e *Idex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Idex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Idex) GetPairs() []*pair.Pair
- func (e *Idex) GetPairsData() error
- func (e *Idex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Idex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Idex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Idex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Idex) GetTxFee(coin *coin.Coin) float64
- func (e *Idex) HasPair(pair *pair.Pair) bool
- func (e *Idex) InitData() error
- func (e *Idex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Idex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Idex) ListOrders() ([]*exchange.Order, error)
- func (e *Idex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Idex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Idex) OrderStatus(order *exchange.Order) error
- func (e *Idex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Idex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Idex) UpdateAllBalances()
- func (e *Idex) UpdateConstraint()
- func (e *Idex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 20 DEFAULT_TAKER_FEE = 0.002 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 CONTRACT_ADDRESS = "0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208" EXPIRES = 100000 )
const (
API_URL string = "https://api.idex.market"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances []struct { Result struct { TotalBtc string `json:"total_btc"` TotalCny string `json:"total_cny"` TotalUsd string `json:"total_usd"` AssetsList []struct { CoinSymbol string `json:"coin_symbol"` Balance string `json:"balance"` Freeze string `json:"freeze"` BTCValue string `json:"BTCValue"` CNYValue string `json:"CNYValue"` USDValue string `json:"USDValue"` } `json:"assets_list"` } `json:"result"` Cmd string `json:"cmd"` }
type CancelOrder ¶
type CoinDetails ¶
type CoinsData ¶
type CoinsData map[string]CoinDetails
type Idex ¶
type Idex 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 CreateIdex ¶
*************************************************
func (*Idex) 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 (*Idex) CancelAllOrder ¶
func (*Idex) DeleteCoin ¶
func (*Idex) DeletePair ¶
func (*Idex) DoAccountOperation ¶
func (e *Idex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Idex) GetCoinConstraint ¶
func (e *Idex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Idex) 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 (*Idex) GetConstraintFetchMethod ¶
func (e *Idex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Idex) GetName ¶
func (e *Idex) GetName() exchange.ExchangeName
func (*Idex) GetPairConstraint ¶
func (e *Idex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Idex) 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 (*Idex) LoadPublicData ¶
func (e *Idex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Idex) 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 (*Idex) SetCoinConstraint ¶
func (e *Idex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Idex) SetPairConstraint ¶
func (e *Idex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Idex) UpdateAllBalances ¶
func (e *Idex) UpdateAllBalances()
func (*Idex) UpdateConstraint ¶
func (e *Idex) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Error Error `json:"error"` Result json.RawMessage `json:"result"` Cmd string `json:"cmd"` Ver string `json:"ver"` }
type OrderBook ¶
type OrderBook struct { Asks []struct { Price string `json:"price"` Amount string `json:"amount"` Total string `json:"total"` OrderHash string `json:"orderHash"` Params struct { TokenBuy string `json:"tokenBuy"` BuySymbol string `json:"buySymbol"` BuyPrecision int `json:"buyPrecision"` AmountBuy string `json:"amountBuy"` TokenSell string `json:"tokenSell"` SellSymbol string `json:"sellSymbol"` SellPrecision int `json:"sellPrecision"` AmountSell string `json:"amountSell"` Expires int `json:"expires"` Nonce int64 `json:"nonce"` User string `json:"user"` } `json:"params"` } `json:"asks"` Bids []struct { Price string `json:"price"` Amount string `json:"amount"` Total string `json:"total"` OrderHash string `json:"orderHash"` Params struct { TokenBuy string `json:"tokenBuy"` BuySymbol string `json:"buySymbol"` BuyPrecision int `json:"buyPrecision"` AmountBuy string `json:"amountBuy"` TokenSell string `json:"tokenSell"` SellSymbol string `json:"sellSymbol"` SellPrecision int `json:"sellPrecision"` AmountSell string `json:"amountSell"` Expires int `json:"expires"` Nonce int `json:"nonce"` User string `json:"user"` } `json:"params"` } `json:"bids"` }
type OrderStatus ¶
type OrderStatus []struct { Result struct { ID int `json:"id"` CreatedAt int64 `json:"createdAt"` AccountType int `json:"account_type"` Pair string `json:"pair"` CoinSymbol string `json:"coin_symbol"` CurrencySymbol string `json:"currency_symbol"` OrderSide int `json:"order_side"` OrderType int `json:"order_type"` Price string `json:"price"` DealPrice string `json:"deal_price"` Amount string `json:"amount"` Money string `json:"money"` DealAmount string `json:"deal_amount"` DealPercent string `json:"deal_percent"` DealMoney string `json:"deal_money"` Status int `json:"status"` Unexecuted string `json:"unexecuted"` OrderFrom int `json:"order_from"` } `json:"result"` Cmd string `json:"cmd"` }
type PlaceOrder ¶
type PlaceOrder struct { Timestamp int `json:"timestamp"` Market string `json:"market"` OrderNumber int `json:"orderNumber"` OrderHash string `json:"orderHash"` Price string `json:"price"` Amount string `json:"amount"` Total string `json:"total"` Type string `json:"type"` Params struct { TokenBuy string `json:"tokenBuy"` BuyPrecision int `json:"buyPrecision"` AmountBuy string `json:"amountBuy"` TokenSell string `json:"tokenSell"` SellPrecision int `json:"sellPrecision"` AmountSell string `json:"amountSell"` Expires int `json:"expires"` Nonce string `json:"nonce"` User string `json:"user"` } `json:"params"` }