Skip to content

Subspace 1.3.0

Compare
Choose a tag to compare
@richard-ramos richard-ramos released this 11 Feb 14:18
· 65 commits to master since this release

New methods available to track blocks, gas price and blocktime

trackBlock()

Returns the block information for any new block as soon as they are mined. It's the reactive equivalent to web3.eth.getBlock("latest").

subspace.trackBlock().subscribe(block => console.log(block));

trackBlockNumber()

Returns the latest block number. It's the reactive equivalent to web3.eth.getBlockNumber.

subspace.trackBlockNumber().subscribe(blockNumber => console.log(blockNumber));

trackGasPrice()

Returns the current gas price oracle. It's the reactive equivalent to web3.eth.getGasPrice.

subspace.trackGasPrice().subscribe(gasPrice => console.log(gasPrice));

trackAverageBlocktime()

Returns the moving average block time taking in account the latest 10 blocks. The time is returned in milliseconds:

subspace.trackAverageBlocktime().subscribe(blocktimeMS => console.log(blocktimeMS));

Bug fixes

  • Web3 subscriptions are reused, which means that calling a track method with the same parameters more than once will not create a duplicate subscription.