Skip to content

Commit 0eb2851

Browse files
ost-ptkclaude
andauthored
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

e2e-tests/popup/transfers/casper-native-transfer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ popup.describe('Popup UI: Casper Native Transfer', () => {
162162

163163
await popupExpect(
164164
popupPage.getByRole('heading', {
165-
name: 'failed to send http request, details: Code: 500, err: Internal Server Error'
165+
name: 'Internal Server Error'
166166
})
167167
).toBeVisible();
168168
await popupExpect(

e2e-tests/popup/transfers/erc-20-transfer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ popup.describe('Popup UI: ERC-20 transfer', () => {
181181

182182
await popupExpect(
183183
popupPage.getByRole('heading', {
184-
name: 'failed to send http request, details: Code: 500, err: Internal Server Error'
184+
name: 'Internal Server Error'
185185
})
186186
).toBeVisible();
187187
await popupExpect(

package-lock.json

Lines changed: 115 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
"@zondax/ledger-casper": "^2.6.3",
7171
"base64-loader": "1.0.0",
7272
"big.js": "^6.2.1",
73-
"casper-js-sdk": "5.0.10",
74-
"casper-wallet-core": "git+ssh://git@github.com:make-software/casper-wallet-core.git#v1.3.0",
75-
"date-fns": "^2.30.0",
73+
"casper-js-sdk": "5.0.12",
74+
"casper-wallet-core": "git+ssh://git@github.com:make-software/casper-wallet-core.git#442723023778ee0bbfce3ca886015d1372a883e2",
75+
"date-fns": "^4.1.0",
7676
"dotenv-webpack": "^8.1.0",
7777
"i18next": "^23.11.0",
7878
"i18next-browser-languagedetector": "^7.2.1",

0 commit comments

Comments
 (0)