A Node.js module to easily retrieve address metadata from Eth Registry's Ethereum contract.
Usage:
yarn add theregistry
- get(_address) ⇒
string
|string
Retrieve metadata for this address
- storeMetadata(_address, _name, _data, _callback) ⇒
string
Stores address metadata on Eth Registry
- storeJsonFileIPFS(Blob) ⇒
string
Reads content of a JSON file and stores it on IPFS
- storeDataFileIPFS(Blob) ⇒
string
Reads content of a Plaintext file and stores it on IPFS
- convertBlobToBase64(Blob) ⇒
string
Converts an image blob to a base64 string
- lookUp(IPFS) ⇒
string
Reads content of a JSON file and stores it on IPFS
- price(unit) ⇒
number
Retrieve the current price for submitting data to Eth Registry
- getHistory() ⇒
string
Retrieve the last 10 submissions to Eth Registry
Retrieve metadata for this address
Kind: global function
Returns: string
- Address Metadata object with received metadata or null when no metadata availablestring
- Name Metadata object with received metadata or null when no metadata available
Param | Type |
---|---|
_address | string |
Example
import Registry from "eth-registry";
import Web3 from "web3";
const provider = new Web3.providers.HttpProvider(
`https://mainnet.infura.io/`,
);
const registry = new Registry(provider);
registry
.get(ensaddress)
.then(r => {
console.log(r.data);
})
.catch(e => console.error(e));
Stores address metadata on Eth Registry
Kind: global function
Returns: string
- TX Hash of the submitted file
Param | Type | Description |
---|---|---|
_address | string |
Address for which you are submitting data |
_name | string |
Name of the address |
_data | string |
Metadata object |
_callback | function |
Callback for when the transaction receipt is returned |
Reads content of a JSON file and stores it on IPFS
Kind: global function
Returns: string
- IPFS Hash of stored file
Param | Type | Description |
---|---|---|
Blob | blob |
accepted by Filereader |
Reads content of a Plaintext file and stores it on IPFS
Kind: global function
Returns: string
- IPFS Hash of stored file
Param | Type | Description |
---|---|---|
Blob | blob |
accepted by Filereader |
Converts an image blob to a base64 string
Kind: global function
Returns: string
- base64 encoded image file
Param | Type | Description |
---|---|---|
Blob | blob |
accepted by Filereader |
Reads content of a JSON file and stores it on IPFS
Kind: global function
Returns: string
- JSON contents returned from IPFS
Param | Type | Description |
---|---|---|
IPFS | string |
address to look up |
Retrieve the current price for submitting data to Eth Registry
Kind: global function
Returns: number
- Current price
Param | Type | Default | Description |
---|---|---|---|
unit | string |
"ether" |
Unit to convert the price to (defaults to 'ether') |
Retrieve the last 10 submissions to Eth Registry
Kind: global function
Returns: string
- the last 10 submissions to Eth Registry
npm run clean
- Removelib/
directorynpm test
- Run tests with linting and coverage results.npm test:only
- Run tests without linting or coverage.npm test:watch
- You can even re-run tests on file changes!npm test:prod
- Run tests with minified code.npm run test:examples
- Test written examples on pure JS for better understanding module usage.npm run lint
- Run ESlint with airbnb-confignpm run cover
- Get coverage report for your code.npm run build
- Babel will transpile ES6 => ES5 and minify the code.npm run prepublish
- Hook for npm. Do all the checks before publishing your module.
MIT © Alexander Mangel