VoteAccount.fromJson constructor

VoteAccount.fromJson(
  1. Map<String, dynamic> json
)

Creates an instance of this class from the constructor parameters defined in the json object.

Example

class Item extends Serializable {
  const(this.name, this.count);
  final String name;
  final int? count;
}

final Item x = Item.fromJson({
  'name': 'apple',
  'count': 10,
});

Implementation

factory VoteAccount.fromJson(final Map<String, dynamic> json) => VoteAccount(
  votePubkey: Pubkey.fromBase58(json['votePubkey']),
  nodePubkey: Pubkey.fromBase58(json['nodePubkey']),
  activatedStake: json['activatedStake'],
  epochVoteAccount: json['epochVoteAccount'],
  commission: json['commission'],
  lastVote: json['lastVote'],
  epochCredits: List<List>.from(
    json['epochCredits'],
  ).map(List<int>.from).toList(growable: false),
);