Constructor for the PriorityFeeCalculator class.
The current time in milliseconds.
The duration for how long to stay in triggered state before resetting. Default value is 10 seconds.
Calculates the compute unit price to use based on the desired additional fee to pay and the compute unit limit.
the compute unit price to use, in micro lamports
desired CU to use
desired additional fee to pay, in micro lamports
This method returns a transaction instruction list that sets the compute limit on the ComputeBudget program.
An array of transaction instructions.
The maximum number of compute units that can be used by the transaction.
This method generates a list of transaction instructions for the ComputeBudget program, and includes a priority fee if it's required
An array of transaction instructions.
The maximum number of compute units that can be used by the transaction.
A boolean indicating whether to include a priority fee in the transaction, this should be from this.updatePriorityFee()
or this.priorityFeeTriggered
.
The additional fee to be paid, in micro lamports, the actual price will be calculated.
Update the priority fee state based on the current time and the current timeout count.
true if priority fee should be included in the next transaction
current time in milliseconds
Generated using TypeDoc
This class determines whether a priority fee needs to be included in a transaction based on a recent history of timed out transactions.