Repository navigation
feat: send evm transactions through the viem-based hub3 evm namespace - #1523
Open
arlert-armin wants to merge 29 commits into
Open
arlert-armin wants to merge 29 commits into
arlert-armin wants to merge 29 commits into
Conversation
arlert-armin
requested review from
Ikari-Shinji-re,
RyukTheCoder,
llawliet-l-l,
nikaaru and
yeager-eren
as code owners
October 7, 2026 09:43
RyukTheCoder
requested changes
Oct 14, 2026
RyukTheCoder
requested changes
Oct 14, 2026
arlert-armin
force-pushed
the
feat/rc-516-adopt-the-viem-based-evm-namespace-in-rango-client-and-the-playground
branch
from
October 16, 2026 15:42
767249c to
b508b27
Compare
arlert-armin
force-pushed
the
feat/rc-516-adopt-the-viem-based-evm-namespace-in-rango-client-and-the-playground
branch
from
October 19, 2026 14:15
3c95ae5 to
fd34bc4
Compare
Pin @hub3js/evm and @hub3js/namespaces to the experimental build that exposes viem's actions on the EVM namespace, dedupe viem to 2.57.3 and move its ox patch to the matching version. Providers gain @hub3js/namespaces and drop @rango-dev/signer-evm, which they no longer use.
…ace actions Ledger and Trezor have no injected provider. Their EVM namespaces now register the public viem actions, including the receipt ones, and sign on the device through their own `sendTransaction` and `signMessage` actions, so they no longer need an EVM signer or a JSON-RPC provider of their own. The allowance is read with the public client's `readContract`.
…espaces Both now send through viem's wallet actions. Safe resolves its safeTxHash to the on-chain hash with a `resolveTransactionHash` namespace action and signs messages off-chain through its SDK. Their EVM signers are removed.
… viem Methods the session negotiated go to the wallet over the relay, and reads go to a node for the session's active chain. viem's wallet actions and the receipt actions run on it, so the EVM signer is removed.
Their EVM namespaces register `viemWalletAdapter` and `viemPublicAdapter`, plus wallet-transport `getTransactionReceipt` and `waitForTransactionReceipt`, and are built with the EVM RPC URL. EVM signers are no longer registered; providers left without a signer drop their `signers` property.
Their EVM namespaces register `viemWalletAdapter` and `viemPublicAdapter`, plus wallet-transport `getTransactionReceipt` and `waitForTransactionReceipt`, and are built with the EVM RPC URL. EVM signers are no longer registered; providers left without a signer drop their `signers` property.
Their EVM namespaces register `viemWalletAdapter` and `viemPublicAdapter`, plus wallet-transport `getTransactionReceipt` and `waitForTransactionReceipt`, and are built with the EVM RPC URL. EVM signers are no longer registered; providers left without a signer drop their `signers` property.
Providers without an EVM namespace take the RPC URLs too, so any of their namespaces can start using one.
`RPC_URLS` holds the RPC endpoint of each namespace, and is passed to every provider where providers are built: the widget, the playground and the queue-manager demo. BREAKING CHANGE: `buildProvider` of every `@rango-dev/provider-*` package, and each builder returned by `allProviders()`, now requires the RPC URLs of its namespaces, e.g. `buildProvider(RPC_URLS)`. Providers no longer expose an EVM signer.
EVM swaps, approvals and Hyperliquid signing go through the wallet's EVM
namespace instead of the EVM signer. `common/evm.ts` converts Rango's EVM
transaction for viem and keeps what the signer did: the wallet address and
chain checks, the retry without EIP-1559 fees, error mapping that still
recognises a user rejection, and, while waiting for the receipt,
replacement handling and the Tenderly failure lookup. Wallets whose
`sendTransaction` returns another kind of hash can register
`resolveTransactionHash`.
EVM approvals read viem's receipt: `getTransactionReceipt({ hash })`,
which throws while pending and reports `'success' | 'reverted'`.
…ider hubProvider returned the provider from the configured list. The widget rebuilds that list with the same ids, while the hub keeps the instances it registered first, so the returned provider could have no store, and its namespaces threw "You need to set your store using `.store` method first." as soon as an action read their state, e.g. signing an EVM transaction. Return the hub's own instance instead.
Pin @hub3js/evm and @hub3js/namespaces to 0.0.0-experimental-9a7dcf8b-20261019. Ledger Wallet reads what its provider doesn't serve, e.g. transaction receipts, from the public RPC.
RyukTheCoder
requested changes
Nov 7, 2026
RyukTheCoder
left a comment
Contributor
There was a problem hiding this comment.
Tnx for your effort, I just left some comments. Also plz update the PR description as it changed a lot and the two hub3 stacked PRs are now merged so you can remove the experimental pinned versions.
…of experimental builds
…espace's signTypedData params
…at approvals are prerequisites
… action EVM sending, its environment checks (network and parallel claim) and the receipt wait move into executeEvmTransaction. The generic execute action keeps only the wallet check, and hands EVM transactions stored by older versions over. The status check waits on EVM transactions directly, since no other signer waits.
…own 1.8.24 to match viem 2.57.13 to 2.57.16 reject ':' in EIP-712 struct names, which broke signing Hyperliquid's HyperliquidTransaction:UsdSend. 2.57.17 allows it again. reown 1.8.20's typings don't accept 2.57.17's new prepare phase, so reown moves to 1.8.24, whose typings check without the old appkit-controllers patch. The ox patch moves to the ox version 2.57.17 uses.
RyukTheCoder
requested changes
Nov 10, 2026
- Type hyperliquid typed data with viem's TypedDataDefinition, re-exported by @hub3js/evm. evm and namespaces are pinned to the experimental hub3 build that adds the export, and rango-preset declares @hub3js/evm. - Reject a sent EVM transaction whose hash doesn't start with 0x, after both the first send and the legacy gas retry (some wallets resolve 'null'). - Keep the WalletConnect session context on relayed request errors, and pass wallet error context through to the signer error. - Pass a chain 1 rpc url in widget/app, the playground and the queue-manager demo, so Ledger and Trezor reads work there. - Declare @hub3js/namespaces in the providers that import it, and drop the unused @rango-dev/signer-evm from bitget, okx, trezor and walletconnect-2.
RyukTheCoder
approved these changes
Nov 10, 2026
…configured Ledger and Trezor read Ethereum through the EVM signer's public node before rpcUrls existed. Dapps that predate rpcUrls pass none, so the widget now uses that node for chain 1 when neither rpcUrls.evm[1] nor customEthereumRPC is set. Providers still get no url of their own.
The export is merged and released as @hub3js/evm 0.8.1-next.2, so the experimental build is no longer needed. @hub3js/namespaces stays on 0.8.1-next.1, which takes that evm. Later namespaces prereleases bring a tron package whose TronWeb types don't compile in the providers.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The hub3 EVM namespace now exposes viem's wallet and public actions (rango-exchange/hub3js#91, rango-exchange/hub3js#92). This PR moves rango-client onto it and stops using the EVM signers.
hub3 version: no stable hub3 release contains the viem namespace yet, so these are pinned exactly to hub3's
nextprereleases.@hub3js/evmis on0.8.1-next.2, which includes theTypedDataDefinitionexport (rango-exchange/hub3js#102).@hub3js/namespacesis on0.8.1-next.1, which takes that evm. Laternamespacesprereleases bring a tron package whose TronWeb types don't compile in the providers. Exact pins are used because a caret range on a prerelease can resolve to a different build.Providers
buildProvidertakes the RPC urls of its namespaces (NamespacesRPCUrls). They're optional, and none are hardcoded. EVM urls are given per chain.viemWalletAdapter, which serves both the wallet and the public actions through the wallet's own provider. Reads and receipts follow the chain the wallet is on.viemPublicAdapter(rpcUrls).sendTransactionandsignMessageactions.viemPublicAdapter(rpcUrls), plusviemWalletAdapterlimited to the reads its provider serves. Its provider has noeth_getTransactionReceipt.resolveTransactionHashaction that maps a safeTxHash to the on-chain hash. A wallet's own actions win over the viem adapter's, and a test covers Safe'ssignMessage.@rango-dev/signer-evmis dropped from the providers. The package itself stays for now and can be deleted in a follow-up.Widget
rpcUrlsconfig, keyed by chain id:{ evm: { 1: [...], 56: [...] } }. It's converted toNamespacesRPCUrlsbefore the providers are built. On Ethereum,signers.customEthereumRPCis tried first.rpcUrls.evm[1], nosigners.customEthereumRPC), the widget uses the public node the EVM signer used (https://ethereum-rpc.publicnode.com). Dapps that predaterpcUrlskeep Ledger and Trezor working as before. Other chains only get the urls the dapp configures. The providers hardcode no url; widget/app, the playground and the queue-manager demo pass one explicitly.queue-manager
executeEvmTransaction. It holds:executeTransactionkeeps a light check (wallet connected with the right address) and signs the other chains through their signers. A swap stored by an older version can still resume there with an EVM transaction, so it's handed over to the EVM action.wait, so the generic waiter is gone.checkApprovalStatus) is removed. Approvals run as prerequisites, and transactions are created withapprove: false, so the server never builds an approve transaction. A swap saved by an older version while waiting on such an approval starts the step over, and the prerequisite flow reads the allowance on-chain.TypedDataDefinition, re-exported by@hub3js/evm.0xfails. Some wallets (e.g. Rainbow over WalletConnect) resolve'null'on rejection instead of throwing.Other changes
:in EIP-712 struct names, which breaks Hyperliquid'sHyperliquidTransaction:UsdSend. Theoxpatch moves to the version that comes with it (0.14.63), and the old viem patch is dropped because it no longer matched the installed version.@reown/appkitmoves to 1.8.24, because 1.8.20's typings don't accept viem 2.57.17. Its typings check as they are, so theappkit-controllerspatch is removed.hubProviderin wallets-react returns the hub's registered instance. The widget rebuilds its provider list, and a rebuilt provider has no store, so its namespaces threw "You need to set your store using.storemethod first."How did you test this change?
eth_sendTransactionparams the signer sent:gas, and an explicit zerovalue;rpcUrlsconfigured.Checklist: