Crear una vigilancia
curl --request POST \
--url https://app.blockgence.com/v1/guard/watches \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"address": "<string>",
"chain": "ethereum",
"name": "",
"purpose": "own",
"rules": {},
"shared": false
}
'import requests
url = "https://app.blockgence.com/v1/guard/watches"
payload = {
"address": "<string>",
"chain": "ethereum",
"name": "",
"purpose": "own",
"rules": {},
"shared": 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({
address: '<string>',
chain: 'ethereum',
name: '',
purpose: 'own',
rules: {},
shared: false
})
};
fetch('https://app.blockgence.com/v1/guard/watches', 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/guard/watches",
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([
'address' => '<string>',
'chain' => 'ethereum',
'name' => '',
'purpose' => 'own',
'rules' => [
],
'shared' => 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/guard/watches"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"chain\": \"ethereum\",\n \"name\": \"\",\n \"purpose\": \"own\",\n \"rules\": {},\n \"shared\": 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/guard/watches")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"chain\": \"ethereum\",\n \"name\": \"\",\n \"purpose\": \"own\",\n \"rules\": {},\n \"shared\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/guard/watches")
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 \"address\": \"<string>\",\n \"chain\": \"ethereum\",\n \"name\": \"\",\n \"purpose\": \"own\",\n \"rules\": {},\n \"shared\": 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>"
}Guard
Crear una vigilancia
Comienza a vigilar una dirección en una red. Guard registra su actividad y genera alertas según sus reglas.
Cuerpo del pedido: {"address": "0x…", "chain": "ethereum", "name": "…", "purpose": "own", "rules": {…}, "shared": false}.
purpose:own(una billetera propia, como una billetera operativa o de tesorería; valor por defecto) oadversary(la billetera de un atacante que se quiere seguir).rules: opcional. Se combina con las reglas por defecto del propósito; el catálogo está enGET /v1/guard/status.shared: contrue, la vigilancia la ve toda la organización y cualquiera que la vea puede operar sus alertas.chain: por defecto,ethereum. Las redes disponibles se indican enGET /v1/guard/status.
La vigilancia cubre la actividad desde el primer bloque que Guard lee después de crearla, no hacia atrás. Ese
bloque se informa en coverage.armed_block del detalle. Para la actividad anterior, use el rastreo. Una
dirección EVM existe en todas las redes, pero cada vigilancia cubre una sola red.
Responde la vigilancia creada.
Errores:
400: dirección inválida, red que Guard no vigila (eldetailindica cuáles sí), propósito o regla inválidos, osharedsin organización. Los contratos de un protocolo se registran conPOST /v1/guard/protocols.403: se alcanzó el límite de vigilancias del plan (10 enfree, 100 enproy 1,000 enenterprise), o la clave de API no está asignada a una persona.409: ya existe una vigilancia propia de esa dirección en esa red.422: el cuerpo del pedido trae un campo desconocido.
Costo: sin cargo.
POST
/
v1
/
guard
/
watches
Crear una vigilancia
curl --request POST \
--url https://app.blockgence.com/v1/guard/watches \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"address": "<string>",
"chain": "ethereum",
"name": "",
"purpose": "own",
"rules": {},
"shared": false
}
'import requests
url = "https://app.blockgence.com/v1/guard/watches"
payload = {
"address": "<string>",
"chain": "ethereum",
"name": "",
"purpose": "own",
"rules": {},
"shared": 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({
address: '<string>',
chain: 'ethereum',
name: '',
purpose: 'own',
rules: {},
shared: false
})
};
fetch('https://app.blockgence.com/v1/guard/watches', 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/guard/watches",
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([
'address' => '<string>',
'chain' => 'ethereum',
'name' => '',
'purpose' => 'own',
'rules' => [
],
'shared' => 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/guard/watches"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"chain\": \"ethereum\",\n \"name\": \"\",\n \"purpose\": \"own\",\n \"rules\": {},\n \"shared\": 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/guard/watches")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"chain\": \"ethereum\",\n \"name\": \"\",\n \"purpose\": \"own\",\n \"rules\": {},\n \"shared\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blockgence.com/v1/guard/watches")
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 \"address\": \"<string>\",\n \"chain\": \"ethereum\",\n \"name\": \"\",\n \"purpose\": \"own\",\n \"rules\": {},\n \"shared\": 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>"
}Autorizaciones
APIKeyHeaderBearerAuth
Encabezados
Cuerpo
application/json
Respuesta
Respuesta correcta.