Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Blocktrade
- func (e *Blocktrade) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Blocktrade) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Blocktrade) CanDeposit(coin *coin.Coin) bool
- func (e *Blocktrade) CanWithdraw(coin *coin.Coin) bool
- func (e *Blocktrade) CancelAllOrder() error
- func (e *Blocktrade) CancelOrder(order *exchange.Order) error
- func (e *Blocktrade) DeleteCoin(coin *coin.Coin)
- func (e *Blocktrade) DeletePair(pair *pair.Pair)
- func (e *Blocktrade) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Blocktrade) GetBalance(coin *coin.Coin) float64
- func (e *Blocktrade) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Blocktrade) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Blocktrade) GetCoins() []*coin.Coin
- func (e *Blocktrade) GetCoinsData() error
- func (e *Blocktrade) GetConfirmation(coin *coin.Coin) int
- func (e *Blocktrade) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Blocktrade) GetFee(pair *pair.Pair) float64
- func (e *Blocktrade) GetID() int
- func (e *Blocktrade) GetLotSize(pair *pair.Pair) float64
- func (e *Blocktrade) GetName() exchange.ExchangeName
- func (e *Blocktrade) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Blocktrade) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Blocktrade) GetPairs() []*pair.Pair
- func (e *Blocktrade) GetPairsData() error
- func (e *Blocktrade) GetPriceFilter(pair *pair.Pair) float64
- func (e *Blocktrade) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Blocktrade) GetSymbolByPair(pair *pair.Pair) string
- func (e *Blocktrade) GetTradingWebURL(pair *pair.Pair) string
- func (e *Blocktrade) GetTxFee(coin *coin.Coin) float64
- func (e *Blocktrade) HasPair(pair *pair.Pair) bool
- func (e *Blocktrade) InitData() error
- func (e *Blocktrade) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Blocktrade) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Blocktrade) ListOrders() ([]*exchange.Order, error)
- func (e *Blocktrade) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Blocktrade) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Blocktrade) OrderStatus(order *exchange.Order) error
- func (e *Blocktrade) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Blocktrade) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Blocktrade) UpdateAllBalances()
- func (e *Blocktrade) UpdateConstraint()
- func (e *Blocktrade) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CoinsData
- type JsonResponse
- type OrderBook
- type OrderBooks
- type PairsData
- type PlaceOrder
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 56 DEFAULT_TAKER_FEE = 0.0015 DEFAULT_MAKER_FEE = 0.0015 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL = "https://trade.blocktrade.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances []struct { Asset string `json:"asset"` Total float64 `json:"total"` Available float64 `json:"available"` Locked float64 `json:"locked"` }
********* Private API Structure*********
type Blocktrade ¶
type Blocktrade 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 CreateBlocktrade ¶
func CreateBlocktrade(config *exchange.Config) *Blocktrade
*************************************************
func (*Blocktrade) ApiKeyGet ¶
func (e *Blocktrade) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
************** Signature Http Request ************** Method: API Get 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 (*Blocktrade) ApiKeyRequest ¶
func (e *Blocktrade) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
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
func (*Blocktrade) CanDeposit ¶
func (e *Blocktrade) CanDeposit(coin *coin.Coin) bool
func (*Blocktrade) CanWithdraw ¶
func (e *Blocktrade) CanWithdraw(coin *coin.Coin) bool
func (*Blocktrade) CancelAllOrder ¶
func (e *Blocktrade) CancelAllOrder() error
func (*Blocktrade) CancelOrder ¶
func (e *Blocktrade) CancelOrder(order *exchange.Order) error
func (*Blocktrade) DeleteCoin ¶
func (e *Blocktrade) DeleteCoin(coin *coin.Coin)
func (*Blocktrade) DeletePair ¶
func (e *Blocktrade) DeletePair(pair *pair.Pair)
func (*Blocktrade) DoAccountOperation ¶
func (e *Blocktrade) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Blocktrade) GetBalance ¶
func (e *Blocktrade) GetBalance(coin *coin.Coin) float64
func (*Blocktrade) GetCoinBySymbol ¶
func (e *Blocktrade) GetCoinBySymbol(symbol string) *coin.Coin
func (*Blocktrade) GetCoinConstraint ¶
func (e *Blocktrade) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Blocktrade) GetCoins ¶
func (e *Blocktrade) GetCoins() []*coin.Coin
func (*Blocktrade) GetCoinsData ¶
func (e *Blocktrade) GetCoinsData() error
************** 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(strRequestPath)
func (*Blocktrade) GetConfirmation ¶
func (e *Blocktrade) GetConfirmation(coin *coin.Coin) int
func (*Blocktrade) GetConstraintFetchMethod ¶
func (e *Blocktrade) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Blocktrade) GetFee ¶
func (e *Blocktrade) GetFee(pair *pair.Pair) float64
*************** Pair Constraint ***************
func (*Blocktrade) GetID ¶
func (e *Blocktrade) GetID() int
*************** Exchange Information ***************
func (*Blocktrade) GetLotSize ¶
func (e *Blocktrade) GetLotSize(pair *pair.Pair) float64
func (*Blocktrade) GetName ¶
func (e *Blocktrade) GetName() exchange.ExchangeName
func (*Blocktrade) GetPairBySymbol ¶
func (e *Blocktrade) GetPairBySymbol(symbol string) *pair.Pair
func (*Blocktrade) GetPairConstraint ¶
func (e *Blocktrade) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Blocktrade) GetPairs ¶
func (e *Blocktrade) GetPairs() []*pair.Pair
func (*Blocktrade) GetPairsData ¶
func (e *Blocktrade) GetPairsData() error
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 (*Blocktrade) GetPriceFilter ¶
func (e *Blocktrade) GetPriceFilter(pair *pair.Pair) float64
func (*Blocktrade) GetSymbolByCoin ¶
func (e *Blocktrade) GetSymbolByCoin(coin *coin.Coin) string
func (*Blocktrade) GetSymbolByPair ¶
func (e *Blocktrade) GetSymbolByPair(pair *pair.Pair) string
func (*Blocktrade) GetTradingWebURL ¶
func (e *Blocktrade) GetTradingWebURL(pair *pair.Pair) string
func (*Blocktrade) GetTxFee ¶
func (e *Blocktrade) GetTxFee(coin *coin.Coin) float64
*************** Coin Constraint ***************
func (*Blocktrade) InitData ¶
func (e *Blocktrade) InitData() error
func (*Blocktrade) ListOrders ¶
func (e *Blocktrade) ListOrders() ([]*exchange.Order, error)
func (*Blocktrade) LoadPublicData ¶
func (e *Blocktrade) LoadPublicData(operation *exchange.PublicOperation) error
func (*Blocktrade) 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.GetSymbolByPair(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 (*Blocktrade) OrderStatus ¶
func (e *Blocktrade) OrderStatus(order *exchange.Order) error
func (*Blocktrade) SetCoinConstraint ¶
func (e *Blocktrade) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Blocktrade) SetPairConstraint ¶
func (e *Blocktrade) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Blocktrade) UpdateAllBalances ¶
func (e *Blocktrade) UpdateAllBalances()
func (*Blocktrade) UpdateConstraint ¶
func (e *Blocktrade) UpdateConstraint()
type CoinsData ¶
type CoinsData []struct { ID int `json:"id"` FullName string `json:"full_name"` IsoCode string `json:"iso_code"` IconPath string `json:"icon_path"` IconPathPng string `json:"icon_path_png"` Color string `json:"color"` Sign string `json:"sign"` CurrencyType string `json:"currency_type"` MinimalWithdrawalAmount string `json:"minimal_withdrawal_amount"` MinimalOrderValue string `json:"minimal_order_value"` MaximumOrderValue string `json:"maximum_order_value"` LotSize string `json:"lot_size"` DecimalPrecision int `json:"decimal_precision"` }
********* Public API Structure*********
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
type OrderBooks ¶
type PlaceOrder ¶
type PlaceOrder struct { Symbol string `json:"symbol"` OrderID string `json:"orderId"` Side string `json:"side"` Type string `json:"type"` Price string `json:"price"` AveragePrice string `json:"executedQty"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` }