Skip to content

BlockFrostIPFS

slowbackspace edited this page Mar 9, 2023 · 6 revisions

Class: BlockFrostIPFS

Table of contents

Constructors

Properties

Constructors

constructor

new BlockFrostIPFS(options?)

Parameters

Name Type
options? Options

Defined in

src/BlockFrostIPFS.ts:34

Properties

add

add: (this: BlockFrostIPFS, path: string) => Promise<AddResponse> = add

Type declaration

▸ (this, path): Promise<AddResponse>

Adds a file to IPFS

See

API docs for Add a file to IPFS

Remarks

You need to pin an object to avoid it being garbage collected. This usage is being counted in your user account quota.

Parameters
Name Type Description
this BlockFrostIPFS -
path string path to the file
Returns

Promise<AddResponse>

information about added ipfs object

Defined in

src/BlockFrostIPFS.ts:58


gateway

gateway: (this: BlockFrostIPFS, path: string) => Promise<unknown> = gateway

Type declaration

▸ (this, path): Promise<unknown>

Retrieve an object from the IPFS gateway

See

API docs for Relay to an IPFS gateway

Remarks

Useful if you do not want to rely on a public gateway, such as ipfs.blockfrost.dev.

Parameters
Name Type Description
this BlockFrostIPFS -
path string path to the file
Returns

Promise<unknown>

the object content

Defined in

src/BlockFrostIPFS.ts:59


list

list: (this: BlockFrostIPFS, pagination?: PaginationOptions) => Promise<ListResponse> = list

Type declaration

▸ (this, pagination?): Promise<ListResponse>

List pinned IPFS resources.

See

API docs for List pinned objects

Parameters
Name Type Description
this BlockFrostIPFS -
pagination? PaginationOptions Optional, Pagination options
Returns

Promise<ListResponse>

List of pinned IPFS objects

Defined in

src/BlockFrostIPFS.ts:62


listByPath

listByPath: (this: BlockFrostIPFS, path: string) => Promise<ListResponse> = listByPath

Type declaration

▸ (this, path): Promise<ListResponse>

Obtains information about locally pinned IPFS object

See

API docs for Details about pinned object

Parameters
Name Type Description
this BlockFrostIPFS -
path string The path to the IPFS object (IPFS hash)
Returns

Promise<ListResponse>

List of pinned IPFS objects

Defined in

src/BlockFrostIPFS.ts:61


pin

pin: (this: BlockFrostIPFS, path: string) => Promise<PinResponse> = pin

Type declaration

▸ (this, path): Promise<PinResponse>

Pins the IPFS resource.

See

API docs for Pin an object

Remarks

IPFS pinning refers to the process of specifying data to be retained and persist on one or more IPFS nodes.

Parameters
Name Type Description
this BlockFrostIPFS -
path string path to the file
Returns

Promise<PinResponse>

Pinned object

Defined in

src/BlockFrostIPFS.ts:60


pinRemove

pinRemove: (this: BlockFrostIPFS, path: string) => Promise<string> = pinRemove

Type declaration

▸ (this, path): Promise<string>

Removes pinned object from local storage

See

API docs for Remove a IPFS pin

Parameters
Name Type Description
this BlockFrostIPFS -
path string The path to the IPFS object (IPFS hash)
Returns

Promise<string>

List of pinned IPFS objects

Defined in

src/BlockFrostIPFS.ts:63