import { type ChainNamespace, type JobHandle, type ServerKeyringHttp, type SignatureRequestContext } from "../../keyring"; import type { RelayTransactionSubmitInput } from "./relayTypes"; import { type PollOpts } from "./remoteSigningJob"; import type { JobStatus, MfaApprovalDetails, SignatureMethod, SignatureRequestStatus, TransactionTx, TxJobStatus } from "./types"; export type RemoteSigningClientDeps = { http: ServerKeyringHttp; projectId: string; }; /** * Shared HTTP client for remote signing routes. Used by `EvmServerAdapter` * (server signs) and `EvmByokAdapter` (client embeds a pre-computed * signature / signed raw tx). The only delta for BYOK is the optional * `signature` / `signedTransaction` fields on the create-request bodies. */ export declare class RemoteSigningClient { #private; constructor(deps: RemoteSigningClientDeps); submitSignatureRequest(namespace: ChainNamespace, walletAddress: string, method: SignatureMethod, payload: object, ctx: SignatureRequestContext, signature?: string): Promise; submitTransaction(namespace: ChainNamespace, tx: TransactionTx, ctx: SignatureRequestContext, signedTransaction?: string): Promise; /** * Submit a gasless EIP-7702 relay batch (`eth_sendRelayTransaction` / * `redeemDelegations`). Reuses the transaction-requests route; job status * polling is identical to {@link submitTransaction}. */ submitRelayTransaction(input: RelayTransactionSubmitInput, ctx: SignatureRequestContext): Promise; getJobStatus(handle: JobHandle): Promise; awaitJob(handle: JobHandle, opts?: PollOpts): Promise; /** * Unified MFA approval lookup by transaction-/signature-request id * (`pollingId`). The backend never surfaces a separate approval id to the * CLI — callers pass the request id they already hold from submit. * * Throws {@link RemoteSigningError} with code `NOT_FOUND` when no approval * exists for the request yet; use an optimistic wrapper to treat that as * "no approval (yet)" while a job is still in `EVALUATING`. */ getMfaApproval(requestId: string): Promise; /** * Poll a transaction job until terminal, narrowed to the tx-typed status. * Callers pass a transaction `JobHandle` (`kind: TRANSACTION`), so the * polled status is always a {@link TxJobStatus}. */ awaitTxJob(handle: JobHandle, opts?: PollOpts): Promise; /** * Submit a signature request, poll until terminal, and resolve to the final * signature. Shared by the server and BYOK adapters: * * - Server mode (no embedded `signature`): the service signs, so success is * `SIGNED` carrying `final.signature`. * - BYOK mode (embedded `signature`): the service only evaluates policy and * never signs, so success is `APPROVED` with no server signature — the * locally computed `signature` passed in is returned. A server signature * (`SIGNED`) is still honored defensively if mimir ever returns one. * * Any other terminal state (`DENIED`/`EXPIRED`/`FAILED`, or a non-signature * job on a signature route) throws {@link JobFailedError}. */ signAndAwait(namespace: ChainNamespace, walletAddress: string, method: SignatureMethod, payload: object, ctx: SignatureRequestContext, opts?: PollOpts, signature?: string): Promise; } export declare function isSignRequestTerminal(status: SignatureRequestStatus): boolean;