refactor(passport): replace ethers with viem in wallet package #2753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace ether with viem in wallet package.
Note
Migrates the Wallet SDK from ethers to viem, introducing a
WalletSigner/MessageSignerabstraction, refactors zkEVM/crypto flows and types toviem(bigint/Hex), updates Passport/x‑client crypto, and adds EIP‑712 typed‑data normalization with tests.etherswithviemacross wallet: introduceWalletSignerinterface and useviem’sPublicClient,encodeFunctionData,hashMessage/hashTypedData,keccak256,toBytes.zkEvmmodules (walletHelpers,relayerClient,personalSign,sendDeployTransactionAndPersonalSign,signEjectionTransaction,zkEvmProvider) to useviemandgetChainId; convertBigNumberish/hex types tobigint/Hex.utils/crypto.signRaw(ethers-free) andutils/stringusingviembyte utilities.WalletSignerand updatemagicTEESignerto implement it (no longer extends ethersSigner; returns typed0x${string}).typesandzkEvmtype defs (bigint values, EIP‑6963 types), adjust guardian client and sequence compatibility toviemenc/decoding.signTypedDataV4with robustchainIdnormalization (transformTypedData) and added unit tests; packing/signing refactored toviemhashing;signERC191MessageusesviemhashMessage.ethers.Signerwith lightweightMessageSignerinstarkExflows and toolkitcrypto.signRaw/generateIMXAuthorisationHeaders.registerOffchain/registrationnow acceptMessageSigner;getStarkSignerusesMessageSignerfor legacy Stark key derivation.MessageSignertype; switch crypto helpers (signRaw,generateIMXAuthorisationHeaders,signMessage) and Stark key derivation to use it; minor minting import tweaks.@imtbl/wallet: removeethers, addviem; addtsupand adjust dev deps.packages/game-bridge: bumpparcelto^2.13.3.Written by Cursor Bugbot for commit f4398d2. This will update automatically on new commits. Configure here.