import { ethers } from 'ethers'; import { TurnkeyConfig } from '../turnkeyClient.js'; /** * Turnkey's `signRawPayload` returns r/s as bare 32-byte hex (no `0x` prefix). * Validate the component is exactly 32 bytes (64 hex chars) after stripping any * prefix and return it `0x`-prefixed for ethers. */ export declare function normalizeSignatureComponent(label: string, value: string): string; /** * Lift Turnkey's recovery id into ethers' v space. Turnkey returns v as a hex * recovery id ("00"/"01"); ethers v5 `joinSignature` expects 27/28, and * misinterprets a bare 0/1. Values already in 27/28 form ("1b"/"1c") pass through * unchanged. A non-hex/garbage v throws. */ export declare function normalizeRecoveryV(v: string): number; /** * Turnkey signer for EVM transactions * Uses Turnkey's secure enclaves to sign transactions without exposing private keys * This is a custom ethers v5-compatible Signer that uses Turnkey SDK directly * Uses composition to access Turnkey functionality while extending ethers.Signer * * @example * ```typescript * const config: TurnkeyConfig = { * organizationId: 'your-org-id', * apiPublicKey: process.env.TURNKEY_API_PUBLIC_KEY, * apiPrivateKey: process.env.TURNKEY_API_PRIVATE_KEY, * privateKeyId: 'your-private-key-id', * publicKey: '0x...', // Ethereum address * }; * * const provider = new ethers.providers.JsonRpcProvider('...'); * const signer = new TurnkeyEvmSigner(config, provider); * * // Use with MultiProvider * multiProvider.setSigner('ethereum', signer); * ``` */ export declare class TurnkeyEvmSigner extends ethers.Signer { private readonly manager; readonly address: string; readonly provider: ethers.providers.Provider | undefined; constructor(config: TurnkeyConfig, provider?: ethers.providers.Provider); /** * Health check - delegates to manager */ healthCheck(): Promise; /** * Get an ethers Signer connected to the provided provider * This returns a new instance with the provider connected */ getSigner(provider: ethers.providers.Provider): Promise; /** * Connect this signer to a provider (creates new instance with proper configuration) */ connect(provider: ethers.providers.Provider): TurnkeyEvmSigner; /** * Get the address of this signer */ getAddress(): Promise; /** * Sign a transaction using Turnkey */ signTransaction(transaction: ethers.providers.TransactionRequest): Promise; /** * Sign a message using Turnkey */ signMessage(message: string | ethers.utils.Bytes): Promise; /** * EIP-712 typed-data signing per the ethers v5 Signer interface. * * Submits the full typed-data payload to Turnkey using * `PAYLOAD_ENCODING_EIP712` (rather than hashing locally and submitting an * opaque digest) so Turnkey policies can inspect the domain and message * fields — e.g. a Safe proposal's `to`/`value`/`data`/`operation`/`nonce` — * before authorizing the signature. Returns the canonical joined ECDSA * signature that downstream consumers like Safe Transaction Service expect * for typed-data sender signatures. */ _signTypedData(domain: ethers.TypedDataDomain, types: Record>, value: Record): Promise; /** * Validate the Turnkey activity completed, ensure r/s/v are well-formed, * and join them into ethers' canonical `0x{r}{s}{v}` ECDSA signature. */ private assembleSignature; /** * Populate a transaction with default values (nonce, gas, etc.) */ populateTransaction(transaction: ethers.providers.TransactionRequest): Promise; } //# sourceMappingURL=turnkey.d.ts.map