Sending from Account A to B is not working in my implementation. The docs provided by stellar for Java are straight forward but I have been receiving a BaseEncodingException when trying to sign the transaction. My code is identical to that on the Java docs for stellar, am I missing something here?
Also, checks are done on both accounts to ensure they are not-null and have proper funds for the transaction to go through.
KeyPair destination = KeyPair.fromAccountId(request.getSource());
KeyPair source = KeyPair.fromSecretSeed(ServerInfo.PRIVATE_KEY_MAIN_ACCOUNT);
Transaction trns = null;
try {
AccountResponse sourceAccount = checkForFunds(request);
trns = new Transaction.Builder(sourceAccount, Network.TESTNET)
.addOperation(new PaymentOperation
.Builder(destination.getPublicKey().toString(), new AssetTypeNative(), request.getAmount())
.build())
.addMemo(Memo.text("Test Transaction"))
.setTimeout(180)
.setOperationFee(100)
.build();
System.out.println(".buildTransaction() - transaction created: " + trns.hashCode());
// Sign the transaction to prove you are actually the person sending it.
trns.sign(source);
return trns;
} catch (IOException e) {
throw e;
}