feat: forward custom RPC URLs to embedded wallet #4570
Conversation
🦋 Changeset detectedLatest commit: b8cb393 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
10 Skipped Deployments
|
|
…into feat/custom-rpc-url-ew
…into feat/custom-rpc-url-ew
enesozturk
left a comment
There was a problem hiding this comment.
Left a single comment 🙏🏽
There was a problem hiding this comment.
Bug: `getRpcUrl` Misclassifies Chain IDs
The getRpcUrl method has flawed logic for determining the ChainNamespace from chainId. It incorrectly assumes all numeric chainIds (number or integer-like strings) are eip155. Additionally, it aggressively defaults any non-CAIP-2, non-integer string chainId to solana. This misclassifies inputs like decimal number strings, empty strings, scientific notation, or arbitrary non-numeric strings, leading to incorrect RPC URL selection for non-EIP155/non-Solana chains or invalid inputs.
packages/wallet/src/W3mFrameProvider.ts#L770-L787
appkit/packages/wallet/src/W3mFrameProvider.ts
Lines 770 to 787 in b8cb393
Bug: getUser Method Missing RPC URL Handling
The getUser method does not automatically add the rpcUrl to its payload when called directly. While the connect method passes the rpcUrl to getUser, other direct callers of getUser will not forward custom RPC URLs to the embedded wallet. This is inconsistent with other methods (e.g., connectSocial, switchNetwork, request) which automatically derive and include the rpcUrl via this.getRpcUrl(chainId), contradicting the PR's goal of forwarding custom RPC URLs.
packages/wallet/src/W3mFrameProvider.ts#L370-L385
appkit/packages/wallet/src/W3mFrameProvider.ts
Lines 370 to 385 in b8cb393
Was this report helpful? Give feedback by reacting with 👍 or 👎
Description
customRPCUrlparameter to embedded wallet to ensure this RPC is used for requestsrpcUrlto getUser, connect, connectSocial, switchNetwork and rpcRequest schemasgetRpcUrltoW3mFrameProviderto fetch rpc url for active network for every request that requires itType of change
Associated Issues
APKT-3087
Checklist