Class IPFS

Class for handling IPFS file uploads through various providers

Constructors

Properties

Methods

Constructors

  • Creates an instance of the IPFS class

    Parameters

    • provider: "pinata"

      The IPFS provider to use

    • config: PinataConfig

      Configuration for the selected provider

    Returns IPFS

Properties

config: PinataConfig
provider: "pinata"

Methods

  • Uploads a file to IPFS

    Parameters

    • file: string

      Path to the file to upload

    • fileName: string

      Name to use for the file

    Returns Promise<string>

    Promise resolving to the IPFS content identifier (CID)

  • Uploads a JSON object to IPFS

    Parameters

    • json: object

      The JSON object to upload

    • fileName: string

      Name to use for the file

    Returns Promise<string>

    Promise resolving to the IPFS content identifier (CID)