Skip to content

Commit

Permalink
Solve BIP44 parameter passing format error
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenguoz committed Feb 9, 2023
1 parent e9ecbc6 commit f4f46f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Wallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function newAccountByMnemonic(string $passphrase = '', string $pat
{
$mnemonic = BIP39::Generate(12);
$seed = $mnemonic->generateSeed($passphrase);
$HDKey = BIP44::fromMasterSeed($seed)->derive($path);
$HDKey = BIP44::fromMasterSeed(bin2hex($seed))->derive($path);

$privateKey = $HDKey->privateKey;
$address = PEMHelper::privateKeyToAddress($privateKey);
Expand All @@ -61,7 +61,7 @@ public static function newAccountByMnemonic(string $passphrase = '', string $pat
public static function revertAccountByMnemonic(string $mnemonic, string $passphrase = '', string $path = self::DEFAULT_PATH): array
{
$seed = BIP39::Words($mnemonic)->generateSeed($passphrase);
$HDKey = BIP44::fromMasterSeed($seed)->derive($path);
$HDKey = BIP44::fromMasterSeed(bin2hex($seed))->derive($path);

$privateKey = $HDKey->privateKey;
$address = PEMHelper::privateKeyToAddress($privateKey);
Expand Down

0 comments on commit f4f46f5

Please sign in to comment.