@apexfusionfoundation/blockfrost-js
Version:
A JavaScript/TypeScript SDK for interacting with the https://blockfrost.io API
43 lines (42 loc) • 1.37 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() {
return new Promise((resolve, reject) => {
this.instance(`metrics`)
.then(resp => {
resolve(resp.body);
})
.catch(err => {
reject((0, errors_1.handleError)(err));
});
});
}
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() {
return new Promise((resolve, reject) => {
this.instance(`metrics/endpoints`)
.then(resp => {
resolve(resp.body);
})
.catch(err => {
reject((0, errors_1.handleError)(err));
});
});
}
exports.metricsEndpoints = metricsEndpoints;