trustray

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTxs

func AppendTxs(in []types.Tx, srcTx *Doc, coinIndex uint) (out []types.Tx)

func NormalizeToken

func NormalizeToken(srcToken *Contract, coinIndex uint) types.Token

NormalizeToken converts a Ethereum token into the generic model

func NormalizeTokens

func NormalizeTokens(srcTokens []Contract, coinIndex uint) []types.Token

NormalizeTxs converts multiple Ethereum tokens

Types

type Client

type Client struct {
	client.Request
}

func (*Client) GetBlock

func (c *Client) GetBlock(num int64) (page []Doc, err error)

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(num int64, coinIndex uint) (*types.Block, error)

func (*Client) GetCurrentBlockNumber

func (c *Client) GetCurrentBlockNumber() (int64, error)

func (*Client) GetTokenList

func (c *Client) GetTokenList(address string, coinIndex uint) (types.TokenPage, error)

func (*Client) GetTokenTxs

func (c *Client) GetTokenTxs(address, token string, coinIndex uint) (types.TxPage, error)

func (*Client) GetTokens

func (c *Client) GetTokens(address string) (tp *TokenPage, err error)

func (*Client) GetTransactions

func (c *Client) GetTransactions(address string, coinIndex uint) (types.TxPage, error)

func (*Client) GetTxs

func (c *Client) GetTxs(address string) (*Page, error)

func (*Client) GetTxsWithContract

func (c *Client) GetTxsWithContract(address, contract string) (*Page, error)

type Contract

type Contract struct {
	Address     string `json:"address"`
	Symbol      string `json:"symbol"`
	Decimals    uint   `json:"decimals"`
	TotalSupply string `json:"totalSupply,omitempty"`
	Name        string `json:"name"`
}

type Doc

type Doc struct {
	Ops         []Op   `json:"operations"`
	Contract    string `json:"contract"`
	ID          string `json:"id"`
	BlockNumber uint64 `json:"blockNumber"`
	Timestamp   int64  `json:"time"`
	Nonce       uint64 `json:"nonce"`
	From        string `json:"from"`
	To          string `json:"to"`
	Value       string `json:"value"`
	Gas         string `json:"gas"`
	GasPrice    string `json:"gasPrice"`
	GasUsed     string `json:"gasUsed"`
	Input       string `json:"input"`
	Error       string `json:"error"`
	Coin        uint   `json:"coin"`
}

type NodeInfo

type NodeInfo struct {
	LatestBlock int64 `json:"latest_block"`
}

type Op

type Op struct {
	TxID     string                `json:"transactionId"`
	Contract *Contract             `json:"contract"`
	From     string                `json:"from"`
	To       string                `json:"to"`
	Type     types.TransactionType `json:"type"`
	Value    string                `json:"value"`
	Coin     uint                  `json:"coin"`
}

type Page

type Page struct {
	Total uint  `json:"total"`
	Docs  []Doc `json:"docs"`
}

type TokenPage

type TokenPage struct {
	Total uint       `json:"total"`
	Docs  []Contract `json:"docs"`
}

Jump to

Keyboard shortcuts

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