Skip to main content

Official Python SDK for RuleRunner API

Project description

RuleRunner Python SDK

Official Python SDK for the RuleRunner API - a compliance-as-a-service platform for blockchain transactions.

Installation

pip install rulerunner-sdk

Quick Start

from rulerunner_sdk import RuleRunnerClient

# Initialize the client with your API key
client = RuleRunnerClient(api_key="your_api_key")

# Check if a transaction is compliant
result = client.is_compliant(
    from_address="0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    to_address="0x742d35Cc6634C0532925a3b844Bc454e4438f44f",
    amount="10.0"
)

print(f"Transaction is compliant: {result['is_compliant']}")

# Verify a proof locally
if not result['is_compliant'] and result.get('from_address_proof'):
    is_valid = client.verify_proof_locally(
        address="0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
        proof=result['from_address_proof'],
        root=result['merkle_root']
    )
    print(f"Local proof verification: {is_valid}")

Features

  • Transaction compliance checking
  • Local proof verification
  • Health check endpoint
  • API key management
  • Rate limiting and quota tracking

API Reference

RuleRunnerClient

client = RuleRunnerClient(
    api_key: str,
    base_url: str = "https://api.rulerunner.com"  # Optional custom base URL
)

Methods

is_compliant

Check if a transaction is compliant with sanctions lists.

result = client.is_compliant(
    from_address: str,
    to_address: str,
    amount: str
)

verify_proof_locally

Verify a Merkle proof locally without making an API call.

is_valid = client.verify_proof_locally(
    address: str,
    proof: List[Dict[str, Any]],
    root: str
)

health_check

Check the health status of the API.

status = client.health_check()

Error Handling

The SDK raises custom exceptions for different error cases:

  • RuleRunnerAPIError: API-level errors (4xx, 5xx)
  • RuleRunnerConnectionError: Network/connection issues
  • RuleRunnerProofVerificationError: Invalid proof data

License

MIT License

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

rulerunner_sdk-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

rulerunner_sdk-0.1.0-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rulerunner_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for rulerunner_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07283ab54316f8b738ed2e7d40bd8a55244937a4e9233c35d5df6d96d39df726
MD5 a3b87ab77536bb42e216603fdbda57a9
BLAKE2b-256 bca4937e5e429322c772410c1ab900c23602e90cd034148993c7ba02f3a6908c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rulerunner_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for rulerunner_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51bab8ca53bce5f3ac31f127b0b3ab749636b57277f24b8758723929c52ef040
MD5 54e27597cb5e47bbd39b5d503706a9f0
BLAKE2b-256 f967dcc1445c539b8a57647e16395943e5f4340681dde0924aacef43b6a7a2f4

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