# Wallet API errors

> Learn how to troubleshoot errors from Wallet APIs

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

When working with Wallet APIs, you may encounter various errors. Here are some common errors and how to troubleshoot them.

### Replacement underpriced

```json
{
  "code": -32602,
  "message": "replacement underpriced",
  ...
}
```

<Info>
  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](https://www.alchemy.com/support/how-to-fix-replacement-underpriced-errors).
</Info>

### Execution reverted

```json
{
  "code": -32521,
  "message": "execution reverted",
  ...
}
```

<Info>
  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.
</Info>

### ERC20: transfer amount exceeds balance

```json
{
  "code": -32521,
  "message": "ERC20: transfer amount exceeds balance",
  ...
}
```

<Info>
  If [paying for gas with ERC-20
  tokens](https://www.alchemy.com/docs/wallets/transactions/pay-gas-with-any-token),
  ensure the sender has the required balance.
</Info>

### AA23 reverted

```json
{
  "code": -32500,
  "message": "validation reverted: [reason]: AA23 reverted",
  ...
}
```

<Info>
  AA23 errors happen if sender signature validation reverted or ran out of gas
  (OOG). Follow [these
  recommendations](https://www.alchemy.com/support/how-to-resolve-entrypoint-aaxx-errors).
</Info>

### AA25 invalid account nonce

```json
{
  "code": -32500,
  "message": "validation reverted: [reason]: AA25 invalid account nonce",
  ...
}
```

<Info>
  The nonce used is invalid. This usually happens when trying to reuse an old
  nonce. Follow [these
  recommendations](https://www.alchemy.com/support/how-to-resolve-entrypoint-aaxx-errors).
</Info>

### Policy ID(s) not found

```json
{
  "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.",
  ...
}
```

<Info>
  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](https://www.alchemy.com/docs/wallets/transactions/sponsor-gas) for more
  info.
</Info>

### Invalid account signature

```json
{
  "code": -32507,
  "message": "invalid account signature",
  ...
}
```

<Info>
  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](/docs/wallets/reference/smart-wallet-quickstart#2-sign-the-signature-requests) for
  more info.
</Info>

### Precheck failed: sender balance

```json
{
  "code": -32000,
  "message": "precheck failed: sender balance and deposit together is ____ but must be at least ____ to pay for this operation",
  ...
}
```

<Info>
  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](https://www.alchemy.com/docs/wallets/transactions/sponsor-gas) for more
  info.
</Info>

### EIP-7702 not enabled

```json
{
  "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.",
  ...
}
```

<Info>
  This chain does not support EIP-7702. Call [`wallet_requestAccount`](/docs/wallets/transactions/using-eip-7702) 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.
</Info>

### maxFeePerGas too low

```json
{
  "code": -32000,
  "message": "An error occurred while executing user operation: precheck failed: maxFeePerGas is {actual} but must be at least {min}",
  ...
}
```

<Info>
  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 [`gasParamsOverride` capability](/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-api-endpoints/wallet-prepare-calls#params0.capabilities.gasparamsoverride) to set a higher `maxFeePerGas` buffer, but this is an advanced override and shouldn't typically be required.
</Info>

### maxPriorityFeePerGas too low

```json
{
  "code": -32000,
  "message": "precheck failed: maxPriorityFeePerGas is {actual} but must be at least {min}",
  ...
}
```

<Info>
  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.
</Info>

### preVerificationGas too low

```json
{
  "code": -32000,
  "message": "precheck failed: preVerificationGas is {actual} but must be at least {min}",
  ...
}
```

<Info>
  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.
</Info>

### Total gas limit too high

```json
{
  "code": -32000,
  "message": "precheck failed: total gas limit is {actual} but must be at most {max}",
  ...
}
```

<Info>
  The combined gas limits on the user operation exceed the maximum allowed. Reduce the complexity of your calls or split them into multiple operations.
</Info>

### callGasLimit too low

```json
{
  "code": -32000,
  "message": "precheck failed: callGasLimit is {actual} but must be at least {min}",
  ...
}
```

<Info>
  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.
</Info>

### verificationGasLimit too high

```json
{
  "code": -32000,
  "message": "precheck failed: verificationGasLimit is {actual} but must be at most {max}",
  ...
}
```

<Info>
  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.
</Info>

### EIP-7702 invalid signature

```json
{
  "code": -32000,
  "message": "precheck failed: EIP-7702 authorization signature is invalid",
  ...
}
```

<Info>
  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.
</Info>

### EIP-7702 nonce mismatch

```json
{
  "code": -32000,
  "message": "precheck failed: EIP-7702 nonce mismatch. Expected: {expected}, Actual: {actual}",
  ...
}
```

<Info>
  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.
</Info>

### EIP-7702 too many pending transactions

```json
{
  "code": -32000,
  "message": "precheck failed: EIP-7702 auth sender has too many pending transactions: {count}. Max allowed: 1",
  ...
}
```

<Info>
  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.
</Info>