Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • API

Index

Methods

  • Removes stored content by its CID from this account. Please note that even if content is removed from the service other nodes that have replicated it might still continue providing it.

    Parameters

    Returns Promise<void>

  • encodeBlob(service: Service, content: Blob | File): Promise<{ car: CarReader; cid: CID }>
  • Encodes a single file to a CAR file and also returns it's root CID.

    Parameters

    • service: Service
    • content: Blob | File

    Returns Promise<{ car: CarReader; cid: CID }>

  • encodeDirectory(files: Iterable<File>): Promise<{ car: CarReader; cid: CID }>
  • Encodes a directory of files to a CAR file and also returns the root CID. Provided files MUST be within the same directory, otherwise error is raised e.g. foo/bar.png, foo/bla/baz.json is ok but foo/bar.png, bla/baz.json is not.

    Parameters

    • files: Iterable<File>

    Returns Promise<{ car: CarReader; cid: CID }>

  • encodeNFT<T>(input: T): Promise<{ car: CarReader; token: Token<T> }>
  • Encodes the given token and all resources it references (in the form of a File or a Blob) along with a metadata JSON as specificed in ERC-1155 to a CAR file. The token.image must be either a File or a Blob instance, which will be stored and the corresponding content address URL will be saved in the metadata JSON file under image field.

    If token.properties contains properties with File or Blob values, those also get stored and their URLs will be saved in the metadata JSON file in their place.

    Note: URLs for File objects will retain file names e.g. in case of new File([bytes], 'cat.png', { type: 'image/png' }) will be transformed into a URL that looks like ipfs://bafy...hash/image/cat.png. For Blob objects, the URL will not have a file name name or mime type, instead it will be transformed into a URL that looks like ipfs://bafy...hash/image/blob.

    Type Parameters

    Parameters

    • input: T

    Returns Promise<{ car: CarReader; token: Token<T> }>

  • Stores the given token and all resources it references (in the form of a File or a Blob) along with a metadata JSON as specificed in ERC-1155. The token.image must be either a File or a Blob instance, which will be stored and the corresponding content address URL will be saved in the metadata JSON file under image field.

    If token.properties contains properties with File or Blob values, those also get stored and their URLs will be saved in the metadata JSON file in their place.

    Note: URLs for File objects will retain file names e.g. in case of new File([bytes], 'cat.png', { type: 'image/png' }) will be transformed into a URL that looks like ipfs://bafy...hash/image/cat.png. For Blob objects, the URL will not have a file name name or mime type, instead it will be transformed into a URL that looks like ipfs://bafy...hash/image/blob.

    Type Parameters

    Parameters

    Returns Promise<Token<T>>

Generated using TypeDoc