feat(iframe): add request popup for eth_signTypedData_v4 requests#705
feat(iframe): add request popup for eth_signTypedData_v4 requests#705ultraviolet10 wants to merge 3 commits intomasterfrom
Conversation
Deploying happychain with
|
| Latest commit: |
f2975be
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1f6d08db.happychain.pages.dev |
| Branch Preview URL: | https://aritra-eth-signtypeddata-v4.happychain.pages.dev |
HAPPY-500 Implement `eth_signedTypedData_v4` request frame.
cf. HAPPY-235 for some background Key highlight:
|
apps/iframe/src/requests/approved.ts
Outdated
| case "eth_signTypedData_v4": { | ||
| return await sendToWalletClient(request) | ||
| } |
There was a problem hiding this comment.
isn't this the default? i think you don't need this
There was a problem hiding this comment.
file moved to src/requests/approved.ts where the code doesn't exist, hence this is handled!
apps/iframe/src/requests/injected.ts
Outdated
| case "eth_signTypedData_v4": { | ||
| return await sendToInjectedClient(app, request) | ||
| } |
There was a problem hiding this comment.
isn't this the default? i think you don't need this
There was a problem hiding this comment.
same as above :)
d994330 to
f2975be
Compare
| * | ||
| * This is used to safely recurse into nested structs defined in EIP-712 typed data. | ||
| */ | ||
| function isObject(value: unknown): value is Record<string, unknown> { |
There was a problem hiding this comment.
this should probably live in common utils i think 🫡
| <FormattedDetailsLine>{domain.version}</FormattedDetailsLine> | ||
| </div> | ||
| )} | ||
| {(typeof domain.chainId === "number" || typeof domain.chainId === "bigint") && ( |
There was a problem hiding this comment.
nipick/suggestion/preference 😄
| {(typeof domain.chainId === "number" || typeof domain.chainId === "bigint") && ( | |
| {['number', 'bigint'].includes(typeof domain.chainId) && ( |

Linked Issues
Description
Added support for handling
eth_signTypedData_v4requests in the iframe component. This implementation:EthSignTypedDatav4.tsxthat renders EIP-712 structured data in a user-friendly format.Toggle Checklist
Checklist
Basics
norswap/build-system-caching).Reminder: PR review guidelines
Correctness
testnet, mainnet, standalone wallet, ...).
< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >
< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >
and have updated the code & comments accordingly.
Architecture & Documentation
(2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
Public APIS and meaningful (non-local) internal APIs are properly documented in code comments.
in a Markdown document.
make changesetforbreaking and meaningful changes in packages (not required for cleanups & refactors).