Taquito TypeDocs
    Preparing search index...

    Examples of use :

    Estimate a transfer operation :

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

    const amount = 2;
    const address = 'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY';

    // Estimate gasLimit, storageLimit and fees for a transfer operation
    const est = await Tezos.estimate.transfer({ to: address, amount: amount })
    console.log(est.burnFeeMutez, est.gasLimit, est.minimalFeeMutez, est.storageLimit,
    est.suggestedFeeMutez, est.totalCost, est.usingBaseFeeMutez)

    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.burnFeeMutez, est.gasLimit, est.minimalFeeMutez, est.storageLimit,
    est.suggestedFeeMutez, est.totalCost, est.usingBaseFeeMutez)

    Fee estimation keeps the same overall formula shape on Tezos L1 and on Tezos X / Tezlink: a fixed minimal fee plus byte and gas-price components. The important difference is that on Tezos X the byte fee and gas-price terms exposed by mempool/filter are material and may change over time, while on L1 they have historically been close to Taquito's long-standing defaults. Estimate therefore accepts fee parameters computed by the estimator instead of assuming L1 values internally.

    Index

    Constructors

    • Parameters

      • _milligasLimit: string | number
      • _storageLimit: string | number
      • opSize: string | number
      • minimalFeePerStorageByteMutez: string | number
      • baseFeeMutez: string | number = DEFAULT_FEE_PARAMS.minimalFeeMutez

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

      • feeParams: FeeParams = DEFAULT_FEE_PARAMS

      Returns Estimate

    Properties

    opSize: string | number

    Accessors

    • get consumedMilligas(): number

      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.

      Returns number

    Methods