Documentation ¶
Index ¶
- Variables
- func NewMoveBalanceHandler(args MoveBalanceHandlerArgs) (*moveBalanceHandler, error)
- func NewWalletTracker(args WalletTrackerArgs) (*walletTracker, error)
- type LastProcessedNonceHandler
- type MoveBalanceHandlerArgs
- type ProxyHandler
- type TrackableAddressesProvider
- type TransactionInteractor
- type WalletTrackerArgs
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAvailableBalanceValue = errors.New("invalid available balance value")
ErrInvalidAvailableBalanceValue signals that an invalid available balance value was provided
var ErrInvalidTransactionValue = errors.New("invalid transaction value")
ErrInvalidTransactionValue signals that an invalid transaction value was provided
var ErrNilLastProcessedNonceHandler = errors.New("nil last processed nonce handler")
ErrNilLastProcessedNonceHandler signals that a nil last processed nonce handler was provided
var ErrNilMinimumBalance = errors.New("nil minimum balance")
ErrNilMinimumBalance signals that a nil minimum balance was provided
var ErrNilProxy = errors.New("nil proxy")
ErrNilProxy signals that a nil proxy has been provided
var ErrNilTrackableAddressesProvider = errors.New("nil trackable address provider")
ErrNilTrackableAddressesProvider signals that a nil trackable address provider was used
var ErrNilTransactionInteractor = errors.New("nil transaction interactor")
ErrNilTransactionInteractor signals that a nil transaction interactor was provided
Functions ¶
func NewMoveBalanceHandler ¶
func NewMoveBalanceHandler(args MoveBalanceHandlerArgs) (*moveBalanceHandler, error)
NewMoveBalanceHandler creates a new instance of the moveBalanceHandler struct
func NewWalletTracker ¶
func NewWalletTracker(args WalletTrackerArgs) (*walletTracker, error)
NewWalletTracker will create a new walletTracker instance. It automatically starts an inner processLoop go routine that can be stopped by calling the Close method
Types ¶
type LastProcessedNonceHandler ¶
type LastProcessedNonceHandler interface { ProcessedNonce(nonce uint64) GetLastProcessedNonce() uint64 IsInterfaceNil() bool }
LastProcessedNonceHandler will keep track of the last processed hyper block nonce. fraction of hyper blocks sets after an application restart
type MoveBalanceHandlerArgs ¶
type MoveBalanceHandlerArgs struct { Proxy ProxyHandler TxInteractor TransactionInteractor ReceiverAddress string TrackableAddressesProvider TrackableAddressesProvider MinimumBalance *big.Int }
MoveBalanceHandlerArgs is the argument DTO for the NewMoveBalanceHandler constructor function
type ProxyHandler ¶
type ProxyHandler interface { GetLatestHyperBlockNonce(ctx context.Context) (uint64, error) GetHyperBlockByNonce(ctx context.Context, nonce uint64) (*data.HyperBlock, error) GetDefaultTransactionArguments(ctx context.Context, address sdkCore.AddressHandler, networkConfigs *data.NetworkConfig) (transaction.FrontendTransaction, string, error) GetNetworkConfig(ctx context.Context) (*data.NetworkConfig, error) IsInterfaceNil() bool }
ProxyHandler defines the behavior of a proxy handler that can process requests
type TrackableAddressesProvider ¶
type TrackableAddressesProvider interface { IsTrackableAddresses(addressAsBech32 string) bool PrivateKeyOfBech32Address(addressAsBech32 string) []byte IsInterfaceNil() bool }
TrackableAddressesProvider defines the behavior for a component that can determine if one address is tracked or not
type TransactionInteractor ¶
type TransactionInteractor interface { AddTransaction(tx *transaction.FrontendTransaction) ApplySignature(cryptoHolder sdkCore.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error IsInterfaceNil() bool }
TransactionInteractor defines the transaction interactor behavior used in workflows
type WalletTrackerArgs ¶
type WalletTrackerArgs struct { TrackableAddressesProvider TrackableAddressesProvider Proxy ProxyHandler NonceHandler LastProcessedNonceHandler CheckInterval time.Duration MinimumBalance *big.Int }
WalletTrackerArgs is the argument DTO for the NewWalletTracker constructor function