bitculator-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Bitculator webhooks. Use when setting up Bitculator webhook handlers, debugging X-Bitculator-Signature verification, or handling the…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Bitculator Webhooks
When to Use This Skill
- How do I receive Bitculator webhooks?
- How do I verify the
X-Bitculator-Signatureheader? - How do I handle the
alarm.triggeredevent for a price alarm? - Why is my Bitculator webhook signature verification failing?
- How do I register a Bitculator webhook endpoint and get its signing secret?
Essential Code (USE THIS)
Bitculator sends X-Bitculator-Signature: t=<unix seconds>,v1=<hex>. v1 is the lowercase hex HMAC-SHA256 of "<t>.<raw body>", keyed with the whole signing secret string's UTF-8 bytes: keep the whsec_ prefix and do not base64-decode it. Sign t exactly as it appears in the header, and use the raw body bytes, not re-serialised JSON. Bitculator has no verification SDK in its docs, so verify manually.
Accept the delivery if any v1= entry matches, and ignore other keys. A header with no t=, or a t= that is not all digits, fails. Compare hex case-insensitively: require exactly 64 hex characters, lowercase, then compare in constant time.
Verification (Node.js)
const crypto = require('crypto');
// rawBody: Buffer of the exact request bytes (express.raw({ type: '*/*' }), not express.json)
function verifyBitculator(rawBody, signatureHeader, secret, toleranceSeconds = 0) {
if (!secret || !signatureHeader) return false;
let t; const v1 = [];
for (const kv of signatureHeader.split(',')) {
const i = kv.indexOf('=');
if (i <= 0) continue;
const key = kv.slice(0, i).trim(), value = kv.slice(i + 1).trim();
if (key === 't') t = value; else if (key === 'v1') v1.push(value);
}
if (!t || !/^[0-9]+$/.test(t)) return false;
if (toleranceSeconds > 0 && !(Math.abs(Math.floor(Date.now() / 1000) - Number(t)) < toleranceSeconds)) return false;
const expected = Buffer.from(crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest('hex'));
return v1.some((sig) => /^[0-9a-fA-F]{64}$/.test(sig) &&
crypto.timingSafeEqual(Buffer.from(sig.toLowerCase()), expected));
}
Verification (Python)
import hashlib, hmac, re, time
def verify_bitculator(raw_body: bytes, header: str, secret: str, tolerance: int = 0) -> bool:
if not secret or not header:
return False
t, v1 = None, []
for kv in header.split(","):
key, sep, value = kv.partition("=")
if sep and key.strip() == "t": t = value.strip()
elif sep and key.strip() == "v1": v1.append(value.strip())
if not t or not re.fullmatch(r"[0-9]+", t):
return False
if tolerance > 0 and not abs(int(time.time()) - int(t)) < tolerance:
return False
expected = hmac.new(secret.encode(), t.encode() + b"." + raw_body, hashlib.sha256).hexdigest().encode()
return any(re.fullmatch(r"[0-9a-fA-F]{64}", sig) and hmac.compare_digest(sig.lower().encode(), expected)
for sig in v1)
Respond 401 when the header is missing or empty, malformed, or the signature does not match.
Timestamp window
The timestamp window is opt-in: BITCULATOR_WEBHOOK_TOLERANCE_SECONDS is unset or 0 by default (off). Bitculator's own PHP example accepts a delivery only when abs(time() - t) < 300, so set 300 to match it when Bitculator calls you directly (t is Unix seconds; the check uses the absolute difference). Behind Hookdeck leave it off: Hookdeck retries and replays resend the original headers and timestamp, so a fixed window would reject legitimate redeliveries.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Common Event Types
| Event | Description |
|---|---|
alarm.triggered |
A price alarm fired. This is the only value Bitculator accepts in a webhook's events list |
POST /api/v1/webhooks/{id}/test sends a signed alarm.triggered test event with real signature headers, so you can verify your receiver end to end. Its body carries data: { test: true, alarm: null }.
Route on the X-Bitculator-Event header, after verifying. Bitculator names the event in X-Bitculator-Event: alarm.triggered. That header is not covered by the signature, so verify first and use it only as a routing label. The examples assume alarm.triggered when it is absent, and acknowledge (200) and skip any event they don't know.
The body. Bitculator's OpenAPI spec (https://bitculator.com/api/v1/openapi.json, the alarmTriggered callback) documents it: event, created_at and data.alarm with id, name, coin (slug, symbol, name), metric, direction (above or below), target (a decimal string) and triggered_at. The examples still check every field's type before reading into it, and acknowledge and log a non-JSON body instead of answering 500. See references/overview.md.
Important Headers
| Header | Description |
|---|---|
| `X-Bitcu |
Установить bitculator-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bitculator-webhooks?
Receive and verify Bitculator webhooks. Use when setting up Bitculator webhook handlers, debugging X-Bitculator-Signature verification, or handling the alarm.triggered price alarm event from the Bitculator crypto market data API.
Как установить скилл bitculator-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bitculator-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic