2

我正在尝试使用erdpy在测试网 Maiar Exchange 上查找 EGLD-MEX 对的地址。

我正在使用这个电话:

erdpy --verbose contract query erd1qqqqqqqqqqqqqpgqum3tp4paqxt3snyfj3a5qj37tr9umv970n4s0kv06c --proxy https://testnet-gateway.elrond.com --function=getPair --arguments 0x5745474C442D663634336438 0x4D45582D633735316436

在哪里

erd1qqqqqqqqqqqqqpgqum3tp4paqxt3snyfj3a5qj37tr9umv970n4s0kv06c是路由器智能合约在测试网上的地址。我在https://testnet.maiar.exchange/中执行交换时发现了它,如图所示 在显示路由器智能合约地址的交易所执行交换时的 UI

0x5745474C442D663634336438是十六进制的 WEGLD-f643d8

0x4D45582D633735316436是十六进制的 MEX-c751d6

此调用的响应为空。

我做错了什么?

4

1 回答 1

1

您使用的地址不是您假设的路由器地址,而是该对本身的地址。

您还可以通过 graphql api 轻松检查。 https://testnet-exchange-graph.elrond.com/graphql

使用以下查询:

{factory{address}, pairs{address, firstToken{identifier}, secondToken{identifier}}}

您将收到以下输出:

{
  "data": {
    "factory": {
      "address": "erd1qqqqqqqqqqqqqpgq4axqc749vuqr27snr8d8qgvlmz44chsr0n4sm4a72g"
    },
    "pairs": [
      {
        "address": "erd1qqqqqqqqqqqqqpgqum3tp4paqxt3snyfj3a5qj37tr9umv970n4s0kv06c",
        "firstToken": {
          "identifier": "WEGLD-f643d8"
        },
        "secondToken": {
          "identifier": "MEX-c751d6"
        }
      },
      {
        "address": "erd1qqqqqqqqqqqqqpgqmzjpcyra47d0k8xualwcs6k2gzkdrdap0n4sdj0nu6",
        "firstToken": {
          "identifier": "WEGLD-f643d8"
        },
        "secondToken": {
          "identifier": "USDC-72a225"
        }
      },
      {
        "address": "erd1qqqqqqqqqqqqqpgq3cpwrvmextk986e6z6akeewq8feukuj90n4sf2aa2n",
        "firstToken": {
          "identifier": "WEGLD-f643d8"
        },
        "secondToken": {
          "identifier": "RIDE-ae50f0"
        }
      }
    ]
  }
}

工厂地址是代理,地址对应该是不言自明的。

于 2021-12-24T14:23:27.550 回答