Class CostEstimator

Class used for estimating the TX cost on the target chain. It makes use of substrates ts.estimateFee() method to estimate the cost of the TX. It is also a producer, able to trigger the re-evaluation of a given SFX. Currently, this is triggered every 30s

Hierarchy

  • CostEstimator

Constructors

Properties

trackingMap: Map<string, Estimate> = ...

Map containg the estimates for each SFX

Methods

  • returns the transaction cost of a specific side effect in native asset

    Parameters

    • tx: SubmittableExtrinsic

      of the SFX on target

    Returns Promise<number>

    the cost of the SFX in native asset

  • adds a sfx to tracking list and returns an observable that emits the transaction cost in native asset

    Parameters

    • sfxId: string
    • tx: SubmittableExtrinsic

      of the SFX on target

    Returns Promise<BehaviorSubject<number>>

Generated using TypeDoc