result

package
v0.91.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

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

MarshalJSON implements json.Marshaler interface.

func (*Block) UnmarshalJSON added in v0.75.0

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

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 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 {
	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

func (r Invoke) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Invoke) UnmarshalJSON added in v0.91.0

func (r *Invoke) UnmarshalJSON(data []byte) error

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 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 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

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

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

type UnclaimedGas struct {
	Address   util.Uint160
	Unclaimed big.Int
}

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.

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 Version

type Version struct {
	TCPPort   uint16 `json:"tcpport"`
	WSPort    uint16 `json:"wsport,omitempty"`
	Nonce     uint32 `json:"nonce"`
	UserAgent string `json:"useragent"`
}

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