mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 13:31:00 +00:00
1 line
9.8 KiB
Plaintext
1 line
9.8 KiB
Plaintext
{"dependencies":[{"name":"rxjs","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":15,"index":156},"end":{"line":5,"column":30,"index":171}}],"key":"atDzfUGaJNRNtwyVumomzH/5ygw=","exportNames":["*"],"imports":1}},{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":15,"index":188},"end":{"line":6,"column":40,"index":213}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":7,"column":19,"index":234},"end":{"line":7,"column":46,"index":261}}],"key":"H94lp+EitftSFqDHaenrSs5zKB0=","exportNames":["*"],"imports":1}},{"name":"./cache.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":8,"column":19,"index":282},"end":{"line":8,"column":40,"index":303}}],"key":"j07H5gZzqUTkzaDscxaQqJUlcmI=","exportNames":["*"],"imports":1}},{"name":"./util.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":9,"column":18,"index":323},"end":{"line":9,"column":38,"index":343}}],"key":"RHtkf1pyimtRfZWAvWBZ833kE8E=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.erasPoints = void 0;\n exports._erasPoints = _erasPoints;\n const rxjs_1 = require(_dependencyMap[0], \"rxjs\");\n const util_1 = require(_dependencyMap[1], \"@polkadot/util\");\n const index_js_1 = require(_dependencyMap[2], \"../util/index.js\");\n const cache_js_1 = require(_dependencyMap[3], \"./cache.js\");\n const util_js_1 = require(_dependencyMap[4], \"./util.js\");\n const CACHE_KEY = 'eraPoints';\n function mapValidators({\n individual\n }) {\n return [...individual.entries()].filter(([, points]) => points.gt(util_1.BN_ZERO)).reduce((result, [validatorId, points]) => {\n result[validatorId.toString()] = points;\n return result;\n }, {});\n }\n function mapPoints(eras, points) {\n return eras.map((era, index) => ({\n era,\n eraPoints: points[index].total,\n validators: mapValidators(points[index])\n }));\n }\n function _erasPoints(instanceId, api) {\n return (0, index_js_1.memo)(instanceId, (eras, withActive) => {\n if (!eras.length) {\n return (0, rxjs_1.of)([]);\n }\n const cached = (0, cache_js_1.getEraMultiCache)(CACHE_KEY, eras, withActive);\n const remaining = (0, util_js_1.filterEras)(eras, cached);\n return !remaining.length ? (0, rxjs_1.of)(cached) : api.query.staking.erasRewardPoints.multi(remaining).pipe((0, rxjs_1.map)(p => (0, cache_js_1.filterCachedEras)(eras, cached, (0, cache_js_1.setEraMultiCache)(CACHE_KEY, withActive, mapPoints(remaining, p)))));\n });\n }\n /**\n * @name erasPoints\n * @description Retrieves historical era points with its validators.\n * @param {boolean} withActive? (Optional) Whether to include the active era in the result.\n * @example\n * ```javascript\n * const points = await api.derive.staking.erasPoints(true);\n * console.log(\n * \"Validator points:\",\n * points.map(({ era, eraPoints }) => `Era: ${era}, points ${eraPoints}`)\n * );\n * ```\n */\n exports.erasPoints = (0, util_js_1.erasHistoricApply)('_erasPoints');\n});","lineCount":54,"map":[[2,2,1,0],[2,14,1,12],[4,2,2,0,"Object"],[4,8,2,6],[4,9,2,7,"defineProperty"],[4,23,2,21],[4,24,2,22,"exports"],[4,31,2,29],[4,33,2,31],[4,45,2,43],[4,47,2,45],[5,4,2,47,"value"],[5,9,2,52],[5,11,2,54],[6,2,2,59],[6,3,2,60],[6,4,2,61],[7,2,3,0,"exports"],[7,9,3,7],[7,10,3,8,"erasPoints"],[7,20,3,18],[7,23,3,21],[7,28,3,26],[7,29,3,27],[8,2,4,0,"exports"],[8,9,4,7],[8,10,4,8,"_erasPoints"],[8,21,4,19],[8,24,4,22,"_erasPoints"],[8,35,4,33],[9,2,5,0],[9,8,5,6,"rxjs_1"],[9,14,5,12],[9,17,5,15,"require"],[9,24,5,22],[9,25,5,22,"_dependencyMap"],[9,39,5,22],[9,50,5,29],[9,51,5,30],[10,2,6,0],[10,8,6,6,"util_1"],[10,14,6,12],[10,17,6,15,"require"],[10,24,6,22],[10,25,6,22,"_dependencyMap"],[10,39,6,22],[10,60,6,39],[10,61,6,40],[11,2,7,0],[11,8,7,6,"index_js_1"],[11,18,7,16],[11,21,7,19,"require"],[11,28,7,26],[11,29,7,26,"_dependencyMap"],[11,43,7,26],[11,66,7,45],[11,67,7,46],[12,2,8,0],[12,8,8,6,"cache_js_1"],[12,18,8,16],[12,21,8,19,"require"],[12,28,8,26],[12,29,8,26,"_dependencyMap"],[12,43,8,26],[12,60,8,39],[12,61,8,40],[13,2,9,0],[13,8,9,6,"util_js_1"],[13,17,9,15],[13,20,9,18,"require"],[13,27,9,25],[13,28,9,25,"_dependencyMap"],[13,42,9,25],[13,58,9,37],[13,59,9,38],[14,2,10,0],[14,8,10,6,"CACHE_KEY"],[14,17,10,15],[14,20,10,18],[14,31,10,29],[15,2,11,0],[15,11,11,9,"mapValidators"],[15,24,11,22,"mapValidators"],[15,25,11,23],[16,4,11,25,"individual"],[17,2,11,36],[17,3,11,37],[17,5,11,39],[18,4,12,4],[18,11,12,11],[18,12,12,12],[18,15,12,15,"individual"],[18,25,12,25],[18,26,12,26,"entries"],[18,33,12,33],[18,34,12,34],[18,35,12,35],[18,36,12,36],[18,37,13,9,"filter"],[18,43,13,15],[18,44,13,16],[18,45,13,17],[18,48,13,20,"points"],[18,54,13,26],[18,55,13,27],[18,60,13,32,"points"],[18,66,13,38],[18,67,13,39,"gt"],[18,69,13,41],[18,70,13,42,"util_1"],[18,76,13,48],[18,77,13,49,"BN_ZERO"],[18,84,13,56],[18,85,13,57],[18,86,13,58],[18,87,14,9,"reduce"],[18,93,14,15],[18,94,14,16],[18,95,14,17,"result"],[18,101,14,23],[18,103,14,25],[18,104,14,26,"validatorId"],[18,115,14,37],[18,117,14,39,"points"],[18,123,14,45],[18,124,14,46],[18,129,14,51],[19,6,15,8,"result"],[19,12,15,14],[19,13,15,15,"validatorId"],[19,24,15,26],[19,25,15,27,"toString"],[19,33,15,35],[19,34,15,36],[19,35,15,37],[19,36,15,38],[19,39,15,41,"points"],[19,45,15,47],[20,6,16,8],[20,13,16,15,"result"],[20,19,16,21],[21,4,17,4],[21,5,17,5],[21,7,17,7],[21,8,17,8],[21,9,17,9],[21,10,17,10],[22,2,18,0],[23,2,19,0],[23,11,19,9,"mapPoints"],[23,20,19,18,"mapPoints"],[23,21,19,19,"eras"],[23,25,19,23],[23,27,19,25,"points"],[23,33,19,31],[23,35,19,33],[24,4,20,4],[24,11,20,11,"eras"],[24,15,20,15],[24,16,20,16,"map"],[24,19,20,19],[24,20,20,20],[24,21,20,21,"era"],[24,24,20,24],[24,26,20,26,"index"],[24,31,20,31],[24,37,20,37],[25,6,21,8,"era"],[25,9,21,11],[26,6,22,8,"eraPoints"],[26,15,22,17],[26,17,22,19,"points"],[26,23,22,25],[26,24,22,26,"index"],[26,29,22,31],[26,30,22,32],[26,31,22,33,"total"],[26,36,22,38],[27,6,23,8,"validators"],[27,16,23,18],[27,18,23,20,"mapValidators"],[27,31,23,33],[27,32,23,34,"points"],[27,38,23,40],[27,39,23,41,"index"],[27,44,23,46],[27,45,23,47],[28,4,24,4],[28,5,24,5],[28,6,24,6],[28,7,24,7],[29,2,25,0],[30,2,26,0],[30,11,26,9,"_erasPoints"],[30,22,26,20,"_erasPoints"],[30,23,26,21,"instanceId"],[30,33,26,31],[30,35,26,33,"api"],[30,38,26,36],[30,40,26,38],[31,4,27,4],[31,11,27,11],[31,12,27,12],[31,13,27,13],[31,15,27,15,"index_js_1"],[31,25,27,25],[31,26,27,26,"memo"],[31,30,27,30],[31,32,27,32,"instanceId"],[31,42,27,42],[31,44,27,44],[31,45,27,45,"eras"],[31,49,27,49],[31,51,27,51,"withActive"],[31,61,27,61],[31,66,27,66],[32,6,28,8],[32,10,28,12],[32,11,28,13,"eras"],[32,15,28,17],[32,16,28,18,"length"],[32,22,28,24],[32,24,28,26],[33,8,29,12],[33,15,29,19],[33,16,29,20],[33,17,29,21],[33,19,29,23,"rxjs_1"],[33,25,29,29],[33,26,29,30,"of"],[33,28,29,32],[33,30,29,34],[33,32,29,36],[33,33,29,37],[34,6,30,8],[35,6,31,8],[35,12,31,14,"cached"],[35,18,31,20],[35,21,31,23],[35,22,31,24],[35,23,31,25],[35,25,31,27,"cache_js_1"],[35,35,31,37],[35,36,31,38,"getEraMultiCache"],[35,52,31,54],[35,54,31,56,"CACHE_KEY"],[35,63,31,65],[35,65,31,67,"eras"],[35,69,31,71],[35,71,31,73,"withActive"],[35,81,31,83],[35,82,31,84],[36,6,32,8],[36,12,32,14,"remaining"],[36,21,32,23],[36,24,32,26],[36,25,32,27],[36,26,32,28],[36,28,32,30,"util_js_1"],[36,37,32,39],[36,38,32,40,"filterEras"],[36,48,32,50],[36,50,32,52,"eras"],[36,54,32,56],[36,56,32,58,"cached"],[36,62,32,64],[36,63,32,65],[37,6,33,8],[37,13,33,15],[37,14,33,16,"remaining"],[37,23,33,25],[37,24,33,26,"length"],[37,30,33,32],[37,33,34,14],[37,34,34,15],[37,35,34,16],[37,37,34,18,"rxjs_1"],[37,43,34,24],[37,44,34,25,"of"],[37,46,34,27],[37,48,34,29,"cached"],[37,54,34,35],[37,55,34,36],[37,58,35,14,"api"],[37,61,35,17],[37,62,35,18,"query"],[37,67,35,23],[37,68,35,24,"staking"],[37,75,35,31],[37,76,35,32,"erasRewardPoints"],[37,92,35,48],[37,93,35,49,"multi"],[37,98,35,54],[37,99,35,55,"remaining"],[37,108,35,64],[37,109,35,65],[37,110,35,66,"pipe"],[37,114,35,70],[37,115,35,71],[37,116,35,72],[37,117,35,73],[37,119,35,75,"rxjs_1"],[37,125,35,81],[37,126,35,82,"map"],[37,129,35,85],[37,131,35,88,"p"],[37,132,35,89],[37,136,35,94],[37,137,35,95],[37,138,35,96],[37,140,35,98,"cache_js_1"],[37,150,35,108],[37,151,35,109,"filterCachedEras"],[37,167,35,125],[37,169,35,127,"eras"],[37,173,35,131],[37,175,35,133,"cached"],[37,181,35,139],[37,183,35,141],[37,184,35,142],[37,185,35,143],[37,187,35,145,"cache_js_1"],[37,197,35,155],[37,198,35,156,"setEraMultiCache"],[37,214,35,172],[37,216,35,174,"CACHE_KEY"],[37,225,35,183],[37,227,35,185,"withActive"],[37,237,35,195],[37,239,35,197,"mapPoints"],[37,248,35,206],[37,249,35,207,"remaining"],[37,258,35,216],[37,260,35,218,"p"],[37,261,35,219],[37,262,35,220],[37,263,35,221],[37,264,35,222],[37,265,35,223],[37,266,35,224],[38,4,36,4],[38,5,36,5],[38,6,36,6],[39,2,37,0],[40,2,38,0],[41,0,39,0],[42,0,40,0],[43,0,41,0],[44,0,42,0],[45,0,43,0],[46,0,44,0],[47,0,45,0],[48,0,46,0],[49,0,47,0],[50,0,48,0],[51,0,49,0],[52,0,50,0],[53,2,51,0,"exports"],[53,9,51,7],[53,10,51,8,"erasPoints"],[53,20,51,18],[53,23,51,21],[53,24,51,22],[53,25,51,23],[53,27,51,25,"util_js_1"],[53,36,51,34],[53,37,51,35,"erasHistoricApply"],[53,54,51,52],[53,56,51,54],[53,69,51,67],[53,70,51,68],[54,0,51,69],[54,3]],"functionMap":{"names":["<global>","mapValidators","filter$argument_0","filter.reduce$argument_0","mapPoints","eras.map$argument_0","_erasPoints","<anonymous>"],"mappings":"AAA;ACU;gBCE,yCD;gBEC;KFG;CDC;AIC;oBCC;MDI;CJC;AMC;4CCC;KDS;CNC"},"hasCjsExports":true},"type":"js/module"}]} |