Skip to content

attestHuman

const result = await fidemark.attestHuman({
content, // string | Uint8Array
contentType, // string: MIME type or category
creator, // optional, defaults to the signer's address
createdAt, // optional, Unix timestamp; defaults to now
proofMethod, // optional, defaults to "wallet-signed"
refUID, // optional, parent attestation UID
});

Returns the attestation UID, transaction hash, and a public verify URL.

FieldTypeNotes
contentstring | Uint8Array / str | bytes / []byteHashed client-side with SHA-256. The bytes never leave your machine.
contentTypestringFree-form. Conventional values: text/article, image/jpeg, audio/wav, application/pdf.
creatorstringAddress of the human creator. Defaults to the signer’s address. Must match the signer: the resolver enforces creator == attester.
createdAtnumber | bigint / int / uint64Unix seconds. Defaults to now. Cannot be more than 1 day in the future.
proofMethodstringTrust layer. Defaults to wallet-signed. Must be on the resolver’s allowlist: see Trust layers.
CodeCause
INVALID_INPUTMissing signer, or both signer and privateKey were passed to the constructor.
VALIDATION_REJECTEDThe resolver rejected the attestation (mismatched creator, unknown proofMethod, future timestamp, empty field).
USER_REJECTEDA wallet (e.g. MetaMask) prompt was rejected by the user.
INSUFFICIENT_FUNDSThe signer’s address has no funds to pay gas.

Complete, copy-pasteable runnable. See Configuration for every constructor option.

import { Fidemark, getNetwork } from "@fidemark/sdk";
const fidemark = new Fidemark({
network: getNetwork("base-sepolia"),
privateKey: process.env.PRIVATE_KEY,
});
const result = await fidemark.attestHuman({
content: articleMarkdown,
contentType: "text/article",
});
console.log(`Verify at ${result.verifyUrl}`);