~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/atlibs-identlink

ident.link agent-of walk with grants over CAR-verified sync.getRecord: Rust crate identlink, wasm, JS

1 collaborator
0
0
main
49 lines · 1.7 KB Raw History
export declare const ENDORSEMENT_NSID: "link.ident.endorsement";
export declare const ASSOCIATION_NSID: "com.publicdomainrelay.temp.market.association";
export declare const AGENT_OF_PREFIX: "https://ident.link/agent-of/";

export interface DidDoc {
  id?: string;
  alsoKnownAs?: string[];
  verificationMethod?: { id: string; type?: string; controller?: string; publicKeyMultibase?: string }[];
  service?: { id: string; type: string; serviceEndpoint: unknown }[];
}

export interface StrongRef {
  uri: string;
  cid: string;
}

export interface Io {
  resolveDid?(did: string): Promise<DidDoc | null> | DidDoc | null;
  getRecord?(repo: string, collection: string, rkey: string): Promise<unknown | null> | unknown | null;
  contractHeld?(contract: StrongRef, authorities: string[]): Promise<boolean> | boolean;
  now?(): number | Date;
}

export interface Options {
  maxDepth?: number;
  budget?: number;
}

export interface Ancestor {
  did: string;
  depth: number;
  expiresAt?: string;
}

export interface Walk {
  agent: string;
  ancestors: Ancestor[];
  roots: string[];
  expiresAt?: string;
  truncated: boolean;
  errors: string[];
}

export declare function load(wasmModule?: BufferSource | WebAssembly.Module | URL | string | Response): Promise<unknown>;
export declare function walk(io: Io, agent: string, options?: Options): Promise<Walk>;
export declare function agentOf(alsoKnownAs: string[]): Promise<string[]>;
export declare function verifyRecord(car: Uint8Array, doc: DidDoc, repo: string, collection: string, rkey: string): Promise<unknown | null>;
export declare function marketContractHeld(io: Io, contract: StrongRef, authorities: string[]): Promise<boolean>;
export declare function recordCid(value: unknown): Promise<string>;