Messages API Reference
This document provides a concise API reference for the Messages component within the Hedera DID SDK for JavaScript.
Message Classes
DIDMessage
DIDMessage is the abstract base class for all SDK DID messages. It is implemented in core and extended by concrete message classes in messages.
Properties
| Name | Type | Description |
|---|---|---|
proof? |
|
Cryptographic proof attached to the message. |
operation |
|
Operation type: |
did |
|
DID associated with the message. |
topicId |
|
Hedera topic id where message is published. |
payload |
|
JSON payload to publish (includes proof). Throws if proof is missing. |
Methods
signWith
signWith(signer: Signer, options: SignWithOptions): Promise<void>
Signs the unsecured message and sets proof.
setProof
setProof(
proof: Proof,
verifier: Verifier,
cryptosuites: ProofVerifier[],
options: VerifierOptions,
): Promise<void>
Validates and attaches a provided proof.
CreateDidMessage
Represents a DID create operation in DID SDK 2.0.
| Name | Type | Description |
|---|---|---|
identifierMultibasePublicKey? |
|
Identifier key used to derive DID id. |
didDocumentFields |
|
Initial DID document fields for creation. |
network? |
|
Target Hedera network. |
topicId? |
|
Existing topic id, if provided. |
Component Implementation
The Hashgraph DID SDK provides the DID Message classes within @swiss-digital-assets-institute/messages. For further details, refer to the Packages Guide.