
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@synonymdev/slashtags-widget-bitcoin-feed
Advanced tools
Populates the data for the Bitcoin stats widget.
Copy config/config.example.json
to config/config.json
then edit the relay address.
cp config/config.example.json config/config.json
Start the feed writer
npm start
It will generate a keyPair
and persist that in config/config.json
for future sessions.
It should print: Running Bitcoin price feed: slashfeed:<id>/Bitcoin Price?relay=<relay-address>
To read The price feed use the Reader
helper class.
const { Feed, Reader } = require('slashtags-widget-price-feed');
(async () => {
const client = new Client({ storage: './path/to/feed/storage', relay: 'https://web-relay.example.com' })
const feed = new Feed(client, config, { icon })
await feed.ready()
const client = new Client({ storage: './path/to/reader/storage'})
const readerClient = new Client({ storage: tmpdir() })
const reader = new Reader(readerClient, feed.url)
const unsubscribe = reader.subscribeBlockInfo(latestBlock => {
// latestBlock:
// {
// height: <block height>,
// timestamp: <timestamp of last block>,
// transactionCount: <tx count>,
// size: <size of block>,
// weight: <weight of block>,
// difficulty: <difficulty>,
// hash: <blocks hash>,
// merkleRoot: <blocks merkle root>
// }
})
// Either call unsubscribe or close reader to close subscriptions
unsubscribe()
reader.close()
})
FAQs
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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.