-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 methods to support fetching the ENS contenthash and other record types #1003
Comments
I completely agree, this is missing and should be added. Simple methods, which do not require additional libraries will be added. So, the most common and simple content hashes (IPFS PB-node and Swarm) will be handled. Unsupported content hashes will throw an error. For those following along at home, this is defined in EIP-1577. :) |
I have local changes that support contenthash, text and multi-coin address support. Still needs more testing, but feels good so far. :) |
Do these local changes also decode IPNS/IPFS content hashes? |
It handles IPFS content hashes that use dag-pb formats. Are IPNS encoded CID different? If you have an example ENS name with an IPNS that would be super helpful. :) I have made it super pessimistic though, so if it hits unsupported data, it will throw. It won't ever return wrong data. :) |
The three formats we care about in Uniswap interface are:
Our decoding code in the interface is here: And some example ENS names here: Our tokens.uniswap.eth ENS name points at ipns://tokens.uniswap.org |
Right, but what about the binary encoding. Currently I only support CID version 1 ( I certainly do not support currently support IPNS + DNSLink... I've not seen that before... Do you have a link to docs? I just tried all the ones in that test list and they all appear to by ipfs:// DAG-PB. I think you would need to have one with a type of As people find unsupported combinations (the CID is quite complex) I'll expand support. However, like the multi-coin support, I only plan to support types that are either wildly popular or require very little additional code. To support all Multicodec formats (the vast majority of which probably do not have a single instance of existence on Earth) would more than double the size of the entire ethers.js library, which I aim to keep lean. :) I might add the ability to extend the object though. So, for example, if you want ZCash support, you can register your own blake2b implementation. But that's a future idea. :) I'll try getting it out today. :) |
This should be available in 5.0.10. You should be able to use:
Try it out and let me know how it goes. :) |
Closing this now, but let me know if you have any issues. Thanks! :) |
use the latest version 5.0.14 in my project which also need support ipns and cointype such as EOS, unfortunately, it is not working or needs some extra handle. |
Currently there are no methods on the provider to support fetching and decoding contenthash, or other record types.
Specifically I need contenthash, but other methods are welcome
The text was updated successfully, but these errors were encountered: