UNPKG

@blockfrost/blockfrost-js

Version:

A JavaScript/TypeScript SDK for interacting with the https://blockfrost.io API

39 lines (38 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.networkEras = exports.network = void 0; const errors_1 = require("../../../utils/errors"); /** * Obtains detailed network information. * @see {@link https://docs.blockfrost.io/#tag/Cardano-Network/paths/~1network/get | API docs for Network information} * * @returns Detailed network information. * */ async function network() { try { const res = await this.instance(`network`); return res.body; } catch (error) { throw (0, errors_1.handleError)(error); } } exports.network = network; /** * Returns start and end of each era along with parameters that can vary between hard forks. * @see {@link https://docs.blockfrost.io/#tag/Cardano-Network/paths/~1network~1eras/get | API docs for Network information} * * @returns List of blockchain eras. * */ async function networkEras() { try { const res = await this.instance(`network/eras`); return res.body; } catch (error) { throw (0, errors_1.handleError)(error); } } exports.networkEras = networkEras;