PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@polkadot/api-derive/staking

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

import { map } from 'rxjs';
import { memo } from '../util/index.js';
import { erasHistoricApplyAccount } from './util.js';
export function _stakerSlashes(instanceId, api) {
    return memo(instanceId, (accountId, eras, withActive) => {
        const stakerId = api.registry.createType('AccountId', accountId).toString();
        return api.derive.staking._erasSlashes(eras, withActive).pipe(map((slashes) => slashes.map(({ era, nominators, validators }) => ({
            era,
            total: nominators[stakerId] || validators[stakerId] || api.registry.createType('Balance')
        }))));
    });
}
export const stakerSlashes = /*#__PURE__*/ erasHistoricApplyAccount('_stakerSlashes');

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


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