ModelInstanceDocument stream implementation

Type Parameters

  • T = Record<string, any>

Hierarchy

  • Stream
    • ModelInstanceDocument

Constructors

  • Type Parameters

    • T = Record<string, any>

    Parameters

    • state$: RunningStateLike
    • _context: Context

    Returns ModelInstanceDocument<T>

Properties

state$: RunningStateLike
STREAM_TYPE_ID: number = 3
STREAM_TYPE_NAME: string = 'MID'

Accessors

  • get allCommitIds(): CommitID[]
  • Returns CommitID[]

  • get anchorCommitIds(): CommitID[]
  • Returns CommitID[]

  • get api(): CeramicApi
  • Returns CeramicApi

  • get commitId(): CommitID
  • Returns CommitID

  • get id(): StreamID
  • Returns StreamID

  • get state(): StreamState
  • Returns StreamState

  • get tip(): CID
  • Returns CID

Methods

  • Update the contents of an existing Model Instance Document based on a JSON-patch diff from the existing contents to the desired new contents

    Parameters

    • jsonPatch: Operation[]

      JSON patch diff of document contents

    • opts: UpdateOpts = {}

      Additional options

    Returns Promise<void>

  • Returns Promise<AnchorStatus>

  • Parameters

    • Optional opts: LoadOpts

    Returns Promise<void>

  • Loads a Model Instance Document from a given StreamID

    Type Parameters

    • T

    Parameters

    • ceramic: CeramicApi

      Instance of CeramicAPI used to communicate with the Ceramic network

    • streamId: string | StreamID | CommitID

      StreamID to load. Must correspond to a ModelInstanceDocument

    • opts: LoadOpts = {}

      Additional options

    Returns Promise<ModelInstanceDocument<T>>