Examples of use :

Estimate a transfer operation :

// Assuming that provider and signer are already configured...

const amount = 2;
const address = 'mv1UrqbBFBXnEdHnvSrMpt2BQnZzFMA9HQnc';

// Estimate gasLimit, storageLimit and fees for a transfer operation
const est = await Tezos.estimate.transfer({ to: address, amount: amount })
console.log(est.burnFeeMumav, est.gasLimit, est.minimalFeeMumav, est.storageLimit,
est.suggestedFeeMumav, est.totalCost, est.usingBaseFeeMumav)

Estimate a contract origination :

// generic.json is referring to a Michelson Smart Contract

const genericMultisigJSON = require('./generic.json')
const est = await Tezos.estimate.originate({
code: genericMultisigJSON,
storage: {
stored_counter: 0,
threshold: 1,
keys: ['edpkuLxx9PQD8fZ45eUzrK3BhfDZJHhBuK4Zi49DcEGANwd2rpX82t']
}
})
console.log(est.burnFeeMumav, est.gasLimit, est.minimalFeeMumav, est.storageLimit,
est.suggestedFeeMumav, est.totalCost, est.usingBaseFeeMumav)

Constructors

  • Parameters

    • _milligasLimit: string | number
    • _storageLimit: string | number
    • opSize: string | number
    • minimalFeePerStorageByteMumav: string | number
    • baseFeeMumav: string | number = MINIMAL_FEE_MUMAV

      Description

      Base fee in mumav (1 mumav = 1e10−6 tez)

    Returns Estimate

Properties

opSize: string | number

Accessors

  • get consumedMilligas(): number
  • Returns number

    Description

    Since Delphinet, consumed gas is provided in milligas for more precision. This function returns an estimation of the gas that operation will consume in milligas.

Methods