Skip to content

Audit Store

import { verify } from '@brivora/verify';
// In-memory store
const store = verify.createAuditStore({ type: 'memory' });
// File-based store
const store = verify.createAuditStore({ type: 'file', path: './audit' });
await store.save(result.proof);
// List all stored proofs
const proofs = await store.list();
// Retrieve a specific proof by hash
const proof = await store.load(proofHash);
// Get all proofs in a chain starting from a specific proof
const chain = await store.chain({ from: startHash });
const store = verify.createAuditStore({
type: 'custom',
adapter: {
save: async (proof) => { /* your storage logic */ },
load: async (hash) => { /* your retrieval logic */ },
list: async (options) => { /* your listing logic */ },
chain: async (options) => { /* your chain logic */ },
},
});