estimateComputeUnitLimitFactory
Returns a function that estimates the compute units consumed by a transaction message by simulating it.
The estimator sets the compute unit limit to the maximum (1,400,000) before simulating, so the simulation does not fail due to compute unit exhaustion. For blockhash-lifetime transactions, the RPC is asked to replace the blockhash during simulation, so any blockhash value will work. For durable nonce transactions, the actual nonce value is used.
Parameters
| Parameter | Type | Description |
|---|---|---|
factoryConfig | EstimateComputeUnitLimitFactoryConfig | An object containing the RPC instance to use for simulation. |
Returns
EstimateComputeUnitLimitFunction
A function that accepts a transaction message and returns the estimated compute units.