Documentation
¶
Index ¶
- Variables
- func ReadIteratorItems(inv Invoker, batchSize int, contract util.Uint160, method string, ...) ([]stackitem.Item, error)
- type ContextWaiter
- type Invoker
- type Transaction
- type Waiter
- func (w *Waiter) Wait(h util.Uint256, vub uint32, err error) (*state.AppExecResult, error)
- func (w *Waiter) WaitAny(ctx context.Context, vub uint32, hashes ...util.Uint256) (*state.AppExecResult, error)
- func (w *Waiter) WaitCtx(ctx context.Context, h util.Uint256, vub uint32, err error) (*state.AppExecResult, error)
- type WaiterOptions
Constants ¶
This section is empty.
Variables ¶
var ErrTransactionTooLarge = errors.New("transaction/script size limit exceeded")
Functions ¶
Types ¶
type ContextWaiter ¶ added in v0.21.3
type ContextWaiter interface { waiter.Waiter WaitCtx(ctx context.Context, h util.Uint256, vub uint32, err error) (*state.AppExecResult, error) }
ContextWaiter is an interface that supports transaction awaiting with a context limit.
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.
type Waiter ¶ added in v0.21.0
type Waiter struct {
// contains filtered or unexported fields
}
Waiter is a decorator on top of the standard waiter.Waiter. It provides additional behavior (controlled by WaiterOptions) on top of the standard functionality of awaiting transactions.
func NewWaiter ¶ added in v0.21.0
func NewWaiter(waiter waiter.Waiter, options WaiterOptions) *Waiter
NewWaiter decorates the specified waiter in a new Waiter instance.
func (*Waiter) Wait ¶ added in v0.21.0
Wait allows to wait until transaction will be accepted to the chain.
type WaiterOptions ¶ added in v0.21.0
type WaiterOptions struct { // IgnoreAlreadyExistsError controls behavior for "already exists" error: // - If set to true, it indicates that "already exists" error is not a problem, we should // wait for transaction as usual (this is the behavior of neo-go [waiter.PollingBased]). // - If set to false, it indicates that "already exists" should be reported as an error. IgnoreAlreadyExistsError bool // VerifyExecResults controls whether waiter should ensure that transaction successfully // enters blockchain block. VerifyExecResults bool }