Skip to content

Conversation

@shineli1984
Copy link
Collaborator

@shineli1984 shineli1984 commented Dec 10, 2025

Summary

Replace ether with viem in wallet package.


Note

Migrates the Wallet SDK from ethers to viem, introducing a WalletSigner/MessageSigner abstraction, refactors zkEVM/crypto flows and types to viem (bigint/Hex), updates Passport/x‑client crypto, and adds EIP‑712 typed‑data normalization with tests.

  • Wallet SDK (viem migration & type cleanup)
    • Replace ethers with viem across wallet: introduce WalletSigner interface and use viem’s PublicClient, encodeFunctionData, hashMessage/hashTypedData, keccak256, toBytes.
    • Refactor zkEvm modules (walletHelpers, relayerClient, personalSign, sendDeployTransactionAndPersonalSign, signEjectionTransaction, zkEvmProvider) to use viem and getChainId; convert BigNumberish/hex types to bigint/Hex.
    • Add utils/crypto.signRaw (ethers-free) and utils/string using viem byte utilities.
    • Introduce WalletSigner and update magicTEESigner to implement it (no longer extends ethers Signer; returns typed 0x${string}).
    • Update types and zkEvm type defs (bigint values, EIP‑6963 types), adjust guardian client and sequence compatibility to viem enc/decoding.
  • EIP‑712 & signing
    • New signTypedDataV4 with robust chainId normalization (transformTypedData) and added unit tests; packing/signing refactored to viem hashing; signERC191Message uses viem hashMessage.
  • Passport SDK / Toolkit signer abstraction
    • Replace ethers.Signer with lightweight MessageSigner in starkEx flows and toolkit crypto.signRaw/generateIMXAuthorisationHeaders.
    • registerOffchain/registration now accept MessageSigner; getStarkSigner uses MessageSigner for legacy Stark key derivation.
  • x-client updates
    • Add MessageSigner type; switch crypto helpers (signRaw, generateIMXAuthorisationHeaders, signMessage) and Stark key derivation to use it; minor minting import tweaks.
  • Build/Deps
    • @imtbl/wallet: remove ethers, add viem; add tsup and adjust dev deps.
    • packages/game-bridge: bump parcel to ^2.13.3.

Written by Cursor Bugbot for commit f4398d2. This will update automatically on new commits. Configure here.

@shineli1984 shineli1984 requested a review from a team as a code owner December 10, 2025 23:56
@nx-cloud
Copy link

nx-cloud bot commented Dec 10, 2025

View your CI Pipeline Execution ↗ for commit f4398d2

Command Status Duration Result
nx release publish --tag alpha ✅ Succeeded 48s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 2m 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-15 05:11:37 UTC

@shineli1984 shineli1984 merged commit 0b33fdf into main Dec 16, 2025
10 checks passed
@shineli1984 shineli1984 deleted the ethers-to-viem branch December 16, 2025 06:31
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.

2 participants