mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 06:31:03 +00:00
1 line
9.5 KiB
Plaintext
1 line
9.5 KiB
Plaintext
{"dependencies":[{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":65,"index":65}}],"key":"ISHU1ovvPMrCldqRjtd1JhW9dyo=","exportNames":["*"],"imports":1}},{"name":"../../bn.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":2,"column":0,"index":66},"end":{"line":2,"column":44,"index":110}}],"key":"AqMAkL2+aQpxj6Ec25gB/czctb4=","exportNames":["*"],"imports":1}},{"name":"../../hmac/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":111},"end":{"line":3,"column":51,"index":162}}],"key":"18UlrcnrnFmFiaIzCTZFlLAsbTY=","exportNames":["*"],"imports":1}},{"name":"../../secp256k1/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":4,"column":0,"index":163},"end":{"line":4,"column":94,"index":257}}],"key":"OzEoVMd6eyi1RXo4bBfYirp+MAg=","exportNames":["*"],"imports":1}},{"name":"../validatePath.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":5,"column":0,"index":258},"end":{"line":5,"column":62,"index":320}}],"key":"6zpYpw1C5elqpVDvznyoTEjNTt4=","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 var _polkadotUtil = require(_dependencyMap[0], \"@polkadot/util\");\n var _bnJs = require(_dependencyMap[1], \"../../bn.js\");\n var _hmacIndexJs = require(_dependencyMap[2], \"../../hmac/index.js\");\n var _secp256k1IndexJs = require(_dependencyMap[3], \"../../secp256k1/index.js\");\n var _validatePathJs = require(_dependencyMap[4], \"../validatePath.js\");\n const MASTER_SECRET = (0, _polkadotUtil.stringToU8a)('Bitcoin seed');\n function createCoded(secretKey, chainCode) {\n return {\n chainCode,\n publicKey: (0, _secp256k1IndexJs.secp256k1PairFromSeed)(secretKey).publicKey,\n secretKey\n };\n }\n function deriveChild(hd, index) {\n const indexBuffer = (0, _polkadotUtil.bnToU8a)(index, _bnJs.BN_BE_32_OPTS);\n const data = index >= _validatePathJs.HARDENED ? (0, _polkadotUtil.u8aConcat)(new Uint8Array(1), hd.secretKey, indexBuffer) : (0, _polkadotUtil.u8aConcat)(hd.publicKey, indexBuffer);\n try {\n const I = (0, _hmacIndexJs.hmacShaAsU8a)(hd.chainCode, data, 512);\n return createCoded((0, _secp256k1IndexJs.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, _hmacIndexJs.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, _validatePathJs.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(\"'\") ? _validatePathJs.HARDENED : 0));\n }\n return hd;\n }\n});","lineCount":47,"map":[[7,2,28,0,"exports"],[7,9,28,0],[7,10,28,0,"hdEthereum"],[7,20,28,0],[7,23,28,0,"hdEthereum"],[7,33,28,0],[8,2,1,0],[8,6,1,0,"_polkadotUtil"],[8,19,1,0],[8,22,1,0,"require"],[8,29,1,0],[8,30,1,0,"_dependencyMap"],[8,44,1,0],[9,2,2,0],[9,6,2,0,"_bnJs"],[9,11,2,0],[9,14,2,0,"require"],[9,21,2,0],[9,22,2,0,"_dependencyMap"],[9,36,2,0],[10,2,3,0],[10,6,3,0,"_hmacIndexJs"],[10,18,3,0],[10,21,3,0,"require"],[10,28,3,0],[10,29,3,0,"_dependencyMap"],[10,43,3,0],[11,2,4,0],[11,6,4,0,"_secp256k1IndexJs"],[11,23,4,0],[11,26,4,0,"require"],[11,33,4,0],[11,34,4,0,"_dependencyMap"],[11,48,4,0],[12,2,5,0],[12,6,5,0,"_validatePathJs"],[12,21,5,0],[12,24,5,0,"require"],[12,31,5,0],[12,32,5,0,"_dependencyMap"],[12,46,5,0],[13,2,6,0],[13,8,6,6,"MASTER_SECRET"],[13,21,6,19],[13,24,6,22],[13,28,6,22,"stringToU8a"],[13,41,6,33],[13,42,6,33,"stringToU8a"],[13,53,6,33],[13,55,6,34],[13,69,6,48],[13,70,6,49],[14,2,7,0],[14,11,7,9,"createCoded"],[14,22,7,20,"createCoded"],[14,23,7,21,"secretKey"],[14,32,7,30],[14,34,7,32,"chainCode"],[14,43,7,41],[14,45,7,43],[15,4,8,4],[15,11,8,11],[16,6,9,8,"chainCode"],[16,15,9,17],[17,6,10,8,"publicKey"],[17,15,10,17],[17,17,10,19],[17,21,10,19,"secp256k1PairFromSeed"],[17,38,10,40],[17,39,10,40,"secp256k1PairFromSeed"],[17,60,10,40],[17,62,10,41,"secretKey"],[17,71,10,50],[17,72,10,51],[17,73,10,52,"publicKey"],[17,82,10,61],[18,6,11,8,"secretKey"],[19,4,12,4],[19,5,12,5],[20,2,13,0],[21,2,14,0],[21,11,14,9,"deriveChild"],[21,22,14,20,"deriveChild"],[21,23,14,21,"hd"],[21,25,14,23],[21,27,14,25,"index"],[21,32,14,30],[21,34,14,32],[22,4,15,4],[22,10,15,10,"indexBuffer"],[22,21,15,21],[22,24,15,24],[22,28,15,24,"bnToU8a"],[22,41,15,31],[22,42,15,31,"bnToU8a"],[22,49,15,31],[22,51,15,32,"index"],[22,56,15,37],[22,58,15,39,"BN_BE_32_OPTS"],[22,63,15,52],[22,64,15,52,"BN_BE_32_OPTS"],[22,77,15,52],[22,78,15,53],[23,4,16,4],[23,10,16,10,"data"],[23,14,16,14],[23,17,16,17,"index"],[23,22,16,22],[23,26,16,26,"HARDENED"],[23,41,16,34],[23,42,16,34,"HARDENED"],[23,50,16,34],[23,53,17,10],[23,57,17,10,"u8aConcat"],[23,70,17,19],[23,71,17,19,"u8aConcat"],[23,80,17,19],[23,82,17,20],[23,86,17,24,"Uint8Array"],[23,96,17,34],[23,97,17,35],[23,98,17,36],[23,99,17,37],[23,101,17,39,"hd"],[23,103,17,41],[23,104,17,42,"secretKey"],[23,113,17,51],[23,115,17,53,"indexBuffer"],[23,126,17,64],[23,127,17,65],[23,130,18,10],[23,134,18,10,"u8aConcat"],[23,147,18,19],[23,148,18,19,"u8aConcat"],[23,157,18,19],[23,159,18,20,"hd"],[23,161,18,22],[23,162,18,23,"publicKey"],[23,171,18,32],[23,173,18,34,"indexBuffer"],[23,184,18,45],[23,185,18,46],[24,4,19,4],[24,8,19,8],[25,6,20,8],[25,12,20,14,"I"],[25,13,20,15],[25,16,20,18],[25,20,20,18,"hmacShaAsU8a"],[25,32,20,30],[25,33,20,30,"hmacShaAsU8a"],[25,45,20,30],[25,47,20,31,"hd"],[25,49,20,33],[25,50,20,34,"chainCode"],[25,59,20,43],[25,61,20,45,"data"],[25,65,20,49],[25,67,20,51],[25,70,20,54],[25,71,20,55],[26,6,21,8],[26,13,21,15,"createCoded"],[26,24,21,26],[26,25,21,27],[26,29,21,27,"secp256k1PrivateKeyTweakAdd"],[26,46,21,54],[26,47,21,54,"secp256k1PrivateKeyTweakAdd"],[26,74,21,54],[26,76,21,55,"hd"],[26,78,21,57],[26,79,21,58,"secretKey"],[26,88,21,67],[26,90,21,69,"I"],[26,91,21,70],[26,92,21,71,"slice"],[26,97,21,76],[26,98,21,77],[26,99,21,78],[26,101,21,80],[26,103,21,82],[26,104,21,83],[26,105,21,84],[26,107,21,86,"I"],[26,108,21,87],[26,109,21,88,"slice"],[26,114,21,93],[26,115,21,94],[26,117,21,96],[26,118,21,97],[26,119,21,98],[27,4,22,4],[27,5,22,5],[27,6,23,4],[27,12,23,10],[28,6,24,8],[29,6,25,8],[29,13,25,15,"deriveChild"],[29,24,25,26],[29,25,25,27,"hd"],[29,27,25,29],[29,29,25,31,"index"],[29,34,25,36],[29,37,25,39],[29,38,25,40],[29,39,25,41],[30,4,26,4],[31,2,27,0],[32,2,28,7],[32,11,28,16,"hdEthereum"],[32,21,28,26,"hdEthereum"],[32,22,28,27,"seed"],[32,26,28,31],[32,28,28,33,"path"],[32,32,28,37],[32,35,28,40],[32,37,28,42],[32,39,28,44],[33,4,29,4],[33,10,29,10,"I"],[33,11,29,11],[33,14,29,14],[33,18,29,14,"hmacShaAsU8a"],[33,30,29,26],[33,31,29,26,"hmacShaAsU8a"],[33,43,29,26],[33,45,29,27,"MASTER_SECRET"],[33,58,29,40],[33,60,29,42,"seed"],[33,64,29,46],[33,66,29,48],[33,69,29,51],[33,70,29,52],[34,4,30,4],[34,8,30,8,"hd"],[34,10,30,10],[34,13,30,13,"createCoded"],[34,24,30,24],[34,25,30,25,"I"],[34,26,30,26],[34,27,30,27,"slice"],[34,32,30,32],[34,33,30,33],[34,34,30,34],[34,36,30,36],[34,38,30,38],[34,39,30,39],[34,41,30,41,"I"],[34,42,30,42],[34,43,30,43,"slice"],[34,48,30,48],[34,49,30,49],[34,51,30,51],[34,52,30,52],[34,53,30,53],[35,4,31,4],[35,8,31,8],[35,9,31,9,"path"],[35,13,31,13],[35,17,31,17,"path"],[35,21,31,21],[35,26,31,26],[35,29,31,29],[35,33,31,33,"path"],[35,37,31,37],[35,42,31,42],[35,45,31,45],[35,49,31,49,"path"],[35,53,31,53],[35,58,31,58],[35,62,31,62],[35,66,31,66,"path"],[35,70,31,70],[35,75,31,75],[35,79,31,79],[35,81,31,81],[36,6,32,8],[36,13,32,15,"hd"],[36,15,32,17],[37,4,33,4],[38,4,34,4],[38,8,34,8],[38,9,34,9],[38,13,34,9,"hdValidatePath"],[38,28,34,23],[38,29,34,23,"hdValidatePath"],[38,43,34,23],[38,45,34,24,"path"],[38,49,34,28],[38,50,34,29],[38,52,34,31],[39,6,35,8],[39,12,35,14],[39,16,35,18,"Error"],[39,21,35,23],[39,22,35,24],[39,47,35,49],[39,48,35,50],[40,4,36,4],[41,4,37,4],[41,10,37,10,"parts"],[41,15,37,15],[41,18,37,18,"path"],[41,22,37,22],[41,23,37,23,"split"],[41,28,37,28],[41,29,37,29],[41,32,37,32],[41,33,37,33],[41,34,37,34,"slice"],[41,39,37,39],[41,40,37,40],[41,41,37,41],[41,42,37,42],[42,4,38,4],[42,9,38,9],[42,15,38,15,"p"],[42,16,38,16],[42,20,38,20,"parts"],[42,25,38,25],[42,27,38,27],[43,6,39,8,"hd"],[43,8,39,10],[43,11,39,13,"deriveChild"],[43,22,39,24],[43,23,39,25,"hd"],[43,25,39,27],[43,27,39,29,"parseInt"],[43,35,39,37],[43,36,39,38,"p"],[43,37,39,39],[43,39,39,41],[43,41,39,43],[43,42,39,44],[43,46,39,49,"p"],[43,47,39,50],[43,48,39,51,"length"],[43,54,39,57],[43,57,39,60],[43,58,39,61],[43,62,39,66,"p"],[43,63,39,67],[43,64,39,68,"endsWith"],[43,72,39,76],[43,73,39,77],[43,76,39,80],[43,77,39,81],[43,80,40,14,"HARDENED"],[43,95,40,22],[43,96,40,22,"HARDENED"],[43,104,40,22],[43,107,41,14],[43,108,41,15],[43,109,41,16],[43,110,41,17],[44,4,42,4],[45,4,43,4],[45,11,43,11,"hd"],[45,13,43,13],[46,2,44,0],[47,0,44,1],[47,3]],"functionMap":{"names":["<global>","createCoded","deriveChild","hdEthereum"],"mappings":"AAA;ACM;CDM;AEC;CFa;OGC;CHgB"},"hasCjsExports":false},"type":"js/module"}]} |