PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@polkadot/api-derive/cjs/staking
Просмотр файла: stakerPoints.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stakerPoints = void 0;
exports._stakerPoints = _stakerPoints;
const rxjs_1 = require("rxjs");
const index_js_1 = require("../util/index.js");
const util_js_1 = require("./util.js");
function _stakerPoints(instanceId, api) {
return (0, index_js_1.memo)(instanceId, (accountId, eras, withActive) => {
const stakerId = api.registry.createType('AccountId', accountId).toString();
return api.derive.staking._erasPoints(eras, withActive).pipe((0, rxjs_1.map)((points) => points.map(({ era, eraPoints, validators }) => ({
era,
eraPoints,
points: validators[stakerId] || api.registry.createType('RewardPoint')
}))));
});
}
exports.stakerPoints = (0, util_js_1.erasHistoricApplyAccount)('_stakerPoints');
Выполнить команду
Для локальной разработки. Не используйте в интернете!