getDiscussion method

Future<Discussion> getDiscussion({
  1. required String author,
  2. required String permlink,
})

Return a discussion with the given parameters. Throws a NotFoundFailure if a post could not be found.

Implementation

Future<Discussion> getDiscussion({
  required String author,
  required String permlink,
}) async {
  final bodyJson = await _fetchPostData(
    method: 'bridge.get_discussion',
    params: {'author': author, 'permlink': permlink},
  );

  return Discussion.fromJson(bodyJson['result'] as Map<String, dynamic>);
}