mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-06 03:17:58 +00:00
1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
{"dependencies":[{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":15,"index":145},"end":{"line":5,"column":40,"index":170}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}},{"name":"../abstract/Array.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":19,"index":191},"end":{"line":6,"column":50,"index":222}}],"key":"6mEu3EU+b/IJjH94vVSmYQCsVqQ=","exportNames":["*"],"imports":1}},{"name":"../utils/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":7,"column":19,"index":243},"end":{"line":7,"column":47,"index":271}}],"key":"j8ZYB2+3ieHcvBXwesUJUzLi2Jo=","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.Vec = void 0;\n exports.decodeVec = decodeVec;\n const util_1 = require(_dependencyMap[0], \"@polkadot/util\");\n const Array_js_1 = require(_dependencyMap[1], \"../abstract/Array.js\");\n const index_js_1 = require(_dependencyMap[2], \"../utils/index.js\");\n const MAX_LENGTH = 512 * 1024;\n const l = (0, util_1.logger)('Vec');\n function decodeVecLength(value) {\n if (Array.isArray(value)) {\n return [value, value.length, 0];\n } else if ((0, util_1.isU8a)(value) || (0, util_1.isHex)(value)) {\n const u8a = (0, util_1.u8aToU8a)(value);\n const [startAt, length] = (0, util_1.compactFromU8aLim)(u8a);\n if (length > MAX_LENGTH) {\n throw new Error(`Vec length ${length.toString()} exceeds ${MAX_LENGTH}`);\n }\n return [u8a, length, startAt];\n } else if (!value) {\n return [null, 0, 0];\n }\n throw new Error(`Expected array/hex input to Vec<*> decoding, found ${typeof value}: ${(0, util_1.stringify)(value)}`);\n }\n function decodeVec(registry, result, value, startAt, Type) {\n if (Array.isArray(value)) {\n const count = result.length;\n for (let i = 0; i < count; i++) {\n // 26/08/2022 this is actually a false positive - after recent eslint upgdates\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const entry = value[i];\n try {\n result[i] = entry instanceof Type ? entry : new Type(registry, entry);\n } catch (error) {\n l.error(`Unable to decode on index ${i}`, error.message);\n throw error;\n }\n }\n return [0, 0];\n } else if (!value) {\n return [0, 0];\n }\n // we don't need more checks, we already limited it via the length decoding\n return (0, index_js_1.decodeU8aVec)(registry, result, (0, util_1.u8aToU8a)(value), startAt, Type);\n }\n /**\n * @name Vec\n * @description\n * This manages codec arrays. Internally it keeps track of the length (as decoded) and allows\n * construction with the passed `Type` in the constructor. It is an extension to Array, providing\n * specific encoding/decoding on top of the base type.\n */\n class Vec extends Array_js_1.AbstractArray {\n #Type;\n constructor(registry, Type, value = [], {\n definition,\n setDefinition = util_1.identity\n } = {}) {\n const [decodeFrom, length, startAt] = decodeVecLength(value);\n super(registry, length);\n this.#Type = definition || setDefinition((0, index_js_1.typeToConstructor)(registry, Type));\n this.initialU8aLength = ((0, util_1.isU8a)(decodeFrom) ? (0, index_js_1.decodeU8aVec)(registry, this, decodeFrom, startAt, this.#Type) : decodeVec(registry, this, decodeFrom, startAt, this.#Type))[0];\n }\n static with(Type) {\n let definition;\n // eslint-disable-next-line no-return-assign\n const setDefinition = d => definition = d;\n return class extends Vec {\n constructor(registry, value) {\n super(registry, Type, value, {\n definition,\n setDefinition\n });\n }\n };\n }\n /**\n * @description The type for the items\n */\n get Type() {\n return this.#Type.name;\n }\n /**\n * @description Finds the index of the value in the array\n */\n indexOf(other) {\n // convert type first, this removes overhead from the eq\n const check = other instanceof this.#Type ? other : new this.#Type(this.registry, other);\n for (let i = 0, count = this.length; i < count; i++) {\n if (check.eq(this[i])) {\n return i;\n }\n }\n return -1;\n }\n /**\n * @description Returns the base runtime type name for this instance\n */\n toRawType() {\n return `Vec<${this.registry.getClassName(this.#Type) || new this.#Type(this.registry).toRawType()}>`;\n }\n }\n exports.Vec = Vec;\n});","lineCount":108,"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,"Vec"],[7,13,3,11],[7,16,3,14],[7,21,3,19],[7,22,3,20],[8,2,4,0,"exports"],[8,9,4,7],[8,10,4,8,"decodeVec"],[8,19,4,17],[8,22,4,20,"decodeVec"],[8,31,4,29],[9,2,5,0],[9,8,5,6,"util_1"],[9,14,5,12],[9,17,5,15,"require"],[9,24,5,22],[9,25,5,22,"_dependencyMap"],[9,39,5,22],[9,60,5,39],[9,61,5,40],[10,2,6,0],[10,8,6,6,"Array_js_1"],[10,18,6,16],[10,21,6,19,"require"],[10,28,6,26],[10,29,6,26,"_dependencyMap"],[10,43,6,26],[10,70,6,49],[10,71,6,50],[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,67,7,46],[11,68,7,47],[12,2,8,0],[12,8,8,6,"MAX_LENGTH"],[12,18,8,16],[12,21,8,19],[12,24,8,22],[12,27,8,25],[12,31,8,29],[13,2,9,0],[13,8,9,6,"l"],[13,9,9,7],[13,12,9,10],[13,13,9,11],[13,14,9,12],[13,16,9,14,"util_1"],[13,22,9,20],[13,23,9,21,"logger"],[13,29,9,27],[13,31,9,29],[13,36,9,34],[13,37,9,35],[14,2,10,0],[14,11,10,9,"decodeVecLength"],[14,26,10,24,"decodeVecLength"],[14,27,10,25,"value"],[14,32,10,30],[14,34,10,32],[15,4,11,4],[15,8,11,8,"Array"],[15,13,11,13],[15,14,11,14,"isArray"],[15,21,11,21],[15,22,11,22,"value"],[15,27,11,27],[15,28,11,28],[15,30,11,30],[16,6,12,8],[16,13,12,15],[16,14,12,16,"value"],[16,19,12,21],[16,21,12,23,"value"],[16,26,12,28],[16,27,12,29,"length"],[16,33,12,35],[16,35,12,37],[16,36,12,38],[16,37,12,39],[17,4,13,4],[17,5,13,5],[17,11,14,9],[17,15,14,13],[17,16,14,14],[17,17,14,15],[17,19,14,17,"util_1"],[17,25,14,23],[17,26,14,24,"isU8a"],[17,31,14,29],[17,33,14,31,"value"],[17,38,14,36],[17,39,14,37],[17,43,14,41],[17,44,14,42],[17,45,14,43],[17,47,14,45,"util_1"],[17,53,14,51],[17,54,14,52,"isHex"],[17,59,14,57],[17,61,14,59,"value"],[17,66,14,64],[17,67,14,65],[17,69,14,67],[18,6,15,8],[18,12,15,14,"u8a"],[18,15,15,17],[18,18,15,20],[18,19,15,21],[18,20,15,22],[18,22,15,24,"util_1"],[18,28,15,30],[18,29,15,31,"u8aToU8a"],[18,37,15,39],[18,39,15,41,"value"],[18,44,15,46],[18,45,15,47],[19,6,16,8],[19,12,16,14],[19,13,16,15,"startAt"],[19,20,16,22],[19,22,16,24,"length"],[19,28,16,30],[19,29,16,31],[19,32,16,34],[19,33,16,35],[19,34,16,36],[19,36,16,38,"util_1"],[19,42,16,44],[19,43,16,45,"compactFromU8aLim"],[19,60,16,62],[19,62,16,64,"u8a"],[19,65,16,67],[19,66,16,68],[20,6,17,8],[20,10,17,12,"length"],[20,16,17,18],[20,19,17,21,"MAX_LENGTH"],[20,29,17,31],[20,31,17,33],[21,8,18,12],[21,14,18,18],[21,18,18,22,"Error"],[21,23,18,27],[21,24,18,28],[21,38,18,42,"length"],[21,44,18,48],[21,45,18,49,"toString"],[21,53,18,57],[21,54,18,58],[21,55,18,59],[21,67,18,71,"MAX_LENGTH"],[21,77,18,81],[21,79,18,83],[21,80,18,84],[22,6,19,8],[23,6,20,8],[23,13,20,15],[23,14,20,16,"u8a"],[23,17,20,19],[23,19,20,21,"length"],[23,25,20,27],[23,27,20,29,"startAt"],[23,34,20,36],[23,35,20,37],[24,4,21,4],[24,5,21,5],[24,11,22,9],[24,15,22,13],[24,16,22,14,"value"],[24,21,22,19],[24,23,22,21],[25,6,23,8],[25,13,23,15],[25,14,23,16],[25,18,23,20],[25,20,23,22],[25,21,23,23],[25,23,23,25],[25,24,23,26],[25,25,23,27],[26,4,24,4],[27,4,25,4],[27,10,25,10],[27,14,25,14,"Error"],[27,19,25,19],[27,20,25,20],[27,74,25,74],[27,81,25,81,"value"],[27,86,25,86],[27,91,25,91],[27,92,25,92],[27,93,25,93],[27,95,25,95,"util_1"],[27,101,25,101],[27,102,25,102,"stringify"],[27,111,25,111],[27,113,25,113,"value"],[27,118,25,118],[27,119,25,119],[27,121,25,121],[27,122,25,122],[28,2,26,0],[29,2,27,0],[29,11,27,9,"decodeVec"],[29,20,27,18,"decodeVec"],[29,21,27,19,"registry"],[29,29,27,27],[29,31,27,29,"result"],[29,37,27,35],[29,39,27,37,"value"],[29,44,27,42],[29,46,27,44,"startAt"],[29,53,27,51],[29,55,27,53,"Type"],[29,59,27,57],[29,61,27,59],[30,4,28,4],[30,8,28,8,"Array"],[30,13,28,13],[30,14,28,14,"isArray"],[30,21,28,21],[30,22,28,22,"value"],[30,27,28,27],[30,28,28,28],[30,30,28,30],[31,6,29,8],[31,12,29,14,"count"],[31,17,29,19],[31,20,29,22,"result"],[31,26,29,28],[31,27,29,29,"length"],[31,33,29,35],[32,6,30,8],[32,11,30,13],[32,15,30,17,"i"],[32,16,30,18],[32,19,30,21],[32,20,30,22],[32,22,30,24,"i"],[32,23,30,25],[32,26,30,28,"count"],[32,31,30,33],[32,33,30,35,"i"],[32,34,30,36],[32,36,30,38],[32,38,30,40],[33,8,31,12],[34,8,32,12],[35,8,33,12],[35,14,33,18,"entry"],[35,19,33,23],[35,22,33,26,"value"],[35,27,33,31],[35,28,33,32,"i"],[35,29,33,33],[35,30,33,34],[36,8,34,12],[36,12,34,16],[37,10,35,16,"result"],[37,16,35,22],[37,17,35,23,"i"],[37,18,35,24],[37,19,35,25],[37,22,35,28,"entry"],[37,27,35,33],[37,39,35,45,"Type"],[37,43,35,49],[37,46,36,22,"entry"],[37,51,36,27],[37,54,37,22],[37,58,37,26,"Type"],[37,62,37,30],[37,63,37,31,"registry"],[37,71,37,39],[37,73,37,41,"entry"],[37,78,37,46],[37,79,37,47],[38,8,38,12],[38,9,38,13],[38,10,39,12],[38,17,39,19,"error"],[38,22,39,24],[38,24,39,26],[39,10,40,16,"l"],[39,11,40,17],[39,12,40,18,"error"],[39,17,40,23],[39,18,40,24],[39,47,40,53,"i"],[39,48,40,54],[39,50,40,56],[39,52,40,58,"error"],[39,57,40,63],[39,58,40,64,"message"],[39,65,40,71],[39,66,40,72],[40,10,41,16],[40,16,41,22,"error"],[40,21,41,27],[41,8,42,12],[42,6,43,8],[43,6,44,8],[43,13,44,15],[43,14,44,16],[43,15,44,17],[43,17,44,19],[43,18,44,20],[43,19,44,21],[44,4,45,4],[44,5,45,5],[44,11,46,9],[44,15,46,13],[44,16,46,14,"value"],[44,21,46,19],[44,23,46,21],[45,6,47,8],[45,13,47,15],[45,14,47,16],[45,15,47,17],[45,17,47,19],[45,18,47,20],[45,19,47,21],[46,4,48,4],[47,4,49,4],[48,4,50,4],[48,11,50,11],[48,12,50,12],[48,13,50,13],[48,15,50,15,"index_js_1"],[48,25,50,25],[48,26,50,26,"decodeU8aVec"],[48,38,50,38],[48,40,50,40,"registry"],[48,48,50,48],[48,50,50,50,"result"],[48,56,50,56],[48,58,50,58],[48,59,50,59],[48,60,50,60],[48,62,50,62,"util_1"],[48,68,50,68],[48,69,50,69,"u8aToU8a"],[48,77,50,77],[48,79,50,79,"value"],[48,84,50,84],[48,85,50,85],[48,87,50,87,"startAt"],[48,94,50,94],[48,96,50,96,"Type"],[48,100,50,100],[48,101,50,101],[49,2,51,0],[50,2,52,0],[51,0,53,0],[52,0,54,0],[53,0,55,0],[54,0,56,0],[55,0,57,0],[56,0,58,0],[57,2,59,0],[57,8,59,6,"Vec"],[57,11,59,9],[57,20,59,18,"Array_js_1"],[57,30,59,28],[57,31,59,29,"AbstractArray"],[57,44,59,42],[57,45,59,43],[58,4,60,4],[58,5,60,5,"Type"],[58,9,60,9],[59,4,61,4,"constructor"],[59,15,61,15,"constructor"],[59,16,61,16,"registry"],[59,24,61,24],[59,26,61,26,"Type"],[59,30,61,30],[59,32,61,32,"value"],[59,37,61,37],[59,40,61,40],[59,42,61,42],[59,44,61,44],[60,6,61,46,"definition"],[60,16,61,56],[61,6,61,58,"setDefinition"],[61,19,61,71],[61,22,61,74,"util_1"],[61,28,61,80],[61,29,61,81,"identity"],[62,4,61,90],[62,5,61,91],[62,8,61,94],[62,9,61,95],[62,10,61,96],[62,12,61,98],[63,6,62,8],[63,12,62,14],[63,13,62,15,"decodeFrom"],[63,23,62,25],[63,25,62,27,"length"],[63,31,62,33],[63,33,62,35,"startAt"],[63,40,62,42],[63,41,62,43],[63,44,62,46,"decodeVecLength"],[63,59,62,61],[63,60,62,62,"value"],[63,65,62,67],[63,66,62,68],[64,6,63,8],[64,11,63,13],[64,12,63,14,"registry"],[64,20,63,22],[64,22,63,24,"length"],[64,28,63,30],[64,29,63,31],[65,6,64,8],[65,10,64,12],[65,11,64,13],[65,12,64,14,"Type"],[65,16,64,18],[65,19,64,21,"definition"],[65,29,64,31],[65,33,64,35,"setDefinition"],[65,46,64,48],[65,47,64,49],[65,48,64,50],[65,49,64,51],[65,51,64,53,"index_js_1"],[65,61,64,63],[65,62,64,64,"typeToConstructor"],[65,79,64,81],[65,81,64,83,"registry"],[65,89,64,91],[65,91,64,93,"Type"],[65,95,64,97],[65,96,64,98],[65,97,64,99],[66,6,65,8],[66,10,65,12],[66,11,65,13,"initialU8aLength"],[66,27,65,29],[66,30,65,32],[66,31,65,33],[66,32,65,34],[66,33,65,35],[66,35,65,37,"util_1"],[66,41,65,43],[66,42,65,44,"isU8a"],[66,47,65,49],[66,49,65,51,"decodeFrom"],[66,59,65,61],[66,60,65,62],[66,63,66,14],[66,64,66,15],[66,65,66,16],[66,67,66,18,"index_js_1"],[66,77,66,28],[66,78,66,29,"decodeU8aVec"],[66,90,66,41],[66,92,66,43,"registry"],[66,100,66,51],[66,102,66,53],[66,106,66,57],[66,108,66,59,"decodeFrom"],[66,118,66,69],[66,120,66,71,"startAt"],[66,127,66,78],[66,129,66,80],[66,133,66,84],[66,134,66,85],[66,135,66,86,"Type"],[66,139,66,90],[66,140,66,91],[66,143,67,14,"decodeVec"],[66,152,67,23],[66,153,67,24,"registry"],[66,161,67,32],[66,163,67,34],[66,167,67,38],[66,169,67,40,"decodeFrom"],[66,179,67,50],[66,181,67,52,"startAt"],[66,188,67,59],[66,190,67,61],[66,194,67,65],[66,195,67,66],[66,196,67,67,"Type"],[66,200,67,71],[66,201,67,72],[66,203,67,74],[66,204,67,75],[66,205,67,76],[67,4,68,4],[68,4,69,4],[68,11,69,11,"with"],[68,15,69,15,"with"],[68,16,69,16,"Type"],[68,20,69,20],[68,22,69,22],[69,6,70,8],[69,10,70,12,"definition"],[69,20,70,22],[70,6,71,8],[71,6,72,8],[71,12,72,14,"setDefinition"],[71,25,72,27],[71,28,72,31,"d"],[71,29,72,32],[71,33,72,38,"definition"],[71,43,72,48],[71,46,72,51,"d"],[71,47,72,53],[72,6,73,8],[72,13,73,15],[72,27,73,29,"Vec"],[72,30,73,32],[72,31,73,33],[73,8,74,12,"constructor"],[73,19,74,23,"constructor"],[73,20,74,24,"registry"],[73,28,74,32],[73,30,74,34,"value"],[73,35,74,39],[73,37,74,41],[74,10,75,16],[74,15,75,21],[74,16,75,22,"registry"],[74,24,75,30],[74,26,75,32,"Type"],[74,30,75,36],[74,32,75,38,"value"],[74,37,75,43],[74,39,75,45],[75,12,75,47,"definition"],[75,22,75,57],[76,12,75,59,"setDefinition"],[77,10,75,73],[77,11,75,74],[77,12,75,75],[78,8,76,12],[79,6,77,8],[79,7,77,9],[80,4,78,4],[81,4,79,4],[82,0,80,0],[83,0,81,0],[84,4,82,4],[84,8,82,8,"Type"],[84,12,82,12,"Type"],[84,13,82,12],[84,15,82,15],[85,6,83,8],[85,13,83,15],[85,17,83,19],[85,18,83,20],[85,19,83,21,"Type"],[85,23,83,25],[85,24,83,26,"name"],[85,28,83,30],[86,4,84,4],[87,4,85,4],[88,0,86,0],[89,0,87,0],[90,4,88,4,"indexOf"],[90,11,88,11,"indexOf"],[90,12,88,12,"other"],[90,17,88,17],[90,19,88,19],[91,6,89,8],[92,6,90,8],[92,12,90,14,"check"],[92,17,90,19],[92,20,90,22,"other"],[92,25,90,27],[92,37,90,39],[92,41,90,43],[92,42,90,44],[92,43,90,45,"Type"],[92,47,90,49],[92,50,91,14,"other"],[92,55,91,19],[92,58,92,14],[92,62,92,18],[92,66,92,22],[92,67,92,23],[92,68,92,24,"Type"],[92,72,92,28],[92,73,92,29],[92,77,92,33],[92,78,92,34,"registry"],[92,86,92,42],[92,88,92,44,"other"],[92,93,92,49],[92,94,92,50],[93,6,93,8],[93,11,93,13],[93,15,93,17,"i"],[93,16,93,18],[93,19,93,21],[93,20,93,22],[93,22,93,24,"count"],[93,27,93,29],[93,30,93,32],[93,34,93,36],[93,35,93,37,"length"],[93,41,93,43],[93,43,93,45,"i"],[93,44,93,46],[93,47,93,49,"count"],[93,52,93,54],[93,54,93,56,"i"],[93,55,93,57],[93,57,93,59],[93,59,93,61],[94,8,94,12],[94,12,94,16,"check"],[94,17,94,21],[94,18,94,22,"eq"],[94,20,94,24],[94,21,94,25],[94,25,94,29],[94,26,94,30,"i"],[94,27,94,31],[94,28,94,32],[94,29,94,33],[94,31,94,35],[95,10,95,16],[95,17,95,23,"i"],[95,18,95,24],[96,8,96,12],[97,6,97,8],[98,6,98,8],[98,13,98,15],[98,14,98,16],[98,15,98,17],[99,4,99,4],[100,4,100,4],[101,0,101,0],[102,0,102,0],[103,4,103,4,"toRawType"],[103,13,103,13,"toRawType"],[103,14,103,13],[103,16,103,16],[104,6,104,8],[104,13,104,15],[104,20,104,22],[104,24,104,26],[104,25,104,27,"registry"],[104,33,104,35],[104,34,104,36,"getClassName"],[104,46,104,48],[104,47,104,49],[104,51,104,53],[104,52,104,54],[104,53,104,55,"Type"],[104,57,104,59],[104,58,104,60],[104,62,104,64],[104,66,104,68],[104,70,104,72],[104,71,104,73],[104,72,104,74,"Type"],[104,76,104,78],[104,77,104,79],[104,81,104,83],[104,82,104,84,"registry"],[104,90,104,92],[104,91,104,93],[104,92,104,94,"toRawType"],[104,101,104,103],[104,102,104,104],[104,103,104,105],[104,106,104,108],[105,4,105,4],[106,2,106,0],[107,2,107,0,"exports"],[107,9,107,7],[107,10,107,8,"Vec"],[107,13,107,11],[107,16,107,14,"Vec"],[107,19,107,17],[108,0,107,18],[108,3]],"functionMap":{"names":["<global>","decodeVecLength","decodeVec","Vec","constructor","_with","setDefinition","<anonymous>","get__Type","indexOf","toRawType"],"mappings":"AAA;ACS;CDgB;AEC;CFwB;AGQ;ICE;KDO;IEC;8BCG,uBD;eEC;YHC;aGE;SFC;KFC;IKI;KLE;IMI;KNW;IOI;KPE;CHC"},"hasCjsExports":true},"type":"js/module"}]} |