knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The package offers an easy way to use the etherscan.io API to query information about the Ethereum network. The package uses Rmpfr
for number represenstation where possible.
Currently work in progress. This is an unofficial package. As always use it at your own risk.
Currently, the package is only available from GitHub:
devtools::install_github("dirkschumacher/etherscanr")
Accounts
etherscan_transactions
get all transaction of an accountetherscan_internal_transactions
get all internal transactionsetherscan_balance
retrieve account balancesStats
etherscan_ethsupply
returns the total Ether supply in Weietherscan_lastprice
returns the last price in USDHelpers
to_ether
converts wei to ether using the Multiple Precision Floating-Point Reliable (MPFR) library.For example let us examine all the transactions of account 0x6F46CF5569AEfA1acC1009290c8E043747172d89:
library(etherscanr) library(dplyr) library(ggplot2) etherscan_transactions("0x6F46CF5569AEfA1acC1009290c8E043747172d89") %>% mutate(value = to_ether(value, from = "wei")) %>% filter(value > 0) %>% ggplot(aes(x = timeStamp, y = value)) + geom_point() + stat_smooth() + # we smooth it just because it looks nice ;) theme(legend.position = "bottom") + expand_limits(y = 0)
This is an open project. Anyone who would like to contribute (features, bug fixes, documentation) is very welcome to do so.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.