result

package
v0.0.0-...-f94ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownERC721Properties = map[string]bool{
	"description": true,
	"image":       true,
	"name":        true,
	"tokenURI":    true,
}

KnownERC721Properties contains a list of well-known NEP-11 token property names.

Functions

This section is empty.

Types

type ApplicationLog

type ApplicationLog struct {
	Container common.Hash
	Logs      []types.Log
}

ApplicationLog represent the results of the script executions for block or transaction.

func NewApplicationLog

func NewApplicationLog(hash common.Hash, aer *types.Receipt) ApplicationLog

NewApplicationLog creates ApplicationLog from a set of several application execution results including only the results with the specified trigger.

type Block

type Block struct {
	block.Header
	BlockMetadata
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(chain LedgerAux, b *block.Block, receipt *types.Receipt, sr *state.MPTRoot, miner common.Address, full bool, cfg config.ProtocolConfiguration) *Block

NewBlock creates a new Block wrapper.

func (Block) MarshalJSON

func (b Block) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Block) UnmarshalJSON

func (b *Block) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type BlockMetadata

type BlockMetadata struct {
	Miner           common.Address `json:"miner"`
	Size            hexutil.Uint   `json:"size"`
	Sha3Uncles      common.Hash    `json:"sha3Uncles"`
	LogsBloom       types.Bloom    `json:"logsBloom"`
	StateRoot       common.Hash    `json:"stateRoot"`
	ReceiptsRoot    common.Hash    `json:"receiptsRoot"`
	Difficulty      hexutil.Uint   `json:"difficulty"`
	TotalDifficulty hexutil.Uint   `json:"totalDifficulty"`
	ExtraData       hexutil.Bytes  `json:"extraData"`
	GasLimit        hexutil.Uint64 `json:"gasLimit"`
	GasUsed         hexutil.Uint64 `json:"gasUsed"`
	Uncles          []common.Hash  `json:"uncles"`
	BaseFeePerGas   *hexutil.Big   `json:"baseFeePerGas,omitempty"`
}

BlockMetadata is an additional metadata added to standard block.Block.

type ERC20Balance

type ERC20Balance struct {
	Asset       common.Address `json:"assethash"`
	Amount      string         `json:"amount"`
	LastUpdated uint32         `json:"lastupdatedblock"`
}

ERC20Balance represents balance for the single token contract.

type ERC20Balances

type ERC20Balances struct {
	Balances []ERC20Balance `json:"balance"`
	Address  string         `json:"address"`
}

ERC20Balances is a result for the getERC20balances RPC call.

type ERC20Transfer

type ERC20Transfer struct {
	Timestamp   uint64         `json:"timestamp"`
	Asset       common.Address `json:"assethash"`
	Address     string         `json:"transferaddress,omitempty"`
	Amount      string         `json:"amount"`
	Index       uint32         `json:"blockindex"`
	NotifyIndex uint32         `json:"transfernotifyindex"`
	TxHash      common.Hash    `json:"txhash"`
}

ERC20Transfer represents single ERC20 transfer event.

type ERC20Transfers

type ERC20Transfers struct {
	Sent     []ERC20Transfer `json:"sent"`
	Received []ERC20Transfer `json:"received"`
	Address  string          `json:"address"`
}

ERC20Transfers is a result for the getERC20transfers RPC.

type ERC721AssetBalance

type ERC721AssetBalance struct {
	Asset  common.Address       `json:"assethash"`
	Tokens []ERC721TokenBalance `json:"tokens"`
}

ERC721Balance is a structure holding balance of a NEP-11 asset.

type ERC721Balances

type ERC721Balances struct {
	Balances []ERC721AssetBalance `json:"balance"`
	Address  string               `json:"address"`
}

ERC721Balances is a result for the getERC721balances RPC call.

type ERC721TokenBalance

type ERC721TokenBalance struct {
	ID          string `json:"tokenid"`
	Amount      string `json:"amount"`
	LastUpdated uint32 `json:"lastupdatedblock"`
}

ERC721TokenBalance represents balance of a single NFT.

type ERC721Transfer

type ERC721Transfer struct {
	Timestamp   uint64         `json:"timestamp"`
	Asset       common.Address `json:"assethash"`
	Address     string         `json:"transferaddress,omitempty"`
	ID          string         `json:"tokenid"`
	Amount      string         `json:"amount"`
	Index       uint32         `json:"blockindex"`
	NotifyIndex uint32         `json:"transfernotifyindex"`
	TxHash      common.Hash    `json:"txhash"`
}

ERC721Transfer represents single NEP-11 transfer event.

type ERC721Transfers

type ERC721Transfers struct {
	Sent     []ERC721Transfer `json:"sent"`
	Received []ERC721Transfer `json:"received"`
	Address  string           `json:"address"`
}

ERC721Transfers is a result for the getERC721transfers RPC.

type FeeHistory

type FeeHistory struct {
	OldestBlock   hexutil.Big   `json:"oldestBlock"`
	BaseFeePerGas []hexutil.Big `json:"baseFeePerGas"`
	GasUsedRatio  []float32     `json:"gasUsedRatio"`
	Reward        []hexutil.Big `json:"reward"`
}

func NewFeeHistory

func NewFeeHistory(receipts types.Receipts, gasPrice *big.Int) (*FeeHistory, error)

type FindStates

type FindStates struct {
	Results    []KeyValue    `json:"results"`
	FirstProof *ProofWithKey `json:"firstProof,omitempty"`
	LastProof  *ProofWithKey `json:"lastProof,omitempty"`
	Truncated  bool          `json:"truncated"`
}

type GetPeers

type GetPeers struct {
	Unconnected Peers `json:"unconnected"`
	Connected   Peers `json:"connected"`
	Bad         Peers `json:"bad"`
}

GetPeers payload for outputting peers in `getpeers` RPC call.

func NewGetPeers

func NewGetPeers() GetPeers

NewGetPeers creates a new GetPeers structure.

func (*GetPeers) AddBad

func (g *GetPeers) AddBad(addrs []string)

AddBad adds a set of peers to the bad peers slice.

func (*GetPeers) AddConnected

func (g *GetPeers) AddConnected(addrs []string)

AddConnected adds a set of peers to the connected peers slice.

func (*GetPeers) AddUnconnected

func (g *GetPeers) AddUnconnected(addrs []string)

AddUnconnected adds a set of peers to the unconnected peers slice.

type Header struct {
	block.Header
	BlockMetadata
}

Header wrapper used for the representation of block header on the RPC Server.

func NewHeader

func NewHeader(h *block.Header, chain LedgerAux) Header

NewHeader creates a new Header wrapper.

func (Header) MarshalJSON

func (h Header) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Header) UnmarshalJSON

func (h *Header) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type KeyValue

type KeyValue struct {
	Key   []byte `json:"key"`
	Value []byte `json:"value"`
}

type LedgerAux

type LedgerAux interface {
	BlockHeight() uint32
	GetHeaderHash(int) common.Hash
	GetGasPrice() *big.Int
}

type NetworkFee

type NetworkFee struct {
	Value uint64 `json:"networkfee,string"`
}

NetworkFee represents a result of calculatenetworkfee RPC call.

type Peer

type Peer struct {
	Address string `json:"address"`
	Port    string `json:"port"`
}

Peer represents the peer.

type Peers

type Peers []Peer

Peers represent a slice of peers.

type ProofWithKey

type ProofWithKey struct {
	Key   []byte
	Proof [][]byte
}

ProofWithKey represens key-proof pair.

func (*ProofWithKey) DecodeBinary

func (p *ProofWithKey) DecodeBinary(r *io.BinReader)

DecodeBinary implements io.Serializable.

func (*ProofWithKey) EncodeBinary

func (p *ProofWithKey) EncodeBinary(w *io.BinWriter)

EncodeBinary implements io.Serializable.

func (*ProofWithKey) FromString

func (p *ProofWithKey) FromString(s string) error

FromString decodes p from hex-encoded string.

func (*ProofWithKey) MarshalJSON

func (p *ProofWithKey) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*ProofWithKey) String

func (p *ProofWithKey) String() string

String implements fmt.Stringer.

func (*ProofWithKey) UnmarshalJSON

func (p *ProofWithKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Protocol

type Protocol struct {
	AddressVersion            byte   `json:"addressversion"`
	ChainID                   uint64 `json:"network"`
	MillisecondsPerBlock      int    `json:"msperblock"`
	MaxTraceableBlocks        uint32 `json:"maxtraceableblocks"`
	MaxTransactionsPerBlock   uint16 `json:"maxtransactionsperblock"`
	MemoryPoolMaxTransactions int    `json:"memorypoolmaxtransactions"`
	ValidatorsCount           byte   `json:"validatorscount"`
	InitialGasDistribution    uint64 `json:"initialgasdistribution"`
}

Protocol represents network-dependent parameters.

type RReceipt

type RReceipt struct {
	types.Receipt
	// contains filtered or unexported fields
}

func NewRReceipt

func NewRReceipt(receipt *types.Receipt, tx *transaction.Transaction) RReceipt

func (RReceipt) MarshalJSON

func (rr RReceipt) MarshalJSON() ([]byte, error)

type RawMempool

type RawMempool struct {
	Height     uint32        `json:"height"`
	Verified   []common.Hash `json:"verified"`
	Unverified []common.Hash `json:"unverified"`
}

RawMempool represents a result of getrawmempool RPC call.

type RelayResult

type RelayResult struct {
	Hash common.Hash `json:"hash"`
}

RelayResult ia a result of `sendrawtransaction` or `submitblock` RPC calls.

type StateHeight

type StateHeight struct {
	Local     uint32 `json:"localrootindex"`
	Validated uint32 `json:"validatedrootindex"`
}

StateHeight is a result of getstateheight RPC.

type Syncing

type Syncing struct {
	StartingBlock string `json:"startingBlock"`
	CurrentBlock  string `json:"currentBlock"`
	HighestBlock  string `json:"highestBlock"`
}

type TraceResult

type TraceResult struct {
	Ret   hexutil.Bytes   `json:"output"`
	Err   string          `json:"error,omitempty"`
	Trace *response.Trace `json:"trace"`
}

type TransactionMetadata

type TransactionMetadata struct {
	Blockhash        common.Hash  `json:"blockHash"`
	BlockNumber      hexutil.Uint `json:"blockNumber"`
	TransactionIndex hexutil.Uint `json:"transactionIndex"`
}

TransactionMetadata is an auxiliary struct for proper TransactionOutputRaw marshaling.

type TransactionObject

type TransactionObject struct {
	Data     []byte               `json:"data"`     //optional
	From     common.Address       `json:"from"`     //optional
	Gas      uint64               `json:"gas"`      //optional
	GasPrice *big.Int             `json:"gasPrice"` //optional
	To       *common.Address      `json:"to"`
	Value    *big.Int             `json:"value"`   //optional
	Witness  *transaction.Witness `json:"witness"` //optional
	Nonce    uint64               `json:"nonce"`   //optional
}

func (TransactionObject) MarshalJSON

func (t TransactionObject) MarshalJSON() ([]byte, error)

func (*TransactionObject) UnmarshalJSON

func (t *TransactionObject) UnmarshalJSON(text []byte) error

type TransactionOutputRaw

type TransactionOutputRaw struct {
	transaction.Transaction
	TransactionMetadata
}

TransactionOutputRaw is used as a wrapper to represents a Transaction.

func NewTransactionOutputRaw

func NewTransactionOutputRaw(tx *transaction.Transaction, header *block.Header, receipt *types.Receipt) TransactionOutputRaw

NewTransactionOutputRaw returns a new ransactionOutputRaw object.

func (TransactionOutputRaw) MarshalJSON

func (t TransactionOutputRaw) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*TransactionOutputRaw) UnmarshalJSON

func (t *TransactionOutputRaw) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Marshaler interface.

type TxPool

type TxPool struct {
	Pending map[string]map[uint64]poolTx `json:"pending"`
	Queued  map[string]map[uint64]poolTx `json:"queued"`
}

func NewTxPool

func NewTxPool(txes []*transaction.Transaction) TxPool

type UnclaimedGas

type UnclaimedGas struct {
	Address   common.Address
	Unclaimed big.Int
}

UnclaimedGas response wrapper.

func (UnclaimedGas) MarshalJSON

func (g UnclaimedGas) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*UnclaimedGas) UnmarshalJSON

func (g *UnclaimedGas) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type ValidateAddress

type ValidateAddress struct {
	Address interface{} `json:"address"`
	IsValid bool        `json:"isvalid"`
}

ValidateAddress represents result of the `validateaddress` call. Notice that Address is an interface{} here because server echoes back whatever address value user has sent to it, even if it's not a string.

type Validator

type Validator struct {
	PublicKey keys.PublicKey `json:"publickey"`
	Votes     int64          `json:"votes,string"`
	Active    bool           `json:"active"`
}

Validator used for the representation of state.Validator on the RPC Server.

type VerifyProof

type VerifyProof struct {
	Value []byte
}

VerifyProof is a result of verifyproof RPC. nil Value is considered invalid.

func (*VerifyProof) MarshalJSON

func (p *VerifyProof) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*VerifyProof) UnmarshalJSON

func (p *VerifyProof) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Version

type Version struct {
	// Magic contains network magic.
	// Deprecated: use Protocol.StateRootInHeader instead
	ChainID   uint64   `json:"network"`
	TCPPort   uint16   `json:"tcpport"`
	WSPort    uint16   `json:"wsport,omitempty"`
	Nonce     uint32   `json:"nonce"`
	UserAgent string   `json:"useragent"`
	Protocol  Protocol `json:"protocol"`
}

Version model used for reporting server version info.

Jump to

Keyboard shortcuts

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