UNPKG

digiid-ts

Version:

A modern TypeScript implementation of the DigiID authentication protocol.

25 lines 1.32 kB
import { DigiIDCallbackData, DigiIDUriOptions, DigiIDVerificationResult, DigiIDVerifyOptions } from './types'; /** * INTERNAL: Verifies the signature using @noble/curves. * Exported primarily for testing purposes (mocking/spying). * @internal */ export declare function _internalVerifySignature(uri: string, address: string, signature: string): Promise<boolean>; /** * Generates a DigiID authentication URI. * * @param options - Options for URI generation, including the callback URL. * @returns The generated DigiID URI string. * @throws {DigiIDError} If the callback URL is invalid or missing. */ export declare function generateDigiIDUri(options: DigiIDUriOptions): string; /** * Verifies the signature and data received from a DigiID callback. * * @param callbackData - The data received from the wallet (address, uri, signature). * @param verifyOptions - Options for verification, including the expected callback URL and nonce. * @returns {Promise<DigiIDVerificationResult>} A promise that resolves with verification details if successful. * @throws {DigiIDError} If validation or signature verification fails. */ export declare function verifyDigiIDCallback(callbackData: DigiIDCallbackData, verifyOptions: DigiIDVerifyOptions): Promise<DigiIDVerificationResult>; //# sourceMappingURL=digiid.d.ts.map