Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // FallbackGasTipCap 5 gwei in case the backend does not support eth_maxPriorityFeePerGas (no idea if/when this ever // happens..) FallbackGasTipCap = big.NewInt(5_000_000_000) // FallbackGasLimitMultiplier 1.20x gas limit multiplier. This is arbitrary but should be safe for most cases FallbackGasLimitMultiplier = 1.20 )
Functions ¶
func NoopSigner ¶
func NoopSigner(addr common.Address, tx *types.Transaction) (*types.Transaction, error)
Types ¶
type SimpleTxManager ¶
type SimpleTxManager struct {
// contains filtered or unexported fields
}
func NewSimpleTxManager ¶
func NewSimpleTxManager( wallet wallet.Wallet, client eth.Client, logger log.Logger, sender common.Address, ) *SimpleTxManager
NewSimpleTxManager creates a new simpleTxManager which can be used to send a transaction to smart contracts on the Ethereum node
func (*SimpleTxManager) GetNoSendTxOpts ¶
func (m *SimpleTxManager) GetNoSendTxOpts() (*bind.TransactOpts, error)
GetNoSendTxOpts This generates a noSend TransactOpts so that we can use this to generate the transaction without actually sending it
func (*SimpleTxManager) Send ¶
func (m *SimpleTxManager) Send(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)
Send is used to send a transaction to the Ethereum node. It takes an unsigned/signed transaction and then sends it to the Ethereum node. It also takes care of gas estimation and adds a buffer to the gas limit If you pass in a signed transaction it will ignore the signature and resign the transaction after adding the nonce and gas limit. To check out the whole flow on how this works, check out the README.md in this folder
func (*SimpleTxManager) WithGasLimitMultiplier ¶
func (m *SimpleTxManager) WithGasLimitMultiplier(multiplier float64) *SimpleTxManager
type TxManager ¶
type TxManager interface {
// Send is used to send a transaction
// It takes an unsigned transaction and then signs it before sending
// It also takes care of nonce management and gas estimation
Send(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)
// GetNoSendTxOpts This generates a noSend TransactOpts so that we can use
// this to generate the transaction without actually sending it
GetNoSendTxOpts() (*bind.TransactOpts, error)
}
