Documentation ¶
Overview ¶
Package SouthXchange is an implementation of the SouthXchange API in Golang.
Index ¶
- Constants
- func DecodeData(body []byte, indexes []int) (ret []byte, err error)
- func NewClient(apiKey, apiSecret, userAgent string) (c *client)
- func NewClientWithCustomHttpConfig(apiKey, apiSecret, userAgent string, httpClient *http.Client) (c *client)
- func NewClientWithCustomTimeout(apiKey, apiSecret, userAgent string, timeout time.Duration) (c *client)
- type Balance
- type Book
- type BookOrder
- type MarketPrice
- type MarketSummary
- type Order
- type OrderType
- type SouthXchange
- func (o *SouthXchange) GetBalances() (balances []Balance, err error)
- func (b *SouthXchange) GetBookOrders(listing string, reference string) (book Book, err error)
- func (b *SouthXchange) GetDepositAddress(currency string) (address string, err error)
- func (s *SouthXchange) GetMarketPrice(listing string, reference string) (marketPrice MarketPrice, err error)
- func (b *SouthXchange) GetMarketSummaries() (marketSummaries []MarketSummary, err error)
- func (b *SouthXchange) GetOpenOrders() (openOrders []Order, err error)
- func (b *SouthXchange) GetOrder(orderCode string) (order Order, err error)
- func (b *SouthXchange) GetTransactions(transactionType string, start uint64, limit uint32, sort string, desc bool) (transactions []Transaction, err error)
- func (o *SouthXchange) ListOrders() (orders []string, err error)
- func (o *SouthXchange) PlaceOrder(listing string, reference string, orderSide OrderType, amount float64, ...) (orderCode string, err error)
- func (o *SouthXchange) SetDebug(enable bool)
- func (o *SouthXchange) Withdraw(address string, currency string, quantity float64) (withdraw WithdrawalInfo, err error)
- type Timestamp
- type Transaction
- type WithdrawalInfo
Constants ¶
const ( API_BASE = "https://www.southxchange.com/api" // SouthXchange API endpoint API_BASE_V2 = "https://www.southxchange.com/api/v2" )
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(apiKey, apiSecret, userAgent string) (c *client)
NewClient return a new SouthXchange HTTP client
func NewClientWithCustomHttpConfig ¶
func NewClientWithCustomHttpConfig(apiKey, apiSecret, userAgent string, httpClient *http.Client) (c *client)
NewClientWithCustomHttpConfig returns a new SouthXchange HTTP client using the predefined http client
func NewClientWithCustomTimeout ¶
func NewClientWithCustomTimeout(apiKey, apiSecret, userAgent string, timeout time.Duration) (c *client)
NewClient returns a new SouthXchange HTTP client with custom timeout
Types ¶
type MarketPrice ¶
type MarketSummary ¶
func (*MarketSummary) UnmarshalJSON ¶
func (n *MarketSummary) UnmarshalJSON(buf []byte) error
type SouthXchange ¶
type SouthXchange struct {
// contains filtered or unexported fields
}
SouthXchange represent a SouthXchange client
func New ¶
func New(apiKey, apiSecret, userAgent string) *SouthXchange
New returns an instantiated SouthXchange struct
func NewWithCustomHttpClient ¶
func NewWithCustomHttpClient(apiKey, apiSecret, userAgent string, httpClient *http.Client) *SouthXchange
NewWithCustomHttpClient returns an instantiated SouthXchange struct with custom http client
func NewWithCustomTimeout ¶
func NewWithCustomTimeout(apiKey, apiSecret, userAgent string, timeout time.Duration) *SouthXchange
NewWithCustomTimeout returns an instantiated SouthXchange struct with custom timeout
func (*SouthXchange) GetBalances ¶
func (o *SouthXchange) GetBalances() (balances []Balance, err error)
GetBalances is used to retrieve all balances from your account
func (*SouthXchange) GetBookOrders ¶
func (b *SouthXchange) GetBookOrders(listing string, reference string) (book Book, err error)
func (*SouthXchange) GetDepositAddress ¶
func (b *SouthXchange) GetDepositAddress(currency string) (address string, err error)
GetDepositAddress is sed to generate or retrieve an address for a specific currency. currency a string literal for the currency (ie. BTC)
func (*SouthXchange) GetMarketPrice ¶
func (s *SouthXchange) GetMarketPrice(listing string, reference string) (marketPrice MarketPrice, err error)
func (*SouthXchange) GetMarketSummaries ¶
func (b *SouthXchange) GetMarketSummaries() (marketSummaries []MarketSummary, err error)
GetMarketSummaries is used to get the last 24 hour summary of all active exchanges
func (*SouthXchange) GetOpenOrders ¶
func (b *SouthXchange) GetOpenOrders() (openOrders []Order, err error)
GetOpenOrders returns orders that you currently have opened.
func (*SouthXchange) GetOrder ¶
func (b *SouthXchange) GetOrder(orderCode string) (order Order, err error)
GetOrder returns an order based on the orderCode
func (*SouthXchange) GetTransactions ¶
func (b *SouthXchange) GetTransactions(transactionType string, start uint64, limit uint32, sort string, desc bool) (transactions []Transaction, err error)
GetTransactions is used to retrieve your transaction history
func (*SouthXchange) ListOrders ¶
func (o *SouthXchange) ListOrders() (orders []string, err error)
gets and array containing all orders
func (*SouthXchange) PlaceOrder ¶
func (o *SouthXchange) PlaceOrder(listing string, reference string, orderSide OrderType, amount float64, limitPrice float64, marketPrice bool) (orderCode string, err error)
listing string reference string orderSide string enum amount float the quantity of coins to sell limitPrice float optional price in reference currency. ff nil then order is executed at market price
func (*SouthXchange) SetDebug ¶
func (o *SouthXchange) SetDebug(enable bool)
set enable/disable http request/response dump
func (*SouthXchange) Withdraw ¶
func (o *SouthXchange) Withdraw(address string, currency string, quantity float64) (withdraw WithdrawalInfo, err error)
Withdraw is used to withdraw funds from your account. address string the address where to send the funds. currency string literal for the currency (ie. BTC) quantity float the quantity of coins to withdraw fee float the quantity of coins to withdraw