The API is designed to make it easier to write third-party applications. Server-side cryptography and POW operations are performed. Therefore, it is not recommended for public access, because it is not protected from DDOS attacks. Use it if applications such as the exchange server are on the same private network.
This API is available if server is running http and hosting included constant USE_HARD_API_V2.
Warning: the Tera blockchain has a high rate of block confirmation (starting from 4 seconds), but since it uses PoW, it is possible to get into local orphan chains. Therefore, for a reliable transfer of value, we recommend that exchanges wait for additional time, such as 100 seconds, to interpret the finality of the transaction.
text - the optional field contains a detailed description of the result
All methods support the Meta parameter, if it is specified, the same value is added to the query result. This is useful for organizing your own query routing, often used in micro-service architectures.
## GenerateKeys
1)**/api/v2/GenerateKeys** - create private key - public key pair
2)**/api/v2/CreateAccount** - create a new account (account). In Tere free account creation is possible only in the intervals of 10 seconds. The paid version is given in the example of 2 methods **Send**
* Wait - if the number 1 is set, the response to the request is not returned until the transaction is written to the blockchain (the response time to the request is increased to 18 seconds)
3)**/api/v2/Send** - sending coins from one account to another (you need to specify the private key of the sender's account)
#### Parameters:
* FromID - the account number of the sender
* FromPrivKey - sender private key in hex format
* ToID - the account number of the recipient, the number or public key in hex format (in this case, it will create a new account with the name specified in the first line of the description of the payment and the payment the account will be charged 10 Tera)
* Amount - sum, floating-point number, or object format {SumCOIN,SumCENT}
* Description - description of payment order (optional)
* Wait - if the number 1 is set, the response to the request is not returned until the transaction is written to the blockchain (the response time to the request is increased to 8 seconds)
1. Computer A (has public keys) creates a raw unsigned transaction
2. Computer B (has secret keys) grabs and signs the raw transaction
3. computer A grabs the signed transaction and transmits it.
7)**/api/v2/CreateRawTransaction** - create json payment tx without a signature
#### Parameters:
* FromID - the account number of the sender
* ToID - the account number of the recipient, the number or public key in hex format (in this case, it will create a new account with the name specified in the first line of the description of the payment and the payment the account will be charged 10 Tera)
* Amount - sum, floating-point number, or object format {SumCOIN,SumCENT}
* Description - description of payment order (optional)
9)**/api/v2/SendRawTransaction** - send tx to TERA network
#### Parameters:
* Tx -JSON object
* Wait - if the number 1 is set, the response to the request is not returned until the transaction is written to the blockchain (the response time to the request is increased to 8 seconds)