Options
All
  • Public
  • Public/Protected
  • All
Menu

To install this library:
$ npm install --save @ceramicnetwork/core

Hierarchy

  • Ceramic

Implements

  • CeramicApi

Index

Constructors

constructor

Properties

Readonly context

context: Context

dispatcher

dispatcher: Dispatcher

Readonly pin

pin: PinApi

pinStore

pinStore: PinStore

Accessors

did

  • get did(): DID | undefined

ipfs

Methods

_loadDoc

  • _loadDoc(docId: DocID | string, opts?: DocOpts): Promise<Document>

addDoctypeHandler

  • addDoctypeHandler<T>(doctypeHandler: DoctypeHandler<T>): void
  • Register new doctype handler

    Type parameters

    • T: Doctype

    Parameters

    • doctypeHandler: DoctypeHandler<T>

      Document type handler

    Returns void

applyCommit

  • applyCommit<T>(docId: string | DocID, commit: CeramicCommit, opts?: DocOpts): Promise<T>
  • Applies commit on a given document

    Type parameters

    • T: Doctype

    Parameters

    • docId: string | DocID

      Document ID

    • commit: CeramicCommit

      Commit to be applied

    • Optional opts: DocOpts

      Initialization options

    Returns Promise<T>

applyRecord

  • applyRecord<T>(docId: DocID | string, record: CeramicCommit, opts?: DocOpts): Promise<T>
  • Applies record on a given document

    deprecated

    See applyCommit

    Type parameters

    • T: Doctype

    Parameters

    • docId: DocID | string

      Document ID

    • record: CeramicCommit

      Record to be applied

    • Optional opts: DocOpts

      Initialization options

    Returns Promise<T>

close

  • close(): Promise<void>

createDocument

  • createDocument<T>(doctype: string, params: DocParams, opts?: DocOpts): Promise<T>
  • Create doctype instance

    Type parameters

    • T: Doctype

    Parameters

    • doctype: string

      Document type

    • params: DocParams

      Create parameters

    • Optional opts: DocOpts

      Initialization options

    Returns Promise<T>

createDocumentFromGenesis

  • createDocumentFromGenesis<T>(doctype: string, genesis: any, opts?: DocOpts): Promise<T>
  • Creates doctype from genesis record

    Type parameters

    • T: Doctype

    Parameters

    • doctype: string

      Document type

    • genesis: any

      Genesis CID

    • Default value opts: DocOpts = {}

      Initialization options

    Returns Promise<T>

getSupportedChains

  • getSupportedChains(): Promise<Array<string>>
  • Returns Promise<Array<string>>

    An array of the CAIP-2 chain IDs of the blockchains that are supported for anchoring documents.

loadDocument

  • loadDocument<T>(docId: DocID | string, opts?: DocOpts): Promise<T>
  • Load document type instance

    Type parameters

    • T: Doctype

    Parameters

    • docId: DocID | string

      Document ID

    • Default value opts: DocOpts = {}

      Initialization options

    Returns Promise<T>

loadDocumentCommits

  • loadDocumentCommits(docId: string | DocID): Promise<Record<string, any>[]>

loadDocumentRecords

  • loadDocumentRecords(docId: DocID | string): Promise<Array<Record<string, any>>>
  • Load all document records by document ID

    deprecated

    See loadDocumentCommits

    Parameters

    • docId: DocID | string

      Document ID

    Returns Promise<Array<Record<string, any>>>

multiQuery

  • multiQuery(queries: Array<MultiQuery>, timeout?: number): Promise<Record<string, Doctype>>
  • Load all document types instances for given multiqueries

    Parameters

    • queries: Array<MultiQuery>

      Array of MultiQueries

    • Optional timeout: number

      Timeout in milliseconds

    Returns Promise<Record<string, Doctype>>

setDIDProvider

  • setDIDProvider(provider: DIDProvider): Promise<void>

Static create