Stateless manager to send transactions to L1.
func (c *Client) Add(ctx context.Context, to *common.Address, forcedNonce *uint64, value *big.Int, data []byte, gasOffset uint64, sidecar *types.BlobTxSidecar) (common.Hash, error)
Adds a transaction to be sent to L1. The returned hash is calculated over the to, nonce, value and data fields.
Parameter forcedNonce is optional, if nil is passed the current nonce is obtained from the L1 node.
func (c *Client) Remove(ctx context.Context, id common.Hash) error
Removes a transaction. Should be called when a finalized transactions is not relevant any more.
func (c *Client) Result(ctx context.Context, id common.Hash) (MonitoredTxResult, error)
Result returns the current result of the transaction execution with all the details.
func (c *Client) ResultsByStatus(ctx context.Context, statuses []MonitoredTxStatus) ([]MonitoredTxResult, error)
ResultsByStatus returns all the results for all the monitored txs matching the provided statuses. If the statuses are empty, all the statuses are considered.
- Created: the tx was just added to the volatile storage
- Sent: transaction was sent to L1
- Failed: the tx was already mined and failed with an error that can't be recovered automatically, ex: the data in the tx is invalid and the tx gets reverted
- Mined: the tx was already mined and the receipt status is Successful.
- Safe: The tx was mined and is considered safe.
- Finalized: The tx was mined and is considered finalized.