Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type JsonResponse
- type Mxc
- func (e *Mxc) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]string) string
- func (e *Mxc) CanDeposit(coin *coin.Coin) bool
- func (e *Mxc) CanWithdraw(coin *coin.Coin) bool
- func (e *Mxc) CancelAllOrder() error
- func (e *Mxc) CancelOrder(order *exchange.Order) error
- func (e *Mxc) DeleteCoin(coin *coin.Coin)
- func (e *Mxc) DeletePair(pair *pair.Pair)
- func (e *Mxc) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Mxc) GetBalance(coin *coin.Coin) float64
- func (e *Mxc) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Mxc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Mxc) GetCoins() []*coin.Coin
- func (e *Mxc) GetCoinsData() error
- func (e *Mxc) GetConfirmation(coin *coin.Coin) int
- func (e *Mxc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Mxc) GetFee(pair *pair.Pair) float64
- func (e *Mxc) GetID() int
- func (e *Mxc) GetLotSize(pair *pair.Pair) float64
- func (e *Mxc) GetName() exchange.ExchangeName
- func (e *Mxc) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Mxc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Mxc) GetPairs() []*pair.Pair
- func (e *Mxc) GetPairsData() error
- func (e *Mxc) GetPriceFilter(pair *pair.Pair) float64
- func (e *Mxc) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Mxc) GetSymbolByPair(pair *pair.Pair) string
- func (e *Mxc) GetTradingWebURL(pair *pair.Pair) string
- func (e *Mxc) GetTxFee(coin *coin.Coin) float64
- func (e *Mxc) HasPair(pair *pair.Pair) bool
- func (e *Mxc) InitData() error
- func (e *Mxc) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Mxc) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Mxc) ListOrders() ([]*exchange.Order, error)
- func (e *Mxc) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Mxc) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Mxc) OrderStatus(order *exchange.Order) error
- func (e *Mxc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Mxc) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Mxc) UpdateAllBalances()
- func (e *Mxc) UpdateConstraint()
- func (e *Mxc) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type TradeHistory
Constants ¶
const ( DEFAULT_ID = 24 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://www.mxc.co" //"https://www.mxc.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type JsonResponse ¶
type JsonResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data json.RawMessage `json:"data"` }
type Mxc ¶
type Mxc 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 (*Mxc) ApiKeyRequest ¶
func (e *Mxc) 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 (*Mxc) CancelAllOrder ¶
func (*Mxc) DeleteCoin ¶
func (*Mxc) DeletePair ¶
func (*Mxc) DoAccountOperation ¶
func (e *Mxc) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Mxc) GetCoinConstraint ¶
func (e *Mxc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Mxc) 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 (*Mxc) GetConstraintFetchMethod ¶
func (e *Mxc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Mxc) GetName ¶
func (e *Mxc) GetName() exchange.ExchangeName
func (*Mxc) GetPairConstraint ¶
func (e *Mxc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Mxc) 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 (*Mxc) LoadPublicData ¶
func (e *Mxc) LoadPublicData(operation *exchange.PublicOperation) error
func (*Mxc) 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 (*Mxc) SetCoinConstraint ¶
func (e *Mxc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Mxc) SetPairConstraint ¶
func (e *Mxc) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Mxc) UpdateAllBalances ¶
func (e *Mxc) UpdateAllBalances()
func (*Mxc) UpdateConstraint ¶
func (e *Mxc) UpdateConstraint()
type OrderStatus ¶
type OrderStatus struct { ID string `json:"id"` Market string `json:"market"` Price string `json:"price"` Status string `json:"status"` TotalQuantity string `json:"totalQuantity"` TradedQuantity string `json:"tradedQuantity"` TradedAmount string `json:"tradedAmount"` CreateTime string `json:"createTime"` Type int `json:"type"` }
type PlaceOrder ¶
type PlaceOrder struct {
OrderID string `json:"data"`
}