https://github.com/0xpolygon/zkevm-ethtx-manager
zkevm-ethtx-manager
https://github.com/0xpolygon/zkevm-ethtx-manager
Last synced: about 1 year ago
JSON representation
zkevm-ethtx-manager
- Host: GitHub
- URL: https://github.com/0xpolygon/zkevm-ethtx-manager
- Owner: 0xPolygon
- License: other
- Created: 2024-01-05T00:07:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T09:32:06.000Z (almost 2 years ago)
- Last Synced: 2024-08-29T10:29:21.994Z (almost 2 years ago)
- Language: Go
- Size: 437 KB
- Stars: 2
- Watchers: 10
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zkevm-ethtx-manager
Stateless manager to send transactions to L1.
## Main Funtions
### Add Transaction
`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.
### Remove Transaction
`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.
### Get Transaction Status
`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.
### Get All Transactions Status
`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.
### Transactions statuses
- **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.