MoralisWeb3 / issue-tracker

25 stars 7 forks source link

Wrong amount value in result of getTokenIdMetadata for ERC-1155 #147

Open AlexanderPodlesniyQs opened 2 years ago

AlexanderPodlesniyQs commented 2 years ago

The following request:

Web3Api.token.getTokenIdMetadata({
  chain: 'mainnet',
  address: "0x92239fe0F4A8efB5cF4A3b3370a3212561585874",
  token_id: "30303918488147675524746157622421434662120376452804653719934145608274626872327"
})

returns amount = 1. Full response:

{
  token_address: '0x92239fe0f4a8efb5cf4a3b3370a3212561585874',
  token_id: '30303918488147675524746157622421434662120376452804653719934145608274626872327',
  block_number_minted: '14195073',
  owner_of: '0x6d70faa384151f3bcfa2d8abdb4e453158936077',
  block_number: '14484221',
  amount: '1',
  contract_type: 'ERC1155',
  name: 'The Skull Collection by Amy Karle',
  symbol: null,
  token_uri: 'https://api.keevowallet.com/nft/92239fe0f4a8efb5cf4a3b3370a3212561585874/42ff68f8763069a1db9c41bc21017359f8dd7b401d930a7719a0185a94b60407/meta',
  metadata: '{"image":"https://api.keevowallet.com/nft/media/42ff68f8763069a1db9c41bc21017359f8dd7b401d930a7719a0185a94b60407","name":"Transmutation","description":"“Transmutation” by Amy Karle, 2022. Limited Edition of 100 in The Skull Collection (20 Collector’s Editions available in Genesis Drop, remainder held in Artist Reserve)."}',    
  synced_at: '2022-02-13T02:32:55.636Z',
  is_valid: 1,
  syncing: 2,
  frozen: 0
}

The request:

Web3Api.token.getAllTokenIds({
  chain: 'mainnet',
  address: "0x92239fe0F4A8efB5cF4A3b3370a3212561585874"
})

returns correct value of amount = 100. Full response (after filtering the result by token id= 30303918488147675524746157622421434662120376452804653719934145608274626872327):

{
  token_address: '0x92239fe0f4a8efb5cf4a3b3370a3212561585874',
  token_id: '30303918488147675524746157622421434662120376452804653719934145608274626872327',
  amount: '100',
  contract_type: 'ERC1155',
  name: 'The Skull Collection by Amy Karle',
  symbol: null,
  token_uri: 'https://api.keevowallet.com/nft/92239fe0f4a8efb5cf4a3b3370a3212561585874/42ff68f8763069a1db9c41bc21017359f8dd7b401d930a7719a0185a94b60407/meta',
  metadata: '{"image":"https://api.keevowallet.com/nft/media/42ff68f8763069a1db9c41bc21017359f8dd7b401d930a7719a0185a94b60407","name":"Transmutation","description":"“Transmutation” by Amy Karle, 2022. Limited Edition of 100 in The Skull Collection (20 Collector’s Editions available in Genesis Drop, remainder held in Artist Reserve)."}',      synced_at: '2022-02-13T02:32:55.636Z'
}

Are these amount fields in responses of those two requests (getTokenIdMetadata, getAllTokenIds) have the same meaning? If so there is a bug (incorrect amount value in getTokenIdMetadata request). If not what meaning has amount field in the response of getTokenIdMetadata?