Skip to main content

ResQ.Storage.PinataClient

PinataClient.UnpinAsync(string, CancellationToken) Method

Unpins a file from Pinata.
public System.Threading.Tasks.Task<bool> UnpinAsync(string cid, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

cid System.String The IPFS Content Identifier to unpin. cancellationToken System.Threading.CancellationToken Cancellation token for the operation. Implements UnpinAsync(string, CancellationToken)

Returns

System.Threading.Tasks.Task<System.Boolean>
True if the file was successfully unpinned; false otherwise.

Exceptions

System.ArgumentNullException
Thrown when cid is null or empty.
System.OperationCanceledException
Thrown when the operation is cancelled.

Example

bool success = await storage.UnpinAsync("Qmabc123...");
if (success)
{
    Console.WriteLine("File unpinned successfully");
}

Remarks

Unpinning removes the file from your Pinata account but does not remove it from the IPFS network. The content may still be available if other nodes have pinned it or if it has been cached. Use this to manage storage costs by removing unneeded pins.