diff --git a/README.md b/README.md index f3235b3..7bebf7b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Your contributions are vital to keeping this repository valuable and up-to-date. 1. **Submit a Pull Request (PR)**: Submit a PR to the main repository for review. 2. **Edit the JSON directly** [here](https://github.com/bcnmy/aa-errors/edit/main/docs/errors.json) (be careful!). +**NB: The 'regex' field is used to match a thrown error from the SDK to your KnownError, so please make sure it is a string unique to your error** + #### Error Documentation Structure ```typescript @@ -27,4 +29,20 @@ export type KnownError = { }; ``` +#### Example: + +``` +{ + "name": "SmartAccountInsufficientFundsError", + "regex": "aa21", + "description": "You are not using a paymaster, and the sender address did not have enough native tokens to cover the gas costs associated with the user operation.", + "causes": ["Your smart wallet does not have funds to send transaction."], + "solutions": [ + "If you are not using a paymaster, verify that the sender address has enough native tokens to cover the required prefund.", + "Send some native tokens in your smart wallet to be able to resolve the error.", + "If you are looking to use a paymaster to cover the gas fees, verify that the paymasterAndData field is set." + ] +} +``` + ### [Hosted errors](https://bcnmy.github.io/aa-errors/errors.json)