Skip to content

Query CyberID owner by name

GraphQL

request example

query {
  cyberIdByName(name: "pengdeng.cyber") {
    tokenId
    name
    owner {
      address
    }
  }
}

response example

{
  "data": {
    "cyberIdByName": {
      "tokenId": "85399087058221196933735331368181146816035410356131591160153355702122418658771",
      "name": "pengdeng.cyber",
      "owner": {
        "address": "0xD9c208dB8d08365916C35473b97A390dDAA551B2"
      }
    }
  }
}

ON CHAIN

// remove the `.cyber` suffix to get the tokenId
uint256 tokenId = getTokenId("pengdeng");
address owner = ownerOf(tokenId);