sendTransaction()
Send a new transaction on the blockchain.
Requesting the content of a wallet should not be considered a transaction. This distinction arises because such a request is handled by a single node and does not affect the global state of the network. Transactions, in contrast, are actions that have an impact on the overall network state.
When we talk about "affecting the global state of the network," we mean that the requested action results in a change of state and requires the execution of an operation by all nodes in the network or a specific subset of nodes.
Transactions are typically used for various purposes, including modifying the contents of a wallet, executing smart contracts, or creating/modifying/destroying assets on the blockchains. Transactions are the primary mechanism for carrying out these diverse operations and involve several parameters to achieve the desired outcomes.
Method Signature
ID:
This represents the transaction hash, which is usually calculated as:
Where "From," "To," and "Payload" are in hexadecimal representation without the "0x" identifier, while the "ID" will contain the "0x" hexadecimal identifier.
From:
This field represents the wallet address of the entity initiating the transaction, without the "0x" hexadecimal identifier. Please note that the wallet address must be pre-registered on the chosen blockchain. Furthermore, the wallet must maintain an adequate balance of CIRX coins to cover the transaction fees associated with the particular transaction. These fees are essential for the seamless processing and execution of the requested transaction.
To:
This field represents the wallet address of the transaction recipient, without the "0x" hexadecimal identifier. If the particular transaction doesn't necessitate a recipient address, this field can be the same as the sender's address.
Timestamp:
Transaction timestamp in format YYYY:MM:DD-hh:mm:ss in UDT timezone.
Payload:
String in hexadecimal format without the "0x" hexadecimal identifier (base64 is also accepted).
Nonce:
Nonce value for the current transaction. It's crucial to obtain the current Nonce value from the sending wallet and incorporate it into the new transaction. For more information, please refer to the "getWalletNonce()" section.
Signature:
Signature of the transaction ID in hexadecimal format, without the "0x" identifier. The signature is obtained using Elliptic curve algorithm Secp256k1 (more cryptos will be available soon).
Public Key:
The public key of the "From" Wallet is included in the transaction to expedite the initial transaction pre-validation process. This eliminates the need to access wallet files for public key retrieval during this phase, thus enhancing the efficiency of the transaction.
Blockchain:
Blockchain Address where the transaction is sent, without the hexadecimal identifier.
Type:
Types of transactions:
C_TYPE_COIN: Transaction involving native coins (CIRX) without the use of Hyper Code (Smart Contracts).
C_TYPE_TOKEN: Transaction involving specified tokens without the use of Hyper Code.
C_TYPE_ASSET: Transaction involving a generic digital asset that is not represented by a token.
C_TYPE_CERTIFICATE: Transaction where the payload doesn't require processing and is a generic string.
C_TYPE_REGISTERWALLET: Transaction used to register a new wallet on a specified blockchain.
C_TYPE_HC_DEPLOYMENT: Transaction to deploy a new Hyper Code Program.
C_TYPE_HC_REQUEST: Transaction to call a specified endpoint of a Hyper Program.
C_TYPE_USERDEF: Unspecified type, defined by the user (not available yet).
Request
Parameters
id
string
Calculated TxID in hex
from
string
Wallet address in hex
to
string
Receiver's wallet address in hex
timestamp
string
Date string in "YYYY:MM:DD-HH:mm:ss" format
payload
string
String in hexadecimal format
nonce
string
Nonce value for the current transaction.
signature
string
Signature of the transaction ID in hexadecimal
blockchain
string
Blockchain address in hex
type
string
One of the types listed before
Example:
Result
The result will be of type Array
, but for easier readability, here is the equivalent in JSON.
Last updated