repo method

Future<Map<String, dynamic>> repo({
  1. bool? sizeOnly,
  2. bool? human,
})

Get stats for the currently used repo. /api/v0/stats/repo

Optional arguments:

  • sizeOnly bool: Only report RepoSize and StorageMax.
  • human bool: Print sizes in human readable format (e.g., 1K 234M 2G).

Response:

{
  "NumObjects": "<uint64>",
  "RepoPath": "<string>",
  "SizeStat": {
    "RepoSize": "<uint64>",
    "StorageMax": "<uint64>"
  },
  "Version": "<string>",
  "StatusCode": "<statusCode>",
  "StatusMessage": "<statusMessage>"
}

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

Implementation

Future<Map<String, dynamic>> repo({bool? sizeOnly, bool? human}) async {
  Response? res = await _post(
    Ipfs.dio,
    url: "${Ipfs.url}/stats/repo",
    queryParameters: {
      if (sizeOnly != null) "size-only": sizeOnly,
      if (human != null) "human": human,
    },
  );

  return _interceptDioResponse(res, expectsResponseBody: true);
}