netmap

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: GPL-3.0, Apache-2.0 Imports: 15 Imported by: 6

Documentation

Overview

Package netmap contains RPC wrappers for NeoFS Netmap contract.

Index

Constants

This section is empty.

Variables

View Source
var (
	// NodeStateOnline is used by healthy available nodes.
	NodeStateOnline = big.NewInt(int64(nodestate.Online))

	// NodeStateOffline is used by for currently unavailable nodes.
	NodeStateOffline = big.NewInt(int64(nodestate.Offline))

	// NodeStateMaintenance is used by nodes with known partial availability.
	NodeStateMaintenance = big.NewInt(int64(nodestate.Maintenance))
)

Possible node states in NetmapNode.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	Invoker

	nep22.Actor

	MakeCall(contract util.Uint160, method string, params ...any) (*transaction.Transaction, error)
	MakeRun(script []byte) (*transaction.Transaction, error)
	MakeUnsignedCall(contract util.Uint160, method string, attrs []transaction.Attribute, params ...any) (*transaction.Transaction, error)
	MakeUnsignedRun(script []byte, attrs []transaction.Attribute) (*transaction.Transaction, error)
	SendCall(contract util.Uint160, method string, params ...any) (util.Uint256, uint32, error)
	SendRun(script []byte) (util.Uint256, uint32, error)
}

Actor is used by Contract to call state-changing methods.

type AddNodeEvent added in v0.21.0

type AddNodeEvent struct {
	PublicKey  *keys.PublicKey
	Addresses  []any
	Attributes map[any]any
}

AddNodeEvent represents "AddNode" event emitted by the contract.

func AddNodeEventsFromApplicationLog added in v0.21.0

func AddNodeEventsFromApplicationLog(log *result.ApplicationLog) ([]*AddNodeEvent, error)

AddNodeEventsFromApplicationLog retrieves a set of all emitted events with "AddNode" name from the provided result.ApplicationLog.

func (*AddNodeEvent) FromStackItem added in v0.21.0

func (e *AddNodeEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to AddNodeEvent or returns an error if it's not possible to do to so.

type AddPeerSuccessEvent

type AddPeerSuccessEvent struct {
	PublicKey *keys.PublicKey
}

AddPeerSuccessEvent represents "AddPeerSuccess" event emitted by the contract.

func AddPeerSuccessEventsFromApplicationLog

func AddPeerSuccessEventsFromApplicationLog(log *result.ApplicationLog) ([]*AddPeerSuccessEvent, error)

AddPeerSuccessEventsFromApplicationLog retrieves a set of all emitted events with "AddPeerSuccess" name from the provided result.ApplicationLog.

func (*AddPeerSuccessEvent) FromStackItem

func (e *AddPeerSuccessEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to AddPeerSuccessEvent or returns an error if it's not possible to do to so.

type CommonIRNode

type CommonIRNode struct {
	PublicKey *keys.PublicKey
}

CommonIRNode is a contract-specific common.IRNode type used by its methods.

func (*CommonIRNode) FromStackItem

func (res *CommonIRNode) FromStackItem(item stackitem.Item) error

FromStackItem retrieves fields of CommonIRNode from the given stackitem.Item or returns an error if it's not possible to do to so. It implements stackitem.Convertible interface.

func (*CommonIRNode) ToSCParameter added in v0.21.0

func (res *CommonIRNode) ToSCParameter() (smartcontract.Parameter, error)

ToSCParameter creates smartcontract.Parameter representing CommonIRNode. It implements smartcontract.Convertible interface so that CommonIRNode could be used with invokers.

func (*CommonIRNode) ToStackItem added in v0.21.0

func (res *CommonIRNode) ToStackItem() (stackitem.Item, error)

ToStackItem creates stackitem.Item representing CommonIRNode. It implements stackitem.Convertible interface.

type Contract

type Contract struct {
	ContractReader
	NEP22Contract
	// contains filtered or unexported fields
}

Contract implements all contract methods.

func New

func New(actor Actor, hash util.Uint160) *Contract

New creates an instance of Contract using provided contract hash and the given Actor.

func (*Contract) AddNode added in v0.21.0

func (c *Contract) AddNode(n *NetmapNode2) (util.Uint256, uint32, error)

AddNode creates a transaction invoking `addNode` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) AddNodeTransaction added in v0.21.0

func (c *Contract) AddNodeTransaction(n *NetmapNode2) (*transaction.Transaction, error)

AddNodeTransaction creates a transaction invoking `addNode` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) AddNodeUnsigned added in v0.21.0

func (c *Contract) AddNodeUnsigned(n *NetmapNode2) (*transaction.Transaction, error)

AddNodeUnsigned creates a transaction invoking `addNode` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) AddPeer

func (c *Contract) AddPeer(nodeInfo []byte) (util.Uint256, uint32, error)

AddPeer creates a transaction invoking `addPeer` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) AddPeerIR

func (c *Contract) AddPeerIR(nodeInfo []byte) (util.Uint256, uint32, error)

AddPeerIR creates a transaction invoking `addPeerIR` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) AddPeerIRTransaction

func (c *Contract) AddPeerIRTransaction(nodeInfo []byte) (*transaction.Transaction, error)

AddPeerIRTransaction creates a transaction invoking `addPeerIR` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) AddPeerIRUnsigned

func (c *Contract) AddPeerIRUnsigned(nodeInfo []byte) (*transaction.Transaction, error)

AddPeerIRUnsigned creates a transaction invoking `addPeerIR` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) AddPeerTransaction

func (c *Contract) AddPeerTransaction(nodeInfo []byte) (*transaction.Transaction, error)

AddPeerTransaction creates a transaction invoking `addPeer` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) AddPeerUnsigned

func (c *Contract) AddPeerUnsigned(nodeInfo []byte) (*transaction.Transaction, error)

AddPeerUnsigned creates a transaction invoking `addPeer` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) DeleteNode added in v0.21.0

func (c *Contract) DeleteNode(pkey *keys.PublicKey) (util.Uint256, uint32, error)

DeleteNode creates a transaction invoking `deleteNode` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) DeleteNodeTransaction added in v0.21.0

func (c *Contract) DeleteNodeTransaction(pkey *keys.PublicKey) (*transaction.Transaction, error)

DeleteNodeTransaction creates a transaction invoking `deleteNode` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) DeleteNodeUnsigned added in v0.21.0

func (c *Contract) DeleteNodeUnsigned(pkey *keys.PublicKey) (*transaction.Transaction, error)

DeleteNodeUnsigned creates a transaction invoking `deleteNode` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) LastEpochBlock

func (c *Contract) LastEpochBlock() (util.Uint256, uint32, error)

LastEpochBlock creates a transaction invoking `lastEpochBlock` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) LastEpochBlockTransaction

func (c *Contract) LastEpochBlockTransaction() (*transaction.Transaction, error)

LastEpochBlockTransaction creates a transaction invoking `lastEpochBlock` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) LastEpochBlockUnsigned

func (c *Contract) LastEpochBlockUnsigned() (*transaction.Transaction, error)

LastEpochBlockUnsigned creates a transaction invoking `lastEpochBlock` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) NewEpoch

func (c *Contract) NewEpoch(epochNum *big.Int) (util.Uint256, uint32, error)

NewEpoch creates a transaction invoking `newEpoch` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) NewEpochTransaction

func (c *Contract) NewEpochTransaction(epochNum *big.Int) (*transaction.Transaction, error)

NewEpochTransaction creates a transaction invoking `newEpoch` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) NewEpochUnsigned

func (c *Contract) NewEpochUnsigned(epochNum *big.Int) (*transaction.Transaction, error)

NewEpochUnsigned creates a transaction invoking `newEpoch` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) SetCleanupThreshold added in v0.21.0

func (c *Contract) SetCleanupThreshold(val *big.Int) (util.Uint256, uint32, error)

SetCleanupThreshold creates a transaction invoking `setCleanupThreshold` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) SetCleanupThresholdTransaction added in v0.21.0

func (c *Contract) SetCleanupThresholdTransaction(val *big.Int) (*transaction.Transaction, error)

SetCleanupThresholdTransaction creates a transaction invoking `setCleanupThreshold` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) SetCleanupThresholdUnsigned added in v0.21.0

func (c *Contract) SetCleanupThresholdUnsigned(val *big.Int) (*transaction.Transaction, error)

SetCleanupThresholdUnsigned creates a transaction invoking `setCleanupThreshold` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) SetConfig

func (c *Contract) SetConfig(id []byte, key []byte, val []byte) (util.Uint256, uint32, error)

SetConfig creates a transaction invoking `setConfig` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) SetConfigTransaction

func (c *Contract) SetConfigTransaction(id []byte, key []byte, val []byte) (*transaction.Transaction, error)

SetConfigTransaction creates a transaction invoking `setConfig` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) SetConfigUnsigned

func (c *Contract) SetConfigUnsigned(id []byte, key []byte, val []byte) (*transaction.Transaction, error)

SetConfigUnsigned creates a transaction invoking `setConfig` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) SubscribeForNewEpoch added in v0.19.0

func (c *Contract) SubscribeForNewEpoch(contract util.Uint160) (util.Uint256, uint32, error)

SubscribeForNewEpoch creates a transaction invoking `subscribeForNewEpoch` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) SubscribeForNewEpochTransaction added in v0.19.0

func (c *Contract) SubscribeForNewEpochTransaction(contract util.Uint160) (*transaction.Transaction, error)

SubscribeForNewEpochTransaction creates a transaction invoking `subscribeForNewEpoch` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) SubscribeForNewEpochUnsigned added in v0.19.0

func (c *Contract) SubscribeForNewEpochUnsigned(contract util.Uint160) (*transaction.Transaction, error)

SubscribeForNewEpochUnsigned creates a transaction invoking `subscribeForNewEpoch` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) UnsubscribeFromNewEpoch added in v0.24.0

func (c *Contract) UnsubscribeFromNewEpoch(contract util.Uint160) (util.Uint256, uint32, error)

UnsubscribeFromNewEpoch creates a transaction invoking `unsubscribeFromNewEpoch` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) UnsubscribeFromNewEpochTransaction added in v0.24.0

func (c *Contract) UnsubscribeFromNewEpochTransaction(contract util.Uint160) (*transaction.Transaction, error)

UnsubscribeFromNewEpochTransaction creates a transaction invoking `unsubscribeFromNewEpoch` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) UnsubscribeFromNewEpochUnsigned added in v0.24.0

func (c *Contract) UnsubscribeFromNewEpochUnsigned(contract util.Uint160) (*transaction.Transaction, error)

UnsubscribeFromNewEpochUnsigned creates a transaction invoking `unsubscribeFromNewEpoch` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) UpdateSnapshotCount

func (c *Contract) UpdateSnapshotCount(count *big.Int) (util.Uint256, uint32, error)

UpdateSnapshotCount creates a transaction invoking `updateSnapshotCount` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) UpdateSnapshotCountTransaction

func (c *Contract) UpdateSnapshotCountTransaction(count *big.Int) (*transaction.Transaction, error)

UpdateSnapshotCountTransaction creates a transaction invoking `updateSnapshotCount` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) UpdateSnapshotCountUnsigned

func (c *Contract) UpdateSnapshotCountUnsigned(count *big.Int) (*transaction.Transaction, error)

UpdateSnapshotCountUnsigned creates a transaction invoking `updateSnapshotCount` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) UpdateState

func (c *Contract) UpdateState(state *big.Int, publicKey *keys.PublicKey) (util.Uint256, uint32, error)

UpdateState creates a transaction invoking `updateState` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) UpdateStateIR

func (c *Contract) UpdateStateIR(state *big.Int, publicKey *keys.PublicKey) (util.Uint256, uint32, error)

UpdateStateIR creates a transaction invoking `updateStateIR` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) UpdateStateIRTransaction

func (c *Contract) UpdateStateIRTransaction(state *big.Int, publicKey *keys.PublicKey) (*transaction.Transaction, error)

UpdateStateIRTransaction creates a transaction invoking `updateStateIR` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) UpdateStateIRUnsigned

func (c *Contract) UpdateStateIRUnsigned(state *big.Int, publicKey *keys.PublicKey) (*transaction.Transaction, error)

UpdateStateIRUnsigned creates a transaction invoking `updateStateIR` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) UpdateStateTransaction

func (c *Contract) UpdateStateTransaction(state *big.Int, publicKey *keys.PublicKey) (*transaction.Transaction, error)

UpdateStateTransaction creates a transaction invoking `updateState` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) UpdateStateUnsigned

func (c *Contract) UpdateStateUnsigned(state *big.Int, publicKey *keys.PublicKey) (*transaction.Transaction, error)

UpdateStateUnsigned creates a transaction invoking `updateState` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

type ContractReader

type ContractReader struct {
	// contains filtered or unexported fields
}

ContractReader implements safe contract methods.

func NewReader

func NewReader(invoker Invoker, hash util.Uint160) *ContractReader

NewReader creates an instance of ContractReader using provided contract hash and the given Invoker.

func (*ContractReader) CleanupThreshold added in v0.21.0

func (c *ContractReader) CleanupThreshold() (*big.Int, error)

CleanupThreshold invokes `cleanupThreshold` method of contract.

func (*ContractReader) Config

func (c *ContractReader) Config(key []byte) (any, error)

Config invokes `config` method of contract.

func (*ContractReader) Epoch

func (c *ContractReader) Epoch() (*big.Int, error)

Epoch invokes `epoch` method of contract.

func (*ContractReader) GetEpochBlock added in v0.22.0

func (c *ContractReader) GetEpochBlock(epoch *big.Int) (*big.Int, error)

GetEpochBlock invokes `getEpochBlock` method of contract.

func (*ContractReader) GetEpochTime added in v0.22.0

func (c *ContractReader) GetEpochTime(epoch *big.Int) (*big.Int, error)

GetEpochTime invokes `getEpochTime` method of contract.

func (*ContractReader) InnerRingList

func (c *ContractReader) InnerRingList() ([]*CommonIRNode, error)

InnerRingList invokes `innerRingList` method of contract.

func (*ContractReader) IsStorageNode added in v0.21.0

func (c *ContractReader) IsStorageNode(key *keys.PublicKey) (bool, error)

IsStorageNode invokes `isStorageNode` method of contract.

func (*ContractReader) IsStorageNode2 added in v0.21.0

func (c *ContractReader) IsStorageNode2(key *keys.PublicKey, epoch *big.Int) (bool, error)

IsStorageNode2 invokes `isStorageNode` method of contract.

func (*ContractReader) LastEpochTime added in v0.22.0

func (c *ContractReader) LastEpochTime() (*big.Int, error)

LastEpochTime invokes `lastEpochTime` method of contract.

func (*ContractReader) ListCandidates added in v0.21.0

func (c *ContractReader) ListCandidates() (uuid.UUID, result.Iterator, error)

ListCandidates invokes `listCandidates` method of contract.

func (*ContractReader) ListCandidatesExpanded added in v0.21.0

func (c *ContractReader) ListCandidatesExpanded(_numOfIteratorItems int) ([]stackitem.Item, error)

ListCandidatesExpanded is similar to ListCandidates (uses the same contract method), but can be useful if the server used doesn't support sessions and doesn't expand iterators. It creates a script that will get the specified number of result items from the iterator right in the VM and return them to you. It's only limited by VM stack and GAS available for RPC invocations.

func (*ContractReader) ListConfig

func (c *ContractReader) ListConfig() ([]*NetmapConfigRecord, error)

ListConfig invokes `listConfig` method of contract.

func (*ContractReader) ListNodes added in v0.21.0

func (c *ContractReader) ListNodes() (uuid.UUID, result.Iterator, error)

ListNodes invokes `listNodes` method of contract.

func (*ContractReader) ListNodes2 added in v0.21.0

func (c *ContractReader) ListNodes2(epoch *big.Int) (uuid.UUID, result.Iterator, error)

ListNodes2 invokes `listNodes` method of contract.

func (*ContractReader) ListNodes2Expanded added in v0.21.0

func (c *ContractReader) ListNodes2Expanded(epoch *big.Int, _numOfIteratorItems int) ([]stackitem.Item, error)

ListNodes2Expanded is similar to ListNodes2 (uses the same contract method), but can be useful if the server used doesn't support sessions and doesn't expand iterators. It creates a script that will get the specified number of result items from the iterator right in the VM and return them to you. It's only limited by VM stack and GAS available for RPC invocations.

func (*ContractReader) ListNodesExpanded added in v0.21.0

func (c *ContractReader) ListNodesExpanded(_numOfIteratorItems int) ([]stackitem.Item, error)

ListNodesExpanded is similar to ListNodes (uses the same contract method), but can be useful if the server used doesn't support sessions and doesn't expand iterators. It creates a script that will get the specified number of result items from the iterator right in the VM and return them to you. It's only limited by VM stack and GAS available for RPC invocations.

func (*ContractReader) Netmap

func (c *ContractReader) Netmap() ([]*NetmapNode, error)

Netmap invokes `netmap` method of contract.

func (*ContractReader) NetmapCandidates

func (c *ContractReader) NetmapCandidates() ([]*NetmapNode, error)

NetmapCandidates invokes `netmapCandidates` method of contract.

func (*ContractReader) Snapshot

func (c *ContractReader) Snapshot(diff *big.Int) ([]*NetmapNode, error)

Snapshot invokes `snapshot` method of contract.

func (*ContractReader) SnapshotByEpoch

func (c *ContractReader) SnapshotByEpoch(epoch *big.Int) ([]*NetmapNode, error)

SnapshotByEpoch invokes `snapshotByEpoch` method of contract.

func (*ContractReader) UnusedCandidate added in v0.21.0

func (c *ContractReader) UnusedCandidate() (*NetmapCandidate, error)

UnusedCandidate invokes `unusedCandidate` method of contract.

func (*ContractReader) Version

func (c *ContractReader) Version() (*big.Int, error)

Version invokes `version` method of contract.

type Invoker

type Invoker interface {
	Call(contract util.Uint160, operation string, params ...any) (*result.Invoke, error)
	CallAndExpandIterator(contract util.Uint160, method string, maxItems int, params ...any) (*result.Invoke, error)
	TerminateSession(sessionID uuid.UUID) error
	TraverseIterator(sessionID uuid.UUID, iterator *result.Iterator, num int) ([]stackitem.Item, error)
}

Invoker is used by ContractReader to call various safe methods.

type NEP22Contract added in v0.25.0

type NEP22Contract = nep22.Contract

NEP22Contract is an alias for nep22.Contract.

type NetmapCandidate added in v0.21.0

type NetmapCandidate struct {
	Addresses       []string
	Attributes      map[string]string
	Key             *keys.PublicKey
	State           *big.Int
	LastActiveEpoch *big.Int
}

NetmapCandidate is a contract-specific netmap.Candidate type used by its methods.

func (*NetmapCandidate) FromStackItem added in v0.21.0

func (res *NetmapCandidate) FromStackItem(item stackitem.Item) error

FromStackItem retrieves fields of NetmapCandidate from the given stackitem.Item or returns an error if it's not possible to do to so. It implements stackitem.Convertible interface.

func (*NetmapCandidate) ToSCParameter added in v0.21.0

func (res *NetmapCandidate) ToSCParameter() (smartcontract.Parameter, error)

ToSCParameter creates smartcontract.Parameter representing NetmapCandidate. It implements smartcontract.Convertible interface so that NetmapCandidate could be used with invokers.

func (*NetmapCandidate) ToStackItem added in v0.21.0

func (res *NetmapCandidate) ToStackItem() (stackitem.Item, error)

ToStackItem creates stackitem.Item representing NetmapCandidate. It implements stackitem.Convertible interface.

type NetmapConfigRecord added in v0.21.0

type NetmapConfigRecord struct {
	Key   []byte
	Value []byte
}

NetmapConfigRecord is a contract-specific netmap.ConfigRecord type used by its methods.

func (*NetmapConfigRecord) FromStackItem added in v0.21.0

func (res *NetmapConfigRecord) FromStackItem(item stackitem.Item) error

FromStackItem retrieves fields of NetmapConfigRecord from the given stackitem.Item or returns an error if it's not possible to do to so. It implements stackitem.Convertible interface.

func (*NetmapConfigRecord) ToSCParameter added in v0.21.0

func (res *NetmapConfigRecord) ToSCParameter() (smartcontract.Parameter, error)

ToSCParameter creates smartcontract.Parameter representing NetmapConfigRecord. It implements smartcontract.Convertible interface so that NetmapConfigRecord could be used with invokers.

func (*NetmapConfigRecord) ToStackItem added in v0.21.0

func (res *NetmapConfigRecord) ToStackItem() (stackitem.Item, error)

ToStackItem creates stackitem.Item representing NetmapConfigRecord. It implements stackitem.Convertible interface.

type NetmapNode

type NetmapNode struct {
	BLOB  []byte
	State *big.Int
}

NetmapNode is a contract-specific netmap.Node type used by its methods.

func (*NetmapNode) FromStackItem

func (res *NetmapNode) FromStackItem(item stackitem.Item) error

FromStackItem retrieves fields of NetmapNode from the given stackitem.Item or returns an error if it's not possible to do to so. It implements stackitem.Convertible interface.

func (*NetmapNode) ToSCParameter added in v0.21.0

func (res *NetmapNode) ToSCParameter() (smartcontract.Parameter, error)

ToSCParameter creates smartcontract.Parameter representing NetmapNode. It implements smartcontract.Convertible interface so that NetmapNode could be used with invokers.

func (*NetmapNode) ToStackItem added in v0.21.0

func (res *NetmapNode) ToStackItem() (stackitem.Item, error)

ToStackItem creates stackitem.Item representing NetmapNode. It implements stackitem.Convertible interface.

type NetmapNode2 added in v0.21.0

type NetmapNode2 struct {
	Addresses  []string
	Attributes map[string]string
	Key        *keys.PublicKey
	State      *big.Int
}

NetmapNode2 is a contract-specific netmap.Node2 type used by its methods.

func (*NetmapNode2) FromStackItem added in v0.21.0

func (res *NetmapNode2) FromStackItem(item stackitem.Item) error

FromStackItem retrieves fields of NetmapNode2 from the given stackitem.Item or returns an error if it's not possible to do to so. It implements stackitem.Convertible interface.

func (*NetmapNode2) ToSCParameter added in v0.21.0

func (res *NetmapNode2) ToSCParameter() (smartcontract.Parameter, error)

ToSCParameter creates smartcontract.Parameter representing NetmapNode2. It implements smartcontract.Convertible interface so that NetmapNode2 could be used with invokers.

func (*NetmapNode2) ToStackItem added in v0.21.0

func (res *NetmapNode2) ToStackItem() (stackitem.Item, error)

ToStackItem creates stackitem.Item representing NetmapNode2. It implements stackitem.Convertible interface.

type NewEpochEvent

type NewEpochEvent struct {
	Epoch *big.Int
}

NewEpochEvent represents "NewEpoch" event emitted by the contract.

func NewEpochEventsFromApplicationLog

func NewEpochEventsFromApplicationLog(log *result.ApplicationLog) ([]*NewEpochEvent, error)

NewEpochEventsFromApplicationLog retrieves a set of all emitted events with "NewEpoch" name from the provided result.ApplicationLog.

func (*NewEpochEvent) FromStackItem

func (e *NewEpochEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to NewEpochEvent or returns an error if it's not possible to do to so.

type NewEpochSubscriptionEvent added in v0.19.0

type NewEpochSubscriptionEvent struct {
	Contract util.Uint160
}

NewEpochSubscriptionEvent represents "NewEpochSubscription" event emitted by the contract.

func NewEpochSubscriptionEventsFromApplicationLog added in v0.19.0

func NewEpochSubscriptionEventsFromApplicationLog(log *result.ApplicationLog) ([]*NewEpochSubscriptionEvent, error)

NewEpochSubscriptionEventsFromApplicationLog retrieves a set of all emitted events with "NewEpochSubscription" name from the provided result.ApplicationLog.

func (*NewEpochSubscriptionEvent) FromStackItem added in v0.19.0

func (e *NewEpochSubscriptionEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to NewEpochSubscriptionEvent or returns an error if it's not possible to do to so.

type NewEpochUnsubscriptionEvent added in v0.24.0

type NewEpochUnsubscriptionEvent struct {
	Contract util.Uint160
}

NewEpochUnsubscriptionEvent represents "NewEpochUnsubscription" event emitted by the contract.

func NewEpochUnsubscriptionEventsFromApplicationLog added in v0.24.0

func NewEpochUnsubscriptionEventsFromApplicationLog(log *result.ApplicationLog) ([]*NewEpochUnsubscriptionEvent, error)

NewEpochUnsubscriptionEventsFromApplicationLog retrieves a set of all emitted events with "NewEpochUnsubscription" name from the provided result.ApplicationLog.

func (*NewEpochUnsubscriptionEvent) FromStackItem added in v0.24.0

func (e *NewEpochUnsubscriptionEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to NewEpochUnsubscriptionEvent or returns an error if it's not possible to do to so.

type UpdateStateSuccessEvent

type UpdateStateSuccessEvent struct {
	PublicKey *keys.PublicKey
	State     *big.Int
}

UpdateStateSuccessEvent represents "UpdateStateSuccess" event emitted by the contract.

func UpdateStateSuccessEventsFromApplicationLog

func UpdateStateSuccessEventsFromApplicationLog(log *result.ApplicationLog) ([]*UpdateStateSuccessEvent, error)

UpdateStateSuccessEventsFromApplicationLog retrieves a set of all emitted events with "UpdateStateSuccess" name from the provided result.ApplicationLog.

func (*UpdateStateSuccessEvent) FromStackItem

func (e *UpdateStateSuccessEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to UpdateStateSuccessEvent or returns an error if it's not possible to do to so.

Jump to

Keyboard shortcuts

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