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

buildStatementBatchWithRoot(inputs)

Parameters

inputsStatementInput[]*
Array of statement inputs.

Returns

Prop

Type

import { buildStatementBatchWithRoot } from '@fide.work/fcp';

const result = await buildStatementBatchWithRoot([{ subject: { rawIdentifier: "https://x.com/alice", entityType: "Person", sourceType: "Product" }, predicate: { rawIdentifier: "https://schema.org/name", entityType: "CreativeWork", sourceType: "Product" }, object: { rawIdentifier: "Alice", entityType: "CreativeWork", sourceType: "CreativeWork" } }, { subject: { rawIdentifier: "https://x.com/bob", entityType: "Person", sourceType: "Product" }, predicate: { rawIdentifier: "https://schema.org/worksFor", entityType: "CreativeWork", sourceType: "Product" }, object: { rawIdentifier: "https://www.acme.com", entityType: "Organization", sourceType: "Product" } }]);

Type Definitions

type StatementInput

Input for creating a statement. All triples require rawIdentifier + entityType + sourceType. The SDK always computes Fide IDs internally to avoid trust/validation issues with pre-calculated hashes.

StatementInput

Properties

Prop

Type

type StatementBatchWithRoot

Batch build result with deterministic content root.

StatementBatchWithRoot

Properties

Prop

Type