import init, * as wasm from "./pkg/identlink.js"; export const ENDORSEMENT_NSID = "link.ident.endorsement"; export const ASSOCIATION_NSID = "com.publicdomainrelay.temp.market.association"; export const AGENT_OF_PREFIX = "https://ident.link/agent-of/"; let ready; export const load = (wasmModule) => (ready ??= init(wasmModule === undefined ? undefined : { module_or_path: wasmModule })); export async function walk(io, agent, options) { await load(); return wasm.walk(io ?? {}, agent, options ?? {}); } export async function agentOf(alsoKnownAs) { await load(); return wasm.agentOf(alsoKnownAs); } export async function verifyRecord(car, doc, repo, collection, rkey) { await load(); return wasm.verifyRecord(car, doc, repo, collection, rkey); } export async function marketContractHeld(io, contract, authorities) { await load(); return wasm.marketContractHeld(io ?? {}, contract, authorities); } export async function recordCid(value) { await load(); return wasm.recordCid(value); }