How can I implement code that returns whether a token is in the ERC721 or ERC1155 standard, knowing both the contract address and the tokenId? What I tried is that I call a function that exists only on ERC1155 standard and if it fails then it's obviously an ERC721 token. But this is probably not the best solution. Any tips?
I have an implementation which doesn't rely on erc-165, but we get the code and check if certain function signature exists, check the implementation here: https://github.com/botfi-app/token-standard-detector