mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 06:31:03 +00:00
1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"dependencies":[{"name":"rxjs","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":53,"index":53}}],"key":"PnOMrhZAPWoeW3ygrvUJ7ff768Y=","exportNames":["*"],"imports":1}},{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":2,"column":0,"index":54},"end":{"line":2,"column":59,"index":113}}],"key":"ISHU1ovvPMrCldqRjtd1JhW9dyo=","exportNames":["*"],"imports":1}},{"name":"../util/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":114},"end":{"line":3,"column":51,"index":165}}],"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.accounts = accounts;\n Object.defineProperty(exports, \"account\", {\n enumerable: true,\n get: function () {\n return account;\n }\n });\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 const QUERY_OPTS = {\n withDestination: true,\n withLedger: true,\n withNominations: true,\n withPrefs: true\n };\n function groupByEra(list) {\n return list.reduce((map, {\n era,\n value\n }) => {\n const key = era.toString();\n map[key] = (map[key] || _polkadotUtil.BN_ZERO).add(value.unwrap());\n return map;\n }, {});\n }\n function calculateUnlocking(api, stakingLedger, sessionInfo) {\n const results = Object.entries(groupByEra((stakingLedger?.unlocking || []).filter(({\n era\n }) => era.unwrap().gt(sessionInfo.activeEra)))).map(([eraString, value]) => ({\n remainingEras: new _polkadotUtil.BN(eraString).isub(sessionInfo.activeEra),\n value: api.registry.createType('Balance', value)\n }));\n return results.length ? results : undefined;\n }\n function redeemableSum(api, stakingLedger, sessionInfo) {\n return api.registry.createType('Balance', (stakingLedger?.unlocking || []).reduce((total, {\n era,\n value\n }) => {\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 _polkadotUtil.BN(0)));\n }\n function parseResult(api, sessionInfo, keys, query) {\n return (0, _polkadotUtil.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, _utilIndexJs.memo)(instanceId, (accountIds, opts = QUERY_OPTS) => api.derive.session.info().pipe((0, _rxjs.switchMap)(sessionInfo => (0, _rxjs.combineLatest)([api.derive.staking.keysMulti(accountIds), api.derive.staking.queryMulti(accountIds, opts)]).pipe((0, _rxjs.map)(([keys, queries]) => queries.map((q, index) => parseResult(api, sessionInfo, keys[index], q)))))));\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 const account = /*#__PURE__*/(0, _utilIndexJs.firstMemo)((api, accountId, opts) => api.derive.staking.accounts([accountId], opts));\n});","lineCount":89,"map":[[7,2,57,0,"exports"],[7,9,57,0],[7,10,57,0,"accounts"],[7,18,57,0],[7,21,57,0,"accounts"],[7,29,57,0],[8,2,76,0,"Object"],[8,8,76,0],[8,9,76,0,"defineProperty"],[8,23,76,0],[8,24,76,0,"exports"],[8,31,76,0],[9,4,76,0,"enumerable"],[9,14,76,0],[10,4,76,0,"get"],[10,7,76,0],[10,18,76,0,"get"],[10,19,76,0],[11,6,76,0],[11,13,76,0,"account"],[11,20,76,0],[12,4,76,0],[13,2,76,0],[14,2,1,0],[14,6,1,0,"_rxjs"],[14,11,1,0],[14,14,1,0,"require"],[14,21,1,0],[14,22,1,0,"_dependencyMap"],[14,36,1,0],[15,2,2,0],[15,6,2,0,"_polkadotUtil"],[15,19,2,0],[15,22,2,0,"require"],[15,29,2,0],[15,30,2,0,"_dependencyMap"],[15,44,2,0],[16,2,3,0],[16,6,3,0,"_utilIndexJs"],[16,18,3,0],[16,21,3,0,"require"],[16,28,3,0],[16,29,3,0,"_dependencyMap"],[16,43,3,0],[17,2,4,0],[17,8,4,6,"QUERY_OPTS"],[17,18,4,16],[17,21,4,19],[18,4,5,4,"withDestination"],[18,19,5,19],[18,21,5,21],[18,25,5,25],[19,4,6,4,"withLedger"],[19,14,6,14],[19,16,6,16],[19,20,6,20],[20,4,7,4,"withNominations"],[20,19,7,19],[20,21,7,21],[20,25,7,25],[21,4,8,4,"withPrefs"],[21,13,8,13],[21,15,8,15],[22,2,9,0],[22,3,9,1],[23,2,10,0],[23,11,10,9,"groupByEra"],[23,21,10,19,"groupByEra"],[23,22,10,20,"list"],[23,26,10,24],[23,28,10,26],[24,4,11,4],[24,11,11,11,"list"],[24,15,11,15],[24,16,11,16,"reduce"],[24,22,11,22],[24,23,11,23],[24,24,11,24,"map"],[24,27,11,27],[24,29,11,29],[25,6,11,31,"era"],[25,9,11,34],[26,6,11,36,"value"],[27,4,11,42],[27,5,11,43],[27,10,11,48],[28,6,12,8],[28,12,12,14,"key"],[28,15,12,17],[28,18,12,20,"era"],[28,21,12,23],[28,22,12,24,"toString"],[28,30,12,32],[28,31,12,33],[28,32,12,34],[29,6,13,8,"map"],[29,9,13,11],[29,10,13,12,"key"],[29,13,13,15],[29,14,13,16],[29,17,13,19],[29,18,13,20,"map"],[29,21,13,23],[29,22,13,24,"key"],[29,25,13,27],[29,26,13,28],[29,30,13,32,"BN_ZERO"],[29,43,13,39],[29,44,13,39,"BN_ZERO"],[29,51,13,39],[29,53,13,41,"add"],[29,56,13,44],[29,57,13,45,"value"],[29,62,13,50],[29,63,13,51,"unwrap"],[29,69,13,57],[29,70,13,58],[29,71,13,59],[29,72,13,60],[30,6,14,8],[30,13,14,15,"map"],[30,16,14,18],[31,4,15,4],[31,5,15,5],[31,7,15,7],[31,8,15,8],[31,9,15,9],[31,10,15,10],[32,2,16,0],[33,2,17,0],[33,11,17,9,"calculateUnlocking"],[33,29,17,27,"calculateUnlocking"],[33,30,17,28,"api"],[33,33,17,31],[33,35,17,33,"stakingLedger"],[33,48,17,46],[33,50,17,48,"sessionInfo"],[33,61,17,59],[33,63,17,61],[34,4,18,4],[34,10,18,10,"results"],[34,17,18,17],[34,20,18,20,"Object"],[34,26,18,26],[34,27,19,9,"entries"],[34,34,19,16],[34,35,19,17,"groupByEra"],[34,45,19,27],[34,46,19,28],[34,47,19,29,"stakingLedger"],[34,60,19,42],[34,62,19,44,"unlocking"],[34,71,19,53],[34,75,19,57],[34,77,19,59],[34,79,19,61,"filter"],[34,85,19,67],[34,86,19,68],[34,87,19,69],[35,6,19,71,"era"],[36,4,19,75],[36,5,19,76],[36,10,19,81,"era"],[36,13,19,84],[36,14,19,85,"unwrap"],[36,20,19,91],[36,21,19,92],[36,22,19,93],[36,23,19,94,"gt"],[36,25,19,96],[36,26,19,97,"sessionInfo"],[36,37,19,108],[36,38,19,109,"activeEra"],[36,47,19,118],[36,48,19,119],[36,49,19,120],[36,50,19,121],[36,51,19,122],[36,52,20,9,"map"],[36,55,20,12],[36,56,20,13],[36,57,20,14],[36,58,20,15,"eraString"],[36,67,20,24],[36,69,20,26,"value"],[36,74,20,31],[36,75,20,32],[36,81,20,38],[37,6,21,8,"remainingEras"],[37,19,21,21],[37,21,21,23],[37,25,21,27,"BN"],[37,38,21,29],[37,39,21,29,"BN"],[37,41,21,29],[37,42,21,30,"eraString"],[37,51,21,39],[37,52,21,40],[37,53,21,41,"isub"],[37,57,21,45],[37,58,21,46,"sessionInfo"],[37,69,21,57],[37,70,21,58,"activeEra"],[37,79,21,67],[37,80,21,68],[38,6,22,8,"value"],[38,11,22,13],[38,13,22,15,"api"],[38,16,22,18],[38,17,22,19,"registry"],[38,25,22,27],[38,26,22,28,"createType"],[38,36,22,38],[38,37,22,39],[38,46,22,48],[38,48,22,50,"value"],[38,53,22,55],[39,4,23,4],[39,5,23,5],[39,6,23,6],[39,7,23,7],[40,4,24,4],[40,11,24,11,"results"],[40,18,24,18],[40,19,24,19,"length"],[40,25,24,25],[40,28,25,10,"results"],[40,35,25,17],[40,38,26,10,"undefined"],[40,47,26,19],[41,2,27,0],[42,2,28,0],[42,11,28,9,"redeemableSum"],[42,24,28,22,"redeemableSum"],[42,25,28,23,"api"],[42,28,28,26],[42,30,28,28,"stakingLedger"],[42,43,28,41],[42,45,28,43,"sessionInfo"],[42,56,28,54],[42,58,28,56],[43,4,29,4],[43,11,29,11,"api"],[43,14,29,14],[43,15,29,15,"registry"],[43,23,29,23],[43,24,29,24,"createType"],[43,34,29,34],[43,35,29,35],[43,44,29,44],[43,46,29,46],[43,47,29,47,"stakingLedger"],[43,60,29,60],[43,62,29,62,"unlocking"],[43,71,29,71],[43,75,29,75],[43,77,29,77],[43,79,29,79,"reduce"],[43,85,29,85],[43,86,29,86],[43,87,29,87,"total"],[43,92,29,92],[43,94,29,94],[44,6,29,96,"era"],[44,9,29,99],[45,6,29,101,"value"],[46,4,29,107],[46,5,29,108],[46,10,29,113],[47,6,30,8],[48,6,31,8],[49,6,32,8],[50,6,33,8],[50,13,33,15,"era"],[50,16,33,18],[50,17,33,19,"unwrap"],[50,23,33,25],[50,24,33,26],[50,25,33,27],[50,26,33,28,"gt"],[50,28,33,30],[50,29,33,31,"sessionInfo"],[50,40,33,42],[50,41,33,43,"currentEra"],[50,51,33,53],[50,52,33,54],[50,55,34,14,"total"],[50,60,34,19],[50,63,35,14,"total"],[50,68,35,19],[50,69,35,20,"iadd"],[50,73,35,24],[50,74,35,25,"value"],[50,79,35,30],[50,80,35,31,"unwrap"],[50,86,35,37],[50,87,35,38],[50,88,35,39],[50,89,35,40],[51,4,36,4],[51,5,36,5],[51,7,36,7],[51,11,36,11,"BN"],[51,24,36,13],[51,25,36,13,"BN"],[51,27,36,13],[51,28,36,14],[51,29,36,15],[51,30,36,16],[51,31,36,17],[51,32,36,18],[52,2,37,0],[53,2,38,0],[53,11,38,9,"parseResult"],[53,22,38,20,"parseResult"],[53,23,38,21,"api"],[53,26,38,24],[53,28,38,26,"sessionInfo"],[53,39,38,37],[53,41,38,39,"keys"],[53,45,38,43],[53,47,38,45,"query"],[53,52,38,50],[53,54,38,52],[54,4,39,4],[54,11,39,11],[54,15,39,11,"objectSpread"],[54,28,39,23],[54,29,39,23,"objectSpread"],[54,41,39,23],[54,43,39,24],[54,44,39,25],[54,45,39,26],[54,47,39,28,"keys"],[54,51,39,32],[54,53,39,34,"query"],[54,58,39,39],[54,60,39,41],[55,6,40,8,"redeemable"],[55,16,40,18],[55,18,40,20,"redeemableSum"],[55,31,40,33],[55,32,40,34,"api"],[55,35,40,37],[55,37,40,39,"query"],[55,42,40,44],[55,43,40,45,"stakingLedger"],[55,56,40,58],[55,58,40,60,"sessionInfo"],[55,69,40,71],[55,70,40,72],[56,6,41,8,"unlocking"],[56,15,41,17],[56,17,41,19,"calculateUnlocking"],[56,35,41,37],[56,36,41,38,"api"],[56,39,41,41],[56,41,41,43,"query"],[56,46,41,48],[56,47,41,49,"stakingLedger"],[56,60,41,62],[56,62,41,64,"sessionInfo"],[56,73,41,75],[57,4,42,4],[57,5,42,5],[57,6,42,6],[58,2,43,0],[59,2,44,0],[60,0,45,0],[61,0,46,0],[62,0,47,0],[63,0,48,0],[64,0,49,0],[65,0,50,0],[66,0,51,0],[67,0,52,0],[68,0,53,0],[69,0,54,0],[70,0,55,0],[71,0,56,0],[72,2,57,7],[72,11,57,16,"accounts"],[72,19,57,24,"accounts"],[72,20,57,25,"instanceId"],[72,30,57,35],[72,32,57,37,"api"],[72,35,57,40],[72,37,57,42],[73,4,58,4],[73,11,58,11],[73,15,58,11,"memo"],[73,27,58,15],[73,28,58,15,"memo"],[73,32,58,15],[73,34,58,16,"instanceId"],[73,44,58,26],[73,46,58,28],[73,47,58,29,"accountIds"],[73,57,58,39],[73,59,58,41,"opts"],[73,63,58,45],[73,66,58,48,"QUERY_OPTS"],[73,76,58,58],[73,81,58,63,"api"],[73,84,58,66],[73,85,58,67,"derive"],[73,91,58,73],[73,92,58,74,"session"],[73,99,58,81],[73,100,58,82,"info"],[73,104,58,86],[73,105,58,87],[73,106,58,88],[73,107,58,89,"pipe"],[73,111,58,93],[73,112,58,94],[73,116,58,94,"switchMap"],[73,121,58,103],[73,122,58,103,"switchMap"],[73,131,58,103],[73,133,58,105,"sessionInfo"],[73,144,58,116],[73,148,58,121],[73,152,58,121,"combineLatest"],[73,157,58,134],[73,158,58,134,"combineLatest"],[73,171,58,134],[73,173,58,135],[73,174,59,8,"api"],[73,177,59,11],[73,178,59,12,"derive"],[73,184,59,18],[73,185,59,19,"staking"],[73,192,59,26],[73,193,59,27,"keysMulti"],[73,202,59,36],[73,203,59,37,"accountIds"],[73,213,59,47],[73,214,59,48],[73,216,60,8,"api"],[73,219,60,11],[73,220,60,12,"derive"],[73,226,60,18],[73,227,60,19,"staking"],[73,234,60,26],[73,235,60,27,"queryMulti"],[73,245,60,37],[73,246,60,38,"accountIds"],[73,256,60,48],[73,258,60,50,"opts"],[73,262,60,54],[73,263,60,55],[73,264,61,5],[73,265,61,6],[73,266,61,7,"pipe"],[73,270,61,11],[73,271,61,12],[73,275,61,12,"map"],[73,280,61,15],[73,281,61,15,"map"],[73,284,61,15],[73,286,61,16],[73,287,61,17],[73,288,61,18,"keys"],[73,292,61,22],[73,294,61,24,"queries"],[73,301,61,31],[73,302,61,32],[73,307,61,37,"queries"],[73,314,61,44],[73,315,61,45,"map"],[73,318,61,48],[73,319,61,49],[73,320,61,50,"q"],[73,321,61,51],[73,323,61,53,"index"],[73,328,61,58],[73,333,61,63,"parseResult"],[73,344,61,74],[73,345,61,75,"api"],[73,348,61,78],[73,350,61,80,"sessionInfo"],[73,361,61,91],[73,363,61,93,"keys"],[73,367,61,97],[73,368,61,98,"index"],[73,373,61,103],[73,374,61,104],[73,376,61,106,"q"],[73,377,61,107],[73,378,61,108],[73,379,61,109],[73,380,61,110],[73,381,61,111],[73,382,61,112],[73,383,61,113],[73,384,61,114],[74,2,62,0],[75,2,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,0],[82,0,70,0],[83,0,71,0],[84,0,72,0],[85,0,73,0],[86,0,74,0],[87,0,75,0],[88,2,76,7],[88,8,76,13,"account"],[88,15,76,20],[88,18,76,23],[88,31,76,37],[88,35,76,37,"firstMemo"],[88,47,76,46],[88,48,76,46,"firstMemo"],[88,57,76,46],[88,59,76,47],[88,60,76,48,"api"],[88,63,76,51],[88,65,76,53,"accountId"],[88,74,76,62],[88,76,76,64,"opts"],[88,80,76,68],[88,85,76,73,"api"],[88,88,76,76],[88,89,76,77,"derive"],[88,95,76,83],[88,96,76,84,"staking"],[88,103,76,91],[88,104,76,92,"accounts"],[88,112,76,100],[88,113,76,101],[88,114,76,102,"accountId"],[88,123,76,111],[88,124,76,112],[88,126,76,114,"opts"],[88,130,76,118],[88,131,76,119],[88,132,76,120],[89,0,76,121],[89,3]],"functionMap":{"names":["<global>","groupByEra","list.reduce$argument_0","calculateUnlocking","filter$argument_0","Object.entries.map$argument_0","redeemableSum","reduce$argument_0","parseResult","accounts","memo$argument_1","switchMap$argument_0","map$argument_0","queries.map$argument_0","firstMemo$argument_0"],"mappings":"AAA;ACS;uBCC;KDI;CDC;AGC;oECE,mDD;aEC;MFG;CHI;AMC;sFCC;KDO;CNC;AQC;CRK;OSc;4BCC,4EC;gBCG,iCC,2DD,CD,ED,ED;CTC;+Ccc,wEd"},"hasCjsExports":false},"type":"js/module"}]} |