mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 05:21:02 +00:00
1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
{"dependencies":[{"name":"@babel/runtime/helpers/slicedToArray","data":{"asyncType":null,"isESMImport":false,"locs":[],"key":"5y7e5+zC7teYEEC6niD9f5zII1M=","exportNames":["*"],"imports":1}},{"name":"rxjs","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":15,"index":147},"end":{"line":5,"column":30,"index":162}}],"key":"atDzfUGaJNRNtwyVumomzH/5ygw=","exportNames":["*"],"imports":1}},{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":15,"index":179},"end":{"line":6,"column":40,"index":204}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":7,"column":19,"index":225},"end":{"line":7,"column":46,"index":252}}],"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 var _slicedToArray = require(_dependencyMap[0], \"@babel/runtime/helpers/slicedToArray\").default;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.account = void 0;\n exports.accounts = accounts;\n var rxjs_1 = require(_dependencyMap[1], \"rxjs\");\n var util_1 = require(_dependencyMap[2], \"@polkadot/util\");\n var index_js_1 = require(_dependencyMap[3], \"../util/index.js\");\n var QUERY_OPTS = {\n withDestination: true,\n withLedger: true,\n withNominations: true,\n withPrefs: true\n };\n function groupByEra(list) {\n return list.reduce((map, _ref) => {\n var era = _ref.era,\n value = _ref.value;\n var key = era.toString();\n map[key] = (map[key] || util_1.BN_ZERO).add(value.unwrap());\n return map;\n }, {});\n }\n function calculateUnlocking(api, stakingLedger, sessionInfo) {\n var results = Object.entries(groupByEra((stakingLedger?.unlocking || []).filter(_ref2 => {\n var era = _ref2.era;\n return era.unwrap().gt(sessionInfo.activeEra);\n }))).map(_ref3 => {\n var _ref4 = _slicedToArray(_ref3, 2),\n eraString = _ref4[0],\n value = _ref4[1];\n return {\n remainingEras: new util_1.BN(eraString).isub(sessionInfo.activeEra),\n value: api.registry.createType('Balance', value)\n };\n });\n return results.length ? results : undefined;\n }\n function redeemableSum(api, stakingLedger, sessionInfo) {\n return api.registry.createType('Balance', (stakingLedger?.unlocking || []).reduce((total, _ref5) => {\n var era = _ref5.era,\n value = _ref5.value;\n // aligns with https://github.com/paritytech/substrate/blob/fdfdc73f9e64dc47934b72eb9af3e1989e4ba699/frame/staking/src/pallet/mod.rs#L973-L975\n // (ensure currentEra >= era passed, as per https://github.com/paritytech/substrate/blob/fdfdc73f9e64dc47934b72eb9af3e1989e4ba699/frame/staking/src/lib.rs#L477-L494)\n // NOTE: Previously we used activeEra >= era, which is incorrect for the last session\n return era.unwrap().gt(sessionInfo.currentEra) ? total : total.iadd(value.unwrap());\n }, new util_1.BN(0)));\n }\n function parseResult(api, sessionInfo, keys, query) {\n return (0, util_1.objectSpread)({}, keys, query, {\n redeemable: redeemableSum(api, query.stakingLedger, sessionInfo),\n unlocking: calculateUnlocking(api, query.stakingLedger, sessionInfo)\n });\n }\n /**\n * @name accounts\n * @param {(Uint8Array | string)[]} accountIds List of account stashes\n * @param {StakingQueryFlags} opts optional filtering flag\n * @description From a list of stashes, fill in all the relevant staking details\n * @example\n * ```javascript\n * const accounts = await api.derive.staking.accounts([\n * \"149B17nn7zVL4SkLSNmANupEkGexUBAxVrdk4bbWFZYibkFc\",\n * ]);\n * console.log(\"First account staking info:\", accounts[0]);\n * ```\n */\n function accounts(instanceId, api) {\n return (0, index_js_1.memo)(instanceId, function (accountIds) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : QUERY_OPTS;\n return api.derive.session.info().pipe((0, rxjs_1.switchMap)(sessionInfo => (0, rxjs_1.combineLatest)([api.derive.staking.keysMulti(accountIds), api.derive.staking.queryMulti(accountIds, opts)]).pipe((0, rxjs_1.map)(_ref6 => {\n var _ref7 = _slicedToArray(_ref6, 2),\n keys = _ref7[0],\n queries = _ref7[1];\n return queries.map((q, index) => parseResult(api, sessionInfo, keys[index], q));\n }))));\n });\n }\n /**\n * @name account\n * @param {(Uint8Array | string)} accountId AccountId of the stash.\n * @param {StakingQueryFlags} opts (Optional) filtering flag.\n * @description From a stash, retrieve the controllerId and fill in all the relevant staking details.\n * @example\n * ```javascript\n * const accountStakingData = await api.derive.staking.account(\n * \"149B17nn7zVL4SkLSNmANupEkGexUBAxVrdk4bbWFZYibkFc\"\n * );\n * console.log(accountStakingData);\n * ```\n */\n exports.account = (0, index_js_1.firstMemo)((api, accountId, opts) => api.derive.staking.accounts([accountId], opts));\n});","lineCount":97,"map":[[2,2,1,0],[2,14,1,12],[4,2,1,13],[4,6,1,13,"_slicedToArray"],[4,20,1,13],[4,23,1,13,"require"],[4,30,1,13],[4,31,1,13,"_dependencyMap"],[4,45,1,13],[4,90,1,13,"default"],[4,97,1,13],[5,2,2,0,"Object"],[5,8,2,6],[5,9,2,7,"defineProperty"],[5,23,2,21],[5,24,2,22,"exports"],[5,31,2,29],[5,33,2,31],[5,45,2,43],[5,47,2,45],[6,4,2,47,"value"],[6,9,2,52],[6,11,2,54],[7,2,2,59],[7,3,2,60],[7,4,2,61],[8,2,3,0,"exports"],[8,9,3,7],[8,10,3,8,"account"],[8,17,3,15],[8,20,3,18],[8,25,3,23],[8,26,3,24],[9,2,4,0,"exports"],[9,9,4,7],[9,10,4,8,"accounts"],[9,18,4,16],[9,21,4,19,"accounts"],[9,29,4,27],[10,2,5,0],[10,6,5,6,"rxjs_1"],[10,12,5,12],[10,15,5,15,"require"],[10,22,5,22],[10,23,5,22,"_dependencyMap"],[10,37,5,22],[10,48,5,29],[10,49,5,30],[11,2,6,0],[11,6,6,6,"util_1"],[11,12,6,12],[11,15,6,15,"require"],[11,22,6,22],[11,23,6,22,"_dependencyMap"],[11,37,6,22],[11,58,6,39],[11,59,6,40],[12,2,7,0],[12,6,7,6,"index_js_1"],[12,16,7,16],[12,19,7,19,"require"],[12,26,7,26],[12,27,7,26,"_dependencyMap"],[12,41,7,26],[12,64,7,45],[12,65,7,46],[13,2,8,0],[13,6,8,6,"QUERY_OPTS"],[13,16,8,16],[13,19,8,19],[14,4,9,4,"withDestination"],[14,19,9,19],[14,21,9,21],[14,25,9,25],[15,4,10,4,"withLedger"],[15,14,10,14],[15,16,10,16],[15,20,10,20],[16,4,11,4,"withNominations"],[16,19,11,19],[16,21,11,21],[16,25,11,25],[17,4,12,4,"withPrefs"],[17,13,12,13],[17,15,12,15],[18,2,13,0],[18,3,13,1],[19,2,14,0],[19,11,14,9,"groupByEra"],[19,21,14,19,"groupByEra"],[19,22,14,20,"list"],[19,26,14,24],[19,28,14,26],[20,4,15,4],[20,11,15,11,"list"],[20,15,15,15],[20,16,15,16,"reduce"],[20,22,15,22],[20,23,15,23],[20,24,15,24,"map"],[20,27,15,27],[20,29,15,27,"_ref"],[20,33,15,27],[20,38,15,48],[21,6,15,48],[21,10,15,31,"era"],[21,13,15,34],[21,16,15,34,"_ref"],[21,20,15,34],[21,21,15,31,"era"],[21,24,15,34],[22,8,15,36,"value"],[22,13,15,41],[22,16,15,41,"_ref"],[22,20,15,41],[22,21,15,36,"value"],[22,26,15,41],[23,6,16,8],[23,10,16,14,"key"],[23,13,16,17],[23,16,16,20,"era"],[23,19,16,23],[23,20,16,24,"toString"],[23,28,16,32],[23,29,16,33],[23,30,16,34],[24,6,17,8,"map"],[24,9,17,11],[24,10,17,12,"key"],[24,13,17,15],[24,14,17,16],[24,17,17,19],[24,18,17,20,"map"],[24,21,17,23],[24,22,17,24,"key"],[24,25,17,27],[24,26,17,28],[24,30,17,32,"util_1"],[24,36,17,38],[24,37,17,39,"BN_ZERO"],[24,44,17,46],[24,46,17,48,"add"],[24,49,17,51],[24,50,17,52,"value"],[24,55,17,57],[24,56,17,58,"unwrap"],[24,62,17,64],[24,63,17,65],[24,64,17,66],[24,65,17,67],[25,6,18,8],[25,13,18,15,"map"],[25,16,18,18],[26,4,19,4],[26,5,19,5],[26,7,19,7],[26,8,19,8],[26,9,19,9],[26,10,19,10],[27,2,20,0],[28,2,21,0],[28,11,21,9,"calculateUnlocking"],[28,29,21,27,"calculateUnlocking"],[28,30,21,28,"api"],[28,33,21,31],[28,35,21,33,"stakingLedger"],[28,48,21,46],[28,50,21,48,"sessionInfo"],[28,61,21,59],[28,63,21,61],[29,4,22,4],[29,8,22,10,"results"],[29,15,22,17],[29,18,22,20,"Object"],[29,24,22,26],[29,25,23,9,"entries"],[29,32,23,16],[29,33,23,17,"groupByEra"],[29,43,23,27],[29,44,23,28],[29,45,23,29,"stakingLedger"],[29,58,23,42],[29,60,23,44,"unlocking"],[29,69,23,53],[29,73,23,57],[29,75,23,59],[29,77,23,61,"filter"],[29,83,23,67],[29,84,23,68,"_ref2"],[29,89,23,68],[30,6,23,68],[30,10,23,71,"era"],[30,13,23,74],[30,16,23,74,"_ref2"],[30,21,23,74],[30,22,23,71,"era"],[30,25,23,74],[31,6,23,74],[31,13,23,81,"era"],[31,16,23,84],[31,17,23,85,"unwrap"],[31,23,23,91],[31,24,23,92],[31,25,23,93],[31,26,23,94,"gt"],[31,28,23,96],[31,29,23,97,"sessionInfo"],[31,40,23,108],[31,41,23,109,"activeEra"],[31,50,23,118],[31,51,23,119],[32,4,23,119],[32,6,23,120],[32,7,23,121],[32,8,23,122],[32,9,24,9,"map"],[32,12,24,12],[32,13,24,13,"_ref3"],[32,18,24,13],[33,6,24,13],[33,10,24,13,"_ref4"],[33,15,24,13],[33,18,24,13,"_slicedToArray"],[33,32,24,13],[33,33,24,13,"_ref3"],[33,38,24,13],[34,8,24,15,"eraString"],[34,17,24,24],[34,20,24,24,"_ref4"],[34,25,24,24],[35,8,24,26,"value"],[35,13,24,31],[35,16,24,31,"_ref4"],[35,21,24,31],[36,6,24,31],[36,13,24,38],[37,8,25,8,"remainingEras"],[37,21,25,21],[37,23,25,23],[37,27,25,27,"util_1"],[37,33,25,33],[37,34,25,34,"BN"],[37,36,25,36],[37,37,25,37,"eraString"],[37,46,25,46],[37,47,25,47],[37,48,25,48,"isub"],[37,52,25,52],[37,53,25,53,"sessionInfo"],[37,64,25,64],[37,65,25,65,"activeEra"],[37,74,25,74],[37,75,25,75],[38,8,26,8,"value"],[38,13,26,13],[38,15,26,15,"api"],[38,18,26,18],[38,19,26,19,"registry"],[38,27,26,27],[38,28,26,28,"createType"],[38,38,26,38],[38,39,26,39],[38,48,26,48],[38,50,26,50,"value"],[38,55,26,55],[39,6,27,4],[39,7,27,5],[40,4,27,5],[40,5,27,6],[40,6,27,7],[41,4,28,4],[41,11,28,11,"results"],[41,18,28,18],[41,19,28,19,"length"],[41,25,28,25],[41,28,29,10,"results"],[41,35,29,17],[41,38,30,10,"undefined"],[41,47,30,19],[42,2,31,0],[43,2,32,0],[43,11,32,9,"redeemableSum"],[43,24,32,22,"redeemableSum"],[43,25,32,23,"api"],[43,28,32,26],[43,30,32,28,"stakingLedger"],[43,43,32,41],[43,45,32,43,"sessionInfo"],[43,56,32,54],[43,58,32,56],[44,4,33,4],[44,11,33,11,"api"],[44,14,33,14],[44,15,33,15,"registry"],[44,23,33,23],[44,24,33,24,"createType"],[44,34,33,34],[44,35,33,35],[44,44,33,44],[44,46,33,46],[44,47,33,47,"stakingLedger"],[44,60,33,60],[44,62,33,62,"unlocking"],[44,71,33,71],[44,75,33,75],[44,77,33,77],[44,79,33,79,"reduce"],[44,85,33,85],[44,86,33,86],[44,87,33,87,"total"],[44,92,33,92],[44,94,33,92,"_ref5"],[44,99,33,92],[44,104,33,113],[45,6,33,113],[45,10,33,96,"era"],[45,13,33,99],[45,16,33,99,"_ref5"],[45,21,33,99],[45,22,33,96,"era"],[45,25,33,99],[46,8,33,101,"value"],[46,13,33,106],[46,16,33,106,"_ref5"],[46,21,33,106],[46,22,33,101,"value"],[46,27,33,106],[47,6,34,8],[48,6,35,8],[49,6,36,8],[50,6,37,8],[50,13,37,15,"era"],[50,16,37,18],[50,17,37,19,"unwrap"],[50,23,37,25],[50,24,37,26],[50,25,37,27],[50,26,37,28,"gt"],[50,28,37,30],[50,29,37,31,"sessionInfo"],[50,40,37,42],[50,41,37,43,"currentEra"],[50,51,37,53],[50,52,37,54],[50,55,38,14,"total"],[50,60,38,19],[50,63,39,14,"total"],[50,68,39,19],[50,69,39,20,"iadd"],[50,73,39,24],[50,74,39,25,"value"],[50,79,39,30],[50,80,39,31,"unwrap"],[50,86,39,37],[50,87,39,38],[50,88,39,39],[50,89,39,40],[51,4,40,4],[51,5,40,5],[51,7,40,7],[51,11,40,11,"util_1"],[51,17,40,17],[51,18,40,18,"BN"],[51,20,40,20],[51,21,40,21],[51,22,40,22],[51,23,40,23],[51,24,40,24],[51,25,40,25],[52,2,41,0],[53,2,42,0],[53,11,42,9,"parseResult"],[53,22,42,20,"parseResult"],[53,23,42,21,"api"],[53,26,42,24],[53,28,42,26,"sessionInfo"],[53,39,42,37],[53,41,42,39,"keys"],[53,45,42,43],[53,47,42,45,"query"],[53,52,42,50],[53,54,42,52],[54,4,43,4],[54,11,43,11],[54,12,43,12],[54,13,43,13],[54,15,43,15,"util_1"],[54,21,43,21],[54,22,43,22,"objectSpread"],[54,34,43,34],[54,36,43,36],[54,37,43,37],[54,38,43,38],[54,40,43,40,"keys"],[54,44,43,44],[54,46,43,46,"query"],[54,51,43,51],[54,53,43,53],[55,6,44,8,"redeemable"],[55,16,44,18],[55,18,44,20,"redeemableSum"],[55,31,44,33],[55,32,44,34,"api"],[55,35,44,37],[55,37,44,39,"query"],[55,42,44,44],[55,43,44,45,"stakingLedger"],[55,56,44,58],[55,58,44,60,"sessionInfo"],[55,69,44,71],[55,70,44,72],[56,6,45,8,"unlocking"],[56,15,45,17],[56,17,45,19,"calculateUnlocking"],[56,35,45,37],[56,36,45,38,"api"],[56,39,45,41],[56,41,45,43,"query"],[56,46,45,48],[56,47,45,49,"stakingLedger"],[56,60,45,62],[56,62,45,64,"sessionInfo"],[56,73,45,75],[57,4,46,4],[57,5,46,5],[57,6,46,6],[58,2,47,0],[59,2,48,0],[60,0,49,0],[61,0,50,0],[62,0,51,0],[63,0,52,0],[64,0,53,0],[65,0,54,0],[66,0,55,0],[67,0,56,0],[68,0,57,0],[69,0,58,0],[70,0,59,0],[71,0,60,0],[72,2,61,0],[72,11,61,9,"accounts"],[72,19,61,17,"accounts"],[72,20,61,18,"instanceId"],[72,30,61,28],[72,32,61,30,"api"],[72,35,61,33],[72,37,61,35],[73,4,62,4],[73,11,62,11],[73,12,62,12],[73,13,62,13],[73,15,62,15,"index_js_1"],[73,25,62,25],[73,26,62,26,"memo"],[73,30,62,30],[73,32,62,32,"instanceId"],[73,42,62,42],[73,44,62,44],[73,54,62,45,"accountIds"],[73,64,62,55],[74,6,62,55],[74,10,62,57,"opts"],[74,14,62,61],[74,17,62,61,"arguments"],[74,26,62,61],[74,27,62,61,"length"],[74,33,62,61],[74,41,62,61,"arguments"],[74,50,62,61],[74,58,62,61,"undefined"],[74,67,62,61],[74,70,62,61,"arguments"],[74,79,62,61],[74,85,62,64,"QUERY_OPTS"],[74,95,62,74],[75,6,62,74],[75,13,62,79,"api"],[75,16,62,82],[75,17,62,83,"derive"],[75,23,62,89],[75,24,62,90,"session"],[75,31,62,97],[75,32,62,98,"info"],[75,36,62,102],[75,37,62,103],[75,38,62,104],[75,39,62,105,"pipe"],[75,43,62,109],[75,44,62,110],[75,45,62,111],[75,46,62,112],[75,48,62,114,"rxjs_1"],[75,54,62,120],[75,55,62,121,"switchMap"],[75,64,62,130],[75,66,62,133,"sessionInfo"],[75,77,62,144],[75,81,62,149],[75,82,62,150],[75,83,62,151],[75,85,62,153,"rxjs_1"],[75,91,62,159],[75,92,62,160,"combineLatest"],[75,105,62,173],[75,107,62,175],[75,108,63,8,"api"],[75,111,63,11],[75,112,63,12,"derive"],[75,118,63,18],[75,119,63,19,"staking"],[75,126,63,26],[75,127,63,27,"keysMulti"],[75,136,63,36],[75,137,63,37,"accountIds"],[75,147,63,47],[75,148,63,48],[75,150,64,8,"api"],[75,153,64,11],[75,154,64,12,"derive"],[75,160,64,18],[75,161,64,19,"staking"],[75,168,64,26],[75,169,64,27,"queryMulti"],[75,179,64,37],[75,180,64,38,"accountIds"],[75,190,64,48],[75,192,64,50,"opts"],[75,196,64,54],[75,197,64,55],[75,198,65,5],[75,199,65,6],[75,200,65,7,"pipe"],[75,204,65,11],[75,205,65,12],[75,206,65,13],[75,207,65,14],[75,209,65,16,"rxjs_1"],[75,215,65,22],[75,216,65,23,"map"],[75,219,65,26],[75,221,65,28,"_ref6"],[75,226,65,28],[76,8,65,28],[76,12,65,28,"_ref7"],[76,17,65,28],[76,20,65,28,"_slicedToArray"],[76,34,65,28],[76,35,65,28,"_ref6"],[76,40,65,28],[77,10,65,30,"keys"],[77,14,65,34],[77,17,65,34,"_ref7"],[77,22,65,34],[78,10,65,36,"queries"],[78,17,65,43],[78,20,65,43,"_ref7"],[78,25,65,43],[79,8,65,43],[79,15,65,49,"queries"],[79,22,65,56],[79,23,65,57,"map"],[79,26,65,60],[79,27,65,61],[79,28,65,62,"q"],[79,29,65,63],[79,31,65,65,"index"],[79,36,65,70],[79,41,65,75,"parseResult"],[79,52,65,86],[79,53,65,87,"api"],[79,56,65,90],[79,58,65,92,"sessionInfo"],[79,69,65,103],[79,71,65,105,"keys"],[79,75,65,109],[79,76,65,110,"index"],[79,81,65,115],[79,82,65,116],[79,84,65,118,"q"],[79,85,65,119],[79,86,65,120],[79,87,65,121],[80,6,65,121],[80,8,65,122],[80,9,65,123],[80,10,65,124],[80,11,65,125],[81,4,65,125],[81,6,65,126],[82,2,66,0],[83,2,67,0],[84,0,68,0],[85,0,69,0],[86,0,70,0],[87,0,71,0],[88,0,72,0],[89,0,73,0],[90,0,74,0],[91,0,75,0],[92,0,76,0],[93,0,77,0],[94,0,78,0],[95,0,79,0],[96,2,80,0,"exports"],[96,9,80,7],[96,10,80,8,"account"],[96,17,80,15],[96,20,80,18],[96,21,80,19],[96,22,80,20],[96,24,80,22,"index_js_1"],[96,34,80,32],[96,35,80,33,"firstMemo"],[96,44,80,42],[96,46,80,44],[96,47,80,45,"api"],[96,50,80,48],[96,52,80,50,"accountId"],[96,61,80,59],[96,63,80,61,"opts"],[96,67,80,65],[96,72,80,70,"api"],[96,75,80,73],[96,76,80,74,"derive"],[96,82,80,80],[96,83,80,81,"staking"],[96,90,80,88],[96,91,80,89,"accounts"],[96,99,80,97],[96,100,80,98],[96,101,80,99,"accountId"],[96,110,80,108],[96,111,80,109],[96,113,80,111,"opts"],[96,117,80,115],[96,118,80,116],[96,119,80,117],[97,0,80,118],[97,3]],"functionMap":{"names":["<global>","groupByEra","list.reduce$argument_0","calculateUnlocking","filter$argument_0","Object.entries.map$argument_0","redeemableSum","reduce$argument_0","parseResult","accounts","<anonymous>","queries.map$argument_0"],"mappings":"AAA;ACa;uBCC;KDI;CDC;AGC;oECE,mDD;aEC;MFG;CHI;AMC;sFCC;KDO;CNC;AQC;CRK;ASc;4CCC;6DCG,2DD,KD;CTC;4CUc,wEV"},"hasCjsExports":true},"type":"js/module"}]} |