addOriginKey method
Add a new origin key @param {String} originPublicKey origin public key to be added @param {String} certificate certificate of the origin public key
Implementation
Future<String> addOriginKey({
String? originPublicKey,
String? certificate,
}) async {
final jsonRPCRequest = {
'jsonrpc': '2.0',
'method': 'add_origin_key',
'params': <String, String>{
'origin_public_key': originPublicKey!,
'certificate': certificate!,
},
'id': 1,
};
_logger.fine(
'addOriginKey: requestHttp.body=${json.encode(jsonRPCRequest)}',
);
final responseHttp = await http.post(
Uri.parse('$endpoint/api/rpc'),
body: json.encode(jsonRPCRequest),
headers: kRequestHeaders,
);
_logger.fine('addOriginKey: responseHttp.body=${responseHttp.body}');
final result = getJsonRPCResult(responseHttp.body);
return originKeyResponseFromJson(
json.encode(
result,
),
).toString();
}