eth_signTransaction - Cronos RPC Method
Sign a transaction without broadcasting it on Cronos. Public shared RPC endpoints commonly return deprecation, unsupported-method, or account-management errors because they do not keep unlocked signers.
Signs a transaction with the private key of the specified account on Cronos without submitting it to the network.
Why Cronos? Build on the EVM-compatible Crypto.com blockchain with fast finality and deep Crypto.com ecosystem integration.
Security Warning: Public Dwellir endpoints do not keep unlocked signers. On shared infrastructure,
eth_signTransactioncommonly returns a deprecation, unsupported-method, or account-management error instead of a signed payload. For production use, sign transactions client-side using libraries like ethers.js or web3.py, then broadcast witheth_sendRawTransaction.
When to Use This Method
eth_signTransaction is relevant for Cronos developers building DeFi and payment applications in limited scenarios:
- Understanding the Signing Flow — Learn how transaction signing works before implementing client-side signing
- Local Development — Sign transactions on a local dev node (Hardhat, Anvil, Ganache) where accounts are unlocked
- Offline Signing Workflows — Generate signed transaction payloads for later broadcast
Code Examples
Common Use Cases
1. Offline Transaction Signing
Sign transactions on an air-gapped machine for later broadcast:
import { Wallet } from 'ethers';
async function createSignedTransaction(privateKey, to, value, { chainId, nonce, gasLimit }) {
const wallet = new Wallet(privateKey);
const tx = {
to,
value,
gasLimit,
nonce,
chainId,
};
const signedTx = await wallet.signTransaction(tx);
// Store signedTx and broadcast from an online machine
return signedTx;
}2. Batch Transaction Preparation
Pre-sign multiple transactions for sequential submission on Cronos:
async function prepareBatch(wallet, transactions) {
const signed = [];
for (let i = 0; i < transactions.length; i++) {
const tx = {
...transactions[i],
nonce: baseNonce + i
};
signed.push(await wallet.signTransaction(tx));
}
return signed; // Submit via eth_sendRawTransaction in order
}Error Handling
Common errors and solutions:
| Error Code | Description | Solution |
|---|---|---|
| -32000 | Deprecated, unavailable, or account not unlocked | Use client-side signing instead of node-side signing |
| -32601 | Method not found | Method disabled on this node — use client-side signing |
| -32602 | Invalid params | Verify transaction fields (from, to, gas, etc.) |
| -32603 | Internal error | Check node logs for signing failures |
Related Methods
eth_sendRawTransaction— Broadcast a signed transactioneth_sendTransaction— Sign and send in one step (requires unlocked account)eth_accounts— List accounts available for signing
eth_feeHistory
Get historical gas fee data on Cronos including base fees and priority fee percentiles. Essential for gas price prediction, fee estimation UIs, and network congestion monitoring.
eth_sendTransaction
Send a transaction from an unlocked account on Cronos. Requires the node to hold the sender's private key — intended for development and testing only.