public class App {
public static void main(String[] args) {
try {
Pair key = Mnemonic.toKeyPair(Arrays.asList("artwork", "people", "where", "dolphin", "assume", "develop", "polar",
"link", "company", "boil", "over", "shed", "clump", "fall", "seed", "flag", "private", "opinion",
"budget", "follow", "install", "skill", "agent", "garbage")); //Key pair of public key and private key generated using 24 words for the wallet
TonLibService tonLibService; // Instance of TonlibService Class
tonLibService = new TonLibService(true, key.getSecretKey());// Instance of TonlibService Class with a parameter of testNet:true and the key generated above
public TonLibService(Boolean isTestNet, byte[] adminWalletSecret) throws InterruptedException {
// Initialize TonLib with configuration files
tonlib = Tonlib.builder().testnet(isTestNet)
.pathToTonlibSharedLib(“lib/tonlibjson.dll”)
.pathToGlobalConfig(“lib/testnet-global.config.json”)
.verbosityLevel(VerbosityLevel.FATAL)
.ignoreCache(false)
.build();
// Initialize Admin Wallet with secret key
adminWallet = WalletV4R2.builder()
.tonlib(tonlib)
.keyPair(TweetNaclFast.Signature.keyPair_fromSeed(adminWalletSecret))
.build();
System.out.println("Admin Wallet Address:" + adminWallet.getAddress());
The address I got from here differs from the address from a tonkeeper app wallet that has the 24 words above as a secret key.
Why does it happen?
Feenix Net is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.