test-pkg-ngn
Version:
A library containing helper functions that facilitate scripting for keepers of the Keep3r Network
17 lines (16 loc) • 1.12 kB
TypeScript
import { BundleBurstGroup, FormatBundlesTxsToType2Props } from '@types';
/**
* @notice Helper function to format the transactions on every bundle to type 2.
*
* @dev This function will dynamically calculate the maximum possible baseFee in N blocks ahead determined with the blocksAhead property
* and then calculate the maxFeePerGas by adding the maxBaseFee to the provided priority fee.
*
* @param bundlesTxs An array of bundles to format to type 2.
* @param block The current block. This is used to get the current baseFee, which is required for the calculation of the maxBaseFee.
* @param priorityFeeInWei The desired priority fee in wei to use as maxPriorityFeePerGas.
* @param blocksAhead How many blocks ahead to calculate the maxFeePerGas for. This parameter usually coincides with the burst size we use
* for our bundles, as we want to ensure our calculation of the maxBaseFee is correct.
*
* @return An array containing all the formatted bundles.
*/
export declare function formatBundlesTxsToType2(props: FormatBundlesTxsToType2Props): BundleBurstGroup[];