Skip to content

Commit 49e4857

Browse files
committed
doc(transactions): Add docs for method: getTransactions
1 parent f37a6d7 commit 49e4857

File tree

4 files changed

+106
-3
lines changed

4 files changed

+106
-3
lines changed

dist/web3data.min.js

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

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: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,91 @@ const batTokenAddress = web3data.market.getAssetAddresses('bat') const assetAddr
982982

983983

984984

985+
### src/transaction.js
986+
987+
988+
989+
#### Class: Transaction
990+
991+
992+
Contains methods pertaining to the `/address` endpoint of Amberdata's API.
993+
See [documentation](https://docs.amberdata.io/reference#get-all-transactions) details about our transaction endpoints.
994+
995+
996+
997+
998+
999+
1000+
1001+
1002+
1003+
#### constructor(web3data)
1004+
1005+
1006+
Creates an instance of Transaction. Meant to be used in conjunction with the Web3Data class.
1007+
1008+
1009+
1010+
1011+
##### Parameters
1012+
1013+
| Name | Type | Description | |
1014+
| ---- | ---- | ----------- | -------- |
1015+
| web3data | | The web3data instance. |   |
1016+
1017+
1018+
1019+
1020+
##### Examples
1021+
1022+
```javascript
1023+
1024+
```
1025+
1026+
1027+
##### Returns
1028+
1029+
1030+
- `Void`
1031+
1032+
1033+
1034+
1035+
1036+
#### getTransactions(filterOptions)
1037+
1038+
1039+
Retrieves all transactions matching the specified filters.
1040+
1041+
1042+
1043+
1044+
##### Parameters
1045+
1046+
| Name | Type | Description | |
1047+
| ---- | ---- | ----------- | -------- |
1048+
| filterOptions | | The filter options associated with the request. |   |
1049+
| filterOptions.status | | Filter by the status of the transactions to retrieve (all, completed, failed, pending). |   |
1050+
1051+
1052+
1053+
1054+
##### Examples
1055+
1056+
```javascript
1057+
const transactions = await web3data.transaction.getTransactions()
1058+
```
1059+
1060+
1061+
##### Returns
1062+
1063+
1064+
- - All transactions matched by the specified filters.
1065+
1066+
1067+
1068+
1069+
9851070
### src/utils.js
9861071

9871072

src/transaction.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@ const {
55

66
const {is, get, onFulfilled, onError, throwIf} = require('./utils')
77

8+
/**
9+
* Contains methods pertaining to the `/address` endpoint of Amberdata's API.
10+
* See [documentation](https://docs.amberdata.io/reference#get-all-transactions) details about our transaction endpoints.
11+
*/
812
class Transaction {
13+
/**
14+
* Creates an instance of Transaction. Meant to be used in conjunction with the Web3Data class.
15+
*
16+
* @param web3data - The web3data instance.
17+
* @example
18+
*/
919
constructor(web3data) {
1020
this.web3data = web3data
1121
}
1222

13-
getTransactions(filterOptions) {
23+
/**
24+
* Retrieves all transactions matching the specified filters.
25+
*
26+
* @param [filterOptions] - The filter options associated with the request.
27+
* @param [filterOptions.status] - Filter by the status of the transactions to retrieve (all, completed, failed, pending).
28+
* @returns - All transactions matched by the specified filters.
29+
* @example const transactions = await web3data.transaction.getTransactions()
30+
*/
31+
getTransactions(filterOptions = {}) {
1432
return get(this.web3data, {
1533
endpoint: ENDPOINT,
1634
filterOptions

0 commit comments

Comments
 (0)