Documentation ¶
Index ¶
- Constants
- Variables
- func CancelAllOrders() error
- func CancelOrder(id uuid.UUID) (entities.Base, error)
- func GetAllBalances() (entities.AllBalanceResp, error)
- func GetAllCurrencies() ([]string, error)
- func GetAllOrders() (entities.OrdersResp, error)
- func GetAllOrdersFor(pair string) (entities.OrdersResp, error)
- func GetAllTransactions() (entities.TransactionResp, error)
- func GetBalance(currency string) (entities.BalanceResp, error)
- func GetBalances(hideZero bool) map[string]*entities.BalanceResp
- func GetCandles(pair string, interval CandleInterval, from, to time.Time) (entities.CandlesResp, error)
- func GetCurrencies() (entities.CurrencyResp, error)
- func GetDepositAddress(currency string) (entities.DepositAddrResp, error)
- func GetOrderBook(pair string) (entities.OrderBookResp, error)
- func GetOrderDetails(id uuid.UUID) (entities.OrderDetailsResp, error)
- func GetTicker(pair string, interval TickerInterval) (entities.TickerResp, error)
- func GetTrades(pair string, interval TickerInterval) (entities.TradesResp, error)
- func GetTradingPairs() (entities.TradingPairResp, error)
- func GetTransactions(page int) (entities.TransactionResp, error)
- func GetVotes() (entities.VotesResp, error)
- func Init(configPath string) error
- func InstallErrorHook(f ErrorHook)
- func PlaceOrder(pair string, side entities.OrderType, amount float64, amountDecimals int, ...) (entities.PlaceOrderResp, error)
- func PlaceOrderTyped(pair *entities.TradingPair, side entities.OrderType, amount Amount, ...) (entities.PlaceOrderResp, error)
- func UninstallErrorHook()
- type Amount
- type CandleInterval
- type CandleIntervalSpec
- type CredentialsConfig
- type ErrorHook
- type Price
- type TickerInterval
Constants ¶
View Source
const ( // Base URL for API calls TokensBaseUrl = "https://api.tokens.net" // Percentage fee for takers TakerFeePercent = 0.2 // Percentage fee for makers MakerFeePercent = 0 )
View Source
const ( Day = iota Hour )
View Source
const ( Min1 = iota Min5 Min10 Min30 Day1 )
View Source
const (
Timeout = time.Duration(5 * time.Second)
)
Variables ¶
View Source
var ( Credentials *CredentialsConfig NullHookFunc = func(code int, reason string) {} HookFunc = NullHookFunc )
Functions ¶
func GetAllCurrencies ¶
* * Get all supported currency codes. * See GetCurrencies()
func GetAllOrdersFor ¶
func GetAllOrdersFor(pair string) (entities.OrdersResp, error)
*
- Get all orders for currency pair.
func GetAllTransactions ¶
func GetAllTransactions() (entities.TransactionResp, error)
*
- Get transactions. WARNING might take a while.
func GetBalances ¶
func GetBalances(hideZero bool) map[string]*entities.BalanceResp
* * Get balances.
func GetCandles ¶ added in v0.0.2
func GetCandles(pair string, interval CandleInterval, from, to time.Time) (entities.CandlesResp, error)
*
- Get candles.
func GetCurrencies ¶ added in v0.0.2
func GetCurrencies() (entities.CurrencyResp, error)
*
- Get currencies (and some basic info).
func GetDepositAddress ¶ added in v0.0.2
func GetDepositAddress(currency string) (entities.DepositAddrResp, error)
*
- Get deposit address for given currency (note you need API key of Main account)
func GetOrderBook ¶
func GetOrderBook(pair string) (entities.OrderBookResp, error)
* * Get order book.
func GetOrderDetails ¶
func GetOrderDetails(id uuid.UUID) (entities.OrderDetailsResp, error)
*
- Get order details.
func GetTicker ¶
func GetTicker(pair string, interval TickerInterval) (entities.TickerResp, error)
* * Get ticker for last day or hour.
func GetTrades ¶
func GetTrades(pair string, interval TickerInterval) (entities.TradesResp, error)
* * List trades, which occured in last minute, hour or day.
func GetTradingPairs ¶
func GetTradingPairs() (entities.TradingPairResp, error)
* * List all existing pairs.
func GetTransactions ¶
func GetTransactions(page int) (entities.TransactionResp, error)
*
- Get transactions. Page parameter starts from 1 and goes to max (which you get from TransactionResp.TotalPages)
func GetVotes ¶
*
- List all currencies participating in voting and number of votes for each currency.
func InstallErrorHook ¶
func InstallErrorHook(f ErrorHook)
func PlaceOrder ¶
func PlaceOrder( pair string, side entities.OrderType, amount float64, amountDecimals int, price float64, priceDecimals int, takeProfitPrice float64, expireDate *time.Time) (entities.PlaceOrderResp, error)
*
- Place an order.
func PlaceOrderTyped ¶
func PlaceOrderTyped( pair *entities.TradingPair, side entities.OrderType, amount Amount, price Price, takeProfitPrice *Price, expireDate *time.Time) (entities.PlaceOrderResp, error)
*
- Place an order in a type-safe manner to avoid (costly) mistakes.
func UninstallErrorHook ¶
func UninstallErrorHook()
Types ¶
type CandleInterval ¶ added in v0.0.2
type CandleInterval int
type CandleIntervalSpec ¶ added in v0.0.2
type CredentialsConfig ¶
type TickerInterval ¶ added in v0.0.2
type TickerInterval int
Click to show internal directories.
Click to hide internal directories.