mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 08:51:01 +00:00
1 line
10 KiB
Plaintext
1 line
10 KiB
Plaintext
{"dependencies":[{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":4,"column":15,"index":125},"end":{"line":4,"column":40,"index":150}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}},{"name":"../../bn.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":16,"index":168},"end":{"line":5,"column":38,"index":190}}],"key":"KpyQTnSc+lume/ty+bkuhKxhDyc=","exportNames":["*"],"imports":1}},{"name":"../../hmac/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":19,"index":211},"end":{"line":6,"column":49,"index":241}}],"key":"xomgSIlDVXaL2DeB/qi8teJfUFI=","exportNames":["*"],"imports":1}},{"name":"../../secp256k1/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":7,"column":19,"index":262},"end":{"line":7,"column":54,"index":297}}],"key":"4D8Nzq9B2rc/fg/SEdnt6zLJFjk=","exportNames":["*"],"imports":1}},{"name":"../validatePath.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":8,"column":26,"index":325},"end":{"line":8,"column":55,"index":354}}],"key":"dVLuLIlI76M8kErTJUVVKA9ve1I=","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.hdEthereum = hdEthereum;\n const util_1 = require(_dependencyMap[0], \"@polkadot/util\");\n const bn_js_1 = require(_dependencyMap[1], \"../../bn.js\");\n const index_js_1 = require(_dependencyMap[2], \"../../hmac/index.js\");\n const index_js_2 = require(_dependencyMap[3], \"../../secp256k1/index.js\");\n const validatePath_js_1 = require(_dependencyMap[4], \"../validatePath.js\");\n const MASTER_SECRET = (0, util_1.stringToU8a)('Bitcoin seed');\n function createCoded(secretKey, chainCode) {\n return {\n chainCode,\n publicKey: (0, index_js_2.secp256k1PairFromSeed)(secretKey).publicKey,\n secretKey\n };\n }\n function deriveChild(hd, index) {\n const indexBuffer = (0, util_1.bnToU8a)(index, bn_js_1.BN_BE_32_OPTS);\n const data = index >= validatePath_js_1.HARDENED ? (0, util_1.u8aConcat)(new Uint8Array(1), hd.secretKey, indexBuffer) : (0, util_1.u8aConcat)(hd.publicKey, indexBuffer);\n try {\n const I = (0, index_js_1.hmacShaAsU8a)(hd.chainCode, data, 512);\n return createCoded((0, index_js_2.secp256k1PrivateKeyTweakAdd)(hd.secretKey, I.slice(0, 32)), I.slice(32));\n } catch {\n // In case parse256(IL) >= n or ki == 0, proceed with the next value for i\n return deriveChild(hd, index + 1);\n }\n }\n function hdEthereum(seed, path = '') {\n const I = (0, index_js_1.hmacShaAsU8a)(MASTER_SECRET, seed, 512);\n let hd = createCoded(I.slice(0, 32), I.slice(32));\n if (!path || path === 'm' || path === 'M' || path === \"m'\" || path === \"M'\") {\n return hd;\n }\n if (!(0, validatePath_js_1.hdValidatePath)(path)) {\n throw new Error('Invalid derivation path');\n }\n const parts = path.split('/').slice(1);\n for (const p of parts) {\n hd = deriveChild(hd, parseInt(p, 10) + (p.length > 1 && p.endsWith(\"'\") ? validatePath_js_1.HARDENED : 0));\n }\n return hd;\n }\n});","lineCount":47,"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,"hdEthereum"],[7,20,3,18],[7,23,3,21,"hdEthereum"],[7,33,3,31],[8,2,4,0],[8,8,4,6,"util_1"],[8,14,4,12],[8,17,4,15,"require"],[8,24,4,22],[8,25,4,22,"_dependencyMap"],[8,39,4,22],[8,60,4,39],[8,61,4,40],[9,2,5,0],[9,8,5,6,"bn_js_1"],[9,15,5,13],[9,18,5,16,"require"],[9,25,5,23],[9,26,5,23,"_dependencyMap"],[9,40,5,23],[9,58,5,37],[9,59,5,38],[10,2,6,0],[10,8,6,6,"index_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,69,6,48],[10,70,6,49],[11,2,7,0],[11,8,7,6,"index_js_2"],[11,18,7,16],[11,21,7,19,"require"],[11,28,7,26],[11,29,7,26,"_dependencyMap"],[11,43,7,26],[11,74,7,53],[11,75,7,54],[12,2,8,0],[12,8,8,6,"validatePath_js_1"],[12,25,8,23],[12,28,8,26,"require"],[12,35,8,33],[12,36,8,33,"_dependencyMap"],[12,50,8,33],[12,75,8,54],[12,76,8,55],[13,2,9,0],[13,8,9,6,"MASTER_SECRET"],[13,21,9,19],[13,24,9,22],[13,25,9,23],[13,26,9,24],[13,28,9,26,"util_1"],[13,34,9,32],[13,35,9,33,"stringToU8a"],[13,46,9,44],[13,48,9,46],[13,62,9,60],[13,63,9,61],[14,2,10,0],[14,11,10,9,"createCoded"],[14,22,10,20,"createCoded"],[14,23,10,21,"secretKey"],[14,32,10,30],[14,34,10,32,"chainCode"],[14,43,10,41],[14,45,10,43],[15,4,11,4],[15,11,11,11],[16,6,12,8,"chainCode"],[16,15,12,17],[17,6,13,8,"publicKey"],[17,15,13,17],[17,17,13,19],[17,18,13,20],[17,19,13,21],[17,21,13,23,"index_js_2"],[17,31,13,33],[17,32,13,34,"secp256k1PairFromSeed"],[17,53,13,55],[17,55,13,57,"secretKey"],[17,64,13,66],[17,65,13,67],[17,66,13,68,"publicKey"],[17,75,13,77],[18,6,14,8,"secretKey"],[19,4,15,4],[19,5,15,5],[20,2,16,0],[21,2,17,0],[21,11,17,9,"deriveChild"],[21,22,17,20,"deriveChild"],[21,23,17,21,"hd"],[21,25,17,23],[21,27,17,25,"index"],[21,32,17,30],[21,34,17,32],[22,4,18,4],[22,10,18,10,"indexBuffer"],[22,21,18,21],[22,24,18,24],[22,25,18,25],[22,26,18,26],[22,28,18,28,"util_1"],[22,34,18,34],[22,35,18,35,"bnToU8a"],[22,42,18,42],[22,44,18,44,"index"],[22,49,18,49],[22,51,18,51,"bn_js_1"],[22,58,18,58],[22,59,18,59,"BN_BE_32_OPTS"],[22,72,18,72],[22,73,18,73],[23,4,19,4],[23,10,19,10,"data"],[23,14,19,14],[23,17,19,17,"index"],[23,22,19,22],[23,26,19,26,"validatePath_js_1"],[23,43,19,43],[23,44,19,44,"HARDENED"],[23,52,19,52],[23,55,20,10],[23,56,20,11],[23,57,20,12],[23,59,20,14,"util_1"],[23,65,20,20],[23,66,20,21,"u8aConcat"],[23,75,20,30],[23,77,20,32],[23,81,20,36,"Uint8Array"],[23,91,20,46],[23,92,20,47],[23,93,20,48],[23,94,20,49],[23,96,20,51,"hd"],[23,98,20,53],[23,99,20,54,"secretKey"],[23,108,20,63],[23,110,20,65,"indexBuffer"],[23,121,20,76],[23,122,20,77],[23,125,21,10],[23,126,21,11],[23,127,21,12],[23,129,21,14,"util_1"],[23,135,21,20],[23,136,21,21,"u8aConcat"],[23,145,21,30],[23,147,21,32,"hd"],[23,149,21,34],[23,150,21,35,"publicKey"],[23,159,21,44],[23,161,21,46,"indexBuffer"],[23,172,21,57],[23,173,21,58],[24,4,22,4],[24,8,22,8],[25,6,23,8],[25,12,23,14,"I"],[25,13,23,15],[25,16,23,18],[25,17,23,19],[25,18,23,20],[25,20,23,22,"index_js_1"],[25,30,23,32],[25,31,23,33,"hmacShaAsU8a"],[25,43,23,45],[25,45,23,47,"hd"],[25,47,23,49],[25,48,23,50,"chainCode"],[25,57,23,59],[25,59,23,61,"data"],[25,63,23,65],[25,65,23,67],[25,68,23,70],[25,69,23,71],[26,6,24,8],[26,13,24,15,"createCoded"],[26,24,24,26],[26,25,24,27],[26,26,24,28],[26,27,24,29],[26,29,24,31,"index_js_2"],[26,39,24,41],[26,40,24,42,"secp256k1PrivateKeyTweakAdd"],[26,67,24,69],[26,69,24,71,"hd"],[26,71,24,73],[26,72,24,74,"secretKey"],[26,81,24,83],[26,83,24,85,"I"],[26,84,24,86],[26,85,24,87,"slice"],[26,90,24,92],[26,91,24,93],[26,92,24,94],[26,94,24,96],[26,96,24,98],[26,97,24,99],[26,98,24,100],[26,100,24,102,"I"],[26,101,24,103],[26,102,24,104,"slice"],[26,107,24,109],[26,108,24,110],[26,110,24,112],[26,111,24,113],[26,112,24,114],[27,4,25,4],[27,5,25,5],[27,6,26,4],[27,12,26,10],[28,6,27,8],[29,6,28,8],[29,13,28,15,"deriveChild"],[29,24,28,26],[29,25,28,27,"hd"],[29,27,28,29],[29,29,28,31,"index"],[29,34,28,36],[29,37,28,39],[29,38,28,40],[29,39,28,41],[30,4,29,4],[31,2,30,0],[32,2,31,0],[32,11,31,9,"hdEthereum"],[32,21,31,19,"hdEthereum"],[32,22,31,20,"seed"],[32,26,31,24],[32,28,31,26,"path"],[32,32,31,30],[32,35,31,33],[32,37,31,35],[32,39,31,37],[33,4,32,4],[33,10,32,10,"I"],[33,11,32,11],[33,14,32,14],[33,15,32,15],[33,16,32,16],[33,18,32,18,"index_js_1"],[33,28,32,28],[33,29,32,29,"hmacShaAsU8a"],[33,41,32,41],[33,43,32,43,"MASTER_SECRET"],[33,56,32,56],[33,58,32,58,"seed"],[33,62,32,62],[33,64,32,64],[33,67,32,67],[33,68,32,68],[34,4,33,4],[34,8,33,8,"hd"],[34,10,33,10],[34,13,33,13,"createCoded"],[34,24,33,24],[34,25,33,25,"I"],[34,26,33,26],[34,27,33,27,"slice"],[34,32,33,32],[34,33,33,33],[34,34,33,34],[34,36,33,36],[34,38,33,38],[34,39,33,39],[34,41,33,41,"I"],[34,42,33,42],[34,43,33,43,"slice"],[34,48,33,48],[34,49,33,49],[34,51,33,51],[34,52,33,52],[34,53,33,53],[35,4,34,4],[35,8,34,8],[35,9,34,9,"path"],[35,13,34,13],[35,17,34,17,"path"],[35,21,34,21],[35,26,34,26],[35,29,34,29],[35,33,34,33,"path"],[35,37,34,37],[35,42,34,42],[35,45,34,45],[35,49,34,49,"path"],[35,53,34,53],[35,58,34,58],[35,62,34,62],[35,66,34,66,"path"],[35,70,34,70],[35,75,34,75],[35,79,34,79],[35,81,34,81],[36,6,35,8],[36,13,35,15,"hd"],[36,15,35,17],[37,4,36,4],[38,4,37,4],[38,8,37,8],[38,9,37,9],[38,10,37,10],[38,11,37,11],[38,13,37,13,"validatePath_js_1"],[38,30,37,30],[38,31,37,31,"hdValidatePath"],[38,45,37,45],[38,47,37,47,"path"],[38,51,37,51],[38,52,37,52],[38,54,37,54],[39,6,38,8],[39,12,38,14],[39,16,38,18,"Error"],[39,21,38,23],[39,22,38,24],[39,47,38,49],[39,48,38,50],[40,4,39,4],[41,4,40,4],[41,10,40,10,"parts"],[41,15,40,15],[41,18,40,18,"path"],[41,22,40,22],[41,23,40,23,"split"],[41,28,40,28],[41,29,40,29],[41,32,40,32],[41,33,40,33],[41,34,40,34,"slice"],[41,39,40,39],[41,40,40,40],[41,41,40,41],[41,42,40,42],[42,4,41,4],[42,9,41,9],[42,15,41,15,"p"],[42,16,41,16],[42,20,41,20,"parts"],[42,25,41,25],[42,27,41,27],[43,6,42,8,"hd"],[43,8,42,10],[43,11,42,13,"deriveChild"],[43,22,42,24],[43,23,42,25,"hd"],[43,25,42,27],[43,27,42,29,"parseInt"],[43,35,42,37],[43,36,42,38,"p"],[43,37,42,39],[43,39,42,41],[43,41,42,43],[43,42,42,44],[43,46,42,49,"p"],[43,47,42,50],[43,48,42,51,"length"],[43,54,42,57],[43,57,42,60],[43,58,42,61],[43,62,42,66,"p"],[43,63,42,67],[43,64,42,68,"endsWith"],[43,72,42,76],[43,73,42,77],[43,76,42,80],[43,77,42,81],[43,80,43,14,"validatePath_js_1"],[43,97,43,31],[43,98,43,32,"HARDENED"],[43,106,43,40],[43,109,44,14],[43,110,44,15],[43,111,44,16],[43,112,44,17],[44,4,45,4],[45,4,46,4],[45,11,46,11,"hd"],[45,13,46,13],[46,2,47,0],[47,0,47,1],[47,3]],"functionMap":{"names":["<global>","createCoded","deriveChild","hdEthereum"],"mappings":"AAA;ACS;CDM;AEC;CFa;AGC;CHgB"},"hasCjsExports":true},"type":"js/module"}]} |