curl --request GET \
--url https://app.blockgence.com/v1/approvals/{chain}/{addr} \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.blockgence.com/v1/approvals/{chain}/{addr}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.blockgence.com/v1/approvals/{chain}/{addr}', 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/approvals/{chain}/{addr}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://app.blockgence.com/v1/approvals/{chain}/{addr}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.blockgence.com/v1/approvals/{chain}/{addr}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/approvals/{chain}/{addr}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
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>"
}Permisos otorgados por una dirección
Devuelve cada permiso que una dirección dio sobre sus tokens, cuáles siguen abiertos hoy, cuánto puede mover
cada spender y cuándo y cómo se otorgó cada uno. Cubre approve de ERC-20, approve de un NFT por tokenId
(ERC-721), setApprovalForAll de una colección (ERC-721 y ERC-1155) y Permit2. blockgence no revoca ni firma
nada: la consulta es de solo lectura.
El estado de hoy se lee en la red a un bloque fijo (state_block), no se reconstruye desde los eventos.
Campos principales de cada permiso en permissions[]:
kind:erc20,permit2,erc721uoperator.state:open,closed,expired(Permit2 vencido),unverified(no se pudo leer: no significa cerrado) onot_checked.current: el allowance y el saldo leídos, conunlimited.exposure: lo que el spender puede mover hoy, con su valor en USD al precio actual si hay precio.granted: el último otorgamiento y cómo se hizo (via:approve,owner_tx,permit_signature,owner_contract_call,permit2_signature,permit2_approvey otros). Se analizan hasta 40 transacciones por consulta.spender: su dirección, su etiqueta y su tipo de cuenta.hints: pistas sobre un permiso abierto (spender_labeled,open_to_eoa,unlimited,signed_permit), cada una con su motivo. Ningún spender se declara drainer sin una fuente que lo diga.
summary resume los totales, coverage indica qué se leyó (cada búsqueda trae hasta 10,000 eventos) y
methodology cita las entradas que sostienen la respuesta.
Disponibilidad: en algunas redes la historia completa no está disponible. Ahí, el pedido sin ventana responde
503 source_unavailable con reason: not_configured, sin cobro, y el mensaje indica desde qué from_block se
puede pedir; con una ventana corta, la respuesta sale con coverage.route.status: degraded. Qué lecturas
ofrece cada red se consulta en GET /v1/chains.
Errores: si falla la búsqueda de permisos, la respuesta es 503, porque sin ella el resultado diría «no hay
permisos». Las demás fallas se declaran en degraded_sources y dejan el dato sin verificar, nunca cerrado.
Costo: 10 créditos de base. Algunas operaciones cobran menos si reutilizan un resultado guardado; nunca más.
curl --request GET \
--url https://app.blockgence.com/v1/approvals/{chain}/{addr} \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.blockgence.com/v1/approvals/{chain}/{addr}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.blockgence.com/v1/approvals/{chain}/{addr}', 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/approvals/{chain}/{addr}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://app.blockgence.com/v1/approvals/{chain}/{addr}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.blockgence.com/v1/approvals/{chain}/{addr}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/approvals/{chain}/{addr}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
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
Parámetros de ruta
Parámetros de consulta
Respuesta
Los permisos de la dirección, con su estado, su exposición y su origen.