types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountState

type AccountState struct {
	Root    Hash            `json:"root"`
	Storage map[Hash]string `json:"storage,omitempty"`
}

type Address

type Address string

func NewAddress

func NewAddress(hexString string) Address

NewAddressFromHex creates a new address from a given hex string It will left-pad to 20 bytes if the string is shorter than that, or truncate to 20 bytes if larger

func (*Address) Hex

func (addr *Address) Hex() string

func (*Address) IsEmpty

func (addr *Address) IsEmpty() bool

func (Address) MarshalJSON

func (addr Address) MarshalJSON() ([]byte, error)

func (*Address) String

func (addr *Address) String() string

func (*Address) UnmarshalJSON

func (addr *Address) UnmarshalJSON(input []byte) error

func (*Address) UnmarshalTOML

func (addr *Address) UnmarshalTOML(input []byte) error

type Block

type Block struct {
	Hash         Hash   `json:"hash"`
	ParentHash   Hash   `json:"parentHash"`
	StateRoot    Hash   `json:"stateRoot"`
	TxRoot       Hash   `json:"txRoot"`
	ReceiptRoot  Hash   `json:"receiptRoot"`
	Number       uint64 `json:"number"`
	GasLimit     uint64 `json:"gasLimit"`
	GasUsed      uint64 `json:"gasUsed"`
	Timestamp    uint64 `json:"timestamp"`
	ExtraData    string `json:"extraData"`
	Transactions []Hash `json:"transactions"`
}

type EIP165Call

type EIP165Call struct {
	To   Address `json:"to"`
	Data HexData `json:"data"`
}

Call args for checking a contract for EIP165 interfaces

type Event

type Event struct {
	Index            uint64  `json:"index"`
	Address          Address `json:"address"`
	Topics           []Hash  `json:"topics"`
	Data             HexData `json:"data"`
	BlockNumber      uint64  `json:"blockNumber"`
	BlockHash        Hash    `json:"blockHash"`
	TransactionHash  Hash    `json:"transactionHash"`
	TransactionIndex uint64  `json:"transactionIndex"`
	Timestamp        uint64  `json:"timestamp"`
}

type Hash

type Hash string

func NewHash

func NewHash(hexString string) Hash

NewHashFromHex creates a new hash from a given hex string It will left-pad to 32 bytes if the string is shorter than that, or truncate to 32 bytes if larger

func (*Hash) Hex

func (hsh *Hash) Hex() string

func (*Hash) IsEmpty

func (hsh *Hash) IsEmpty() bool

func (Hash) MarshalJSON

func (hsh Hash) MarshalJSON() ([]byte, error)

func (*Hash) String

func (hsh *Hash) String() string

func (*Hash) UnmarshalJSON

func (hsh *Hash) UnmarshalJSON(input []byte) error

func (*Hash) UnmarshalTOML

func (hsh *Hash) UnmarshalTOML(input []byte) error

type HexData

type HexData string

func NewHexData

func NewHexData(input string) HexData

func (*HexData) AsBytes

func (data *HexData) AsBytes() []byte

func (*HexData) IsEmpty

func (data *HexData) IsEmpty() bool

func (HexData) MarshalJSON

func (data HexData) MarshalJSON() ([]byte, error)

func (*HexData) String

func (data *HexData) String() string

func (*HexData) UnmarshalJSON

func (data *HexData) UnmarshalJSON(input []byte) error

type HexNumber

type HexNumber uint64

func (HexNumber) MarshalJSON

func (num HexNumber) MarshalJSON() ([]byte, error)

func (*HexNumber) ToUint64

func (num *HexNumber) ToUint64() uint64

func (*HexNumber) UnmarshalJSON

func (num *HexNumber) UnmarshalJSON(input []byte) error

type InternalCall

type InternalCall struct {
	From    Address `json:"from"`
	To      Address `json:"to"`
	Gas     uint64  `json:"gas"`
	GasUsed uint64  `json:"gasUsed"`
	Value   uint64  `json:"value"`
	Input   HexData `json:"input"`
	Output  HexData `json:"output"`
	Type    string  `json:"type"`
}

type RangeResult

type RangeResult struct {
	Start       uint64 `json:"start"`
	End         uint64 `json:"end"`
	ResultCount int    `json:"resultCount"`
}

type RawAccountState

type RawAccountState struct {
	Root    Hash              `json:"root"`
	Storage map[string]string `json:"storage,omitempty"`
}

type RawBlock

type RawBlock struct {
	Hash         Hash      `json:"hash"`
	ParentHash   Hash      `json:"parentHash"`
	StateRoot    Hash      `json:"stateRoot"`
	TxRoot       Hash      `json:"transactionsRoot"`
	ReceiptRoot  Hash      `json:"receiptsRoot"`
	Number       HexNumber `json:"number"`
	GasLimit     HexNumber `json:"gasLimit"`
	GasUsed      HexNumber `json:"gasUsed"`
	Timestamp    HexNumber `json:"timestamp"`
	ExtraData    string    `json:"extraData"`
	Transactions []Hash    `json:"transactions"`
}

received from eth_getBlockByNumber

type RawHeader

type RawHeader struct {
	Hash   Hash      `json:"hash"`
	Number HexNumber `json:"number"`
}

type RawInnerCall

type RawInnerCall struct {
	Type    string
	To      Address
	Input   HexData
	From    Address
	Value   HexNumber
	Gas     HexNumber
	GasUsed HexNumber
	Output  HexData
	Calls   []RawInnerCall
}

type RawOuterCall

type RawOuterCall struct {
	Calls []RawInnerCall
}

type Template

type Template struct {
	TemplateName  string `json:"templateName"`
	ABI           string `json:"abi"`
	StorageLayout string `json:"storageLayout"`
}

type Transaction

type Transaction struct {
	Hash              Hash            `json:"hash"`
	Status            bool            `json:"status"`
	BlockNumber       uint64          `json:"blockNumber"`
	BlockHash         Hash            `json:"blockHash"`
	Index             uint64          `json:"index"`
	Nonce             uint64          `json:"nonce"`
	From              Address         `json:"from"`
	To                Address         `json:"to"`
	Value             uint64          `json:"value"`
	Gas               uint64          `json:"gas"`
	GasPrice          uint64          `json:"gasPrice"`
	GasUsed           uint64          `json:"gasUsed"`
	CumulativeGasUsed uint64          `json:"cumulativeGasUsed"`
	CreatedContract   Address         `json:"createdContract"`
	Data              HexData         `json:"data"`
	PrivateData       HexData         `json:"privateData"`
	IsPrivate         bool            `json:"isPrivate"`
	Timestamp         uint64          `json:"timestamp"`
	Events            []*Event        `json:"events"`
	InternalCalls     []*InternalCall `json:"internalCalls"`
}

Jump to

Keyboard shortcuts

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