【问题标题】:How can I get the wallet address for a given herotag?如何获取给定 herotag 的钱包地址?
【发布时间】:2021-09-23 12:14:30
【问题描述】:

如果我想获取给定钱包地址的 herotag,我可以简单地调用以下端点:

https://api.elrond.com/accounts/erd1hw78kxyj353x52hmmq6dzxgexynwt4m29q2uvpq6xdm90z3halvsl7cn6g

我得到:

{
   "address":"erd1hw78kxyj353x52hmmq6dzxgexynwt4m29q2uvpq6xdm90z3halvsl7cn6g",
   "nonce":4,
   "balance":"0",
   "rootHash":"QU6o17Qw4KUPnpU6e6QbEuvKUTA8SPy52QFseslWsG4=",
   "txCount":4,
   "username":"event.elrond",
   "shard":1
}

我在哪里看到username

但现在我想获取给定 herotag 的钱包地址。

是否有任何 API 端点可用于此目的?

【问题讨论】:

    标签: blockchain elrond


    【解决方案1】:

    使用 API

    https://api.elrond.com/usernames/<herotag>
    

    例如:

    https://api.elrond.com/usernames/event

    重定向到

    https://api.elrond.com/accounts/erd1hw78kxyj353x52hmmq6dzxgexynwt4m29q2uvpq6xdm90z3halvsl7cn6g

    然后返回

    {
      "address": "erd1hw78kxyj353x52hmmq6dzxgexynwt4m29q2uvpq6xdm90z3halvsl7cn6g",
      "nonce": 7,
      "balance": "254914476000000000",
      "rootHash": "QU6o17Qw4KUPnpU6e6QbEuvKUTA8SPy52QFseslWsG4=",
      "txCount": 9,
      "scrCount": 12,
      "username": "event.elrond",
      "shard": 1,
      "developerReward": "0"
    }
    

    使用erdpy

    erdpy dns resolve <herotag>.elrond --proxy=https://gateway.elrond.com
    

    &lt;herotag&gt; 应替换为其值。

    例如:

    erdpy dns resolve event.elrond --proxy=https://gateway.elrond.com
    

    输出

    erd1hw78kxyj353x52hmmq6dzxgexynwt4m29q2uvpq6xdm90z3halvsl7cn6g
    

    详情

    $ erdpy --version
    erdpy 1.0.12
    

    【讨论】:

      猜你喜欢
      • 2022-11-15
      • 2022-01-08
      • 2022-06-30
      • 2022-05-31
      • 2022-07-20
      • 2021-09-06
      • 2021-10-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多