UNPKG

@bsv/sdk

Version:

BSV Blockchain Software Development Kit

50 lines 3.17 kB
import { DisplayableIdentity } from './types/index.js'; import { CertificateFieldNameUnder50Bytes, DiscoverByAttributesArgs, DiscoverByIdentityKeyArgs, IdentityCertificate, OriginatorDomainNameStringUnder250Bytes, WalletCertificate, WalletInterface } from '../wallet/index.js'; import { BroadcastFailure, BroadcastResponse } from '../transaction/index.js'; /** * IdentityClient lets you discover who others are, and let the world know who you are. */ export declare class IdentityClient { private readonly options; private readonly originator?; private readonly authClient; private readonly wallet; constructor(wallet?: WalletInterface, options?: import("./types/index.js").IdentityClientOptions, originator?: OriginatorDomainNameStringUnder250Bytes); /** * Publicly reveals selected fields from a given certificate by creating a publicly verifiable certificate. * The publicly revealed certificate is included in a blockchain transaction and broadcast to a federated overlay node. * * @param {Certificate} certificate - The master certificate to selectively reveal. * @param {CertificateFieldNameUnder50Bytes[]} fieldsToReveal - An array of certificate field names to reveal. Only these fields will be included in the public certificate. * * @returns {Promise<object>} A promise that resolves with the broadcast result from the overlay network. * @throws {Error} Throws an error if the certificate is invalid, the fields cannot be revealed, or if the broadcast fails. */ publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>; /** * Resolves displayable identity certificates, issued to a given identity key by a trusted certifier. * * @param {DiscoverByIdentityKeyArgs} args - Arguments for requesting the discovery based on the identity key. * @returns {Promise<DisplayableIdentity[]>} The promise resolves to displayable identities. */ resolveByIdentityKey(args: DiscoverByIdentityKeyArgs): Promise<DisplayableIdentity[]>; /** * Resolves displayable identity certificates by specific identity attributes, issued by a trusted entity. * * @param {DiscoverByAttributesArgs} args - Attributes and optional parameters used to discover certificates. * @returns {Promise<DisplayableIdentity[]>} The promise resolves to displayable identities. */ resolveByAttributes(args: DiscoverByAttributesArgs): Promise<DisplayableIdentity[]>; /** * TODO: Implement once revocation overlay is created * Remove public certificate revelation from overlay services by spending the identity token * @param serialNumber - Unique serial number of the certificate to revoke revelation */ /** * Parse out identity and certifier attributes to display from an IdentityCertificate * @param identityToParse - The Identity Certificate to parse * @returns - IdentityToDisplay */ static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity; } //# sourceMappingURL=IdentityClient.d.ts.map