Skip to content

Methods available in DIDRegistryContract

The available methods in the DIDRegistryContract are:

prepareTxData

Prepares transaction data for a specific method in the contract.

  • Parameters:
    • methodName (string): Name of the method to call on the contract.
    • args (any[]): Arguments to pass to the method.
    • signerAddress (string): Address of the signer initiating the transaction.
    • memo (string, optional): Additional memo to attach to the transaction.
  • Returns: Promise<TransactionRequest>.

generateDID

Generates an Ethereum-based Decentralized Identifier (DID).

  • Parameters:
    • publicKey (string): Public key (Ethereum address) used as the DID identifier.
  • Returns: Promise<EthrDID>.

resolveDID

Resolves a Decentralized Identifier using the configured provider.

  • Parameters:
    • did (string): Decentralized Identifier to resolve.
  • Returns: Promise<DIDResolutionResult>.

resolveDIDWithAttributes

Resolves DID and fetches additional attributes from the Ethereum DID registry.

  • Parameters:
    • contractAddress (string): Address of the DID registry contract.
    • identity (string): Ethereum address owning the DID.
    • did (string): Decentralized Identifier to resolve.
  • Returns: Promise<Partial<DIDResolutionResultWithAttributes>>.

getDIDEventDetails

Extracts and processes details of DID-related blockchain events.

  • Parameters:
    • data_events (any[]): Raw event data from the blockchain.
    • eventName (string): Name of the event to process (e.g., "DIDAttributeChanged").
    • eventStruct (object): Mapping of event names to attribute structures.
  • Returns: Promise<EventDetails[]>.

getDIDEvents

Retrieves and processes all DID-related events for a specific identity.

  • Parameters:
    • contract (object): DID registry contract to filter events.
    • identity (string): Ethereum address associated with the DID.
    • eventStruct (object): Mapping of event names to attribute structures.
  • Returns: Promise<Record<keyof EventStruct, EventDetails[]>>.

processSetAttributeEvents

Processes DIDAttributeChanged events to return the latest attributes.

  • Parameters:
    • dIdAttributeChangedEvents (object[]): Array of DID attribute change events.
      • Properties:
        • name (string): Attribute name.
        • value (EventDetails[]): Attribute values.
  • Returns: Promise<SetAttributeEventObject>.