Documentation ¶
Index ¶
- Constants
- func IsoTime() string
- type AccountBalances
- type CoinData
- type JsonResponse
- type Oksim
- func (e *Oksim) ApiKeyRequest(method string, mapParams map[string]interface{}, strRequestPath string) string
- func (e *Oksim) CanDeposit(coin *coin.Coin) bool
- func (e *Oksim) CanWithdraw(coin *coin.Coin) bool
- func (e *Oksim) CancelAllOrder() error
- func (e *Oksim) CancelOrder(order *exchange.Order) error
- func (e *Oksim) DeleteCoin(coin *coin.Coin)
- func (e *Oksim) DeletePair(pair *pair.Pair)
- func (e *Oksim) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Oksim) GetBalance(coin *coin.Coin) float64
- func (e *Oksim) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Oksim) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Oksim) GetCoins() []*coin.Coin
- func (e *Oksim) GetCoinsData() error
- func (e *Oksim) GetConfirmation(coin *coin.Coin) int
- func (e *Oksim) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Oksim) GetFee(pair *pair.Pair) float64
- func (e *Oksim) GetID() int
- func (e *Oksim) GetLotSize(pair *pair.Pair) float64
- func (e *Oksim) GetName() exchange.ExchangeName
- func (e *Oksim) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Oksim) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Oksim) GetPairs() []*pair.Pair
- func (e *Oksim) GetPairsData() error
- func (e *Oksim) GetPriceFilter(pair *pair.Pair) float64
- func (e *Oksim) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Oksim) GetSymbolByPair(pair *pair.Pair) string
- func (e *Oksim) GetTradingWebURL(pair *pair.Pair) string
- func (e *Oksim) GetTxFee(coin *coin.Coin) float64
- func (e *Oksim) HasPair(pair *pair.Pair) bool
- func (e *Oksim) InitData() error
- func (e *Oksim) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Oksim) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Oksim) ListOrders() ([]*exchange.Order, error)
- func (e *Oksim) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Oksim) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Oksim) OrderStatus(order *exchange.Order) error
- func (e *Oksim) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Oksim) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Oksim) Transfer(coin *coin.Coin, quantity float64, from, to int) bool
- func (e *Oksim) UpdateAllBalances()
- func (e *Oksim) UpdateConstraint()
- func (e *Oksim) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type OrderStatus
- type PairData
- type PlaceOrder
- type Transfer
Constants ¶
const ( DEFAULT_ID = 74 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 JsonResponse ¶
type Oksim ¶
type Oksim 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 CreateOksim ¶
*************************************************
func (*Oksim) ApiKeyRequest ¶
func (e *Oksim) 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 (*Oksim) CancelAllOrder ¶
func (*Oksim) DeleteCoin ¶
func (*Oksim) DeletePair ¶
func (*Oksim) DoAccountOperation ¶
func (e *Oksim) DoAccountOperation(operation *exchange.AccountOperation) error
func (*Oksim) GetCoinConstraint ¶
func (e *Oksim) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Oksim) 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 (*Oksim) GetConstraintFetchMethod ¶
func (e *Oksim) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Oksim) GetName ¶
func (e *Oksim) GetName() exchange.ExchangeName
func (*Oksim) GetPairConstraint ¶
func (e *Oksim) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Oksim) 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 (*Oksim) LoadPublicData ¶
func (e *Oksim) LoadPublicData(operation *exchange.PublicOperation) error
func (*Oksim) 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 (*Oksim) SetCoinConstraint ¶
func (e *Oksim) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Oksim) SetPairConstraint ¶
func (e *Oksim) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Oksim) UpdateAllBalances ¶
func (e *Oksim) UpdateAllBalances()
func (*Oksim) UpdateConstraint ¶
func (e *Oksim) UpdateConstraint()
type OrderStatus ¶
type OrderStatus struct { InstType string `json:"instType"` InstID string `json:"instId"` Ccy string `json:"ccy"` OrdID string `json:"ordId"` ClOrdID string `json:"clOrdId"` Tag string `json:"tag"` Px string `json:"px"` Sz string `json:"sz"` Pnl string `json:"pnl"` OrdType string `json:"ordType"` Side string `json:"side"` PosSide string `json:"posSide"` TdMode string `json:"tdMode"` AccFillSz string `json:"accFillSz"` FillPx string `json:"fillPx"` TradeID string `json:"tradeId"` FillSz string `json:"fillSz"` FillTime string `json:"fillTime"` State string `json:"state"` AvgPx string `json:"avgPx"` Lever string `json:"lever"` TpTriggerPx string `json:"tpTriggerPx"` TpOrdPx string `json:"tpOrdPx"` SlTriggerPx string `json:"slTriggerPx"` SlOrdPx string `json:"slOrdPx"` FeeCcy string `json:"feeCcy"` Fee string `json:"fee"` RebateCcy string `json:"rebateCcy"` Rebate string `json:"rebate"` Category string `json:"category"` UTime string `json:"uTime"` CTime string `json:"cTime"` }
type PairData ¶
type PairData struct { Alias string `json:"alias"` BaseCcy string `json:"baseCcy"` Category string `json:"category"` CtMult string `json:"ctMult"` CtType string `json:"ctType"` CtVal string `json:"ctVal"` CtValCcy string `json:"ctValCcy"` ExpTime string `json:"expTime"` InstID string `json:"instId"` InstType string `json:"instType"` Lever string `json:"lever"` ListTime string `json:"listTime"` LotSz string `json:"lotSz"` MinSz string `json:"minSz"` OptType string `json:"optType"` QuoteCcy string `json:"quoteCcy"` SettleCcy string `json:"settleCcy"` State string `json:"state"` Stk string `json:"stk"` TickSz string `json:"tickSz"` Uly string `json:"uly"` }