PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@polkadot/api-derive/cjs/staking

Просмотр файла: overview.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.overview = overview;
const rxjs_1 = require("rxjs");
const util_1 = require("@polkadot/util");
const index_js_1 = require("../util/index.js");
/**
 * @description Retrieve the staking overview, including elected and points earned
 */
function overview(instanceId, api) {
    return (0, index_js_1.memo)(instanceId, () => (0, rxjs_1.combineLatest)([
        api.derive.session.indexes(),
        api.derive.staking.validators()
    ]).pipe((0, rxjs_1.map)(([indexes, { nextElected, validators }]) => (0, util_1.objectSpread)({}, indexes, {
        nextElected,
        validators
    }))));
}

Выполнить команду


Для локальной разработки. Не используйте в интернете!