UNPKG

@ledgerhq/coin-hedera

Version:
23 lines 837 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getValidators = getValidators; const api_1 = require("../network/api"); const utils_1 = require("./utils"); async function getValidators(cursor) { const res = await api_1.apiClient.getNodes({ fetchAllPages: false, ...(cursor && { cursor }), }); return { next: res.nextCursor ?? undefined, items: res.nodes.map(node => ({ address: node.node_account_id, nodeId: node.node_id.toString(), name: (0, utils_1.extractCompanyFromNodeDescription)(node.description), description: node.description, balance: BigInt(node.stake), apy: (0, utils_1.calculateAPY)(node.reward_rate_start), })), }; } //# sourceMappingURL=getValidators.js.map