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
Set an account
First install Flowx as a local command globally on your machine
Create a virtual environment
python -m venv .virtual_env_name
Start the virtual environment
source .venv/bin/activate
install the command with pipx
pipx install flowx-sdk
If not for the 1st time do
pipx install -f flowx-sdk
After that run the command to initialize the programm
flowx init
Login to authenticate your machine
flowx login
Or signup
flowx signup
Create token
flowx create --token <api-token>
Then you can use the module in your project
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@github.com:georgegoldman/FlowX.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:
from flowx_sdk.client import Client
# Initialize FlowX client
client = Client(api_key="your-api-key")
client.authenticated #True
# 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
-
Supported Currencies
-
Stablecoins
- USDT (Tether)
- USDC (USD Coin)
- DAI (MakerDAO’s decentralized stablecoin)
- BUSD (Binance USD)
- EUROC (Circle's Euro-backed stablecoin)
-
Local African Currencies (For Real-World Integration)
- NGN (Nigerian Naira)
- KES (Kenyan Shilling)
- ZAR (South African Rand)
- GHS (Ghanaian Cedi)
- TZS (Tanzanian Shilling)
- UGX (Ugandan Shilling)
-
Global Reserve Currencies
- USD (US Dollar)
- EUR (Euro)
- GBP (British Pound)
-
Cryptocurrencies for Liquidity Bridging
- SUI (Sui)
- BTC (Bitcoin)
- ETH (Ethereum)
- XRP (Ripple)
-
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowx_sdk-0.0.9.tar.gz.
File metadata
- Download URL: flowx_sdk-0.0.9.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c59cdb9bfdb090e16d1fc5c42889795b8cba7ae73c0f8d74e3cc1cf6a7f8f5b
|
|
| MD5 |
b2339d3b97c91258af706036b538f258
|
|
| BLAKE2b-256 |
7f0f79b136100bbe21d84c28f97f3f6bf3d0bf2d59f8fd030c12883e6038e214
|
File details
Details for the file flowx_sdk-0.0.9-py2.py3-none-any.whl.
File metadata
- Download URL: flowx_sdk-0.0.9-py2.py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e0a62bb07090bb717bedff7533bd19a7abda94028ce44c8f90b0f886fb74175
|
|
| MD5 |
913780ab0d65f281b8f0d666bd24d5fc
|
|
| BLAKE2b-256 |
d18e1db77c2c7dd4ba4f7ca92fbfe583ecf161ecac6dff2ab2286d8f55615403
|