kraken

package
v0.0.0-...-e82c919 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const API_ROOT = "https://api.kraken.com"

Variables

This section is empty.

Functions

func GetNormalizePairName

func GetNormalizePairName(pair string) string

func NormalizeAssetName

func NormalizeAssetName(name string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey string, apiSecret string) *Client

func (*Client) BuildQueryString

func (c *Client) BuildQueryString(params map[string]interface{}) string

func (*Client) Get

func (c *Client) Get(endpoint string, params map[string]interface{}) (*http.Response, error)

func (*Client) HasAuth

func (c *Client) HasAuth() bool

HasAuth returns true if client has authentication information.

func (*Client) Post

func (c *Client) Post(endpoint string, params map[string]interface{}) (*http.Response, error)

func (*Client) Ticker

func (c *Client) Ticker(pairs ...string) (tickers map[string]Ticker, err error)

type GetLedgerOptions

type GetLedgerOptions struct {
	Count int
	Type  string
}

type LedgerEntry

type LedgerEntry struct {
	LedgerID    string
	ReferenceID string
	Timestamp   time.Time
	Type        string
	AssetClass  string
	Asset       string
	Amount      float64
	Fee         float64
	Balance     float64
}

func NewLedgerEntryFromRaw

func NewLedgerEntryFromRaw(id string, raw RawLedgerEntry) LedgerEntry

type LedgerService

type LedgerService struct {
	// contains filtered or unexported fields
}

func NewLedgerService

func NewLedgerService(client *Client) *LedgerService

func (*LedgerService) Ledger

func (s *LedgerService) Ledger(options GetLedgerOptions) ([]LedgerEntry, error)

func (*LedgerService) RawLedger

func (s *LedgerService) RawLedger(params map[string]interface{}) (*RawLedgerResponse, error)

type RawLedgerEntry

type RawLedgerEntry struct {
	RefID      string  `json:"refid"`
	Time       float64 `json:"time"`
	Type       string  `json:"type"`
	AssetClass string  `json:"aclass"`
	Asset      string  `json:"asset"`
	Amount     string  `json:"amount"`
	Fee        string  `json:"fee"`
	Balance    string  `json:"balance"`
}

type RawLedgerResponse

type RawLedgerResponse struct {
	Error  []string `json:"error"`
	Result struct {
		Count  int64                     `json:"count"`
		Ledger map[string]RawLedgerEntry `json:"ledger""`
	} `json:"result"`
	Raw string `json:"-"`
}

func (*RawLedgerResponse) SetRaw

func (r *RawLedgerResponse) SetRaw(raw string)

type RawSetter

type RawSetter interface {
	SetRaw(raw string)
}

type RawTickerPair

type RawTickerPair struct {
	A []string `json:"a"` // Ask array.
	B []string `json:"b"` // Bid array.
	C []string `json:"c"` // Last array.
	V []string `json:"v"`
	P []string `json:"p"`
	T []int64  `json:"t"`
	H []string `json:"h"`
	O string   `json:"o"`
}

type RawTickerResponse

type RawTickerResponse struct {
	Error  []string                 `json:"error"`
	Result map[string]RawTickerPair `json:"result"`
}

type Ticker

type Ticker struct {
	Pair      string
	Timestamp time.Time
	Ask       float64
	Bid       float64
	Last      float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL