@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.
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@ var bip39 = require('@scure/bip39');
7
7
  var english_js = require('@scure/bip39/wordlists/english.js');
8
8
  var bip32 = require('@scure/bip32');
9
9
  var base = require('@scure/base');
10
- var sha2 = require('@noble/hashes/sha2');
11
- var legacy = require('@noble/hashes/legacy');
10
+ var sha2_js = require('@noble/hashes/sha2.js');
11
+ var legacy_js = require('@noble/hashes/legacy.js');
12
12
  var react = require('react');
13
13
 
14
14
  var __defProp = Object.defineProperty;
@@ -891,7 +891,7 @@ function deriveBitcoinAddress(seed, network = "testnet") {
891
891
  if (!child.publicKey) {
892
892
  throw new Error("Failed to derive public key");
893
893
  }
894
- const pubKeyHash = legacy.ripemd160(sha2.sha256(child.publicKey));
894
+ const pubKeyHash = legacy_js.ripemd160(sha2_js.sha256(child.publicKey));
895
895
  const witnessVersion = 0;
896
896
  const words = base.bech32.toWords(pubKeyHash);
897
897
  words.unshift(witnessVersion);
@@ -932,7 +932,7 @@ async function deriveTonAddress(seed) {
932
932
  const publicKey = keypair.publicKey;
933
933
  const workchain = 0;
934
934
  const flags = 17;
935
- const hash = sha2.sha256(publicKey);
935
+ const hash = sha2_js.sha256(publicKey);
936
936
  const addressData = new Uint8Array(34);
937
937
  addressData[0] = flags;
938
938
  addressData[1] = workchain;
@@ -969,7 +969,7 @@ function deriveTronAddress(seed) {
969
969
  for (let i = 0; i < 20; i++) {
970
970
  addressBytes[i + 1] = parseInt(ethAddressHex.slice(i * 2, i * 2 + 2), 16);
971
971
  }
972
- const tronBase58check = base.base58check(sha2.sha256);
972
+ const tronBase58check = base.base58check(sha2_js.sha256);
973
973
  return tronBase58check.encode(addressBytes);
974
974
  } catch (error) {
975
975
  console.error("TRON address derivation failed:", error);
@@ -984,7 +984,7 @@ function deriveSparkAddress(seed, network = "testnet") {
984
984
  if (!child.publicKey) {
985
985
  throw new Error("Failed to derive public key");
986
986
  }
987
- const pubKeyHash = legacy.ripemd160(sha2.sha256(child.publicKey));
987
+ const pubKeyHash = legacy_js.ripemd160(sha2_js.sha256(child.publicKey));
988
988
  const witnessVersion = 0;
989
989
  const words = base.bech32.toWords(pubKeyHash);
990
990
  words.unshift(witnessVersion);