Skip to main content

How to send a simple transaction

This recipe demonstrates how to send a transaction using the signAndSendUniqueTransaction helper function, which simplifies the process of creating, signing, and sending transactions on the Chromia blockchain.

Prerequisites

  • Node.js
  • FT4 client: npm install @chromia/ft4
  • Postchain client: npm install postchain-client

Demo script

Key Features

The signAndSendUniqueTransaction helper function does three things:

  • Automatic uniqueness - Adds a nop operation with random data to ensure the transaction is unique
  • Simplified signing - Signs with the provided signature provider or private key
  • Transaction receipt - Sends the transaction and returns a receipt with statusCode, status, and transactionRid

Transaction Status

The helper returns one of the following statuses:

  • Waiting - Transaction is pending inclusion
  • Rejected - Transaction was rejected by the network
  • Confirmed - Transaction was successfully included in a block
  • Unknown - Transaction status could not be determined

Learn more