Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getEVMChainAddress #3888

Closed
makoto opened this issue Mar 10, 2023 · 2 comments
Closed

Add getEVMChainAddress #3888

makoto opened this issue Mar 10, 2023 · 2 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6

Comments

@makoto
Copy link

makoto commented Mar 10, 2023

Describe the Feature

The current resolver.getAddress(coinType) only supports several coinType mostly because supporting all coin type via https://github.com/ensdomains/address-encoder will increase the file size and dependencies.

I would like to have resolver.getAddress(chainId) that internally converts EVM chainId to cointype and returns EVM compatible address

The reference implementation is at https://github.com/MetaMask/metamask-extension/blob/59c03f2fd600b1d4fe39bf2b93a82215b43a5b3c/ui/ducks/ens.js

Code Example

const address = await getEVMChainAddress(
  web3Provider,
  name,
  chainId,
);
@makoto makoto added the enhancement New feature or improvement. label Mar 10, 2023
@kunaldo07
Copy link

Where can i write the function?

@ricmoo ricmoo added on-deck This Enhancement or Bug is currently being worked on. v6 Issues regarding v6 labels Jun 13, 2023
ricmoo added a commit that referenced this issue Jun 14, 2023
@ricmoo
Copy link
Member

ricmoo commented Jun 14, 2023

In v6.6.0 I've added support for:

  • any EVM-compatible chain can be resolved using ENSIP-11
  • for full coinType support, the ProviderPluginMulicoin is now available, when attached it will pull in the @ensdomains/address-encoder package and provide support for all coinTypes supported by that library

Try it out and let me know if there are any issues. :)

@ricmoo ricmoo closed this as completed Jun 14, 2023
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Jun 14, 2023
Woodpile37 pushed a commit to Woodpile37/ethers.js that referenced this issue Jan 14, 2024
Woodpile37 pushed a commit to Woodpile37/ethers.js that referenced this issue Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

3 participants