
Download Cardano staking rewards in PoolTool-compatible format
Source:R/fetch_pooltool.R
fetch_pooltool.RdDownloads Cardano staking reward history for a stake or payment
address using the public Koios API and returns a data frame shaped like the
PoolTool generic CSV export. This can be passed directly to
format_pooltool() or saved locally as a CSV file.
This helper intentionally does not scrape PoolTool. PoolTool's web UI can be
stale or change without notice, while the reward history itself is available
from chain indexer APIs. The returned columns follow the PoolTool export
layout closely enough for format_pooltool() to consume them unchanged.
Usage
fetch_pooltool(
address,
currency = "CAD",
save.path = NULL,
format = FALSE,
exchange = "exodus",
perform = TRUE,
list.prices = NULL,
force = FALSE,
verbose = TRUE
)Arguments
- address
A Cardano stake address (
stake1...) or payment/base address (addr1...).- currency
Local fiat currency for reward values. Currently only
CADis supported. Defaults to"CAD".- save.path
Optional file path. When provided, the returned data frame is also written to disk as a CSV file.
- format
Logical; if
TRUE, returnformat_pooltool()output instead of the raw PoolTool-compatible table.- exchange
Exchange label passed to
format_pooltool()whenformat = TRUE. Defaults to"exodus"to preserve current package behavior.- perform
Whether to execute the API requests (if
TRUE), or just return the request objects that would be used (ifFALSE).- list.prices
Optional
list.pricesobject to use for pricing reward dates. Supplying this keeps the workflow deterministic and avoids implicit online pricing lookups.- force
Passed through to
match_prices()when price data must be resolved.- verbose
Logical; whether to print progress messages.
Value
A data frame in PoolTool generic-CSV shape, or formatted exchange
transactions when format = TRUE.
Examples
fetch_pooltool(
"stake1u88nvynpjl3lsj6wf8k7p9pxj6ta58rx2jfttqqpkumrlpsf6zeud",
perform = FALSE
)
#> $account_rewards
#> <httr2_request>
#> POST https://api.koios.rest/api/v1/account_rewards
#> Headers:
#> * accept : "application/json"
#> * content-type: "application/json"
#> Body: JSON data
#>