toJson method

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

Dont change order of toJson the key index must be equal to protoConfig fields.

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    'authority': authority,
    'sender': sender,
    'code_bytes': switch (codeBytes) {
      List<int> bytes => StringUtils.decode(
        bytes,
        encoding: StringEncoding.base64,
      ),
      _ => null,
    },
    'type_args': typeArgs.map((e) => e).toList(),
    'args': args.map((e) => e).toList(),
  };
}