After posting a transaction to the network, most software needs to display comprehensive feedback to the user. This is especially true when an error happens.
This library produces human-readable descriptions for any possible code Stellar Core returns:
const response = await server.submitTransaction(transaction)
const result = new TxResult(response)
Result for successful transactions:
title: "The transaction has been validated",
offerResults is as described in StellarSdk server.submitTransaction() documentation.
Result for failed transactions:
title: "The transaction has been rejected",
"Operation 1: The destination account doesn't exist.",
"Operation 3: The source does not have enough funds."
NPM | Yarn | Documentation