Skip to main content
Version: 17.5.0

Estimate Provider

Taquito's estimate method can be used to estimate fees, gas, and storage associated with an operation.

note

Our estimation of fee, gasLimit and storageLimit is based on the RPC call response to simulate_operation plus a small buffer. The context and volume at the time of simulate_operation might differ from preapply/operations and injection/operation, potentially causing errors like fees_too_low, storage_exhausted.operation and gas_exhausted.operation.

The Estimate objectโ€‹

The Estimate object has the following properties:

[burnFeeMumav]: The number of Mumav that will be burned for the storage of the operation. Returns a number.

[gasLimit]: The limit on the amount of gas a given operation can consume. Returns a number.

[minimalFeeMumav]: Minimum fees for the operation according to baker defaults. Returns a number.

[storageLimit]: The limit on the amount of storage an operation can use. Returns a number.

[suggestedFeeMumav:]: The suggested fee for the operation includes minimal fees and a small buffer. Returns a number.

[totalCost]: The sum of minimalFeeMumav + burnFeeMumav. Returns a number.

[usingBaseFeeMumav]: Fees according to your specified base fee will ensure that at least minimum fees are used.

Estimate a transfer operationโ€‹

The following example shows an estimate of the fees associated with transferring 2แน to mv1UrqbBFBXnEdHnvSrMpt2BQnZzFMA9HQnc address. The configuration of the signer is to use a throw-away private key for demonstration purposes.

Live Editor
Result

Estimate a smart contract callโ€‹

This example will demonstrate how to estimate the fees related to calling a smart contract.

We have updated the estimate provider to have a contractCall() method. The contractCall() member method can now be used to estimate contract calls as such:

Live Editor
Result

Estimate a contract originationโ€‹

In this example, we will use the estimate method of Taquito on a contract origination. The genericMultisigJSONfile variable contains a Michelson Smart Contract.

Live Editor
Result

Provide detailed feedback