> 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/calculating-a-transaction-hash.md).

# Calculating a Transaction Hash

```javascript
Circular.GetWallet(Blockchain, Address); 

var Nonce = w_nonce + 1;  // Wallet Nonce + 1
var From = '0x...';       // Sender Address 
var To = '0x...';         // Recipient Address

// Remove ‘0x’ from the addresses
if (Blockchain.startsWith('0x')) {
    Blockchain = Blockchain.slice(2);
}

if (From.startsWith('0x')) {
    From = From.slice(2);
}

if (To.startsWith('0x')) {
    To = To.slice(2);
}

var Asset = "CIRX";
var Amount = 100.00;
var Memo = "Test Send CIRX";

// Definition of the Transaction Payload
var PayloadObject = {
    "Action": "CP_SEND",
    "Asset": Asset,
    "Amount": Amount,
    "Memo": Memo
};

// Conversion to string
var jsonstr = JSON.stringify(PayloadObject);

// Conversion to Hex Representation
var Payload = Circular.stringToHex(jsonstr);

// Retrieval of the Timestamp
Timestamp = Circular.getFormattedTimestamp();

// Transaction String
const str = Blockchain + From + To + Payload + Nonce + Timestamp;

// Signature Hash
const TxID = sha256(str);
```


---

# 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/calculating-a-transaction-hash.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.
