Metadata-Version: 2.3
Name: flowx_sdk
Version: 0.0.7
Summary: the feature of blockchain
Project-URL: home, https://github.com/georgegoldman/FlowX.git
Author-email: George-Goldman <georgegoldmanjohn.o@gmail.com>
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Dist: requests>=2.20
Description-Content-Type: text/markdown


# 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

1. [Installation](#installation)
2. [Getting Started](#getting-started)
3. [Usage](#usage)
4. [Authentication](#authentication)
5. [API Endpoints](#api-endpoints)
6. [Error Handling](#error-handling)
7. [Contributing](#contributing)
8. [License](#license)
9. [Support](#support)

---

## Installation

To install the FlowX SDK, you can use `pip`:

```bash
pip install flowx-sdk
```

Alternatively, you can install the latest development version directly from the GitHub repository:

```bash
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:

```python
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:

```python
currencies = client.get_supported_currencies()
print(currencies)
```

### 2. **Send Cross-Border Payment**

To send a stablecoin-based payment:

```python
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:

```python
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:

```python
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:

```python
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:

1. Fork the repository on GitHub.
2. Create a new branch for your feature or bugfix.
3. Make your changes and commit them with descriptive messages.
4. 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](LICENSE).

---

## Support

If you have any issues or need further assistance, please reach out to our support team at [support@flowx.com](mailto:support@flowx.com) or check our documentation and FAQ on [FlowX Documentation](https://flowx.com/docs).
