Documentation ¶
Overview ¶
Package Livecoin is an implementation of the Livecoin API in Golang.
Index ¶
- Constants
- func NewClient(apiKey, apiSecret string) (c *client)
- func NewClientWithCustomHttpConfig(apiKey, apiSecret string, httpClient *http.Client) (c *client)
- func NewClientWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) (c *client)
- type Balance
- type Livecoin
- func (b *Livecoin) GetBalance(currency string) (balance Balance, err error)
- func (b *Livecoin) GetBalances() (balances []Balance, err error)
- func (b *Livecoin) GetTrades(currencyPair string) (trades []Trade, err error)
- func (b *Livecoin) GetTransactions(start uint64, end uint64) (transactions []Transaction, err error)
- func (c *Livecoin) SetDebug(enable bool)
- type Trade
- type Transaction
Constants ¶
const (
API_BASE = "https://api.livecoin.net" // Livecoin API endpoint
)
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(apiKey, apiSecret string) (c *client)
NewClient return a new Livecoin HTTP client
func NewClientWithCustomHttpConfig ¶
NewClientWithCustomHttpConfig returns a new Livecoin HTTP client using the predefined http client
func NewClientWithCustomTimeout ¶
NewClient returns a new Livecoin HTTP client with custom timeout
Types ¶
type Livecoin ¶
type Livecoin struct {
// contains filtered or unexported fields
}
livecoin represent a livecoin client
func NewWithCustomHttpClient ¶
NewWithCustomHttpClient returns an instantiated livecoin struct with custom http client
func NewWithCustomTimeout ¶
NewWithCustomTimeout returns an instantiated livecoin struct with custom timeout
func (*Livecoin) GetBalance ¶
Getbalance is used to retrieve the balance from your account for a specific currency. currency: a string literal for the currency (ex: LTC)
func (*Livecoin) GetBalances ¶
GetBalances is used to retrieve all balances from your account
func (*Livecoin) GetTrades ¶
GetTrades used to retrieve your trade history. market string literal for the market (ie. BTC/LTC). If set to "all", will return for all market
func (*Livecoin) GetTransactions ¶
func (b *Livecoin) GetTransactions(start uint64, end uint64) (transactions []Transaction, err error)
GetTransactions is used to retrieve your withdrawal and deposit history "Start" and "end" are given in UNIX timestamp format in miliseconds and used to specify the date range for the data returned.
type Trade ¶
type Trade struct { Id uint64 `json:"id"` ClientOrderId uint64 `json:"clientorderid"` Type string `json:"type"` Symbol string `json:"symbol"` Date time.Time `json:"datetime"` Price float64 `json:"price"` Quantity float64 `json:"quantity"` Commission float64 `json:"commission"` }
func (*Trade) UnmarshalJSON ¶
type Transaction ¶
type Transaction struct { Id string `json:"id"` Type string `json:"type"` Date time.Time `json:"date"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` FixedCurrency string `json:"fixedCurrency"` TaxCurrency string `json:"taxCurrency"` External string `json:"external"` ExternalKey string `json:"externalKey"` Login string `json:"login"` }
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error