result

package
v0.98.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

Functions

This section is empty.

Types

type ApplicationLog

type ApplicationLog struct {
	Container     util.Uint256
	IsTransaction bool
	Executions    []state.Execution
}

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

func NewApplicationLog

func NewApplicationLog(hash util.Uint256, aers []state.AppExecResult, trig trigger.Type) ApplicationLog

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

func (ApplicationLog) MarshalJSON added in v0.91.0

func (l ApplicationLog) MarshalJSON() ([]byte, error)

MarshalJSON implements implements json.Marshaler interface.

func (*ApplicationLog) UnmarshalJSON added in v0.91.0

func (l *ApplicationLog) UnmarshalJSON(data []byte) error

UnmarshalJSON implements implements json.Unmarshaler interface.

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 LedgerAux) 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 FindStates added in v0.97.3

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 added in v0.97.3

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

MarshalJSON implements json.Marshaler interface.

func (*Header) UnmarshalJSON added in v0.97.3

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

UnmarshalJSON implements json.Unmarshaler interface.

type Invoke

type Invoke struct {
	State          string
	GasConsumed    int64
	Script         []byte
	Stack          []stackitem.Item
	FaultException string
	Notifications  []state.NotificationEvent
	Transaction    *transaction.Transaction
	Diagnostics    *InvokeDiag
	// contains filtered or unexported fields
}

Invoke represents code invocation result and is used by several RPC calls that invoke functions, scripts and generic bytecode.

func NewInvoke added in v0.95.0

func NewInvoke(ic *interop.Context, script []byte, faultException string, maxIteratorResultItems int) *Invoke

NewInvoke returns new Invoke structure with the given fields set.

func (*Invoke) Finalize added in v0.98.0

func (r *Invoke) Finalize()

Finalize releases resources occupied by Iterators created at the script invocation. This method will be called automatically on Invoke marshalling.

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 InvokeDiag added in v0.98.0

type InvokeDiag struct {
	Changes     []storage.Operation  `json:"storagechanges"`
	Invocations []*vm.InvocationTree `json:"invokedcontracts"`
}

InvokeDiag is an additional diagnostic data for invocation.

type Iterator added in v0.95.0

type Iterator struct {
	Values    []stackitem.Item
	Truncated bool
}

Iterator represents deserialized VM iterator values with truncated flag.

type KeyValue added in v0.97.3

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

type LedgerAux added in v0.98.1

type LedgerAux interface {
	BlockHeight() uint32
	GetHeaderHash(int) util.Uint256
}

LedgerAux is a set of methods needed to construct some outputs.

type NEP11AssetBalance added in v0.98.0

type NEP11AssetBalance struct {
	Asset  util.Uint160        `json:"assethash"`
	Tokens []NEP11TokenBalance `json:"tokens"`
}

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

type NEP11Balances added in v0.98.0

type NEP11Balances struct {
	Balances []NEP11AssetBalance `json:"balance"`
	Address  string              `json:"address"`
}

NEP11Balances is a result for the getnep11balances RPC call.

type NEP11TokenBalance added in v0.98.0

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

NEP11TokenBalance represents balance of a single NFT.

type NEP11Transfer added in v0.98.0

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

NEP11Transfer represents single NEP-11 transfer event.

type NEP11Transfers added in v0.98.0

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

NEP11Transfers is a result for the getnep11transfers RPC.

type NEP17Balance added in v0.92.0

type NEP17Balance struct {
	Asset       util.Uint160 `json:"assethash"`
	Amount      string       `json:"amount"`
	LastUpdated uint32       `json:"lastupdatedblock"`
}

NEP17Balance represents balance for the single token contract.

type NEP17Balances added in v0.92.0

type NEP17Balances struct {
	Balances []NEP17Balance `json:"balance"`
	Address  string         `json:"address"`
}

NEP17Balances is a result for the getnep17balances RPC call.

type NEP17Transfer added in v0.92.0

type NEP17Transfer 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"`
}

NEP17Transfer represents single NEP17 transfer event.

type NEP17Transfers added in v0.92.0

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

NEP17Transfers is a result for the getnep17transfers RPC.

type NetworkFee added in v0.95.2

type NetworkFee struct {
	Value int64 `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 added in v0.76.0

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

ProofWithKey represens key-proof pair.

func (*ProofWithKey) DecodeBinary added in v0.76.0

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

DecodeBinary implements io.Serializable.

func (*ProofWithKey) EncodeBinary added in v0.76.0

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

EncodeBinary implements io.Serializable.

func (*ProofWithKey) FromString added in v0.76.0

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

FromString decodes p from hex-encoded string.

func (*ProofWithKey) MarshalJSON added in v0.76.0

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

MarshalJSON implements json.Marshaler.

func (*ProofWithKey) String added in v0.76.0

func (p *ProofWithKey) String() string

String implements fmt.Stringer.

func (*ProofWithKey) UnmarshalJSON added in v0.76.0

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

UnmarshalJSON implements json.Unmarshaler.

type Protocol added in v0.97.3

type Protocol struct {
	AddressVersion              byte          `json:"addressversion"`
	Network                     netmode.Magic `json:"network"`
	MillisecondsPerBlock        int           `json:"msperblock"`
	MaxTraceableBlocks          uint32        `json:"maxtraceableblocks"`
	MaxValidUntilBlockIncrement uint32        `json:"maxvaliduntilblockincrement"`
	MaxTransactionsPerBlock     uint16        `json:"maxtransactionsperblock"`
	MemoryPoolMaxTransactions   int           `json:"memorypoolmaxtransactions"`
	ValidatorsCount             byte          `json:"validatorscount"`
	InitialGasDistribution      fixedn.Fixed8 `json:"initialgasdistribution"`
	// StateRootInHeader is true if state root is contained in block header.
	StateRootInHeader bool `json:"staterootinheader,omitempty"`
}

Protocol represents network-dependent parameters.

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 StateHeight added in v0.76.0

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

StateHeight is a result of getstateheight RPC.

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,omitempty"`
}

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 LedgerAux) 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 VerifyProof added in v0.76.0

type VerifyProof struct {
	Value []byte
}

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

func (*VerifyProof) MarshalJSON added in v0.76.0

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

MarshalJSON implements json.Marshaler.

func (*VerifyProof) UnmarshalJSON added in v0.76.0

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
	Magic     netmode.Magic `json:"network"`
	TCPPort   uint16        `json:"tcpport"`
	WSPort    uint16        `json:"wsport,omitempty"`
	Nonce     uint32        `json:"nonce"`
	UserAgent string        `json:"useragent"`
	Protocol  Protocol      `json:"protocol"`
	// StateRootInHeader is true if state root is contained in block header.
	// Deprecated: use Protocol.StateRootInHeader instead
	StateRootInHeader bool `json:"staterootinheader,omitempty"`
}

Version model used for reporting server version info.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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