import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.metrics.chains.getRollingWindowMetrics({
metric: "txCount",
});
console.log(result);
}
run();{
"result": {
"lastHour": 123,
"lastDay": 123,
"lastWeek": 123,
"lastMonth": 123,
"last90Days": 123,
"lastYear": 123,
"allTime": 123
}
}Gets the rolling window metrics for an EVM chain for the last hour, day, week, month, 90 days, year, and all time. Active addresses/active senders only support last hour, day, and week.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.metrics.chains.getRollingWindowMetrics({
metric: "txCount",
});
console.log(result);
}
run();{
"result": {
"lastHour": 123,
"lastDay": 123,
"lastWeek": 123,
"lastMonth": 123,
"last90Days": 123,
"lastYear": 123,
"allTime": 123
}
}Which chain level metric to fetch for the rolling window.
gasUsed, txCount, avgGps, maxGps, avgTps, maxTps, avgGasPrice, maxGasPrice, feesPaid, contracts, deployers, activeAddresses, activeSenders A supported EVM chain ID or one of "total", "mainnet", or "testnet". Use the /chains endpoint to get a list of supported chain IDs.
Successful response
Array of current metrics values for different windows.
Show child attributes
Was this page helpful?