feat(wallets): map backend recovery signer error codes to SDK errors - #2038
Conversation
Original prompt from Panayiotis
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: 6f20777 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Prompt To Fix All With AI### Issue 1
packages/wallets/src/utils/errors.ts:335
**Unused recovery error mapper**
`throwIfRecoverySignerApiError` is compiled into this package but is only referenced by its unit tests and is not available through the package entry point. Shipping it before the wallet factory integration leaves unused implementation that must remain synchronized with the backend contract until the next PR lands.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(wallets): map backend recovery sign..." | Re-trigger Greptile |
🔥 Smoke Test Results❌ Status: Failed Statistics
Test DetailsThis is a non-blocking smoke test. Full regression tests run separately. |
Co-Authored-By: Panayiotis Halios <panos@paella.dev>
…sage Co-Authored-By: Panayiotis Halios <panos@paella.dev>
2f22c5b to
6f20777
Compare
Description
Part 2/4 of splitting #2035 into a reviewable stack (stacked on #2037).
Adds SDK error classes for the backend's stable recovery error codes, plus
throwIfRecoverySignerApiError(response)which maps an API error body to the right class:SIGNER_LIMIT_EXCEEDEDRecoverySignerLimitExceededErrorRECOVERY_DUPLICATE_SIGNERDuplicateRecoverySignerErrorRECOVERY_SIGNER_CONFLICTRecoverySignerConflictErrorSIGNER_REQUIREDSignerRequiredErrorRECOVERY_NOT_SUPPORTED_ON_CHAINRecoveryNotSupportedOnChainErrorNOT_SUPPORTED_ON_API_VERSIONNotSupportedOnApiVersionErrorRECOVERY_ADMIN_SIGNER_CONFLICTRecoveryAdminSignerConflictErrorAlso adds
InvalidRecoveryConfigErrorandMAX_RECOVERY_SIGNERS = 10for client-side validation, and exports everything from the package index. Nothing calls the mapping yet — the wallet factory wires it up in the next PR of the stack.Test plan
src/utils/errors.test.tscover every code above, fallback messages, API error details, and that unrelated API bodies are not swallowed.pnpm --filter @crossmint/wallets-sdk test:vitestpasses.Package updates
@crossmint/wallets-sdk(patch) — changesetrecovery-errorsadded.Link to Devin session: https://crossmint.devinenterprise.com/sessions/520c831e21b04f9f9d2fbb524107c536
Open in Devin Desktop: https://crossmint.devinenterprise.com/desktop/session/520c831e21b04f9f9d2fbb524107c536?variant=devin
Requested by: @panosinthezone