0

I;m trying to query a Cryptokitties token metadata from Etherscan and I need to give two values: _tokenId (uint256) and _preferredTransport (string).

What are possible value for _preferredTransport?

  • hello, do you finally find how to query kitty's metadata? – rocky802 May 11 at 7:51
  • Nope. But you can get some info through the getKitty query – Pm Rivière May 11 at 12:01
0

Looks like it's deprecated (no longer in use):

function tokenMetadata(uint256 _tokenId, string _preferredTransport) external view returns (string infoUrl) {
    require(erc721Metadata != address(0));
    bytes32[4] memory buffer;
    uint256 count;
    (buffer, count) = erc721Metadata.getMetadata(_tokenId, _preferredTransport);

    return _toString(buffer, count);
}

function getMetadata(uint256 _tokenId, string) public view returns (bytes32[4] buffer, uint256 count) {
    if (_tokenId == 1) {
        buffer[0] = "Hello World! :D";
        count = 15;
    } else if (_tokenId == 2) {
        buffer[0] = "I would definitely choose a medi";
        buffer[1] = "um length string.";
        count = 49;
    } else if (_tokenId == 3) {
        buffer[0] = "Lorem ipsum dolor sit amet, mi e";
        buffer[1] = "st accumsan dapibus augue lorem,";
        buffer[2] = " tristique vestibulum id, libero";
        buffer[3] = " suscipit varius sapien aliquam.";
        count = 128;
    }
}

As you can see, the 2nd input argument has no name, and is there for not in use.

| improve this answer | |
  • Thanks! — and now how would I request the metadata from Etherscan? as a value is required for preferredTransport – Pm Rivière Apr 23 at 16:38
  • @PmRivière: "not in use" means that you can pass whatever you want, and it will have no impact on the result! – goodvibration Apr 23 at 16:39
  • It looks like erc721Metadata is address(0), so tokenMetadata will fail no matter what. I think getKitty is the how you should get data about the token – flygoing Apr 23 at 17:04
  • @flygoing: Yes, it means that function tokenMetadata will always revert (until someone changes this currently null pointer). But you've asked a general question about a function which takes "_tokenId (uint256) and _preferredTransport (string)" (without specifying anything beyond that BTW, not even the contract address which I had to look up myself). And I have answered that question. If you have another question about another function, then you should post it separately, and accept this answer if you feel it has answered the your question. Otherwise, please explain what else is missing. – goodvibration Apr 23 at 17:10
  • @goodvibration thanks for the answer and sorry I didn't produce the contract address – Pm Rivière Apr 24 at 3:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.