resolve method

Future<Map<String, dynamic>> resolve({
  1. required String path,
  2. bool? recursive,
  3. int? dhtRecordCount,
  4. String? dhtTimeout,
})

Resolve the value of names to IPFS or DAG path. /api/v0/resolve

Arguments:

  • path String: The name to resolve.

Optional arguments:

  • recursive bool: Resolve until the result is an IPFS name. Default: true.
  • dhtRecordCount int: Number of records to request for DHT resolution.
  • dhtTimeout String: Max time to collect values during DHT resolution eg "30s". Pass 0 for no timeout.

Response:

{
  "Path": "<string>",
  "StatusCode": "<statusCode>",
  "StatusMessage": "<statusMessage>"
}

See more: https://docs.ipfs.io/reference/http/api/#api-v0-resolve

Implementation

Future<Map<String, dynamic>> resolve({
  required String path,
  bool? recursive,
  int? dhtRecordCount,
  String? dhtTimeout,
}) async {
  Response? res = await _post(
    dio,
    url: "$url/resolve",
    queryParameters: {
      "arg": path,
      if (recursive != null) "recursive": recursive,
      if (dhtRecordCount != null) "dht-record-count": dhtRecordCount,
      if (dhtTimeout != null) "dht-timeout": dhtTimeout,
    },
  );

  return _interceptDioResponse(res, expectsResponseBody: true);
}