Comparing version 0.0.3 to 0.0.4
44
index.js
@@ -1,5 +0,16 @@ | ||
System.register([], function (exports_1, context_1) { | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
var HDKey, bitcoin, bip39, assert; | ||
var __moduleName = context_1 && context_1.id; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const HDKey = require('hdkey'); | ||
const bitcoin = require('bitcoinjs-lib'); | ||
const bip39 = require('bip39'); | ||
const assert = require('bsert'); | ||
/** | ||
@@ -11,3 +22,3 @@ * Generate a BIP39 menemonic | ||
} | ||
exports_1("randomMenemonic", randomMenemonic); | ||
exports.randomMenemonic = randomMenemonic; | ||
/** | ||
@@ -21,3 +32,3 @@ * Generate a pseudo-random seed from BIP39 menemonic | ||
} | ||
exports_1("seedFromMenemonic", seedFromMenemonic); | ||
exports.seedFromMenemonic = seedFromMenemonic; | ||
/** | ||
@@ -40,3 +51,3 @@ * Derive an extended keypair from seed | ||
} | ||
exports_1("deriveAccount", deriveAccount); | ||
exports.deriveAccount = deriveAccount; | ||
//doc https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki | ||
@@ -71,3 +82,3 @@ //lib https://github.com/cryptocoinjs/hdkey | ||
} | ||
exports_1("generateAddress", generateAddress); | ||
exports.generateAddress = generateAddress; | ||
function HDKeyFromExtendedKey(extendedKeyB58) { | ||
@@ -91,3 +102,3 @@ let hdkey; | ||
} | ||
exports_1("HDKeyFromExtendedKey", HDKeyFromExtendedKey); | ||
exports.HDKeyFromExtendedKey = HDKeyFromExtendedKey; | ||
function checkHDKey(key) { | ||
@@ -112,3 +123,3 @@ if (key.startsWith('x')) { | ||
} | ||
exports_1("checkHDKey", checkHDKey); | ||
exports.checkHDKey = checkHDKey; | ||
function deriveAddress(extendedKey, n, derivationPrefix = 'm/0/') { | ||
@@ -122,3 +133,3 @@ let t = checkHDKey(extendedKey); | ||
} | ||
exports_1("deriveAddress", deriveAddress); | ||
exports.deriveAddress = deriveAddress; | ||
function deriveKey(extendedKey, n, derivationPrefix = 'm/0/') { | ||
@@ -132,16 +143,7 @@ let t = checkHDKey(extendedKey); | ||
} | ||
exports_1("deriveKey", deriveKey); | ||
exports.deriveKey = deriveKey; | ||
function addressFromHDKey(hdkey, net = "mainnet") { | ||
return bitcoin.payments.p2pkh({ pubkey: Buffer.from(hdkey), network: bitcoin.networks[net] }).address; | ||
} | ||
exports_1("addressFromHDKey", addressFromHDKey); | ||
return { | ||
setters: [], | ||
execute: function () { | ||
HDKey = require('hdkey'); | ||
bitcoin = require('bitcoinjs-lib'); | ||
bip39 = require('bip39'); | ||
assert = require('bsert'); | ||
} | ||
}; | ||
exports.addressFromHDKey = addressFromHDKey; | ||
}); |
{ | ||
"name": "btc-hdkey", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Hierarchical Deterministic Wallet support for BTC", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7414
177