Documentation ¶
Index ¶
- Variables
- type ApplicationLog
- type Block
- type BlockMetadata
- type ERC20Balance
- type ERC20Balances
- type ERC20Transfer
- type ERC20Transfers
- type ERC721AssetBalance
- type ERC721Balances
- type ERC721TokenBalance
- type ERC721Transfer
- type ERC721Transfers
- type FeeHistory
- type FindStates
- type GetPeers
- type Header
- type KeyValue
- type LedgerAux
- type NetworkFee
- type Peer
- type Peers
- type ProofWithKey
- func (p *ProofWithKey) DecodeBinary(r *io.BinReader)
- func (p *ProofWithKey) EncodeBinary(w *io.BinWriter)
- func (p *ProofWithKey) FromString(s string) error
- func (p *ProofWithKey) MarshalJSON() ([]byte, error)
- func (p *ProofWithKey) String() string
- func (p *ProofWithKey) UnmarshalJSON(data []byte) error
- type Protocol
- type RReceipt
- type RawMempool
- type RelayResult
- type StateHeight
- type Syncing
- type TraceResult
- type TransactionMetadata
- type TransactionObject
- type TransactionOutputRaw
- type TxPool
- type UnclaimedGas
- type ValidateAddress
- type Validator
- type VerifyProof
- type Version
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
MarshalJSON implements json.Marshaler interface.
func (*Block) UnmarshalJSON ¶
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 ¶
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 (*GetPeers) AddConnected ¶
AddConnected adds a set of peers to the connected peers slice.
func (*GetPeers) AddUnconnected ¶
AddUnconnected adds a set of peers to the unconnected peers slice.
type Header ¶
type Header struct { block.Header BlockMetadata }
Header wrapper used for the representation of block header on the RPC Server.
func (Header) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Header) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface.
type NetworkFee ¶
type NetworkFee struct {
Value uint64 `json:"networkfee,string"`
}
NetworkFee represents a result of calculatenetworkfee RPC call.
type ProofWithKey ¶
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 ¶
func NewRReceipt ¶
func NewRReceipt(receipt *types.Receipt, tx *transaction.Transaction) RReceipt
func (RReceipt) MarshalJSON ¶
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 ¶
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 TraceResult ¶
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 ¶
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.