Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@brave/eth-token-tracker
Advanced tools
A module for tracking Ethereum token balances over block changes.
A JS module for tracking Ethereum tokens and their values over time.
npm install '@metamask/eth-token-tracker'
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()
FAQs
A module for tracking Ethereum token balances over block changes.
We found that @brave/eth-token-tracker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.