{"dependencies":[{"name":"../key/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":4,"column":19,"index":135},"end":{"line":4,"column":45,"index":161}}],"key":"yFQXkPkkkalb4eM03iFjbY8kBS8=","exportNames":["*"],"imports":1}},{"name":"../sr25519/index.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":19,"index":182},"end":{"line":5,"column":49,"index":212}}],"key":"oXpdIbLCYUaE/PBMrGkthdOf8+w=","exportNames":["*"],"imports":1}},{"name":"./decode.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":20,"index":234},"end":{"line":6,"column":42,"index":256}}],"key":"NjDZuONZNxCfNbNOGpYxcMs1w6o=","exportNames":["*"],"imports":1}},{"name":"./encode.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":7,"column":20,"index":278},"end":{"line":7,"column":42,"index":300}}],"key":"6FztT/DfTVBhkTe+9OSAQ47EebM=","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.deriveAddress = deriveAddress;\n const index_js_1 = require(_dependencyMap[0], \"../key/index.js\");\n const index_js_2 = require(_dependencyMap[1], \"../sr25519/index.js\");\n const decode_js_1 = require(_dependencyMap[2], \"./decode.js\");\n const encode_js_1 = require(_dependencyMap[3], \"./encode.js\");\n function filterHard({\n isHard\n }) {\n return isHard;\n }\n /**\n * @name deriveAddress\n * @summary Creates a sr25519 derived address from the supplied and path.\n * @description\n * Creates a sr25519 derived address based on the input address/publicKey and the uri supplied.\n */\n function deriveAddress(who, suri, ss58Format) {\n const {\n path\n } = (0, index_js_1.keyExtractPath)(suri);\n if (!path.length || path.every(filterHard)) {\n throw new Error('Expected suri to contain a combination of non-hard paths');\n }\n let publicKey = (0, decode_js_1.decodeAddress)(who);\n for (const {\n chainCode\n } of path) {\n publicKey = (0, index_js_2.sr25519DerivePublic)(publicKey, chainCode);\n }\n return (0, encode_js_1.encodeAddress)(publicKey, ss58Format);\n }\n});","lineCount":38,"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,"deriveAddress"],[7,23,3,21],[7,26,3,24,"deriveAddress"],[7,39,3,37],[8,2,4,0],[8,8,4,6,"index_js_1"],[8,18,4,16],[8,21,4,19,"require"],[8,28,4,26],[8,29,4,26,"_dependencyMap"],[8,43,4,26],[8,65,4,44],[8,66,4,45],[9,2,5,0],[9,8,5,6,"index_js_2"],[9,18,5,16],[9,21,5,19,"require"],[9,28,5,26],[9,29,5,26,"_dependencyMap"],[9,43,5,26],[9,69,5,48],[9,70,5,49],[10,2,6,0],[10,8,6,6,"decode_js_1"],[10,19,6,17],[10,22,6,20,"require"],[10,29,6,27],[10,30,6,27,"_dependencyMap"],[10,44,6,27],[10,62,6,41],[10,63,6,42],[11,2,7,0],[11,8,7,6,"encode_js_1"],[11,19,7,17],[11,22,7,20,"require"],[11,29,7,27],[11,30,7,27,"_dependencyMap"],[11,44,7,27],[11,62,7,41],[11,63,7,42],[12,2,8,0],[12,11,8,9,"filterHard"],[12,21,8,19,"filterHard"],[12,22,8,20],[13,4,8,22,"isHard"],[14,2,8,29],[14,3,8,30],[14,5,8,32],[15,4,9,4],[15,11,9,11,"isHard"],[15,17,9,17],[16,2,10,0],[17,2,11,0],[18,0,12,0],[19,0,13,0],[20,0,14,0],[21,0,15,0],[22,0,16,0],[23,2,17,0],[23,11,17,9,"deriveAddress"],[23,24,17,22,"deriveAddress"],[23,25,17,23,"who"],[23,28,17,26],[23,30,17,28,"suri"],[23,34,17,32],[23,36,17,34,"ss58Format"],[23,46,17,44],[23,48,17,46],[24,4,18,4],[24,10,18,10],[25,6,18,12,"path"],[26,4,18,17],[26,5,18,18],[26,8,18,21],[26,9,18,22],[26,10,18,23],[26,12,18,25,"index_js_1"],[26,22,18,35],[26,23,18,36,"keyExtractPath"],[26,37,18,50],[26,39,18,52,"suri"],[26,43,18,56],[26,44,18,57],[27,4,19,4],[27,8,19,8],[27,9,19,9,"path"],[27,13,19,13],[27,14,19,14,"length"],[27,20,19,20],[27,24,19,24,"path"],[27,28,19,28],[27,29,19,29,"every"],[27,34,19,34],[27,35,19,35,"filterHard"],[27,45,19,45],[27,46,19,46],[27,48,19,48],[28,6,20,8],[28,12,20,14],[28,16,20,18,"Error"],[28,21,20,23],[28,22,20,24],[28,80,20,82],[28,81,20,83],[29,4,21,4],[30,4,22,4],[30,8,22,8,"publicKey"],[30,17,22,17],[30,20,22,20],[30,21,22,21],[30,22,22,22],[30,24,22,24,"decode_js_1"],[30,35,22,35],[30,36,22,36,"decodeAddress"],[30,49,22,49],[30,51,22,51,"who"],[30,54,22,54],[30,55,22,55],[31,4,23,4],[31,9,23,9],[31,15,23,15],[32,6,23,17,"chainCode"],[33,4,23,27],[33,5,23,28],[33,9,23,32,"path"],[33,13,23,36],[33,15,23,38],[34,6,24,8,"publicKey"],[34,15,24,17],[34,18,24,20],[34,19,24,21],[34,20,24,22],[34,22,24,24,"index_js_2"],[34,32,24,34],[34,33,24,35,"sr25519DerivePublic"],[34,52,24,54],[34,54,24,56,"publicKey"],[34,63,24,65],[34,65,24,67,"chainCode"],[34,74,24,76],[34,75,24,77],[35,4,25,4],[36,4,26,4],[36,11,26,11],[36,12,26,12],[36,13,26,13],[36,15,26,15,"encode_js_1"],[36,26,26,26],[36,27,26,27,"encodeAddress"],[36,40,26,40],[36,42,26,42,"publicKey"],[36,51,26,51],[36,53,26,53,"ss58Format"],[36,63,26,63],[36,64,26,64],[37,2,27,0],[38,0,27,1],[38,3]],"functionMap":{"names":["","filterHard","deriveAddress"],"mappings":"AAA;ACO;CDE;AEO;CFU"},"hasCjsExports":true},"type":"js/module"}]}