approveRequest method
Future<void>
approveRequest(
- CapabilityLink capabilityLink,
- Signed<
WitnessStatement> signedWitnessStatement, - PrivateKey withPrivateKey
Implementation
Future<void> approveRequest(
CapabilityLink capabilityLink,
Signed<WitnessStatement> signedWitnessStatement,
PrivateKey withPrivateKey,
) async {
final content = signedWitnessStatement.toJson();
final resp = await postAuth(
'/request/${capabilityLink.value}/approve',
json.encode(content),
withPrivateKey,
);
if (resp.statusCode != HttpStatus.ok) {
return Future.error(HttpResponseError(resp.statusCode, resp.body));
}
}