Quick Start
Constructors
Signer.fromPrivateKey
Convenience constructor for local signing:Signer.fromProvider
Compose a Signer from existing Provider and Account layers:Signer.Live
Base layer requiring all dependencies explicitly:Layer Pattern
Browser Wallet
Methods
signMessage — EIP-191 personal_signTransactionRequest
Transaction Types
Transaction Type Detection
The signer automatically detects which transaction type to use based on provided fields:- If
typeis explicitly provided → Use that type - If
authorizationListprovided → EIP-7702 (type 4) - If
blobVersionedHashesprovided → EIP-4844 (type 3) - If
maxFeePerGasormaxPriorityFeePerGasprovided → EIP-1559 (type 2) - If
accessListprovided withgasPrice→ EIP-2930 (type 1) - If
gasPriceprovided (no accessList) → Legacy (type 0) - If neither provided AND network supports EIP-1559 → EIP-1559 (type 2)
- If neither provided AND network doesn’t support EIP-1559 → Legacy (type 0)
Fee Calculation
When using EIP-1559 andmaxFeePerGas is not provided, it’s calculated as:
maxFeePerGas = 30 * 1.2 + 2 = 38 gwei
(baseFee * 12n) / 10n + maxPriorityFeePerGas
Nonce Management
Nonces are fetched usinggetTransactionCount('pending') to correctly account for pending transactions. This makes sequential sends safe.
⚠️ Concurrent sends still require care. If you send multiple transactions concurrently without waiting, they may race to fetch the same pending nonce. For concurrent sends:
- Manage nonces manually via
noncefield - Send transactions sequentially
Error Handling
Service Interface
Dependencies
Signer.Live requires these services:
| Service | Purpose |
|---|---|
ProviderService | Request-only layer used by free functions for gas/nonce/chainId lookups |
AccountService | Sign messages and transactions |
TransportService | Send raw transactions via RPC |
fromProvider and fromPrivateKey constructors compose these for you.
See Also
- Send Transactions Example — Complete transaction examples
- Provider Service — JSON-RPC provider operations
- Transport Service — HTTP/WebSocket transport layer
- HD Wallet Guide — Create signers from mnemonic
- EIP-1559 — Fee market change
- EIP-4844 — Blob transactions
- EIP-7702 — Set code transactions

