mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 10:01:02 +00:00
1 line
11 KiB
Plaintext
1 line
11 KiB
Plaintext
{"dependencies":[{"name":"rxjs","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":15,"index":160},"end":{"line":5,"column":30,"index":175}}],"key":"atDzfUGaJNRNtwyVumomzH/5ygw=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":19,"index":196},"end":{"line":6,"column":46,"index":223}}],"key":"H94lp+EitftSFqDHaenrSs5zKB0=","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.nextElected = nextElected;\n exports.validators = validators;\n const rxjs_1 = require(_dependencyMap[0], \"rxjs\");\n const index_js_1 = require(_dependencyMap[1], \"../util/index.js\");\n /**\n * @name nextElected\n * @description Retrieves the list of accounts that are set to be the next elected validators in the staking system. It provides a preview of who will be validators in the next staking era.\n * @example\n * ```javascript\n * const nextElected = await api.derive.staking.nextElected();\n * console.log(\n * \"Next Elected Validators:\",\n * nextElected.map((acc) => acc.toString())\n * );\n * ```\n */\n function nextElected(instanceId, api) {\n return (0, index_js_1.memo)(instanceId, () =>\n // Compatibility for future generation changes in staking.\n api.query.staking.erasStakersOverview ? api.derive.session.indexes().pipe(\n // only populate for next era in the last session, so track both here - entries are not\n // subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh\n (0, rxjs_1.switchMap)(({\n currentEra\n }) => api.query.staking.erasStakersOverview.keys(currentEra)),\n // Dedupe any duplicates\n (0, rxjs_1.map)(keys => [...new Set(keys.map(({\n args: [, accountId]\n }) => accountId.toString()))].map(a => api.registry.createType('AccountId', a)))) : api.query.staking.erasStakers ? api.derive.session.indexes().pipe(\n // only populate for next era in the last session, so track both here - entries are not\n // subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh\n (0, rxjs_1.switchMap)(({\n currentEra\n }) => api.query.staking.erasStakers.keys(currentEra)),\n // Dedupe any duplicates\n (0, rxjs_1.map)(keys => [...new Set(keys.map(({\n args: [, accountId]\n }) => accountId.toString()))].map(a => api.registry.createType('AccountId', a)))) : api.query.staking['currentElected']());\n }\n /**\n * @name validators\n * @description Retrieve latest list of validators.\n * @example\n * ```javascript\n * const { validators, nextElected } = await api.derive.staking.validators();\n * console.log(\n * \"Current Validators:\",\n * validators.map((v) => v.toString())\n * );\n * console.log(\n * \"Next Elected Validators:\",\n * nextElected.map((v) => v.toString())\n * );\n * ```\n */\n function validators(instanceId, api) {\n return (0, index_js_1.memo)(instanceId, () =>\n // Sadly the node-template is (for some obscure reason) not comprehensive, so while the derive works\n // in all actual real-world deployed chains, it does create some confusion for limited template chains\n (0, rxjs_1.combineLatest)([api.query.session ? api.query.session.validators() : (0, rxjs_1.of)([]), api.query.staking ? api.derive.staking.nextElected() : (0, rxjs_1.of)([])]).pipe((0, rxjs_1.map)(([validators, nextElected]) => ({\n nextElected: nextElected.length ? nextElected : validators,\n validators\n }))));\n }\n});","lineCount":71,"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,"nextElected"],[7,21,3,19],[7,24,3,22,"nextElected"],[7,35,3,33],[8,2,4,0,"exports"],[8,9,4,7],[8,10,4,8,"validators"],[8,20,4,18],[8,23,4,21,"validators"],[8,33,4,31],[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,"index_js_1"],[10,18,6,16],[10,21,6,19,"require"],[10,28,6,26],[10,29,6,26,"_dependencyMap"],[10,43,6,26],[10,66,6,45],[10,67,6,46],[11,2,7,0],[12,0,8,0],[13,0,9,0],[14,0,10,0],[15,0,11,0],[16,0,12,0],[17,0,13,0],[18,0,14,0],[19,0,15,0],[20,0,16,0],[21,0,17,0],[22,0,18,0],[23,2,19,0],[23,11,19,9,"nextElected"],[23,22,19,20,"nextElected"],[23,23,19,21,"instanceId"],[23,33,19,31],[23,35,19,33,"api"],[23,38,19,36],[23,40,19,38],[24,4,20,4],[24,11,20,11],[24,12,20,12],[24,13,20,13],[24,15,20,15,"index_js_1"],[24,25,20,25],[24,26,20,26,"memo"],[24,30,20,30],[24,32,20,32,"instanceId"],[24,42,20,42],[24,44,20,44],[25,4,21,4],[26,4,22,4,"api"],[26,7,22,7],[26,8,22,8,"query"],[26,13,22,13],[26,14,22,14,"staking"],[26,21,22,21],[26,22,22,22,"erasStakersOverview"],[26,41,22,41],[26,44,23,10,"api"],[26,47,23,13],[26,48,23,14,"derive"],[26,54,23,20],[26,55,23,21,"session"],[26,62,23,28],[26,63,23,29,"indexes"],[26,70,23,36],[26,71,23,37],[26,72,23,38],[26,73,23,39,"pipe"],[26,77,23,43],[27,4,24,8],[28,4,25,8],[29,4,26,8],[29,5,26,9],[29,6,26,10],[29,8,26,12,"rxjs_1"],[29,14,26,18],[29,15,26,19,"switchMap"],[29,24,26,28],[29,26,26,30],[29,27,26,31],[30,6,26,33,"currentEra"],[31,4,26,44],[31,5,26,45],[31,10,26,50,"api"],[31,13,26,53],[31,14,26,54,"query"],[31,19,26,59],[31,20,26,60,"staking"],[31,27,26,67],[31,28,26,68,"erasStakersOverview"],[31,47,26,87],[31,48,26,88,"keys"],[31,52,26,92],[31,53,26,93,"currentEra"],[31,63,26,103],[31,64,26,104],[31,65,26,105],[32,4,27,8],[33,4,28,8],[33,5,28,9],[33,6,28,10],[33,8,28,12,"rxjs_1"],[33,14,28,18],[33,15,28,19,"map"],[33,18,28,22],[33,20,28,25,"keys"],[33,24,28,29],[33,28,28,34],[33,29,28,35],[33,32,28,38],[33,36,28,42,"Set"],[33,39,28,45],[33,40,28,46,"keys"],[33,44,28,50],[33,45,28,51,"map"],[33,48,28,54],[33,49,28,55],[33,50,28,56],[34,6,28,58,"args"],[34,10,28,62],[34,12,28,64],[34,15,28,67,"accountId"],[34,24,28,76],[35,4,28,78],[35,5,28,79],[35,10,28,84,"accountId"],[35,19,28,93],[35,20,28,94,"toString"],[35,28,28,102],[35,29,28,103],[35,30,28,104],[35,31,28,105],[35,32,28,106],[35,33,28,107],[35,34,28,108,"map"],[35,37,28,111],[35,38,28,113,"a"],[35,39,28,114],[35,43,28,119,"api"],[35,46,28,122],[35,47,28,123,"registry"],[35,55,28,131],[35,56,28,132,"createType"],[35,66,28,142],[35,67,28,143],[35,78,28,154],[35,80,28,156,"a"],[35,81,28,157],[35,82,28,158],[35,83,28,159],[35,84,28,160],[35,85,28,161],[35,88,29,10,"api"],[35,91,29,13],[35,92,29,14,"query"],[35,97,29,19],[35,98,29,20,"staking"],[35,105,29,27],[35,106,29,28,"erasStakers"],[35,117,29,39],[35,120,30,14,"api"],[35,123,30,17],[35,124,30,18,"derive"],[35,130,30,24],[35,131,30,25,"session"],[35,138,30,32],[35,139,30,33,"indexes"],[35,146,30,40],[35,147,30,41],[35,148,30,42],[35,149,30,43,"pipe"],[35,153,30,47],[36,4,31,12],[37,4,32,12],[38,4,33,12],[38,5,33,13],[38,6,33,14],[38,8,33,16,"rxjs_1"],[38,14,33,22],[38,15,33,23,"switchMap"],[38,24,33,32],[38,26,33,34],[38,27,33,35],[39,6,33,37,"currentEra"],[40,4,33,48],[40,5,33,49],[40,10,33,54,"api"],[40,13,33,57],[40,14,33,58,"query"],[40,19,33,63],[40,20,33,64,"staking"],[40,27,33,71],[40,28,33,72,"erasStakers"],[40,39,33,83],[40,40,33,84,"keys"],[40,44,33,88],[40,45,33,89,"currentEra"],[40,55,33,99],[40,56,33,100],[40,57,33,101],[41,4,34,12],[42,4,35,12],[42,5,35,13],[42,6,35,14],[42,8,35,16,"rxjs_1"],[42,14,35,22],[42,15,35,23,"map"],[42,18,35,26],[42,20,35,29,"keys"],[42,24,35,33],[42,28,35,38],[42,29,35,39],[42,32,35,42],[42,36,35,46,"Set"],[42,39,35,49],[42,40,35,50,"keys"],[42,44,35,54],[42,45,35,55,"map"],[42,48,35,58],[42,49,35,59],[42,50,35,60],[43,6,35,62,"args"],[43,10,35,66],[43,12,35,68],[43,15,35,71,"accountId"],[43,24,35,80],[44,4,35,82],[44,5,35,83],[44,10,35,88,"accountId"],[44,19,35,97],[44,20,35,98,"toString"],[44,28,35,106],[44,29,35,107],[44,30,35,108],[44,31,35,109],[44,32,35,110],[44,33,35,111],[44,34,35,112,"map"],[44,37,35,115],[44,38,35,117,"a"],[44,39,35,118],[44,43,35,123,"api"],[44,46,35,126],[44,47,35,127,"registry"],[44,55,35,135],[44,56,35,136,"createType"],[44,66,35,146],[44,67,35,147],[44,78,35,158],[44,80,35,160,"a"],[44,81,35,161],[44,82,35,162],[44,83,35,163],[44,84,35,164],[44,85,35,165],[44,88,36,14,"api"],[44,91,36,17],[44,92,36,18,"query"],[44,97,36,23],[44,98,36,24,"staking"],[44,105,36,31],[44,106,36,32],[44,122,36,48],[44,123,36,49],[44,124,36,50],[44,125,36,51],[44,126,36,52],[45,2,37,0],[46,2,38,0],[47,0,39,0],[48,0,40,0],[49,0,41,0],[50,0,42,0],[51,0,43,0],[52,0,44,0],[53,0,45,0],[54,0,46,0],[55,0,47,0],[56,0,48,0],[57,0,49,0],[58,0,50,0],[59,0,51,0],[60,0,52,0],[61,0,53,0],[62,2,54,0],[62,11,54,9,"validators"],[62,21,54,19,"validators"],[62,22,54,20,"instanceId"],[62,32,54,30],[62,34,54,32,"api"],[62,37,54,35],[62,39,54,37],[63,4,55,4],[63,11,55,11],[63,12,55,12],[63,13,55,13],[63,15,55,15,"index_js_1"],[63,25,55,25],[63,26,55,26,"memo"],[63,30,55,30],[63,32,55,32,"instanceId"],[63,42,55,42],[63,44,55,44],[64,4,56,4],[65,4,57,4],[66,4,58,4],[66,5,58,5],[66,6,58,6],[66,8,58,8,"rxjs_1"],[66,14,58,14],[66,15,58,15,"combineLatest"],[66,28,58,28],[66,30,58,30],[66,31,59,8,"api"],[66,34,59,11],[66,35,59,12,"query"],[66,40,59,17],[66,41,59,18,"session"],[66,48,59,25],[66,51,60,14,"api"],[66,54,60,17],[66,55,60,18,"query"],[66,60,60,23],[66,61,60,24,"session"],[66,68,60,31],[66,69,60,32,"validators"],[66,79,60,42],[66,80,60,43],[66,81,60,44],[66,84,61,14],[66,85,61,15],[66,86,61,16],[66,88,61,18,"rxjs_1"],[66,94,61,24],[66,95,61,25,"of"],[66,97,61,27],[66,99,61,29],[66,101,61,31],[66,102,61,32],[66,104,62,8,"api"],[66,107,62,11],[66,108,62,12,"query"],[66,113,62,17],[66,114,62,18,"staking"],[66,121,62,25],[66,124,63,14,"api"],[66,127,63,17],[66,128,63,18,"derive"],[66,134,63,24],[66,135,63,25,"staking"],[66,142,63,32],[66,143,63,33,"nextElected"],[66,154,63,44],[66,155,63,45],[66,156,63,46],[66,159,64,14],[66,160,64,15],[66,161,64,16],[66,163,64,18,"rxjs_1"],[66,169,64,24],[66,170,64,25,"of"],[66,172,64,27],[66,174,64,29],[66,176,64,31],[66,177,64,32],[66,178,65,5],[66,179,65,6],[66,180,65,7,"pipe"],[66,184,65,11],[66,185,65,12],[66,186,65,13],[66,187,65,14],[66,189,65,16,"rxjs_1"],[66,195,65,22],[66,196,65,23,"map"],[66,199,65,26],[66,201,65,28],[66,202,65,29],[66,203,65,30,"validators"],[66,213,65,40],[66,215,65,42,"nextElected"],[66,226,65,53],[66,227,65,54],[66,233,65,60],[67,6,66,8,"nextElected"],[67,17,66,19],[67,19,66,21,"nextElected"],[67,30,66,32],[67,31,66,33,"length"],[67,37,66,39],[67,40,67,14,"nextElected"],[67,51,67,25],[67,54,68,14,"validators"],[67,64,68,24],[68,6,69,8,"validators"],[69,4,70,4],[69,5,70,5],[69,6,70,6],[69,7,70,7],[69,8,70,8],[69,9,70,9],[70,2,71,0],[71,0,71,1],[71,3]],"functionMap":{"names":["<global>","nextElected","<anonymous>","keys.map$argument_0","map$argument_0","validators"],"mappings":"AAA;ACkB;4CCC;uDCQ,iDD,QE,8CF;2DCO,iDD,QE,8CF;mDDC;CDC;AKiB;4CHC;QGe;CLC"},"hasCjsExports":true},"type":"js/module"}]} |