Content
@
0 reply
0 recast
0 reaction
shazow
@shazow.eth
Is there an ethers.js v6 idiomatic way for resolving an ENS name with respect to some non-mainnet chainId? Like say my ENS has a special address for Base (chainId 8453), how would I get that rather than my mainnet (chainId 1) address? Is there something like ethers.resolveAddress for that? @ricmoo
1 reply
0 recast
2 reactions
RicMoo.eth
@ricmoo
If I understand, you can create a custom network instance, and add an EnsPlugin to it with the desired ENS address. Then it will just be used for all ENS interactions. Here is an example of how ENS is configured on the stock networks: https://github.com/ethers-io/ethers.js/blob/main/src.ts/providers/network.ts#L358
1 reply
1 recast
1 reaction
shazow
@shazow.eth
Hmm am I crazy to expect that I should be able to just pass an optional chainId into ethers.resolveAddress(...) or somesuch?
1 reply
0 recast
0 reaction