0.0.36 SDK showing methods differently and getWalletTokenIdTransfers not working

Hey,

I recently updated the SDK but the methods are in different places to how they are shown in the documentation and in the recent youtube video showing the updates.

On the Moralis.Web3API object i get the following

This is different to the docs and the video.

the Moralis.Web3API.NFT.getWalletTokenIdTransfers() method throws an error for me although i think the arguments i’m putting in are correct

  const options = {
      token_address: "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      chain: "0x4",
      token_id: "1",
    };
    try {
      const transfers = await Moralis.Web3API.NFT.getWalletTokenIdTransfers(
        options
      );
      console.log(transfers);
    } catch (error) {
      console.log(error);
    }
  }

Any thoughts on what is happening?

Hi,
If you used npm I would suggest uninstall and install moralis again, it looks like you are running a different version from 0.0.36.

I have uninstalled and reinstalled and now the methods are in the correct place.

However, i still cant get the .getWalletTokenIdTransfers() method to work

I think that it has different parameter names in the new version and you may also have to update your moralis server to the latest version in order for some functions to work properly.
What if your current code that calls that function now?

I’ve updated the server and now it seems to work. Although it’s just returning an empty array. My understanding was that it would return the transfers of a given token id from a given contract. Effectively the same as the API endpoint /nft/{address}/{token_id}/transfers

Or am I wrong?

Thanks for the help dude

you may be right, this query will get all transfers:

curl -X 'GET' \
  'https://deep-index.moralis.io/api/v2/nft/0x5fed3F1E64DeF0D7ec2497211F83eeD8efDa7d1A/transfers?chain=rinkeby&format=decimal&order=block_number.DESC' \
  -H 'accept: application/json' \
  -H 'X-API-Key: API_KEY'

=>

{
  "total": 9,
  "page": 0,
  "page_size": 500,
  "result": [
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "9",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0xefa0ccb0774baf930b59038058029a1da585c8c6",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9171515",
      "block_timestamp": "2021-08-24T14:09:40.000Z",
      "block_hash": "0x4a1870dacf17b22fe866212e3044dca4c67ad6ed482b5c87cd8e0ec898e422d4",
      "transaction_hash": "0xb974888c663d1d9165d75dbb5d86ba051f0ca53aeae70d7a8bcc59c7acc14b9e",
      "transaction_type": "Single",
      "transaction_index": 3,
      "log_index": 4
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "10",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0xefa0ccb0774baf930b59038058029a1da585c8c6",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9171286",
      "block_timestamp": "2021-08-24T13:12:23.000Z",
      "block_hash": "0xf8d80d0c7165f36cc2e9d60e0f2797b5804fddde00ca507cc85f3091d2be8aaf",
      "transaction_hash": "0x4e777ca1f7d70079c911b46e4218cc67558bc927489cc0036031b07ec84978ee",
      "transaction_type": "Single",
      "transaction_index": 6,
      "log_index": 13
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "7",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154461",
      "block_timestamp": "2021-08-21T14:54:41.000Z",
      "block_hash": "0x10f244532a150dedd4e55d4d494cdcb77ecd36dbda143ccd8a97e19fca25765d",
      "transaction_hash": "0xbee1b0b9e98755fb629761a5b02d796bd37ad9aa8378f761dcf03fb44b29948f",
      "transaction_type": "Single",
      "transaction_index": 5,
      "log_index": 9
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "6",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154454",
      "block_timestamp": "2021-08-21T14:52:56.000Z",
      "block_hash": "0x1a7a7d006ede3084e3165e96f31621f98678c9051552e5bdfbb9e0c4c4e8412d",
      "transaction_hash": "0xcdcb649390091a6338ef6fa0cb3bfae6fa5c03fdc64353f051351d85781222d0",
      "transaction_type": "Single",
      "transaction_index": 10,
      "log_index": 20
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "5",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154300",
      "block_timestamp": "2021-08-21T14:14:22.000Z",
      "block_hash": "0x9acb2d9a6e9292b5ac972be6b99cce68a92eb088f8acff94842e610720d1a21c",
      "transaction_hash": "0xc4877d080b106d86343ba604f1401eb23d62117f7f1652b0c9a97513f7a76d11",
      "transaction_type": "Single",
      "transaction_index": 2,
      "log_index": 2
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "4",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154263",
      "block_timestamp": "2021-08-21T14:05:07.000Z",
      "block_hash": "0xe50dedcb456455c63913df0d3ef12b913d82b480c44779f1fc4e3061d27653cc",
      "transaction_hash": "0xbdc2e317c16cad55c345c1bd2f15b3219120b7f9a01dfb02f1bc426073b1de7a",
      "transaction_type": "Single",
      "transaction_index": 8,
      "log_index": 15
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "3",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154227",
      "block_timestamp": "2021-08-21T13:56:04.000Z",
      "block_hash": "0x1d57ce943303ec77ce3dda491e6f8f0f6df54beee968176bc298e85b0b98c1cc",
      "transaction_hash": "0x2dcc842eea1133ed8ff53a18f87e8cb33fd65aa92640788a63226497668ad944",
      "transaction_type": "Single",
      "transaction_index": 9,
      "log_index": 19
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "2",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154222",
      "block_timestamp": "2021-08-21T13:54:49.000Z",
      "block_hash": "0x542fa62120796f6f06884d144a5c198ce1f2b716fbd023a801d4b44c5c8b00a5",
      "transaction_hash": "0x7924b99e2959f027f44e9b43ec4fea9c24f41fe85e8dcc9e5a909403264d7230",
      "transaction_type": "Single",
      "transaction_index": 8,
      "log_index": 20
    },
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "1",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154197",
      "block_timestamp": "2021-08-21T13:48:32.000Z",
      "block_hash": "0xb0237aabc8872baec70548c9bc9abc1eeee926600baf5fdd70b281052dfe542c",
      "transaction_hash": "0xa3ece6340d1785edfa231ada6bde6c21bd9c83c1127c6b769ec42a1dc6daa86a",
      "transaction_type": "Single",
      "transaction_index": 10,
      "log_index": 11
    }
  ]
}

Right.

To just get transfers of a single token_id is /nft/{address}/{token_id}/transfers

Correct?

Right,
you could also run the query directly in Moralis interface to see the output:

curl -X 'GET' \
  'https://deep-index.moralis.io/api/v2/nft/0x5fed3F1E64DeF0D7ec2497211F83eeD8efDa7d1A/1/transfers?chain=rinkeby&format=decimal&order=block_number.DESC' \
  -H 'accept: application/json' \
  -H 'X-API-Key: API_KEY'

=>

{
  "total": 1,
  "page": 0,
  "page_size": 500,
  "result": [
    {
      "token_address": "0x5fed3f1e64def0d7ec2497211f83eed8efda7d1a",
      "token_id": "1",
      "from_address": "0x0000000000000000000000000000000000000000",
      "to_address": "0x666379e2aac65919ef222010053535354fefe39c",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "9154197",
      "block_timestamp": "2021-08-21T13:48:32.000Z",
      "block_hash": "0xb0237aabc8872baec70548c9bc9abc1eeee926600baf5fdd70b281052dfe542c",
      "transaction_hash": "0xa3ece6340d1785edfa231ada6bde6c21bd9c83c1127c6b769ec42a1dc6daa86a",
      "transaction_type": "Single",
      "transaction_index": 10,
      "log_index": 11
    }
  ]
}

Yes cool.

Is that endpoint and the getWalletTokenIdTransfers() method supposed to give the same results? Or are they different queries?

In theory I guess that they should give the same results, it looks like getContractNFTTransfers doesn’t work either for your contract address.

Hi @highrankin

SDK Web3API methods use the same endpoints as Web3 API from admin panel.

So, they will provide you the same information

@highrankin

We need to check getContractNFTTransfers looks like it works incorrectly

Hey @highrankin

Issue with getContractNFTTransfers was fiex on new server version 0.0.251
Please update your server :man_mechanic:

Now Moralis.Web3API.token.getContractNFTTransfers is the same as ​/nft​/{address}​/transfers

Let me know how it will work for you :mage: