ensdomains / ensjs-v2

Javascript bindings for the Ethereum Name Service
208 stars 122 forks source link

Feature request: Expose registry address property #41

Open eggplantzzz opened 5 years ago

eggplantzzz commented 5 years ago

This issue is a request for the address of the registry that the library is connected to to be exposed as a property on the instance. So for example, I would like to be able to do the following:

const ENSJS = require("ethereum-ens");
const provider = <someValidProviderForMainnet>;
const ensjs = new ENSJS(provider);
ensjs.address
> 0x314159265dd8dbb310642f98f50c066173c1259b // address for the mainnet ENS registry

Currently I am using the address found at ensjs.registryPromise._rejectionHandler0._address but this does not seem ideal. :)