tokenofOwnerByIndex method
Enumerate NFTs assigned to an owner
Throws if index
>= balanceOf(owner)
or if owner
is the zero address, representing invalid NFTs.
tokenAddress An address for whom to query .
IndexNO A counter less than totalSupply()
ownerAddress The address which owns the funds.
The token identifier for the index
th NFT assigned to owner
Implementation
Future<String> tokenofOwnerByIndex(
BigInt index_, String _token__Add_, String ownerrAddr) async {
final EthereumAddress contractAddr = EthereumAddress.fromHex(_token__Add_);
final EthereumAddress ownerAddress = EthereumAddress.fromHex(ownerrAddr);
final contract =
DeployedContract(ContractAbi.fromJson(abiFile, 'XRC721'), contractAddr);
final getTokenbyIndex = contract.function('tokenOfOwnerByIndex');
final tokenofOwnerByIndex = await client.call(
contract: contract,
function: getTokenbyIndex,
params: [ownerAddress, index_]);
return ('$tokenofOwnerByIndex');
}