@zubari/sdk 0.1.15 → 0.1.16

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.
@@ -8,8 +8,8 @@ var bip39 = require('@scure/bip39');
8
8
  var english_js = require('@scure/bip39/wordlists/english.js');
9
9
  var bip32 = require('@scure/bip32');
10
10
  var base = require('@scure/base');
11
- var sha2 = require('@noble/hashes/sha2');
12
- var legacy = require('@noble/hashes/legacy');
11
+ var sha2_js = require('@noble/hashes/sha2.js');
12
+ var legacy_js = require('@noble/hashes/legacy.js');
13
13
 
14
14
  // src/react/useWalletManager.ts
15
15
 
@@ -547,7 +547,7 @@ function deriveBitcoinAddress(seed, network = "testnet") {
547
547
  if (!child.publicKey) {
548
548
  throw new Error("Failed to derive public key");
549
549
  }
550
- const pubKeyHash = legacy.ripemd160(sha2.sha256(child.publicKey));
550
+ const pubKeyHash = legacy_js.ripemd160(sha2_js.sha256(child.publicKey));
551
551
  const witnessVersion = 0;
552
552
  const words = base.bech32.toWords(pubKeyHash);
553
553
  words.unshift(witnessVersion);
@@ -588,7 +588,7 @@ async function deriveTonAddress(seed) {
588
588
  const publicKey = keypair.publicKey;
589
589
  const workchain = 0;
590
590
  const flags = 17;
591
- const hash = sha2.sha256(publicKey);
591
+ const hash = sha2_js.sha256(publicKey);
592
592
  const addressData = new Uint8Array(34);
593
593
  addressData[0] = flags;
594
594
  addressData[1] = workchain;
@@ -625,7 +625,7 @@ function deriveTronAddress(seed) {
625
625
  for (let i = 0; i < 20; i++) {
626
626
  addressBytes[i + 1] = parseInt(ethAddressHex.slice(i * 2, i * 2 + 2), 16);
627
627
  }
628
- const tronBase58check = base.base58check(sha2.sha256);
628
+ const tronBase58check = base.base58check(sha2_js.sha256);
629
629
  return tronBase58check.encode(addressBytes);
630
630
  } catch (error) {
631
631
  console.error("TRON address derivation failed:", error);
@@ -640,7 +640,7 @@ function deriveSparkAddress(seed, network = "testnet") {
640
640
  if (!child.publicKey) {
641
641
  throw new Error("Failed to derive public key");
642
642
  }
643
- const pubKeyHash = legacy.ripemd160(sha2.sha256(child.publicKey));
643
+ const pubKeyHash = legacy_js.ripemd160(sha2_js.sha256(child.publicKey));
644
644
  const witnessVersion = 0;
645
645
  const words = base.bech32.toWords(pubKeyHash);
646
646
  words.unshift(witnessVersion);