Documentation ¶
Index ¶
- Constants
- type AccountAllBalances
- type AccountBalances
- type CloseOrders
- type CoinsData
- type DepositAddress
- type DepositHistory
- type Ftx
- func (e *Ftx) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Ftx) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Ftx) CanDeposit(coin *coin.Coin) bool
- func (e *Ftx) CanWithdraw(coin *coin.Coin) bool
- func (e *Ftx) CancelAllOrder() error
- func (e *Ftx) CancelOrder(order *exchange.Order) error
- func (e *Ftx) DeleteCoin(coin *coin.Coin)
- func (e *Ftx) DeletePair(pair *pair.Pair)
- func (e *Ftx) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Ftx) GetBalance(coin *coin.Coin) float64
- func (e *Ftx) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Ftx) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Ftx) GetCoins() []*coin.Coin
- func (e *Ftx) GetCoinsData() error
- func (e *Ftx) GetConfirmation(coin *coin.Coin) int
- func (e *Ftx) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Ftx) GetFee(pair *pair.Pair) float64
- func (e *Ftx) GetID() int
- func (e *Ftx) GetLotSize(pair *pair.Pair) float64
- func (e *Ftx) GetName() exchange.ExchangeName
- func (e *Ftx) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Ftx) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Ftx) GetPairs() []*pair.Pair
- func (e *Ftx) GetPairsData() error
- func (e *Ftx) GetPriceFilter(pair *pair.Pair) float64
- func (e *Ftx) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Ftx) GetSymbolByPair(pair *pair.Pair) string
- func (e *Ftx) GetTradingWebURL(pair *pair.Pair) string
- func (e *Ftx) GetTxFee(coin *coin.Coin) float64
- func (e *Ftx) HasPair(pair *pair.Pair) bool
- func (e *Ftx) InitData() error
- func (e *Ftx) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Ftx) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Ftx) ListOrders() ([]*exchange.Order, error)
- func (e *Ftx) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Ftx) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Ftx) OrderStatus(order *exchange.Order) error
- func (e *Ftx) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Ftx) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Ftx) UpdateAllBalances()
- func (e *Ftx) UpdateConstraint()
- func (e *Ftx) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type JsonResponse
- type OpenOrders
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type RawKline
- type Uuid
- type WithdrawHistory
Constants ¶
const ( DEFAULT_ID = 62 DEFAULT_TAKER_FEE = 0.0007 DEFAULT_MAKER_FEE = 0.0002 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://ftx.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAllBalances ¶
type AccountBalances ¶
type CloseOrders ¶
type CloseOrders []struct { AvgFillPrice float64 `json:"avgFillPrice"` ClientID interface{} `json:"clientId"` CreatedAt time.Time `json:"createdAt"` FilledSize float64 `json:"filledSize"` Future string `json:"future"` ID int `json:"id"` Ioc bool `json:"ioc"` Market string `json:"market"` PostOnly bool `json:"postOnly"` Price float64 `json:"price"` ReduceOnly bool `json:"reduceOnly"` RemainingSize float64 `json:"remainingSize"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` Type string `json:"type"` }
type DepositAddress ¶
type DepositHistory ¶
type DepositHistory []struct { Coin string `json:"coin"` Notes string `json:"notes"` Confirmations int `json:"confirmations"` ConfirmedTime time.Time `json:"confirmedTime"` Fee float64 `json:"fee"` ID int `json:"id"` SentTime time.Time `json:"sentTime"` Size float64 `json:"size"` Status string `json:"status"` Time time.Time `json:"time"` Txid string `json:"txid"` }
type Ftx ¶
type Ftx struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string Sub_Account_Name string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func (*Ftx) 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 (*Ftx) ApiKeyRequest ¶
func (*Ftx) CancelAllOrder ¶
func (*Ftx) DeleteCoin ¶
func (*Ftx) DeletePair ¶
func (*Ftx) DoAccountOperation ¶
func (e *Ftx) DoAccountOperation(operation *exchange.AccountOperation) error
func (*Ftx) GetCoinConstraint ¶
func (e *Ftx) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Ftx) 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 (*Ftx) GetConstraintFetchMethod ¶
func (e *Ftx) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Ftx) GetName ¶
func (e *Ftx) GetName() exchange.ExchangeName
func (*Ftx) GetPairConstraint ¶
func (e *Ftx) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Ftx) 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 (*Ftx) LoadPublicData ¶
func (e *Ftx) LoadPublicData(operation *exchange.PublicOperation) error
************** PUBLIC API **************
func (*Ftx) SetCoinConstraint ¶
func (e *Ftx) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Ftx) SetPairConstraint ¶
func (e *Ftx) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Ftx) UpdateAllBalances ¶
func (e *Ftx) UpdateAllBalances()
func (*Ftx) UpdateConstraint ¶
func (e *Ftx) UpdateConstraint()
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Result json.RawMessage `json:"result"` }
type OpenOrders ¶
type OpenOrders []struct { CreatedAt time.Time `json:"createdAt"` FilledSize float64 `json:"filledSize"` Future string `json:"future"` ID int `json:"id"` Market string `json:"market"` Price float64 `json:"price"` AvgFillPrice float64 `json:"avgFillPrice"` RemainingSize float64 `json:"remainingSize"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` Type string `json:"type"` ReduceOnly bool `json:"reduceOnly"` Ioc bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientID interface{} `json:"clientId"` }
type OrderStatus ¶
type OrderStatus struct { CreatedAt time.Time `json:"createdAt"` FilledSize float64 `json:"filledSize"` Future string `json:"future"` ID int `json:"id"` Market string `json:"market"` Price float64 `json:"price"` AvgFillPrice float64 `json:"avgFillPrice"` RemainingSize float64 `json:"remainingSize"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` Type string `json:"type"` ReduceOnly bool `json:"reduceOnly"` Ioc bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientID interface{} `json:"clientId"` }
type PairsData ¶
type PairsData []struct { Ask float64 `json:"ask"` BaseCurrency string `json:"baseCurrency"` Bid float64 `json:"bid"` Change1H float64 `json:"change1h,omitempty"` Change24H float64 `json:"change24h,omitempty"` ChangeBod float64 `json:"changeBod,omitempty"` Enabled bool `json:"enabled"` Last float64 `json:"last"` MinProvideSize float64 `json:"minProvideSize"` Name string `json:"name"` Price float64 `json:"price"` PriceIncrement float64 `json:"priceIncrement"` QuoteCurrency string `json:"quoteCurrency"` QuoteVolume24H float64 `json:"quoteVolume24h,omitempty"` Restricted bool `json:"restricted"` SizeIncrement float64 `json:"sizeIncrement"` Type string `json:"type"` Underlying string `json:"underlying"` VolumeUsd24H float64 `json:"volumeUsd24h,omitempty"` }
type PlaceOrder ¶
type PlaceOrder struct { CreatedAt time.Time `json:"createdAt"` FilledSize float64 `json:"filledSize"` Future string `json:"future"` ID int `json:"id"` Market string `json:"market"` Price float64 `json:"price"` RemainingSize float64 `json:"remainingSize"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` Type string `json:"type"` ReduceOnly bool `json:"reduceOnly"` Ioc bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientID interface{} `json:"clientId"` }
type WithdrawHistory ¶
type WithdrawHistory []struct { Coin string `json:"coin"` Notes string `json:"notes"` Address string `json:"address"` Tag interface{} `json:"tag"` Fee float64 `json:"fee"` ID int `json:"id"` Size float64 `json:"size"` Status string `json:"status"` Time time.Time `json:"time"` Txid string `json:"txid"` }
need test array or single