Documentation ¶
Index ¶
- Constants
- func ComputeHmac256Base64(strMessage string, strSecret string) string
- func ComputeHmac384NoDecode(strMessage string, strSecret string) string
- type AccountBalances
- type Idcm
- func (e *Idcm) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Idcm) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]string) string
- func (e *Idcm) CanDeposit(coin *coin.Coin) bool
- func (e *Idcm) CanWithdraw(coin *coin.Coin) bool
- func (e *Idcm) CancelAllOrder() error
- func (e *Idcm) CancelOrder(order *exchange.Order) error
- func (e *Idcm) DeleteCoin(coin *coin.Coin)
- func (e *Idcm) DeletePair(pair *pair.Pair)
- func (e *Idcm) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Idcm) GetBalance(coin *coin.Coin) float64
- func (e *Idcm) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Idcm) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Idcm) GetCoins() []*coin.Coin
- func (e *Idcm) GetCoinsData() error
- func (e *Idcm) GetConfirmation(coin *coin.Coin) int
- func (e *Idcm) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Idcm) GetFee(pair *pair.Pair) float64
- func (e *Idcm) GetID() int
- func (e *Idcm) GetLotSize(pair *pair.Pair) float64
- func (e *Idcm) GetName() exchange.ExchangeName
- func (e *Idcm) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Idcm) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Idcm) GetPairs() []*pair.Pair
- func (e *Idcm) GetPairsData() error
- func (e *Idcm) GetPriceFilter(pair *pair.Pair) float64
- func (e *Idcm) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Idcm) GetSymbolByPair(pair *pair.Pair) string
- func (e *Idcm) GetTradingWebURL(pair *pair.Pair) string
- func (e *Idcm) GetTxFee(coin *coin.Coin) float64
- func (e *Idcm) HasPair(pair *pair.Pair) bool
- func (e *Idcm) InitData() error
- func (e *Idcm) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Idcm) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Idcm) ListOrders() ([]*exchange.Order, error)
- func (e *Idcm) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Idcm) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Idcm) OrderStatus(order *exchange.Order) error
- func (e *Idcm) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Idcm) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Idcm) UpdateAllBalances()
- func (e *Idcm) UpdateConstraint()
- func (e *Idcm) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type Withdraw
Constants ¶
const ( API_URL_PUB string = "https://api.idcs.io:8323/api/v1/RealTimeQuote" API_URL string = "https://api.IDCM.cc:8323/api/v1" )
const ( DEFAULT_ID = 67 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 )
Variables ¶
This section is empty.
Functions ¶
func ComputeHmac256Base64 ¶
func ComputeHmac384NoDecode ¶
Types ¶
type AccountBalances ¶
type Idcm ¶
type Idcm 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 CreateIdcm ¶
*************************************************
func (*Idcm) 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 (*Idcm) ApiKeyRequest ¶
func (*Idcm) CancelAllOrder ¶
func (*Idcm) CancelOrder ¶
will return true even if the order doesn't exist
func (*Idcm) DeleteCoin ¶
func (*Idcm) DeletePair ¶
func (*Idcm) DoAccountOperation ¶
func (e *Idcm) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Idcm) GetCoinConstraint ¶
func (e *Idcm) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Idcm) 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 (*Idcm) GetConstraintFetchMethod ¶
func (e *Idcm) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Idcm) GetName ¶
func (e *Idcm) GetName() exchange.ExchangeName
func (*Idcm) GetPairConstraint ¶
func (e *Idcm) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Idcm) 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 (*Idcm) LoadPublicData ¶
func (e *Idcm) LoadPublicData(operation *exchange.PublicOperation) error
************** Public API **************
func (*Idcm) 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 (*Idcm) SetCoinConstraint ¶
func (e *Idcm) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Idcm) SetPairConstraint ¶
func (e *Idcm) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Idcm) UpdateAllBalances ¶
func (e *Idcm) UpdateAllBalances()
func (*Idcm) UpdateConstraint ¶
func (e *Idcm) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Result int `json:"result"` Code string `json:"code"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus []struct { Orderid string `json:"orderid"` Symbol string `json:"symbol"` Price float64 `json:"price"` Avgprice float64 `json:"avgprice"` Side int `json:"side"` Type int `json:"type"` Timestamp string `json:"timestamp"` Amount int `json:"amount"` Executedamount int `json:"executedamount"` Status int `json:"status"` }
type PairsData ¶
type PairsData struct { Data []struct { TradePairID string `json:"TradePairID"` TradePairCode string `json:"TradePairCode"` LastPrice float64 `json:"LastPrice"` Change float64 `json:"Change"` Rose float64 `json:"Rose"` Volume float64 `json:"Volume"` High float64 `json:"High"` Low float64 `json:"Low"` Open float64 `json:"Open"` Close float64 `json:"Close"` Turnover float64 `json:"Turnover"` Sort int `json:"Sort"` PriceDigit int `json:"PriceDigit"` QuantityDigit int `json:"QuantityDigit"` } `json:"Data"` NeedLang bool `json:"NeedLang"` Status bool `json:"Status"` Msg interface{} `json:"Msg"` URL interface{} `json:"Url"` StatusCode string `json:"StatusCode"` Extra interface{} `json:"Extra"` }
type PlaceOrder ¶
type PlaceOrder struct {
Orderid string `json:"orderid"`
}