M2M Sentinel Python SDK
Python client for Base EVM bytecode capability, common-proxy resolution, and sourced market observations. Factual static capability observation — not a formal reachability audit, safety guarantee, or transaction advice.
Installation
From PyPI (Recommended)
pip install m2m-sentinel==1.2.3
From Source
git clone https://github.com/M2M-Sentinel/m2m-sentinel-sdk.git
cd m2m-sentinel-sdk/python
pip install .
Quickstart Example
from m2m_sentinel import AsyncM2MSentinelClient, M2MSentinelClient, X402SignerClient
# 1. Initialize client (defaults to https://api.m2msentinel.com)
client = M2MSentinelClient(api_key="sk_starter_...")
# Observe static capabilities for a Base smart contract
response = client.audit_contract("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
audit = response["audit"]
print("Capability Rating:", audit["capabilityRating"])
print("Proxy Resolution:", audit["proxyResolution"])
# Observe one exact transaction at a pinned Base block before applying
# caller-owned signing policy. This is evidence, not a safety decision.
transaction = {
"chainId": 8453,
"to": "0x1111111111111111111111111111111111111111",
"data": "0x40c10f19",
}
preflight = client.preflight_transaction(transaction)
print("Executing target:", preflight.get("resolvedExecutionTarget"))
print("Observation block:", preflight["observationBlock"])
# The async facade uses the same JSON body and header-only credentials.
# asyncio.run(AsyncM2MSentinelClient(api_key="sk_starter_...").preflight_transaction(transaction))
# 2. Autonomous Headless x402 Micropayments (EIP-3009 Local Signing)
signer = X402SignerClient(private_key="0x...")
paid_res = signer.fetch_with_auto_payment("/v1/audit/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
print("Paid analysis:", paid_res["data"])
# Get capability index (fewer observed risky static patterns = higher score)
index = client.get_capability_score("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
print("Capability Score:", index["capabilityScore"], index["scoreMeaning"])
# Schematic paid-onboarding example. Supply these values from your private
# server/wallet flow; never hard-code credentials.
wallet_address = "0xYOUR_SUBSCRIBER_WALLET"
existing_paid_key = "READ_FROM_YOUR_SECRET_STORE"
original_payment_hash = "0xYOUR_ORIGINAL_PAYMENT_HASH"
intent = client.create_subscription_intent(
"GROWTH", wallet_address, duration_days=90,
renew_existing_key=True, api_key=existing_paid_key
)
recovery = client.create_recovery_challenge(wallet_address, tx_hash=original_payment_hash)
Method Reference
| Method | Description |
|---|---|
audit_contract(address) |
Returns static opcode capability flags, proxy resolution (EIP-1967/UUPS), and bytecode provenance on Base. |
preflight_transaction(transaction) |
Resolves the supplied selector's executing target at one pinned Base block and returns evidence or an explicit incomplete state; it does not make a safety decision. |
AsyncM2MSentinelClient.preflight_transaction(transaction) |
Async facade for the same header-authenticated transaction-specific observation. |
get_capability_score(address) |
Evaluates observed static capability patterns. (Retains /v1/security/score/:address for backwards compatibility). |
get_gas_metrics() |
Fetches real-time Base network gas suggestions and congestion telemetry. |
get_token_price(symbol) |
Sourced Base DEX price observation for allowlisted assets (USDC, WETH, etc.). |
get_dex_liquidity(address) |
Sourced DEX reserve and liquidity data on Base. |
Important Notice
The route behind get_capability_score retains /v1/security/score/:address for legacy compatibility, but its value means only that fewer selected static patterns were observed. Factual static capability observation — not a formal reachability audit, safety guarantee, or transaction advice.
Metadata
Release files for m2m-sentinel 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| m2m_sentinel-1.2.3.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| m2m_sentinel-1.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.5 kB
Release files / m2m_sentinel-1.2.3.tar.gz
| Download URL | m2m_sentinel-1.2.3.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8984e47a41482b696c8a54839c5343742ada6eb69966891cadc14e8d2583fe3c
|
|
BLAKE2b-256 checksum How to use checksums |
71ceff2c5a2de50358ca57fdc46da1d2e9067013706d9c0cd4120e2e12d0d7a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logRelease files / m2m_sentinel-1.2.3-py3-none-any.whl
| Download URL | m2m_sentinel-1.2.3-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28029532da192127766ac5b09e3e35fa479db498e8a0875c4ec4d9eb070f4d7f
|
|
BLAKE2b-256 checksum How to use checksums |
92d60065489f6022b34617baf8c2f22348244c8390e088b7a3f3f8c2348f7323
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency log