Documentation ¶
Index ¶
- Constants
- type Bybit
- func (e *Bybit) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Bybit) CanDeposit(coin *coin.Coin) bool
- func (e *Bybit) CanWithdraw(coin *coin.Coin) bool
- func (e *Bybit) CancelAllOrder() error
- func (e *Bybit) CancelOrder(order *exchange.Order) error
- func (e *Bybit) DeleteCoin(coin *coin.Coin)
- func (e *Bybit) DeletePair(pair *pair.Pair)
- func (e *Bybit) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bybit) GetBalance(coin *coin.Coin) float64
- func (e *Bybit) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bybit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bybit) GetCoins() []*coin.Coin
- func (e *Bybit) GetCoinsData() error
- func (e *Bybit) GetConfirmation(coin *coin.Coin) int
- func (e *Bybit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bybit) GetFee(pair *pair.Pair) float64
- func (e *Bybit) GetID() int
- func (e *Bybit) GetLotSize(pair *pair.Pair) float64
- func (e *Bybit) GetName() exchange.ExchangeName
- func (e *Bybit) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bybit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bybit) GetPairs() []*pair.Pair
- func (e *Bybit) GetPairsData() error
- func (e *Bybit) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bybit) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bybit) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bybit) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bybit) GetTxFee(coin *coin.Coin) float64
- func (e *Bybit) HasPair(pair *pair.Pair) bool
- func (e *Bybit) InitData() error
- func (e *Bybit) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bybit) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bybit) ListOrders() ([]*exchange.Order, error)
- func (e *Bybit) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bybit) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Bybit) OrderStatus(order *exchange.Order) error
- func (e *Bybit) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bybit) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bybit) UpdateAllBalances()
- func (e *Bybit) UpdateConstraint()
- func (e *Bybit) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type PairsData
Constants ¶
const ( DEFAULT_ID = 52 DEFAULT_TAKER_FEE = 0.0075 DEFAULT_MAKER_FEE = 0.0025 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://api.bybit.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bybit ¶
type Bybit 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 CreateBybit ¶
*************************************************
func (*Bybit) 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 (*Bybit) CancelAllOrder ¶
func (*Bybit) DeleteCoin ¶
func (*Bybit) DeletePair ¶
func (*Bybit) DoAccountOperation ¶
func (e *Bybit) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bybit) GetCoinConstraint ¶
func (e *Bybit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bybit) 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 (*Bybit) GetConstraintFetchMethod ¶
func (e *Bybit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bybit) GetName ¶
func (e *Bybit) GetName() exchange.ExchangeName
func (*Bybit) GetPairConstraint ¶
func (e *Bybit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bybit) 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 (*Bybit) LoadPublicData ¶
func (e *Bybit) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bybit) 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 (*Bybit) SetCoinConstraint ¶
func (e *Bybit) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bybit) SetPairConstraint ¶
func (e *Bybit) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bybit) UpdateAllBalances ¶
func (e *Bybit) UpdateAllBalances()
func (*Bybit) UpdateConstraint ¶
func (e *Bybit) UpdateConstraint()
type JsonResponse ¶
type PairsData ¶
type PairsData []struct { Name string `json:"name"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` PriceScale int `json:"price_scale"` PriceFilter struct { MinPrice string `json:"min_price"` MaxPrice string `json:"max_price"` TickSize string `json:"tick_size"` } `json:"price_filter"` LotSizeFilter struct { MaxTradingQty int `json:"max_trading_qty"` MinTradingQty int `json:"min_trading_qty"` QtyStep float64 `json:"qty_step"` } `json:"lot_size_filter"` }