Ethereum API Documentation
Use this API to simulate Ethereum 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 Ethereum simulation features.
X-API-KEY: your_api_key_here
Simulate an Ethereum Transaction
This endpoint allows you to create a simulated Ethereum transaction between wallets on the Fauxchain network. The transaction will be processed and verified according to Ethereum network rules, but no real cryptocurrency is used.
Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
receiver_address | string | Required | The Ethereum address that will receive the transaction |
amount | float | Required | Amount of Ethereum to send (minimum 0.00000001 ETH) |
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/ethereum/tx/YOUR_TX_HASH
Replace YOUR_TX_HASH with the actual hash returned in the API response. Example:
https://fauxchain.io/explorer/ethereum/tx/0x7be38fa9306d5cb1357b3c4d5c0b6f8e2aa3d8c7f5e4d6a9b2c1f8e7d3a6b5c9
Example Request
{
"receiver_address": "0x8b1462e7a45746ee731a16f95725880b868cbb32",
"amount": 0.05
}
Example Success Response
{
"success": true,
"tx_hash": "0x7be38fa9306d...",
"sender_address": "0xYourEthereumAddress...",
"receiver_address": "0x8b1462e7a45746ee731a16f95725880b868cbb32",
"amount": 0.05,
"fee": "0.00010000",
}
Response Field Description
Field | Type | Description |
---|---|---|
tx_hash | string | Unique transaction identifier. Used to link to the explorer. |
sender_address | string | Your configured Ethereum API address |
receiver_address | string | Destination address |
amount | float | Amount transferred |
fee | float | Auto-calculated 0.2% fee |
Example Error Responses
The following errors may be returned if the request fails validation or is unauthorized:
{
"error": "Ethereum 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/ethereum"
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"receiver_address": "RECEIVER_ADDRESS",
"amount": ETHEREUM_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/ethereum', [
'receiver_address' => 'RECEIVER_ADDRESS',
'amount' => ETHEREUM_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\": ETHEREUM_AMOUNT }", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://fauxchain.io/api/simulate/ethereum", content);
var responseString = await response.Content.ReadAsStringAsync();
fetch('https://fauxchain.io/api/simulate/ethereum', {
method: 'POST',
headers: {
'X-API-KEY': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
receiver_address: 'RECEIVER_ADDRESS',
amount: ETHEREUM_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/ethereum")
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" => ETHEREUM_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/ethereum"))
.header("X-API-KEY", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{\"receiver_address\":\"RECEIVER_ADDRESS\",\"amount\":ETHEREUM_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: ETHEREUM_AMOUNT,
}
jsonBody, _ := json.Marshal(body)
req, _ := http.NewRequest("POST", "https://fauxchain.io/api/simulate/ethereum", 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)
}