I'm using js-soroban-client. This code for simulating a transaction works:
let tx = new SorobanClient.TransactionBuilder(account, {
fee: fee.toString(10),
networkPassphrase: NETWORK_PASSPHRASE,
})
.addOperation(contract.call(method, ...args))
.setTimeout(SorobanClient.TimeoutInfinite)
.build()
const simulated = await Server.simulateTransaction(tx)
Then I can successfully check if simulated.results?.[0]?.auth exists and, if so, sign the transaction with Freighter, re-construct it, and use sendTransaction to send it.
But if I just try to sendTransaction instead, in order to have up-to-date information rather than just the stale info returned by simulate, it fails. Here's the code I try:
tx = SorobanClient.assembleTransaction(tx, NETWORK_PASSPHRASE, simulated) as Tx
const sendTransactionResponse = await Server.sendTransaction(tx)
As when example, when using this to call the symbol method of my fungible token, the simulated.results include xdr AAAADQAAAARBQk5E, which decodes as the scvBytes for ABND.
The sendTransactionResponse returns a status: ERROR with errorResultXdr of AAAAAAAAlSH////6AAAAAA==, which decodes in Stellar Laborator as a TransactionResult with result: [txBadAuth] (https://laboratory.stellar.org/#xdr-viewer?input=AAAAAAAAlSH%2F%2F%2F%2F6AAAAAA%3D%3D&type=TransactionResult&network=futurenet)
Why does it say that it has bad auth, when the method I'm calling doesn't require a signature? What's the correct way to assemble this transaction?