Documentation ¶
Index ¶
- Constants
- Variables
- func GetMinOrderSize(client *Client, market string, ticker float64, prec int) (float64, error)
- func GetMinimumOrder(client *Client, market string) (float64, error)
- type BookEntry
- type Client
- func (client *Client) BuyLimitOrder(pair string, amount, price float64) (*Order, error)
- func (client *Client) BuyMarketOrder(pair string, amount float64) (*Order, error)
- func (client *Client) CancelOrder(id string) error
- func (client *Client) GetOpenOrders() ([]Order, error)
- func (client *Client) GetOpenOrdersEx(pair string) ([]Order, error)
- func (client *Client) GetUserTransactions(pair string) (Transactions, error)
- func (client *Client) OrderBook(pair string) (*OrderBook, error)
- func (client *Client) SellLimitOrder(pair string, amount, price float64) (*Order, error)
- func (client *Client) SellMarketOrder(pair string, amount float64) (*Order, error)
- func (client *Client) Ticker(pair string) (*Ticker, error)
- func (client *Client) TradingPairsInfo() ([]Pair, error)
- type Market
- type Order
- type OrderBook
- type Orders
- type Pair
- type Ticker
- type Transaction
- func (transaction *Transaction) Amount(client *Client) float64
- func (transaction *Transaction) DateTime() time.Time
- func (transaction *Transaction) Market(client *Client) string
- func (transaction *Transaction) OrderId() string
- func (transaction *Transaction) Price(client *Client) float64
- func (transaction *Transaction) Side(client *Client) (string, error)
- type Transactions
Constants ¶
View Source
const ( Endpoint = "https://www.bitstamp.net/api/v2" TimeFormat = "2006-01-02 15:04:05" )
View Source
const ( BUY = "buy" SELL = "sell" )
Variables ¶
Functions ¶
func GetMinOrderSize ¶
Types ¶
type Client ¶
type Client struct { URL string Key string Secret string // contains filtered or unexported fields }
func (*Client) BuyLimitOrder ¶
func (*Client) BuyMarketOrder ¶
func (*Client) CancelOrder ¶
func (*Client) GetOpenOrders ¶
func (*Client) GetOpenOrdersEx ¶
func (*Client) GetUserTransactions ¶
func (client *Client) GetUserTransactions(pair string) (Transactions, error)
func (*Client) SellLimitOrder ¶
func (*Client) SellMarketOrder ¶
func (*Client) TradingPairsInfo ¶
type Market ¶
type Order ¶
type Order struct { Id string `json:"id"` DateTime string `json:"datetime"` Type int `json:"type,string"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` CurrencyPair string `json:"currency_pair,omitempty"` // warning: NOT equal to market name }
func (*Order) GetDateTimeEx ¶
type Ticker ¶
type Ticker struct { Last float64 `json:"last,string"` High float64 `json:"high,string"` Low float64 `json:"low,string"` Vwap float64 `json:"vwap,string"` Volume float64 `json:"volume,string"` Bid float64 `json:"bid,string"` Ask float64 `json:"ask,string"` Timestamp string `json:"timestamp"` Open float64 `json:"open,string"` }
type Transaction ¶
type Transaction map[string]interface{}
func (*Transaction) Amount ¶
func (transaction *Transaction) Amount(client *Client) float64
func (*Transaction) DateTime ¶
func (transaction *Transaction) DateTime() time.Time
func (*Transaction) Market ¶
func (transaction *Transaction) Market(client *Client) string
func (*Transaction) OrderId ¶
func (transaction *Transaction) OrderId() string
func (*Transaction) Price ¶
func (transaction *Transaction) Price(client *Client) float64
type Transactions ¶
type Transactions []Transaction
func (Transactions) GetOrders ¶
func (transactions Transactions) GetOrders() Transactions
func (Transactions) GetOrdersEx ¶
func (transactions Transactions) GetOrdersEx(client *Client, market string) Transactions
func (Transactions) IndexByOrderId ¶
func (transactions Transactions) IndexByOrderId(id string) int
Click to show internal directories.
Click to hide internal directories.