UNPKG

@zkp2p/reclaim-witness-sdk

Version:

<div> <div> <img src="https://raw.githubusercontent.com/reclaimprotocol/.github/main/assets/banners/Attestor-Core.png" /> </div> </div>

23 lines (22 loc) 945 B
import { IncomingMessage } from 'http'; import { ServiceSignatureType } from '../../proto/api'; /** * Sign message using the PRIVATE_KEY env var. */ export declare function signAsAttestor(data: Uint8Array | string, scheme: ServiceSignatureType): Uint8Array<ArrayBufferLike> | Promise<Uint8Array<ArrayBufferLike>>; /** * Obtain the address on chain, from the PRIVATE_KEY env var. */ export declare function getAttestorAddress(scheme: ServiceSignatureType): string; /** * Nice parse JSON with a key. * If the data is empty, returns an empty object. * And if the JSON is invalid, throws a bad request error, * with the key in the error message. */ export declare function niceParseJsonObject(data: string, key: string): any; /** * Extract any initial messages sent via the query string, * in the `messages` parameter. */ export declare function getInitialMessagesFromQuery(req: IncomingMessage): import("../../proto/api").RPCMessage[];