Account.fromJson constructor

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

Implementation

factory Account.fromJson(Map<String, dynamic> json) {
  return Account(
    id: _parseInt(json['id']),
    name: json['name'],
    owner: json['owner'] != null ? Authority.fromJson(json['owner']) : null,
    active: json['active'] != null ? Authority.fromJson(json['active']) : null,
    posting: json['posting'] != null ? Authority.fromJson(json['posting']) : null,
    memoKey: json['memo_key'],
    jsonMetadata: json['json_metadata'],
    postingJsonMetadata: json['posting_json_metadata'],
    proxy: json['proxy'],
    lastOwnerUpdate: json['last_owner_update'],
    lastAccountUpdate: json['last_account_update'],
    created: json['created'],
    mined: json['mined'],
    ownerChallenged: json['owner_challenged'],
    activeChallenged: json['active_challenged'],
    lastOwnerProved: json['last_owner_proved'],
    lastActiveProved: json['last_active_proved'],
    recoveryAccount: json['recovery_account'],
    resetAccount: json['reset_account'],
    lastAccountRecovery: json['last_account_recovery'],
    commentCount: _parseInt(json['comment_count']),
    lifetimeVoteCount: _parseInt(json['lifetime_vote_count']),
    postCount: _parseInt(json['post_count']),
    canVote: json['can_vote'],
    votingPower: _parseInt(json['voting_power']),
    lastVoteTime: json['last_vote_time'],
    votingManabar: json['voting_manabar'] != null ? Manabar.fromJson(json['voting_manabar']) : null,
    balance: json['balance'] != null ? AccountAsset.fromJson(json['balance']) : null,
    savingsBalance: json['savings_balance'] != null ? AccountAsset.fromJson(json['savings_balance']) : null,
    hbdBalance: json['hbd_balance'] != null ? AccountAsset.fromJson(json['hbd_balance']) : null,
    hbdSeconds: json['hbd_seconds'],
    hbdSecondsLastUpdate: json['hbd_seconds_last_update'],
    hbdLastInterestPayment: json['hbd_last_interest_payment'],
    savingsHbdBalance: json['savings_hbd_balance'] != null ? AccountAsset.fromJson(json['savings_hbd_balance']) : null,
    savingsHbdSeconds: json['savings_hbd_seconds'],
    savingsHbdSecondsLastUpdate: json['savings_hbd_seconds_last_update'],
    savingsHbdLastInterestPayment: json['savings_hbd_last_interest_payment'],
    savingsWithdrawRequests: _parseInt(json['savings_withdraw_requests']),
    rewardHbdBalance: json['reward_hbd_balance'] != null ? AccountAsset.fromJson(json['reward_hbd_balance']) : null,
    rewardHiveBalance: json['reward_hive_balance'] != null ? AccountAsset.fromJson(json['reward_hive_balance']) : null,
    rewardVestingBalance: json['reward_vesting_balance'] != null ? AccountAsset.fromJson(json['reward_vesting_balance']) : null,
    rewardVestingHive: json['reward_vesting_hive'] != null ? AccountAsset.fromJson(json['reward_vesting_hive']) : null,
    curationRewards: _parseInt(json['curation_rewards']),
    postingRewards: _parseInt(json['posting_rewards']),
    vestingShares: json['vesting_shares'] != null ? AccountAsset.fromJson(json['vesting_shares']) : null,
    delegatedVestingShares: json['delegated_vesting_shares'] != null ? AccountAsset.fromJson(json['delegated_vesting_shares']) : null,
    receivedVestingShares: json['received_vesting_shares'] != null ? AccountAsset.fromJson(json['received_vesting_shares']) : null,
    vestingWithdrawRate: json['vesting_withdraw_rate'] != null ? AccountAsset.fromJson(json['vesting_withdraw_rate']) : null,
    nextVestingWithdrawal: json['next_vesting_withdrawal'],
    withdrawn: _parseInt(json['withdrawn']),
    toWithdraw: _parseInt(json['to_withdraw']),
    withdrawRoutes: _parseInt(json['withdraw_routes']),
    proxiedVsfVotes: json['proxied_vsf_votes'] != null
  ? (json['proxied_vsf_votes'] as List)
      .map((e) => _parseInt(e) ?? 0)
      .toList()
  : null,
    witnessesVotedFor: _parseInt(json['witnesses_voted_for']),
    averageBandwidth: json['average_bandwidth'],
    lifetimeBandwidth: json['lifetime_bandwidth'],
    lastBandwidthUpdate: json['last_bandwidth_update'],
    averageMarketBandwidth: json['average_market_bandwidth'],
    lifetimeMarketBandwidth: json['lifetime_market_bandwidth'],
    lastMarketBandwidthUpdate: json['last_market_bandwidth_update'],
    lastPost: json['last_post'],
    lastRootPost: json['last_root_post'],
    vestingBalance: json['vesting_balance'] != null ? AccountAsset.fromJson(json['vesting_balance']) : null,
    reputation: _parseInt(json['reputation']),
    transferHistory: json['transfer_history'],
    marketHistory: json['market_history'],
    postHistory: json['post_history'],
    voteHistory: json['vote_history'],
    otherHistory: json['other_history'],
    witnessVotes: json['witness_votes'] != null ? List<String>.from(json['witness_votes']) : null,
    tagsUsage: json['tags_usage'] != null ? List<String>.from(json['tags_usage']) : null,
    guestBloggers: json['guest_bloggers'] != null ? List<String>.from(json['guest_bloggers']) : null,
    openOrders: json['open_orders'],
    comments: json['comments'],
    blog: json['blog'],
    feed: json['feed'],
    recentReplies: json['recent_replies'],
    recommended: json['recommended'],
  );
}