the feature of blockchain
Project description
FlowX SDK - Python
FlowX is a protocol designed to empower developers building financial solutions by offering an efficient, low-cost way to handle cross-border payments using stablecoins. FlowX aims to address real-world issues in African financial systems, such as high remittance costs, limited liquidity, and currency volatility.
This SDK provides an easy-to-use interface for integrating FlowX's cross-border payment protocol into Python applications. It offers seamless interaction with the FlowX network, allowing developers to process stablecoin-based payments efficiently and securely.
Table of Contents
- Installation
- Getting Started
- Usage
- Authentication
- API Endpoints
- Error Handling
- Contributing
- License
- Support
Installation
To install the FlowX SDK, you can use pip:
pip install flowx-sdk
Alternatively, you can install the latest development version directly from the GitHub repository:
pip install git+https://github.com/yourusername/flowx-sdk.git
Getting Started
After installing the flowx-sdk, you can start integrating FlowX into your Python application. The first step is to import the SDK and set up your API key for authentication.
Example:
import flowx
# Initialize FlowX client
client = flowx.Client(api_key="your_api_key")
# Example: Get supported currencies
currencies = client.get_supported_currencies()
print(currencies)
Usage
Here are some common tasks you can accomplish with the flowx-sdk:
1. Get Supported Currencies
To check which currencies FlowX supports for cross-border payments:
currencies = client.get_supported_currencies()
print(currencies)
2. Send Cross-Border Payment
To send a stablecoin-based payment:
payment = client.send_payment(
sender_wallet="your_sender_wallet_address",
receiver_wallet="receiver_wallet_address",
amount="100.00",
currency="USD"
)
print(payment)
3. Check Payment Status
To check the status of a payment:
status = client.get_payment_status(payment_id="your_payment_id")
print(status)
Authentication
The FlowX SDK requires an API key for authentication. You can obtain your API key by registering on the FlowX platform.
To authenticate, simply pass your API key when initializing the Client object:
client = flowx.Client(api_key="your_api_key")
For security purposes, it is recommended to keep your API key in an environment variable or a configuration file rather than hardcoding it directly into your scripts.
API Endpoints
The SDK interacts with FlowX's API endpoints. Below are some key endpoints:
1. GET /supported_currencies
- Returns a list of currencies supported by FlowX for cross-border payments.
2. POST /send_payment
- Initiates a cross-border payment from one wallet to another.
- Parameters:
sender_wallet,receiver_wallet,amount,currency
3. GET /payment_status/{payment_id}
- Retrieves the status of a previously initiated payment.
- Parameters:
payment_id
Error Handling
The SDK raises exceptions for various error conditions. Common exceptions include:
flowx.exceptions.AuthenticationError: If the API key is invalid or missing.flowx.exceptions.PaymentError: If the payment cannot be processed due to insufficient funds, invalid wallet address, or other reasons.flowx.exceptions.NetworkError: If there is a network issue when contacting FlowX servers.
You can handle errors using standard try and except blocks:
try:
payment = client.send_payment(
sender_wallet="your_sender_wallet_address",
receiver_wallet="receiver_wallet_address",
amount="100.00",
currency="USD"
)
print(payment)
except flowx.exceptions.PaymentError as e:
print(f"Payment failed: {e}")
except flowx.exceptions.NetworkError as e:
print(f"Network error: {e}")
Contributing
We welcome contributions to the flowx-sdk. To contribute:
- Fork the repository on GitHub.
- Create a new branch for your feature or bugfix.
- Make your changes and commit them with descriptive messages.
- Push your changes and create a pull request.
Please ensure that you write tests for any new features or fixes you add.
License
The FlowX SDK is released under the MIT License.
Support
If you have any issues or need further assistance, please reach out to our support team at support@flowx.com or check our documentation and FAQ on FlowX Documentation.
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
File details
Details for the file flowx_sdk-0.0.3.tar.gz.
File metadata
- Download URL: flowx_sdk-0.0.3.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ba01d01a73507e59873a2a6d9af447ce43d72a33edb89de2d57e28b846e0ba
|
|
| MD5 |
8d4f2b66257464fc6c80fa138c08f2cd
|
|
| BLAKE2b-256 |
3c617c52c2f266956819fef4a066f4b50737aafc3ff267851800de06325aa89a
|