@orangecheck/stamp-ots / makeDefaultAnchorVerifier
Function: makeDefaultAnchorVerifier()
function makeDefaultAnchorVerifier(opts: {
headerSource: BlockHeaderSource;
}): Promise<(proofB64: string, blockHeight: number, blockHash: string, envelopeId: string) => Promise<boolean>>;
Defined in: anchor.ts:128
Default anchor verifier that dynamically imports the opentimestamps npm
package and wires it into makeAnchorVerifier. The import is lazy so
consumers who only need calendar submission don't pay the dep cost.
Install opentimestamps alongside @orangecheck/stamp-ots to use this:
npm i @orangecheck/stamp-ots opentimestamps
Then:
const verifyOtsAnchor = await makeDefaultAnchorVerifier({ headerSource }); await verify({ envelope, verifyOtsAnchor });
Throws if opentimestamps isn't resolvable. That's intentional — callers
who haven't installed it should use makeAnchorVerifier with their own
walker instead, so the failure surfaces immediately rather than silently
reporting every stamp as unverified.
Parameters
| Parameter | Type |
|---|---|
opts | { headerSource: BlockHeaderSource; } |
opts.headerSource | BlockHeaderSource |
Returns
Promise<(proofB64: string, blockHeight: number, blockHash: string, envelopeId: string) => Promise<boolean>>