
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
eth-method-registry
Advanced tools
A module for getting method signature info from an ethereum method signature.
A javascript library for getting Solidity method data from a four-byte method signature.
Currently uses the parity on-chain method registry, but eventually I am interested in adding various parallel methods, whatever works and returns a valid response!
With Node.js Installed:
yarn install eth-method-registry -S
const { MethodRegistry } = require('eth-method-registry')
const Eth = require('@metamask/ethjs')
const provider = new Eth.HttpProvider('https://mainnet.infura.io/v3/YOUR-PROJECT-ID')
const registry = new MethodRegistry({ provider })
// Uses promises, pass the 4byte prefix to the lookup method:
registry.lookup('0xa9059cbb')
.then((result) => {
console.log(result) // prints 'transfer(address,uint256)'
})
// Also includes a method for parsing the resulting sig
// into something more useful for rendering:
const sig = 'transferFrom(address,uint256)'
const parsed = registry.parse(sig)
/* Parsed value:
{
name :'Transfer From',
args: [
{ type: 'address' },
{ type: 'uint256' }
]
}
*/
The unit tests of this package run against Infura's v3 API.
After cloning this repository, run cp .infurarc.template .infurarc
and add your Infura project ID to the file.
yarn test
[4.0.0]
16.20
(#57)@babel/runtime@^7.0.0
is now a peerDependency (#62)MethodRegistry
properties are now removed: eth
, provider
, registry
(#60)@metamask/ethjs
with used subdependencies @metamask/ethjs-query
and @metamask/ethjs-contract
(#61)@metamask/ethjs-contract
and @metamask/ethjs-query
(#62)
@metamask/ethjs-contract
@^0.3.4
->^0.4.1
@metamask/ethjs-query
@^0.5.3
->^0.7.1
babel-runtime
(#62)FAQs
A module for getting method signature info from an ethereum method signature.
The npm package eth-method-registry receives a total of 72,233 weekly downloads. As such, eth-method-registry popularity was classified as popular.
We found that eth-method-registry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.