mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 21:31:02 +00:00
1 line
10 KiB
Plaintext
1 line
10 KiB
Plaintext
{"dependencies":[{"name":"rxjs","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":57,"index":57}}],"key":"PnOMrhZAPWoeW3ygrvUJ7ff768Y=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":2,"column":0,"index":58},"end":{"line":2,"column":40,"index":98}}],"key":"GRJlO1cmIj14nBxcasNpiq30og4=","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 var _rxjs = require(_dependencyMap[0], \"rxjs\");\n var _utilIndexJs = 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, _utilIndexJs.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.switchMap)(({\n currentEra\n }) => api.query.staking.erasStakersOverview.keys(currentEra)),\n // Dedupe any duplicates\n (0, _rxjs.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.switchMap)(({\n currentEra\n }) => api.query.staking.erasStakers.keys(currentEra)),\n // Dedupe any duplicates\n (0, _rxjs.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, _utilIndexJs.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.combineLatest)([api.query.session ? api.query.session.validators() : (0, _rxjs.of)([]), api.query.staking ? api.derive.staking.nextElected() : (0, _rxjs.of)([])]).pipe((0, _rxjs.map)(([validators, nextElected]) => ({\n nextElected: nextElected.length ? nextElected : validators,\n validators\n }))));\n }\n});","lineCount":71,"map":[[7,2,15,0,"exports"],[7,9,15,0],[7,10,15,0,"nextElected"],[7,21,15,0],[7,24,15,0,"nextElected"],[7,35,15,0],[8,2,50,0,"exports"],[8,9,50,0],[8,10,50,0,"validators"],[8,20,50,0],[8,23,50,0,"validators"],[8,33,50,0],[9,2,1,0],[9,6,1,0,"_rxjs"],[9,11,1,0],[9,14,1,0,"require"],[9,21,1,0],[9,22,1,0,"_dependencyMap"],[9,36,1,0],[10,2,2,0],[10,6,2,0,"_utilIndexJs"],[10,18,2,0],[10,21,2,0,"require"],[10,28,2,0],[10,29,2,0,"_dependencyMap"],[10,43,2,0],[11,2,3,0],[12,0,4,0],[13,0,5,0],[14,0,6,0],[15,0,7,0],[16,0,8,0],[17,0,9,0],[18,0,10,0],[19,0,11,0],[20,0,12,0],[21,0,13,0],[22,0,14,0],[23,2,15,7],[23,11,15,16,"nextElected"],[23,22,15,27,"nextElected"],[23,23,15,28,"instanceId"],[23,33,15,38],[23,35,15,40,"api"],[23,38,15,43],[23,40,15,45],[24,4,16,4],[24,11,16,11],[24,15,16,11,"memo"],[24,27,16,15],[24,28,16,15,"memo"],[24,32,16,15],[24,34,16,16,"instanceId"],[24,44,16,26],[24,46,16,28],[25,4,17,4],[26,4,18,4,"api"],[26,7,18,7],[26,8,18,8,"query"],[26,13,18,13],[26,14,18,14,"staking"],[26,21,18,21],[26,22,18,22,"erasStakersOverview"],[26,41,18,41],[26,44,19,10,"api"],[26,47,19,13],[26,48,19,14,"derive"],[26,54,19,20],[26,55,19,21,"session"],[26,62,19,28],[26,63,19,29,"indexes"],[26,70,19,36],[26,71,19,37],[26,72,19,38],[26,73,19,39,"pipe"],[26,77,19,43],[27,4,20,8],[28,4,21,8],[29,4,22,8],[29,8,22,8,"switchMap"],[29,13,22,17],[29,14,22,17,"switchMap"],[29,23,22,17],[29,25,22,18],[29,26,22,19],[30,6,22,21,"currentEra"],[31,4,22,32],[31,5,22,33],[31,10,22,38,"api"],[31,13,22,41],[31,14,22,42,"query"],[31,19,22,47],[31,20,22,48,"staking"],[31,27,22,55],[31,28,22,56,"erasStakersOverview"],[31,47,22,75],[31,48,22,76,"keys"],[31,52,22,80],[31,53,22,81,"currentEra"],[31,63,22,91],[31,64,22,92],[31,65,22,93],[32,4,23,8],[33,4,24,8],[33,8,24,8,"map"],[33,13,24,11],[33,14,24,11,"map"],[33,17,24,11],[33,19,24,13,"keys"],[33,23,24,17],[33,27,24,22],[33,28,24,23],[33,31,24,26],[33,35,24,30,"Set"],[33,38,24,33],[33,39,24,34,"keys"],[33,43,24,38],[33,44,24,39,"map"],[33,47,24,42],[33,48,24,43],[33,49,24,44],[34,6,24,46,"args"],[34,10,24,50],[34,12,24,52],[34,15,24,55,"accountId"],[34,24,24,64],[35,4,24,66],[35,5,24,67],[35,10,24,72,"accountId"],[35,19,24,81],[35,20,24,82,"toString"],[35,28,24,90],[35,29,24,91],[35,30,24,92],[35,31,24,93],[35,32,24,94],[35,33,24,95],[35,34,24,96,"map"],[35,37,24,99],[35,38,24,101,"a"],[35,39,24,102],[35,43,24,107,"api"],[35,46,24,110],[35,47,24,111,"registry"],[35,55,24,119],[35,56,24,120,"createType"],[35,66,24,130],[35,67,24,131],[35,78,24,142],[35,80,24,144,"a"],[35,81,24,145],[35,82,24,146],[35,83,24,147],[35,84,24,148],[35,85,24,149],[35,88,25,10,"api"],[35,91,25,13],[35,92,25,14,"query"],[35,97,25,19],[35,98,25,20,"staking"],[35,105,25,27],[35,106,25,28,"erasStakers"],[35,117,25,39],[35,120,26,14,"api"],[35,123,26,17],[35,124,26,18,"derive"],[35,130,26,24],[35,131,26,25,"session"],[35,138,26,32],[35,139,26,33,"indexes"],[35,146,26,40],[35,147,26,41],[35,148,26,42],[35,149,26,43,"pipe"],[35,153,26,47],[36,4,27,12],[37,4,28,12],[38,4,29,12],[38,8,29,12,"switchMap"],[38,13,29,21],[38,14,29,21,"switchMap"],[38,23,29,21],[38,25,29,22],[38,26,29,23],[39,6,29,25,"currentEra"],[40,4,29,36],[40,5,29,37],[40,10,29,42,"api"],[40,13,29,45],[40,14,29,46,"query"],[40,19,29,51],[40,20,29,52,"staking"],[40,27,29,59],[40,28,29,60,"erasStakers"],[40,39,29,71],[40,40,29,72,"keys"],[40,44,29,76],[40,45,29,77,"currentEra"],[40,55,29,87],[40,56,29,88],[40,57,29,89],[41,4,30,12],[42,4,31,12],[42,8,31,12,"map"],[42,13,31,15],[42,14,31,15,"map"],[42,17,31,15],[42,19,31,17,"keys"],[42,23,31,21],[42,27,31,26],[42,28,31,27],[42,31,31,30],[42,35,31,34,"Set"],[42,38,31,37],[42,39,31,38,"keys"],[42,43,31,42],[42,44,31,43,"map"],[42,47,31,46],[42,48,31,47],[42,49,31,48],[43,6,31,50,"args"],[43,10,31,54],[43,12,31,56],[43,15,31,59,"accountId"],[43,24,31,68],[44,4,31,70],[44,5,31,71],[44,10,31,76,"accountId"],[44,19,31,85],[44,20,31,86,"toString"],[44,28,31,94],[44,29,31,95],[44,30,31,96],[44,31,31,97],[44,32,31,98],[44,33,31,99],[44,34,31,100,"map"],[44,37,31,103],[44,38,31,105,"a"],[44,39,31,106],[44,43,31,111,"api"],[44,46,31,114],[44,47,31,115,"registry"],[44,55,31,123],[44,56,31,124,"createType"],[44,66,31,134],[44,67,31,135],[44,78,31,146],[44,80,31,148,"a"],[44,81,31,149],[44,82,31,150],[44,83,31,151],[44,84,31,152],[44,85,31,153],[44,88,32,14,"api"],[44,91,32,17],[44,92,32,18,"query"],[44,97,32,23],[44,98,32,24,"staking"],[44,105,32,31],[44,106,32,32],[44,122,32,48],[44,123,32,49],[44,124,32,50],[44,125,32,51],[44,126,32,52],[45,2,33,0],[46,2,34,0],[47,0,35,0],[48,0,36,0],[49,0,37,0],[50,0,38,0],[51,0,39,0],[52,0,40,0],[53,0,41,0],[54,0,42,0],[55,0,43,0],[56,0,44,0],[57,0,45,0],[58,0,46,0],[59,0,47,0],[60,0,48,0],[61,0,49,0],[62,2,50,7],[62,11,50,16,"validators"],[62,21,50,26,"validators"],[62,22,50,27,"instanceId"],[62,32,50,37],[62,34,50,39,"api"],[62,37,50,42],[62,39,50,44],[63,4,51,4],[63,11,51,11],[63,15,51,11,"memo"],[63,27,51,15],[63,28,51,15,"memo"],[63,32,51,15],[63,34,51,16,"instanceId"],[63,44,51,26],[63,46,51,28],[64,4,52,4],[65,4,53,4],[66,4,54,4],[66,8,54,4,"combineLatest"],[66,13,54,17],[66,14,54,17,"combineLatest"],[66,27,54,17],[66,29,54,18],[66,30,55,8,"api"],[66,33,55,11],[66,34,55,12,"query"],[66,39,55,17],[66,40,55,18,"session"],[66,47,55,25],[66,50,56,14,"api"],[66,53,56,17],[66,54,56,18,"query"],[66,59,56,23],[66,60,56,24,"session"],[66,67,56,31],[66,68,56,32,"validators"],[66,78,56,42],[66,79,56,43],[66,80,56,44],[66,83,57,14],[66,87,57,14,"of"],[66,92,57,16],[66,93,57,16,"of"],[66,95,57,16],[66,97,57,17],[66,99,57,19],[66,100,57,20],[66,102,58,8,"api"],[66,105,58,11],[66,106,58,12,"query"],[66,111,58,17],[66,112,58,18,"staking"],[66,119,58,25],[66,122,59,14,"api"],[66,125,59,17],[66,126,59,18,"derive"],[66,132,59,24],[66,133,59,25,"staking"],[66,140,59,32],[66,141,59,33,"nextElected"],[66,152,59,44],[66,153,59,45],[66,154,59,46],[66,157,60,14],[66,161,60,14,"of"],[66,166,60,16],[66,167,60,16,"of"],[66,169,60,16],[66,171,60,17],[66,173,60,19],[66,174,60,20],[66,175,61,5],[66,176,61,6],[66,177,61,7,"pipe"],[66,181,61,11],[66,182,61,12],[66,186,61,12,"map"],[66,191,61,15],[66,192,61,15,"map"],[66,195,61,15],[66,197,61,16],[66,198,61,17],[66,199,61,18,"validators"],[66,209,61,28],[66,211,61,30,"nextElected"],[66,222,61,41],[66,223,61,42],[66,229,61,48],[67,6,62,8,"nextElected"],[67,17,62,19],[67,19,62,21,"nextElected"],[67,30,62,32],[67,31,62,33,"length"],[67,37,62,39],[67,40,63,14,"nextElected"],[67,51,63,25],[67,54,64,14,"validators"],[67,64,64,24],[68,6,65,8,"validators"],[69,4,66,4],[69,5,66,5],[69,6,66,6],[69,7,66,7],[69,8,66,8],[69,9,66,9],[70,2,67,0],[71,0,67,1],[71,3]],"functionMap":{"names":["<global>","nextElected","memo$argument_1","switchMap$argument_0","map$argument_0","keys.map$argument_0","validators"],"mappings":"AAA;OCc;4BCC;kBCM,0ED;YEE,+BC,iDD,uDF;sBCK,kED;gBEE,+BC,iDD,uDF;mDDC;CDC;OMiB;4BJC;gBEU;MFK,EI;CNC"},"hasCjsExports":false},"type":"js/module"}]} |