M2M Sentinel Python SDK
Official Python client for the M2M Sentinel Web3 Pre-Transaction Risk Decision API on Base (Coinbase L2).
Installation
pip install m2m-sentinel
Or install from source:
pip install git+https://github.com/m2msentinel/m2m-sentinel.git#subdirectory=public/sdk/python
Quick Start
from m2m_sentinel import M2MSentinelClient
# Initialize client (uses API key in x-api-key header)
client = M2MSentinelClient(api_key="sk_starter_...")
# Perform pre-transaction audit of a smart contract address
audit_result = client.audit_contract("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
print("Security Rating:", audit_result["audit"]["securityRating"])
print("Score:", audit_result["audit"]["securityScore"])
# Get live gas fees on Base
gas = client.get_gas_fees()
print(f"Gas Price: {gas['gasPrice']['gwei']} Gwei")
# Check token prices with provenance
price = client.get_token_price("WETH")
print(f"WETH Price: ${price['token']['priceUsd']}")
Free Tier Signup (Wallet Verified)
# 1. Create a free-tier challenge
challenge = client.create_free_challenge(user_wallet="0xYourWallet")
# 2. Sign challenge['intent']['messageToSign'] with your wallet (personal_sign)
signature = "0x..." # Signature from personal_sign
# 3. Claim your free-tier key (100 credits/day, wallet verified)
claimed = client.claim_free_tier(intent_id=challenge['intent']['id'], signature=signature)
print("Your API Key:", claimed["apiKey"])
Response Handling & Provenance
Every response from M2M Sentinel includes source provenance and trust levels. Unbacked verdicts return UNVERIFIED with a None score rather than fabricated data.
PaymentRequiredError(402): HTTP 402 challenge returned when x402 payment is required.RateLimitedError(429): Burst rate limit exceeded. Checkretry_after.DataSourceUnavailableError(503): Upstream data source is down; no fake data generated.
Documentation & Specs
- Website: https://m2msentinel.vercel.app
- Interactive Docs: https://m2msentinel.vercel.app/docs.html
- OpenAPI Spec: https://m2msentinel.vercel.app/openapi.json
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
m2m_sentinel-1.0.4.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file m2m_sentinel-1.0.4.tar.gz.
File metadata
- Download URL: m2m_sentinel-1.0.4.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8401e747754604ae7c80bd45627ed1bae2b648fc848cc6fab326d24da8f3e87
|
|
| MD5 |
0fc644b5e12696c2a865218071adfaf6
|
|
| BLAKE2b-256 |
c093564280a3dee5525144720b726bacd9aca7c4052f73e1431e59c95a003aed
|
File details
Details for the file m2m_sentinel-1.0.4-py3-none-any.whl.
File metadata
- Download URL: m2m_sentinel-1.0.4-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50a1fc4bd83f53d7f135f94cd17a61330241dad9ffa702a06d3ca65826a993fb
|
|
| MD5 |
cda949693725a494eed96d2e57cd9e63
|
|
| BLAKE2b-256 |
5040bb34c1e551d2868d6b00fefe7d62d6f6342e76cdef46992ec6e0a946d5d3
|