RPCModel.fromJson constructor

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

Implementation

factory RPCModel.fromJson(Map<String, dynamic> json) {
  return RPCModel(
    id: json['id'],
    jsonrpc: json['jsonrpc'],
    userOperationResult: (json['result'].runtimeType != String)
        ? UserOperationResult.fromJson(json['result'])
        : null,
    userOperationHashResult: (json['result'].runtimeType != String)
        ? null
        : UserOperationHashResult.fromJson(json),
    result: (json['result'].runtimeType != String) ? json['result'] : null,
    userOpHash:
        (json['result'].runtimeType == String) ? json['result'] : null,
    error: json['error'] != null ? RPCError.fromJson(json['error']) : null,
  );
}