Documentation
¶
Index ¶
- Constants
- type AccountBalances
- type Coinex
- func (e *Coinex) ApiKeyPost(strRequestPath string, mapParams map[string]string) string
- func (e *Coinex) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]string) string
- func (e *Coinex) CanDeposit(coin *coin.Coin) bool
- func (e *Coinex) CanWithdraw(coin *coin.Coin) bool
- func (e *Coinex) CancelAllOrder() error
- func (e *Coinex) CancelOrder(order *exchange.Order) error
- func (e *Coinex) DeleteCoin(coin *coin.Coin)
- func (e *Coinex) DeletePair(pair *pair.Pair)
- func (e *Coinex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Coinex) GetBalance(coin *coin.Coin) float64
- func (e *Coinex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Coinex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Coinex) GetCoins() []*coin.Coin
- func (e *Coinex) GetCoinsData() error
- func (e *Coinex) GetConfirmation(coin *coin.Coin) int
- func (e *Coinex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Coinex) GetFee(pair *pair.Pair) float64
- func (e *Coinex) GetID() int
- func (e *Coinex) GetLotSize(pair *pair.Pair) float64
- func (e *Coinex) GetName() exchange.ExchangeName
- func (e *Coinex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Coinex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Coinex) GetPairs() []*pair.Pair
- func (e *Coinex) GetPairsData() error
- func (e *Coinex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Coinex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Coinex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Coinex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Coinex) GetTxFee(coin *coin.Coin) float64
- func (e *Coinex) HasPair(pair *pair.Pair) bool
- func (e *Coinex) InitData() error
- func (e *Coinex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coinex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coinex) ListOrders() ([]*exchange.Order, error)
- func (e *Coinex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Coinex) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Coinex) OrderStatus(order *exchange.Order) error
- func (e *Coinex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Coinex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Coinex) UpdateAllBalances()
- func (e *Coinex) UpdateConstraint()
- func (e *Coinex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type DepositHistory
- type JsonResponse
- type OpenOrders
- type OrderBook
- type PairsData
- type PlaceOrder
- type SubAccountBalances
- type TickerDetail
- type TickerPrice
- type TradeHistory
- type TransferHistory
- type Withdraw
- type WithdrawHistory
Constants ¶
const ( DEFAULT_ID = 3 DEFAULT_TAKER_FEE = 0.001 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 )
const (
API_URL = "https://api.coinex.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Coinex ¶
type Coinex 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 CreateCoinex ¶
*************************************************
func (*Coinex) ApiKeyPost ¶
func (*Coinex) ApiKeyRequest ¶
func (e *Coinex) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]string) string
************** 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 (*Coinex) CancelAllOrder ¶
func (*Coinex) DeleteCoin ¶
func (*Coinex) DeletePair ¶
func (*Coinex) DoAccountOperation ¶
func (e *Coinex) DoAccountOperation(operation *exchange.AccountOperation) error
func (*Coinex) GetCoinConstraint ¶
func (e *Coinex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Coinex) 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 (*Coinex) GetConstraintFetchMethod ¶
func (e *Coinex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Coinex) GetName ¶
func (e *Coinex) GetName() exchange.ExchangeName
func (*Coinex) GetPairConstraint ¶
func (e *Coinex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Coinex) 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 (*Coinex) LoadPublicData ¶
func (e *Coinex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Coinex) 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 (*Coinex) SetCoinConstraint ¶
func (e *Coinex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Coinex) SetPairConstraint ¶
func (e *Coinex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Coinex) UpdateAllBalances ¶
func (e *Coinex) UpdateAllBalances()
func (*Coinex) UpdateConstraint ¶
func (e *Coinex) UpdateConstraint()
type DepositHistory ¶
type DepositHistory []struct { ActualAmount string `json:"actual_amount"` ActualAmountDisplay string `json:"actual_amount_display"` AddExplorer string `json:"add_explorer"` Amount string `json:"amount"` AmountDisplay string `json:"amount_display"` CoinAddress string `json:"coin_address"` CoinAddressDisplay string `json:"coin_address_display"` CoinDepositID int `json:"coin_deposit_id"` CoinType string `json:"coin_type"` Confirmations int `json:"confirmations"` CreateTime int64 `json:"create_time"` Explorer string `json:"explorer"` Remark string `json:"remark"` SmartContractName string `json:"smart_contract_name"` Status string `json:"status"` StatusDisplay string `json:"status_display"` TransferMethod string `json:"transfer_method"` TxID string `json:"tx_id"` TxIDDisplay string `json:"tx_id_display"` }
type JsonResponse ¶
type JsonResponse struct { Code int `json:"code"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
type OpenOrders ¶
type OpenOrders struct { Count int `json:"count"` CurrPage int `json:"curr_page"` Data []struct { Amount string `json:"amount"` AssetFee string `json:"asset_fee"` AvgPrice string `json:"avg_price"` ClientID string `json:"client_id"` CreateTime int64 `json:"create_time"` DealAmount string `json:"deal_amount"` DealFee string `json:"deal_fee"` DealMoney string `json:"deal_money"` FeeAsset string `json:"fee_asset"` FeeDiscount string `json:"fee_discount"` ID int64 `json:"id"` Left string `json:"left"` MakerFeeRate string `json:"maker_fee_rate"` Market string `json:"market"` OrderType string `json:"order_type"` Price string `json:"price"` Status string `json:"status"` TakerFeeRate string `json:"taker_fee_rate"` Type string `json:"type"` } `json:"data"` HasNext bool `json:"has_next"` }
type PairsData ¶
type PairsData struct { Symbol string `json:"name"` MinAmount string `json:"min_amount"` MakerFeeRate string `json:"maker_fee_rate"` TakerFeeRate string `json:"taker_fee_rate"` PricingName string `json:"pricing_name"` PricingDecimal int `json:"pricing_decimal"` TradingName string `json:"trading_name"` TradingDecimal int `json:"trading_decimal"` }
type PlaceOrder ¶
type PlaceOrder struct { Amount string `json:"amount"` AvgPrice string `json:"avg_price"` CreateTime int `json:"create_time"` DealAmount string `json:"deal_amount"` DealFee string `json:"deal_fee"` DealMoney string `json:"deal_money"` ID int `json:"id"` Left string `json:"left"` MakerFeeRate string `json:"maker_fee_rate"` Market string `json:"market"` OrderType string `json:"order_type"` Price string `json:"price"` Status string `json:"status"` TakerFeeRate string `json:"taker_fee_rate"` Type string `json:"type"` }
type SubAccountBalances ¶
type SubAccountBalances map[string](map[string]*AccountBalances)
type TickerDetail ¶
type TickerPrice ¶
type TickerPrice struct { Date int64 `json:"date"` Ticker map[string]TickerDetail `json:"ticker"` }
type TradeHistory ¶
type TransferHistory ¶
type TransferHistory struct { CurrPage int `json:"curr_page"` Data []struct { Time int64 `json:"time"` Amount string `json:"amount"` CoinType string `json:"coin_type"` TransferFrom string `json:"transfer_from"` TransferTo string `json:"transfer_to"` Status string `json:"status"` } `json:"data"` HasNext bool `json:"has_next"` PerPage int `json:"per_page"` Total int `json:"total"` TotalPage int `json:"total_page"` }
type Withdraw ¶
type Withdraw struct { ActualAmount string `json:"actual_amount"` Amount string `json:"amount"` CoinAddress string `json:"coin_address"` CoinType string `json:"coin_type"` CoinWithdrawID int `json:"coin_withdraw_id"` Confirmations int `json:"confirmations"` CreateTime int `json:"create_time"` Status string `json:"status"` TxFee string `json:"tx_fee"` TxID string `json:"tx_id"` }
type WithdrawHistory ¶
type WithdrawHistory []struct { ActualAmount string `json:"actual_amount"` Amount string `json:"amount"` CoinAddress string `json:"coin_address"` CoinType string `json:"coin_type"` CoinWithdrawID int `json:"coin_withdraw_id"` Confirmations int `json:"confirmations"` CreateTime int64 `json:"create_time"` Status string `json:"status"` TxFee string `json:"tx_fee"` TxID string `json:"tx_id"` }