0

I am interested in getting the transaction history for an ERC-1155 token by specifying the contract address and the tokenID. For example, saving all of the transactions from this token:

https://polygonscan.com/nft/0x4d97dcd97ec945f40cf65f87097ace5ea0476045/60409519652189793219981471355062948936772693999500608409437288239043585098237

I have tried using the Polygon Scan API with a call like this:

curl -X 'GET' "https://api.polygonscan.com/api?module=account&action=token1155tx&contractaddress=0x4d97dcd97ec945f40cf65f87097ace5ea0476045&address=60409519652189793219981471355062948936772693999500608409437288239043585098237&page=1&offset=100&startblock=0&endblock=99999999&sort=asc&apikey=<MY API KEY>" 

But, it seems the address parameter is not the right one to specify. How can I accomplish my goal? I'm open to using other API/methods if going through api.polygonscan.com is not possible. Thank you!

1 Answer 1

1

You're using api which Returns the list of ERC-1155 ( Multi Token Standard ) tokens transferred by an address, with optional filtering by token contract.

It means address will be a wallet address which related to event transfer of NFT belongs to contractAddress. And you're passing 60409519652189793219981471355062948936772693999500608409437288239043585098237 which means tokenId of NFT. It's wrong value. You can't use this API to get transfer history on

Because tokenId wasn't marked index in event TransferSingle, then scanning history of a NFT tokenId seems hard by yourself. Some third party provides those infos, you could try Alchemy for instead: https://docs.alchemy.com/docs/how-to-get-the-transfer-history-of-an-nft

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.