Stellar Asked by pizi on January 1, 2021
I submit a transaction to the TestNet by using the official horizon API (https://horizon-testnet.stellar.org/), and it returns tx_bad_auth
.
This is my code:
Server server = new Server("https://horizon-testnet.stellar.org");
final KeyPair keyPair = KeyPair.fromSecretSeed("xxx...");
String toAddress = "xxx...";
final String accountId = keyPair.getAccountId();
System.out.println(accountId);
final AccountResponse account = server.accounts().account(keyPair.getAccountId());
Transaction.Builder builder = new Transaction.Builder(account, Network.TESTNET);
Transaction transaction = builder.setBaseFee(100)
.addOperation(new PaymentOperation.Builder(toAddress, new AssetTypeNative(), "100.0").build())
.setTimeout(3600).build();
final SubmitTransactionResponse submitTransactionResponse = server.submitTransaction(transaction);
System.out.println(submitTransactionResponse.isSuccess());
System.out.println(submitTransactionResponse.getExtras().getResultCodes().getTransactionResultCode());
final String hash = submitTransactionResponse.getHash();
System.out.println(hash);
output:
GCLYWR7FETXXX...
false
tx_bad_auth
null
Before the TestNet restart today, this code works.
After I create another account using my account, I can submit a payment transaction with my account. It's strange.
Answered by pizi on January 1, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP