Repository navigation
Conversation
- Add lib/blockchain/ens.ts: resolveAddress() accepts a 0x address or an ENS name, normalizes the name and resolves it on Sepolia's ENS. - Balance, token balance, wallet analysis and prepareTransaction accept names and return the name alongside the resolved address. - Transfer previews record toEnsName, show "name resolves to 0x…" in the recipient check and warn the user to confirm the resolved address. The wallet still signs only the resolved address. - Cards show the name next to the short address; the agent prompt and tool descriptions mention ENS. - Add tests/ens.test.ts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What does this PR do?
Lets users type ENS names (e.g.
alice.eth) anywhere Chainly takes an address. Names are normalized and resolved on Ethereum Sepolia's own ENS registry via viem (thesepoliachain already includes the ENS resolver, so no new dependency). Plain0xaddresses work exactly as before, with no extra RPC call.src/lib/blockchain/ens.tswithresolveAddress().getEthBalance,getTokenBalance(wallet side),analyzeWalletandprepareTransactionaccept names and return the name alongside the resolved address.Type of change
How was it tested?
pnpm lint,pnpm typecheck,pnpm testandpnpm buildpass locallypnpm dev) on Ethereum Sepolia — not done: the Sepolia RPC isn't reachable from the environment this was built in, so a live lookup still needs a manual checksrc/lib/(tests/ens.test.ts, 8 cases: name detection, normalization, unresolved and invalid names, balance results, transfer preview, zero-address refusal)Screenshots
Not captured (small change: the name appears before the short address in result cards and the transaction preview).
Safety checklist (if this touches transactions or tools)
This touches
transfer.tsandtools.ts:toBlockchainError)The recipient name is resolved once, when the preview is prepared; the preview, the browser signing guard and the wallet only ever use the resolved address. The preview shows "name resolves to 0x…" and warns the user to confirm it, since a name's owner can change where it points. A name resolving to the zero address is refused.