

From signed to final
The first answer is a guess. A validated ledger makes the result final.
Key points
- The first answer is a guess. Only a validated ledger is final.
- tec means it failed but was recorded, so the fee is burned.
- LastLedgerSequence sets a deadline, so a lost transaction fails for sure.
The lesson
Sending a transaction is like mailing a letter. The post office says "got it." That does not mean it arrived.
When you submit, the server gives a . It is the server's best guess. The real answer comes when a validated ledger includes the transaction. Then it is final.
Every result has a code. The first letters tell the family:
- tes: it worked.
- tec: it failed, but it was recorded. The fee is burned.
- tem: badly formed. No server will ever take it.
- tef: it cannot apply now, such as an old number.
- ter: not yet. It may work in a later ledger.
What if the transaction goes missing? Set a deadline:
LastLedgerSequence. Once a passes that number, the transaction can never get in. Then you know it failed, and you can safely try again.
Preliminary or final.
submitreturnsengine_resultfrom the server's open ledger. It can change. Read the final result withtx: it is final only whenvalidatedistrue. Under heavy load, a transaction can wait in the queue first.Result families:
Prefix Meaning In a ledger? Fee tesSuccess Yes Burned tecFailed, recorded, e.g. tecUNFUNDED_PAYMENTYes Burned temMalformed, never valid, e.g. temBAD_AMOUNTNo None tefCannot apply, e.g. tefPAST_SEQNo None terRetry, e.g. terPRE_SEQNot yet None yet telThis server's local error, e.g. high load No None A
tecresult also uses theSequence.tesandtecresults are final only in a .Expiry.
LastLedgerSequenceis the highest ledger index that may include the transaction. Libraries usually set the current index plus about 20, roughly a minute. Once a validated ledger passes it without the transaction, it cannot succeed. A late copy fails withtefMAX_LEDGER.Safe retry. Keep the signed blob and hash. Check
txon a validated ledger. Only after the deadline passes with no result, sign again.Related: Fees and burn, Consensus.

