@@ -188,8 +188,8 @@ Get the Address for an ENS Name
188
188
.. code-block :: python
189
189
190
190
from ens.auto import ns
191
- eth_address = ns.address(' jasoncarver .eth' )
192
- assert eth_address == ' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD '
191
+ eth_address = ns.address(' ens .eth' )
192
+ assert eth_address == ' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 '
193
193
194
194
The ``ENS `` module has no opinion as to which TLD you can use,
195
195
but will not infer a TLD if it is not provided with the name.
@@ -199,13 +199,13 @@ Get the ENS Name for an Address
199
199
200
200
.. code-block :: python
201
201
202
- domain = ns.name(' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD ' )
202
+ domain = ns.name(' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 ' )
203
203
204
204
# name() also accepts the bytes version of the address
205
- assert ns.name(b ' [ c$o! \x91\xf1\x8f &u \xce\xdb\x8b ( \x10 . \x95 tX ' ) == domain
205
+ assert ns.name(b ' \xfe\x89\xcc z \xbb ,A \x83 h: \xb7\x16 S \xc4\xcd\xc9\xb0 -D \xb7 ' ) == domain
206
206
207
207
# confirm that the name resolves back to the address that you looked up:
208
- assert ns.address(domain) == ' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD '
208
+ assert ns.address(domain) == ' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 '
209
209
210
210
.. note :: For accuracy, and as a recommendation from the ENS documentation on
211
211
`reverse resolution <https://docs.ens.domains/dapp-developer-guide/resolving-names#reverse-resolution >`_,
@@ -233,24 +233,24 @@ you must already be the owner of the domain (or its parent).
233
233
234
234
.. code-block :: python
235
235
236
- ns.setup_address(' jasoncarver .eth' , ' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD ' )
236
+ ns.setup_address(' ens .eth' , ' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 ' )
237
237
238
238
In the common case where you want to point the name to the owning address, you can skip the address.
239
239
240
240
.. code-block :: python
241
241
242
- ns.setup_address(' jasoncarver .eth' )
242
+ ns.setup_address(' ens .eth' )
243
243
244
244
You can claim arbitrarily deep subdomains.
245
245
246
246
.. code-block :: python
247
247
248
- ns.setup_address(' supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver .eth' )
248
+ ns.setup_address(' supreme.executive.power.derives.from.a.mandate.from.the.masses.ens .eth' )
249
249
250
250
# wait for the transaction to be mined, then:
251
251
assert (
252
- ns.address(' supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver .eth' )
253
- == ' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD '
252
+ ns.address(' supreme.executive.power.derives.from.a.mandate.from.the.masses.ens .eth' )
253
+ == ' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 '
254
254
)
255
255
256
256
.. warning :: Gas costs scale up with the number of subdomains!
@@ -265,14 +265,14 @@ this is referred to as "reverse" resolution. The ENS Reverse Resolver is used fo
265
265
266
266
.. code-block :: python
267
267
268
- ns.setup_name(' jasoncarver .eth' , ' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD ' )
268
+ ns.setup_name(' ens .eth' , ' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 ' )
269
269
270
270
If you don't supply the address, :meth: `~ens.ENS.setup_name ` will assume you want the
271
271
address returned by :meth: `~ens.ENS.address `.
272
272
273
273
.. code-block :: python
274
274
275
- ns.setup_name(' jasoncarver .eth' )
275
+ ns.setup_name(' ens .eth' )
276
276
277
277
If the name doesn't already point to an address, :meth: `~ens.ENS.setup_name ` will
278
278
call :meth: `~ens.ENS.setup_address ` for you.
@@ -281,7 +281,7 @@ Wait for the transaction to be mined, then:
281
281
282
282
.. code-block :: python
283
283
284
- assert ns.name(' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD ' ) == ' jasoncarver .eth'
284
+ assert ns.name(' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 ' ) == ' ens .eth'
285
285
286
286
....
287
287
@@ -298,15 +298,15 @@ You'll need to setup the address first, and then the text can be set:
298
298
299
299
.. code-block :: python
300
300
301
- ns.setup_address(' jasoncarver .eth' , ' 0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD ' )
302
- ns.set_text(' jasoncarver .eth' , ' url' , ' https://example.com' )
301
+ ns.setup_address(' ens .eth' , ' 0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7 ' )
302
+ ns.set_text(' ens .eth' , ' url' , ' https://example.com' )
303
303
304
304
A transaction dictionary can be passed as the last argument if desired:
305
305
306
306
.. code-block :: python
307
307
308
308
transaction_dict = {' from' : ' 0x123...' }
309
- ns.set_text(' jasoncarver .eth' , ' url' , ' https://example.com' , transaction_dict)
309
+ ns.set_text(' ens .eth' , ' url' , ' https://example.com' , transaction_dict)
310
310
311
311
If the transaction dictionary is not passed, sensible defaults will be used, and if
312
312
a transaction dictionary is passed but does not have a ``from `` value,
@@ -319,7 +319,7 @@ Anyone can read the data from an ENS Record:
319
319
320
320
.. code-block :: python
321
321
322
- url = ns.get_text(' jasoncarver .eth' , ' url' )
322
+ url = ns.get_text(' ens .eth' , ' url' )
323
323
assert url == ' https://example.com'
324
324
325
325
....
@@ -334,7 +334,7 @@ You can get the resolver for an ENS name via the :meth:`~ens.ENS.resolver` metho
334
334
335
335
.. code-block :: python
336
336
337
- >> > resolver = ns.resolver(' jasoncarver .eth' )
337
+ >> > resolver = ns.resolver(' ens .eth' )
338
338
>> > resolver.address
339
339
' 0x5B2063246F2191f18F2675ceDB8b28102e957458'
340
340
0 commit comments