mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 15:41:01 +00:00
1 line
15 KiB
Plaintext
1 line
15 KiB
Plaintext
{"dependencies":[{"name":"rxjs","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":15,"index":197},"end":{"line":5,"column":30,"index":212}}],"key":"atDzfUGaJNRNtwyVumomzH/5ygw=","exportNames":["*"],"imports":1}},{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":15,"index":229},"end":{"line":6,"column":40,"index":254}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":7,"column":19,"index":275},"end":{"line":7,"column":46,"index":302}}],"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.sessionProgress = exports.eraProgress = exports.eraLength = void 0;\n exports.progress = progress;\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 function withProgressField(field) {\n return (instanceId, api) => (0, index_js_1.memo)(instanceId, () => api.derive.session.progress().pipe((0, rxjs_1.map)(info => info[field])));\n }\n function createDerive(api, info, [currentSlot, epochIndex, epochOrGenesisStartSlot, activeEraStartSessionIndex]) {\n const epochStartSlot = epochIndex.mul(info.sessionLength).iadd(epochOrGenesisStartSlot);\n const sessionProgress = currentSlot.sub(epochStartSlot);\n const eraProgress = info.currentIndex.sub(activeEraStartSessionIndex).imul(info.sessionLength).iadd(sessionProgress);\n return (0, util_1.objectSpread)({\n eraProgress: api.registry.createType('BlockNumber', eraProgress),\n sessionProgress: api.registry.createType('BlockNumber', sessionProgress)\n }, info);\n }\n function queryAura(api) {\n return api.derive.session.info().pipe((0, rxjs_1.map)(info => (0, util_1.objectSpread)({\n eraProgress: api.registry.createType('BlockNumber'),\n sessionProgress: api.registry.createType('BlockNumber')\n }, info)));\n }\n function queryBabe(api) {\n return api.derive.session.info().pipe((0, rxjs_1.switchMap)(info => (0, rxjs_1.combineLatest)([(0, rxjs_1.of)(info),\n // we may have no staking, but have babe (permissioned)\n api.query.staking?.erasStartSessionIndex ? api.queryMulti([api.query.babe.currentSlot, api.query.babe.epochIndex, api.query.babe.genesisSlot, [api.query.staking.erasStartSessionIndex, info.activeEra]]) : api.queryMulti([api.query.babe.currentSlot, api.query.babe.epochIndex, api.query.babe.genesisSlot])])), (0, rxjs_1.map)(([info, [currentSlot, epochIndex, genesisSlot, optStartIndex]]) => [info, [currentSlot, epochIndex, genesisSlot, optStartIndex && optStartIndex.isSome ? optStartIndex.unwrap() : api.registry.createType('SessionIndex', 1)]]));\n }\n /**\n * @name progress\n * @description Retrieves session information and progress.\n * @example\n * ```javascript\n * api.derive.session.progress((progress) => {\n * console.log(`Session progress ${JSON.stringify(progress)}`);\n * });\n * ```\n */\n function progress(instanceId, api) {\n return (0, index_js_1.memo)(instanceId, () => api.query.babe ? queryBabe(api).pipe((0, rxjs_1.map)(([info, slots]) => createDerive(api, info, slots))) : queryAura(api));\n }\n /**\n * @name eraLenght\n * @description Retrieves the total length of the current era.\n * @example\n * ```javascript\n * api.derive.session.eraLength((length) => {\n * console.log(`Current era length: ${length} sessions`);\n * });\n * ```\n */\n exports.eraLength = withProgressField('eraLength');\n /**\n * @name eraProgress\n * @description Retrieves the progress of the current era.\n * @example\n * ```javascript\n * api.derive.session.eraProgress((progress) => {\n * console.log(`Current era progress: ${progress} sessions`);\n * });\n * ```\n */\n exports.eraProgress = withProgressField('eraProgress');\n /**\n * @name sessionProgress\n * @description Retrieves the progress of the current session.\n * @example\n * ```javascript\n * api.derive.session.sessionProgress((progress) => {\n * console.log(`Current session progress: ${progress} slots`);\n * });\n * ```\n */\n exports.sessionProgress = withProgressField('sessionProgress');\n});","lineCount":81,"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,"sessionProgress"],[7,25,3,23],[7,28,3,26,"exports"],[7,35,3,33],[7,36,3,34,"eraProgress"],[7,47,3,45],[7,50,3,48,"exports"],[7,57,3,55],[7,58,3,56,"eraLength"],[7,67,3,65],[7,70,3,68],[7,75,3,73],[7,76,3,74],[8,2,4,0,"exports"],[8,9,4,7],[8,10,4,8,"progress"],[8,18,4,16],[8,21,4,19,"progress"],[8,29,4,27],[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,11,8,9,"withProgressField"],[12,28,8,26,"withProgressField"],[12,29,8,27,"field"],[12,34,8,32],[12,36,8,34],[13,4,9,4],[13,11,9,11],[13,12,9,12,"instanceId"],[13,22,9,22],[13,24,9,24,"api"],[13,27,9,27],[13,32,9,32],[13,33,9,33],[13,34,9,34],[13,36,9,36,"index_js_1"],[13,46,9,46],[13,47,9,47,"memo"],[13,51,9,51],[13,53,9,53,"instanceId"],[13,63,9,63],[13,65,9,65],[13,71,9,71,"api"],[13,74,9,74],[13,75,9,75,"derive"],[13,81,9,81],[13,82,9,82,"session"],[13,89,9,89],[13,90,9,90,"progress"],[13,98,9,98],[13,99,9,99],[13,100,9,100],[13,101,9,101,"pipe"],[13,105,9,105],[13,106,9,106],[13,107,9,107],[13,108,9,108],[13,110,9,110,"rxjs_1"],[13,116,9,116],[13,117,9,117,"map"],[13,120,9,120],[13,122,9,123,"info"],[13,126,9,127],[13,130,9,132,"info"],[13,134,9,136],[13,135,9,137,"field"],[13,140,9,142],[13,141,9,143],[13,142,9,144],[13,143,9,145],[13,144,9,146],[14,2,10,0],[15,2,11,0],[15,11,11,9,"createDerive"],[15,23,11,21,"createDerive"],[15,24,11,22,"api"],[15,27,11,25],[15,29,11,27,"info"],[15,33,11,31],[15,35,11,33],[15,36,11,34,"currentSlot"],[15,47,11,45],[15,49,11,47,"epochIndex"],[15,59,11,57],[15,61,11,59,"epochOrGenesisStartSlot"],[15,84,11,82],[15,86,11,84,"activeEraStartSessionIndex"],[15,112,11,110],[15,113,11,111],[15,115,11,113],[16,4,12,4],[16,10,12,10,"epochStartSlot"],[16,24,12,24],[16,27,12,27,"epochIndex"],[16,37,12,37],[16,38,12,38,"mul"],[16,41,12,41],[16,42,12,42,"info"],[16,46,12,46],[16,47,12,47,"sessionLength"],[16,60,12,60],[16,61,12,61],[16,62,12,62,"iadd"],[16,66,12,66],[16,67,12,67,"epochOrGenesisStartSlot"],[16,90,12,90],[16,91,12,91],[17,4,13,4],[17,10,13,10,"sessionProgress"],[17,25,13,25],[17,28,13,28,"currentSlot"],[17,39,13,39],[17,40,13,40,"sub"],[17,43,13,43],[17,44,13,44,"epochStartSlot"],[17,58,13,58],[17,59,13,59],[18,4,14,4],[18,10,14,10,"eraProgress"],[18,21,14,21],[18,24,14,24,"info"],[18,28,14,28],[18,29,14,29,"currentIndex"],[18,41,14,41],[18,42,14,42,"sub"],[18,45,14,45],[18,46,14,46,"activeEraStartSessionIndex"],[18,72,14,72],[18,73,14,73],[18,74,14,74,"imul"],[18,78,14,78],[18,79,14,79,"info"],[18,83,14,83],[18,84,14,84,"sessionLength"],[18,97,14,97],[18,98,14,98],[18,99,14,99,"iadd"],[18,103,14,103],[18,104,14,104,"sessionProgress"],[18,119,14,119],[18,120,14,120],[19,4,15,4],[19,11,15,11],[19,12,15,12],[19,13,15,13],[19,15,15,15,"util_1"],[19,21,15,21],[19,22,15,22,"objectSpread"],[19,34,15,34],[19,36,15,36],[20,6,16,8,"eraProgress"],[20,17,16,19],[20,19,16,21,"api"],[20,22,16,24],[20,23,16,25,"registry"],[20,31,16,33],[20,32,16,34,"createType"],[20,42,16,44],[20,43,16,45],[20,56,16,58],[20,58,16,60,"eraProgress"],[20,69,16,71],[20,70,16,72],[21,6,17,8,"sessionProgress"],[21,21,17,23],[21,23,17,25,"api"],[21,26,17,28],[21,27,17,29,"registry"],[21,35,17,37],[21,36,17,38,"createType"],[21,46,17,48],[21,47,17,49],[21,60,17,62],[21,62,17,64,"sessionProgress"],[21,77,17,79],[22,4,18,4],[22,5,18,5],[22,7,18,7,"info"],[22,11,18,11],[22,12,18,12],[23,2,19,0],[24,2,20,0],[24,11,20,9,"queryAura"],[24,20,20,18,"queryAura"],[24,21,20,19,"api"],[24,24,20,22],[24,26,20,24],[25,4,21,4],[25,11,21,11,"api"],[25,14,21,14],[25,15,21,15,"derive"],[25,21,21,21],[25,22,21,22,"session"],[25,29,21,29],[25,30,21,30,"info"],[25,34,21,34],[25,35,21,35],[25,36,21,36],[25,37,21,37,"pipe"],[25,41,21,41],[25,42,21,42],[25,43,21,43],[25,44,21,44],[25,46,21,46,"rxjs_1"],[25,52,21,52],[25,53,21,53,"map"],[25,56,21,56],[25,58,21,59,"info"],[25,62,21,63],[25,66,21,68],[25,67,21,69],[25,68,21,70],[25,70,21,72,"util_1"],[25,76,21,78],[25,77,21,79,"objectSpread"],[25,89,21,91],[25,91,21,93],[26,6,22,8,"eraProgress"],[26,17,22,19],[26,19,22,21,"api"],[26,22,22,24],[26,23,22,25,"registry"],[26,31,22,33],[26,32,22,34,"createType"],[26,42,22,44],[26,43,22,45],[26,56,22,58],[26,57,22,59],[27,6,23,8,"sessionProgress"],[27,21,23,23],[27,23,23,25,"api"],[27,26,23,28],[27,27,23,29,"registry"],[27,35,23,37],[27,36,23,38,"createType"],[27,46,23,48],[27,47,23,49],[27,60,23,62],[28,4,24,4],[28,5,24,5],[28,7,24,7,"info"],[28,11,24,11],[28,12,24,12],[28,13,24,13],[28,14,24,14],[29,2,25,0],[30,2,26,0],[30,11,26,9,"queryBabe"],[30,20,26,18,"queryBabe"],[30,21,26,19,"api"],[30,24,26,22],[30,26,26,24],[31,4,27,4],[31,11,27,11,"api"],[31,14,27,14],[31,15,27,15,"derive"],[31,21,27,21],[31,22,27,22,"session"],[31,29,27,29],[31,30,27,30,"info"],[31,34,27,34],[31,35,27,35],[31,36,27,36],[31,37,27,37,"pipe"],[31,41,27,41],[31,42,27,42],[31,43,27,43],[31,44,27,44],[31,46,27,46,"rxjs_1"],[31,52,27,52],[31,53,27,53,"switchMap"],[31,62,27,62],[31,64,27,65,"info"],[31,68,27,69],[31,72,27,74],[31,73,27,75],[31,74,27,76],[31,76,27,78,"rxjs_1"],[31,82,27,84],[31,83,27,85,"combineLatest"],[31,96,27,98],[31,98,27,100],[31,99,28,8],[31,100,28,9],[31,101,28,10],[31,103,28,12,"rxjs_1"],[31,109,28,18],[31,110,28,19,"of"],[31,112,28,21],[31,114,28,23,"info"],[31,118,28,27],[31,119,28,28],[32,4,29,8],[33,4,30,8,"api"],[33,7,30,11],[33,8,30,12,"query"],[33,13,30,17],[33,14,30,18,"staking"],[33,21,30,25],[33,23,30,27,"erasStartSessionIndex"],[33,44,30,48],[33,47,31,14,"api"],[33,50,31,17],[33,51,31,18,"queryMulti"],[33,61,31,28],[33,62,31,29],[33,63,32,16,"api"],[33,66,32,19],[33,67,32,20,"query"],[33,72,32,25],[33,73,32,26,"babe"],[33,77,32,30],[33,78,32,31,"currentSlot"],[33,89,32,42],[33,91,33,16,"api"],[33,94,33,19],[33,95,33,20,"query"],[33,100,33,25],[33,101,33,26,"babe"],[33,105,33,30],[33,106,33,31,"epochIndex"],[33,116,33,41],[33,118,34,16,"api"],[33,121,34,19],[33,122,34,20,"query"],[33,127,34,25],[33,128,34,26,"babe"],[33,132,34,30],[33,133,34,31,"genesisSlot"],[33,144,34,42],[33,146,35,16],[33,147,35,17,"api"],[33,150,35,20],[33,151,35,21,"query"],[33,156,35,26],[33,157,35,27,"staking"],[33,164,35,34],[33,165,35,35,"erasStartSessionIndex"],[33,186,35,56],[33,188,35,58,"info"],[33,192,35,62],[33,193,35,63,"activeEra"],[33,202,35,72],[33,203,35,73],[33,204,36,13],[33,205,36,14],[33,208,37,14,"api"],[33,211,37,17],[33,212,37,18,"queryMulti"],[33,222,37,28],[33,223,37,29],[33,224,38,16,"api"],[33,227,38,19],[33,228,38,20,"query"],[33,233,38,25],[33,234,38,26,"babe"],[33,238,38,30],[33,239,38,31,"currentSlot"],[33,250,38,42],[33,252,39,16,"api"],[33,255,39,19],[33,256,39,20,"query"],[33,261,39,25],[33,262,39,26,"babe"],[33,266,39,30],[33,267,39,31,"epochIndex"],[33,277,39,41],[33,279,40,16,"api"],[33,282,40,19],[33,283,40,20,"query"],[33,288,40,25],[33,289,40,26,"babe"],[33,293,40,30],[33,294,40,31,"genesisSlot"],[33,305,40,42],[33,306,41,13],[33,307,41,14],[33,308,42,5],[33,309,42,6],[33,310,42,7],[33,312,42,9],[33,313,42,10],[33,314,42,11],[33,316,42,13,"rxjs_1"],[33,322,42,19],[33,323,42,20,"map"],[33,326,42,23],[33,328,42,25],[33,329,42,26],[33,330,42,27,"info"],[33,334,42,31],[33,336,42,33],[33,337,42,34,"currentSlot"],[33,348,42,45],[33,350,42,47,"epochIndex"],[33,360,42,57],[33,362,42,59,"genesisSlot"],[33,373,42,70],[33,375,42,72,"optStartIndex"],[33,388,42,85],[33,389,42,86],[33,390,42,87],[33,395,42,92],[33,396,43,8,"info"],[33,400,43,12],[33,402,43,14],[33,403,43,15,"currentSlot"],[33,414,43,26],[33,416,43,28,"epochIndex"],[33,426,43,38],[33,428,43,40,"genesisSlot"],[33,439,43,51],[33,441,43,53,"optStartIndex"],[33,454,43,66],[33,458,43,70,"optStartIndex"],[33,471,43,83],[33,472,43,84,"isSome"],[33,478,43,90],[33,481,43,93,"optStartIndex"],[33,494,43,106],[33,495,43,107,"unwrap"],[33,501,43,113],[33,502,43,114],[33,503,43,115],[33,506,43,118,"api"],[33,509,43,121],[33,510,43,122,"registry"],[33,518,43,130],[33,519,43,131,"createType"],[33,529,43,141],[33,530,43,142],[33,544,43,156],[33,546,43,158],[33,547,43,159],[33,548,43,160],[33,549,43,161],[33,550,44,5],[33,551,44,6],[33,552,44,7],[34,2,45,0],[35,2,46,0],[36,0,47,0],[37,0,48,0],[38,0,49,0],[39,0,50,0],[40,0,51,0],[41,0,52,0],[42,0,53,0],[43,0,54,0],[44,0,55,0],[45,2,56,0],[45,11,56,9,"progress"],[45,19,56,17,"progress"],[45,20,56,18,"instanceId"],[45,30,56,28],[45,32,56,30,"api"],[45,35,56,33],[45,37,56,35],[46,4,57,4],[46,11,57,11],[46,12,57,12],[46,13,57,13],[46,15,57,15,"index_js_1"],[46,25,57,25],[46,26,57,26,"memo"],[46,30,57,30],[46,32,57,32,"instanceId"],[46,42,57,42],[46,44,57,44],[46,50,57,50,"api"],[46,53,57,53],[46,54,57,54,"query"],[46,59,57,59],[46,60,57,60,"babe"],[46,64,57,64],[46,67,58,10,"queryBabe"],[46,76,58,19],[46,77,58,20,"api"],[46,80,58,23],[46,81,58,24],[46,82,58,25,"pipe"],[46,86,58,29],[46,87,58,30],[46,88,58,31],[46,89,58,32],[46,91,58,34,"rxjs_1"],[46,97,58,40],[46,98,58,41,"map"],[46,101,58,44],[46,103,58,46],[46,104,58,47],[46,105,58,48,"info"],[46,109,58,52],[46,111,58,54,"slots"],[46,116,58,59],[46,117,58,60],[46,122,58,65,"createDerive"],[46,134,58,77],[46,135,58,78,"api"],[46,138,58,81],[46,140,58,83,"info"],[46,144,58,87],[46,146,58,89,"slots"],[46,151,58,94],[46,152,58,95],[46,153,58,96],[46,154,58,97],[46,157,59,10,"queryAura"],[46,166,59,19],[46,167,59,20,"api"],[46,170,59,23],[46,171,59,24],[46,172,59,25],[47,2,60,0],[48,2,61,0],[49,0,62,0],[50,0,63,0],[51,0,64,0],[52,0,65,0],[53,0,66,0],[54,0,67,0],[55,0,68,0],[56,0,69,0],[57,0,70,0],[58,2,71,0,"exports"],[58,9,71,7],[58,10,71,8,"eraLength"],[58,19,71,17],[58,22,71,20,"withProgressField"],[58,39,71,37],[58,40,71,38],[58,51,71,49],[58,52,71,50],[59,2,72,0],[60,0,73,0],[61,0,74,0],[62,0,75,0],[63,0,76,0],[64,0,77,0],[65,0,78,0],[66,0,79,0],[67,0,80,0],[68,0,81,0],[69,2,82,0,"exports"],[69,9,82,7],[69,10,82,8,"eraProgress"],[69,21,82,19],[69,24,82,22,"withProgressField"],[69,41,82,39],[69,42,82,40],[69,55,82,53],[69,56,82,54],[70,2,83,0],[71,0,84,0],[72,0,85,0],[73,0,86,0],[74,0,87,0],[75,0,88,0],[76,0,89,0],[77,0,90,0],[78,0,91,0],[79,0,92,0],[80,2,93,0,"exports"],[80,9,93,7],[80,10,93,8,"sessionProgress"],[80,25,93,23],[80,28,93,26,"withProgressField"],[80,45,93,43],[80,46,93,44],[80,63,93,61],[80,64,93,62],[81,0,93,63],[81,3]],"functionMap":{"names":["<global>","withProgressField","<anonymous>","createDerive","queryAura","queryBabe","progress"],"mappings":"AAA;ACO;WCC,uID;CDC;AGC;CHQ;AIC;0DFC;YEG;CJC;AKC;gEHC;MGe,mBH;KGE;CLC;AMW;4CJC;wBIE;CNC"},"hasCjsExports":true},"type":"js/module"}]} |