orderList method

Future<List<String>?> orderList()

Fetches a list of current running orders

Implementation

Future<List<String>?> orderList() async {
  var jws = await _createJWS('${account!.accountURL!}/orders', useKid: true);
  var body = json.encode(jws.toJson());
  var headers = {'Content-Type': 'application/jose+json'};
  try {
    var response = await Dio().post(
      '${account!.accountURL!}/orders',
      data: body,
      options: Options(headers: headers),
    );
    print(response.data);
    return <String>[];
  } on DioException catch (e) {
    print(e.response!.data!.toString());
    return null;
  }
}