Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Balance
- type CoinsData
- type FundSource
- type FundSources
- type JsonResponse
- type OrderBook
- type OrderDetail
- type OrdersPage
- type PairsData
- type PlaceOrder
- type Tick
- type TradeHistory
- type WithdrawResponse
- type Zebitex
- func (e *Zebitex) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Zebitex) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) (string, int)
- func (e *Zebitex) CanDeposit(coin *coin.Coin) bool
- func (e *Zebitex) CanWithdraw(coin *coin.Coin) bool
- func (e *Zebitex) CancelAllOrder() error
- func (e *Zebitex) CancelOrder(order *exchange.Order) error
- func (e *Zebitex) CreateFundSource(currency, label, addr string) (bool, FundSource)
- func (e *Zebitex) DeleteCoin(coin *coin.Coin)
- func (e *Zebitex) DeletePair(pair *pair.Pair)
- func (e *Zebitex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Zebitex) GetBalance(coin *coin.Coin) float64
- func (e *Zebitex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Zebitex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Zebitex) GetCoins() []*coin.Coin
- func (e *Zebitex) GetCoinsData() error
- func (e *Zebitex) GetConfirmation(coin *coin.Coin) int
- func (e *Zebitex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Zebitex) GetFee(pair *pair.Pair) float64
- func (e *Zebitex) GetID() int
- func (e *Zebitex) GetLotSize(pair *pair.Pair) float64
- func (e *Zebitex) GetName() exchange.ExchangeName
- func (e *Zebitex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Zebitex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Zebitex) GetPairs() []*pair.Pair
- func (e *Zebitex) GetPairsData() error
- func (e *Zebitex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Zebitex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Zebitex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Zebitex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Zebitex) GetTxFee(coin *coin.Coin) float64
- func (e *Zebitex) HasPair(pair *pair.Pair) bool
- func (e *Zebitex) InitData() error
- func (e *Zebitex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Zebitex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Zebitex) ListOrders() ([]*exchange.Order, error)
- func (e *Zebitex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Zebitex) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Zebitex) OrderStatus(order *exchange.Order) error
- func (e *Zebitex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Zebitex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Zebitex) UpdateAllBalances()
- func (e *Zebitex) UpdateConstraint()
- func (e *Zebitex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
Constants ¶
const ( DEFAULT_ID = 53 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 = "https://zebitex.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Balance ¶
type Balance struct { IsFiat bool `json:"isFiat"` Code string `json:"code"` Title string `json:"title"` PaymentAddress string `json:"paymentAddress"` Balance string `json:"balance"` LockedBalance string `json:"lockedBalance"` PaymentAddressQrCode string `json:"paymentAddressQrCode"` BankAccounts interface{} `json:"bankAccounts"` IsDisabled bool `json:"isDisabled"` }
********* Private API Structure*********
type FundSource ¶
type FundSources ¶
type FundSources []FundSource
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
type OrderBook ¶
type OrderBook struct { Bids [][]interface{} `json:"bids"` Asks [][]interface{} `json:"asks"` }
type OrderDetail ¶
type OrderDetail struct { Id int64 `json:"id"` Side string `json:"side"` State string `json:"state"` OrdType string `json:"ordType"` Currency string `json:"currency"` Price string `json:"price"` Filled string `json:"filled"` Amount string `json:"amount"` Avg string `json:"avg"` Total string `json:"total"` UpdatedAt string `json:"updatedAt"` Pair string `json:"pair"` BaseUnit string `json:"baseUnit"` QuoteUnit string `json:"quoteUnit"` }
type OrdersPage ¶
type OrdersPage struct { Per int64 `json:"per"` Items []OrderDetail `json:"items"` NextCursor interface{} `json:"nextCursor"` }
type PlaceOrder ¶
type Tick ¶
type Tick struct { Name string `json:"name"` BaseUnit string `json:"base_unit"` QuoteUnit string `json:"quote_unit"` AskFee float64 `json:"ask_fee"` BidFee float64 `json:"bid_fee"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` VisualLow string `json:"visualLow"` VisualHigh string `json:"visualHigh"` VisualLast string `json:"visualLast"` At int `json:"at"` Open string `json:"open"` Volume interface{} `json:"volume"` //接口返回有时是浮点,有时是字符串 Market string `json:"market"` // Buy float64 `json:"buy"` IsUpTend bool `json:"isUpTend"` // Sell float64 `json:"sell"` Percent string `json:"percent"` Change string `json:"change"` VisualOpen string `json:"visualOpen"` VisualVolume string `json:"visualVolume"` VisualBuy string `json:"visualBuy"` VisualSell string `json:"visualSell"` }
********* Public API Structure*********
type TradeHistory ¶
type WithdrawResponse ¶
type WithdrawResponse struct {
Error string `json:"error"`
}
type Zebitex ¶
type Zebitex 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 CreateZebitex ¶
*************************************************
func (*Zebitex) ApiKeyGet ¶
************** 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 (*Zebitex) ApiKeyRequest ¶
func (e *Zebitex) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) (string, int)
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 (*Zebitex) CancelAllOrder ¶
func (*Zebitex) CreateFundSource ¶
func (e *Zebitex) CreateFundSource(currency, label, addr string) (bool, FundSource)
don't use this for withdraw
CreateFundSource(currency, label, addr string)
func (*Zebitex) DeleteCoin ¶
func (*Zebitex) DeletePair ¶
func (*Zebitex) DoAccountOperation ¶
func (e *Zebitex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Zebitex) GetCoinConstraint ¶
func (e *Zebitex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Zebitex) 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(strRequestPath)
func (*Zebitex) GetConstraintFetchMethod ¶
func (e *Zebitex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Zebitex) GetName ¶
func (e *Zebitex) GetName() exchange.ExchangeName
func (*Zebitex) GetPairConstraint ¶
func (e *Zebitex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Zebitex) 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 (*Zebitex) LoadPublicData ¶
func (e *Zebitex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Zebitex) 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 (*Zebitex) OrderStatus ¶
Update delay after order cancelled
func (*Zebitex) SetCoinConstraint ¶
func (e *Zebitex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Zebitex) SetPairConstraint ¶
func (e *Zebitex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Zebitex) UpdateAllBalances ¶
func (e *Zebitex) UpdateAllBalances()
func (*Zebitex) UpdateConstraint ¶
func (e *Zebitex) UpdateConstraint()