Skip to content

fix(eip712): drop duplicated chain name row from domain rows (WALLET-1318)#46

Merged
Comp0te merged 1 commit into
masterfrom
WALLET-1318-fix-chain-name-dup
Jun 22, 2026
Merged

fix(eip712): drop duplicated chain name row from domain rows (WALLET-1318)#46
Comp0te merged 1 commit into
masterfrom
WALLET-1318-fix-chain-name-dup

Conversation

@ost-ptk

@ost-ptk ost-ptk commented Jun 18, 2026

Copy link
Copy Markdown
Member

Problem

In the Domain section of the EIP-712 signing screen, the chain name was shown twice:

  1. The synthetic "Network" row — built in the Wallet UI from signatureRequest.chainName.
  2. A "Chain Name" row — coming from signatureRequest.domainRows.

Both rendered typedData.domain.chain_name.

Root cause

EIP712SignatureRequestDto promotes domain.chain_name into a dedicated chainName field, but buildTypedDataDisplayModel also built domainRows via Object.entries(domain), so chain_name remained there too (labelled "Chain Name").

Changes

  • Added an optional excludeDomainKeys: readonly string[] = [] parameter to buildTypedDataDisplayModel, filtering domain keys out of domainRows (backwards-compatible — defaults to []).
  • EIP712SignatureRequestDto now passes [EIP712_CHAIN_NAME_KEY], so chain_name is removed from domainRows while chainName stays for the synthetic "Network" row.
  • Extracted a shared EIP712_CHAIN_NAME_KEY constant (data/dto/eip712/common.ts) to keep the promote-and-exclude sites in sync (DTO + repository).
  • Tests: chain_name exclusion, other domain/message rows preserved, edge case for a domain without chain_name.

Verification

  • yarn test — EIP-712 suite: 69 passed.
  • yarn code:check — types and lint clean (Prettier warnings only for unrelated files, not part of this diff).

🤖 Generated with Claude Code

…1318)

The EIP-712 signing screen showed the chain name twice in the Domain
section: once as the synthetic "Network" row (built by consumers from
`signatureRequest.chainName`) and once as a generic "Chain Name" row in
`domainRows`. `EIP712SignatureRequestDto` promotes `domain.chain_name`
into the dedicated `chainName` field, but `buildTypedDataDisplayModel`
still emitted it among the generic domain rows.

- add optional `excludeDomainKeys` to `buildTypedDataDisplayModel` to
  filter domain entries out of `domainRows`
- exclude `chain_name` from the DTO so it surfaces only as `chainName`
- extract the shared `EIP712_CHAIN_NAME_KEY` constant to keep the
  promote-and-exclude sites in sync
- cover the new behaviour, including a domain without `chain_name`

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: ost-ptk <ostap@make.services>
@ost-ptk ost-ptk requested a review from Comp0te June 18, 2026 13:16

@Comp0te Comp0te left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Comp0te Comp0te merged commit bfcc383 into master Jun 22, 2026
4 checks passed
@Comp0te Comp0te mentioned this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants