Skip to main content

ResQ.Storage.PinataClient

PinataClient.ListPinsAsync(string, int, CancellationToken) Method

Lists pinned files with optional name prefix filtering.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<ResQ.Storage.PinMetadata>> ListPinsAsync(string? namePrefix=null, int limit=100, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

namePrefix System.String Optional prefix to filter pins by name. If null or empty, returns all pins. limit System.Int32 Maximum number of results to return (default 100). cancellationToken System.Threading.CancellationToken Cancellation token for the operation. Implements ListPinsAsync(string, int, CancellationToken)

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<PinMetadata>>
A read-only list of pin metadata matching the filter criteria.

Exceptions

System.ArgumentOutOfRangeException
Thrown when limit is less than 1.
System.OperationCanceledException
Thrown when the operation is cancelled.

Example

// List all pins
var allPins = await storage.ListPinsAsync();

// List pins with specific prefix
var evidencePins = await storage.ListPinsAsync("evidence-", limit: 50);
foreach (var pin in evidencePins)
{
    Console.WriteLine($"{pin.Name}: {pin.Cid}");
}

Remarks

This method queries the Pinata API for pinned content. Results include metadata about each pin including CID, name, size, and custom key-value pairs.