emblem-vault-sdk 1.9.3 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -709352,9 +709352,9 @@ const bip39 = __importStar(require("bip39"));
709352
709352
  // import bitcoin from "bitcoinjs-lib";
709353
709353
  const ecc = __importStar(require("@bitcoin-js/tiny-secp256k1-asmjs"));
709354
709354
  const bip32 = (0, bip32_1.BIP32Factory)(ecc);
709355
- let mainnet = { "messagePrefix": "\u0018Bitcoin Signed Message:\n", "bech32": "bc", "bip32": { "public": 76067358, "private": 76066276 }, "pubKeyHash": 0, "scriptHash": 5, "wif": 128 };
709356
709355
  const generateTaprootAddressFromMnemonic = (phrase) => __awaiter(void 0, void 0, void 0, function* () {
709357
709356
  let bitcoin = window.bitcoin;
709357
+ let mainnet = bitcoin.networks.mainnet;
709358
709358
  bitcoin.initEccLib(ecc);
709359
709359
  const seed = bip39.mnemonicToSeedSync(phrase);
709360
709360
  const rootKey = bip32.fromSeed(seed, mainnet);
@@ -709376,6 +709376,7 @@ exports.generateTaprootAddressFromMnemonic = generateTaprootAddressFromMnemonic;
709376
709376
  const getPsbtTxnSize = (phrase, psbtBase64) => {
709377
709377
  var _a, _b;
709378
709378
  let bitcoin = window.bitcoin;
709379
+ let mainnet = bitcoin.networks.mainnet;
709379
709380
  const parsedPsbt = bitcoin.Psbt.fromBase64(psbtBase64);
709380
709381
  const psbt = new bitcoin.Psbt();
709381
709382
  const seed = bip39.mnemonicToSeedSync(phrase);
package/dist/derive.js CHANGED
@@ -38,9 +38,9 @@ const bip39 = __importStar(require("bip39"));
38
38
  // import bitcoin from "bitcoinjs-lib";
39
39
  const ecc = __importStar(require("@bitcoin-js/tiny-secp256k1-asmjs"));
40
40
  const bip32 = (0, bip32_1.BIP32Factory)(ecc);
41
- let mainnet = { "messagePrefix": "\u0018Bitcoin Signed Message:\n", "bech32": "bc", "bip32": { "public": 76067358, "private": 76066276 }, "pubKeyHash": 0, "scriptHash": 5, "wif": 128 };
42
41
  const generateTaprootAddressFromMnemonic = (phrase) => __awaiter(void 0, void 0, void 0, function* () {
43
42
  let bitcoin = window.bitcoin;
43
+ let mainnet = bitcoin.networks.mainnet;
44
44
  bitcoin.initEccLib(ecc);
45
45
  const seed = bip39.mnemonicToSeedSync(phrase);
46
46
  const rootKey = bip32.fromSeed(seed, mainnet);
@@ -62,6 +62,7 @@ exports.generateTaprootAddressFromMnemonic = generateTaprootAddressFromMnemonic;
62
62
  const getPsbtTxnSize = (phrase, psbtBase64) => {
63
63
  var _a, _b;
64
64
  let bitcoin = window.bitcoin;
65
+ let mainnet = bitcoin.networks.mainnet;
65
66
  const parsedPsbt = bitcoin.Psbt.fromBase64(psbtBase64);
66
67
  const psbt = new bitcoin.Psbt();
67
68
  const seed = bip39.mnemonicToSeedSync(phrase);
package/docs/bundle.js CHANGED
@@ -709352,9 +709352,9 @@ const bip39 = __importStar(require("bip39"));
709352
709352
  // import bitcoin from "bitcoinjs-lib";
709353
709353
  const ecc = __importStar(require("@bitcoin-js/tiny-secp256k1-asmjs"));
709354
709354
  const bip32 = (0, bip32_1.BIP32Factory)(ecc);
709355
- let mainnet = { "messagePrefix": "\u0018Bitcoin Signed Message:\n", "bech32": "bc", "bip32": { "public": 76067358, "private": 76066276 }, "pubKeyHash": 0, "scriptHash": 5, "wif": 128 };
709356
709355
  const generateTaprootAddressFromMnemonic = (phrase) => __awaiter(void 0, void 0, void 0, function* () {
709357
709356
  let bitcoin = window.bitcoin;
709357
+ let mainnet = bitcoin.networks.mainnet;
709358
709358
  bitcoin.initEccLib(ecc);
709359
709359
  const seed = bip39.mnemonicToSeedSync(phrase);
709360
709360
  const rootKey = bip32.fromSeed(seed, mainnet);
@@ -709376,6 +709376,7 @@ exports.generateTaprootAddressFromMnemonic = generateTaprootAddressFromMnemonic;
709376
709376
  const getPsbtTxnSize = (phrase, psbtBase64) => {
709377
709377
  var _a, _b;
709378
709378
  let bitcoin = window.bitcoin;
709379
+ let mainnet = bitcoin.networks.mainnet;
709379
709380
  const parsedPsbt = bitcoin.Psbt.fromBase64(psbtBase64);
709380
709381
  const psbt = new bitcoin.Psbt();
709381
709382
  const seed = bip39.mnemonicToSeedSync(phrase);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Emblem Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/derive.ts CHANGED
@@ -6,14 +6,15 @@ import * as ecc from '@bitcoin-js/tiny-secp256k1-asmjs'
6
6
 
7
7
  const bip32 = BIP32Factory(ecc);
8
8
 
9
- let mainnet: any = {"messagePrefix":"\u0018Bitcoin Signed Message:\n","bech32":"bc","bip32":{"public":76067358,"private":76066276},"pubKeyHash":0,"scriptHash":5,"wif":128}
9
+ // let mainnet: any = {"messagePrefix":"\u0018Bitcoin Signed Message:\n","bech32":"bc","bip32":{"public":76067358,"private":76066276},"pubKeyHash":0,"scriptHash":5,"wif":128}
10
10
  declare global {
11
11
  interface Window {
12
12
  bitcoin: any;
13
13
  }
14
14
  }
15
15
  export const generateTaprootAddressFromMnemonic = async (phrase: string) => {
16
- let bitcoin = window.bitcoin;
16
+ let bitcoin = window.bitcoin;
17
+ let mainnet = bitcoin.networks.mainnet;
17
18
  bitcoin.initEccLib(ecc);
18
19
  const seed = bip39.mnemonicToSeedSync(phrase);
19
20
 
@@ -39,7 +40,8 @@ export const generateTaprootAddressFromMnemonic = async (phrase: string) => {
39
40
  // we sign it with a dummy key and then extract the transaction
40
41
  // it should be very close to 100% accurate
41
42
  export const getPsbtTxnSize = (phrase: string, psbtBase64: string) => {
42
- let bitcoin = window.bitcoin;
43
+ let bitcoin = window.bitcoin;
44
+ let mainnet = bitcoin.networks.mainnet;
43
45
  const parsedPsbt = bitcoin.Psbt.fromBase64(psbtBase64);
44
46
 
45
47
  const psbt = new bitcoin.Psbt();