txListInternal method Null safety
Get a list of internal transactions
txhash
- Transaction hash. If specified then address will be ignored
address
- Transaction address
startblock
- start looking here
endblock
- end looking there
sort
- Sort asc/desc
Example
final txlist = eth.txListInternal('0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170');
Implementation
Future<EtherScanTxInternalModel> txListInternal({
String? txhash,
String? address,
Object startblock = 0,
String? endblock = 'latest',
EtherSort sort = EtherSort.asc,
}) async {
const module = 'account';
const action = 'txlistinternal';
Map<String, dynamic>? query = {
'module': module,
'action': action,
'apiKey': apiKey,
};
query.addAll({
'startblock': startblock,
'endblock': endblock,
'sort': sort.str,
});
if (txhash != null) {
query.putIfAbsent('txhash', () => txhash);
} else {
query.putIfAbsent('address', () => address);
}
query['txhash'] = txhash;
return (await get(query)).fold(
(l) => EtherScanTxInternalModel.empty(),
(r) => EtherScanTxInternalModel.fromJson(r),
);
}