CreateTransaction
Create a new Transaction object and send it to the network to be processed. See Quick Start in Javascript-SDK for an example of how to construct a Transaction object.
Example Request
=== "cURL"
=== "Node.js"
=== "Java"
=== "Python"
=== "Go"
Example Response
Arguments
id
string
Required
"1"
jsonrpc
string
Required
"2.0"
method
string
Required
"CreateTransaction"
params
N/A
Required
See table below for the Transaction parameters required:
Transaction Parameters
version
number
Required
The decimal conversion of the bitwise concatenation of CHAIN_ID
and MSG_VERSION
parameters.
- For mainnet, it is 65537
.
- For Developer testnet, it is 21823489
.
nonce
number
Required
A transaction counter in each account. This prevents replay attacks where a transaction sending eg. 20 coins from A to B can be replayed by B over and over to continually drain A's balance.
It's value should be Current account nonce + 1
.
toAddr
string
Required
Recipient's account address. This is represented as a String
.
NOTE: This address has to be checksummed for every 6th bit, but the "0x" prefix is optional.
For deploying new contracts, set this to "0000000000000000000000000000000000000000"
.
amount
string
Required
Transaction amount to be sent to the recipent's address. This is measured in the smallest price unit Qa (or 10^-12 Zil) in Zilliqa.
pubKey
string
Required
Sender's public key of 33 bytes.
gasPrice
string
Required
An amount that a sender is willing to pay per unit of gas for processing this transaction. This is measured in the smallest price unit Qa (or 10^-12 Zil) in Zilliqa.
gasLimit
string
Required
The amount of gas units that is needed to be process this transaction.
- For regular transaction, please use "50"
.
- For smart contract transaction, please consult the gas documentation.
code
string
Optional
The smart contract source code. This is present only when deploying a new contract.
data
string
Optional
String
-ified JSON object specifying the transition parameters to be passed to a specified smart contract.
- When creating a contract, this JSON object contains the init parameters.
- When calling a contract, this JSON object contains the msg parameters.
For more information on the Scilla interpreter, please visit the documentation.
signature
string
Required
An EC-Schnorr signature of 64 bytes of the entire Transaction object as stipulated above.
priority
boolean
Optional
A flag for this transaction to be processed by the DS committee. This is only required for Category III transactions.