@arcblock/did
Version:
Javascript lib to work with ArcBlock DID
28 lines • 947 B
text/typescript
//#region src/entity.d.ts
/**
* Cross-Method Entity Association
*
* Functions for comparing DID identity across different methods.
* Two DIDs with different methods but the same identifier represent the same entity.
*/
/**
* Get the entity identifier from a DID (strips method prefix).
* This is the canonical identity across methods.
*
* @param did - A full DID or bare address
* @returns The entity identifier
*/
declare function getEntityId(did: string): string;
/**
* Check if two DIDs represent the same entity.
* Compares the identifier portion (case-insensitive), ignoring the method prefix.
*
* For did:name DIDs, performs exact string comparison (names are case-insensitive).
*
* @param a - First DID or address
* @param b - Second DID or address
* @returns true if both DIDs refer to the same entity
*/
declare function isSameEntity(a: unknown, b: unknown): boolean;
//#endregion
export { getEntityId, isSameEntity };