TRON API Documentation
Use this API to simulate TRON (TRX) transactions on Fauxchain.
Authentication
All API requests must include your API key in the request headers. Your API key identifies your account and provides access to the TRON simulation features.
X-API-KEY: your_api_key_here
Simulate a TRON Transaction
This endpoint allows you to create a simulated TRON transaction between wallets on the Fauxchain network. The transaction will be processed using TRON's unique fee structure, but no real cryptocurrency is used.
Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
receiver_address | string | Required | The TRON address that will receive the transaction |
amount | float | Required | Amount of TRX to send (minimum 0.000001 TRX) |
TRON Fee Structure
TRON transactions use a unique fee structure compared to other blockchains. All simulated TRON transactions incur a network-like fee calculated using burned_trx as the API fee metric. No bandwidth is used or deducted β bandwidth_used will always be 0 in the transaction response, simulating the use of free daily bandwidth allocation.
Transaction Hash Usage
Every successful transaction returns a unique tx_hash. This hash serves as a permanent identifier for the transaction and can be used to build an explorer link for your users to view transaction details.
https://fauxchain.io/explorer/tron/tx/YOUR_TX_HASH
Replace YOUR_TX_HASH with the actual hash returned in the API response. Example:
https://fauxchain.io/explorer/tron/tx/b7e2c8f9d3a6e1b4c7f0a5d8e2b9c6f3a7e4d1b8c5f2a9e6d3b0c7f4a1e8d5b2
Example Request
{
"receiver_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"amount": 10.5
}
Example Success Response
{
"success": true,
"tx_hash": "b7e2c8f9d3a6e1b4c7f0a5d8e2b9c6f3a7e4d1b8c5f2a9e6d3b0c7f4a1e8d5b2",
"sender_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"receiver_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"amount": 10.5,
"burned_trx": "1.470000",
"bandwidth_used": 0
}
Response Field Description
Field | Type | Description |
---|---|---|
tx_hash | string | Unique transaction identifier. Used to link to the explorer. |
sender_address | string | Your configured TRON API address |
receiver_address | string | Destination TRON address |
amount | float | Amount of TRX transferred |
burned_trx | string | Amount of TRX burned for energy to process the transaction |
bandwidth_used | integer | Bandwidth consumed (always 0 in simulation, representing free daily allocation) |
Example Error Responses
The following errors may be returned if the request fails validation or is unauthorized:
{
"error": "TRON API address is not set. Please configure it in your dashboard."
}
{
"error": "Insufficient balance. Minimum of $0.05 is required to simulate a transaction."
}
Response Codes
-
200 OKTransaction simulated successfully. JSON response includes all transaction details.
-
401 UnauthorizedMissing or invalid API key.
-
403 ForbiddenInsufficient balance.
-
422 Unprocessable EntityValidation errors (e.g., missing receiver address, invalid amount, API address not set).
-
500 Internal Server ErrorUnexpected backend error.
Code Examples
import requests
url = "https://fauxchain.io/api/simulate/tron"
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"receiver_address": "RECEIVER_ADDRESS",
"amount": TRX_AMOUNT
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
$response = Http::withHeaders([
'X-API-KEY' => 'YOUR_API_KEY'
])->post('https://fauxchain.io/api/simulate/tron', [
'receiver_address' => 'RECEIVER_ADDRESS',
'amount' => TRX_AMOUNT
]);
echo $response->body();
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY");
var content = new StringContent("{ \"receiver_address\": \"RECEIVER_ADDRESS\", \"amount\": TRX_AMOUNT }", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://fauxchain.io/api/simulate/tron", content);
var responseString = await response.Content.ReadAsStringAsync();
fetch('https://fauxchain.io/api/simulate/tron', {
method: 'POST',
headers: {
'X-API-KEY': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
receiver_address: 'RECEIVER_ADDRESS',
amount: TRX_AMOUNT
})
}).then(response => response.json())
.then(data => console.log(data));
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://fauxchain.io/api/simulate/tron")
request = Net::HTTP::Post.new(uri)
request["X-API-KEY"] = "YOUR_API_KEY"
request.content_type = "application/json"
request.body = JSON.dump({
"receiver_address" => "RECEIVER_ADDRESS",
"amount" => TRX_AMOUNT
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://fauxchain.io/api/simulate/tron"))
.header("X-API-KEY", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{\"receiver_address\":\"RECEIVER_ADDRESS\",\"amount\":TRX_AMOUNT}"))
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type RequestBody struct {
ReceiverAddress string `json:"receiver_address"`
Amount float64 `json:"amount"`
}
func main() {
body := RequestBody{
ReceiverAddress: "RECEIVER_ADDRESS",
Amount: TRX_AMOUNT,
}
jsonBody, _ := json.Marshal(body)
req, _ := http.NewRequest("POST", "https://fauxchain.io/api/simulate/tron", bytes.NewBuffer(jsonBody))
req.Header.Set("X-API-KEY", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}