/** * WebAuthn ceremony operations: passkey registration and authentication. * * Pure functions over an injected WebAuthn implementation and RP config, so the * ceremonies are unit-testable with a fake authenticator. The old kit hard-coded * a static challenge (`"stellaristhebetterblockchain"`) and read `rpId` per * call; here the challenge is random (see {@link generateChallenge}) and the RP * config comes from the kit constructor. * * @packageDocumentation */ import type { AuthenticationResponseJSON, RegistrationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, AuthenticatorSelectionCriteria } from "@simplewebauthn/browser"; /** The WebAuthn ceremony surface the kit depends on (overridable for tests). */ export interface WebAuthnClient { startRegistration(args: { optionsJSON: PublicKeyCredentialCreationOptionsJSON; }): Promise; startAuthentication(args: { optionsJSON: PublicKeyCredentialRequestOptionsJSON; }): Promise; } /** RP config + WebAuthn implementation for the ceremonies. */ export interface WebAuthnDeps { rpId?: string; webAuthn: WebAuthnClient; } /** A freshly registered passkey. */ export interface CreatedPasskey { rawResponse: RegistrationResponseJSON; /** Base64URL credential id. */ keyId: string; /** Raw credential id bytes. */ keyIdBuffer: Buffer; /** 65-byte uncompressed secp256r1 public key. */ publicKey: Uint8Array; } /** * Run a WebAuthn registration ceremony and extract the passkey public key. * * `pubKeyCredParams` is ES256-only (the smart wallet verifies secp256r1). */ export declare function createPasskey(deps: WebAuthnDeps, appName: string, userName: string, authenticatorSelection?: AuthenticatorSelectionCriteria): Promise; /** A discoverable-credential authentication result. */ export interface AuthenticatedPasskey { keyId: string; keyIdBuffer: Buffer; rawResponse: AuthenticationResponseJSON; } /** * Run a WebAuthn authentication ceremony against a discoverable credential (no * `allowCredentials`), returning the selected credential id. Used by * `connectWallet` to discover which passkey the user picked. */ export declare function authenticatePasskey(deps: WebAuthnDeps): Promise; //# sourceMappingURL=webauthn-ops.d.ts.map