Transaction

A Zetrix Transaction Blockchain API allows developers to send and receive transactions, read data, and access smart contract functions on a blockchain programmatically.

To create a transaction, you typically need to provide the sender's address, the recipient's address, the amount of the cryptocurrency to send, and a transaction fee, which is paid to the miners who verify and process the transaction. Once the transaction is created, it is broadcast to the network and added to a pool of unconfirmed transactions.

The Zetrix Transaction Blockchain API allows developers to interact with these unconfirmed transactions, retrieve information about them, and monitor their status in real-time. You can also use the transaction API to inspect the details of a confirmed transaction, including the amount sent, the recipient, and the timestamp of the transaction.

Generate Blob

POST HTTP /ztx/tx/generate-blob

CURL Command

curl POST https://{endpoint}/ztx/tx/generate-blob
  • Function

To generate blob based on input account.

  • The body is in json data.

Here body transfer is the transaction data. For specific json format and parameters, see Transaction Structure.

{
  "operations": [
    {
      "amount": "string",
      "fromAddress": "string",
      "inputStr": "string",
      "payload": "string",
      "precision": "string",
      "toAddress": "string",
      "type": "string"
    }
  ],
  "txInitiator": "string"
}

"type" field can be depicted as follows:

  • Return Value

For example, to transfer Zetrix coin, developer can provide the following info in the payload where type is equals to 2.

Response from the example :

Parse Blob

CURL Command

  • Function

To parse a blob.

  • The body is in json data.

Here body transfer is the transaction data. For specific json format and parameters, see Transaction Structure.

  • Return Value

Query Transaction By Hash

CURL Command

  • Function

To query a transaction.

  • The body is in json data.

Here body transfer is the transaction data. For specific json format and parameters, see Transaction Structure.

Name
Description
Format

hash

transaction hash

string

  • Return Value

Sign Blob

CURL Command

  • Function

To sign transaction blob.

  • The body is in json data.

Here body transfer is the transaction data. For specific json format and parameters, see Transaction Structure.

  • Return Value

Submit Transaction

CURL Command

  • Function

To submit transaction.

  • The body is in json data.

Here body transfer is the transaction data. For specific json format and parameters, see Transaction Structure.

  • Return Value

Last updated