Wallet API
In ViteJ, a wallet instance contains a mnemonic phrase, and is able to derive up to 100 public/private key pairs. One private key uniquely determines a Vite address.
Wallet Instance
// create new wallet instance
Wallet wallet0 = new Wallet();
// recover wallet from mnemonic phrase
Wallet wallet1 = new Wallet(Arrays.asList("network","north","tell","potato","predict","almost","wonder","spirit","wheel","smile","disease","bonus","round","flock","pole","review","music","oven","clarify","exclude","loyal","episode","image","notable"));
Wallet wallet2 = new Wallet("network north tell potato predict almost wonder spirit wheel smile disease bonus round flock pole review music oven clarify exclude loyal episode image notable");
// export mnemonic phrase from wallet
List<String> mnemonic = wallet.getMnemonic();
Address Derivation
// address 0
KeyPair keyPair0 = wallet.deriveKeyPair();
// address 1
KeyPair keyPair1 = wallet.deriveKeyPair(1);
Key Pairs
// get public key
byte[] publicKey = keyPair.getPublicKey();
// get private key
byte[] privateKey = keyPair.getPrivateKey();
// get address
Address address = keyPair.getAddress();