Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Externalize Network Map #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var textEncoding = require('text-encoding');
var TextDecoder = textEncoding.TextDecoder;
var uts46 = require('idna-uts46');
var _ = require('underscore');
var registryAddresses = require('ethereum-ens-network-map');

var registryInterface = [
{
Expand Down Expand Up @@ -258,13 +259,6 @@ var resolverInterface = [
}
];

var registryAddresses = {
// Mainnet
"1": "0x314159265dd8dbb310642f98f50c066173c1259b",
// Ropsten
"3": "0x112234455c3a32fd11230c42e7bccd4a84e02010",
}

/**
* @class
*/
Expand All @@ -279,7 +273,7 @@ function Resolver(ens, node, contract) {
return Promise.promisifyAll(contract.at(address));
});
});

_.each(contract.abi, function(signature) {
this[signature.name] = function() {
var args = arguments;
Expand Down Expand Up @@ -326,7 +320,7 @@ function fromHex(x) {
if(x.startsWith("0x")) {
x = x.slice(2);
}

var ret = new Uint8Array(x.length / 2);
for(var i = 0; i < ret.length; i++) {
ret[i] = parseInt(x.slice(i * 2, i * 2 + 2), 16);
Expand Down Expand Up @@ -369,7 +363,7 @@ Resolver.prototype.contract = function() {
}.bind(this));
};

/**
/**
* @class
*
* @description Provides an easy-to-use interface to the Ethereum Name Service.
Expand Down Expand Up @@ -529,7 +523,7 @@ ENS.prototype.owner = function(name, callback) {
}

/**
* setOwner sets the owner of the specified name. Only the owner may call
* setOwner sets the owner of the specified name. Only the owner may call
* setResolver or setSubnodeOwner. The calling account must be the current
* owner of the name in order for this call to succeed.
* @param {string} name The name to update
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"dependencies": {
"bluebird": "^3.4.7",
"crypto-js": "^3.1.6",
"ethereum-ens-network-map": "^1.0.0",
"idna-uts46": "^1.0.1",
"pako": "^1.0.4",
"text-encoding": "^0.6.4",
Expand Down