Skip to content

Commit 9c6ea18

Browse files
committed
feat(transaction-getAll): Merge master
2 parents 516d47c + 3ae03ba commit 9c6ea18

File tree

4 files changed

+382
-6
lines changed

4 files changed

+382
-6
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: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api.md

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,92 @@ const batTokenAddress = web3data.market.getAssetAddresses('bat') const assetAddr
10241024

10251025

10261026

1027+
#### Class: Transaction
1028+
1029+
1030+
Contains methods pertaining to the `/address` endpoint of Amberdata's API.
1031+
See [documentation](https://docs.amberdata.io/reference#get-all-transactions) details about our transaction endpoints.
1032+
1033+
1034+
1035+
1036+
1037+
1038+
1039+
1040+
1041+
#### constructor(web3data)
1042+
1043+
1044+
Creates an instance of Transaction. Meant to be used in conjunction with the Web3Data class.
1045+
1046+
1047+
1048+
1049+
##### Parameters
1050+
1051+
| Name | Type | Description | |
1052+
| ---- | ---- | ----------- | -------- |
1053+
| web3data | | The web3data instance. |   |
1054+
1055+
1056+
1057+
1058+
##### Examples
1059+
1060+
```javascript
1061+
1062+
```
1063+
1064+
1065+
##### Returns
1066+
1067+
1068+
- `Void`
1069+
1070+
1071+
1072+
1073+
1074+
#### getTransactions(filterOptions)
1075+
1076+
1077+
Retrieves all transactions matching the specified filters.
1078+
1079+
1080+
1081+
1082+
##### Parameters
1083+
1084+
| Name | Type | Description | |
1085+
| ---- | ---- | ----------- | -------- |
1086+
| filterOptions | | The filter options associated with the request. |   |
1087+
| filterOptions.status | | Filter by the status of the transactions to retrieve (all, completed, failed, pending). |   |
1088+
| filterOptions.includePrice | | Indicates whether or not to include price data with the results. |   |
1089+
1090+
1091+
1092+
1093+
##### Examples
1094+
1095+
```javascript
1096+
const transactions = await web3data.transaction.getTransactions()
1097+
// Include pricing data with transactions
1098+
const transactions = await web3data.transaction.getTransactions({
1099+
includePrice: true
1100+
})
1101+
```
1102+
1103+
1104+
##### Returns
1105+
1106+
1107+
- All transactions matched by the specified filters.
1108+
1109+
1110+
1111+
1112+
10271113
#### getAll(filterOptions)
10281114

10291115

@@ -1057,6 +1143,213 @@ See 'getTransactions' for details.
10571143

10581144

10591145

1146+
#### getTransaction(hash, filterOptions)
1147+
1148+
1149+
Retrieves the transaction data for the specified hash.
1150+
1151+
1152+
1153+
1154+
##### Parameters
1155+
1156+
| Name | Type | Description | |
1157+
| ---- | ---- | ----------- | -------- |
1158+
| hash | | The transaction hash. |   |
1159+
| filterOptions | | The filter options associated with the request. See [docs](https://docs.amberdata.io/reference#gettransaction) for more details. |   |
1160+
| filterOptions.validationMethod=none | | The validation method to be added to the response: `none`, `basic`, `full`. |   |
1161+
| filterOptions.includePrice=true | | Indicates whether or not to include price data with the results. |   |
1162+
1163+
1164+
1165+
1166+
##### Examples
1167+
1168+
```javascript
1169+
const transaction = await web3data.transaction.getTransaction('0xd0a5a0912fdf87993b3cebd696f1ee667a8fbbe8fc890a22dcbdf114f36de4cf')
1170+
```
1171+
1172+
1173+
##### Returns
1174+
1175+
1176+
- The data for the specified transaction hash.
1177+
1178+
1179+
1180+
1181+
1182+
#### getPendingTransactions()
1183+
1184+
1185+
Retrieves all pending transaction.
1186+
1187+
1188+
1189+
1190+
1191+
1192+
##### Examples
1193+
1194+
```javascript
1195+
const pendingTransactions = await web3data.transaction.getPendingTransactions()
1196+
```
1197+
1198+
1199+
##### Returns
1200+
1201+
1202+
- The pending transactions.
1203+
1204+
1205+
1206+
1207+
1208+
#### getGasPrediction()
1209+
1210+
1211+
Retrieves the latest gas predictions for the transactions.
1212+
1213+
1214+
1215+
1216+
1217+
1218+
##### Examples
1219+
1220+
```javascript
1221+
const gasPredictions = await web3data.transaction.getGasPrediction()
1222+
```
1223+
1224+
1225+
##### Returns
1226+
1227+
1228+
- The latest gas predictions for the transactions.
1229+
1230+
1231+
1232+
1233+
1234+
#### getGasPercentiles(filterOptions)
1235+
1236+
1237+
Retrieves the latest gas price percentiles for the transactions.
1238+
1239+
1240+
1241+
1242+
##### Parameters
1243+
1244+
| Name | Type | Description | |
1245+
| ---- | ---- | ----------- | -------- |
1246+
| filterOptions | | The filter options associated with the request. |   |
1247+
| filterOptions.numBlocks | | Number of past blocks on which to base the percentiles. |   |
1248+
1249+
1250+
1251+
1252+
##### Examples
1253+
1254+
```javascript
1255+
const gasPercentiles = await web3data.transaction.getGasPercentiles()
1256+
```
1257+
1258+
1259+
##### Returns
1260+
1261+
1262+
- The latest gas price percentiles for the transactions.
1263+
1264+
1265+
1266+
1267+
1268+
#### getGasPrice()
1269+
1270+
1271+
Retrieves the latest average gas price. Uses `getGasPrediction` under the hood.
1272+
1273+
1274+
1275+
1276+
1277+
1278+
##### Examples
1279+
1280+
```javascript
1281+
const gasPrice = await web3data.transaction.getGasPrice()
1282+
```
1283+
1284+
1285+
##### Returns
1286+
1287+
1288+
- The latest gas price.
1289+
1290+
1291+
1292+
1293+
1294+
#### getVolume(filterOptions)
1295+
1296+
1297+
Retrieves the historical (time series) volume of transactions.
1298+
1299+
1300+
1301+
1302+
##### Parameters
1303+
1304+
| Name | Type | Description | |
1305+
| ---- | ---- | ----------- | -------- |
1306+
| filterOptions | | The filter options associated with the request. See [docs](https://docs.amberdata.io/reference#gethistoricaltransactionvolume) for more details. |   |
1307+
1308+
1309+
1310+
1311+
##### Examples
1312+
1313+
```javascript
1314+
const volume = await web3data.transaction.getVolume()
1315+
```
1316+
1317+
1318+
##### Returns
1319+
1320+
1321+
- The historical (time series) volume of transactions.
1322+
1323+
1324+
1325+
1326+
1327+
#### getMetrics()
1328+
1329+
1330+
Get metrics for recent confirmed transactions for a given blockchain. Default metrics are over a 24h period.
1331+
1332+
1333+
1334+
1335+
1336+
1337+
##### Examples
1338+
1339+
```javascript
1340+
const metrics = await web3data.transaction.getMetrics()
1341+
```
1342+
1343+
1344+
##### Returns
1345+
1346+
1347+
- Metrics for recent confirmed transactions.
1348+
1349+
1350+
1351+
1352+
10601353
### src/utils.js
10611354

10621355

0 commit comments

Comments
 (0)