ethjs / ethjs-ens

An Ethereum Name Service interface module built on EthJS
34 stars 17 forks source link

Compatibility Web3 0.x -> Web3 1.0 #18

Closed renexdev closed 6 years ago

renexdev commented 6 years ago

Hi there, I'm trying to use ethjs-ens in a project with Web3 1.0. The following code:

    let provider = web3.currentProvider
    provider.sendAsync = provider.send
    console.log(provider)
    const ens = new ENS( provider, registryAddress)

gives me error: The EthJsENS Constructor requires a provider. Do you know any way to handdle this? Thanks in advance...

danfinlay commented 6 years ago

Look at the sample code. These are not two ordered arguments, they are options in a hash:

 const ens = new ENS({ provider, network: '3' })

// is the same as:
 const ens = new ENS({ provider: provider, network: '3' })
renexdev commented 6 years ago

Great, thanks!