parseFideId
Parse a Fide ID into its constituent components. Decomposes a Fide ID into entity type, source type, and fingerprint, converting hex characters to their corresponding entity type names.
Parameters
Returns
Prop
Type
import { parseFideId } from '@fide.work/fcp';
const result = parseFideId('did:fide:0x152f02f1d1c1e62b2e569e11818420c1968be3d9');Related Constants
FIDE_CHAR_TO_ENTITY_TYPE
Reverse lookup: character code to entity type name
export const FIDE_CHAR_TO_ENTITY_TYPE: Record<string, "Statement" | "Person" | "Organization" | "AutonomousAgent" | "Place" | "Event" | "Product" | "CreativeWork">Type Definitions
type ParsedFideId
Parsed Fide ID components.
ParsedFideIdProperties
Prop
Type
isValidFideId
Validate that a string is a properly formatted Fide ID. Checks that the value follows the standard Fide ID format: `did:fide:0x` prefix followed by exactly 40 hexadecimal characters (case-insensitive).
buildStatementBatchWithRoot
Build a batch of statements and derive a deterministic batch root. Root derivation: - `statementFideIds` are lexicographically sorted - Sorted IDs are joined with `\\n` - SHA-256 is computed over that byte sequence - Result is returned as lowercase hex string