fetchERC721Transactions method

Future<List<EtherscanTransaction>> fetchERC721Transactions({
  1. required String address,
  2. String? contractAddress,
  3. int? startblock,
  4. int? endblock,
  5. int? page,
  6. int? offset,
  7. Sorting? sorting,
})

Fetch a list of all ERC721 Tokens for a given address

Implementation

Future<List<EtherscanTransaction>> fetchERC721Transactions({
  required String address,
  String? contractAddress,
  int? startblock,
  int? endblock,
  int? page,
  int? offset,
  Sorting? sorting,
}) async {
  final endpoint = buildERC721TransactionEndpoint(
    address: address,
    contractAddress: contractAddress,
    startblock: startblock,
    endblock: endblock,
    page: page,
    offset: offset,
    sorting: sorting,
  );

  final result =
      await fetchEtherscanWithRatelimitRetries(endpoint) as List<dynamic>;

  return [
    for (final tx in result)
      EtherscanTransaction.fromJsonErc721(
        tx,
        currency: currency,
        address: address,
      ),
  ];
}