Documentation
¶
Index ¶
Constants ¶
View Source
const AssetCurrency = "currency"
The asset class for currencies TODO: Can't find documentation on other asset classes, do they exist?
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
// Alternative name for the asset
AltName string `json:"altname"`
// The asset class
Class string `json:"aclass"`
// Number of decimals used for record keeping
Decimals int `json:"decimals"`
// Number of decimals used for output display
DisplayDecimals int `json:"display_decimals"`
}
An Asset inside of Kraken's API
type AssetOptions ¶
type AssetOptions struct {
// The info for assets to retrieve from the server. Defaults to all info.
Info string
// The asset class to retrieve data for. Defaults to "currency".
AssetClass string
// Assets to retrieve data for. Defaults to all assets if none are specified.
Assets []string
}
AssetOptions represent the options that can be used when retrieving asset data
func (AssetOptions) QueryString ¶
func (a AssetOptions) QueryString() string
type AssetPair ¶
type AssetPair struct {
// Alternative pair name
AltName string `json:"altname"`
// WebSocket pair name (if available)
WebSocketName string `json:"wsname"`
// Asset class of the base component
ClassBase string `json:"aclass_base"`
// Asset id of the base component
Base string `json:"base"`
// Asset class of the quote component
ClassQuote string `json:"aclass_quote"`
// Asset id of the quote component
Quote string `json:"quote"`
// Volume lot size
Lot string `json:"lot"`
// Scaling decimal places for the pair
PairDecimals int `json:"pair_decimals"`
// Scaling decimal places for volume
LotDecimals int `json:"lot_decimals"`
// Amount to multiply the lot volume by to get the currency volume
LotMultiplier int `json:"lot_multiplier"`
// Array of possible leverage amounts when buying
LeverageBuy []int `json:"leverage_buy"`
// Array of possible leverage amounts when selling
LeverageSell []int `json:"leverage_sell"`
// Fee schedule in the form [[volume, percent fee], ...]
Fees [][]float32 `json:"fees"`
// Maker fee schedule in the form [[volume, percent fee], ...]
FeesMaker [][]float32 `json:"fees_maker"`
// Volume discount currency
FeeVolumeCurrency string `json:"fee_volume_currency"`
// Margin call level
MarginCall int `json:"margin_call"`
// Stop/liquidation margin level
MarginStop int `json:"margin_stop"`
// Minimum order volume for the pair
OrderMin string `json:"ordermin"`
}
A tradable asset pair
type AssetPairOptions ¶
func (AssetPairOptions) QueryString ¶
func (a AssetPairOptions) QueryString() string
type Error ¶
type Error []string
Error represents a list of error strings returned by the kraken api TODO: Parse and handle errors sent back from the Kraken API
type Kraken ¶
type Kraken struct {
// contains filtered or unexported fields
}
func (*Kraken) AssetPairs ¶
func (k *Kraken) AssetPairs(opts AssetPairOptions) (pairs AssetPairs, err error)
type Response ¶
type Response struct {
Errors []string `json:"error"`
Result interface{} `json:"result"`
}
A Response represents the json structure that the Kraken API outputs. All API outputs are wrapped.
type ServerTime ¶
type ServerTime struct {
UnixTime int64 `json:"unixtime"`
}
Kraken: /0/public/Time result
Click to show internal directories.
Click to hide internal directories.