Transaction Simulation
curl --request POST \
--url https://service.hashdit.io/v2/hashdit/txn-simulation \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"chain_id": "56",
"block_height": "58083468",
"evm_transactions": [
{
"from": "0xfe4e28082959fc24d602719178bFC30d853a11D8",
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"value": "0",
"gas_limit": "300000",
"gas_price": "150000000",
"data": "0x...",
"force": true
}
],
"requested_items": {
"balance_changes": true,
"approve_changes": false,
"ownership_changes": false,
"involved_address_risks": true,
"invocation_tree": false
},
"request_source": "Diting"
}
'import requests
url = "https://service.hashdit.io/v2/hashdit/txn-simulation"
payload = {
"chain_id": "56",
"block_height": "58083468",
"evm_transactions": [
{
"from": "0xfe4e28082959fc24d602719178bFC30d853a11D8",
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"value": "0",
"gas_limit": "300000",
"gas_price": "150000000",
"data": "0x...",
"force": True
}
],
"requested_items": {
"balance_changes": True,
"approve_changes": False,
"ownership_changes": False,
"involved_address_risks": True,
"invocation_tree": False
},
"request_source": "Diting"
}
headers = {
"Content-Type": "<content-type>",
"X-API-Key": "<x-api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', 'X-API-Key': '<x-api-key>'},
body: JSON.stringify({
chain_id: '56',
block_height: '58083468',
evm_transactions: [
{
from: '0xfe4e28082959fc24d602719178bFC30d853a11D8',
to: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
value: '0',
gas_limit: '300000',
gas_price: '150000000',
data: '0x...',
force: true
}
],
requested_items: {
balance_changes: true,
approve_changes: false,
ownership_changes: false,
involved_address_risks: true,
invocation_tree: false
},
request_source: 'Diting'
})
};
fetch('https://service.hashdit.io/v2/hashdit/txn-simulation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://service.hashdit.io/v2/hashdit/txn-simulation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain_id' => '56',
'block_height' => '58083468',
'evm_transactions' => [
[
'from' => '0xfe4e28082959fc24d602719178bFC30d853a11D8',
'to' => '0x10ED43C718714eb63d5aA57B78B54704E256024E',
'value' => '0',
'gas_limit' => '300000',
'gas_price' => '150000000',
'data' => '0x...',
'force' => true
]
],
'requested_items' => [
'balance_changes' => true,
'approve_changes' => false,
'ownership_changes' => false,
'involved_address_risks' => true,
'invocation_tree' => false
],
'request_source' => 'Diting'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://service.hashdit.io/v2/hashdit/txn-simulation"
payload := strings.NewReader("{\n \"chain_id\": \"56\",\n \"block_height\": \"58083468\",\n \"evm_transactions\": [\n {\n \"from\": \"0xfe4e28082959fc24d602719178bFC30d853a11D8\",\n \"to\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\",\n \"value\": \"0\",\n \"gas_limit\": \"300000\",\n \"gas_price\": \"150000000\",\n \"data\": \"0x...\",\n \"force\": true\n }\n ],\n \"requested_items\": {\n \"balance_changes\": true,\n \"approve_changes\": false,\n \"ownership_changes\": false,\n \"involved_address_risks\": true,\n \"invocation_tree\": false\n },\n \"request_source\": \"Diting\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://service.hashdit.io/v2/hashdit/txn-simulation")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<x-api-key>")
.body("{\n \"chain_id\": \"56\",\n \"block_height\": \"58083468\",\n \"evm_transactions\": [\n {\n \"from\": \"0xfe4e28082959fc24d602719178bFC30d853a11D8\",\n \"to\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\",\n \"value\": \"0\",\n \"gas_limit\": \"300000\",\n \"gas_price\": \"150000000\",\n \"data\": \"0x...\",\n \"force\": true\n }\n ],\n \"requested_items\": {\n \"balance_changes\": true,\n \"approve_changes\": false,\n \"ownership_changes\": false,\n \"involved_address_risks\": true,\n \"invocation_tree\": false\n },\n \"request_source\": \"Diting\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.hashdit.io/v2/hashdit/txn-simulation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<x-api-key>'
request.body = "{\n \"chain_id\": \"56\",\n \"block_height\": \"58083468\",\n \"evm_transactions\": [\n {\n \"from\": \"0xfe4e28082959fc24d602719178bFC30d853a11D8\",\n \"to\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\",\n \"value\": \"0\",\n \"gas_limit\": \"300000\",\n \"gas_price\": \"150000000\",\n \"data\": \"0x...\",\n \"force\": true\n }\n ],\n \"requested_items\": {\n \"balance_changes\": true,\n \"approve_changes\": false,\n \"ownership_changes\": false,\n \"involved_address_risks\": true,\n \"invocation_tree\": false\n },\n \"request_source\": \"Diting\"\n}"
response = http.request(request)
puts response.read_body{
"code": "000000000",
"status": "OK",
"type": "GENERAL",
"data": {
"involved_addresses": [
"0xfe4e28082959fc24d602719178bfc30d853a11d8",
"0x10ed43c718714eb63d5aa57b78b54704e256024e",
"0x55d398326f99059ff775485246999027b3197955"
],
"involved_addresses_risks": [
{
"address": "0x55d398326f99059ff775485246999027b3197955",
"risk_level": 0,
"score": 100
},
{
"address": "0x51d0efe2ad6fe5c44528c8f2b3a80ab727c3a3fc",
"risk_level": 4,
"score": 60
}
],
"txn_summaries": [
{
"from": "0xfe4e28082959fc24d602719178bFC30d853a11D8",
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"gas_used": 229454,
"effective_gas_price": 150000000,
"called_addresses": [
"0x10ed43c718714eb63d5aa57b78b54704e256024e",
"0x55d398326f99059ff775485246999027b3197955"
],
"balance_changes": [
{
"tokenName": "Binance-Peg BSC-USD",
"symbol": "BSC-USD",
"token_address": "0x55d398326f99059ff775485246999027b3197955",
"change_list": [
{
"address": "0xfe4e28082959fc24d602719178bfc30d853a11d8",
"amount_change": "228.257892352717276327",
"value_usd": "228.155861074835611704"
}
]
}
]
}
]
},
"error_data": null
}{
"code": "<string>",
"status": "<string>"
}{
"code": "403",
"message": "invalid apiKey: apiKey invalid",
"apiKey": ""
}{
"code": "429",
"status": "error",
"message": "Rate limit exceeded"
}Transaction Simulation
Transaction Simulation
Simulates one or more EVM transactions without broadcasting them on-chain. The API evaluates token balance changes, approvals, ownership transfers, and address-level security risks to help detect malicious or unexpected behavior before execution.
POST
/
v2
/
hashdit
/
txn-simulation
Transaction Simulation
curl --request POST \
--url https://service.hashdit.io/v2/hashdit/txn-simulation \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"chain_id": "56",
"block_height": "58083468",
"evm_transactions": [
{
"from": "0xfe4e28082959fc24d602719178bFC30d853a11D8",
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"value": "0",
"gas_limit": "300000",
"gas_price": "150000000",
"data": "0x...",
"force": true
}
],
"requested_items": {
"balance_changes": true,
"approve_changes": false,
"ownership_changes": false,
"involved_address_risks": true,
"invocation_tree": false
},
"request_source": "Diting"
}
'import requests
url = "https://service.hashdit.io/v2/hashdit/txn-simulation"
payload = {
"chain_id": "56",
"block_height": "58083468",
"evm_transactions": [
{
"from": "0xfe4e28082959fc24d602719178bFC30d853a11D8",
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"value": "0",
"gas_limit": "300000",
"gas_price": "150000000",
"data": "0x...",
"force": True
}
],
"requested_items": {
"balance_changes": True,
"approve_changes": False,
"ownership_changes": False,
"involved_address_risks": True,
"invocation_tree": False
},
"request_source": "Diting"
}
headers = {
"Content-Type": "<content-type>",
"X-API-Key": "<x-api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', 'X-API-Key': '<x-api-key>'},
body: JSON.stringify({
chain_id: '56',
block_height: '58083468',
evm_transactions: [
{
from: '0xfe4e28082959fc24d602719178bFC30d853a11D8',
to: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
value: '0',
gas_limit: '300000',
gas_price: '150000000',
data: '0x...',
force: true
}
],
requested_items: {
balance_changes: true,
approve_changes: false,
ownership_changes: false,
involved_address_risks: true,
invocation_tree: false
},
request_source: 'Diting'
})
};
fetch('https://service.hashdit.io/v2/hashdit/txn-simulation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://service.hashdit.io/v2/hashdit/txn-simulation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain_id' => '56',
'block_height' => '58083468',
'evm_transactions' => [
[
'from' => '0xfe4e28082959fc24d602719178bFC30d853a11D8',
'to' => '0x10ED43C718714eb63d5aA57B78B54704E256024E',
'value' => '0',
'gas_limit' => '300000',
'gas_price' => '150000000',
'data' => '0x...',
'force' => true
]
],
'requested_items' => [
'balance_changes' => true,
'approve_changes' => false,
'ownership_changes' => false,
'involved_address_risks' => true,
'invocation_tree' => false
],
'request_source' => 'Diting'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://service.hashdit.io/v2/hashdit/txn-simulation"
payload := strings.NewReader("{\n \"chain_id\": \"56\",\n \"block_height\": \"58083468\",\n \"evm_transactions\": [\n {\n \"from\": \"0xfe4e28082959fc24d602719178bFC30d853a11D8\",\n \"to\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\",\n \"value\": \"0\",\n \"gas_limit\": \"300000\",\n \"gas_price\": \"150000000\",\n \"data\": \"0x...\",\n \"force\": true\n }\n ],\n \"requested_items\": {\n \"balance_changes\": true,\n \"approve_changes\": false,\n \"ownership_changes\": false,\n \"involved_address_risks\": true,\n \"invocation_tree\": false\n },\n \"request_source\": \"Diting\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://service.hashdit.io/v2/hashdit/txn-simulation")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<x-api-key>")
.body("{\n \"chain_id\": \"56\",\n \"block_height\": \"58083468\",\n \"evm_transactions\": [\n {\n \"from\": \"0xfe4e28082959fc24d602719178bFC30d853a11D8\",\n \"to\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\",\n \"value\": \"0\",\n \"gas_limit\": \"300000\",\n \"gas_price\": \"150000000\",\n \"data\": \"0x...\",\n \"force\": true\n }\n ],\n \"requested_items\": {\n \"balance_changes\": true,\n \"approve_changes\": false,\n \"ownership_changes\": false,\n \"involved_address_risks\": true,\n \"invocation_tree\": false\n },\n \"request_source\": \"Diting\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.hashdit.io/v2/hashdit/txn-simulation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<x-api-key>'
request.body = "{\n \"chain_id\": \"56\",\n \"block_height\": \"58083468\",\n \"evm_transactions\": [\n {\n \"from\": \"0xfe4e28082959fc24d602719178bFC30d853a11D8\",\n \"to\": \"0x10ED43C718714eb63d5aA57B78B54704E256024E\",\n \"value\": \"0\",\n \"gas_limit\": \"300000\",\n \"gas_price\": \"150000000\",\n \"data\": \"0x...\",\n \"force\": true\n }\n ],\n \"requested_items\": {\n \"balance_changes\": true,\n \"approve_changes\": false,\n \"ownership_changes\": false,\n \"involved_address_risks\": true,\n \"invocation_tree\": false\n },\n \"request_source\": \"Diting\"\n}"
response = http.request(request)
puts response.read_body{
"code": "000000000",
"status": "OK",
"type": "GENERAL",
"data": {
"involved_addresses": [
"0xfe4e28082959fc24d602719178bfc30d853a11d8",
"0x10ed43c718714eb63d5aa57b78b54704e256024e",
"0x55d398326f99059ff775485246999027b3197955"
],
"involved_addresses_risks": [
{
"address": "0x55d398326f99059ff775485246999027b3197955",
"risk_level": 0,
"score": 100
},
{
"address": "0x51d0efe2ad6fe5c44528c8f2b3a80ab727c3a3fc",
"risk_level": 4,
"score": 60
}
],
"txn_summaries": [
{
"from": "0xfe4e28082959fc24d602719178bFC30d853a11D8",
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"gas_used": 229454,
"effective_gas_price": 150000000,
"called_addresses": [
"0x10ed43c718714eb63d5aa57b78b54704e256024e",
"0x55d398326f99059ff775485246999027b3197955"
],
"balance_changes": [
{
"tokenName": "Binance-Peg BSC-USD",
"symbol": "BSC-USD",
"token_address": "0x55d398326f99059ff775485246999027b3197955",
"change_list": [
{
"address": "0xfe4e28082959fc24d602719178bfc30d853a11d8",
"amount_change": "228.257892352717276327",
"value_usd": "228.155861074835611704"
}
]
}
]
}
]
},
"error_data": null
}{
"code": "<string>",
"status": "<string>"
}{
"code": "403",
"message": "invalid apiKey: apiKey invalid",
"apiKey": ""
}{
"code": "429",
"status": "error",
"message": "Rate limit exceeded"
}Headers
Must be set to application/json
Your HashDit API key (required for production use)
Body
application/json
Transaction simulation request
The network chain ID. See Supported Chains for a complete list of supported networks for this endpoint.
Example:
"56"
Block height used as the simulation context.
Example:
"58083468"
List of EVM transactions to simulate.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Identifier for the request source (e.g. application name).
Example:
"Diting"
Was this page helpful?
⌘I