Version: v0.0.0-...-bbfc9be Latest Latest

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 3 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type API

type API struct {
	// contains filtered or unexported fields

func NewAPI

func NewAPI(id caller.APIID, caller caller.Caller) *API

func (*API) GetAccountHistory

func (api *API) GetAccountHistory(account, stop types.ObjectID, limit int, start types.ObjectID) ([]*OperationHistory, error)

GetAccountHistory gets operations relevant to the specified account account: The account whose history should be queried stop: ID of the earliest operation to retrieve limit: Maximum number of operations to retrieve (must not exceed 100) start: ID of the most recent operation to retrieve

func (*API) GetFillOrderHistory

func (api *API) GetFillOrderHistory(base, quote types.ObjectID, limit uint32) ([]*OrderHistory, error)

GetFillOrderHistory returns filled orders

func (*API) GetMarketHistory

func (api *API) GetMarketHistory(base, quote types.ObjectID, bucketSeconds uint32, start, end types.Time) ([]*Bucket, error)

GetMarketHistory returns market history base/quote (candlesticks) for the given period

func (*API) GetMarketHistoryBuckets

func (api *API) GetMarketHistoryBuckets() ([]uint32, error)

GetMarketHistoryBuckets returns a list of buckets that can be passed to `GetMarketHistory` as the `bucketSeconds` argument

type Bucket

type Bucket struct {
	ID          string        `json:"id"`
	Key         BucketKey     `json:"key"`
	HighBase    types.Suint32 `json:"high_base"`
	HighQuote   types.Suint32 `json:"high_quote"`
	LowBase     types.Suint32 `json:"low_base"`
	LowQuote    types.Suint32 `json:"low_quote"`
	OpenBase    types.Suint32 `json:"open_base"`
	OpenQuote   types.Suint32 `json:"open_quote"`
	CloseBase   types.Suint32 `json:"close_base"`
	CloseQuote  types.Suint32 `json:"close_quote"`
	BaseVolume  types.Suint32 `json:"base_volume"`
	QuoteVolume types.Suint32 `json:"quote_volume"`

type BucketKey

type BucketKey struct {
	Base    string        `json:"base"`
	Quote   string        `json:"quote"`
	Seconds types.Suint32 `json:"seconds"`
	Open    types.Time    `json:"open"`

type OperationHistory

type OperationHistory struct {
	ID                       string            `json:"id"`
	BlockNumber              uint32            `json:"block_num"`
	TransactionsInBlock      uint32            `json:"trx_in_block"`
	OperationsInTransactions uint32            `json:"op_in_trx"`
	VirtualOperations        uint32            `json:"virtual_op"`
	Result                   []json.RawMessage `json:"result"`
	Operations               []json.RawMessage `json:"op"`

type OrderHistory

type OrderHistory struct {
	ID        string         `json:"id"`
	Key       OrderKey       `json:"key"`
	Time      types.Time     `json:"time"`
	Operation OrderOperation `json:"op"`

type OrderKey

type OrderKey struct {
	Base     types.ObjectID `json:"base"`
	Quote    types.ObjectID `json:"quote"`
	Sequence int32          `json:"sequence"`

type OrderOperation

type OrderOperation struct {
	Fee       types.AssetAmount `json:"fee"`
	Pays      types.AssetAmount `json:"pays"`
	Receives  types.AssetAmount `json:"receives"`
	FillPrice types.Price       `json:"fill_price"`
	OrderID   types.ObjectID    `json:"order_id"`
	AccountID types.ObjectID    `json:"account_id"`
	IsMaker   bool              `json:"is_maker"`

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL