fetchERC20Transactions method
Fetch all ERC20 Transactions for a given token
and address
Implementation
Future<List<EtherscanTransaction>> fetchERC20Transactions({
required String contractAddress,
required String address,
int? startblock,
int? endblock,
int? page,
int? offset,
Sorting? sorting,
}) async {
final endpoint = buildERC20TransactionEndpoint(
address: address,
contractAddress: contractAddress,
startblock: startblock,
endblock: endblock,
page: page,
offset: offset,
sorting: sorting,
);
final txResults = await fetchEtherscanWithRatelimitRetries(endpoint);
return [
for (final tx in txResults)
EtherscanTransaction.fromJsonErc20(
tx,
address: address,
currency: currency,
)
];
}