Documentation ¶
Index ¶
- Constants
- func IsoTime() string
- type AccountBalances
- type AssetBalance
- type CoinsData
- type ErrorMsg
- type Okex
- func (e *Okex) ApiKeyRequest(method string, mapParams map[string]interface{}, strRequestPath string) string
- func (e *Okex) CanDeposit(coin *coin.Coin) bool
- func (e *Okex) CanWithdraw(coin *coin.Coin) bool
- func (e *Okex) CancelAllOrder() error
- func (e *Okex) CancelOrder(order *exchange.Order) error
- func (e *Okex) DeleteCoin(coin *coin.Coin)
- func (e *Okex) DeletePair(pair *pair.Pair)
- func (e *Okex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Okex) GetBalance(coin *coin.Coin) float64
- func (e *Okex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Okex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Okex) GetCoins() []*coin.Coin
- func (e *Okex) GetCoinsData() error
- func (e *Okex) GetConfirmation(coin *coin.Coin) int
- func (e *Okex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Okex) GetFee(pair *pair.Pair) float64
- func (e *Okex) GetID() int
- func (e *Okex) GetLotSize(pair *pair.Pair) float64
- func (e *Okex) GetName() exchange.ExchangeName
- func (e *Okex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Okex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Okex) GetPairs() []*pair.Pair
- func (e *Okex) GetPairsData() error
- func (e *Okex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Okex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Okex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Okex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Okex) GetTxFee(coin *coin.Coin) float64
- func (e *Okex) HasPair(pair *pair.Pair) bool
- func (e *Okex) InitData() error
- func (e *Okex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Okex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Okex) ListOrders() ([]*exchange.Order, error)
- func (e *Okex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Okex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Okex) OrderStatus(order *exchange.Order) error
- func (e *Okex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Okex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Okex) Transfer(coin *coin.Coin, quantity float64, from, to int) bool
- func (e *Okex) UpdateAllBalances()
- func (e *Okex) UpdateConstraint()
- func (e *Okex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- func (e *Okex) WithdrawFee() error
- type OpenOrders
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type TickerPrice
- type TradeHistory
- type Transfer
- type TransferHistory
- type WSOrderBook
- type WithdrawFee
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 13 DEFAULT_TAKER_FEE = 0.0015 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://www.okex.com"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountBalances ¶
type AssetBalance ¶
type Okex ¶
type Okex struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string Passphrase string TradePassword string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateOkex ¶
*************************************************
func (*Okex) ApiKeyRequest ¶
func (e *Okex) ApiKeyRequest(method string, mapParams map[string]interface{}, strRequestPath string) string
************** 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 (*Okex) CancelAllOrder ¶
func (*Okex) DeleteCoin ¶
func (*Okex) DeletePair ¶
func (*Okex) DoAccountOperation ¶
func (e *Okex) DoAccountOperation(operation *exchange.AccountOperation) error
func (*Okex) GetCoinConstraint ¶
func (e *Okex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Okex) 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 (*Okex) GetConstraintFetchMethod ¶
func (e *Okex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Okex) GetName ¶
func (e *Okex) GetName() exchange.ExchangeName
func (*Okex) GetPairConstraint ¶
func (e *Okex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Okex) 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 (*Okex) LoadPublicData ¶
func (e *Okex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Okex) 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 (*Okex) SetCoinConstraint ¶
func (e *Okex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Okex) SetPairConstraint ¶
func (e *Okex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Okex) UpdateAllBalances ¶
func (e *Okex) UpdateAllBalances()
func (*Okex) UpdateConstraint ¶
func (e *Okex) UpdateConstraint()
func (*Okex) WithdrawFee ¶
type OpenOrders ¶
type OpenOrders []struct { ClientOid string `json:"client_oid"` CreatedAt time.Time `json:"created_at"` FilledNotional string `json:"filled_notional"` FilledSize string `json:"filled_size"` Funds string `json:"funds"` InstrumentID string `json:"instrument_id"` Notional string `json:"notional"` OrderID string `json:"order_id"` OrderType string `json:"order_type"` Price string `json:"price"` PriceAvg string `json:"price_avg"` ProductID string `json:"product_id"` Side string `json:"side"` Size string `json:"size"` Status string `json:"status"` State string `json:"state"` Timestamp time.Time `json:"timestamp"` Type string `json:"type"` }
type OrderStatus ¶
type OrderStatus struct { OrderID string `json:"order_id"` Notional string `json:"notional"` Price string `json:"price"` Size string `json:"size"` InstrumentID string `json:"instrument_id"` Side string `json:"side"` Type string `json:"type"` Timestamp time.Time `json:"timestamp"` FilledSize string `json:"filled_size"` FilledNotional string `json:"filled_notional"` Status string `json:"status"` Code string `json:"code"` Message string `json:"message"` }
type PlaceOrder ¶
type TickerPrice ¶
type TickerPrice []struct { BestAsk string `json:"best_ask"` BestBid string `json:"best_bid"` InstrumentID string `json:"instrument_id"` ProductID string `json:"product_id"` Last string `json:"last"` LastQty string `json:"last_qty"` Ask string `json:"ask"` BestAskSize string `json:"best_ask_size"` Bid string `json:"bid"` BestBidSize string `json:"best_bid_size"` Open24H string `json:"open_24h"` High24H string `json:"high_24h"` Low24H string `json:"low_24h"` BaseVolume24H string `json:"base_volume_24h"` Timestamp time.Time `json:"timestamp"` QuoteVolume24H string `json:"quote_volume_24h"` }