1

I'm using the JavaScript SDK in Node and have run into a problem making payments on the testnet. I catch the error but am unable to parse it to get at the result_codes which show as [Object] when I console.log it. How do I see what the result_codes are?

Example from console.log(error):

{ [BadResponseError: Transaction submission failed. Server responded: 400 Bad Request]
  name: 'BadResponseError',
  message: 'Transaction submission failed. Server responded: 400 Bad Request',
  data: 
   { type: 'https://stellar.org/horizon-errors/transaction_failed',
     title: 'Transaction Failed',
     status: 400,
     detail: 'The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html',
     extras: 
      { envelope_xdr: 'AAAAAIxgJdHRvUjFfPV7yVgiazXSBZWuVJv0eizUPO/GugFMAAAAZAB7Ra0AAAACAAAAAAAAAAEAAAALRmx1dHRlciBBcHAAAAAAAQAAAAAAAAABAAAAAEpsuH8rByJ9lm8GkUTGq1eCLEy4D2fayXD3V95vO5w6AAAAAAAAAAABMS0AAAAAAAAAAAHGugFMAAAAQK1jjtWKT8U6KC7VsuylrU1Qn4pwvAbWdjy1IbiGqDkDXpdQP1fbrezu3nOgAwP8OocRr56GcgikwiT1G41/VgI=',
        result_codes: [Object],
        result_xdr: 'AAAAAAAAAGT////6AAAAAA==' } } }

1 Answer 1

1

Decoding the result_xdr shows the error code txBadAuth.

I couldn't locate the documentation for this error code, but you can reasonably guess that it is related to the transaction signature being incorrect in some way.

The transaction envelope shows it was signed by the source account. And this signer has sufficient weight to perform the payment operation that was attempted. So I'm not entirely sure what was wrong.

The result_codes value is printed as [Object] by node, because it is an object with two fields. A single code for the transaction and an array of codes for the operations. Example

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.