Skip to content

Commit 7018afd

Browse files
committed
doc(transactions): Add missing tests.
1 parent c6bd03d commit 7018afd

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

dist/web3data.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ Retrieves the latest gas predictions for the transactions.
11471147
##### Examples
11481148

11491149
```javascript
1150-
1150+
const gasPredictions = await web3data.transaction.getGasPrediction()
11511151
```
11521152

11531153

@@ -1181,7 +1181,7 @@ Retrieves the latest gas price percentiles for the transactions.
11811181
##### Examples
11821182

11831183
```javascript
1184-
1184+
const gasPercentiles = await web3data.transaction.getGasPercentiles()
11851185
```
11861186

11871187

@@ -1207,7 +1207,7 @@ Retrieves the latest average gas price. Uses `getGasPrediction` under the hood.
12071207
##### Examples
12081208

12091209
```javascript
1210-
1210+
const gasPrice = await web3data.transaction.getGasPrice()
12111211
```
12121212

12131213

@@ -1240,7 +1240,7 @@ Retrieves the historical (time series) volume of transactions.
12401240
##### Examples
12411241

12421242
```javascript
1243-
1243+
const volume = await web3data.transaction.getVolume()
12441244
```
12451245

12461246

@@ -1266,7 +1266,7 @@ Get metrics for recent confirmed transactions for a given blockchain. Default me
12661266
##### Examples
12671267

12681268
```javascript
1269-
1269+
const metrics = await web3data.transaction.getMetrics()
12701270
```
12711271

12721272

src/transaction.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class Transaction {
8484
*
8585
* @returns The latest gas predictions for the transactions.
8686
* @example
87+
* const gasPredictions = await web3data.transaction.getGasPrediction()
8788
*/
8889
getGasPrediction() {
8990
return get(this.web3data, {
@@ -99,6 +100,7 @@ class Transaction {
99100
* @param [filterOptions.numBlocks] - Number of past blocks on which to base the percentiles.
100101
* @returns The latest gas price percentiles for the transactions.
101102
* @example
103+
* const gasPercentiles = await web3data.transaction.getGasPercentiles()
102104
*/
103105
getGasPercentiles(filterOptions = {}) {
104106
return get(this.web3data, {
@@ -113,6 +115,7 @@ class Transaction {
113115
*
114116
* @returns The latest gas price.
115117
* @example
118+
* const gasPrice = await web3data.transaction.getGasPrice()
116119
*/
117120
getGasPrice() {
118121
return this.getGasPrediction().then(gasPrediction => {
@@ -130,6 +133,7 @@ class Transaction {
130133
* @param [filterOptions] - The filter options associated with the request. See [docs](https://docs.amberdata.io/reference#get-historical-transaction-volume) for more details.
131134
* @returns The historical (time series) volume of transactions.
132135
* @example
136+
* const volume = await web3data.transaction.getVolume()
133137
*/
134138
getVolume(filterOptions = {}) {
135139
return get(this.web3data, {
@@ -144,6 +148,8 @@ class Transaction {
144148
*
145149
* @returns Metrics for recent confirmed transactions.
146150
* @example
151+
* const metrics = await web3data.transaction.getMetrics()
152+
*
147153
*/
148154
getMetrics(filterOptions = {}) {
149155
return get(this.web3data, {

0 commit comments

Comments
 (0)