API
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interfaces
DisplayableIdentity |
IdentityClientOptions |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: DisplayableIdentity
export interface DisplayableIdentity {
name: string;
avatarURL: string;
abbreviatedKey: string;
identityKey: string;
badgeIconURL: string;
badgeLabel: string;
badgeClickURL: string;
}
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: IdentityClientOptions
export interface IdentityClientOptions {
protocolID: WalletProtocol;
keyID: string;
tokenAmount: number;
outputIndex: number;
}
See also: WalletProtocol
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Classes
Class: IdentityClient
IdentityClient lets you discover who others are, and let the world know who you are.
export class IdentityClient {
constructor(wallet?: WalletInterface, private readonly options = DEFAULT_IDENTITY_CLIENT_OPTIONS, private readonly originator?: OriginatorDomainNameStringUnder250Bytes)
async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
async resolveByIdentityKey(args: DiscoverByIdentityKeyArgs): Promise<DisplayableIdentity[]>
async resolveByAttributes(args: DiscoverByAttributesArgs): Promise<DisplayableIdentity[]>
static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity
}
See also: BroadcastFailure, BroadcastResponse, CertificateFieldNameUnder50Bytes, DEFAULT_IDENTITY_CLIENT_OPTIONS, DiscoverByAttributesArgs, DiscoverByIdentityKeyArgs, DisplayableIdentity, IdentityCertificate, OriginatorDomainNameStringUnder250Bytes, WalletCertificate, WalletInterface
Method parseIdentity
TODO: Implement once revocation overlay is created Remove public certificate revelation from overlay services by spending the identity token
Parse out identity and certifier attributes to display from an IdentityCertificate
See also: DisplayableIdentity, IdentityCertificateReturns
- IdentityToDisplay
Argument Details
- serialNumber
- Unique serial number of the certificate to revoke revelation
- identityToParse
- The Identity Certificate to parse
Method publiclyRevealAttributes
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.
async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
Returns
A promise that resolves with the broadcast result from the overlay network.
Argument Details
- certificate
- The master certificate to selectively reveal.
- fieldsToReveal
- An array of certificate field names to reveal. Only these fields will be included in the public certificate.
Throws
Throws an error if the certificate is invalid, the fields cannot be revealed, or if the broadcast fails.
Method resolveByAttributes
Resolves displayable identity certificates by specific identity attributes, issued by a trusted entity.
See also: DiscoverByAttributesArgs, DisplayableIdentityReturns
The promise resolves to displayable identities.
Argument Details
- args
- Attributes and optional parameters used to discover certificates.
Method resolveByIdentityKey
Resolves displayable identity certificates, issued to a given identity key by a trusted certifier.
See also: DiscoverByIdentityKeyArgs, DisplayableIdentityReturns
The promise resolves to displayable identities.
Argument Details
- args
- Arguments for requesting the discovery based on the identity key.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Functions
Types
Enums
Variables
DEFAULT_IDENTITY_CLIENT_OPTIONS |
KNOWN_IDENTITY_TYPES |
defaultIdentity |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Variable: DEFAULT_IDENTITY_CLIENT_OPTIONS
DEFAULT_IDENTITY_CLIENT_OPTIONS: IdentityClientOptions = {
protocolID: [1, "identity"],
keyID: "1",
tokenAmount: 1,
outputIndex: 0
}
See also: IdentityClientOptions
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Variable: KNOWN_IDENTITY_TYPES
KNOWN_IDENTITY_TYPES = {
identiCert: "z40BOInXkI8m7f/wBrv4MJ09bZfzZbTj2fJqCtONqCY=",
discordCert: "2TgqRC35B1zehGmB21xveZNc7i5iqHc0uxMb+1NMPW4=",
phoneCert: "mffUklUzxbHr65xLohn0hRL0Tq2GjW1GYF/OPfzqJ6A=",
xCert: "vdDWvftf1H+5+ZprUw123kjHlywH+v20aPQTuXgMpNc=",
registrant: "YoPsbfR6YQczjzPdHCoGC7nJsOdPQR50+SYqcWpJ0y0=",
emailCert: "exOl3KM0dIJ04EW5pZgbZmPag6MdJXd3/a1enmUU/BA=",
anyone: "mfkOMfLDQmrr3SBxBQ5WeE+6Hy3VJRFq6w4A5Ljtlis=",
self: "Hkge6X5JRxt1cWXtHLCrSTg6dCVTxjQJJ48iOYd7n3g=",
coolCert: "AGfk/WrT1eBDXpz3mcw386Zww2HmqcIn3uY6x4Af1eo="
}
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Variable: defaultIdentity
defaultIdentity: DisplayableIdentity = {
name: "Unknown Identity",
avatarURL: "XUUB8bbn9fEthk15Ge3zTQXypUShfC94vFjp65v7u5CQ8qkpxzst",
identityKey: "",
abbreviatedKey: "",
badgeIconURL: "XUUV39HVPkpmMzYNTx7rpKzJvXfeiVyQWg2vfSpjBAuhunTCA9uG",
badgeLabel: "Not verified by anyone you trust.",
badgeClickURL: "https://projectbabbage.com/docs/unknown-identity"
}
See also: DisplayableIdentity
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables