import { KeyringController } from "@toruslabs/ethereum-controllers"; import { type ByokChainAdapter, type DeriveByokWalletOpts, type DerivedByokWallet, type EvmNamespace, type JobHandle, type ServerKeyringHttp, type SignatureRequestContext } from "../../keyring"; import { type MfaApprovalDetails, type PollOpts, type RelayTransactionSubmitInput, type SignatureRequestStatus, type TransactionTx, type TxJobStatus } from "../remote-signing"; import type { EvmSigner } from "../types/EvmSigner"; import type { EVMTypedData } from "../types/EVMTypedData"; export type EvmDerivationPath = `m/44'/60'/0'/0/${number}`; export type EvmByokAdapterDeps = { http: ServerKeyringHttp; projectId: string; }; /** * EVM adapter for the BYOK mnemonic keyring. Derives wallets along the * standard `m/44'/60'/0'/0/i` path and wraps the toruslabs `KeyringController` * as the in-process signer. Implements `EvmSigner` so wallet clients reach * signing methods polymorphically via `keyring.getAdapter("evm")` — same * call site whether the keyring is BYOK or server. * * Server-backed: signing and transaction submission route through the remote * signing service for Shield/policy/MFA evaluation whenever a * `SignatureRequestContext` is supplied. The client signs locally first and * embeds the signature (or signed raw tx) in the create-request body. */ export declare class EvmByokAdapter implements ByokChainAdapter, EvmSigner { #private; readonly namespace: "evm"; constructor(deps: EvmByokAdapterDeps); derivationPath(index: number): EvmDerivationPath; normalizeAddress(address: string): string; derive(opts: DeriveByokWalletOpts): Promise>; importDerivedKey(derived: DerivedByokWallet): Promise<{ address: string; }>; /** * Sign a `personal_sign` message purely in-process, never routing through * the server even when a connection is configured. Bootstrapping flows — * notably the wallet-registration challenge — must produce a signature * BEFORE the wallet exists server-side, so they cannot go through * `/signature-requests` (which evaluates an already-registered wallet). * * Distinct from {@link signPersonalMessage} on purpose: registration's * "always local" requirement is an explicit invariant here, not an * accident of whether a `SignatureRequestContext` happens to be supplied. */ signPersonalMessageLocal(message: string, address: string): Promise; signTransaction(tx: T, address: string): Promise; signEip7702Authorization(...args: Parameters): ReturnType; signMessage(message: string, address: string, ctx?: SignatureRequestContext, _opts?: PollOpts): Promise; signPersonalMessage(message: string, address: string, ctx?: SignatureRequestContext, opts?: PollOpts): Promise; signTypedData(typedData: EVMTypedData, address: string, ctx?: SignatureRequestContext, opts?: PollOpts): Promise; /** * Server-backed BYOK: submit a client-signed raw tx for policy evaluation * and server-side broadcast. Pair with {@link awaitTx} when the initial * status is non-terminal. */ submitSignedTransaction(signedTransaction: string, tx: TransactionTx, ctx: SignatureRequestContext): Promise; /** * Submit a paid ERC-7821 `execute()` batch that was signed client-side. * Forces `encoding: erc7821`. May carry a BYOK-signed `authorizationList` * for first-use EIP-7702 upgrade. */ submitErc7821Transaction(signedTransaction: string, tx: TransactionTx, ctx: SignatureRequestContext): Promise; awaitTx(handle: JobHandle, opts?: PollOpts): Promise; /** Alias for {@link awaitTx} — matches the server adapter surface for job polling. */ awaitJob(handle: JobHandle, opts?: PollOpts): Promise; getJobStatus(handle: JobHandle): Promise; /** Unified MFA approval lookup by request id — see {@link RemoteSigningClient.getMfaApproval}. */ getMfaApproval(requestId: string): Promise; submitPersonalSign(walletAddress: string, message: string, ctx: SignatureRequestContext): Promise; submitSignTypedData(walletAddress: string, data: EVMTypedData, ctx: SignatureRequestContext): Promise; submitRelayTransaction(input: RelayTransactionSubmitInput, ctx: SignatureRequestContext): Promise; /** Gasless relay job status — same transaction-requests route as {@link getJobStatus}. */ getRelayJobStatus(handle: JobHandle): Promise; awaitRelayJob(handle: JobHandle, opts?: PollOpts): Promise; }