toJson method

  1. @override
Map<String, dynamic> toJson()
override

Serialises this class into a JSON object.

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

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

Implementation

@override
Map<String, dynamic> toJson() => {
  'activeStakeLamports': activeStakeLamports,
  'transientStakeLamports': transientStakeLamports,
  'lastUpdateEpoch': lastUpdateEpoch,
  'transientSeedSuffix': transientSeedSuffix,
  'unused': unused,
  'validatorSeedSuffix': validatorSeedSuffix,
  'status': status,
  'voteAccountAddress': voteAccountAddress,
};