Documentation ¶
Index ¶
- Constants
- func CreatePayload(mapParams map[string]string) string
- type AccountBalances
- type Coineal
- func (e *Coineal) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Coineal) ApiKeyRequest(requestMethod string, mapParams map[string]string, strRequestPath string) string
- func (e *Coineal) CanDeposit(coin *coin.Coin) bool
- func (e *Coineal) CanWithdraw(coin *coin.Coin) bool
- func (e *Coineal) CancelAllOrder() error
- func (e *Coineal) CancelOrder(order *exchange.Order) error
- func (e *Coineal) DeleteCoin(coin *coin.Coin)
- func (e *Coineal) DeletePair(pair *pair.Pair)
- func (e *Coineal) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Coineal) GetBalance(coin *coin.Coin) float64
- func (e *Coineal) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Coineal) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Coineal) GetCoins() []*coin.Coin
- func (e *Coineal) GetCoinsData() error
- func (e *Coineal) GetConfirmation(coin *coin.Coin) int
- func (e *Coineal) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Coineal) GetFee(pair *pair.Pair) float64
- func (e *Coineal) GetID() int
- func (e *Coineal) GetLotSize(pair *pair.Pair) float64
- func (e *Coineal) GetName() exchange.ExchangeName
- func (e *Coineal) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Coineal) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Coineal) GetPairs() []*pair.Pair
- func (e *Coineal) GetPairsData() error
- func (e *Coineal) GetPriceFilter(pair *pair.Pair) float64
- func (e *Coineal) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Coineal) GetSymbolByPair(pair *pair.Pair) string
- func (e *Coineal) GetTradingWebURL(pair *pair.Pair) string
- func (e *Coineal) GetTxFee(coin *coin.Coin) float64
- func (e *Coineal) HasPair(pair *pair.Pair) bool
- func (e *Coineal) InitData() error
- func (e *Coineal) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coineal) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coineal) ListOrders() ([]*exchange.Order, error)
- func (e *Coineal) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Coineal) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Coineal) OrderStatus(order *exchange.Order) error
- func (e *Coineal) PostReq(resource string, mapParams map[string]string) string
- func (e *Coineal) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Coineal) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Coineal) UpdateAllBalances()
- func (e *Coineal) UpdateConstraint()
- func (e *Coineal) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 30 DEFAULT_TAKER_FEE = 0.0015 DEFAULT_MAKER_FEE = 0.0015 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://exchange-open-api.coineal.com"
)
Variables ¶
This section is empty.
Functions ¶
func CreatePayload ¶
Types ¶
type AccountBalances ¶
type Coineal ¶
type Coineal 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 CreateCoineal ¶
*************************************************
func (*Coineal) ApiKeyRequest ¶
func (e *Coineal) ApiKeyRequest(requestMethod string, mapParams map[string]string, strRequestPath 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 (*Coineal) CancelAllOrder ¶
func (*Coineal) DeleteCoin ¶
func (*Coineal) DeletePair ¶
func (*Coineal) DoAccountOperation ¶
func (e *Coineal) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Coineal) GetCoinConstraint ¶
func (e *Coineal) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Coineal) 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 (*Coineal) GetConstraintFetchMethod ¶
func (e *Coineal) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Coineal) GetName ¶
func (e *Coineal) GetName() exchange.ExchangeName
func (*Coineal) GetPairConstraint ¶
func (e *Coineal) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Coineal) 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 (*Coineal) LoadPublicData ¶
func (e *Coineal) LoadPublicData(operation *exchange.PublicOperation) error
func (*Coineal) 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 (*Coineal) SetCoinConstraint ¶
func (e *Coineal) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Coineal) SetPairConstraint ¶
func (e *Coineal) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Coineal) UpdateAllBalances ¶
func (e *Coineal) UpdateAllBalances()
func (*Coineal) UpdateConstraint ¶
func (e *Coineal) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Code string `json:"code"` Msg string `json:"msg"` Data json.RawMessage `json:"data"` }
type OrderBook ¶
type OrderBook struct {
Tick struct {
Asks [][]interface{} `json:"asks"`
Bids [][]interface{} `json:"bids"`
Time interface{} `json:"time"`
} `json:"tick"`
}
type OrderStatus ¶
type OrderStatus struct { TradeList []interface{} `json:"trade_list"` OrderInfo struct { Side string `json:"side"` TotalPrice string `json:"total_price"` CreatedAt int64 `json:"created_at"` AvgPrice string `json:"avg_price"` CountCoin string `json:"countCoin"` Source int `json:"source"` Type int `json:"type"` SideMsg string `json:"side_msg"` Volume string `json:"volume"` Price string `json:"price"` SourceMsg string `json:"source_msg"` StatusMsg string `json:"status_msg"` DealVolume string `json:"deal_volume"` ID int `json:"id"` RemainVolume string `json:"remain_volume"` BaseCoin string `json:"baseCoin"` TradeList []interface{} `json:"tradeList"` Status int `json:"status"` } `json:"order_info"` }
type PlaceOrder ¶
type PlaceOrder struct {
OrderID int `json:"order_id"`
}