@helium/http
Version:
HTTP library for interacting with the Helium blockchain API
32 lines • 1.14 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const camelcase_keys_1 = __importDefault(require("camelcase-keys"));
class Stats {
constructor(client, context) {
this.client = client;
this.context = context;
}
async get() {
let url = '/stats';
if (this.context === 'validators') {
url = '/validators/stats';
}
const { data: { data: stats }, } = await this.client.get(url);
return (0, camelcase_keys_1.default)(stats, { deep: true });
}
async counts() {
const url = '/stats/counts';
const { data: { data: stats }, } = await this.client.get(url);
return (0, camelcase_keys_1.default)(stats);
}
async dcBurns() {
const url = '/dc_burns/stats';
const { data: { data: stats }, } = await this.client.get(url);
return (0, camelcase_keys_1.default)(stats, { deep: true });
}
}
exports.default = Stats;
//# sourceMappingURL=Stats.js.map