Type alias RecordOptionsBeta

RecordOptions: DwnMessage[DwnInterface.RecordsWrite | DwnInterface.RecordsDelete] & {
    attestation?: DwnMessage[DwnInterface.RecordsWrite]["attestation"];
    author: string;
    connectedDid: string;
    contextId?: string;
    data?: Readable | ReadableStream;
    delegateDid?: string;
    encodedData?: string | Blob;
    encryption?: DwnMessage[DwnInterface.RecordsWrite]["encryption"];
    initialWrite?: DwnMessage[DwnInterface.RecordsWrite];
    protocolRole?: string;
    recordId?: string;
    remoteOrigin?: string;
}

Options for configuring a Record instance, extending the base RecordsWriteMessage with additional properties.

This type combines the standard fields required for writing DWN records with additional metadata and configuration options used specifically in the Record class.

Type declaration

  • Optional attestation?: DwnMessage[DwnInterface.RecordsWrite]["attestation"]

    The attestation signature(s) for the record.

  • author: string

    The DID that signed the record.

  • connectedDid: string

    The DID of the DWN tenant under which record operations are being performed.

  • Optional contextId?: string

    The contextId associated with the record.

  • Optional data?: Readable | ReadableStream

    A stream of data, conforming to the Readable or ReadableStream interface, providing a mechanism to read the record's data sequentially. This is particularly useful for handling large datasets that should not be loaded entirely in memory, allowing for efficient, chunked processing of the record's data.

  • Optional delegateDid?: string

    The optional DID that will sign the records on behalf of the connectedDid

  • Optional encodedData?: string | Blob

    The data of the record, either as a Base64 URL encoded string or a Blob.

  • Optional encryption?: DwnMessage[DwnInterface.RecordsWrite]["encryption"]

    The encryption information for the record.

  • Optional initialWrite?: DwnMessage[DwnInterface.RecordsWrite]

    The initial RecordsWriteMessage that represents the initial state/version of the record.

  • Optional protocolRole?: string

    The protocol role under which this record is written.

  • Optional recordId?: string

    The unique identifier of the record

  • Optional remoteOrigin?: string

    The remote tenant DID if the record was queried or read from a remote DWN.