Documentation
¶
Index ¶
- type ApplicationLog
- type Block
- type BlockMetadata
- type GetPeers
- type Header
- type Invoke
- type NEP5Balance
- type NEP5Balances
- type NEP5Transfer
- type NEP5Transfers
- type NotificationEvent
- type Peer
- type Peers
- type TransactionMetadata
- type TransactionOutputRaw
- type ValidateAddress
- type Validator
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationLog ¶
type ApplicationLog struct { TxHash util.Uint256 `json:"txid"` Trigger string `json:"trigger"` VMState string `json:"vmstate"` GasConsumed int64 `json:"gas_consumed,string"` Stack []smartcontract.Parameter `json:"stack"` Events []NotificationEvent `json:"notifications"` }
ApplicationLog wrapper used for the representation of the state.AppExecResult based on the specific tx on the RPC Server.
func NewApplicationLog ¶
func NewApplicationLog(appExecRes *state.AppExecResult) ApplicationLog
NewApplicationLog creates a new ApplicationLog wrapper.
type Block ¶
type Block struct { block.Block BlockMetadata }
Block wrapper used for the representation of block.Block / block.Base on the RPC Server.
func NewBlock ¶
func NewBlock(b *block.Block, chain blockchainer.Blockchainer) Block
NewBlock creates a new Block wrapper.
func (Block) MarshalJSON ¶ added in v0.75.0
MarshalJSON implements json.Marshaler interface.
func (*Block) UnmarshalJSON ¶ added in v0.75.0
UnmarshalJSON implements json.Unmarshaler interface.
type BlockMetadata ¶ added in v0.90.0
type BlockMetadata struct { Size int `json:"size"` NextBlockHash *util.Uint256 `json:"nextblockhash,omitempty"` Confirmations uint32 `json:"confirmations"` }
BlockMetadata is an additional metadata added to standard block.Block.
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 { Hash util.Uint256 `json:"hash"` Size int `json:"size"` Version uint32 `json:"version"` PrevBlockHash util.Uint256 `json:"previousblockhash"` MerkleRoot util.Uint256 `json:"merkleroot"` Timestamp uint64 `json:"time"` Index uint32 `json:"index"` NextConsensus string `json:"nextconsensus"` Witnesses []transaction.Witness `json:"witnesses"` Confirmations uint32 `json:"confirmations"` NextBlockHash *util.Uint256 `json:"nextblockhash,omitempty"` }
Header wrapper used for the representation of block header on the RPC Server.
func NewHeader ¶
func NewHeader(h *block.Header, chain blockchainer.Blockchainer) Header
NewHeader creates a new Header wrapper.
type Invoke ¶
type Invoke struct { State string `json:"state"` GasConsumed int64 `json:"gas_consumed,string"` Script string `json:"script"` Stack []smartcontract.Parameter `json:"stack"` }
Invoke represents code invocation result and is used by several RPC calls that invoke functions, scripts and generic bytecode.
type NEP5Balance ¶
type NEP5Balance struct { Asset util.Uint160 `json:"asset_hash"` Amount string `json:"amount"` LastUpdated uint32 `json:"last_updated_block"` }
NEP5Balance represents balance for the single token contract.
func (*NEP5Balance) MarshalJSON ¶
func (b *NEP5Balance) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*NEP5Balance) UnmarshalJSON ¶
func (b *NEP5Balance) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler interface.
type NEP5Balances ¶
type NEP5Balances struct { Balances []NEP5Balance `json:"balance"` Address string `json:"address"` }
NEP5Balances is a result for the getnep5balances RPC call.
type NEP5Transfer ¶
type NEP5Transfer struct { Timestamp uint64 `json:"timestamp"` Asset util.Uint160 `json:"asset_hash"` Address string `json:"transfer_address,omitempty"` Amount string `json:"amount"` Index uint32 `json:"block_index"` NotifyIndex uint32 `json:"transfer_notify_index"` TxHash util.Uint256 `json:"tx_hash"` }
NEP5Transfer represents single NEP5 transfer event.
type NEP5Transfers ¶
type NEP5Transfers struct { Sent []NEP5Transfer `json:"sent"` Received []NEP5Transfer `json:"received"` Address string `json:"address"` }
NEP5Transfers is a result for the getnep5transfers RPC.
type NotificationEvent ¶
type NotificationEvent struct { Contract util.Uint160 `json:"contract"` Item smartcontract.Parameter `json:"state"` }
NotificationEvent response wrapper
func StateEventToResultNotification ¶ added in v0.75.0
func StateEventToResultNotification(event state.NotificationEvent) NotificationEvent
StateEventToResultNotification converts state.NotificationEvent to result.NotificationEvent.
type TransactionMetadata ¶ added in v0.75.0
type TransactionMetadata struct { Blockhash util.Uint256 `json:"blockhash,omitempty"` Confirmations int `json:"confirmations,omitempty"` Timestamp uint64 `json:"blocktime,omitempty"` }
TransactionMetadata is an auxilliary struct for proper TransactionOutputRaw marshaling.
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, chain blockchainer.Blockchainer) TransactionOutputRaw
NewTransactionOutputRaw returns a new ransactionOutputRaw object.
func (TransactionOutputRaw) MarshalJSON ¶ added in v0.75.0
func (t TransactionOutputRaw) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*TransactionOutputRaw) UnmarshalJSON ¶ added in v0.75.0
func (t *TransactionOutputRaw) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Marshaler 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.