Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

nansen-alerts-webhook-listenernansen 警报 webhook 侦听器

Agent Skill

nansen-alerts-webhook-listener 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,592

周安装

108

GitHub Stars

公开资料未说明

下载量

864
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nansen-alerts-webhook-listener(nansen 警报 webhook 侦听器)
来源仓库:https://github.com/nansen-devops/nansen-alerts-webhook-listener
安装命令:
openclaw skills install nansen-alerts-webhook-listener
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install nansen-alerts-webhook-listener

简介

设置本地 Webhook 服务器接收 Nansen 智能警报。

  • 支持 HMAC 签名验证与公共隧道实时传输。
  • 适用于实时监控钱包活动与市场变化场景。
  • 需配置本地端口转发与安全验证机制。
  • 注意防火墙设置与数据传输安全性。nansen-alerts-webhook-listener 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
nansen-alerts-webhook-listener
description
Set up a local webhook server to receive Nansen smart alerts in real-time with HMAC signature verification and public tunneling. Use when a user wants to listen for alerts on their local machine.
metadata
openclaw
requires
env
bins
primaryEnv
NANSEN_API_KEY
install
package
nansen-cli
bins
[nansen]
allowed-tools
Bash(nansen:*), Bash(node:*), Bash(npx:*), Bash(ngrok:*), Write

Alert Webhook Listener

Set up a local HTTP server to receive Nansen smart alert webhook payloads in real-time.

How It Works

Nansen smart alerts support a webhook channel type. When an alert fires, Nansen sends an HTTP POST with a JSON payload to your webhook URL. This skill sets up:

  1. A local HTTP server (Node.js, zero external dependencies) that receives and displays alert payloads
  2. HMAC-SHA256 signature verification so only authentic Nansen payloads are accepted
  3. A public tunnel so Nansen's servers can reach your local machine

This skill does NOT create or modify alerts. It sets up the listener infrastructure and then provides a summary of what the user needs to do to start receiving alerts.

OpenClaw users: If OpenClaw is running locally on the same machine, the webhook server can forward verified alert payloads to OpenClaw's Gateway (/hooks/agent), triggering an agent turn for each alert. Set the OPENCLAW_GATEWAY_URL env var to enable this. See the OpenClaw Integration section below.

Security Warning

Before proceeding, inform the user:

This skill starts an HTTP server on your machine and exposes it to the internet via a tunnel (ngrok or localtunnel). While the server only binds to localhost (127.0.0.1) — meaning no one on your local network can access it directly — the tunnel creates a public URL that anyone on the internet can send requests to. Mitigations in place: - HMAC-SHA256 signature verification rejects all requests not signed by Nansen - 1 MB body size limit prevents memory abuse - Only POST /webhook and GET /health are accepted; everything else returns 404 You should be aware that: - The tunnel URL is publicly discoverable (ngrok URLs can be enumerated) - Unsigned requests still reach your machine — they're rejected, but the connection is made - Stop the tunnel when you're done to close the public endpoint

Wait for the user to confirm they want to proceed before continuing.

Execution Plan

Follow these steps in order. Do not skip signature verification — it is mandatory.

Step 0: Choose a tunnel provider

Before starting, ask the user which tunnel provider they want to use:

ngrok (recommended)localtunnel
StabilityStable — persistent connections with keepaliveFlaky — free relay drops idle connections without warning, tunnels die randomly
Installbrew install ngrok + free account at ngrok.comZero install (npx localtunnel)
HTTPSYesYes
Auth requiredYes (free authtoken from ngrok.com)No

Recommend ngrok. localtunnel is convenient but unreliable — in testing, tunnels silently exit after minutes, causing alerts to fail with "503 Tunnel Unavailable". ngrok maintains stable connections.

Check if ngrok is available:

which ngrok && ngrok version

If not installed, tell the user:

  1. brew install ngrok (or download from ngrok.com)
  2. Create a free account at ngrok.com and copy the authtoken
  3. ngrok config add-authtoken <token>

If the user prefers localtunnel or can't install ngrok, proceed with localtunnel but warn them that the tunnel may drop and they'll need to restart it and update their alert's webhook URL.

Step 1: Generate a webhook secret

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Store the output — you need it for both the server and the alert configuration. Never log or echo the secret after this point.

Step 2: Write the webhook receiver script

Create nansen-webhook-server.mjs in the current working directory. Use only Node.js built-in modules (node:http, node:crypto). No npm install required.

Requirements — do not deviate:

RequirementDetail
Bind address127.0.0.1 only — never 0.0.0.0
Default port9477 (override via PORT env var)
Webhook pathPOST /webhook — reject all other method/path combos with 404
Health checkGET /health → 200 {"status":"ok"}
Signature verificationVerify x-nansen-signature header using HMAC-SHA256 with timing-safe comparison. Reject 401 on mismatch.
Secret validationExit on startup if WEBHOOK_SECRET env var is missing or < 16 chars
Payload loggingPretty-print valid JSON payloads to stdout with ISO timestamp
Request size limitReject bodies > 1 MB (413) to prevent memory abuse
Graceful shutdownHandle SIGINT and SIGTERM — close server, then exit
OpenClaw forwardingIf OPENCLAW_GATEWAY_URL env var is set, forward verified payloads to <url>/hooks/agent via POST. Include OPENCLAW_AUTH_TOKEN as Bearer token if set. Log forward success/failure.
No dependenciesOnly node:http, node:https, and node:crypto — nothing from npm

Signature verification — use timing-safe comparison:

import { createHmac, timingSafeEqual } from 'node:crypto';

function verifySignature(rawBody, signatureHeader, secret) {
  if (!signatureHeader || !secret) return false;
  // Nansen sends "sha256=<hex>" — strip the prefix before comparing
  const sig = signatureHeader.startsWith('sha256=') ? signatureHeader.slice(7) : signatureHeader;
  const expected = createHmac('sha256', secret).update(rawBody).digest('hex');
  try {
    return timingSafeEqual(Buffer.from(sig, 'utf8'), Buffer.from(expected, 'utf8'));
  } catch {
    return false; // length mismatch
  }
}

Full server template:

import { createServer } from 'node:http';
import { createHmac, timingSafeEqual } from 'node:crypto';

const PORT = parseInt(process.env.PORT || '9477', 10);
const SECRET = process.env.WEBHOOK_SECRET;
const MAX_BODY = 1_048_576; // 1 MB

// Optional: forward verified payloads to a local OpenClaw Gateway
const OPENCLAW_URL = process.env.OPENCLAW_GATEWAY_URL; // e.g. http://localhost:3000
const OPENCLAW_TOKEN = process.env.OPENCLAW_AUTH_TOKEN;

if (!SECRET || SECRET.length < 16) {
  console.error('WEBHOOK_SECRET env var required (minimum 16 characters).');
  console.error('Generate one: node -e "console.log(require(\'crypto\').randomBytes(32).toString(\'hex\'))"');
  process.exit(1);
}

function verifySignature(rawBody, signatureHeader) {
  if (!signatureHeader) return false;
  // Nansen sends "sha256=<hex>" — strip the prefix before comparing
  const sig = signatureHeader.startsWith('sha256=') ? signatureHeader.slice(7) : signatureHeader;
  const expected = createHmac('sha256', SECRET).update(rawBody).digest('hex');
  try {
    return timingSafeEqual(Buffer.from(sig, 'utf8'), Buffer.from(expected, 'utf8'));
  } catch {
    return false;
  }
}

async function forwardToOpenClaw(payload) {
  if (!OPENCLAW_URL) return;
  const url = `${OPENCLAW_URL.replace(/\/+$/, '')}/hooks/agent`;
  const headers = { 'Content-Type': 'application/json' };
  if (OPENCLAW_TOKEN) headers['Authorization'] = `Bearer ${OPENCLAW_TOKEN}`;
  try {
    const res = await fetch(url, {
      method: 'POST',
      headers,
      body: JSON.stringify(payload),
    });
    if (res.ok) {
      console.log(`[${ts()}] Forwarded to OpenClaw (${res.status})`);
    } else {
      console.error(`[${ts()}] OpenClaw forward failed (${res.status})`);
    }
  } catch (err) {
    console.error(`[${ts()}] OpenClaw forward error: ${err.message}`);
  }
}

function ts() { return new Date().toISOString(); }

const server = createServer((req, res) => {
  if (req.method === 'GET' && req.url === '/health') {
    res.writeHead(200, { 'Content-Type': 'application/json' });
    return res.end('{"status":"ok"}');
  }

  if (req.method !== 'POST' || req.url !== '/webhook') {
    res.writeHead(404);
    return res.end();
  }

  let size = 0;
  const chunks = [];

  req.on('data', (chunk) => {
    size += chunk.length;
    if (size > MAX_BODY) {
      res.writeHead(413);
      res.end('{"error":"Payload too large"}');
      req.destroy();
      return;
    }
    chunks.push(chunk);
  });

  req.on('end', () => {
    if (res.writableEnded) return;

    const rawBody = Buffer.concat(chunks).toString('utf8');
    const signature = req.headers['x-nansen-signature'];

    if (!verifySignature(rawBody, signature)) {
      console.error(`[${ts()}] REJECTED — invalid signature`);
      res.writeHead(401, { 'Content-Type': 'application/json' });
      return res.end('{"error":"Invalid signature"}');
    }

    let payload;
    try {
      payload = JSON.parse(rawBody);
      console.log(`\
[${ts()}] Alert received:`);
      console.log(JSON.stringify(payload, null, 2));
    } catch {
      console.error(`[${ts()}] WARNING — valid signature but malformed JSON`);
    }

    // Forward to OpenClaw if configured (fire-and-forget — don't block response)
    if (payload) forwardToOpenClaw(payload);

    res.writeHead(200, { 'Content-Type': 'application/json' });
    res.end('{"received":true}');
  });
});

for (const sig of ['SIGINT', 'SIGTERM']) {
  process.on(sig, () => {
    console.log(`\
${sig} — shutting down`);
    server.close(() => process.exit(0));
  });
}

server.listen(PORT, '127.0.0.1', () => {
  console.log(`Webhook listener ready — http://127.0.0.1:${PORT}/webhook`);
  if (OPENCLAW_URL) console.log(`OpenClaw forwarding → ${OPENCLAW_URL}/hooks/agent`);
  console.log('Waiting for alerts… (Ctrl+C to stop)\
');
});

Step 3: Start the server and tunnel

Start the server:

WEBHOOK_SECRET='<secret>' node nansen-webhook-server.mjs

Then start a public tunnel so Nansen's servers can reach it.

ngrok (recommended):

ngrok http 9477

Get the public URL from ngrok's output or its local API:

curl -s http://127.0.0.1:4040/api/tunnels | node -e "process.stdin.on('data',d=>console.log(JSON.parse(d).tunnels[0]?.public_url))"

The webhook URL is https://<subdomain>.ngrok-free.dev/webhook.

localtunnel (fallback — unreliable):

npx localtunnel --port 9477

Prints a URL like https://xxx.loca.lt. The webhook URL is https://xxx.loca.lt/webhook.

Warning: localtunnel's free relay silently drops connections after minutes. When this happens, all alerts fail with "503 Tunnel Unavailable" until you restart the tunnel and update the alert webhook URL. Use ngrok unless you have a reason not to.

Note: Tunnel URLs are ephemeral — they change every restart. For permanent setups, deploy the server to a host with a static URL.

Step 4: Provide a next-steps summary

Do NOT create or modify any alerts. Instead, print a clear summary for the user explaining what was set up and what they need to do next.

The summary MUST include:

  1. Confirmation of what was created (the server script path and the generated secret)
  2. The commands to start the server and tunnel (with the actual secret filled in)
  3. The exact nansen alerts create or nansen alerts update command they should run, with the --webhook and --webhook-secret flags filled in with the tunnel URL and secret — but leave the alert-specific flags (--name, --type, --chains, etc.) as placeholders for the user to fill in
  4. A reminder that the server and tunnel must be running before the alert is created (Nansen validates the webhook endpoint on creation)
  5. A note that tunnel URLs are ephemeral and will change on restart

Example summary format:

## Webhook listener ready

**Server script:** ./nansen-webhook-server.mjs
**Port:** 9477

### To start receiving alerts:

1. Start the server (keep this terminal open):
   WEBHOOK_SECRET='<actual-secret>' node nansen-webhook-server.mjs

2. In a new terminal, start the tunnel:
   ngrok http 9477          # recommended
   # or: npx localtunnel --port 9477  (unreliable — tunnel drops silently)

3. Create an alert pointing to your webhook (fill in your alert details):
   nansen alerts create \
     --name '<your alert name>' \
     --type <sm-token-flows|common-token-transfer|smart-contract-call> \
     --chains <chains> \
     --webhook 'https://<your-tunnel-url>/webhook' \
     --webhook-secret '<actual-secret>' \
     [type-specific flags...]

   Or add the webhook to an existing alert:
   nansen alerts update <alert-id> \
     --webhook 'https://<your-tunnel-url>/webhook' \
     --webhook-secret '<actual-secret>'

Note: The tunnel URL changes each time you restart. Update the alert
webhook URL if you restart the tunnel.

See `nansen alerts create --help` for full flag reference per alert type.

Security Checklist

  • Always use a webhook secret — the server refuses to start without one
  • Always verify signatures — never accept unverified payloads
  • Bind to localhost only — the tunnel handles public exposure; direct 0.0.0.0 binding exposes you to unauthenticated traffic
  • Use HTTPS — both localtunnel and ngrok tunnel via HTTPS by default
  • Body size limit — the 1 MB cap prevents memory exhaustion from oversized requests
  • Timing-safe comparison — prevents timing side-channel attacks on the signature

Troubleshooting

SymptomFix
"Invalid signature" on every requestEnsure the exact same secret is in WEBHOOK_SECRET and --webhook-secret
"Failed to send welcome message" on alert createStart the server and tunnel before creating the alert
No alerts arrivingCheck nansen alerts list --table — is the alert enabled? Is the webhook URL correct (includes /webhook)?
Tunnel URL expired / tunnel diedRestart the tunnel, get the new URL, then nansen alerts update <id> --webhook '<new-url>/webhook'. If this keeps happening, switch from localtunnel to ngrok.
Port already in useSet a different port: PORT=9478 WEBHOOK_SECRET='...' node nansen-webhook-server.mjs and update the tunnel accordingly

OpenClaw Integration

If the user is running OpenClaw locally on the same machine, the webhook server can forward verified alert payloads to OpenClaw's Gateway, triggering an agent turn for each alert.

Flow: Nansen → ngrok → webhook server (signature check) → OpenClaw /hooks/agent

Additional env vars

VarRequiredPurpose
OPENCLAW_GATEWAY_URLYesOpenClaw Gateway base URL (e.g. http://localhost:3000)
OPENCLAW_AUTH_TOKENIf auth enabledBearer token for OpenClaw webhook endpoints

Start command (with OpenClaw forwarding)

WEBHOOK_SECRET='<secret>' \
OPENCLAW_GATEWAY_URL='http://localhost:3000' \
OPENCLAW_AUTH_TOKEN='<token>' \
node nansen-webhook-server.mjs

The server logs both the alert payload and the OpenClaw forward status. If OpenClaw is unreachable, the forward fails silently (the alert is still logged to stdout).

Ask the user

Before enabling OpenClaw forwarding, ask:

  1. Is OpenClaw running locally? What port?
  2. Does their Gateway require auth? If so, what's the Bearer token?

If they don't know or aren't running OpenClaw, skip — the server works fine standalone.

Notes

  • The server uses zero npm dependencies — only Node.js built-ins
  • One server can receive alerts from multiple Nansen alerts (as long as they share the same webhook secret)
  • For production use, deploy to a cloud host with a static URL and run behind a reverse proxy with TLS
  • The x-nansen-signature header format is sha256=<HMAC-SHA256(secret, rawBody)> — strip the sha256= prefix before comparing

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

96.68%
按下载量换算835

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills