curl --request POST \
--url https://app.blockgence.com/v1/simulate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"from": "<string>",
"to": "<string>",
"chain": "ethereum",
"value": "0",
"data": "0x",
"block": 123,
"eval_mode": false
}
'import requests
url = "https://app.blockgence.com/v1/simulate"
payload = {
"from": "<string>",
"to": "<string>",
"chain": "ethereum",
"value": "0",
"data": "0x",
"block": 123,
"eval_mode": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
chain: 'ethereum',
value: '0',
data: '0x',
block: 123,
eval_mode: false
})
};
fetch('https://app.blockgence.com/v1/simulate', 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://app.blockgence.com/v1/simulate",
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([
'from' => '<string>',
'to' => '<string>',
'chain' => 'ethereum',
'value' => '0',
'data' => '0x',
'block' => 123,
'eval_mode' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://app.blockgence.com/v1/simulate"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"chain\": \"ethereum\",\n \"value\": \"0\",\n \"data\": \"0x\",\n \"block\": 123,\n \"eval_mode\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.blockgence.com/v1/simulate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"chain\": \"ethereum\",\n \"value\": \"0\",\n \"data\": \"0x\",\n \"block\": 123,\n \"eval_mode\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"chain\": \"ethereum\",\n \"value\": \"0\",\n \"data\": \"0x\",\n \"block\": 123,\n \"eval_mode\": false\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"error": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>",
"error": "<string>"
}{
"error": "source_unavailable",
"detail": "<string>",
"source": "<string>",
"reason": "<string>",
"retryable": true,
"chain": "<string>",
"primitive": "<string>",
"operation": "<string>",
"target": "<string>",
"http_status": 123,
"retry_after": 123,
"upstream_message": "<string>",
"source_fault": true,
"failure_cause": "<string>"
}Simular una transacción
Simula una transacción antes de firmarla: la ejecuta sobre el estado de un bloque fijo, sin firmar ni enviar nada y sin costo de gas. Una clave de API de solo lectura puede usarla.
Cuerpo (JSON):
chain: la red. Valor por defecto:ethereum.fromyto: direcciones EVM, obligatorias. La creación de contratos (sinto) no se simula.value: el valor nativo en wei, en decimal o en hexadecimal (0x…). Valor por defecto:0.data: el calldata en hexadecimal, hasta 128 KB.block: el bloque de la simulación. Sin él, la cabeza de la red menos 5 bloques. En algunas redes solo se aceptan bloques cercanos a la cabeza; fuera de esa ventana responde400con el límite.eval_mode: el modo evaluación deGET /v1/contract/{chain}/{addr}. Exigeblock.
Cualquier otro campo (gas, gasPrice, nonce o una lista de autorización EIP-7702) responde 422.
Campos principales de la respuesta:
status:success,reverted(con el motivo decodificado enrevert) orejected(la red la rechaza antes de ejecutarla, por fondos o por gas, con el motivo enrejection.reason).call,framesylogs: la llamada, el árbol de llamadas y los eventos, decodificados.movements: los cambios de saldo por cuenta y activo, conciliados con el cambio de estado.movements.from_changeses lo que gana o pierde quien firma.approvals: cada permiso que otorga o revoca (erc20,erc721,operator,permit2), con el spender y sus pistas.delegations_7702: las cuentas que la transacción dejaría delegadas.hints: las pistas de toda la simulación, cada una con su motivo. Ninguna es un veredicto: sin pistas no significa que la transacción sea segura.evidence: el bloque, la fuente y el modo (trace, con el árbol completo, oeth_call, sin él). En el modoeth_call,movements,approvalsydelegations_7702valennullcon su motivo ennull_reason:nullsignifica que no se sabe, y[], que se leyó y no hay.not_covered: las firmas off-chain (permit, Permit2, órdenes), las listas de autorización EIP-7702, las UserOperations, el orden del bloque y los contratos que detectan la simulación.
Errores: un cuerpo inválido o un bloque futuro responden 400; si no se puede simular, 503 sin cobro.
Costo: 15 créditos de base. Algunas operaciones cobran menos si reutilizan un resultado guardado; nunca más.
curl --request POST \
--url https://app.blockgence.com/v1/simulate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"from": "<string>",
"to": "<string>",
"chain": "ethereum",
"value": "0",
"data": "0x",
"block": 123,
"eval_mode": false
}
'import requests
url = "https://app.blockgence.com/v1/simulate"
payload = {
"from": "<string>",
"to": "<string>",
"chain": "ethereum",
"value": "0",
"data": "0x",
"block": 123,
"eval_mode": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
chain: 'ethereum',
value: '0',
data: '0x',
block: 123,
eval_mode: false
})
};
fetch('https://app.blockgence.com/v1/simulate', 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://app.blockgence.com/v1/simulate",
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([
'from' => '<string>',
'to' => '<string>',
'chain' => 'ethereum',
'value' => '0',
'data' => '0x',
'block' => 123,
'eval_mode' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://app.blockgence.com/v1/simulate"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"chain\": \"ethereum\",\n \"value\": \"0\",\n \"data\": \"0x\",\n \"block\": 123,\n \"eval_mode\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.blockgence.com/v1/simulate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"chain\": \"ethereum\",\n \"value\": \"0\",\n \"data\": \"0x\",\n \"block\": 123,\n \"eval_mode\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"chain\": \"ethereum\",\n \"value\": \"0\",\n \"data\": \"0x\",\n \"block\": 123,\n \"eval_mode\": false\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"error": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>",
"error": "<string>"
}{
"error": "source_unavailable",
"detail": "<string>",
"source": "<string>",
"reason": "<string>",
"retryable": true,
"chain": "<string>",
"primitive": "<string>",
"operation": "<string>",
"target": "<string>",
"http_status": 123,
"retry_after": 123,
"upstream_message": "<string>",
"source_fault": true,
"failure_cause": "<string>"
}Autorizaciones
Encabezados
Cuerpo
Una tx sin firmar. Sin gas, gasPrice, nonce ni lista de autorización 7702: el gas no se cobra y una lista de
autorización el nodo la ignora en silencio (medido el 2026-11-16), así que se rechaza en vez de simular otra cosa.
Respuesta
El resultado de la simulación, con sus movimientos, permisos y pistas.