Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CancelOrder
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type Tokok
- func (e *Tokok) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Tokok) ApiKeyRequest(strMethod string, mapParams map[string]interface{}, strRequestPath string) string
- func (e *Tokok) CanDeposit(coin *coin.Coin) bool
- func (e *Tokok) CanWithdraw(coin *coin.Coin) bool
- func (e *Tokok) CancelAllOrder() error
- func (e *Tokok) CancelOrder(order *exchange.Order) error
- func (e *Tokok) DeleteCoin(coin *coin.Coin)
- func (e *Tokok) DeletePair(pair *pair.Pair)
- func (e *Tokok) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Tokok) GetBalance(coin *coin.Coin) float64
- func (e *Tokok) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Tokok) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Tokok) GetCoins() []*coin.Coin
- func (e *Tokok) GetCoinsData() error
- func (e *Tokok) GetConfirmation(coin *coin.Coin) int
- func (e *Tokok) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Tokok) GetFee(pair *pair.Pair) float64
- func (e *Tokok) GetID() int
- func (e *Tokok) GetLotSize(pair *pair.Pair) float64
- func (e *Tokok) GetName() exchange.ExchangeName
- func (e *Tokok) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Tokok) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Tokok) GetPairs() []*pair.Pair
- func (e *Tokok) GetPairsData() error
- func (e *Tokok) GetPriceFilter(pair *pair.Pair) float64
- func (e *Tokok) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Tokok) GetSymbolByPair(pair *pair.Pair) string
- func (e *Tokok) GetTradingWebURL(pair *pair.Pair) string
- func (e *Tokok) GetTxFee(coin *coin.Coin) float64
- func (e *Tokok) HasPair(pair *pair.Pair) bool
- func (e *Tokok) InitData() error
- func (e *Tokok) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Tokok) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Tokok) ListOrders() ([]*exchange.Order, error)
- func (e *Tokok) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Tokok) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Tokok) OrderStatus(order *exchange.Order) error
- func (e *Tokok) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Tokok) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Tokok) UpdateAllBalances()
- func (e *Tokok) UpdateConstraint()
- func (e *Tokok) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
Constants ¶
const ( DEFAULT_ID = 23 DEFAULT_TAKER_FEE = 0.002 DEFAULT_MAKER_FEE = 0.002 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://www.tokok.com/api/v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type CancelOrder ¶
type JsonResponse ¶
type JsonResponse struct { Result bool `json:"result"` Code int `json:"code"` Data json.RawMessage `json:"data"` }
type OrderBook ¶
type OrderBook struct { Bids [][]interface{} `json:"bids"` Asks [][]interface{} `json:"asks"` }
type OrderStatus ¶
type OrderStatus struct { EntrustNum string `json:"entrustNum"` Type int `json:"type"` Status int `json:"status"` EntrustPrice string `json:"entrustPrice"` EntrustCount string `json:"entrustCount"` EntrustSum string `json:"entrustSum"` SurplusEntrustCount string `json:"surplusEntrustCount"` EntrustTimeLong int64 `json:"entrustTime_long"` TransactionFee string `json:"transactionFee"` ProcessedPrice string `json:"processedPrice"` OpenTokFee int `json:"openTokFee"` Symbol string `json:"symbol"` }
type PairsData ¶
type PairsData []struct { Symbol string `json:"symbol"` Status string `json:"status"` BaseAsset string `json:"baseAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAsset string `json:"quoteAsset"` QuoteAssetPrecision int `json:"quoteAssetPrecision"` MinOrderAmount string `json:"minOrderAmount"` MaxOrderAmount string `json:"maxOrderAmount"` }
type PlaceOrder ¶
type PlaceOrder struct {
Data string `json:"data"`
}
type Tokok ¶
type Tokok 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 CreateTokok ¶
*************************************************
func (*Tokok) ApiKeyRequest ¶
func (e *Tokok) ApiKeyRequest(strMethod 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 (*Tokok) CancelAllOrder ¶
func (*Tokok) DeleteCoin ¶
func (*Tokok) DeletePair ¶
func (*Tokok) DoAccountOperation ¶
func (e *Tokok) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Tokok) GetCoinConstraint ¶
func (e *Tokok) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Tokok) 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 (*Tokok) GetConstraintFetchMethod ¶
func (e *Tokok) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Tokok) GetName ¶
func (e *Tokok) GetName() exchange.ExchangeName
func (*Tokok) GetPairConstraint ¶
func (e *Tokok) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Tokok) 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 (*Tokok) LoadPublicData ¶
func (e *Tokok) LoadPublicData(operation *exchange.PublicOperation) error
func (*Tokok) 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 (*Tokok) SetCoinConstraint ¶
func (e *Tokok) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Tokok) SetPairConstraint ¶
func (e *Tokok) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Tokok) UpdateAllBalances ¶
func (e *Tokok) UpdateAllBalances()
func (*Tokok) UpdateConstraint ¶
func (e *Tokok) UpdateConstraint()