Skip to content

Conversation

@rodrigo-fournier-immutable
Copy link
Contributor

Summary

Fixes off-chain order cancellation typed data generation in the Orderbook SDK.

Problem

prepareOrderCancellations() was setting domain.chainId to a string via .toString().

Viem only includes chainId in the inferred EIP712Domain type when domain.chainId is a number or bigint. When it is a string, viem infers EIP712Domain with only:

  • name
  • verifyingContract

…but the domain object still contained chainId, which caused Guardian/go-ethereum EIP-712 hashing to fail with:

there is extra data provided in the message (2 < 3)

Fix

Normalize domain.chainId to Number(network.chainId).

Notes

  • This aligns with order-book-mr which expects EIP712Domain to include chainId.
  • No user-sensitive data involved; this is only typed data schema compatibility.

…erence

Viem only includes chainId in the inferred EIP712Domain type when domain.chainId
is a number or bigint. The cancellation payload was passing chainId as a string
(via .toString()), which caused viem to infer EIP712Domain without chainId.

That led to Guardian/go-ethereum failing with:
'there is extra data provided in the message (2 < 3)'
when the domain object still contained chainId.

This change normalizes chainId to a number for cancellation typed data.
@nx-cloud
Copy link

nx-cloud bot commented Jan 23, 2026

View your CI Pipeline Execution ↗ for commit 79ce26e

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 2m 55s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 1m 19s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-23 00:56:56 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants