Documentation ¶
Index ¶
- Constants
- Variables
- func LoadNonce()
- func SaveNonce()
- func SetKeys(k, secret string)
- func SetNonce(n uint64)
- type AccountInfo
- type Bool
- type Depth
- type DepthItem
- type DepthsMap
- type Fee
- type Funds
- type Order
- type OrdersMap
- type Pair
- type PairInfo
- type PairsMap
- type Rights
- type Tick
- type TicksMap
- type Time
- type TradeInfo
- type TradeResult
- type TradeType
- type TradesInfo
- type TradesMap
Constants ¶
const ( BTCUSD Pair = "btc_usd" BTCEUR = "btc_eur" BTCRUR = "btc_rur" DSHBTC = "dsh_btc" ETHBTC = "eth_btc" ETHLTC = "eth_ltc" ETHRUR = "eth_rur" ETHUSD = "eth_usd" EURRUR = "eur_rur" EURUSD = "eur_usd" LTCBTC = "ltc_btc" LTCEUR = "ltc_eur" LTCRUR = "ltc_rur" LTCUSD = "ltc_usd" NMCBTC = "nmc_btc" NMCUSD = "nmc_usd" NVCBTC = "nvc_btc" NVCUSD = "nvc_usd" PPCBTC = "ppc_btc" PPCUSD = "ppc_usd" USDRUR = "usd_rur" )
Variables ¶
var ( BaseURL = "https://btc-e.nz/" InfoPath = "api/2/" TradeAPIv1Path = "tapi" PublicAPIv3Path = "api/3/" )
URLs and path to api
It's yours responsibility to end paths with '/' if it's necessary
var NonceFile string = ".nonce"
NonceFile is local file to store nonce.
Functions ¶
func LoadNonce ¶
func LoadNonce()
LoadNonce loads last used nonce from file NonceFile
More info: https://btc-e.nz/tapi/docs#auth
func SaveNonce ¶
func SaveNonce()
SaveNonce dumps current nonce value to file NonceFile
More info: https://btc-e.nz/tapi/docs#auth
func SetNonce ¶
func SetNonce(n uint64)
SetNonce sets last used nonce for trade API calls
More info: https://btc-e.nz/tapi/docs#auth
Types ¶
type AccountInfo ¶
type AccountInfo struct { Funds Rights TransactionCount int `json:"transaction_count"` OpenOrders int `json:"open_orders"` ServerTime Time `json:"server_time"` }
func GetInfo ¶
func GetInfo() (AccountInfo, error)
GetInfo loads your account info.
Panics if key and secret key are not set.
Implements btc-e trade API v1 `getInfo` method.
More info: https://btc-e.nz/tapi/docs#getInfo
func (AccountInfo) String ¶
func (a AccountInfo) String() string
type Depth ¶
func GetDepth ¶
GetDepth loads proces and volumes of active orders. It's wrapper around GetDepths.
Implements btc-e public API v3 `depth` method.
More info: https://btc-e.com/api/3/docs#depth
type DepthItem ¶
func (*DepthItem) UnmarshalJSON ¶
UnmarshalJSON decodes JSON array [<price>, <volume>]
type Funds ¶
func CancelOrder ¶
CancelOrder cancels order.
Panics if key and secret key are not set.
Implements btc-e trade API v1 `cancelOrder` method.
More info: https://btc-e.nz/tapi/docs#CancelOrder
type OrdersMap ¶
func ActiveOrders ¶
ActiveOrders loads list of your active orders.
Panics if key and secret key are not set.
Implements btc-e trade API v1 `activeOrders` method.
More info: https://btc-e.nz/tapi/docs#ActiveOrders
func OrderInfo ¶
OrderInfo loads info about your specified order.
Panics if key and secret key are not set.
Implements btc-e trade API v1 `orderInfo` method.
More info: https://btc-e.nz/tapi/docs#OrderInfo
func TradeHistory ¶
TradeHistory loads your completed orders history.
It's don't support any arhuments for now
Panics if key and secret key are not set.
Implements btc-e trade API v1 `tradeHistory` method.
More info: https://btc-e.nz/tapi/docs#TradeHistory
type PairsMap ¶
func GetPairs ¶
GetPairs loads list of tradable pairs and info about them.
Implements btc-e public API v3 `info` method.
More info: https://btc-e.com/api/3/docs#info
type Tick ¶
type Tick struct { Low float64 `json:"low"` High float64 `json:"high"` Avg float64 `json:"avg"` Vol float64 `json:"vol"` VolCur float64 `json:"vol_cur"` Last float64 `json:"last"` Buy float64 `json:"buy"` Sell float64 `json:"sell"` Updated Time `json:"updated"` ServerTime Time `json:"server_time"` }
func GetTick ¶
GetTick loads last tick (prices) for specified pair. It's wrapper around GetTicks.
Implements btc-e public API v3 `ticker` method.
More info: https://btc-e.com/api/3/docs#ticker
type TradeInfo ¶
type TradeResult ¶
func Trade ¶
func Trade(pair Pair, tp TradeType, rate, amount float64) (TradeResult, error)
Trade create order or execute it right away.
Panics if key and secret key are not set.
Implements btc-e trade API v1 `trade` method.
More info: https://btc-e.nz/tapi/docs#Trade
type TradesInfo ¶
type TradesInfo []TradeInfo
func (TradesInfo) String ¶
func (t TradesInfo) String() string
type TradesMap ¶
type TradesMap map[Pair]TradesInfo