algod method

  1. @override
Future<Map<String, dynamic>> algod({
  1. required String ledger,
  2. required String path,
  3. String? body,
  4. String? method,
  5. String? contentType,
})

Proxies the requested path to the Algod v2 API. Is limited to endpoints made available by the API server. By default, all calls to the AlgoSigner.algod method are GET.

Implementation

@override
Future<Map<String, dynamic>> algod({
  required String ledger,
  required String path,
  String? body,
  String? method,
  String? contentType,
}) async {
  Completer<Map<String, dynamic>> c = Completer();
  promiseToFuture(
    algosigner.algod(algosigner.AlgodOptions(
      ledger: ledger,
      path: path,
      body: body,
      method: method,
      contentType: contentType,
    )),
  )
      .then((value) => c.complete(Map<String, dynamic>.from(convert(value))))
      .onError((error, stackTrace) => c.completeError(_handleError(error)));

  return c.future;
}