Skip to main content

Send permissionless Telegram notifications via x402 protocol

Project description

x402-Notify Python SDK

Send permissionless Telegram notifications via x402 protocol.

Installation

pip install x402-notify

Quick Start

from x402_notify import NotifyClient

# Initialize with your wallet's private key
client = NotifyClient(wallet_key="0x...")

# Send notification - x402 payment handled automatically!
client.notify(
    chat_id="123456789",
    message="🚨 ETH dropped below $2000!"
)

How It Works

  1. SDK calls the gateway's /notify endpoint
  2. Gateway returns 402 Payment Required with payment details
  3. SDK automatically sends ETH payment to gateway
  4. SDK retries request with payment proof
  5. Gateway delivers message to Telegram

No API keys. No subscriptions. Just crypto.

Configuration

client = NotifyClient(
    wallet_key="0x...",
    gateway_url="https://notify.x402.io",  # Production gateway
    rpc_url="https://sepolia.base.org",    # Blockchain RPC
    chain_id=84532,                        # Base Sepolia
)

Get Stats

stats = client.get_stats()
print(f"Total notifications sent: {stats['totalNotifications']}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

x402_notify-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

x402_notify-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file x402_notify-0.1.0.tar.gz.

File metadata

  • Download URL: x402_notify-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for x402_notify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9dd9197ac5b2049e7e9c157b9b65b641934f222c8091b1848fa0fa6f4cee5f6e
MD5 65616c6e2ef38a15fc5705d50afd83f7
BLAKE2b-256 7d3206dcb6f382ae148bf39f25100d40708b8ddb65c1b13419b81286628d4bcd

See more details on using hashes here.

File details

Details for the file x402_notify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: x402_notify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for x402_notify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82c43d2b436caabdd41333bb3c090a82589a02cfd09345360a31fe119f8eedee
MD5 2b3af6e86609c51113fed62dfadaddc9
BLAKE2b-256 86a3cdfbf733681145cf8b32211a547530aa76e19a16a39bdb3469b421a7d283

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page