gill

estimateAndUpdateProvisoryComputeUnitLimitFactory

function estimateAndUpdateProvisoryComputeUnitLimitFactory(estimateComputeUnitLimit): EstimateAndUpdateProvisoryComputeUnitLimitFactoryFunction;

Given a transaction message, if it does not have an explicit compute unit limit, estimates the compute unit limit and updates the transaction message with the estimated limit. Otherwise, returns the transaction message unchanged.

It requires a function that estimates the compute unit limit.

Example

const estimateAndUpdateCUs = estimateAndUpdateProvisoryComputeUnitLimitFactory(
    estimateComputeUnitLimitFactory({ rpc })
);
 
const transactionMessageWithCUs = await estimateAndUpdateCUs(transactionMessage);

Parameters

ParameterType
estimateComputeUnitLimitEstimateComputeUnitLimitFactoryFunction

Returns

EstimateAndUpdateProvisoryComputeUnitLimitFactoryFunction

See

estimateAndUpdateProvisoryComputeUnitLimitFactory

On this page