identity

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package identity contains RPC wrappers for Identity contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	Invoker

	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 AddSubjectKeyEvent

type AddSubjectKeyEvent struct {
	SubjectAddress util.Uint160
	SubjectKey     *keys.PublicKey
}

AddSubjectKeyEvent represents "AddSubjectKey" event emitted by the contract.

func AddSubjectKeyEventsFromApplicationLog

func AddSubjectKeyEventsFromApplicationLog(log *result.ApplicationLog) ([]*AddSubjectKeyEvent, error)

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

func (*AddSubjectKeyEvent) FromStackItem

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

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

type AddSubjectToGroupEvent

type AddSubjectToGroupEvent struct {
	SubjectAddress util.Uint160
	Namespace      string
	GroupID        *big.Int
}

AddSubjectToGroupEvent represents "AddSubjectToGroup" event emitted by the contract.

func AddSubjectToGroupEventsFromApplicationLog

func AddSubjectToGroupEventsFromApplicationLog(log *result.ApplicationLog) ([]*AddSubjectToGroupEvent, error)

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

func (*AddSubjectToGroupEvent) FromStackItem

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

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

type AddSubjectToNamespaceEvent

type AddSubjectToNamespaceEvent struct {
	SubjectAddress util.Uint160
	Namespace      string
}

AddSubjectToNamespaceEvent represents "AddSubjectToNamespace" event emitted by the contract.

func AddSubjectToNamespaceEventsFromApplicationLog

func AddSubjectToNamespaceEventsFromApplicationLog(log *result.ApplicationLog) ([]*AddSubjectToNamespaceEvent, error)

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

func (*AddSubjectToNamespaceEvent) FromStackItem

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

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

type Contract

type Contract struct {
	ContractReader
	// 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) AddSubjectKey

func (c *Contract) AddSubjectKey(addr util.Uint160, key *keys.PublicKey) (util.Uint256, uint32, error)

AddSubjectKey creates a transaction invoking `addSubjectKey` 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) AddSubjectKeyTransaction

func (c *Contract) AddSubjectKeyTransaction(addr util.Uint160, key *keys.PublicKey) (*transaction.Transaction, error)

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

func (*Contract) AddSubjectKeyUnsigned

func (c *Contract) AddSubjectKeyUnsigned(addr util.Uint160, key *keys.PublicKey) (*transaction.Transaction, error)

AddSubjectKeyUnsigned creates a transaction invoking `addSubjectKey` 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) AddSubjectToGroup

func (c *Contract) AddSubjectToGroup(addr util.Uint160, groupID *big.Int) (util.Uint256, uint32, error)

AddSubjectToGroup creates a transaction invoking `addSubjectToGroup` 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) AddSubjectToGroupTransaction

func (c *Contract) AddSubjectToGroupTransaction(addr util.Uint160, groupID *big.Int) (*transaction.Transaction, error)

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

func (*Contract) AddSubjectToGroupUnsigned

func (c *Contract) AddSubjectToGroupUnsigned(addr util.Uint160, groupID *big.Int) (*transaction.Transaction, error)

AddSubjectToGroupUnsigned creates a transaction invoking `addSubjectToGroup` 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) ClearAdmin

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

ClearAdmin creates a transaction invoking `clearAdmin` 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) ClearAdminTransaction

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

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

func (*Contract) ClearAdminUnsigned

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

ClearAdminUnsigned creates a transaction invoking `clearAdmin` 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) CreateGroup

func (c *Contract) CreateGroup(ns string, group string) (util.Uint256, uint32, error)

CreateGroup creates a transaction invoking `createGroup` 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) CreateGroupTransaction

func (c *Contract) CreateGroupTransaction(ns string, group string) (*transaction.Transaction, error)

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

func (*Contract) CreateGroupUnsigned

func (c *Contract) CreateGroupUnsigned(ns string, group string) (*transaction.Transaction, error)

CreateGroupUnsigned creates a transaction invoking `createGroup` 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) CreateNamespace

func (c *Contract) CreateNamespace(ns string) (util.Uint256, uint32, error)

CreateNamespace creates a transaction invoking `createNamespace` 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) CreateNamespaceTransaction

func (c *Contract) CreateNamespaceTransaction(ns string) (*transaction.Transaction, error)

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

func (*Contract) CreateNamespaceUnsigned

func (c *Contract) CreateNamespaceUnsigned(ns string) (*transaction.Transaction, error)

CreateNamespaceUnsigned creates a transaction invoking `createNamespace` 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) CreateSubject

func (c *Contract) CreateSubject(ns string, key *keys.PublicKey) (util.Uint256, uint32, error)

CreateSubject creates a transaction invoking `createSubject` 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) CreateSubjectTransaction

func (c *Contract) CreateSubjectTransaction(ns string, key *keys.PublicKey) (*transaction.Transaction, error)

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

func (*Contract) CreateSubjectUnsigned

func (c *Contract) CreateSubjectUnsigned(ns string, key *keys.PublicKey) (*transaction.Transaction, error)

CreateSubjectUnsigned creates a transaction invoking `createSubject` 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) DeleteGroup

func (c *Contract) DeleteGroup(ns string, groupID *big.Int) (util.Uint256, uint32, error)

DeleteGroup creates a transaction invoking `deleteGroup` 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) DeleteGroupKV

func (c *Contract) DeleteGroupKV(ns string, groupID *big.Int, key string) (util.Uint256, uint32, error)

DeleteGroupKV creates a transaction invoking `deleteGroupKV` 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) DeleteGroupKVTransaction

func (c *Contract) DeleteGroupKVTransaction(ns string, groupID *big.Int, key string) (*transaction.Transaction, error)

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

func (*Contract) DeleteGroupKVUnsigned

func (c *Contract) DeleteGroupKVUnsigned(ns string, groupID *big.Int, key string) (*transaction.Transaction, error)

DeleteGroupKVUnsigned creates a transaction invoking `deleteGroupKV` 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) DeleteGroupTransaction

func (c *Contract) DeleteGroupTransaction(ns string, groupID *big.Int) (*transaction.Transaction, error)

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

func (*Contract) DeleteGroupUnsigned

func (c *Contract) DeleteGroupUnsigned(ns string, groupID *big.Int) (*transaction.Transaction, error)

DeleteGroupUnsigned creates a transaction invoking `deleteGroup` 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) DeleteSubject

func (c *Contract) DeleteSubject(addr util.Uint160) (util.Uint256, uint32, error)

DeleteSubject creates a transaction invoking `deleteSubject` 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) DeleteSubjectKV

func (c *Contract) DeleteSubjectKV(addr util.Uint160, key string) (util.Uint256, uint32, error)

DeleteSubjectKV creates a transaction invoking `deleteSubjectKV` 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) DeleteSubjectKVTransaction

func (c *Contract) DeleteSubjectKVTransaction(addr util.Uint160, key string) (*transaction.Transaction, error)

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

func (*Contract) DeleteSubjectKVUnsigned

func (c *Contract) DeleteSubjectKVUnsigned(addr util.Uint160, key string) (*transaction.Transaction, error)

DeleteSubjectKVUnsigned creates a transaction invoking `deleteSubjectKV` 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) DeleteSubjectTransaction

func (c *Contract) DeleteSubjectTransaction(addr util.Uint160) (*transaction.Transaction, error)

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

func (*Contract) DeleteSubjectUnsigned

func (c *Contract) DeleteSubjectUnsigned(addr util.Uint160) (*transaction.Transaction, error)

DeleteSubjectUnsigned creates a transaction invoking `deleteSubject` 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) RemoveSubjectFromGroup

func (c *Contract) RemoveSubjectFromGroup(addr util.Uint160, groupID *big.Int) (util.Uint256, uint32, error)

RemoveSubjectFromGroup creates a transaction invoking `removeSubjectFromGroup` 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) RemoveSubjectFromGroupTransaction

func (c *Contract) RemoveSubjectFromGroupTransaction(addr util.Uint160, groupID *big.Int) (*transaction.Transaction, error)

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

func (*Contract) RemoveSubjectFromGroupUnsigned

func (c *Contract) RemoveSubjectFromGroupUnsigned(addr util.Uint160, groupID *big.Int) (*transaction.Transaction, error)

RemoveSubjectFromGroupUnsigned creates a transaction invoking `removeSubjectFromGroup` 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) RemoveSubjectKey

func (c *Contract) RemoveSubjectKey(addr util.Uint160, key *keys.PublicKey) (util.Uint256, uint32, error)

RemoveSubjectKey creates a transaction invoking `removeSubjectKey` 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) RemoveSubjectKeyTransaction

func (c *Contract) RemoveSubjectKeyTransaction(addr util.Uint160, key *keys.PublicKey) (*transaction.Transaction, error)

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

func (*Contract) RemoveSubjectKeyUnsigned

func (c *Contract) RemoveSubjectKeyUnsigned(addr util.Uint160, key *keys.PublicKey) (*transaction.Transaction, error)

RemoveSubjectKeyUnsigned creates a transaction invoking `removeSubjectKey` 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) SetAdmin

func (c *Contract) SetAdmin(addr util.Uint160) (util.Uint256, uint32, error)

SetAdmin creates a transaction invoking `setAdmin` 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) SetAdminTransaction

func (c *Contract) SetAdminTransaction(addr util.Uint160) (*transaction.Transaction, error)

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

func (*Contract) SetAdminUnsigned

func (c *Contract) SetAdminUnsigned(addr util.Uint160) (*transaction.Transaction, error)

SetAdminUnsigned creates a transaction invoking `setAdmin` 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) SetGroupKV

func (c *Contract) SetGroupKV(ns string, groupID *big.Int, key string, val string) (util.Uint256, uint32, error)

SetGroupKV creates a transaction invoking `setGroupKV` 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) SetGroupKVTransaction

func (c *Contract) SetGroupKVTransaction(ns string, groupID *big.Int, key string, val string) (*transaction.Transaction, error)

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

func (*Contract) SetGroupKVUnsigned

func (c *Contract) SetGroupKVUnsigned(ns string, groupID *big.Int, key string, val string) (*transaction.Transaction, error)

SetGroupKVUnsigned creates a transaction invoking `setGroupKV` 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) SetGroupName

func (c *Contract) SetGroupName(ns string, groupID *big.Int, name string) (util.Uint256, uint32, error)

SetGroupName creates a transaction invoking `setGroupName` 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) SetGroupNameTransaction

func (c *Contract) SetGroupNameTransaction(ns string, groupID *big.Int, name string) (*transaction.Transaction, error)

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

func (*Contract) SetGroupNameUnsigned

func (c *Contract) SetGroupNameUnsigned(ns string, groupID *big.Int, name string) (*transaction.Transaction, error)

SetGroupNameUnsigned creates a transaction invoking `setGroupName` 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) SetSubjectKV

func (c *Contract) SetSubjectKV(addr util.Uint160, key string, val string) (util.Uint256, uint32, error)

SetSubjectKV creates a transaction invoking `setSubjectKV` 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) SetSubjectKVTransaction

func (c *Contract) SetSubjectKVTransaction(addr util.Uint160, key string, val string) (*transaction.Transaction, error)

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

func (*Contract) SetSubjectKVUnsigned

func (c *Contract) SetSubjectKVUnsigned(addr util.Uint160, key string, val string) (*transaction.Transaction, error)

SetSubjectKVUnsigned creates a transaction invoking `setSubjectKV` 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) SetSubjectName

func (c *Contract) SetSubjectName(addr util.Uint160, name string) (util.Uint256, uint32, error)

SetSubjectName creates a transaction invoking `setSubjectName` 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) SetSubjectNameTransaction

func (c *Contract) SetSubjectNameTransaction(addr util.Uint160, name string) (*transaction.Transaction, error)

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

func (*Contract) SetSubjectNameUnsigned

func (c *Contract) SetSubjectNameUnsigned(addr util.Uint160, name string) (*transaction.Transaction, error)

SetSubjectNameUnsigned creates a transaction invoking `setSubjectName` 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) Update

func (c *Contract) Update(script []byte, manifest []byte, data any) (util.Uint256, uint32, error)

Update creates a transaction invoking `update` 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) UpdateTransaction

func (c *Contract) UpdateTransaction(script []byte, manifest []byte, data any) (*transaction.Transaction, error)

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

func (*Contract) UpdateUnsigned

func (c *Contract) UpdateUnsigned(script []byte, manifest []byte, data any) (*transaction.Transaction, error)

UpdateUnsigned creates a transaction invoking `update` 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) GetAdmin

func (c *ContractReader) GetAdmin() (util.Uint160, error)

GetAdmin invokes `getAdmin` method of contract.

func (*ContractReader) GetGroup

func (c *ContractReader) GetGroup(ns string, groupID *big.Int) ([]stackitem.Item, error)

GetGroup invokes `getGroup` method of contract.

func (*ContractReader) GetGroupByName

func (c *ContractReader) GetGroupByName(ns string, name string) ([]stackitem.Item, error)

GetGroupByName invokes `getGroupByName` method of contract.

func (*ContractReader) GetGroupExtended

func (c *ContractReader) GetGroupExtended(ns string, groupID *big.Int) ([]stackitem.Item, error)

GetGroupExtended invokes `getGroupExtended` method of contract.

func (*ContractReader) GetGroupIDByName

func (c *ContractReader) GetGroupIDByName(ns string, name string) (*big.Int, error)

GetGroupIDByName invokes `getGroupIDByName` method of contract.

func (*ContractReader) GetNamespace

func (c *ContractReader) GetNamespace(ns string) ([]stackitem.Item, error)

GetNamespace invokes `getNamespace` method of contract.

func (*ContractReader) GetNamespaceExtended

func (c *ContractReader) GetNamespaceExtended(ns string) ([]stackitem.Item, error)

GetNamespaceExtended invokes `getNamespaceExtended` method of contract.

func (*ContractReader) GetSubject

func (c *ContractReader) GetSubject(addr util.Uint160) ([]stackitem.Item, error)

GetSubject invokes `getSubject` method of contract.

func (*ContractReader) GetSubjectByKey

func (c *ContractReader) GetSubjectByKey(key *keys.PublicKey) ([]stackitem.Item, error)

GetSubjectByKey invokes `getSubjectByKey` method of contract.

func (*ContractReader) GetSubjectByName

func (c *ContractReader) GetSubjectByName(ns string, name string) ([]stackitem.Item, error)

GetSubjectByName invokes `getSubjectByName` method of contract.

func (*ContractReader) GetSubjectExtended

func (c *ContractReader) GetSubjectExtended(addr util.Uint160) ([]stackitem.Item, error)

GetSubjectExtended invokes `getSubjectExtended` method of contract.

func (*ContractReader) GetSubjectKeyByName

func (c *ContractReader) GetSubjectKeyByName(ns string, name string) (*keys.PublicKey, error)

GetSubjectKeyByName invokes `getSubjectKeyByName` method of contract.

func (*ContractReader) ListGroupSubjects

func (c *ContractReader) ListGroupSubjects(ns string, groupID *big.Int) (uuid.UUID, result.Iterator, error)

ListGroupSubjects invokes `listGroupSubjects` method of contract.

func (*ContractReader) ListGroupSubjectsExpanded

func (c *ContractReader) ListGroupSubjectsExpanded(ns string, groupID *big.Int, _numOfIteratorItems int) ([]stackitem.Item, error)

ListGroupSubjectsExpanded is similar to ListGroupSubjects (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) ListGroups

func (c *ContractReader) ListGroups(ns string) (uuid.UUID, result.Iterator, error)

ListGroups invokes `listGroups` method of contract.

func (*ContractReader) ListGroupsExpanded

func (c *ContractReader) ListGroupsExpanded(ns string, _numOfIteratorItems int) ([]stackitem.Item, error)

ListGroupsExpanded is similar to ListGroups (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) ListNamespaceSubjects

func (c *ContractReader) ListNamespaceSubjects(ns string) (uuid.UUID, result.Iterator, error)

ListNamespaceSubjects invokes `listNamespaceSubjects` method of contract.

func (*ContractReader) ListNamespaceSubjectsExpanded

func (c *ContractReader) ListNamespaceSubjectsExpanded(ns string, _numOfIteratorItems int) ([]stackitem.Item, error)

ListNamespaceSubjectsExpanded is similar to ListNamespaceSubjects (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) ListNamespaces

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

ListNamespaces invokes `listNamespaces` method of contract.

func (*ContractReader) ListNamespacesExpanded

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

ListNamespacesExpanded is similar to ListNamespaces (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) ListSubjects

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

ListSubjects invokes `listSubjects` method of contract.

func (*ContractReader) ListSubjectsExpanded

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

ListSubjectsExpanded is similar to ListSubjects (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) Version

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

Version invokes `version` method of contract.

type CreateGroupEvent

type CreateGroupEvent struct {
	Namespace string
	Group     string
}

CreateGroupEvent represents "CreateGroup" event emitted by the contract.

func CreateGroupEventsFromApplicationLog

func CreateGroupEventsFromApplicationLog(log *result.ApplicationLog) ([]*CreateGroupEvent, error)

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

func (*CreateGroupEvent) FromStackItem

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

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

type CreateNamespaceEvent

type CreateNamespaceEvent struct {
	Namespace string
}

CreateNamespaceEvent represents "CreateNamespace" event emitted by the contract.

func CreateNamespaceEventsFromApplicationLog

func CreateNamespaceEventsFromApplicationLog(log *result.ApplicationLog) ([]*CreateNamespaceEvent, error)

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

func (*CreateNamespaceEvent) FromStackItem

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

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

type CreateSubjectEvent

type CreateSubjectEvent struct {
	SubjectAddress util.Uint160
}

CreateSubjectEvent represents "CreateSubject" event emitted by the contract.

func CreateSubjectEventsFromApplicationLog

func CreateSubjectEventsFromApplicationLog(log *result.ApplicationLog) ([]*CreateSubjectEvent, error)

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

func (*CreateSubjectEvent) FromStackItem

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

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

type DeleteGroupEvent

type DeleteGroupEvent struct {
	Namespace string
	GroupID   *big.Int
}

DeleteGroupEvent represents "DeleteGroup" event emitted by the contract.

func DeleteGroupEventsFromApplicationLog

func DeleteGroupEventsFromApplicationLog(log *result.ApplicationLog) ([]*DeleteGroupEvent, error)

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

func (*DeleteGroupEvent) FromStackItem

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

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

type DeleteGroupKVEvent

type DeleteGroupKVEvent struct {
	Namespace string
	GroupID   *big.Int
	Key       string
}

DeleteGroupKVEvent represents "DeleteGroupKV" event emitted by the contract.

func DeleteGroupKVEventsFromApplicationLog

func DeleteGroupKVEventsFromApplicationLog(log *result.ApplicationLog) ([]*DeleteGroupKVEvent, error)

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

func (*DeleteGroupKVEvent) FromStackItem

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

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

type DeleteSubjectEvent

type DeleteSubjectEvent struct {
	SubjectAddress util.Uint160
}

DeleteSubjectEvent represents "DeleteSubject" event emitted by the contract.

func DeleteSubjectEventsFromApplicationLog

func DeleteSubjectEventsFromApplicationLog(log *result.ApplicationLog) ([]*DeleteSubjectEvent, error)

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

func (*DeleteSubjectEvent) FromStackItem

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

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

type DeleteSubjectKVEvent

type DeleteSubjectKVEvent struct {
	SubjectAddress util.Uint160
	Key            string
}

DeleteSubjectKVEvent represents "DeleteSubjectKV" event emitted by the contract.

func DeleteSubjectKVEventsFromApplicationLog

func DeleteSubjectKVEventsFromApplicationLog(log *result.ApplicationLog) ([]*DeleteSubjectKVEvent, error)

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

func (*DeleteSubjectKVEvent) FromStackItem

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

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

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 RemoveSubjectFromGroupEvent

type RemoveSubjectFromGroupEvent struct {
	SubjectAddress util.Uint160
	Namespace      string
	GroupID        *big.Int
}

RemoveSubjectFromGroupEvent represents "RemoveSubjectFromGroup" event emitted by the contract.

func RemoveSubjectFromGroupEventsFromApplicationLog

func RemoveSubjectFromGroupEventsFromApplicationLog(log *result.ApplicationLog) ([]*RemoveSubjectFromGroupEvent, error)

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

func (*RemoveSubjectFromGroupEvent) FromStackItem

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

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

type RemoveSubjectFromNamespaceEvent

type RemoveSubjectFromNamespaceEvent struct {
	SubjectAddress util.Uint160
	Namespace      string
}

RemoveSubjectFromNamespaceEvent represents "RemoveSubjectFromNamespace" event emitted by the contract.

func RemoveSubjectFromNamespaceEventsFromApplicationLog

func RemoveSubjectFromNamespaceEventsFromApplicationLog(log *result.ApplicationLog) ([]*RemoveSubjectFromNamespaceEvent, error)

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

func (*RemoveSubjectFromNamespaceEvent) FromStackItem

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

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

type RemoveSubjectKeyEvent

type RemoveSubjectKeyEvent struct {
	SubjectAddress util.Uint160
	SubjectKey     *keys.PublicKey
}

RemoveSubjectKeyEvent represents "RemoveSubjectKey" event emitted by the contract.

func RemoveSubjectKeyEventsFromApplicationLog

func RemoveSubjectKeyEventsFromApplicationLog(log *result.ApplicationLog) ([]*RemoveSubjectKeyEvent, error)

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

func (*RemoveSubjectKeyEvent) FromStackItem

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

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

type SetGroupKVEvent

type SetGroupKVEvent struct {
	Namespace string
	GroupID   *big.Int
	Key       string
	Value     string
}

SetGroupKVEvent represents "SetGroupKV" event emitted by the contract.

func SetGroupKVEventsFromApplicationLog

func SetGroupKVEventsFromApplicationLog(log *result.ApplicationLog) ([]*SetGroupKVEvent, error)

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

func (*SetGroupKVEvent) FromStackItem

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

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

type SetGroupNameEvent

type SetGroupNameEvent struct {
	Namespace string
	GroupID   *big.Int
	Name      string
}

SetGroupNameEvent represents "SetGroupName" event emitted by the contract.

func SetGroupNameEventsFromApplicationLog

func SetGroupNameEventsFromApplicationLog(log *result.ApplicationLog) ([]*SetGroupNameEvent, error)

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

func (*SetGroupNameEvent) FromStackItem

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

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

type SetSubjectKVEvent

type SetSubjectKVEvent struct {
	SubjectAddress util.Uint160
	Key            string
	Value          string
}

SetSubjectKVEvent represents "SetSubjectKV" event emitted by the contract.

func SetSubjectKVEventsFromApplicationLog

func SetSubjectKVEventsFromApplicationLog(log *result.ApplicationLog) ([]*SetSubjectKVEvent, error)

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

func (*SetSubjectKVEvent) FromStackItem

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

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

type SetSubjectNameEvent

type SetSubjectNameEvent struct {
	SubjectAddress util.Uint160
	Name           string
}

SetSubjectNameEvent represents "SetSubjectName" event emitted by the contract.

func SetSubjectNameEventsFromApplicationLog

func SetSubjectNameEventsFromApplicationLog(log *result.ApplicationLog) ([]*SetSubjectNameEvent, error)

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

func (*SetSubjectNameEvent) FromStackItem

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

FromStackItem converts provided stackitem.Array to SetSubjectNameEvent 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