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

@brave/eth-token-tracker

Package Overview
Dependencies
Maintainers
9
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brave/eth-token-tracker

A module for tracking Ethereum token balances over block changes.

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
9
Created
Source

Eth Token Tracker CircleCI

A JS module for tracking Ethereum tokens and their values over time.

Installation

npm install '@metamask/eth-token-tracker'

Usage

const TokenTracker = require('@metamask/eth-token-tracker')

var tokenTracker = new TokenTracker({

  userAddress: addresses[0], // whose balance to track
  provider,                  // a web3-style provider
  pollingInterval: 4000,     // block polling interval (optional)

  // Tell it about the tokens to track:
  tokens: [
    {
      address: tokenAddress,
    }
  ],
})

// You can use this method to check the state of the tokens
var balances = tokenTracker.serialize()

// You can also subscribe to updates
tokenTracker.on('update', function (balances) {
  console.log(`Your balance of ${balances[0].symbol} is ${balances[0].string}`)
})

// You can add additional tokens after initialization:
tokenTracker.add({ address: otherTokenAddress })

// Make sure to clean up, or it will hold a reference:
tokenTracker.stop()

Keywords

FAQs

Package last updated on 04 Feb 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