> For the complete documentation index, see [llms.txt](https://circular-protocol.gitbook.io/cex-integration-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://circular-protocol.gitbook.io/cex-integration-guide/transactions/transaction-finality.md).

# Transaction Finality

On Circular, transactions are final as soon as the block is minted. There is no need to wait for multiple block confirmations since Circular is designed to prevent forking, ensuring blocks are final. This approach maintains strong security while offering fast transaction finality.

```javascript
async function sendAndCheckTransaction(
    ID, 
    From, 
    To, 
    Timestamp, 
    Type, 
    Payload, 
    Nonce, 
    Signature, 
    Blockchain
) {
    try {
        // Submitting transaction
        const data = await Circular.SendTransaction(
            ID, 
            From, 
            To, 
            Timestamp, 
            Type, 
            Payload, 
            Nonce, 
            Signature, 
            Blockchain
        );

        // If the transaction is correctly received
        if (data.Result === 200) {
            // Extracts the TxID
            var TxID = data.Response.TxID;

            // Waits for the transaction to be finalized
            const transaction = await Circular.GetTransactionOutcome(
                Blockchain, // Blockchain
                TxID,       // Transaction waited on
                25          // 25 seconds timeout
            );

            // If the transaction is found
            if (transaction) {
                // Extracts the transaction status
                if (transaction.Status) {
                    const Status = transaction.Status;

                    // Calculation of the total fee paid
                    var TxFee = transaction.NagFee + 
                                transaction.BroadcastFee + 
                                transaction.ProcessingFee + 
                                transaction.ProtocolFee;

                    // Extraction of the BlockID where the transaction is
                    var Block = transaction.BlockID;

                    // Posts a message with the details
                    alert(`TxID: ${TxID}\n Tx Status: ${Status}\n Fees: ${TxFee} CIRX\n BlockID: ${Block}`);
                } else {
                    console.log('Status field is missing in the transaction response.');
                }
            } else {
                console.log('Transaction not successful or Response was "Transaction Not Found".');
            }
        } else {
            alert('Transaction Rejected: ' + data.Reponse);
        }
    } catch (error) {
        console.error('Error:', error.message);
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://circular-protocol.gitbook.io/cex-integration-guide/transactions/transaction-finality.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
