When working with Wallet APIs, you may encounter various errors. Here are some common errors and how to troubleshoot them.
{
"code": -32602,
"message": "replacement underpriced",
...
}Replacement underpriced errors occur when you attempt to send a call from the same sender before a pending call has been confirmed onchain. Follow these recommendations.
{
"code": -32521,
"message": "execution reverted",
...
}This error normally happens if the calls you are attempting to make are reverting onchain. Double check that you are calling the correct method on the correct contract address, you are using the correct chain, and that the method arguments are correct and properly ABI-encoded.
{
"code": -32521,
"message": "ERC20: transfer amount exceeds balance",
...
}If paying for gas with ERC-20 tokens, ensure the sender has the required balance.
{
"code": -32500,
"message": "validation reverted: [reason]: AA23 reverted",
...
}AA23 errors happen if sender signature validation reverted or ran out of gas (OOG). Follow these recommendations.
{
"code": -32500,
"message": "validation reverted: [reason]: AA25 invalid account nonce",
...
}The nonce used is invalid. This usually happens when trying to reuse an old nonce. Follow these recommendations.
{
"code": -32600,
"message": "Sponsorship failed: [invalid_argument] Policy ID(s) not found. Please ensure you're sending requests with the API key associated with the policies' app, that the policies are active, and the network is allowed.",
...
}Ensure you're sending requests with the API key associated with the policy's app, the policy is active, and the network is allowed. See gas sponsorship docs for more info.
{
"code": -32507,
"message": "invalid account signature",
...
}The call was rejected because it contains an invalid signature from the sender. Be sure that you are correctly signing the signature request(s). Refer to the Wallet API quickstart for more info.
{
"code": -32000,
"message": "precheck failed: sender balance and deposit together is ____ but must be at least ____ to pay for this operation",
...
}The sender's balance is too low to cover gas fees. This normally happens when you mistakenly forget to include your Gas Sponsorship Policy ID. See gas sponsorship docs for more info.
{
"code": -32602,
"message": "EIP-7702 is not enabled on {chainName}. You must call wallet_requestAccount to create a smart contract account address to use on this network.",
...
}This chain does not support EIP-7702. Call wallet_requestAccount to create a smart contract account address to use on this network. Reach out to Alchemy support if you need to inquire about EIP-7702 support on a specific chain.
{
"code": -32000,
"message": "An error occurred while executing user operation: precheck failed: maxFeePerGas is {actual} but must be at least {min}",
...
}This error occurs when the base fee on the chain fluctuates between the time you prepare a call and the time you send it. To resolve:
- Re-prepare the call immediately before sending to get up-to-date fee estimates.
- Minimize any delay between preparing and sending. Don't wait between the two steps.
- If needed, you can use the
gasParamsOverridecapability to set a highermaxFeePerGasbuffer, but this is an advanced override and shouldn't typically be required.
{
"code": -32000,
"message": "precheck failed: maxPriorityFeePerGas is {actual} but must be at least {min}",
...
}This error occurs when the priority fee on the chain changes between the time you prepare a call and the time you send it. Re-prepare the call immediately before sending to get up-to-date fee estimates, and minimize any delay between the two steps.
{
"code": -32000,
"message": "precheck failed: preVerificationGas is {actual} but must be at least {min}",
...
}The preVerificationGas value doesn't cover the intrinsic overhead of the user operation. Re-prepare the call to get an updated gas estimate. This can happen when the operation's calldata size or the chain's L1 fee conditions have changed.
{
"code": -32000,
"message": "precheck failed: total gas limit is {actual} but must be at most {max}",
...
}The combined gas limits on the user operation exceed the maximum allowed. Reduce the complexity of your calls or split them into multiple operations.
{
"code": -32000,
"message": "precheck failed: callGasLimit is {actual} but must be at least {min}",
...
}The callGasLimit is below the required minimum. Re-prepare the call to get an accurate gas estimate, or use gas overrides to increase the limit.
{
"code": -32000,
"message": "precheck failed: verificationGasLimit is {actual} but must be at most {max}",
...
}The verificationGasLimit exceeds the maximum allowed. This can happen if gas estimation returned an unusually high value. Re-prepare the call or reduce overrides if you've set them manually.
{
"code": -32000,
"message": "precheck failed: EIP-7702 authorization signature is invalid",
...
}The EIP-7702 authorization signature is malformed or was signed by the wrong key. Ensure you are correctly signing the authorization with the account's owner key.
{
"code": -32000,
"message": "precheck failed: EIP-7702 nonce mismatch. Expected: {expected}, Actual: {actual}",
...
}The EIP-7702 authorization nonce does not match the expected value onchain. This can happen if you sent another transaction from the same account between preparing and sending the delegation. Ensure no other transactions are submitted from the account while the delegation is in flight.
{
"code": -32000,
"message": "precheck failed: EIP-7702 auth sender has too many pending transactions: {count}. Max allowed: 1",
...
}The authorization sender already has a pending transaction. Only one pending transaction is allowed at a time. Wait for the current transaction to confirm before sending another.