tokenURI method

Future<String> tokenURI(
  1. BigInt token_id,
  2. String tokenAddr__
)

A distinct Uniform Resource Identifier (URI) for a given asset. tokenAddress The address of the token. tokenId The identifier for an NFT. URI of a token.

Implementation

Future<String> tokenURI(BigInt token_id, String tokenAddr__) async {
  final EthereumAddress contractAddr = EthereumAddress.fromHex(tokenAddr__);

  final contract =
      DeployedContract(ContractAbi.fromJson(abiFile, 'XRC721'), contractAddr);
  final tokenURI = contract.function('tokenURI');
  final tokenuri = await client
      .call(contract: contract, function: tokenURI, params: [token_id]);
  return ('$tokenuri');
}