Options
All
  • Public
  • Public/Protected
  • All
Menu

Various utility functions

Hierarchy

  • Utils

Index

Accessors

Static validator

  • get validator(): Ajv

Methods

Static awaitCondition

  • awaitCondition(conditionFn: Function, stopFunction: Function, awaitInterval: number): Promise<void>
  • Awaits on condition for certain amount of time

    Parameters

    • conditionFn: Function
    • stopFunction: Function
    • awaitInterval: number

    Returns Promise<void>

Static getCommitData

  • getCommitData(dispatcher: Dispatcher, cid: CID, timestamp?: number, streamId?: StreamID): Promise<CommitData>
  • Return CommitData (with commit, JWS envelope, and/or anchor proof/timestamp, as applicable) for the specified CID

    Parameters

    • dispatcher: Dispatcher
    • cid: CID
    • Optional timestamp: number
    • Optional streamId: StreamID

    Returns Promise<CommitData>

Static isSchemaValid

  • isSchemaValid(schema: Record<string, unknown>): boolean
  • Validates model against JSON-Schema

    Parameters

    • schema: Record<string, unknown>

      Stream schema

    Returns boolean

Static validate

  • validate(content: any, schema: any): void
  • Validates model against JSON-Schema

    Parameters

    • content: any

      Stream content

    • schema: any

      Stream schema

    Returns void

Static validateSchema

  • validateSchema(doc: TileDocument): Promise<void>