Fountain SDK - Python
Official Python client for the Fountain stablecoin API.
Features
- Email-based authentication with JWT tokens
- Complete API coverage with 18 methods
- Full type hints for IDE support
- Automatic token management
- Comprehensive error handling
- Admin dashboard endpoints
- Real-time operation monitoring
Installation
pip install fountain-sdk
Quick Start
from fountain_sdk import FountainSDK
# Initialize client
fountain = FountainSDK('http://localhost:3000')
# Login
login = fountain.login('user@example.com')
print(f"Welcome, {login.company_name}!")
# Create a new stablecoin operation
operation = fountain.create_stablecoin(
currency_code='APBRL',
amount_brl=10000.00,
deposit_type='XRP',
webhook_url='https://yourapi.com/webhook'
)
print(f"Operation created: {operation.id}")
# Check operation status
status = fountain.get_operation(operation.id)
print(f"Status: {status.status}")
# Mint more tokens
more = fountain.mint_more(
stablecoin_id=operation.stablecoin_id,
amount_brl=5000.00,
deposit_type='XRP'
)
# Burn tokens
burn = fountain.burn_stablecoin(
stablecoin_id=operation.stablecoin_id,
amount_tokens=1000.00,
return_asset='XRP'
)
Authentication
Login with Email
fountain = FountainSDK('http://localhost:3000')
# Login
login_response = fountain.login('admin@company.com')
# Token is automatically set
print(f"Token expires at: {login_response.expires}")
print(f"Is admin: {login_response.is_admin}")
Manual Token Management
# Set token manually
fountain.set_token('your-jwt-token-here')
# Check if authenticated
if fountain.is_authenticated():
token = fountain.get_token()
print(f"Current token: {token}")
# Logout
fountain.logout()
API Methods
Authentication
login(email)- Login with emailset_token(token)- Set JWT tokenget_token()- Get current tokenlogout()- Clear tokenis_authenticated()- Check authentication status
Stablecoin Operations
create_stablecoin(currency_code, amount_brl, deposit_type, company_wallet, webhook_url)mint_more(stablecoin_id, amount_brl, deposit_type, webhook_url)burn_stablecoin(stablecoin_id, amount_tokens, return_asset)get_stablecoin(stablecoin_id)
Operation Monitoring
get_operations(limit, offset)- Get operations for current companyget_operation(operation_id)- Get specific operationget_temp_wallet_status(operation_id)- Monitor temp wallet progress
Admin Methods
get_admin_statistics()- Get system statisticsget_admin_companies(limit, offset)- List all companiesget_admin_stablecoins(limit, offset)- List all stablecoinsget_admin_stablecoin_by_code(currency_code)- Get stablecoin by codeget_admin_temp_wallets(limit, offset)- Monitor all temp walletsget_admin_operations(limit, offset)- View all operationsget_admin_company_stablecoins(company_id, limit, offset)- Get company stablecoinsget_admin_company_operations(company_id, limit, offset)- Get company operations
Error Handling
from fountain_sdk import (
FountainSDK,
AuthenticationError,
APIError,
ValidationError,
)
fountain = FountainSDK('http://localhost:3000')
try:
login = fountain.login('user@example.com')
except ValidationError as e:
print(f"Invalid input: {e}")
except AuthenticationError as e:
print(f"Authentication failed: {e}")
except APIError as e:
print(f"API error: {e}")
print(f"Status code: {e.status_code}")
Data Models
All responses are typed with dataclasses:
LoginResponse- Login response with JWTOperationDetails- Mint/burn operation detailsTempWalletStatus- Temporary wallet monitoringAdminStatistics- System statisticsCompany- Company informationStablecoin- Stablecoin detailsTempWallet- Temporary wallet detailsDepositHistory- Deposit transaction record
Development
Install dependencies
pip install -r requirements-dev.txt
Run tests
pytest
pytest --cov=fountain_sdk # With coverage
Format code
black fountain_sdk/
Type checking
mypy fountain_sdk/
License
MIT License - See LICENSE file for details
Support
For issues and questions, visit: https://github.com/xrpl-fountain/fountain-sdk-python/issues
Metadata
Release files for fountain-sdk 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fountain_sdk-1.0.1.tar.gz | 9.9 kB | Without provenance | Details for fountain_sdk-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fountain_sdk-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for fountain_sdk-1.0.1-py3-none-any.whl |
Total release size: 19.0 kB
Release files / fountain_sdk-1.0.1.tar.gz
| Download URL | fountain_sdk-1.0.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1e8bf23ac0b3ef0eab8be5bbd3884ce22c2a93dbee7f5c5fcb99e3a213940bb
|
|
BLAKE2b-256 checksum How to use checksums |
4f523c8ad476c21ed4d4fcd2f96c27789919b5b54802a897bb96265ac8473acf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fountain_sdk-1.0.1-py3-none-any.whl
| Download URL | fountain_sdk-1.0.1-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76028c119403afaa8fbb9f2f2db2dc29b80b08d228b98e03ade2a44d84be3d47
|
|
BLAKE2b-256 checksum How to use checksums |
ad9c01b991fac91a28f2cbed54e4b94d2ee601b51bc1ec4c7fa1463382ff4604
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for fountain-sdk 1.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.