embark/packages/plugins/ens
Jonathan Rainville 42bd3b7792 fix(@embark/ens): fix Infura connection and testnet use of ENS
Fixes the use of Infura to connect to the ENS contracts. When
connecting directly to Infura, it would throw with `rejected due to
project ID settings`, because it doesn't accept the VM as the domain
Instead, when passing from the proxy, it works. So I changed the
default when no dappConnection to ['$EMBARK']. I also added a
message when the error happens to help users fix it themselves

When in the testnet, we don,t register because we already have the
addresses, which is fine, but we also didn't populate the ensConfig
object which contains the important information about the addresses
and ABI.

There was a lot of lint problems in a couple of files so I cleaned
that up
2020-01-16 11:45:14 -05:00
..
src fix(@embark/ens): fix Infura connection and testnet use of ENS 2020-01-16 11:45:14 -05:00
test build: specify missing test action in relevant package.json "qa" scripts 2019-12-11 14:01:12 -06:00
.npmrc move embarkjs packages & remove embark- prefix from some folders (#1879) 2019-09-06 18:26:08 -04:00
CHANGELOG.md chore(release): 5.0.0 2020-01-07 12:14:37 -06:00
README.md build: tidy up the monorepo in prep for v5.0.0-alpha.0 2019-10-01 13:29:53 -05:00
package.json chore(release): 5.0.0 2020-01-07 12:14:37 -06:00
tsconfig.json build: implement collective typecheck 2019-12-13 13:59:47 -05:00

README.md

embark-ens

Implements ENS support in Embark

This module:

  • registers console commands to interact with ENS
  • deploys & setups ENS contracts depending on the network
  • implements ENS support in EmbarkJS
  • setups generated code acording to the config

API

command: ens:resolve - returns the address of an ens name

arguments:

  • name - ens name to resolve

response:

  • error - if an error occurs, null otherwise
  • address - address associated to the ens name given

command: ens:isENSName - checks is it's a (valid) ENS name

arguments:

  • name - ens name to validate

response:

  • error - if an error occurs, null otherwise
  • result - true/false depending if name given is a valid ens name

command: storage:ens:associate - associates an hash to an ENS domain

arguments:

  • options
    • name - ens name
    • storageHash - hash to associate

response:

  • error - if an error occurs, null otherwise

Web API

endpoint: GET /embark-api/ens/resolve - returns the address of an ens name

arguments:

  • name - ens name to resolve

response:

{
  address: <address of ens name>
}

endpoint: GET /embark-api/ens/lookup - returns the ens name of an address

arguments:

  • address - address to query

response:

{
  name: <ens name of address>
}

endpoint: POST /embark-api/ens/register registers a domain or subdomain

arguments:

  • subdomain - ens domain
  • address - address to associate

response:

{
  name: <ens name>
  address: <address>
}

Dependencies

  • async
  • eth-ens-namehash
  • embarkjs.utils
    • secureSend
  • embark utils
    • AddressUtils
    • hashTo32ByteHexString
    • recursiveMerge