From fdca2b8ee4e6721553a503981cc29b56b2f87b9e Mon Sep 17 00:00:00 2001 From: fselmo Date: Tue, 11 Jul 2023 14:12:35 -0600 Subject: [PATCH] Add documentation for multichain address resolution (ENSIP-9) --- docs/ens_overview.rst | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/ens_overview.rst b/docs/ens_overview.rst index 97b41175f5..55fc511ae7 100644 --- a/docs/ens_overview.rst +++ b/docs/ens_overview.rst @@ -162,9 +162,26 @@ Get the Address for an ENS Name eth_address = ns.address('ens.eth') assert eth_address == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' -The ``ENS`` module has no opinion as to which TLD you can use, +The ``ENS`` module has no opinion as to which **TLD (Top Level Domain)** you can use, but will not infer a TLD if it is not provided with the name. +Multichain Address Resolution ++++++++++++++++++++++++++++++ + +`ENSIP-9 `_ +introduced multichain address resolution, allowing users to resolve addresses from +different chains, specified by the coin type index from +`SLIP44 `_. The +``address()`` method on the ``ENS`` class supports multichain address resolution via +the ``coin_type`` keyword argument. + +.. code-block:: python + + from ens.auto import ns + eth_address = ns.address('ens.eth', coin_type=60) # ETH is coin_type 60 + assert eth_address == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' + + Get the ENS Name for an Address ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -226,6 +243,22 @@ You can claim arbitrarily deep subdomains. .. warning:: Gas costs scale up with the number of subdomains! +Multichain Address Support +++++++++++++++++++++++++++ + +`ENSIP-9 `_ +introduced multichain address resolution, allowing users to resolve addresses from +different chains, specified by the coin type index from +`SLIP44 `_. The +``setup_address()`` method on the ``ENS`` class supports multichain address resolution +via the ``coin_type`` keyword argument. + +.. code-block:: python + + from ens.auto import ns + ns.setup_address('ens.eth', coin_type=60) # ETH is coin_type 60 + assert ns.address('ens.eth', coin_type=60) == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' + Link an Address to a Name ^^^^^^^^^^^^^^^^^^^^^^^^^