Socket
Socket
Sign inDemoInstall

ethereum-emissions-calculator

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereum-emissions-calculator

TypeScript utils to calculate the CO2 emissions of an Ethereum wallet. Powered by the Etherscan.io API.


Version published
Weekly downloads
11
increased by175%
Maintainers
1
Weekly downloads
 
Created
Source

Ethereum Carbon Emissions Calculator

Made with ♥ by Offsetra.com for carbon.fyi. License: MIT.

JavaScript utility to calculate the CO2 emissions of any Ethereum address.

The tool is written in TypeScript and powered by the the Etherscan.io API & an open-source carbon accounting methodology under development by Offsetra. We hope this tool is useful for raising awareness and understanding with regards to the rapidly growing carbon emissions of cryptocurrency mining.

Questions, comments, forks and PRs all very much appreciated!

Usage

npm install ethereum-emissions-calculator

Provide an address and a transaction type, and the calculator will tell you how many emissions this represents in KG CO2e. To calculate the sum total of your addresses' lifetime emissions, you must combine the sum of eth, erc20, and erc721 emissions.

import { calculateAddressEmissions } from "ethereum-emissions-calculator";
import { address, etherscanAPIKey } from "data";

const emissions = await calculateAddressEmissions({
  transactionType: "eth", // "eth" | "erc20" | "erc721"
  address, // 0x12345[...]
  etherscanAPIKey,
});

console.log(emissions);
// {
//   transactionType: "eth",
//   kgCO2: 12345`,
//   transactionsCount: 69,
//   gasUsed: 420,
// }

Methodology

Emissions are calculated based on the transactions initiated (sent) by the provided address. The total emissions are derived from the amount of gas used for each transaction.

More on this coming soon!

FAQs

Package last updated on 31 Jan 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc