@browseth/ens
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -109,6 +109,24 @@ 'use strict'; | ||
this.allTexts = function (node, key) { | ||
return _this.constructor.resolver.e.textChanged({ | ||
node: node, | ||
key: key | ||
}).logs('earliest'); | ||
var abi$$1 = new abi.AbiEvent({ | ||
anonymous: false, | ||
inputs: [{ indexed: true, name: 'node', type: 'bytes32' }, { indexed: true, name: 'indexedKey', type: 'string' }, { indexed: false, name: 'key', type: 'string' }], | ||
name: 'TextChanged', | ||
type: 'event' | ||
}); | ||
return _this.resolverAddress(node).then(function (resolverAddress) { | ||
return _this.ethRef.request('eth_getLogs', { | ||
fromBlock: '0x32C5B9', | ||
toBlock: 'latest', | ||
topics: abi$$1.enc(node, key).map(function (topic) { | ||
return Array.isArray(topic) ? topic.map(function (v) { | ||
return _this.ethRef.data(v); | ||
}) : _this.ethRef.data(topic); | ||
}).filter(function (topic) { | ||
return topic.length; | ||
}).slice(0, 2), | ||
address: resolverAddress | ||
}).then(function (logs) { | ||
return logs.map(abi$$1.dec); | ||
}); | ||
}); | ||
}; | ||
@@ -115,0 +133,0 @@ |
@@ -6,3 +6,3 @@ import _regeneratorRuntime from 'babel-runtime/regenerator'; | ||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
import { AbiCodec } from '@browseth/abi'; | ||
import { AbiCodec, AbiEvent } from '@browseth/abi'; | ||
@@ -104,6 +104,24 @@ var EnsLookup = function EnsLookup(ethRef) { | ||
this.allTexts = function (node, key) { | ||
return _this.constructor.resolver.e.textChanged({ | ||
node: node, | ||
key: key | ||
}).logs('earliest'); | ||
var abi = new AbiEvent({ | ||
anonymous: false, | ||
inputs: [{ indexed: true, name: 'node', type: 'bytes32' }, { indexed: true, name: 'indexedKey', type: 'string' }, { indexed: false, name: 'key', type: 'string' }], | ||
name: 'TextChanged', | ||
type: 'event' | ||
}); | ||
return _this.resolverAddress(node).then(function (resolverAddress) { | ||
return _this.ethRef.request('eth_getLogs', { | ||
fromBlock: '0x32C5B9', | ||
toBlock: 'latest', | ||
topics: abi.enc(node, key).map(function (topic) { | ||
return Array.isArray(topic) ? topic.map(function (v) { | ||
return _this.ethRef.data(v); | ||
}) : _this.ethRef.data(topic); | ||
}).filter(function (topic) { | ||
return topic.length; | ||
}).slice(0, 2), | ||
address: resolverAddress | ||
}).then(function (logs) { | ||
return logs.map(abi.dec); | ||
}); | ||
}); | ||
}; | ||
@@ -110,0 +128,0 @@ |
41
index.js
// import * as utils from '@browseth/utils' | ||
import { AbiCodec } from '@browseth/abi' | ||
import { AbiCodec, AbiEvent } from '@browseth/abi' | ||
export { EnsLookup as default, EnsLookup } | ||
@@ -321,9 +321,34 @@ | ||
allTexts = (node, key) => | ||
this.constructor.resolver.e | ||
.textChanged({ | ||
node, | ||
key, | ||
}) | ||
.logs('earliest') | ||
allTexts = (node, key) => { | ||
const abi = new AbiEvent({ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: true, name: 'node', type: 'bytes32' }, | ||
{ indexed: true, name: 'indexedKey', type: 'string' }, | ||
{ indexed: false, name: 'key', type: 'string' }, | ||
], | ||
name: 'TextChanged', | ||
type: 'event', | ||
}) | ||
return this.resolverAddress(node).then(resolverAddress => { | ||
return this.ethRef | ||
.request('eth_getLogs', { | ||
fromBlock: '0x32C5B9', | ||
toBlock: 'latest', | ||
topics: abi | ||
.enc(node, key) | ||
.map( | ||
topic => | ||
Array.isArray(topic) | ||
? topic.map(v => this.ethRef.data(v)) | ||
: this.ethRef.data(topic), | ||
) | ||
.filter(topic => topic.length) | ||
.slice(0, 2), | ||
address: resolverAddress, | ||
}) | ||
.then(logs => logs.map(abi.dec)) | ||
}) | ||
} | ||
info = node => | ||
@@ -330,0 +355,0 @@ Promise.all([ |
{ | ||
"name": "@browseth/ens", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "MIT", | ||
@@ -15,7 +15,6 @@ "browser": "build/browser.js", | ||
"pretest": "yarn build-node", | ||
"test": "node test", | ||
"postinstall": "lerna link" | ||
"test": "node test" | ||
}, | ||
"dependencies": { | ||
"@browseth/utils": "^1.0.1", | ||
"@browseth/utils": "^1.0.2", | ||
"babel-runtime": "^6.26.0" | ||
@@ -26,3 +25,3 @@ }, | ||
}, | ||
"gitHead": "d1858226c266ce7f8c1d9962a7453f8604f55624" | ||
"gitHead": "ff00b0e69911525b0ddb55312ea5357f77c13c76" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
878371
11494
0
Updated@browseth/utils@^1.0.2