【问题标题】:Find Tron Energy Estimate Before transaction?在交易前查找 Tron Energy Estimate?
【发布时间】:2023-02-14 21:28:30
【问题描述】:

我想在 tron 区块链交易前计算能量,所以我们可以在应用程序交易前向最终用户显示交易费用。但我无法为此找到任何文档或任何函数或任何 api。请帮助我。

【问题讨论】:

    标签: tron


    【解决方案1】:

    我希望这还不算太晚 :)

    我认为该文档应满足您的需求:

    https://tronprotocol.github.io/documentation-en/mechanism-algorithm/resource/#2-how-to-set-fee-limit-caller-must-read

    Tron GET 端点:https://api.trongrid.io/v1/accounts/{contract}/transactions?only_confirmed=true 你可以添加 &limit= 你首选的停止点 [type=int 例如 200]。

    从返回的数据中,您可以获得每个数据的 energy_usage_total,然后对其进行平均。

    这可以深入了解您请求的 x 笔最新交易所消耗的能源。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-22
      • 1970-01-01
      • 1970-01-01
      • 2014-04-12
      • 2013-07-20
      • 2023-02-13
      • 1970-01-01
      • 2010-11-05
      相关资源
      最近更新 更多