PendingTransactionTracker

PendingTransactionTracker

Event emitter utility class for tracking the transactions as they
go from a pending state to a confirmed (mined in a block) state

As well as continues broadcast while in the pending state

Constructor

new PendingTransactionTracker(config)

Source:
Parameters:
Name Type Description
config object

non optional configuration object consists of:

Properties
Name Type Description
provider Object

A network provider.

nonceTracker Object

see nonce tracker

getPendingTransactions function

a function for getting an array of transactions,

publishTransaction function

a async function for publishing raw transactions,

Methods

(async) _checkIfNonceIsTaken(txMeta) → {boolean}

Source:

checks to see if a confirmed txMeta has the same nonce

Parameters:
Name Type Description
txMeta Object

txMeta object

Returns:
Type
boolean

(async) _checkPendingTx(txMeta)

Source:

Ask the network for the transaction to see if it has been include in a block

Parameters:
Name Type Description
txMeta Object

the txMeta object

Fires:
  • tx:failed
  • tx:confirmed
  • tx:warning

(async) _resubmitTx(txMeta, latestBlockNumber) → {string}

Source:

resubmits the individual txMeta used in resubmitPendingTxs

Parameters:
Name Type Description
txMeta Object

txMeta object

latestBlockNumber string

hex string for the latest block number

Fires:
  • tx:retry
Returns:

txHash

Type
string

resubmitPendingTxs(block)

Source:

Will resubmit any transactions who have not been confirmed in a block

Parameters:
Name Type Description
block object

a block object

Fires:
  • tx:warning

(async) updatePendingTxs()

Source:

checks the network for signed txs and releases the nonce global lock if it is