Skip to content

Commit 524483f

Browse files
authored
Merge pull request #45 from Developerayo/patch/tron/pk
Removes 0x prefix from gen tron-pk in `generateWalletFromMnemonic`
2 parents 0baab65 + 84d2d2a commit 524483f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/common/helpers/tronHelper.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,13 @@ const generateWalletFromMnemonic = (
8181
const path = derivationPath || "m/44'/195'/0'/0/0";
8282
const account = TronWeb.fromMnemonic(mnemonic, path);
8383

84+
const privateKey = account.privateKey.startsWith('0x')
85+
? account.privateKey.substring(2)
86+
: account.privateKey;
87+
8488
return successResponse({
8589
address: account.address,
86-
privateKey: account.privateKey,
90+
privateKey: privateKey,
8791
mnemonic: mnemonic,
8892
});
8993
};

0 commit comments

Comments
 (0)