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() => {
      'pubkey': pubkey,
      'gossip': gossip,
      'tpu': tpu,
      'rpc': rpc,
      'version': version,
      'featureSet': featureSet,
      'shredVersion': shredVersion,
    };