embark/packages/plugins/ens
Michael Bradley, Jr 030fb4acc6 build(deps): bump web3[-*] from 1.2.4 to 1.2.6
Remove `bignumber.js` workaround (in the root, from PR #2152) because it's no
longer needed (verified locally).

Remove the `"skipLibCheck"` workaround (in `packages/plugins/solidity-tests`,
from PR #2152) because it's no longer needed (verified locally).

Refactor a typing in `packages/plugins/geth`. What's happening is that in web3
v1.2.4 `sendTransaction` has a return type of `PromiEvent<TransactionReceipt>`
but in v1.2.6 it has a return type of `PromiEvent<TransactionReceipt |
TransactionRevertInstructionError>`.

Compare:
* [v1.2.4/packages/web3-eth/types/index.d.ts#L291-L294](https://github.com/ethereum/web3.js/blob/v1.2.4/packages/web3-eth/types/index.d.ts#L291-L294)
* [v1.2.6/packages/web3-eth/types/index.d.ts#L295-L298](https://github.com/ethereum/web3.js/blob/v1.2.6/packages/web3-eth/types/index.d.ts#L295-L298)

The problem is that the `TransactionRevertInstructionError` type doesn't have a
`transactionHash` property. Since at present the code in
`packages/plugins/geth/src/devtxs.ts` only deals with the success case re:
`sendTransaction`, import the `TransactionReceipt` type from `web3-eth` and
cast the resolved return value's type using TypeScript's `as` operator.
2020-02-03 10:17:07 -06:00
..
src chore(@embarkens): update ENS Registry mainnet address 2020-02-03 09:34:11 -06:00
test fix(@embark/ens): connect to web3 only with dappAutoEnable is true 2020-01-20 12:22:48 -06:00
.npmrc move embarkjs packages & remove embark- prefix from some folders (#1879) 2019-09-06 18:26:08 -04:00
CHANGELOG.md chore(prerelease): 5.1.1-nightly.2 2020-01-31 00:12:28 +00: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 build(deps): bump web3[-*] from 1.2.4 to 1.2.6 2020-02-03 10:17:07 -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