Versions in this module Expand all Collapse all v1 v1.1.3 Jan 20, 2025 v1.1.2 Jan 20, 2025 Changes in this version + const MonitoredTxStatusConfirmed + const MonitoredTxStatusCreated + const MonitoredTxStatusDone + const MonitoredTxStatusFailed + const MonitoredTxStatusReorged + const MonitoredTxStatusSent + var ErrAlreadyExists = errors.New("already exists") + var ErrExecutionReverted = errors.New("execution reverted") + var ErrNotFound = errors.New("not found") + func CreateLogger(owner, monitoredTxId string, from common.Address, to *common.Address) *log.Logger + func CreateMonitoredTxResultLogger(owner string, mTxResult MonitoredTxResult) *log.Logger + type Client struct + func New(cfg Config, ethMan ethermanInterface, storage storageInterface, ...) *Client + func (c *Client) Add(ctx context.Context, owner, id string, from common.Address, to *common.Address, ...) error + func (c *Client) ProcessPendingMonitoredTxs(ctx context.Context, owner string, resultHandler ResultHandler, dbTx pgx.Tx) + func (c *Client) Reorg(ctx context.Context, fromBlockNumber uint64, dbTx pgx.Tx) error + func (c *Client) Result(ctx context.Context, owner, id string, dbTx pgx.Tx) (MonitoredTxResult, error) + func (c *Client) ResultsByStatus(ctx context.Context, owner string, statuses []MonitoredTxStatus, dbTx pgx.Tx) ([]MonitoredTxResult, error) + func (c *Client) Start() + func (c *Client) Stop() + type Config struct + ForcedGas uint64 + FrequencyToMonitorTxs types.Duration + GasPriceMarginFactor float64 + MaxGasPriceLimit uint64 + PrivateKeys []types.KeystoreFileConfig + WaitTxToBeMined types.Duration + type MonitoredTxResult struct + ID string + Status MonitoredTxStatus + Txs map[common.Hash]TxResult + type MonitoredTxStatus string + func (s MonitoredTxStatus) String() string + type PostgresStorage struct + func NewPostgresStorage(dbCfg db.Config) (*PostgresStorage, error) + func (s *PostgresStorage) Add(ctx context.Context, mTx monitoredTx, dbTx pgx.Tx) error + func (s *PostgresStorage) Get(ctx context.Context, owner, id string, dbTx pgx.Tx) (monitoredTx, error) + func (s *PostgresStorage) GetByBlock(ctx context.Context, fromBlock, toBlock *uint64, dbTx pgx.Tx) ([]monitoredTx, error) + func (s *PostgresStorage) GetByStatus(ctx context.Context, owner *string, statuses []MonitoredTxStatus, dbTx pgx.Tx) ([]monitoredTx, error) + func (s *PostgresStorage) Update(ctx context.Context, mTx monitoredTx, dbTx pgx.Tx) error + type ResultHandler func(MonitoredTxResult, pgx.Tx) + type TxResult struct + Receipt *types.Receipt + RevertMessage string + Tx *types.Transaction