Skip to content

feat(eip712): improve account presentation — show public key, fix hash label, adaptive row wrap (WALLET-1321)#1372

Merged
Comp0te merged 3 commits into
developfrom
WALLET-1321-cw-improve-accounts-presentation-in-eip-712
Jun 26, 2026
Merged

feat(eip712): improve account presentation — show public key, fix hash label, adaptive row wrap (WALLET-1321)#1372
Comp0te merged 3 commits into
developfrom
WALLET-1321-cw-improve-accounts-presentation-in-eip-712

Conversation

@ost-ptk

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

Copy link
Copy Markdown
Member

What & why

WALLET-1321 — improve how accounts are presented in EIP-712 signature requests.

After WALLET-1251 fixed address decoding, account rows display the bare 32-byte account hash, even though the accountInfo enrichment already carries the related public key. This PR shows the public key (and the saved account/contact name) when we have it, corrects the hash label, and makes long rows wrap adaptively.

Invariant preserved (WALLET-1251): the public key is sourced only from accountInfo.publicKey. It is never recovered from the address bytes (an account hash is a one-way blake2b hash of the public key). When enrichment is absent, the row falls back to the account hash. This is not a regression of the previous decoding fix.

Changes

  • Show public key from enrichment (eip712-display-row.tsx): the account row passes accountInfo.publicKey to AccountInfoRow when present (fallback to the account hash). This also fixes, for known accounts, the explorer link, the identicon, and the saved-name lookup (which compares against publicKey and previously never matched an account hash).
  • Correct hash label (account-info-row.tsx): new optional isAccountHash?: boolean prop. When set it forces the Account hash / Public key label instead of relying on the startsWith('01'|'02') heuristic that mislabels some account hashes. Default undefined keeps the existing heuristic, so all other screens that use AccountInfoRow are unaffected.
  • Adaptive 2-row layout: RowDataContainer gains flex-wrap: wrap. Rows stay on a single line when there is room and wrap the value to a second, left-aligned line only when it would crowd the label (no forced column). Scalars (Value, Nonce, dates) stay single-row.

Method rename — signTypedDataEIP712signTypedData

Reverts the verbose signTypedDataEIP712 naming back to signTypedData, realigning the typed-data signing method with the existing signMessage / signDeploy convention:

  • Provider method (sdk.ts): the public, dapp-facing method is provider.signTypedData(...) again.
  • Action creators (sdk-method.ts) and their action-type strings (CasperWalletProvider:SignTypedData / :Response / :Error), the background and content handlers, and the ErrorMessages.signTypedData key.
  • casper-wallet-core re-bump to 448c7cb, which renames the repository method to eip712Repository.signTypedData(...) (used in sign-eip712).
  • Intentionally kept as-is: the public CasperWalletSupports.signTypedDataEIP712 = 'sign-typed-data-eip712' capability value.

Companion PRs: core make-software/casper-wallet-core#52, playground make-software/casper-wallet-playground#24.

Scope

The account-presentation changes are wallet frontend only — core already exposes row.accountInfo.publicKey, so they need no core change. The bundled method rename (above) additionally re-bumps casper-wallet-core to the signTypedData repository-method commit.

Testing

This repo does not unit-test React components (zero .tsx tests; testEnvironment: node; npm run test runs without --coverage), so changes are verified the established way:

  • npm run ci-check — format, lint (0 errors), tsc, test (28 passed) all green.
  • Manual (playground): Permit owner/spender show the public key + saved name for known accounts; unknown accounts show the account hash labelled "Account hash" with no false "Public key"; the TransferWithAuthorization package row is unchanged; long rows wrap only when cramped; signing a typed-data request resolves through provider.signTypedData(...).

Out of scope

  • The subject == signer warning (still deferred from WALLET-1251).

@ost-ptk ost-ptk requested a review from Comp0te June 25, 2026 11:06
Reverts the internal provider method, action creators (and their action-type strings) and the ErrorMessages key from `signTypedDataEIP712` to `signTypedData`, realigning with the `signMessage`/`signDeploy` convention. The public `CasperWalletSupports.signTypedDataEIP712 = 'sign-typed-data-eip712'` value is intentionally kept.

Bumps casper-wallet-core to 3d944e3, which renames the repository signing method to `signTypedData` (used in sign-eip712).
@ost-ptk ost-ptk self-assigned this Jun 25, 2026
@Comp0te Comp0te merged commit 04e51d5 into develop Jun 26, 2026
6 checks passed
@Comp0te Comp0te deleted the WALLET-1321-cw-improve-accounts-presentation-in-eip-712 branch June 26, 2026 11:17
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