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 URLcontract_id
: The contract ID for the domains contractnetwork_passphrase
: Network passphrase ("testnet" or "public")simulation_account
: Account used for simulating transactionsdefault_fee
: Default fee for transactionsdefault_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stellar_python_domains_sdk-0.1.0.tar.gz
.
File metadata
- Download URL: stellar_python_domains_sdk-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72de21ba3b24e9b4c31626cb0bcef842e4738d0008d38a781de27dc108bcc7b9 |
|
MD5 | fa7f704b21b10f01ae8aceac32bbb8d9 |
|
BLAKE2b-256 | 4b02dc5fdd8a41c517bd9573e77d9901f4164f07020f887d40ef7f424e09597f |
File details
Details for the file stellar_python_domains_sdk-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: stellar_python_domains_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d1bb38b59d6ee1dd638a4bc7c4333251854a6b0df273d989c8c0eab4589f3e |
|
MD5 | e378e25fbd9b56d4ce7bb1fb69745b1f |
|
BLAKE2b-256 | 8789c5e43941ee657290870c375208d3fe3701a8e89d9d55e2bd530c06061b2e |