An implementation of ledger-cli getquote
that uses Blocktap.io GraphQL to retrieve cryptoasset pricing data.
getquote-blocktap <asset symbol>
Example:
$ getquote-blocktap BTC
3680.000000000
Homebrew is the preferred installation method:
brew tap colindean/ledger-getquote-blocktap https://github.com/colindean/ledger-getquote-blocktap.git
brew install ledger-getquote-blocktap-bin
Alternatively, download the latest release here.
For Windows, you can use the MSVC version if you already have the 2015 Visual C++ Runtime already installed. Otherwise, try the GNU version.
This repo is configured to release on annotated tags on push.
cargo release --dry-run
# once satisfied
cargo release
Run this in Blocktap's playground:
query ledger_pricedb {
assets(sort: { marketCapRank: ASC }){ # need to programatically add filters here for the asset passed into getquote.
assetName
assetSymbol
markets(aggregation: VWA, filter: { quoteSymbol_eq: "USD" }) {
ticker {
lastPrice
}
}
}
}
Use the fantastic graphql-rust project's client tool:
cargo install graphql_client_cli
Get the latest version of the JSON schema:
graphql-client introspect-schema https://api.blocktap.io/graphql --output /tmp/blocktap.json