import { type ConnectionConfig } from "@alchemy/aa-core"; import { TurnkeyClient } from "@turnkey/http"; import EventEmitter from "eventemitter3"; import type { Hex } from "viem"; import type { AlchemySignerClientEvents, CreateAccountParams, EmailAuthParams, GetWebAuthnAttestationResult, SignerBody, SignerResponse, SignupResponse, User } from "./types"; export interface BaseSignerClientParams { stamper: TurnkeyClient["stamper"]; connection: ConnectionConfig; rootOrgId?: string; rpId?: string; } export type ExportWalletStamper = TurnkeyClient["stamper"] & { injectWalletExportBundle(bundle: string): Promise; injectKeyExportBundle(bundle: string): Promise; publicKey(): string | null; }; export declare abstract class BaseSignerClient { private _user; private connectionConfig; protected turnkeyClient: TurnkeyClient; protected rootOrg: string; protected eventEmitter: EventEmitter; constructor(params: BaseSignerClientParams); protected get user(): User | undefined; protected set user(user: User | undefined); protected setStamper(stamper: TurnkeyClient["stamper"]): void; protected exportWalletInner(params: { exportStamper: ExportWalletStamper; exportAs: "SEED_PHRASE" | "PRIVATE_KEY"; }): Promise; abstract createAccount(params: CreateAccountParams): Promise; abstract initEmailAuth(params: Omit): Promise<{ orgId: string; }>; abstract completeEmailAuth(params: { bundle: string; orgId: string; }): Promise; abstract disconnect(): Promise; abstract exportWallet(params: TExportWalletParams): Promise; abstract lookupUserWithPasskey(user?: User): Promise; protected abstract getWebAuthnAttestation(options: CredentialCreationOptions, userDetails?: { username: string; }): Promise; /** * Listen to events emitted by the client * * @param event the event you want to listen to * @param listener the callback function to execute when an event is fired * @returns a function that will remove the listener when called */ on: (event: E, listener: AlchemySignerClientEvents[E]) => () => EventEmitter; addPasskey: (options: CredentialCreationOptions) => Promise; whoami: (orgId?: string | undefined) => Promise; lookupUserByEmail: (email: string) => Promise<{ orgId: string | null; }>; /** * This will sign a message with the user's private key, without doing any transformations on the message. * For SignMessage or SignTypedData, the caller should hash the message before calling this method and pass * that result here. * * @param msg the hex representation of the bytes to sign * @returns the signature over the raw hex */ signRawMessage: (msg: Hex) => Promise<`0x${string}`>; getUser: () => User | null; request: (route: R, body: SignerBody) => Promise>; private exportAsSeedPhrase; private exportAsPrivateKey; protected pollActivityCompletion: (activity: Awaited>["activity"], organizationId: string, resultKey: T) => Promise>; } //# sourceMappingURL=base.d.ts.map