mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 04:11:02 +00:00
1 line
8.1 KiB
Plaintext
1 line
8.1 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":"@polkadot/util","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":2,"column":0,"index":58},"end":{"line":2,"column":41,"index":99}}],"key":"ISHU1ovvPMrCldqRjtd1JhW9dyo=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":100},"end":{"line":3,"column":40,"index":140}}],"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.receivedHeartbeats = receivedHeartbeats;\n var _rxjs = require(_dependencyMap[0], \"rxjs\");\n var _polkadotUtil = require(_dependencyMap[1], \"@polkadot/util\");\n var _utilIndexJs = require(_dependencyMap[2], \"../util/index.js\");\n function mapResult([result, validators, heartbeats, numBlocks]) {\n validators.forEach((validator, index) => {\n const validatorId = validator.toString();\n const blockCount = numBlocks[index];\n const hasMessage = !heartbeats[index].isEmpty;\n const prev = result[validatorId];\n if (!prev || prev.hasMessage !== hasMessage || !prev.blockCount.eq(blockCount)) {\n result[validatorId] = {\n blockCount,\n hasMessage,\n isOnline: hasMessage || blockCount.gt(_polkadotUtil.BN_ZERO)\n };\n }\n });\n return result;\n }\n /**\n * @name receivedHeartbeats\n * @description Return a boolean array indicating whether the passed accounts had received heartbeats in the current session.\n * @example\n * ```javascript\n * let unsub = await api.derive.imOnline.receivedHeartbeats((heartbeat) => {\n * console.log(heartbeat);\n * });\n * ```\n */\n function receivedHeartbeats(instanceId, api) {\n return (0, _utilIndexJs.memo)(instanceId, () => api.query.imOnline?.receivedHeartbeats ? api.derive.staking.overview().pipe((0, _rxjs.switchMap)(({\n currentIndex,\n validators\n }) => (0, _rxjs.combineLatest)([(0, _rxjs.of)({}), (0, _rxjs.of)(validators), api.query.imOnline.receivedHeartbeats.multi(validators.map((_address, index) => [currentIndex, index])), api.query.imOnline.authoredBlocks.multi(validators.map(address => [currentIndex, address]))])), (0, _rxjs.map)(mapResult)) : (0, _rxjs.of)({}));\n }\n});","lineCount":43,"map":[[7,2,30,0,"exports"],[7,9,30,0],[7,10,30,0,"receivedHeartbeats"],[7,28,30,0],[7,31,30,0,"receivedHeartbeats"],[7,49,30,0],[8,2,1,0],[8,6,1,0,"_rxjs"],[8,11,1,0],[8,14,1,0,"require"],[8,21,1,0],[8,22,1,0,"_dependencyMap"],[8,36,1,0],[9,2,2,0],[9,6,2,0,"_polkadotUtil"],[9,19,2,0],[9,22,2,0,"require"],[9,29,2,0],[9,30,2,0,"_dependencyMap"],[9,44,2,0],[10,2,3,0],[10,6,3,0,"_utilIndexJs"],[10,18,3,0],[10,21,3,0,"require"],[10,28,3,0],[10,29,3,0,"_dependencyMap"],[10,43,3,0],[11,2,4,0],[11,11,4,9,"mapResult"],[11,20,4,18,"mapResult"],[11,21,4,19],[11,22,4,20,"result"],[11,28,4,26],[11,30,4,28,"validators"],[11,40,4,38],[11,42,4,40,"heartbeats"],[11,52,4,50],[11,54,4,52,"numBlocks"],[11,63,4,61],[11,64,4,62],[11,66,4,64],[12,4,5,4,"validators"],[12,14,5,14],[12,15,5,15,"forEach"],[12,22,5,22],[12,23,5,23],[12,24,5,24,"validator"],[12,33,5,33],[12,35,5,35,"index"],[12,40,5,40],[12,45,5,45],[13,6,6,8],[13,12,6,14,"validatorId"],[13,23,6,25],[13,26,6,28,"validator"],[13,35,6,37],[13,36,6,38,"toString"],[13,44,6,46],[13,45,6,47],[13,46,6,48],[14,6,7,8],[14,12,7,14,"blockCount"],[14,22,7,24],[14,25,7,27,"numBlocks"],[14,34,7,36],[14,35,7,37,"index"],[14,40,7,42],[14,41,7,43],[15,6,8,8],[15,12,8,14,"hasMessage"],[15,22,8,24],[15,25,8,27],[15,26,8,28,"heartbeats"],[15,36,8,38],[15,37,8,39,"index"],[15,42,8,44],[15,43,8,45],[15,44,8,46,"isEmpty"],[15,51,8,53],[16,6,9,8],[16,12,9,14,"prev"],[16,16,9,18],[16,19,9,21,"result"],[16,25,9,27],[16,26,9,28,"validatorId"],[16,37,9,39],[16,38,9,40],[17,6,10,8],[17,10,10,12],[17,11,10,13,"prev"],[17,15,10,17],[17,19,10,21,"prev"],[17,23,10,25],[17,24,10,26,"hasMessage"],[17,34,10,36],[17,39,10,41,"hasMessage"],[17,49,10,51],[17,53,10,55],[17,54,10,56,"prev"],[17,58,10,60],[17,59,10,61,"blockCount"],[17,69,10,71],[17,70,10,72,"eq"],[17,72,10,74],[17,73,10,75,"blockCount"],[17,83,10,85],[17,84,10,86],[17,86,10,88],[18,8,11,12,"result"],[18,14,11,18],[18,15,11,19,"validatorId"],[18,26,11,30],[18,27,11,31],[18,30,11,34],[19,10,12,16,"blockCount"],[19,20,12,26],[20,10,13,16,"hasMessage"],[20,20,13,26],[21,10,14,16,"isOnline"],[21,18,14,24],[21,20,14,26,"hasMessage"],[21,30,14,36],[21,34,14,40,"blockCount"],[21,44,14,50],[21,45,14,51,"gt"],[21,47,14,53],[21,48,14,54,"BN_ZERO"],[21,61,14,61],[21,62,14,61,"BN_ZERO"],[21,69,14,61],[22,8,15,12],[22,9,15,13],[23,6,16,8],[24,4,17,4],[24,5,17,5],[24,6,17,6],[25,4,18,4],[25,11,18,11,"result"],[25,17,18,17],[26,2,19,0],[27,2,20,0],[28,0,21,0],[29,0,22,0],[30,0,23,0],[31,0,24,0],[32,0,25,0],[33,0,26,0],[34,0,27,0],[35,0,28,0],[36,0,29,0],[37,2,30,7],[37,11,30,16,"receivedHeartbeats"],[37,29,30,34,"receivedHeartbeats"],[37,30,30,35,"instanceId"],[37,40,30,45],[37,42,30,47,"api"],[37,45,30,50],[37,47,30,52],[38,4,31,4],[38,11,31,11],[38,15,31,11,"memo"],[38,27,31,15],[38,28,31,15,"memo"],[38,32,31,15],[38,34,31,16,"instanceId"],[38,44,31,26],[38,46,31,28],[38,52,31,34,"api"],[38,55,31,37],[38,56,31,38,"query"],[38,61,31,43],[38,62,31,44,"imOnline"],[38,70,31,52],[38,72,31,54,"receivedHeartbeats"],[38,90,31,72],[38,93,32,10,"api"],[38,96,32,13],[38,97,32,14,"derive"],[38,103,32,20],[38,104,32,21,"staking"],[38,111,32,28],[38,112,32,29,"overview"],[38,120,32,37],[38,121,32,38],[38,122,32,39],[38,123,32,40,"pipe"],[38,127,32,44],[38,128,32,45],[38,132,32,45,"switchMap"],[38,137,32,54],[38,138,32,54,"switchMap"],[38,147,32,54],[38,149,32,55],[38,150,32,56],[39,6,32,58,"currentIndex"],[39,18,32,70],[40,6,32,72,"validators"],[41,4,32,83],[41,5,32,84],[41,10,32,89],[41,14,32,89,"combineLatest"],[41,19,32,102],[41,20,32,102,"combineLatest"],[41,33,32,102],[41,35,32,103],[41,36,33,12],[41,40,33,12,"of"],[41,45,33,14],[41,46,33,14,"of"],[41,48,33,14],[41,50,33,15],[41,51,33,16],[41,52,33,17],[41,53,33,18],[41,55,34,12],[41,59,34,12,"of"],[41,64,34,14],[41,65,34,14,"of"],[41,67,34,14],[41,69,34,15,"validators"],[41,79,34,25],[41,80,34,26],[41,82,35,12,"api"],[41,85,35,15],[41,86,35,16,"query"],[41,91,35,21],[41,92,35,22,"imOnline"],[41,100,35,30],[41,101,35,31,"receivedHeartbeats"],[41,119,35,49],[41,120,35,50,"multi"],[41,125,35,55],[41,126,35,56,"validators"],[41,136,35,66],[41,137,35,67,"map"],[41,140,35,70],[41,141,35,71],[41,142,35,72,"_address"],[41,150,35,80],[41,152,35,82,"index"],[41,157,35,87],[41,162,35,92],[41,163,35,93,"currentIndex"],[41,175,35,105],[41,177,35,107,"index"],[41,182,35,112],[41,183,35,113],[41,184,35,114],[41,185,35,115],[41,187,36,12,"api"],[41,190,36,15],[41,191,36,16,"query"],[41,196,36,21],[41,197,36,22,"imOnline"],[41,205,36,30],[41,206,36,31,"authoredBlocks"],[41,220,36,45],[41,221,36,46,"multi"],[41,226,36,51],[41,227,36,52,"validators"],[41,237,36,62],[41,238,36,63,"map"],[41,241,36,66],[41,242,36,68,"address"],[41,249,36,75],[41,253,36,80],[41,254,36,81,"currentIndex"],[41,266,36,93],[41,268,36,95,"address"],[41,275,36,102],[41,276,36,103],[41,277,36,104],[41,278,36,105],[41,279,37,9],[41,280,37,10],[41,281,37,11],[41,283,37,13],[41,287,37,13,"map"],[41,292,37,16],[41,293,37,16,"map"],[41,296,37,16],[41,298,37,17,"mapResult"],[41,307,37,26],[41,308,37,27],[41,309,37,28],[41,312,38,10],[41,316,38,10,"of"],[41,321,38,12],[41,322,38,12,"of"],[41,324,38,12],[41,326,38,13],[41,327,38,14],[41,328,38,15],[41,329,38,16],[41,330,38,17],[42,2,39,0],[43,0,39,1],[43,3]],"functionMap":{"names":["<global>","mapResult","validators.forEach$argument_0","receivedHeartbeats","memo$argument_1","switchMap$argument_0","validators.map$argument_0"],"mappings":"AAA;ACG;uBCC;KDY;CDE;OGW;4BCC;uDCC;uECG,0CD;mECC,oCD;UDC;gBDC;CHC"},"hasCjsExports":false},"type":"js/module"}]} |