Skip to content

Commit

Permalink
add TON mnemonics to SK
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithreum committed Oct 15, 2024
1 parent d84a845 commit 5033ef8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/tonMnemonicToPK.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
KeyPair,
mnemonicNew,
mnemonicToPrivateKey
} from "@ton/crypto";

(async () => {

// Generate new key ``.split('\n');
let mnemonics = await mnemonicNew();

console.log("mnemonics", mnemonics)

let keyPair: KeyPair = await mnemonicToPrivateKey(mnemonics);

// Convert the buffers to hex strings (or another encoding if needed)
const publicKeyString = keyPair.publicKey.toString('hex');
const secretKeyString = keyPair.secretKey.toString('hex');

console.log('Public Key:', publicKeyString);
console.log('Secret Key:', secretKeyString);

})()

0 comments on commit 5033ef8

Please sign in to comment.