Versions in this module Expand all Collapse all v1 v1.2.1 Mar 17, 2022 v1.2.1-rc0 Mar 15, 2022 v1.2.0 Mar 3, 2022 Changes in this version + const EthTxAttemptBroadcast + const EthTxAttemptInProgress + const EthTxAttemptInsufficientEth + const EthTxConfirmed + const EthTxConfirmedMissingReceipt + const EthTxFatalError + const EthTxInProgress + const EthTxUnconfirmed + const EthTxUnstarted + const InFlightTransactionRecheckInterval + const TransmitCheckTimeout + const TransmitCheckerTypeSimulate + const TransmitCheckerTypeVRFV1 + const TransmitCheckerTypeVRFV2 + var ErrCouldNotGetReceipt = "could not get receipt" + var Max256BitUInt = big.NewInt(0).Exp(big.NewInt(2), big.NewInt(256), nil) + func CheckEthTxQueueCapacity(q pg.Queryer, fromAddress common.Address, maxQueuedTransactions uint64, ...) (err error) + func CountUnconfirmedTransactions(q pg.Q, fromAddress common.Address, chainID big.Int) (count uint32, err error) + func CountUnstartedTransactions(q pg.Q, fromAddress common.Address, chainID big.Int) (count uint32, err error) + func GetNextNonce(q pg.Q, address gethCommon.Address, chainID *big.Int) (nonce int64, err error) + func IncrementNextNonce(q pg.Queryer, address gethCommon.Address, chainID *big.Int, currentNonce int64) error + type BulletproofTxManager struct + func NewBulletproofTxManager(db *sqlx.DB, ethClient evmclient.Client, cfg Config, keyStore KeyStore, ...) *BulletproofTxManager + func (b *BulletproofTxManager) Close() (merr error) + func (b *BulletproofTxManager) CreateEthTransaction(newTx NewTx, qs ...pg.QOpt) (etx EthTx, err error) + func (b *BulletproofTxManager) GetGasEstimator() gas.Estimator + func (b *BulletproofTxManager) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) + func (b *BulletproofTxManager) RegisterResumeCallback(fn ResumeCallback) + func (b *BulletproofTxManager) SendEther(chainID *big.Int, from, to common.Address, value assets.Eth, gasLimit uint64) (etx EthTx, err error) + func (b *BulletproofTxManager) Start() (merr error) + func (b *BulletproofTxManager) Trigger(addr common.Address) + type ChainKeyStore struct + func NewChainKeyStore(chainID big.Int, config Config, keystore KeyStore) ChainKeyStore + func (c *ChainKeyStore) NewDynamicFeeAttempt(etx EthTx, fee gas.DynamicFee, gasLimit uint64) (attempt EthTxAttempt, err error) + func (c *ChainKeyStore) NewLegacyAttempt(etx EthTx, gasPrice *big.Int, gasLimit uint64) (attempt EthTxAttempt, err error) + func (c *ChainKeyStore) SignTx(address common.Address, tx *gethTypes.Transaction) (common.Hash, []byte, error) + type CheckerFactory struct + Client evmclient.Client + func (c *CheckerFactory) BuildChecker(spec TransmitCheckerSpec) (TransmitChecker, error) + type Config interface + EthTxReaperInterval func() time.Duration + EthTxReaperThreshold func() time.Duration + EthTxResendAfterThreshold func() time.Duration + EvmGasBumpThreshold func() uint64 + EvmGasBumpTxDepth func() uint16 + EvmGasLimitDefault func() uint64 + EvmMaxInFlightTransactions func() uint32 + EvmMaxQueuedTransactions func() uint64 + EvmNonceAutoSync func() bool + EvmRPCDefaultBatchSize func() uint32 + KeySpecificMaxGasPriceWei func(addr common.Address) *big.Int + LogSQL func() bool + TriggerFallbackDBPollInterval func() time.Duration + type DropOldestStrategy struct + func NewDropOldestStrategy(subject uuid.UUID, queueSize uint32) DropOldestStrategy + func (s DropOldestStrategy) PruneQueue(q pg.Queryer) (n int64, err error) + func (s DropOldestStrategy) Subject() uuid.NullUUID + type EthBroadcaster struct + func NewEthBroadcaster(db *sqlx.DB, ethClient evmclient.Client, config Config, keystore KeyStore, ...) *EthBroadcaster + func (eb *EthBroadcaster) Close() error + func (eb *EthBroadcaster) ProcessUnstartedEthTxs(ctx context.Context, keyState ethkey.State) error + func (eb *EthBroadcaster) Start() error + func (eb *EthBroadcaster) Trigger(addr gethCommon.Address) + type EthConfirmer struct + func NewEthConfirmer(db *sqlx.DB, ethClient evmclient.Client, config Config, keystore KeyStore, ...) *EthConfirmer + func (ec *EthConfirmer) CheckForReceipts(ctx context.Context, blockNum int64) error + func (ec *EthConfirmer) Close() error + func (ec *EthConfirmer) EnsureConfirmedTransactionsInLongestChain(ctx context.Context, head *evmtypes.Head) error + func (ec *EthConfirmer) ForceRebroadcast(beginningNonce uint, endingNonce uint, gasPriceWei uint64, ...) error + func (ec *EthConfirmer) ProcessHead(ctx context.Context, head *evmtypes.Head) error + func (ec *EthConfirmer) RebroadcastWhereNecessary(ctx context.Context, blockHeight int64) error + func (ec *EthConfirmer) ResumePendingTaskRuns(ctx context.Context, head *evmtypes.Head) error + func (ec *EthConfirmer) SetBroadcastBeforeBlockNum(blockNum int64) error + func (ec *EthConfirmer) Start() error + type EthReceipt struct + BlockHash common.Hash + BlockNumber int64 + CreatedAt time.Time + ID int64 + Receipt []byte + TransactionIndex uint + TxHash common.Hash + type EthResender struct + func NewEthResender(lggr logger.Logger, db *sqlx.DB, ethClient evmclient.Client, ...) *EthResender + func (er *EthResender) Start() + func (er *EthResender) Stop() + type EthTx struct + AccessList NullableEIP2930AccessList + BroadcastAt *time.Time + CreatedAt time.Time + EVMChainID utils.Big + EncodedPayload []byte + Error null.String + EthTxAttempts []EthTxAttempt + FromAddress common.Address + GasLimit uint64 + ID int64 + Meta *datatypes.JSON + MinConfirmations cnull.Uint32 + Nonce *int64 + PipelineTaskRunID uuid.NullUUID + State EthTxState + Subject uuid.NullUUID + ToAddress common.Address + TransmitChecker *datatypes.JSON + Value assets.Eth + func FindEthTxsRequiringGasBump(ctx context.Context, q pg.Q, lggr logger.Logger, address gethCommon.Address, ...) (etxs []*EthTx, err error) + func FindEthTxsRequiringRebroadcast(ctx context.Context, q pg.Q, lggr logger.Logger, address gethCommon.Address, ...) (etxs []*EthTx, err error) + func FindEthTxsRequiringResubmissionDueToInsufficientEth(ctx context.Context, q pg.Q, lggr logger.Logger, address gethCommon.Address, ...) (etxs []*EthTx, err error) + func (e EthTx) GetChecker() (TransmitCheckerSpec, error) + func (e EthTx) GetError() error + func (e EthTx) GetID() string + func (e EthTx) GetMeta() (*EthTxMeta, error) + type EthTxAttempt struct + BroadcastBeforeBlockNum *int64 + ChainSpecificGasLimit uint64 + CreatedAt time.Time + EthReceipts []EthReceipt + EthTx EthTx + EthTxID int64 + GasFeeCap *utils.Big + GasPrice *utils.Big + GasTipCap *utils.Big + Hash common.Hash + ID int64 + SignedRawTx []byte + State EthTxAttemptState + TxType int + func FindEthTxesRequiringResend(db *sqlx.DB, olderThan time.Time, maxInFlightTransactions uint32, ...) (attempts []EthTxAttempt, err error) + func (a EthTxAttempt) DynamicFee() gas.DynamicFee + func (a EthTxAttempt) GetSignedTx() (*types.Transaction, error) + type EthTxAttemptState string + type EthTxMeta struct + JobID int32 + MaxLink string + RequestID common.Hash + RequestTxHash common.Hash + SubID uint64 + type EthTxState string + type KeyStore interface + GetStatesForChain func(chainID *big.Int) ([]ethkey.State, error) + SignTx func(fromAddress common.Address, tx *gethTypes.Transaction, chainID *big.Int) (*gethTypes.Transaction, error) + SubscribeToKeyChanges func() (ch chan struct{}, unsub func()) + type NSinserttx struct + Attempt EthTxAttempt + Etx EthTx + type NewTx struct + Checker TransmitCheckerSpec + EncodedPayload []byte + FromAddress common.Address + GasLimit uint64 + Meta *EthTxMeta + MinConfirmations null.Uint32 + PipelineTaskRunID *uuid.UUID + Strategy TxStrategy + ToAddress common.Address + type NonceSyncer struct + func NewNonceSyncer(db *sqlx.DB, lggr logger.Logger, cfg pg.LogConfig, ethClient evmclient.Client) *NonceSyncer + func (s NonceSyncer) SyncAll(ctx context.Context, keyStates []ethkey.State) (merr error) + type NullTxManager struct + ErrMsg string + func (n *NullTxManager) Close() error + func (n *NullTxManager) CreateEthTransaction(NewTx, ...pg.QOpt) (etx EthTx, err error) + func (n *NullTxManager) GetGasEstimator() gas.Estimator + func (n *NullTxManager) Healthy() error + func (n *NullTxManager) OnNewLongestChain(context.Context, *evmtypes.Head) + func (n *NullTxManager) Ready() error + func (n *NullTxManager) RegisterResumeCallback(fn ResumeCallback) + func (n *NullTxManager) SendEther(chainID *big.Int, from, to common.Address, value assets.Eth, gasLimit uint64) (etx EthTx, err error) + func (n *NullTxManager) Start() error + func (n *NullTxManager) Trigger(common.Address) + type NullableEIP2930AccessList struct + AccessList types.AccessList + Valid bool + func NullableEIP2930AccessListFrom(al types.AccessList) (n NullableEIP2930AccessList) + func (e *NullableEIP2930AccessList) Scan(value interface{}) error + func (e *NullableEIP2930AccessList) UnmarshalJSON(input []byte) error + func (e NullableEIP2930AccessList) MarshalJSON() ([]byte, error) + func (e NullableEIP2930AccessList) Value() (driver.Value, error) + type ORM interface + EthTransactions func(offset, limit int) ([]EthTx, int, error) + EthTransactionsWithAttempts func(offset, limit int) ([]EthTx, int, error) + EthTxAttempts func(offset, limit int) ([]EthTxAttempt, int, error) + FindEthTxAttempt func(hash common.Hash) (*EthTxAttempt, error) + FindEthTxAttemptsByEthTxIDs func(ids []int64) ([]EthTxAttempt, error) + FindEthTxByHash func(hash common.Hash) (*EthTx, error) + FindEthTxWithAttempts func(etxID int64) (etx EthTx, err error) + InsertEthReceipt func(receipt *EthReceipt) error + InsertEthTx func(etx *EthTx) error + InsertEthTxAttempt func(attempt *EthTxAttempt) error + func NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.LogConfig) ORM + type Reaper struct + func NewReaper(lggr logger.Logger, db *sqlx.DB, config ReaperConfig, chainID big.Int) *Reaper + func (r *Reaper) ReapEthTxes(headNum int64) error + func (r *Reaper) SetLatestBlockNum(latestBlockNum int64) + func (r *Reaper) Start() + func (r *Reaper) Stop() + type ReaperConfig interface + EthTxReaperInterval func() time.Duration + EthTxReaperThreshold func() time.Duration + EvmFinalityDepth func() uint32 + type ResumeCallback func(id uuid.UUID, result interface{}, err error) error + type SendEveryStrategy struct + func (SendEveryStrategy) PruneQueue(pg.Queryer) (int64, error) + func (SendEveryStrategy) Subject() uuid.NullUUID + type SimulateChecker struct + Client evmclient.Client + func (s *SimulateChecker) Check(ctx context.Context, l logger.Logger, tx EthTx, a EthTxAttempt) error + type TransmitChecker interface + Check func(ctx context.Context, l logger.Logger, tx EthTx, a EthTxAttempt) error + var NoChecker TransmitChecker = noChecker{} + type TransmitCheckerFactory interface + BuildChecker func(spec TransmitCheckerSpec) (TransmitChecker, error) + type TransmitCheckerSpec struct + CheckerType TransmitCheckerType + VRFCoordinatorAddress common.Address + type TransmitCheckerType string + type TxManager interface + CreateEthTransaction func(newTx NewTx, qopts ...pg.QOpt) (etx EthTx, err error) + GetGasEstimator func() gas.Estimator + RegisterResumeCallback func(fn ResumeCallback) + SendEther func(chainID *big.Int, from, to common.Address, value assets.Eth, gasLimit uint64) (etx EthTx, err error) + Trigger func(addr common.Address) + type TxStrategy interface + PruneQueue func(q pg.Queryer) (n int64, err error) + Subject func() uuid.NullUUID + func NewQueueingTxStrategy(subject uuid.UUID, queueSize uint32) (strategy TxStrategy) + func NewSendEveryStrategy() TxStrategy + type VRFV1Checker struct + Callbacks func(opts *bind.CallOpts, reqID [32]byte) (v1.Callbacks, error) + func (v *VRFV1Checker) Check(ctx context.Context, l logger.Logger, tx EthTx, _ EthTxAttempt) error + type VRFV2Checker struct + GetCommitment func(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) + func (v *VRFV2Checker) Check(ctx context.Context, l logger.Logger, tx EthTx, _ EthTxAttempt) error v1.1.0-solana-test Feb 17, 2022