interactors

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 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 ErrNilAddressNonceHandlerCreator = errors.New("nil AddressNonceHandlerCreator")

ErrNilAddressNonceHandlerCreator signals that a nil AddressNonceHandlerCreator was provided

View Source
var ErrNilArgCreateTransaction = errors.New("nil ArgCreateTransaction")

ErrNilArgCreateTransaction signals that the provided ArgCreateTransaction 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 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, txArgs *data.ArgCreateTransaction) error
	ReSendTransactionsIfRequired(ctx context.Context) error
	SendTransaction(ctx context.Context, tx *data.Transaction) (string, error)
	DropTransactions()
	IsInterfaceNil() bool
}

AddressNonceHandler defines the component able to handler address nonces

type AddressNonceHandlerCreator

type AddressNonceHandlerCreator interface {
	Create(proxy Proxy, address core.AddressHandler) (AddressNonceHandler, error)
	IsInterfaceNil() bool
}

AddressNonceHandlerCreator defines the component able to create AddressNonceHandler instances

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 *data.Transaction) (string, error)
	SendTransactions(ctx context.Context, txs []*data.Transaction) ([]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 *data.Transaction) (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, txArgs *data.ArgCreateTransaction) error
	SendTransaction(ctx context.Context, tx *data.Transaction) (string, error)
	Close() error
	IsInterfaceNil() bool
}

TransactionNonceHandlerV2 defines the component able to apply nonce for a given ArgCreateTransaction

type TxBuilder

type TxBuilder interface {
	ApplySignatureAndGenerateTx(cryptoHolder core.CryptoComponentsHolder, arg data.ArgCreateTransaction) (*data.Transaction, 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