ticker method
stream output of best block
Implementation
Stream<Map> ticker() async* {
Map oldBlock = await getBlock();
while (true) {
Map newBlock = await getBlock();
if (newBlock['id'] != oldBlock['id']) {
oldBlock = newBlock;
yield newBlock;
} else {
sleep(const Duration(seconds: 1));
}
}
}