Documentation ¶
Overview ¶
Go wrapper for the Luno API. The API is documented here: https://www.luno.com/api
Index ¶
- Constants
- type Address
- type Balance
- type Client
- func (c *Client) Balance(asset string) (balance float64, reserved float64, err error)
- func (c *Client) Balances() ([]Balance, error)
- func (c *Client) CreateQuote(quoteType, baseAmount, pair string) (QuoteResponse, error)
- func (c *Client) DeleteQuote(id string) (QuoteResponse, error)
- func (c *Client) ExerciseQuote(id string) (QuoteResponse, error)
- func (c *Client) GetFeeInfo(pair string) (FeeInfo, error)
- func (c *Client) GetOrder(id string) (*Order, error)
- func (c *Client) GetQuote(id string) (QuoteResponse, error)
- func (c *Client) GetReceiveAddress(asset string, receiveAddress string) (Address, error)
- func (c *Client) GetWithdrawal(id string) (*Withdrawal, error)
- func (c *Client) GetWithdrawals() (*WithdrawalList, error)
- func (c *Client) ListOrders(pair string, state OrderState) ([]Order, error)
- func (c *Client) ListTrades(pair string, since int64) ([]OrderTrade, error)
- func (c *Client) NewReceiveAddress(asset string) (Address, error)
- func (c *Client) OrderBook(pair string) (bids, asks []OrderBookEntry, err error)
- func (c *Client) PostOrder(pair string, order_type OrderType, volume, price float64, ...) (string, error)
- func (c *Client) Send(amount, currency, address, desc, message string) (string, error)
- func (c *Client) SetBaseURL(url url.URL)
- func (c *Client) StopOrder(id string) error
- func (c *Client) Ticker(pair string) (Ticker, error)
- func (c *Client) Trades(pair string) ([]Trade, error)
- type FeeInfo
- type Order
- type OrderBookEntry
- type OrderState
- type OrderTrade
- type OrderType
- type QuoteResponse
- type Ticker
- type Trade
- type Withdrawal
- type WithdrawalList
Constants ¶
const ASK = OrderType("ASK")
const BID = OrderType("BID")
const Complete = OrderState("COMPLETE")
const Pending = OrderState("PENDING")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateQuote ¶
func (c *Client) CreateQuote(quoteType, baseAmount, pair string) (QuoteResponse, error)
CreateQuote creates a quote of the given type (BUY or SELL) for the given baseAmount of a specific pair (like XBTZAR)
func (*Client) DeleteQuote ¶
func (c *Client) DeleteQuote(id string) (QuoteResponse, error)
DeleteQuote rejects a quote
func (*Client) ExerciseQuote ¶
func (c *Client) ExerciseQuote(id string) (QuoteResponse, error)
ExerciseQuote accepts the given quote
func (*Client) GetFeeInfo ¶
GetFeeInfo returns information about the user's fees and trading volume.
func (*Client) GetQuote ¶
func (c *Client) GetQuote(id string) (QuoteResponse, error)
GetQuote returns the details of the specified quote
func (*Client) GetReceiveAddress ¶
GetReceiveAddress returns the default receive address associated with your account and the amount received via the address, but can take optional parameter to check non-default address
func (*Client) GetWithdrawal ¶
func (c *Client) GetWithdrawal(id string) (*Withdrawal, error)
func (*Client) GetWithdrawals ¶
func (c *Client) GetWithdrawals() (*WithdrawalList, error)
func (*Client) ListOrders ¶
func (c *Client) ListOrders(pair string, state OrderState) ([]Order, error)
Returns a list of placed orders. The list is truncated after 100 items. If state is an empty string, the list won't be filtered by state.
func (*Client) ListTrades ¶
func (c *Client) ListTrades(pair string, since int64) ([]OrderTrade, error)
ListTrades returns trades in your account for the given pair, sortest by oldest first, since the given timestamp.
func (*Client) NewReceiveAddress ¶
NewReceiveAddress allocates a new receive address to your account. There is a rate limit of 1 address per hour, but bursts of up to 10 addresses are allowed.
func (*Client) OrderBook ¶
func (c *Client) OrderBook(pair string) ( bids, asks []OrderBookEntry, err error)
Returns a list of bids and asks in the order book for the given currency pair.
func (*Client) PostOrder ¶
func (c *Client) PostOrder(pair string, order_type OrderType, volume, price float64, baseAccountID, counterAccountID string) (string, error)
Create a new trade order. Specify zero for baseAccountID and counterAccountID to use your default accounts.
type FeeInfo ¶
type FeeInfo struct { ThirtyDayVolume float64 `json:"thirty_day_volume,string"` MakerFee float64 `json:"maker_fee,string"` TakerFee float64 `json:"taker_fee,string"` }
FeeInfo hold information about the user's fees and trading volume.
type OrderBookEntry ¶
type OrderBookEntry struct {
Price, Volume float64
}
type OrderState ¶
type OrderState string
type OrderTrade ¶
type OrderTrade struct { Base float64 `json:"base,string"` Counter float64 `json:"counter,string"` FeeBase float64 `json:"fee_base,string"` FeeCounter float64 `json:"fee_counter,string"` IsBuy bool `json:"is_buy"` OrderID string `json:"order_id"` Pair string `json:"pair"` Price float64 `json:"price,string"` Timestamp int64 `json:"timestamp"` Type OrderType `json:"type"` Volume float64 `json:"volume,string"` }
type QuoteResponse ¶
type QuoteResponse struct { ID int64 `json:"id,string"` Type string `json:"type"` Pair string `json:"pair"` BaseAmount float64 `json:"base_amount,string"` CounterAmount float64 `json:"counter_amount,string"` CreatedAt int64 `json:"created_at"` ExpiresAt int64 `json:"expires_at"` Discarded bool `json:"discarded"` Exercised bool `json:"exercised"` }
QuoteResponse contains information about a specific quote
type Withdrawal ¶
type WithdrawalList ¶
type WithdrawalList struct {
Withdrawals []Withdrawal `json:"withdrawals"`
}