Interface Pins

interface Pins {
    add(cid, options?): AsyncGenerator<CID<unknown, number, number, Version>, void, undefined>;
    get(cid, options?): Promise<Pin>;
    isPinned(cid, options?): Promise<boolean>;
    ls(options?): AsyncGenerator<Pin, void, undefined>;
    rm(cid, options?): AsyncGenerator<CID<unknown, number, number, Version>, void, undefined>;
    setMetadata(cid, metadata, options?): Promise<void>;
}

Methods

  • Pin a block in the blockstore. It will not be deleted when garbage collection is run.

    Parameters

    Returns AsyncGenerator<CID<unknown, number, number, Version>, void, undefined>

  • If the CID is pinned, return details of the pin, otherwise throw an error

    Parameters

    Returns Promise<Pin>

  • Return true if the passed CID is pinned

    Parameters

    Returns Promise<boolean>

  • List all blocks that have been pinned.

    Parameters

    Returns AsyncGenerator<Pin, void, undefined>

  • Unpin the block that corresponds to the passed CID. The block will be deleted when garbage collection is run.

    Parameters

    Returns AsyncGenerator<CID<unknown, number, number, Version>, void, undefined>

  • If the CID is pinned, update the metadata associated with the pin, otherwise throw an error

    Parameters

    Returns Promise<void>