Commit 0eb2851
feat: EIP-712 signature requests (WALLET-1251) (#1342)
* build: bump casper-js-sdk to 5.0.12 and date-fns to v4 for EIP-712 core
* feat(sdk): add EIP-712 signTypedData types
* feat(sdk): add signTypedData request/response/error actions
* feat(sdk): expose signTypedData provider method
* feat(redux): store EIP-712 typed data by request id in vault slice
* feat: add SignEip712 route and window app
* feat(background): handle signTypedData request and open EIP-712 window
* feat(services): add useFetchDataForEip712Request hook
* feat(ui): add EIP-712 display row mapper component
* feat(ui): add EIP-712 content with Domain and Message blocks
* feat(ui): add SignEip712Page with fetch, sign and cancel
* feat: wire SignEip712Page route
* fix: import casper-js-sdk types from package root for v5.0.12
* fix(ui): align EIP-712 rows and reuse network display with icon
* chore: update casper-wallet-core dependency to latest commit
* fix(sdk): register signTypedData response/error in content message proxy
* chore: bump casper-wallet-core to latest commit and update dependencies
* feat: reject EIP-712 signing for Ledger accounts (WALLET-1251)
* fix: address EIP-712 signature request review feedback
- persist eip712 payload by adding eip712PayloadReceived to updateVaultCipher
trigger list, preventing a hung request after a service-worker restart
- wrap handleSign key reconstruction + signing in try/catch, sending
signTypedDataError on failure instead of leaving the dapp promise hanging
- guard the eip712 payload JSON.parse and send signTypedDataError on
malformed data instead of throwing during render
- advertise signTypedData in CasperWalletSupports and getActiveAccountSupports
(software accounts only) so dapps can feature-detect EIP-712
- reject watch-only accounts (no secret key) before signing
- harden optional chaining when reading the signing account balance
- import FormatDistanceToken from the date-fns package root
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore: update casper-wallet-core dependency to latest commit
* test(e2e): update failed transfer error heading for casper-js-sdk 5.0.12
The SDK bump 5.0.10 -> 5.0.12 changed the HTTP error format: a 500
response now throws HttpError(status, Error(statusText)), so the
transfer error screen renders 'Internal Server Error' instead of
'failed to send http request, details: Code: 500, err: Internal Server Error'.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 16eddc9 commit 0eb2851
29 files changed
Lines changed: 981 additions & 125 deletions
File tree
- e2e-tests/popup/transfers
- src
- apps/signature-request
- pages/sign-eip712
- router
- background
- redux
- sagas
- vault
- content
- fixtures
- libs
- services
- signature-request-service
- ui/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments