common

package
v0.0.0-...-c10cd6e Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToHex

func BytesToHex(data []byte) string

func HexToBytes

func HexToBytes(hex string) []byte

func HexToString

func HexToString(hex string) string

func IsHex

func IsHex(hex string) bool

func ToBytes

func ToBytes(data interface{}) ([]byte, error)

Types

type Address

type Address [addressLength]byte

Address ...

func NewAddress

func NewAddress(bytes []byte) (result Address)

func StringToAddress

func StringToAddress(s string) (addr Address)

func (*Address) String

func (addr *Address) String() string

type Block

type Block struct {
	Difficulty       *big.Int `json:"difficulty"`
	ExtraData        Data     `json:"extraData"`
	GasLimit         *big.Int `json:"gasLimit"`
	GasUsed          *big.Int `json:"gasUsed"`
	Hash             Hash     `json:"hash"`
	LogsBloom        Data     `json:"logsBloom"`
	Miner            Address  `json:"miner"`
	MixHash          Hash     `json:"mixHash"`
	Nonce            Data     `json:"nonce"`
	Number           *big.Int `json:"number"`
	ParentHash       Hash     `json:"parentHash"`
	ReceiptsRoot     Hash     `json:"receiptsRoot"`
	Sha3Uncles       Hash     `json:"sha3Uncles"`
	Size             *big.Int `json:"size"`
	StateRoot        Hash     `json:"stateRoot"`
	Timestamp        *big.Int `json:"timestamp"`
	TotalDifficulty  *big.Int `json:"totalDifficulty"`
	Transactions     []Hash   `json:"transactions"`
	TransactionsRoot Hash     `json:"transactionsRoot"`
	Uncles           []Hash   `json:"uncles"`
}

Block ...

type Data

type Data []byte

Data ...

func NewData

func NewData(bytes []byte) (data Data)

func StringToData

func StringToData(s string) (data Data)

func (*Data) String

func (data *Data) String() string

type Hash

type Hash [hashLength]byte

Hash ...

func NewHash

func NewHash(bytes []byte) (result Hash)

func StringToHash

func StringToHash(s string) (hash Hash)

func (*Hash) String

func (hash *Hash) String() string

type Log

type Log struct {
	TxData           Data     `json:"TxData"`
	Address          Address  `json:"address"`
	BlockHash        Hash     `json:"blockHash"`
	BlockNumber      *big.Int `json:"blockNumber"`
	LogIndex         *big.Int `json:"logIndex"`
	Removed          bool     `json:"removed"`
	Topics           []Data   `json:"topics"`
	TransactionHash  Hash     `json:"transactionHash"`
	TransactionIndex *big.Int `json:"transactionIndex"`
}

Log ...

type SyncStatus

type SyncStatus struct {
	Result        bool
	StartingBlock *big.Int
	CurrentBlock  *big.Int
	HighestBlock  *big.Int
}

SyncStatus ...

type Transaction

type Transaction struct {
	BlockHash        Hash     `json:"blockHash"`
	BlockNumber      *big.Int `json:"blockNumber"`
	From             Address  `json:"from"`
	Gas              *big.Int `json:"gas"`
	GasPrice         *big.Int `json:"gasprice"`
	Hash             Hash     `json:"hash"`
	Input            Data     `json:"input"`
	Nonce            *big.Int `json:"nonce"`
	R                Data     `json:"r"`
	S                Data     `json:"s"`
	ShardingFlag     Data     `json:"shardingFlag"`
	SysCnt           Data     `json:"syscnt"`
	To               Address  `json:"to"`
	TransactionIndex *big.Int `json:"transactionIndex"`
	V                Data     `json:"v"`
	Value            *big.Int `json:"value"`
}

Transaction ...

func (*Transaction) String

func (tx *Transaction) String() string

type TransactionReceipt

type TransactionReceipt struct {
	BlockHash         Hash     `json:"blockHash"`
	BlockNumber       *big.Int `json:"blockNumber"`
	ContractAddress   Address  `json:"contractAddress"`
	CumulativeGasUsed *big.Int `json:"cumulativeGasUsed"`
	From              Address  `json:"from"`
	GasUsed           *big.Int `json:"gasUsed"`
	Logs              []Log    `json:"logs"`
	LogsBloom         Data     `json:"logsBloom"`
	Root              Data     `json:"root"`
	To                Address  `json:"to"`
	TransactionHash   Hash     `json:"transactionHash"`
	TransactionIndex  *big.Int `json:"transactionIndex"`
}

TransactionReceipt ...

func (*TransactionReceipt) String

func (tx *TransactionReceipt) String() string

type TransactionRequest

type TransactionRequest struct {
	From     Address `json:"from"`
	To       Address `json:"to"`
	Gas      string  `json:"gas"`
	GasPrice string  `json:"gasprice"`
	Value    string  `json:"value"`
	Data     Data    `json:"data"`
}

TransactionRequest ...

func (*TransactionRequest) String

func (tx *TransactionRequest) String() string

func (*TransactionRequest) ToMap

func (tx *TransactionRequest) ToMap() *map[string]string

Jump to

Keyboard shortcuts

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