Documentation ¶
Index ¶
- Constants
- func CreateSign(mapParams map[string]string, e *Digifinex) string
- func GetTimeDifference() int64
- type AccountBalances
- type CancelOrder
- type Digifinex
- func (e *Digifinex) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Digifinex) ApiKeyPost(mapParams map[string]string, strRequestPath string) string
- func (e *Digifinex) CanDeposit(coin *coin.Coin) bool
- func (e *Digifinex) CanWithdraw(coin *coin.Coin) bool
- func (e *Digifinex) CancelAllOrder() error
- func (e *Digifinex) CancelOrder(order *exchange.Order) error
- func (e *Digifinex) DeleteCoin(coin *coin.Coin)
- func (e *Digifinex) DeletePair(pair *pair.Pair)
- func (e *Digifinex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Digifinex) GetBalance(coin *coin.Coin) float64
- func (e *Digifinex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Digifinex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Digifinex) GetCoins() []*coin.Coin
- func (e *Digifinex) GetCoinsData() error
- func (e *Digifinex) GetConfirmation(coin *coin.Coin) int
- func (e *Digifinex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Digifinex) GetFee(pair *pair.Pair) float64
- func (e *Digifinex) GetID() int
- func (e *Digifinex) GetLotSize(pair *pair.Pair) float64
- func (e *Digifinex) GetName() exchange.ExchangeName
- func (e *Digifinex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Digifinex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Digifinex) GetPairs() []*pair.Pair
- func (e *Digifinex) GetPairsData() error
- func (e *Digifinex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Digifinex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Digifinex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Digifinex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Digifinex) GetTxFee(coin *coin.Coin) float64
- func (e *Digifinex) HasPair(pair *pair.Pair) bool
- func (e *Digifinex) InitData() error
- func (e *Digifinex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Digifinex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Digifinex) ListOrders() ([]*exchange.Order, error)
- func (e *Digifinex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Digifinex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Digifinex) OrderStatus(order *exchange.Order) error
- func (e *Digifinex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Digifinex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Digifinex) UpdateAllBalances()
- func (e *Digifinex) UpdateConstraint()
- func (e *Digifinex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 48 DEFAULT_TAKER_FEE = 0.0025 DEFAULT_MAKER_FEE = 0.0025 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 string = "https://openapi.digifinex.com/v2"
)
Variables ¶
This section is empty.
Functions ¶
func GetTimeDifference ¶
func GetTimeDifference() int64
Types ¶
type AccountBalances ¶
type CancelOrder ¶
type CancelOrder struct { Success []interface{} `json:"success"` Fail [][]interface{} `json:"fail"` }
type Digifinex ¶
type Digifinex 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 CreateDigifinex ¶
*************************************************
func (*Digifinex) ApiKeyGET ¶
************** 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 (*Digifinex) ApiKeyPost ¶
func (*Digifinex) CancelAllOrder ¶
func (*Digifinex) DeleteCoin ¶
func (*Digifinex) DeletePair ¶
func (*Digifinex) DoAccountOperation ¶
func (e *Digifinex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Digifinex) GetCoinConstraint ¶
func (e *Digifinex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Digifinex) 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 (*Digifinex) GetConstraintFetchMethod ¶
func (e *Digifinex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Digifinex) GetName ¶
func (e *Digifinex) GetName() exchange.ExchangeName
func (*Digifinex) GetPairConstraint ¶
func (e *Digifinex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Digifinex) 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 (*Digifinex) LoadPublicData ¶
func (e *Digifinex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Digifinex) 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 (*Digifinex) SetCoinConstraint ¶
func (e *Digifinex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Digifinex) SetPairConstraint ¶
func (e *Digifinex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Digifinex) UpdateAllBalances ¶
func (e *Digifinex) UpdateAllBalances()
func (*Digifinex) UpdateConstraint ¶
func (e *Digifinex) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Data json.RawMessage `json:"data"` Date int `json:"date"` Code int `json:"code"` }
type OrderStatus ¶
type OrderStatus []struct { OrderID string `json:"order_id"` CreatedDate int `json:"created_date"` FinishedDate int `json:"finished_date"` Price float64 `json:"price"` Amount float64 `json:"amount"` ExecutedAmount float64 `json:"executed_amount"` CashAmount int `json:"cash_amount"` AvgPrice float64 `json:"avg_price"` Type string `json:"type"` Status int `json:"status"` }