import { AddressBook } from "./address-book"; import { Client, FileId, PrivateKey, PublicKey, TopicId } from "@hashgraph/sdk"; import { HcsDid } from "./did/hcs-did"; import { DidMethodOperation } from "../did-method-operation"; import { HcsDidTransaction } from "./did/hcs-did-transaction"; import { MessageEnvelope } from "./message-envelope"; import { HcsVcMessage } from "./vc/hcs-vc-message"; import { HcsDidMessage } from "./did/hcs-did-message"; import { HcsVcTransaction } from "./vc/hcs-vc-transaction"; import { HcsVcOperation } from "./vc/hcs-vc-operation"; import { HcsDidResolver } from "./did/hcs-did-resolver"; import { HcsDidTopicListener } from "./did/hcs-did-topic-listener"; import { HcsVcStatusResolver } from "./vc/hcs-vc-status-resolver"; import { HcsVcTopicListener } from "./vc/hcs-vc-topic-listener"; /** * Appnet's identity network based on Hedera HCS DID method specification. */ export declare class HcsIdentityNetwork { /** * The address book of appnet's identity network. */ private addressBook; /** * The Hedera network on which this identity network is created. */ private network; /** * Instantiates existing identity network from a provided address book. * * @param network The Hedera network. * @param addressBook The {@link AddressBook} of the identity network. * @return The identity network instance. */ static fromAddressBook(network: string, addressBook: AddressBook): HcsIdentityNetwork; /** * Instantiates existing identity network using an address book file read from Hedera File Service. * * @param client The Hedera network client. * @param network The Hedera network. * @param addressBookFileId The FileID of {@link AddressBook} file stored on Hedera File Service. * @return The identity network instance. */ static fromAddressBookFile(client: Client, network: string, addressBookFileId: FileId): Promise; /** * Instantiates existing identity network using a DID generated for this network. * * @param client The Hedera network client. * @param hcsDid The Hedera HCS DID. * @return The identity network instance. */ static fromHcsDid(client: Client, hcsDid: HcsDid): Promise; /** * Instantiates a {@link HcsDidTransaction} to perform the specified operation on the DID document. * * @param operation The operation to be performed on a DID document. * @return The {@link HcsDidTransaction} instance. */ createDidTransaction(operation: DidMethodOperation): HcsDidTransaction; /** * Instantiates a {@link HcsDidTransaction} to perform the specified operation on the DID document. * * @param message The DID topic message ready to for sending. * @return The {@link HcsDidTransaction} instance. */ createDidTransaction(message: MessageEnvelope): HcsDidTransaction; /** * Instantiates a {@link HcsVcTransaction} to perform the specified operation on the VC document. * * @param operation The type of operation. * @param credentialHash Credential hash. * @param signerPublicKey Public key of the signer (issuer). * @return The transaction instance. */ createVcTransaction(operation: HcsVcOperation, credentialHash: string, signerPublicKey: PublicKey): HcsVcTransaction; /** * Instantiates a {@link HcsVcTransaction} to perform the specified operation on the VC document status. * * @param message The VC topic message ready to for sending. * @param signerPublicKey Public key of the signer (usually issuer). * @return The {@link HcsVcTransaction} instance. */ createVcTransaction(message: MessageEnvelope, signerPublicKey: PublicKey): HcsVcTransaction; /** * Returns the Hedera network on which this identity network runs. * * @return The Hedera network. */ getNetwork(): string; /** * Generates a new DID and it's root key. * * @param withTid Indicates if DID topic ID should be added to the DID as tid parameter. * @return Generated {@link HcsDid} with it's private DID root key. */ generateDid(withTid: boolean): HcsDid; generateDid(privateKey: PrivateKey, withTid: boolean): HcsDid; /** * Generates a new DID from the given public DID root key. * * @param publicKey A DID root key. * @param withTid Indicates if DID topic ID should be added to the DID as tid parameter. * @return A newly generated DID. */ generateDid(publicKey: PublicKey, withTid: boolean): HcsDid; /** * Returns a DID resolver for this network. * * @return The DID resolver for this network. */ getDidResolver(): HcsDidResolver; /** * Returns DID topic ID for this network. * * @return The DID topic ID. */ getDidTopicId(): TopicId; /** * Returns a DID topic listener for this network. * * @return The DID topic listener. */ getDidTopicListener(): HcsDidTopicListener; /** * Returns Verifiable Credentials topic ID for this network. * * @return The VC topic ID. */ getVcTopicId(): TopicId; /** * Returns the address book of this identity network. * * @return The address book of this identity network. */ getAddressBook(): AddressBook; /** * Returns a VC status resolver for this network. * * @return The VC status resolver for this network. */ getVcStatusResolver(): HcsVcStatusResolver; /** * Returns a VC status resolver for this network. * Resolver will validate signatures of topic messages against public keys supplied * by the given provider. * * @param publicKeysProvider Provider of a public keys acceptable for a given VC hash. * @return The VC status resolver for this network. */ getVcStatusResolver(publicKeysProvider: (t: string) => PublicKey[]): HcsVcStatusResolver; /** * Returns a VC topic listener for this network. * * @return The VC topic listener. */ getVcTopicListener(): HcsVcTopicListener; /** * Returns a VC topic listener for this network. * This listener will validate signatures of topic messages against public keys supplied * by the given provider. * * @param publicKeysProvider Provider of a public keys acceptable for a given VC hash. * @return The VC topic listener. */ getVcTopicListener(publicKeysProvider: (t: string) => PublicKey[]): HcsVcTopicListener; }