Skip to main content

Python client SDK for Oasis ROFL.

Project description

oasis-rofl-client

Publish to PyPI PyPI version

Python client SDK for Oasis ROFL.

Installation

pip install oasis-rofl-client

Or using uv:

uv add install oasis-rofl-client

The package requires Python 3.9+ and depends on httpx for async HTTP operations.

Quickstart

The RoflClient provides async methods for interacting with ROFL services:

import asyncio
from oasis_rofl_client import RoflClient

async def main():
    client = RoflClient()
    
    key = await client.generate_key("my-key-id")
    print(f"Generated SECP256K1 key: {key}")

asyncio.run(main())

API Reference

RoflClient

The main client class for interacting with ROFL runtime services.

Constructor

RoflClient(url: str = '')
  • url: Optional URL or Unix socket path
    • If empty (default): Uses Unix socket at /run/rofl-appd.sock
    • If starts with http:// or https://: Uses HTTP transport
    • Otherwise: Treats as Unix socket path

Methods

async generate_key(key_id: str, kind: KeyKind = KeyKind.SECP256K1) -> str

Fetches or generates a cryptographic key from ROFL.

  • Parameters:
    • key_id: Identifier for the key
    • kind: Type of key to generate (default: KeyKind.SECP256K1). Available options:
      • KeyKind.RAW_256: Generate 256 bits of entropy
      • KeyKind.RAW_384: Generate 384 bits of entropy
      • KeyKind.ED25519: Generate an Ed25519 private key
      • KeyKind.SECP256K1: Generate a Secp256k1 private key
  • Returns: The private key as a hex string
  • Raises: httpx.HTTPStatusError if the request fails

Examples

For a complete working example, see examples/basic_usage.py.

Release Process

Publishing to PyPI is fully automated via GitHub Actions.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details or visit http://www.apache.org/licenses/LICENSE-2.0.

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

oasis_rofl_client-0.0.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

oasis_rofl_client-0.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file oasis_rofl_client-0.0.0.tar.gz.

File metadata

  • Download URL: oasis_rofl_client-0.0.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for oasis_rofl_client-0.0.0.tar.gz
Algorithm Hash digest
SHA256 8f1114ccbf150917bbcb794b15cf42200d4477eac03d5c3bdc2442294369e58b
MD5 dfe44a205c84123226a1710aedc7ef66
BLAKE2b-256 b4d65fa5d3ad2932971157542ac006a3e4276a643b8ff692f288b8ab4b0e56f4

See more details on using hashes here.

File details

Details for the file oasis_rofl_client-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for oasis_rofl_client-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d06fe1b42a4c238618cc5f305b59a9ef4dcc629f832caf68b5bd849717725251
MD5 601f4d52ad0bdaf13995de27084d40c7
BLAKE2b-256 647b1ef29a2798535f931db28d5e363df27dea7915bbf17b0ab30b8dbff0a2d7

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