MO

moralis-streams-api

Guides the setup and management of real-time blockchain event webhooks.

Install

mkdir -p .claude/skills/moralis-streams-api && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15518" && unzip -o skill.zip -d .claude/skills/moralis-streams-api && rm skill.zip

Installs to .claude/skills/moralis-streams-api

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Real-time blockchain event monitoring with webhooks. Use when user asks about setting up webhooks, real-time event streaming, monitoring wallet addresses, tracking token transfers in real-time, listening to all addresses on a chain, creating/updating/deleting streams, adding/removing addresses from streams, or receiving blockchain events as they happen. Supports all EVM chains. NOT for querying historical or current blockchain state - use moralis-data-api instead.
468 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Create new blockchain event streams using a PUT request.
  • Update existing streams with a POST request to a specific stream ID.
  • Delete streams by sending a DELETE request with the stream ID.
  • Retrieve a list of all configured streams.
  • Replace addresses associated with a stream using a PATCH request.
  • Configure triggers for on-chain read-only contract calls to enrich webhook data.

How it works

The skill manages real-time blockchain event monitoring by interacting with the Moralis Streams API via HTTP requests, allowing for the creation, modification, and deletion of event streams.

Inputs & outputs

You give it
Stream configuration details (e.g., webhook URL, chain IDs, event types, addresses) or a stream ID.
You get back
A newly created stream, an updated stream, a deleted stream, a list of streams, or enriched webhook data.

When to use moralis-streams-api

  • Setting up a webhook for wallet transfers
  • Tracking contract events in real-time
  • Managing stream configurations

About this skill

CRITICAL: Read Rule Files Before Implementing

The #1 cause of bugs is using wrong HTTP methods or stream configurations.

For EVERY endpoint:

  1. Read rules/{EndpointName}.md
  2. Check HTTP method (PUT for create, POST for update, DELETE for delete)
  3. Verify stream ID format (UUID, not hex)
  4. Use hex chain IDs (0x1, 0x89), not names (eth, polygon)

Reading Order:

  1. This SKILL.md (core patterns)
  2. Endpoint rule file in rules/
  3. Pattern references in references/ (for edge cases only)

Setup

API Key (optional)

Never ask the user to paste their API key into the chat. Instead:

  1. Check if MORALIS_API_KEY is set in the environment (try running [ -n "$MORALIS_API_KEY" ] && echo "API key is set" || echo "API key is NOT set").
  2. If not set, offer to create the .env file with an empty placeholder: MORALIS_API_KEY=
  3. Tell the user to open the .env file and paste their key there themselves.
  4. Let them know: without the key, you won't be able to test or call the Moralis API on their behalf.

If they don't have a key yet, point them to admin.moralis.com/register (free, no credit card).

Environment Variable Discovery

The .env file location depends on how skills are installed:

Create the .env file in the project root (same directory the user runs Claude Code from). Make sure .env is in .gitignore.

Verify Your Key

curl "https://api.moralis-streams.com/streams/evm?limit=10" \
  -H "X-API-Key: $MORALIS_API_KEY"

Base URL

https://api.moralis-streams.com

Important: Different from Data API (deep-index.moralis.io).

Authentication

All requests require: X-API-Key: $MORALIS_API_KEY


HTTP Methods (CRITICAL)

ActionMethodEndpoint
Create streamPUT/streams/evm
Update streamPOST/streams/evm/{id}
Delete streamDELETE/streams/evm/{id}
Get streamsGET/streams/evm
Replace addressesPATCH/streams/evm/{id}/address

Common mistake: Using POST to create streams. Use PUT instead.


Stream Types

TypeDescription
txNative transactions
logContract event logs
erc20transferERC20 token transfers
erc20approvalERC20 approvals
nfttransferNFT transfers
internalTxInternal transactions

Quick Reference: Most Common Patterns

Stream ID Format (ALWAYS UUID)

// WRONG - Hex format
"0x1234567890abcdef"

// CORRECT - UUID format
"YOUR_STREAM_ID"

Chain IDs (ALWAYS hex)

"0x1"     // Ethereum
"0x89"    // Polygon
"0x38"    // BSC
"0xa4b1"  // Arbitrum
"0xa"     // Optimism
"0x2105"  // Base

Event Signatures (topic0)

"Transfer(address,address,uint256)"   // ERC20/NFT Transfer
"Approval(address,address,uint256)"   // ERC20 Approval

Status Values (lowercase only)

"active"      // CORRECT - normal operating state
"paused"      // CORRECT - manually paused
"error"       // CORRECT - auto-set when webhook success rate <70%
"terminated"  // CORRECT - unrecoverable, after 24h in error
"ACTIVE"      // WRONG

Common Pitfalls (Top 5)

  1. Using POST to create streams - Use PUT instead
  2. Wrong base URL - Use api.moralis-streams.com, NOT deep-index.moralis.io
  3. Hex stream ID - Must be UUID format, not hex
  4. String chain names - Use hex (0x1), not names (eth)
  5. Uppercase status - Use lowercase ("active", "paused")
  6. Not returning 200 on test webhook - Stream won't start unless your endpoint returns 2xx on the test webhook sent during create/update

See references/CommonPitfalls.md for complete reference.


Triggers (Read-Only Contract Calls)

Enrich webhook data with on-chain reads (e.g., balanceOf). Triggers execute view/pure functions and attach results to webhook events. Supports dynamic selectors ($contract, $from, $to). See references/Triggers.md for complete reference with examples.


Native Balances in Webhooks

Configure getNativeBalances to include native token balances (ETH, BNB, etc.) in webhook payloads. Requires Business plan+. See references/UsefulStreamOptions.md for configuration details.


Delivery and Error Handling

  • Two webhooks per event: Unconfirmed (confirmed: false) + Confirmed (confirmed: true). Idempotent handlers required.
  • Streams auto-terminate after 24 hours in error state (webhook success rate <70%). This is unrecoverable — you must create a new stream.
  • Test webhook: Sent on every create/update. Must return 200 or stream won't start.

See references/DeliveryGuarantees.md and references/ErrorHandling.md.


Webhook Security

Webhooks are signed with your streams secret (different from API key).

  • Header: x-signature
  • Algorithm: sha3(JSON.stringify(body) + secret)
const verifySignature = (req, secret) => {
  const provided = req.headers["x-signature"];
  const generated = web3.utils.sha3(JSON.stringify(req.body) + secret);
  if (generated !== provided) throw new Error("Invalid Signature");
};

See references/WebhookSecurity.md for complete examples.


Testing Endpoints

WEBHOOK_URL="https://your-server.com/webhook"

# List streams (requires limit)
curl "https://api.moralis-streams.com/streams/evm?limit=100" \
  -H "X-API-Key: $MORALIS_API_KEY"

# Create stream (PUT, not POST)
curl -X PUT "https://api.moralis-streams.com/streams/evm" \
  -H "X-API-Key: $MORALIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "'${WEBHOOK_URL}'",
    "description": "Test stream",
    "tag": "test",
    "topic0": ["Transfer(address,address,uint256)"],
    "allAddresses": false,
    "chainIds": ["0x1"]
  }'

# Pause stream (POST to status)
curl -X POST "https://api.moralis-streams.com/streams/evm/<stream_id>/status" \
  -H "X-API-Key: $MORALIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "paused"}'

Quick Troubleshooting

IssueCauseSolution
"400 Bad Request"Invalid configCheck webhookUrl, topic0 format, chainIds
"404 Not Found"Wrong stream IDVerify UUID format
"Method Not Allowed"Wrong HTTP methodPUT for create, POST for update
"Missing limit"GET /streams/evmAdd ?limit=100
"No webhooks"Stream pausedCheck status is "active"

Endpoint Catalog

Complete list of all 20 Streams API endpoints organized by category.

Stream Management

Create, update, delete, and manage streams.

EndpointDescription
AddAddressToStreamAdd address to stream
CreateStreamCreate stream
DeleteAddressFromStreamDelete address from stream
DeleteStreamDelete stream
DuplicateStreamDuplicate stream
GetAddressesGet addresses by stream
GetHistoryGet history
GetLogsGet logs
GetSettingsGet project settings
GetStatsGet project stats
GetStatsByStreamIdGet project stats by Stream ID
GetStreamGet a specific evm stream.
GetStreamBlockDataByNumberGet webhook data returned on the block number with provided stream config
GetStreamBlockDataToWebhookByNumberSend webhook based on a specific block number using stream config and addresses.
GetStreamsGet streams
ReplaceAddressFromStreamReplaces address from stream
UpdateStreamUpdate stream
UpdateStreamStatusUpdate stream status

Status & Settings

Pause/resume streams and configure settings.

EndpointDescription
SetSettingsSet project settings

History & Analytics

Stream history, replay, statistics, logs, and block data.

EndpointDescription
ReplayHistoryReplay history

Listen to All Addresses

Set allAddresses: true with a topic0 and abi to monitor an event across every contract on a chain (e.g., all ERC20 transfers network-wide). Requires higher-tier plans. See references/ListenToAllAddresses.md for complete examples, ABI templates, and gotchas.

Example: Create ERC20 Transfer Monitor

curl -X PUT "https://api.moralis-streams.com/streams/evm" \
  -H "X-API-Key: $MORALIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://your-server.com/webhook",
    "description": "Monitor ERC20 transfers",
    "tag": "erc20-monitor",
    "topic0": ["Transfer(address,address,uint256)"],
    "allAddresses": true,
    "chainIds": ["0x1", "0x89"],
    "advancedOptions": [{
      "topic0": "Transfer(address,address,uint256)",
      "includeNativeHash": true
    }]
  }'

Pagination

List endpoints use cursor-based pagination:

# First page
curl "...?limit=100" -H "X-API-Key: $KEY"

# Next page
curl "...?limit=100&cursor=<cursor>" -H "X-API-Key: $KEY"

Supported Chains

All major EVM chains: Ethereum (0x1), Polygon (0x89), BSC (0x38), Arbitrum (0xa4b1), Optimism (0xa), Base (0x2105), Avalanche (0xa86a), and m


Content truncated.

When not to use it

  • Querying historical or current blockchain state.

Prerequisites

curlMORALIS_API_KEY environment variable

Limitations

  • Stream IDs must be in UUID format, not hex.
  • Chain IDs must be in hex format, not names.
  • Status values must be lowercase (e.g., 'active', 'paused').

How it compares

This skill provides a programmatic interface for real-time blockchain event monitoring through webhooks, offering immediate notifications rather than requiring manual polling or historical data queries.

Compared to similar skills

moralis-streams-api side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
moralis-streams-api (this skill)04moCautionIntermediate
aspire04moReviewIntermediate
startup04moReviewAdvanced
fastapi-templates5202moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

aspire

adamint

Orchestrates Aspire distributed applications using the Aspire CLI for running, debugging, and managing distributed apps. USE FOR: aspire start, aspire stop, start aspire app, aspire describe, list aspire integrations, debug aspire issues, view aspire logs, add aspire resource, aspire dashboard, upda

00

startup

matlockx

Use this skill for Go service bootstrapping with flachnetz/startup library. Covers options composition, auto-initialization, Postgres, Kafka, HTTP server, tracing, and environment patterns.

00

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

5201,086

android-kotlin-development

aj-geddes

Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.

268679

fastapi-pro

sickn33

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

79181

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

Search skills

Search the agent skills registry