-
Notifications
You must be signed in to change notification settings - Fork 2
feat(iframe): add request popup for eth_signTypedData_v4 requests #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this the default? i think you don't need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this the default? i think you don't need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).