Documentation
¶
Index ¶
- Constants
- type AccessToken
- type AccountBalances
- type Bitmart
- func (e *Bitmart) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]string) string
- func (e *Bitmart) CanDeposit(coin *coin.Coin) bool
- func (e *Bitmart) CanWithdraw(coin *coin.Coin) bool
- func (e *Bitmart) CancelAllOrder() error
- func (e *Bitmart) CancelOrder(order *exchange.Order) error
- func (e *Bitmart) DeleteCoin(coin *coin.Coin)
- func (e *Bitmart) DeletePair(pair *pair.Pair)
- func (e *Bitmart) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bitmart) GetBalance(coin *coin.Coin) float64
- func (e *Bitmart) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bitmart) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bitmart) GetCoins() []*coin.Coin
- func (e *Bitmart) GetCoinsData() error
- func (e *Bitmart) GetConfirmation(coin *coin.Coin) int
- func (e *Bitmart) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bitmart) GetFee(pair *pair.Pair) float64
- func (e *Bitmart) GetID() int
- func (e *Bitmart) GetLotSize(pair *pair.Pair) float64
- func (e *Bitmart) GetName() exchange.ExchangeName
- func (e *Bitmart) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bitmart) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bitmart) GetPairs() []*pair.Pair
- func (e *Bitmart) GetPairsData() error
- func (e *Bitmart) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bitmart) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bitmart) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bitmart) GetToken(key string, secret string, memo string) string
- func (e *Bitmart) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bitmart) GetTxFee(coin *coin.Coin) float64
- func (e *Bitmart) HasPair(pair *pair.Pair) bool
- func (e *Bitmart) InitData() error
- func (e *Bitmart) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitmart) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitmart) ListOrders() ([]*exchange.Order, error)
- func (e *Bitmart) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bitmart) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Bitmart) OrderStatus(order *exchange.Order) error
- func (e *Bitmart) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bitmart) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bitmart) TokenReq(resource string, mapParams map[string]string) string
- func (e *Bitmart) UpdateAllBalances()
- func (e *Bitmart) UpdateConstraint()
- func (e *Bitmart) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CoinsData
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 36 DEFAULT_TAKER_FEE = 0.002 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_TXFEE = 0.005 DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://openapi.bitmart.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccountBalances ¶
type Bitmart ¶
type Bitmart struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string Passphrase string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateBitmart ¶
*************************************************
func (*Bitmart) ApiKeyRequest ¶
func (e *Bitmart) 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 (*Bitmart) CancelAllOrder ¶
func (*Bitmart) DeleteCoin ¶
func (*Bitmart) DeletePair ¶
func (*Bitmart) DoAccountOperation ¶
func (e *Bitmart) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bitmart) GetCoinConstraint ¶
func (e *Bitmart) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bitmart) 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 (*Bitmart) GetConstraintFetchMethod ¶
func (e *Bitmart) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bitmart) GetName ¶
func (e *Bitmart) GetName() exchange.ExchangeName
func (*Bitmart) GetPairConstraint ¶
func (e *Bitmart) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bitmart) 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 (*Bitmart) LoadPublicData ¶
func (e *Bitmart) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bitmart) 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 (*Bitmart) SetCoinConstraint ¶
func (e *Bitmart) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bitmart) SetPairConstraint ¶
func (e *Bitmart) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bitmart) UpdateAllBalances ¶
func (e *Bitmart) UpdateAllBalances()
func (*Bitmart) UpdateConstraint ¶
func (e *Bitmart) UpdateConstraint()
type OrderBook ¶
type OrderBook struct { Buys []struct { Amount string `json:"amount"` Total string `json:"total"` Price string `json:"price"` Count string `json:"count"` } `json:"buys"` Sells []struct { Amount string `json:"amount"` Total string `json:"total"` Price string `json:"price"` Count string `json:"count"` } `json:"sells"` }
type OrderStatus ¶
type OrderStatus struct { EntrustID int `json:"entrust_id"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` Side string `json:"side"` Price string `json:"price"` Fees string `json:"fees"` OriginalAmount string `json:"original_amount"` ExecutedAmount string `json:"executed_amount"` RemainingAmount string `json:"remaining_amount"` Status int `json:"status"` }
type PairsData ¶
type PairsData []struct { ID string `json:"id"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` QuoteIncrement string `json:"quote_increment"` BaseMinSize string `json:"base_min_size"` BaseMaxSize string `json:"base_max_size"` PriceMinPrecision int `json:"price_min_precision"` PriceMaxPrecision int `json:"price_max_precision"` Expiration string `json:"expiration"` }