CEX Integration Guide
  • Introduction
  • Circular's Public Blockchains
  • SDK Library
  • Networks
  • Local Calls
    • Retrieve Wallet
    • Retrieve Wallet Balance for a Specific Asset
    • Resolve Domain Name
    • Retrieve Asset Supply
    • Retrieve Blockchain Block Height
    • Retrieve a Single Block
    • Retrieve a Set of Blocks
    • Retrieve List of Blockchains
    • Retrieve Transaction by ID
    • Retrieve Transaction by Address
    • Retrieve Transaction by Date
  • Transactions
    • Transaction Composition
    • Calculating a Transaction Hash
    • Submitting a Transaction
    • Transaction Finality
  • Wallet Creation
    • Creating a Wallet
    • Wallet Generation (Read Warning)
  • Appendix
  • Node.js
    • Page 1
Powered by GitBook
On this page
  1. Transactions

Calculating a Transaction Hash

Example send CIRX to a wallet:

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);
PreviousTransaction CompositionNextSubmitting a Transaction

Last updated 7 months ago