interactors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: GPL-3.0 Imports: 27 Imported by: 9 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDifferentAccountRecovered = errors.New("different account recovered")

ErrDifferentAccountRecovered signals that a different account was recovered

View Source
var ErrGapNonce = errors.New("gap nonce detected")

ErrGapNonce signals that a gap nonce between the lowest nonce of the transactions from the cache and the blockchain nonce has been detected

View Source
var ErrInvalidPemFile = errors.New("invalid .PEM file")

ErrInvalidPemFile signals that an invalid pem file was provided

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue signals that an invalid value was provided

View Source
var ErrNilAddress = errors.New("nil address")

ErrNilAddress signals that the provided address is nil

View Source
var ErrNilProxy = errors.New("nil proxy")

ErrNilProxy signals that a nil proxy was provided

View Source
var ErrNilTransaction = errors.New("nil transaction")

ErrNilTransaction signals that provided transaction is nil

View Source
var ErrNilTxBuilder = errors.New("nil tx builder")

ErrNilTxBuilder signals that a nil transaction builder was provided

View Source
var ErrTxAlreadySent = errors.New("transaction already sent")

ErrTxAlreadySent signals that a transaction was already sent

View Source
var ErrTxWithSameNonceAndGasPriceAlreadySent = errors.New("transaction with the same nonce & gas price was already sent")

ErrTxWithSameNonceAndGasPriceAlreadySent signals that a transaction with the same nonce & gas price was already sent

View Source
var ErrWorkerClosed = errors.New("worker closed")

ErrWorkerClosed signals that the worker is closed

View Source
var ErrWrongPassword = errors.New("wrong password")

ErrWrongPassword signals that a wrong password was provided

Functions

func NewTransactionInteractor

func NewTransactionInteractor(proxy Proxy, txBuilder TxBuilder) (*transactionInteractor, error)

NewTransactionInteractor will create an interactor that extends the proxy functionality with some transaction-oriented functionality

func NewWallet

func NewWallet() *wallet

NewWallet creates a new wallet instance

Types

type AddressNonceHandler

type AddressNonceHandler interface {
	ApplyNonceAndGasPrice(ctx context.Context, tx *transaction.FrontendTransaction) error
	ReSendTransactionsIfRequired(ctx context.Context) error
	SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error)
	DropTransactions()
	IsInterfaceNil() bool
}

AddressNonceHandler defines the component able to handler address nonces

type AddressNonceHandlerV3 added in v1.4.0

type AddressNonceHandlerV3 interface {
	ApplyNonceAndGasPrice(ctx context.Context, tx ...*transaction.FrontendTransaction) error
	SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error)
	IsInterfaceNil() bool
	Close()
}

AddressNonceHandlerV3 defines the component able to handler address nonces

type Proxy

type Proxy interface {
	GetNetworkConfig(ctx context.Context) (*data.NetworkConfig, error)
	GetAccount(ctx context.Context, address core.AddressHandler) (*data.Account, error)
	SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error)
	SendTransactions(ctx context.Context, txs []*transaction.FrontendTransaction) ([]string, error)
	IsInterfaceNil() bool
}

Proxy holds the primitive functions that the multiversx proxy engine supports & implements dependency inversion: blockchain package is considered inner business logic, this package is considered "plugin"

type TransactionNonceHandlerV1

type TransactionNonceHandlerV1 interface {
	GetNonce(ctx context.Context, address core.AddressHandler) (uint64, error)
	SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error)
	ForceNonceReFetch(address core.AddressHandler) error
	Close() error
	IsInterfaceNil() bool
}

TransactionNonceHandlerV1 defines the component able to manage transaction nonces

type TransactionNonceHandlerV2

type TransactionNonceHandlerV2 interface {
	ApplyNonceAndGasPrice(ctx context.Context, address core.AddressHandler, tx *transaction.FrontendTransaction) error
	SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error)
	Close() error
	IsInterfaceNil() bool
}

TransactionNonceHandlerV2 defines the component able to apply nonce for a given frontend transaction.

type TransactionNonceHandlerV3 added in v1.4.0

type TransactionNonceHandlerV3 interface {
	ApplyNonceAndGasPrice(ctx context.Context, tx ...*transaction.FrontendTransaction) error
	SendTransactions(ctx context.Context, txs ...*transaction.FrontendTransaction) ([]string, error)
	Close()
	IsInterfaceNil() bool
}

TransactionNonceHandlerV3 defines the component able to apply nonce for a given frontend transaction.

type TxBuilder

type TxBuilder interface {
	ApplyUserSignature(cryptoHolder core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error
	ApplyGuardianSignature(cryptoHolderGuardian core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error
	ApplyRelayerSignature(relayerCryptoHolder core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error
	IsInterfaceNil() bool
}

TxBuilder defines the component able to build & sign a transaction

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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