{"version":3,"sources":["jsdelivr-header.js","/npm/@voken/hd-wallet@1.3.2/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,MAAQ,QAAQ,SAChB,OAAS,QAAQ,iBACjB,aAAe,QAAQ,kBAEvB,OAAS,SAAU,GACvB,IAAK,OAAO,SAAS,GACnB,MAAM,UAAU,2CAGlB,KAAK,UAAY,MAAM,eAAe,GAEtC,KAAK,OAAS,SAAU,GACtB,MAAM,EAAO,KAAK,MAAM,GAClB,EAAQ,KAAK,UAAU,OAAO,GACpC,MAAO,CACL,MAAO,EACP,KAAM,EACN,MAAO,EACP,MAAO,QAAU,OAAO,OAAO,EAAM,YACrC,KAAM,OAAS,OAAO,OAAO,EAAM,WACnC,QAAS,aAAa,cAAc,EAAM,WAE9C,EAEA,KAAK,MAAQ,SAAU,GACrB,MAAO,mBAAqB,CAC9B,CACF,EAEA,OAAO,QAAU","file":"/npm/@voken/hd-wallet@1.3.2/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@voken/hd-wallet@1.3.2/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const HDKey = require('hdkey')\r\nconst base32 = require('@voken/base32')\r\nconst vokenAddress = require('@voken/address')\r\n\r\nconst Wallet = function (seedBuffer) {\r\n  if (!Buffer.isBuffer(seedBuffer)) {\r\n    throw TypeError('`seedBuffer` must be a `Buffer` object.')\r\n  }\r\n\r\n  this.rootHDKey = HDKey.fromMasterSeed(seedBuffer)\r\n\r\n  this.derive = function (i) {\r\n    const path = this._path(i)\r\n    const hdKey = this.rootHDKey.derive(path)\r\n    return {\r\n      index: i,\r\n      path: path,\r\n      hdKey: hdKey,\r\n      vpriv: 'vpriv' + base32.encode(hdKey.privateKey),\r\n      vpub: 'vpub' + base32.encode(hdKey.publicKey),\r\n      address: vokenAddress.fromPublicKey(hdKey.publicKey)\r\n    }\r\n  }\r\n\r\n  this._path = function (index) {\r\n    return \"m/44'/678'/0'/0/\" + index\r\n  }\r\n}\r\n\r\nmodule.exports = Wallet\r\n"]}