Skip to content

Commit 2897f48

Browse files
Merge pull request #110 from next-game-solutions/package-website
package website
2 parents 8fa4f55 + d57be0e commit 2897f48

11 files changed

+124
-19
lines changed

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
^.github
66
^README\.Rmd$
77
^codecov\.yml$
8+
^_pkgdown\.yml$
9+
^docs$
10+
^pkgdown$
11+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/pkgdown.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
name: pkgdown
7+
8+
jobs:
9+
pkgdown:
10+
runs-on: macOS-latest
11+
env:
12+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- uses: r-lib/actions/setup-r@v1
17+
18+
- uses: r-lib/actions/setup-pandoc@v1
19+
20+
- name: Query dependencies
21+
run: |
22+
install.packages('remotes')
23+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
24+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
25+
shell: Rscript {0}
26+
27+
- name: Cache R packages
28+
uses: actions/cache@v2
29+
with:
30+
path: ${{ env.R_LIBS_USER }}
31+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
32+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
33+
34+
- name: Install dependencies
35+
run: |
36+
remotes::install_deps(dependencies = TRUE)
37+
install.packages("pkgdown", type = "binary")
38+
shell: Rscript {0}
39+
40+
- name: Install package
41+
run: R CMD INSTALL .
42+
43+
- name: Deploy package
44+
run: |
45+
git config --local user.email "actions@github.com"
46+
git config --local user.name "GitHub Actions"
47+
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
scratchpad/*
33
.V8history
44
inst/doc
5+
docs

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ get_current_trx_price(vs_currencies = c("usd", "eur", "btc"))
4848
#> # A tibble: 3 x 3
4949
#> trx_price vs_currency last_updated_at
5050
#> <dbl> <chr> <dttm>
51-
#> 1 0.0604 usd 2021-02-21 12:35:43
52-
#> 2 0.0498 eur 2021-02-21 12:35:43
53-
#> 3 0.00000105 btc 2021-02-21 12:35:43
51+
#> 1 0.0599 usd 2021-02-21 14:59:17
52+
#> 2 0.0494 eur 2021-02-21 14:59:17
53+
#> 3 0.00000104 btc 2021-02-21 14:59:17
5454

5555

5656
# Querying the TRX market data for a historical period, and plotting the
@@ -90,25 +90,25 @@ get_block_info(latest = TRUE) %>%
9090
glimpse()
9191
#> Rows: 1
9292
#> Columns: 11
93-
#> $ request_time <dttm> 2021-02-21 12:39:39
94-
#> $ block_number <chr> "27841015"
95-
#> $ timestamp <dttm> 2021-02-21 12:38:33
96-
#> $ hash <chr> "0000000001a8d1f7d93d7e4bc40889b1ae1fd328d1b671c8a4...
97-
#> $ parent_hash <chr> "0000000001a8d1f69291287299ab41d7d18be0a1d72759b3ed...
98-
#> $ tx_trie_root <chr> "2q8j1sQad2sVwMpViH2b2m55tNvamXmLsDeX6p5prUfLxFigRE"
93+
#> $ request_time <dttm> 2021-02-21 14:59:57
94+
#> $ block_number <chr> "27843818"
95+
#> $ timestamp <dttm> 2021-02-21 14:58:48
96+
#> $ hash <chr> "0000000001a8dcea5b6d9ae8a2d56f86403592338967699563...
97+
#> $ parent_hash <chr> "0000000001a8dce9a1f8df63b9eefb4fd65074842978bec4fc...
98+
#> $ tx_trie_root <chr> "eLAJi7QAbEZ1qQtHj1EYSZjNJVEG17vVprQHBmMvGrdtqiy3X"
9999
#> $ confirmed <lgl> TRUE
100-
#> $ size <int> 32623
101-
#> $ witness_address <chr> "TWvncFqyDfMcKfjsx4hvoWwhJfF5yKMZcU"
102-
#> $ tx_count <int> 125
103-
#> $ tx <list> [<tbl_df[125 x 4]>]
100+
#> $ size <int> 31862
101+
#> $ witness_address <chr> "TSNbzxac4WhxN91XvaUfPTKP2jNT18mP6T"
102+
#> $ tx_count <int> 131
103+
#> $ tx <list> [<tbl_df[131 x 4]>]
104104

105105

106106
# Current balance of an account:
107107
get_account_balance("TQjaZ9FD473QBTdUzMLmSyoGB6Yz1CGpux") %>%
108108
glimpse()
109109
#> Rows: 1
110110
#> Columns: 10
111-
#> $ request_time <dttm> 2021-02-21 12:39:41
111+
#> $ request_time <dttm> 2021-02-21 15:00:00
112112
#> $ address <chr> "TQjaZ9FD473QBTdUzMLmSyoGB6Yz1CGpux"
113113
#> $ name <chr> "SunTRXV3Pool"
114114
#> $ total_tx <int> 69011

_pkgdown.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
template:
2+
params:
3+
bootswatch: yeti
4+
5+
reference:
6+
- title: "Market data"
7+
- contents:
8+
- get_current_trx_price
9+
- get_current_trx_market_data
10+
- get_trx_market_data_for_date
11+
- get_trx_market_data_for_time_range
12+
- get_trx_market_data_for_last_n_days
13+
- get_trx_ohlc_data_for_last_n_days
14+
- get_supported_coingecko_currencies
15+
- title: "Account balance"
16+
- contents:
17+
- get_account_balance
18+
- get_account_trx_balance
19+
- list_top_trx_holders
20+
- title: "Blocks"
21+
- contents:
22+
- get_block_info
23+
- get_blocks_for_time_range
24+
- title: "Transactions"
25+
- contents:
26+
- get_tx_info_by_id
27+
- get_tx_info_by_account_address
28+
- get_tx_for_time_range
29+
- title: "Transfers"
30+
- contents:
31+
- get_trc10_transfers
32+
- get_trc20_transfers
33+
- title: "Smart contract events"
34+
- contents:
35+
- get_events_of_latest_block
36+
- get_events_by_block_number
37+
- get_events_by_tx_id
38+
- get_events_by_contract_address
39+
- title: "Token descriptions"
40+
- contents:
41+
- get_trc10_token_description
42+
- get_trc20_token_description
43+
- title: "Blockchain statistics"
44+
- contents:
45+
- get_chain_statistics
46+
- title: "Utility functions"
47+
- contents:
48+
- apply_decimal
49+
- convert_address
50+
- is_address
51+
- from_unix_timestamp
52+
- to_unix_timestamp

vignettes/getting-acount-balance.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Balance of a TRON account"
33
output: rmarkdown::html_vignette
44
vignette: >
5-
%\VignetteIndexEntry{Querying the balance of a TRON account}
5+
%\VignetteIndexEntry{Balance of a TRON account}
66
%\VignetteEngine{knitr::rmarkdown}
77
%\VignetteEncoding{UTF-8}
88
---

vignettes/getting-events-info.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Smart contract events"
33
output: rmarkdown::html_vignette
44
vignette: >
5-
%\VignetteIndexEntry{Querying the smart contract events}
5+
%\VignetteIndexEntry{Smart contract events}
66
%\VignetteEngine{knitr::rmarkdown}
77
%\VignetteEncoding{UTF-8}
88
---

vignettes/getting-market-data.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Market data for Tronix (TRX)"
33
output: rmarkdown::html_vignette
44
vignette: >
5-
%\VignetteIndexEntry{Getting the market data for Tronix (TRX)}
5+
%\VignetteIndexEntry{Market data for Tronix (TRX)}
66
%\VignetteEngine{knitr::rmarkdown}
77
%\VignetteEncoding{UTF-8}
88
---

vignettes/getting-transfer-data.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "TRC-10 and TRC-20 transfers"
33
output: rmarkdown::html_vignette
44
vignette: >
5-
%\VignetteIndexEntry{Querying the TRC-10 and TRC-20 transfers}
5+
%\VignetteIndexEntry{TRC-10 and TRC-20 transfers}
66
%\VignetteEngine{knitr::rmarkdown}
77
%\VignetteEncoding{UTF-8}
88
---

0 commit comments

Comments
 (0)