Caip10Link stream implementation

Hierarchy

  • Stream
    • Caip10Link

Constructors

  • Parameters

    • state$: RunningStateLike
    • api: StreamReaderWriter

    Returns Caip10Link

Properties

state$: RunningStateLike
STREAM_TYPE_ID: number = 1
STREAM_TYPE_NAME: string = 'caip10-link'

Accessors

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

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

  • get api(): StreamReaderWriter
  • Returns StreamReaderWriter

  • get commitId(): CommitID
  • Returns CommitID

  • get content(): any
  • Returns any

  • get id(): StreamID
  • Returns StreamID

  • get state(): StreamState<StreamMetadata>
  • Returns StreamState<StreamMetadata>

  • get tip(): CID<unknown, number, number, Version>
  • Returns CID<unknown, number, number, Version>

Methods

  • Given an AuthProvider that supports the CAIP2 chainid of the CAIP10 address that the Caip10Link object represents, clears the link from the CAIP10 address to its current DID if it exists.

    Parameters

    • authProvider: AuthProvider

      AuthProvider instance from the "@ceramicnetwork/blockchain-utils-linking" package. Must include support for the blockchain that the CAIP10 address associated with this Caip10Link lives on.

    • opts: UpdateOpts = {}

      Additional options

    Returns Promise<void>

  • Makes this stream read-only. After this has been called any future attempts to call mutation methods on the instance will throw.

    Returns void

  • Returns Promise<AnchorStatus>

  • Given a DID and an AuthProvider which includes support for the CAIP2 chainid of the CAIP10 address that this Caip10Link represents, updates this Caip10Link to create a verifiable link from the CAIP10 address to the DID.

    Parameters

    • did: string | DID

      The DID being linked to the CAIP10 address that this Caip10Link object represents. If the 'did' provided is an instance of the DID type, the DID must already be authenticated so that the did string it represents is available.

    • authProvider: AuthProvider

      AuthProvider instance from the "@ceramicnetwork/blockchain-utils-linking" package. Must include support for the blockchain that the CAIP10 address associated with this Caip10Link lives on.

    • opts: UpdateOpts = {}

      Additional options

    Returns Promise<void>

  • Given a LinkProof proving the relationship between a DID and a CAIP10 account, updates this CAIP10Link to contain the proof, thereby making the link from the CAIP10 address to the DID publicly discoverable.

    Parameters

    • proof: LinkProof

      LinkProof as generated by the "@ceramicnetwork/blockchain-utils-linking" package

    • opts: UpdateOpts = {}

      Additional options

    Returns Promise<void>

  • Parameters

    • Optional opts: LoadOpts

    Returns Promise<void>

  • Creates a Caip10Link for the given CAIP10 address. Initially created without a link to any DID, use 'setDid' to create the public link between the given CAIP10 account and a DID.

    Parameters

    • ceramic: StreamWriter

      Interface to write to ceramic network

    • accountId: string | AccountId

      Blockchain account id in CAIP10 format.

    • opts: CreateOpts | LoadOpts = {}

      Additional options.

    Returns Promise<Caip10Link>

  • Create Caip10Link from the genesis commit

    Parameters

    • ceramic: StreamWriter

      Interface to write to ceramic network

    • genesisCommit: GenesisCommit

      Genesis commit (first commit in stream log)

    • opts: CreateOpts | LoadOpts = {}

      Additional options

    Returns Promise<Caip10Link>

  • Loads a Caip10Link from a given StreamID

    Parameters

    • ceramic: StreamReader

      Interface for reading streams from ceramic network

    • streamId: string | StreamID | CommitID

      StreamID to load. Must correspond to a Caip10Link

    • opts: LoadOpts = {}

      Additional options

    Returns Promise<Caip10Link>