@blockfrost/blockfrost-js
Version:
A JavaScript/TypeScript SDK for interacting with the https://blockfrost.io API
39 lines (38 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.metricsEndpoints = exports.metrics = void 0;
const errors_1 = require("../../../utils/errors");
/**
* Obtains history of your Blockfrost usage metrics in the past 30 days.
* @see {@link https://docs.blockfrost.io/#tag/Metrics/paths/~1metrics/get | API docs for Blockfrost usage metrics}
*
* @returns Usage metrics for the last 30 days
*
*/
async function metrics() {
try {
const res = await this.instance(`metrics`);
return res.body;
}
catch (error) {
throw (0, errors_1.handleError)(error);
}
}
exports.metrics = metrics;
/**
* Obtains history of your Blockfrost usage metrics, grouped per endpoint, in the past 30 days.
* @see {@link https://docs.blockfrost.io/#tag/Metrics/paths/~1metrics~1endpoints/get | API docs for Blockfrost endpoint usage metrics}
*
* @returns Usage metrics for the last 30 days
*
*/
async function metricsEndpoints() {
try {
const res = await this.instance(`metrics/endpoints`);
return res.body;
}
catch (error) {
throw (0, errors_1.handleError)(error);
}
}
exports.metricsEndpoints = metricsEndpoints;