commonclient

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: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTransactionTooLarge = errors.New("transaction/script size limit exceeded")

Functions

func ReadIteratorItems

func ReadIteratorItems(inv Invoker, batchSize int, contract util.Uint160, method string, params ...any) ([]stackitem.Item, error)

ReadIteratorItems calls method that returns iterator and traverses the iterator until all items are read into array.

Types

type Invoker

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

Invoker is a subset of methods provided by struct invoker.Invoker. The subset contains only those methods that are used by ActorWrapper and clients of the contracts.

type Transaction

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

Transaction allows to invoke several contract method at once.

func NewTransaction

func NewTransaction(contractHash util.Uint160) *Transaction

NewTransaction creates new transaction to accumulate contract invocations.

func (Transaction) Bytes

func (t Transaction) Bytes() ([]byte, error)

Bytes returns the resulting buffer and makes future writes return an error.

func (Transaction) WrapCall

func (t Transaction) WrapCall(method string, args []any) error

WrapCall accept methods and arguments to invoke. Should be used with method on clients like Client.MethodNameCall.

func (Transaction) WrapCallErr

func (t Transaction) WrapCallErr(method string, args []any, err error) error

WrapCallErr accept methods, arguments and error to handle and invoke. Should be used with method on clients like *CallErr.

Jump to

Keyboard shortcuts

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