Documentation ¶
Index ¶
- Variables
- func NewTransactionInteractor(proxy Proxy, txBuilder GuardedTxBuilder) (*transactionInteractor, error)
- func NewWallet() *wallet
- type AddressNonceHandler
- type AddressNonceHandlerV3
- type GuardedTxBuilder
- type Proxy
- type TransactionNonceHandlerV1
- type TransactionNonceHandlerV2
- type TransactionNonceHandlerV3
- type TxBuilder
Constants ¶
This section is empty.
Variables ¶
var ErrDifferentAccountRecovered = errors.New("different account recovered")
ErrDifferentAccountRecovered signals that a different account was recovered
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
var ErrInvalidPemFile = errors.New("invalid .PEM file")
ErrInvalidPemFile signals that an invalid pem file was provided
var ErrInvalidValue = errors.New("invalid value")
ErrInvalidValue signals that an invalid value was provided
var ErrNilAddress = errors.New("nil address")
ErrNilAddress signals that the provided address is nil
var ErrNilProxy = errors.New("nil proxy")
ErrNilProxy signals that a nil proxy was provided
var ErrNilTransaction = errors.New("nil transaction")
ErrNilTransaction signals that provided transaction is nil
var ErrNilTxBuilder = errors.New("nil tx builder")
ErrNilTxBuilder signals that a nil transaction builder was provided
var ErrTxAlreadySent = errors.New("transaction already sent")
ErrTxAlreadySent signals that a transaction was already sent
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
var ErrWorkerClosed = errors.New("worker closed")
ErrWorkerClosed signals that the worker is closed
var ErrWrongPassword = errors.New("wrong password")
ErrWrongPassword signals that a wrong password was provided
Functions ¶
func NewTransactionInteractor ¶
func NewTransactionInteractor(proxy Proxy, txBuilder GuardedTxBuilder) (*transactionInteractor, error)
NewTransactionInteractor will create an interactor that extends the proxy functionality with some transaction-oriented functionality
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 GuardedTxBuilder ¶ added in v1.3.3
type GuardedTxBuilder interface { ApplyUserSignature(cryptoHolder core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error ApplyGuardianSignature(cryptoHolderGuardian core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error IsInterfaceNil() bool }
GuardedTxBuilder defines the component able to build and sign a guarded transaction
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 IsInterfaceNil() bool }
TxBuilder defines the component able to build & sign a transaction