Skip to content

Add runtime api DuniterAccountApi_estimate_costto estimate net tx cost for the end user

This MR adds a runtime API DuniterAccountApi_estimate_cost(tx) that estimates transaction fees and quota refunds. It returns an object with three fields:

    // The estimated effective cost for the user (fees - refund)
    cost: Balance,
    // The estimated amount of fees for the extrinsic
    fees: Balance,
    // The estimated amount of refund from quota
    refund: Balance,

For reviewers

The implementation introduces a new trait, GetSigner, to extract the signer from the transaction. Substrate doesn’t provide a way to retrieve the signer without verifying the signature via the Checkable trait. To avoid unnecessary computation on the node side, this runtime API skips signature verification.

Closes #308 (closed)

Merge request reports

Loading