Skip to main content

A Python SDK for interacting with Soroban Domains on the Stellar network

Project description

Stellar Domains SDK

A Python SDK for interacting with Soroban Domains on the Stellar network. This package provides a simple interface to interact with domain names on the Stellar blockchain.

Installation

pip install stellar-domains-sdk

Quick Start

from stellar_domains_sdk import SorobanDomainsSDK, SorobanDomainsSDKParams
from stellar_domains_sdk.exceptions import Domain404Error

# Initialize the SDK
params = SorobanDomainsSDKParams(
    rpc_url="https://soroban-testnet.stellar.org",
    contract_id="your_contract_id",
    network_passphrase="testnet",
    simulation_account="your_account",
    default_fee=100
)

sdk = SorobanDomainsSDK(params)

# Search for a domain
try:
    result = sdk.search_domain("example.xlm")
    print(f"Domain owner: {result['value']['owner']}")
except Domain404Error:
    print("Domain not found")

Features

  • Domain name parsing and searching
  • Support for both main domains and subdomains
  • Full integration with Soroban smart contracts
  • Comprehensive error handling
  • Type hints for better IDE support

API Reference

SorobanDomainsSDKParams

Parameters for initializing the SDK:

  • rpc_url: Soroban RPC endpoint URL
  • contract_id: The contract ID for the domains contract
  • network_passphrase: Network passphrase ("testnet" or "public")
  • simulation_account: Account used for simulating transactions
  • default_fee: Default fee for transactions
  • default_timeout: Optional timeout value for transactions

SorobanDomainsSDK Methods

search_domain(domain: str, sub_domain: Optional[str] = None)

Searches for a domain or subdomain on the Stellar network.

Returns a dictionary containing domain information:

  • For main domains: owner address, expiration date, collateral amount, etc.
  • For subdomains: parent domain, address, snapshot data

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

stellar_python_domains_sdk-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for stellar_python_domains_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72de21ba3b24e9b4c31626cb0bcef842e4738d0008d38a781de27dc108bcc7b9
MD5 fa7f704b21b10f01ae8aceac32bbb8d9
BLAKE2b-256 4b02dc5fdd8a41c517bd9573e77d9901f4164f07020f887d40ef7f424e09597f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stellar_python_domains_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89d1bb38b59d6ee1dd638a4bc7c4333251854a6b0df273d989c8c0eab4589f3e
MD5 e378e25fbd9b56d4ce7bb1fb69745b1f
BLAKE2b-256 8789c5e43941ee657290870c375208d3fe3701a8e89d9d55e2bd530c06061b2e

See more details on using hashes here.

Supported by

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