Documentation
¶
Index ¶
- Constants
- Variables
- func Balances() (b model.Balances, err error)
- func Book() ([]model.Order, []model.Order, error)
- func CancelOrder(orderID int64, market string) ([]byte, error)
- func CreateSubAccount(name string, allowedIPs []string) ([]byte, error)
- func GetAccount() ([]byte, error)
- func HTTPDelete(urlHost string, parameters map[string]interface{}) ([]byte, error)
- func HTTPGet(urlHost string, parameters map[string]interface{}) ([]byte, error)
- func HTTPPost(urlHost string, parameters map[string]interface{}) ([]byte, error)
- func LoadClient(conf *config.Config)
- func OrderTest()
- func PutLimitOrder(amount, price, orderType, market string) ([]byte, error)
- func PutMarketOrder(amount, orderType, market string) ([]byte, error)
- func QueryOrderFinished(market string, accountID, page, limit int) ([]byte, error)
- func QueryOrderPending(market string, accountID, page, limit int) ([]byte, error)
- type AssetInfo
- type BalanceResp
- type CancelOrderResp
- type CommonResp
- type OrderFinishedResp
- type OrderInfo
- type OrderPendingResp
- type OrderResp
- type QueryPageInfo
Constants ¶
View Source
const APIHTTPHOST = "https://api.coinex.com"
APIHTTPHOST api host
View Source
const CONTENTTYPE = "application/json"
CONTENTTYPE http content-type
View Source
const USERAGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36"
USERAGENT http User-Agent
Variables ¶
View Source
var ( Fees = model.Fees{ MakerTakerRatio: decimal.RequireFromString("0.003"), WithdrawalFlatXCH: decimal.RequireFromString("0.001"), WithdrawalFlatUSDT: decimal.RequireFromString("1.4"), } AskAddition = decimal.NewFromInt(1).Add(Fees.MakerTakerRatio) BidReduction = decimal.NewFromInt(1).Sub(Fees.MakerTakerRatio) )
Functions ¶
func CancelOrder ¶
CancelOrder Cancel unexecuted order
func CreateSubAccount ¶
CreateSubAccount create sub account
func HTTPDelete ¶
HTTPDelete http get method
func LoadClient ¶
func PutLimitOrder ¶
PutLimitOrder create limit order
func PutMarketOrder ¶
PutMarketOrder create market order
func QueryOrderFinished ¶
QueryOrderFinished Acquire executed order list
Types ¶
type BalanceResp ¶
type BalanceResp struct {
CommonResp
AssetBalance map[string]AssetInfo `json:"data"`
}
BalanceResp response for api '/v1/balance/'
type CancelOrderResp ¶
type CancelOrderResp struct {
CommonResp
Order OrderInfo `json:"data"`
}
CancelOrderResp cancel order response from server
type CommonResp ¶
CommonResp common resp: {'code': 0, 'message': 'success'}
type OrderFinishedResp ¶
type OrderFinishedResp struct {
CommonResp
Data struct {
QueryPageInfo
Orders []OrderInfo `json:"data"`
} `json:"data"`
}
OrderFinishedResp query finished order response
type OrderInfo ¶
type OrderInfo struct {
ID int64 `json:"id"`
Amount string `json:"amount"`
AvgPrice string `json:"avg_price"`
CreateTime int64 `json:"create_time"`
DealAmount string `json:"deal_amount"`
DealFee string `json:"deal_fee"`
DealMoney string `json:"deal_money"`
FinishedTime int64 `json:"finished_time"`
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"`
ClientID string `json:"client_id"`
}
OrderInfo order base info
type OrderPendingResp ¶
type OrderPendingResp struct {
CommonResp
Data struct {
QueryPageInfo
Orders []OrderInfo `json:"data"`
} `json:"data"`
}
OrderPendingResp query pending order response
type OrderResp ¶
type OrderResp struct {
CommonResp
Order OrderInfo `json:"data"`
}
OrderResp put limit order response from server
type QueryPageInfo ¶
type QueryPageInfo struct {
CurrentPage int `json:"curr_page"`
Count int `json:"count"`
HasNext bool `json:"has_next"`
}
QueryPageInfo response
Click to show internal directories.
Click to hide internal directories.