import type { Hex } from "viem"; import type { Encoding, RelayMethod } from "../types/Delegation"; /** * ADR-0008 relay authorization entry on `tx.authorizationList`. Present on * BYOK relay (signed client-side); forbidden on server-wallet relay (Mimir * injects the 7702 upgrade). The wire-level invariant is enforced by * `EvmServerAdapter.submitRelayTransaction` / `EvmByokAdapter.submitRelayTransaction`. */ export type RelayAuthorizationWire = { address: Hex; chainId: number; nonce: number; r: Hex; s: Hex; yParity: number; }; /** ADR-0008 relay execution leg. */ export type RelayExecutionWire = { target: Hex; value?: string; callData?: string; }; export type RelayCaveatWire = { enforcer: Hex; terms: Hex; args?: string; }; /** * ADR-0008 relay delegation. `delegator` / `delegate` / `authority` / `salt` * are always present (they mirror `UnsignedDelegation`); `caveats` is * optional so an empty caveat list can be omitted on the wire; `signature` * is present for BYOK relay and omitted for server-wallet relay (Mimir signs * after MFA). */ export type RelayDelegationWire = { delegator: Hex; delegate: Hex; authority: Hex; salt: string; caveats?: RelayCaveatWire[]; signature?: string; }; export type RelayTransactionTx = { from: Hex; chainId: number; authorizationList?: RelayAuthorizationWire[]; }; /** Body posted to `POST /v1/projects/:projectId/transaction-requests` for gasless relay (ADR-0008). */ export type RelayTransactionRequestBody = { requestId: string; method: RelayMethod.EthSendRelayTransaction; encoding: Encoding.RedeemDelegations; tx: RelayTransactionTx; executions: RelayExecutionWire[]; delegation: RelayDelegationWire; txIntent?: string; /** Bridge-api quote id this relay batch executes; see `SignatureRequestContext.bridgeQuoteId`. */ bridgeQuoteId?: string; }; /** Inputs for {@link RemoteSigningClient.submitRelayTransaction} after wire mapping. */ export type RelayTransactionSubmitInput = { from: Hex; chainId: number; executions: RelayExecutionWire[]; delegation: RelayDelegationWire; authorizationList?: RelayAuthorizationWire[]; };