Skip to content

Commit 7594ecb

Browse files
committed
test(address): Merge master
2 parents 302c98c + 3ae03ba commit 7594ecb

File tree

4 files changed

+386
-6
lines changed

4 files changed

+386
-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: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,303 @@ const batTokenAddress = web3data.market.getAssetAddresses('bat') const assetAddr
11481148

11491149

11501150

1151+
### src/transaction.js
1152+
1153+
1154+
1155+
#### Class: Transaction
1156+
1157+
1158+
Contains methods pertaining to the `/address` endpoint of Amberdata's API.
1159+
See [documentation](https://docs.amberdata.io/reference#get-all-transactions) details about our transaction endpoints.
1160+
1161+
1162+
1163+
1164+
1165+
1166+
1167+
1168+
1169+
#### constructor(web3data)
1170+
1171+
1172+
Creates an instance of Transaction. Meant to be used in conjunction with the Web3Data class.
1173+
1174+
1175+
1176+
1177+
##### Parameters
1178+
1179+
| Name | Type | Description | |
1180+
| ---- | ---- | ----------- | -------- |
1181+
| web3data | | The web3data instance. |   |
1182+
1183+
1184+
1185+
1186+
##### Examples
1187+
1188+
```javascript
1189+
1190+
```
1191+
1192+
1193+
##### Returns
1194+
1195+
1196+
- `Void`
1197+
1198+
1199+
1200+
1201+
1202+
#### getTransactions(filterOptions)
1203+
1204+
1205+
Retrieves all transactions matching the specified filters.
1206+
1207+
1208+
1209+
1210+
##### Parameters
1211+
1212+
| Name | Type | Description | |
1213+
| ---- | ---- | ----------- | -------- |
1214+
| filterOptions | | The filter options associated with the request. |   |
1215+
| filterOptions.status | | Filter by the status of the transactions to retrieve (all, completed, failed, pending). |   |
1216+
| filterOptions.includePrice | | Indicates whether or not to include price data with the results. |   |
1217+
1218+
1219+
1220+
1221+
##### Examples
1222+
1223+
```javascript
1224+
const transactions = await web3data.transaction.getTransactions()
1225+
// Include pricing data with transactions
1226+
const transactions = await web3data.transaction.getTransactions({
1227+
includePrice: true
1228+
})
1229+
```
1230+
1231+
1232+
##### Returns
1233+
1234+
1235+
- All transactions matched by the specified filters.
1236+
1237+
1238+
1239+
1240+
1241+
#### getTransaction(hash, filterOptions)
1242+
1243+
1244+
Retrieves the transaction data for the specified hash.
1245+
1246+
1247+
1248+
1249+
##### Parameters
1250+
1251+
| Name | Type | Description | |
1252+
| ---- | ---- | ----------- | -------- |
1253+
| hash | | The transaction hash. |   |
1254+
| filterOptions | | The filter options associated with the request. See [docs](https://docs.amberdata.io/reference#gettransaction) for more details. |   |
1255+
| filterOptions.validationMethod=none | | The validation method to be added to the response: `none`, `basic`, `full`. |   |
1256+
| filterOptions.includePrice=true | | Indicates whether or not to include price data with the results. |   |
1257+
1258+
1259+
1260+
1261+
##### Examples
1262+
1263+
```javascript
1264+
const transaction = await web3data.transaction.getTransaction('0xd0a5a0912fdf87993b3cebd696f1ee667a8fbbe8fc890a22dcbdf114f36de4cf')
1265+
```
1266+
1267+
1268+
##### Returns
1269+
1270+
1271+
- The data for the specified transaction hash.
1272+
1273+
1274+
1275+
1276+
1277+
#### getPendingTransactions()
1278+
1279+
1280+
Retrieves all pending transaction.
1281+
1282+
1283+
1284+
1285+
1286+
1287+
##### Examples
1288+
1289+
```javascript
1290+
const pendingTransactions = await web3data.transaction.getPendingTransactions()
1291+
```
1292+
1293+
1294+
##### Returns
1295+
1296+
1297+
- The pending transactions.
1298+
1299+
1300+
1301+
1302+
1303+
#### getGasPrediction()
1304+
1305+
1306+
Retrieves the latest gas predictions for the transactions.
1307+
1308+
1309+
1310+
1311+
1312+
1313+
##### Examples
1314+
1315+
```javascript
1316+
const gasPredictions = await web3data.transaction.getGasPrediction()
1317+
```
1318+
1319+
1320+
##### Returns
1321+
1322+
1323+
- The latest gas predictions for the transactions.
1324+
1325+
1326+
1327+
1328+
1329+
#### getGasPercentiles(filterOptions)
1330+
1331+
1332+
Retrieves the latest gas price percentiles for the transactions.
1333+
1334+
1335+
1336+
1337+
##### Parameters
1338+
1339+
| Name | Type | Description | |
1340+
| ---- | ---- | ----------- | -------- |
1341+
| filterOptions | | The filter options associated with the request. |   |
1342+
| filterOptions.numBlocks | | Number of past blocks on which to base the percentiles. |   |
1343+
1344+
1345+
1346+
1347+
##### Examples
1348+
1349+
```javascript
1350+
const gasPercentiles = await web3data.transaction.getGasPercentiles()
1351+
```
1352+
1353+
1354+
##### Returns
1355+
1356+
1357+
- The latest gas price percentiles for the transactions.
1358+
1359+
1360+
1361+
1362+
1363+
#### getGasPrice()
1364+
1365+
1366+
Retrieves the latest average gas price. Uses `getGasPrediction` under the hood.
1367+
1368+
1369+
1370+
1371+
1372+
1373+
##### Examples
1374+
1375+
```javascript
1376+
const gasPrice = await web3data.transaction.getGasPrice()
1377+
```
1378+
1379+
1380+
##### Returns
1381+
1382+
1383+
- The latest gas price.
1384+
1385+
1386+
1387+
1388+
1389+
#### getVolume(filterOptions)
1390+
1391+
1392+
Retrieves the historical (time series) volume of transactions.
1393+
1394+
1395+
1396+
1397+
##### Parameters
1398+
1399+
| Name | Type | Description | |
1400+
| ---- | ---- | ----------- | -------- |
1401+
| filterOptions | | The filter options associated with the request. See [docs](https://docs.amberdata.io/reference#gethistoricaltransactionvolume) for more details. |   |
1402+
1403+
1404+
1405+
1406+
##### Examples
1407+
1408+
```javascript
1409+
const volume = await web3data.transaction.getVolume()
1410+
```
1411+
1412+
1413+
##### Returns
1414+
1415+
1416+
- The historical (time series) volume of transactions.
1417+
1418+
1419+
1420+
1421+
1422+
#### getMetrics()
1423+
1424+
1425+
Get metrics for recent confirmed transactions for a given blockchain. Default metrics are over a 24h period.
1426+
1427+
1428+
1429+
1430+
1431+
1432+
##### Examples
1433+
1434+
```javascript
1435+
const metrics = await web3data.transaction.getMetrics()
1436+
```
1437+
1438+
1439+
##### Returns
1440+
1441+
1442+
- Metrics for recent confirmed transactions.
1443+
1444+
1445+
1446+
1447+
11511448
### src/utils.js
11521449

11531450

0 commit comments

Comments
 (0)