/** * Returns the flag for the user verification requirement. * * See: * * @param userVerification - The user verification requirement. * @returns The flag for the user verification requirement. */ export declare function userVerificationFlag(userVerification?: UserVerificationRequirement): number; /** * Encode bytes using the Base64 URL encoding. * * See * * @param data data to encode to `base64url` * @returns the `base64url` encoded data as a string. */ export declare function base64UrlEncode(data: string | Uint8Array | ArrayBuffer): string; /** * Decodes the x and y coordinates of the public key from a created public key credential response. * Inspired from . * * @param response - The authenticator attestation response. * @returns The x and y coordinates of the public key. */ export declare function decodePublicKey(response: Pick): { x: bigint; y: bigint; }; /** * Decode the additional client data JSON fields. This is the fields other than `type` and * `challenge` (including `origin` and any other additional client data fields that may be added by * the authenticator). * * See * * @param response - The authenticator assertion response. * @returns The client data JSON. */ export declare function decodeClientDataFields(response: Pick): string; /** * Decode the signature R and S values from the authenticator response's DER-encoded signature. * * Note that this implementation assumes that all lengths in the DER encoding fit into 8-bit * integers, which is true for the kinds of signatures we are decoding but generally false. I.e. * **this code should not be used in any serious application**. * * See: * - * - * * @param response - The authenticator assertion response. * @returns The r and s values of the signature. */ export declare function decodeSignature(response: Pick): { r: bigint; s: bigint; }; /** * Encodes the given WebAuthn signature into a string. This computes the ABI-encoded signature parameters: * ```solidity * abi.encode(authenticatorData, clientDataFields, r, s); * ``` * * @param authenticatorData - The authenticator data as a Uint8Array. * @param clientDataFields - The client data fields as a string. * @param r - The value of r as a bigint. * @param s - The value of s as a bigint. * @returns The encoded string. */ export declare function getSignatureBytes({ authenticatorData, clientDataFields, r, s, }: { authenticatorData: Uint8Array; clientDataFields: string; r: bigint; s: bigint; }): string; /** * Encodes the signature bytes for a WebAuthn signer. * * @param response - The authenticator assertion response. * @returns The encoded signature as a string. */ export declare function encodeWebAuthnSignature(response: AuthenticatorAssertionResponse): string; /** * Dummy client data JSON fields. This can be used for gas estimations, as it pads the fields enough * to account for variations in WebAuthn implementations. */ export declare const DUMMY_CLIENT_DATA_FIELDS: string; /** * Dummy authenticator data. This can be used for gas estimations, as it ensures that the correct * authenticator flags are set. */ export declare const DUMMY_AUTHENTICATOR_DATA: Uint8Array;