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 RawMempool
- type RelayResult
- type TransactionMetadata
- type TransactionOutputRaw
- type UnclaimedGas
- 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 Trigger string VMState string GasConsumed int64 Stack []stackitem.Item Events []NotificationEvent }
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.
func (ApplicationLog) MarshalJSON ¶ added in v0.91.0
func (l ApplicationLog) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ApplicationLog) UnmarshalJSON ¶ added in v0.91.0
func (l *ApplicationLog) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
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:"gasconsumed,string"` Script string `json:"script"` Stack []stackitem.Item `json:"stack"` }
Invoke represents code invocation result and is used by several RPC calls that invoke functions, scripts and generic bytecode.
func (Invoke) MarshalJSON ¶ added in v0.91.0
MarshalJSON implements json.Marshaler.
func (*Invoke) UnmarshalJSON ¶ added in v0.91.0
UnmarshalJSON implements json.Unmarshaler.
type NEP5Balance ¶
type NEP5Balance struct { Asset util.Uint160 `json:"assethash"` Amount string `json:"amount"` LastUpdated uint32 `json:"lastupdatedblock"` }
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:"assethash"` Address string `json:"transferaddress,omitempty"` Amount string `json:"amount"` Index uint32 `json:"blockindex"` NotifyIndex uint32 `json:"transfernotifyindex"` TxHash util.Uint256 `json:"txhash"` }
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"` Name string `json:"eventname"` 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 RawMempool ¶ added in v0.91.0
type RawMempool struct { Height uint32 `json:"height"` Verified []util.Uint256 `json:"verified"` Unverified []util.Uint256 `json:"unverified"` }
RawMempool represents a result of getrawmempool RPC call.
type RelayResult ¶ added in v0.91.0
RelayResult ia a result of `sendrawtransaction` or `submitblock` RPC calls.
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"` VMState string `json:"vmstate"` }
TransactionMetadata is an auxiliary 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, appExecResult *state.AppExecResult, 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 UnclaimedGas ¶ added in v0.91.0
UnclaimedGas response wrapper
func (UnclaimedGas) MarshalJSON ¶ added in v0.91.0
func (g UnclaimedGas) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface.
func (*UnclaimedGas) UnmarshalJSON ¶ added in v0.91.0
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.