CRYPTO NEWS

How to get the total value of a address including tokens other than ETH

Is there a way to get the total value of a ETH address, not only its ETH value? I know Etherscan shows this on their website but I don’t know if there is an API where I can grab this data, preferably through python.

enter image description here

For reference I can see the token value and ETH value and adding those should give the total wallet value. How can I do this using an API?

ERC721 How to set TokenUri from mint function argument

I use pragma solidity ^0.8.0; and contract MyERC721 is Ownable, ERC721URIStorage I want to set the tokenUri from my mint function argument like this: function mintToken(address recipient, string memory tokenURI) external onlyOwner { uint256 newItemId = _tokenIds.current(); _safeMint(recipient, _tokenIds.current()); _setTokenURI(newItemId, tokenURI); _tokenIds.increment(); } On https://rinkeby.etherscan.io/address/0x89…80b#writeContract I trigger mintToken with an transfer address and the ipfs::Listen

I use pragma solidity ^0.8.0; and contract MyERC721 is Ownable, ERC721URIStorage

I want to set the tokenUri from my mint function argument like this:

function mintToken(address recipient, string memory tokenURI) external onlyOwner {         uint256 newItemId = _tokenIds.current();         _safeMint(recipient, _tokenIds.current());         _setTokenURI(newItemId, tokenURI);         _tokenIds.increment();     } 

On https://rinkeby.etherscan.io/address/0x89…80b#writeContract I trigger mintToken with an transfer address and the ipfs url "ipfs://bafk…eu"

On OpenSea the preview image is broken and the token id is not linked with the tokenUrl

But when I set the tokenUri inside of the mint function like this

function mintToken(address recipient) external onlyOwner {         uint256 newItemId = _tokenIds.current();         _safeMint(recipient, _tokenIds.current());         _setTokenURI(newItemId, "ipfs://bafk...eu");         _tokenIds.increment();     } 

Suddenly everything is fine. OpenSea displays the preview image and links the token id with the tokenUri

Whats the difference between the two ways and why is way 1 not working?

Also when I call tokenURI on https://rinkeby.etherscan.io/address/0x89…80b#readContract for both contracts, both minted tokens return the same url "ipfs://bafk…eu". That’s strange.

How to get the total value of a address including tokens other than ETH

Shopping cart
There are no products in the cart!
Continue shopping
0