@rep3protocol/mintrail-sdk
v0.1.2
Published
Thin typed wrapper over the Mintrail Notary HTTP API.
Readme
@rep3protocol/mintrail-sdk
Thin typed wrapper over the Mintrail Notary HTTP API.
Install
pnpm add @rep3protocol/mintrail-sdkUsage
import { MintrailClient } from "@rep3protocol/mintrail-sdk";
const client = new MintrailClient({
baseUrl: "https://mintrail.rep3protocol.com", // default
apiKey: "your-api-key", // optional, sent as x-api-key
org: "your-org-id", // optional, sent as x-mintrail-org
});
const health = await client.health();
const logs = await client.listLogs();
// Unauthenticated: health, anchorHealth, verifyPublic
await client.verifyPublic({ logId: "...", epoch: 1, debug: true });
// Authenticated (apiKey + org): listLogs, createLog, append, snapshot, shareLink, bundleZip
const created = await client.createLog({});
await client.append({ logId: created.id!, payload: "data" });
await client.snapshot({ logId: created.id!, epoch: 0 });
await client.shareLink({ logId: created.id!, epoch: 0, includeEvidence: true });
await client.bundleZip({ logId: created.id!, epoch: 0, includeEvidence: false });health,anchorHealth, andverifyPublicare unauthenticated; other methods usex-api-keyandx-mintrail-orgwhen provided.- Uses global
fetch; you can inject a customfetchvia options.
