npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eth-reveal

v0.6.1

Published

Dig into Ethereum transactions and reveal their secrets

Downloads

33

Readme

Eth-Reveal

CircleCI npm version

Dive into Ethereum transactions from the CLI or via a module.

Use it live in Codepen: https://codepen.io/justinjmoses/full/vwexLj

Features

  • Decodes method calls, function parameters and logs (with formatted dates and numbers) using ABI from Etherscan (if any)
  • Looks for target of contract if any (i.e. a Proxy) and adds that ABI as well
  • Shows errors and revert reasons

Note: due to storage limitations of popular Ethereum providers, you won't get revert reasons for most transactions more than 128 blocks in the past unless you use an Infura archive node (see https://infura.io/docs/ethereum/add-ons/archiveData)

Browser API

<script src="//cdn.jsdelivr.net/npm/eth-reveal/browser.js"></script>
<script>
	// assumes browser supports modern JS (can use Babel preprocesser for this, see settings in Codepen linked above)
	(async () => {
		const { reveal } = window;
		const {
			hash,
			blockNumber,
			timestamp,
			to,
			from,
			isContract,
			contract,
			underlyingContract,
			method,
			decodedLogs,
			gasPrice,
			gasLimit,
			gasUsed,
			gasFormat, // handy format of gas price, limit and used params
			status,
			errorMessage,
			revertReason,
			value,
			nonce,
		} = await reveal({
			hash: '0x92031f1cafad71bdfaa2d326b222972df2c2dcdc2931b5e8c1a32bda2dc7b2c8',
			network: 'mainnet', // default (supports kovan, ropsten and rinkeby)
			etherscanKey: 'demo', // optionally for better ES performance
			// to access historical data such as previous proxy targets and revert reasons, either supply a provider URI
			providerURI: undefined,
			infuraProjectID: '123321', // or optionally an infura project ID for an archive node
		});
	})();
</script>

Node API

const reveal = require('eth-reveal');

(async () => {
	const {
		hash,
		blockNumber,
		timestamp,
		to,
		from,
		isContract,
		contract,
		underlyingContract,
		method,
		decodedLogs,
		gasPrice,
		gasLimit,
		gasUsed,
		gasFormat, // handy format of gas price, limit and used params
		status,
		errorMessage,
		revertReason,
		value,
		nonce,
	} = await reveal({
		hash: '0x92031f1cafad71bdfaa2d326b222972df2c2dcdc2931b5e8c1a32bda2dc7b2c8',
		network: 'mainnet', // default (supports kovan, ropsten and rinkeby)
		etherscanKey: process.env.ETHERSCAN_API_KEY, // optionally for better ES performance
		// to access historical data such as previous proxy targets and revert reasons, either supply a provider URI
		providerURI: undefined,
		infuraProjectID: '123321', // or optionally an infura project ID for an archive node
	});
})();

CLI Usage:

npx eth-reveal -h [hash]

e.g. npx eth-reveal -h 0x203d9f5ec035ddaa02fc3a61b113bcfc6a8c0ee965fed7508e3627fc39f1a18f (SynthetixFeePool.claimFees)

image

e.g. npx eth-reveal -h 0xa9cfa1dc823f35e230ba1b785f359df0fa3056fe6b3689516216f3c6fc7599ac (Send ETH to NEPay)

image

e.g. npx eth-reveal -h 0x7f370b9f6647762d1a04f55b6a34195da98b749da01bed58d600c87658cf7b90

image (DMSCOIN.transfer)

e.g. npx eth-reveal -h 0x7a8d26e929dba1146cb3eb3ef5ed48883d2460a365f0e7bab2acecbbbdf47f05 (Synthetix.burnSynths)

image