Documentation
¶
Index ¶
- Constants
- type AccountBalances
- type CancelOrder
- type Cointiger
- func (e *Cointiger) ApiKeyGet(strRequestPath string, mapParams map[string]interface{}) string
- func (e *Cointiger) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]interface{}) string
- func (e *Cointiger) CanDeposit(coin *coin.Coin) bool
- func (e *Cointiger) CanWithdraw(coin *coin.Coin) bool
- func (e *Cointiger) CancelAllOrder() error
- func (e *Cointiger) CancelOrder(order *exchange.Order) error
- func (e *Cointiger) DeleteCoin(coin *coin.Coin)
- func (e *Cointiger) DeletePair(pair *pair.Pair)
- func (e *Cointiger) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Cointiger) GetBalance(coin *coin.Coin) float64
- func (e *Cointiger) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Cointiger) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Cointiger) GetCoins() []*coin.Coin
- func (e *Cointiger) GetCoinsData() error
- func (e *Cointiger) GetConfirmation(coin *coin.Coin) int
- func (e *Cointiger) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Cointiger) GetFee(pair *pair.Pair) float64
- func (e *Cointiger) GetID() int
- func (e *Cointiger) GetLotSize(pair *pair.Pair) float64
- func (e *Cointiger) GetName() exchange.ExchangeName
- func (e *Cointiger) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Cointiger) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Cointiger) GetPairs() []*pair.Pair
- func (e *Cointiger) GetPairsData() error
- func (e *Cointiger) GetPriceFilter(pair *pair.Pair) float64
- func (e *Cointiger) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Cointiger) GetSymbolByPair(pair *pair.Pair) string
- func (e *Cointiger) GetTradingWebURL(pair *pair.Pair) string
- func (e *Cointiger) GetTxFee(coin *coin.Coin) float64
- func (e *Cointiger) HasPair(pair *pair.Pair) bool
- func (e *Cointiger) InitData() error
- func (e *Cointiger) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Cointiger) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Cointiger) ListOrders() ([]*exchange.Order, error)
- func (e *Cointiger) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Cointiger) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Cointiger) OrderStatus(order *exchange.Order) error
- func (e *Cointiger) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Cointiger) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Cointiger) UpdateAllBalances()
- func (e *Cointiger) UpdateConstraint()
- func (e *Cointiger) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PairsDetails
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 40 DEFAULT_TAKER_FEE = 0.0015 DEFAULT_MAKER_FEE = 0.0008 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 DEFAULT_LISTED = true )
const (
API_URL = "https://api.cointiger.com/exchange/trading"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances []struct { Normal string `json:"normal"` Lock string `json:"lock"` Coin string `json:"coin"` }
********* Private API Structure*********
type CancelOrder ¶
type Cointiger ¶
type Cointiger 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 CreateCointiger ¶
*************************************************
func (*Cointiger) ApiKeyRequest ¶
func (e *Cointiger) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]interface{}) string
sign err sometimes due to timestamp lag
func (*Cointiger) CancelAllOrder ¶
func (*Cointiger) DeleteCoin ¶
func (*Cointiger) DeletePair ¶
func (*Cointiger) DoAccountOperation ¶
func (e *Cointiger) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Cointiger) GetCoinConstraint ¶
func (e *Cointiger) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Cointiger) 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(strRequestPath)
func (*Cointiger) GetConstraintFetchMethod ¶
func (e *Cointiger) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Cointiger) GetName ¶
func (e *Cointiger) GetName() exchange.ExchangeName
func (*Cointiger) GetPairConstraint ¶
func (e *Cointiger) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Cointiger) 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 (*Cointiger) LoadPublicData ¶
func (e *Cointiger) LoadPublicData(operation *exchange.PublicOperation) error
func (*Cointiger) 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.GetSymbolByPair(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 (*Cointiger) SetCoinConstraint ¶
func (e *Cointiger) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Cointiger) SetPairConstraint ¶
func (e *Cointiger) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Cointiger) UpdateAllBalances ¶
func (e *Cointiger) UpdateAllBalances()
func (*Cointiger) UpdateConstraint ¶
func (e *Cointiger) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code string `json:"code"` Msg string `json:"msg"` Data json.RawMessage `json:"data"` }
type OrderStatus ¶
type OrderStatus struct { Symbol string `json:"symbol"` Fee string `json:"fee"` AvgPrice string `json:"avg_price"` Source int `json:"source"` Type string `json:"type"` Mtime int64 `json:"mtime"` Volume string `json:"volume"` UserID int `json:"user_id"` Price string `json:"price"` Ctime int64 `json:"ctime"` DealVolume string `json:"deal_volume"` ID int `json:"id"` DealMoney string `json:"deal_money"` Status int `json:"status"` }
type PairsDetails ¶
type PairsDetails []struct { BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` PricePrecision int `json:"pricePrecision"` AmountPrecision int `json:"amountPrecision"` AmountMin float64 `json:"amountMin"` WithdrawFeeMin float64 `json:"withdrawFeeMin"` WithdrawFeeMax float64 `json:"withdrawFeeMax"` WithdrawOneMin float64 `json:"withdrawOneMin"` WithdrawOneMax float64 `json:"withdrawOneMax"` DepthSelect struct { Step0 string `json:"step0"` Step1 string `json:"step1"` Step2 string `json:"step2"` } `json:"depthSelect"` }
type PlaceOrder ¶
type PlaceOrder struct {
OrderID int `json:"order_id"`
}