I'm trying to submit a transaction that includes a payment operation. Sometimes the transaction succeeds. However, sometimes it fails. I believe this has something to do with the decimal being submitted.
Before submitting the transaction, the decimal prints as:
11.776242893769199616
On failed transactions, if I browse the XDR response (via Stellar laboratory), I see a negative amount:
amount: -6.6705011 (raw: -66705011)
Any idea why this is a negative number?
Response:
Post Payment Error: Horizon request error of type request failed with message: {
"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": "[XDR INFO]",
"result_codes": {
"transaction": "tx_failed",
"operations": [
"op_malformed"
]
},
"result_xdr": "AAAAAAAAAGT/////AAAAAQAAAAAAAAAB/////wAAAAA="
}
}