Skip to content

Type Alias: TransactionManagerConfig

type TransactionManagerConfig = {
  abis: Record<string, Abi>;
  baseFeePercentageMargin: bigint;
  blockTime: bigint;
  chainId: number;
  eip1559: EIP1559Parameters;
  finalizedTransactionPurgeTime: number;
  gasEstimator: GasEstimator;
  maxPriorityFeePerGas: bigint;
  metrics: {
     active: boolean;
     metricReaders: MetricReader[];
     port: number;
  };
  privateKey: Hex;
  retryPolicyManager: RetryPolicyManager;
  rpc: {
     allowDebug: boolean;
     blockInactivityTimeout: number;
     pollingInterval: number;
     retries: number;
     retryDelay: number;
     timeout: number;
     url: string;
  };
};

Defined in: packages/txm/lib/TransactionManager.ts:34

Properties

abis

abis: Record<string, Abi>;

Defined in: packages/txm/lib/TransactionManager.ts:106

The ABIs used by the TransactionManager. This is a record of aliases to ABIs. The aliases are used to reference the ABIs in the transactions.


baseFeePercentageMargin?

optional baseFeePercentageMargin: bigint;

Defined in: packages/txm/lib/TransactionManager.ts:94

Safety margin for transaction base fees, expressed as a percentage. For example, a 20% increase should be represented as 20n.

This is used to calculate the maximum fee per gas and safeguard from unanticipated or unpredictable gas price increases, in particular when the transaction cannot be included in the very next block.

If not provided, defaults to 20n (20% increase).


blockTime?

optional blockTime: bigint;

Defined in: packages/txm/lib/TransactionManager.ts:112

The expected interval (in seconds) for the creation of a new block on the blockchain. Defaults to 2 seconds.


chainId

chainId: number;

Defined in: packages/txm/lib/TransactionManager.ts:117

The chain ID of the blockchain.


eip1559?

optional eip1559: EIP1559Parameters;

Defined in: packages/txm/lib/TransactionManager.ts:83

Optional EIP-1559 parameters. If not provided, defaults to the OP stack's stock parameters.


finalizedTransactionPurgeTime?

optional finalizedTransactionPurgeTime: number;

Defined in: packages/txm/lib/TransactionManager.ts:124

The time (in milliseconds) after which finalized transactions are purged from the database. If finalizedTransactionPurgeTime is 0, finalized transactions are not purged from the database. Defaults to 2 minutes.


gasEstimator?

optional gasEstimator: GasEstimator;

Defined in: packages/txm/lib/TransactionManager.ts:131

The gas estimator to use for estimating the gas limit of a transaction. You can provide your own implementation to override the default one. Default: DefaultGasLimitEstimator


maxPriorityFeePerGas?

optional maxPriorityFeePerGas: bigint;

Defined in: packages/txm/lib/TransactionManager.ts:100

Optional maximum priority fee per gas. This is the maximum amount of wei per gas the transaction is willing to pay as a tip to miners. If not provided, defaults to 0n.


metrics?

optional metrics: {
  active: boolean;
  metricReaders: MetricReader[];
  port: number;
};

Defined in: packages/txm/lib/TransactionManager.ts:144

Transaction Manager metrics configuration.

active?

optional active: boolean;

Whether to enable metrics collection. Defaults to true.

metricReaders?

optional metricReaders: MetricReader[];

Custom metric readers to use instead of the default Prometheus reader. If provided, these readers will be used and the port setting will be ignored. If not provided, a default Prometheus reader will be configured using the specified port.

port?

optional port: number;

Port number for the default Prometheus metrics endpoint. The default metric reader is a Prometheus reader that exposes metrics via this endpoint. This setting is only used when custom metricReaders are not provided. Defaults to 9090.


privateKey

privateKey: Hex;

Defined in: packages/txm/lib/TransactionManager.ts:80

The private key of the account used for signing transactions.


retryPolicyManager?

optional retryPolicyManager: RetryPolicyManager;

Defined in: packages/txm/lib/TransactionManager.ts:139

The retry policy manager to use for retrying failed transactions. You can provide your own implementation to override the default one. This is used to determine if a transaction should be retried based on the receipt of the transaction when it reverts. Default: DefaultRetryPolicyManager


rpc

rpc: {
  allowDebug: boolean;
  blockInactivityTimeout: number;
  pollingInterval: number;
  retries: number;
  retryDelay: number;
  timeout: number;
  url: string;
};

Defined in: packages/txm/lib/TransactionManager.ts:38

The RPC node configuration

allowDebug?

optional allowDebug: boolean;

Enables debug methods on the RPC node. This is necessary for retrieving revert reasons for failed transactions and for increasing precision in managing transactions that fail due to out-of-gas errors Defaults to false.

blockInactivityTimeout?

optional blockInactivityTimeout: number;

The time without blocks before closing the connection to the RPC node and reconnecting. Defaults to 4000 milliseconds.

pollingInterval?

optional pollingInterval: number;

Specifies the polling interval in milliseconds. Defaults to 1/2 of the block time.

retries?

optional retries: number;

The number of retries for the RPC node. Defaults to 2.

retryDelay?

optional retryDelay: number;

The delay between retries. Defaults to 50 milliseconds.

timeout?

optional timeout: number;

The timeout for the RPC node. Defaults to 2000 milliseconds.

url

url: string;

The url of the RPC node. It can be a http or websocket url.