Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eac-counter

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eac-counter

Shows how much ETH has been transferred using the Ethereum Alarm Clock Protocol

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

npm version

EAC Counter

A library that fetches the amount of ETH (and USD) transferred using the Ethereum Alarm Clock.

Installation

npm install eac-counter

Usage

import EacCounter from 'eac-counter';
const eacCounter = new EacCounter({
  // Needed for fetching amount of USD transferred, get an API key from https://nomics.com/
  nomicsApiKey: '<nomics_api_key>',
  // Needed for fetching amount of ETH transferred, get an API key from https://etherscan.io/
  etherscanApiKey: '<etherscan_api_key>',
});

// Optional: Needed to fetch the amount of USD transferred
await eacCounter.enableUSDFetching();

const { eth, usd } = await eacCounter.getTotalTransferred();
console.log(eth);
console.log(usd); // This will be null if enableUSDFetching() is not called

Browser usage

To use this library in the browser, download and import the browser-compatible file into your HTML file.

<script src="eac-counter.browser.js"></script>

This will expose the EacCounter to the window object. You can then use the following code to fetch the counter:

const eacCounter = new EacCounter({
  nomicsApiKey: '<nomics_api_key>',
  etherscanApiKey: '<etherscan_api_key>',
});
eacCounter.enableUSDFetching().then(function () {
  eacCounter.getTotalTransferred().then(function (value) {
    console.log(value.eth);
    console.log(value.usd);
  });
});

FAQs

Package last updated on 11 Jun 2020

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