Skip to main content

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

  1. Installation
  2. Getting Started
  3. Usage
  4. Authentication
  5. API Endpoints
  6. Error Handling
  7. Contributing
  8. License
  9. 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:

  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.


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

flowx_sdk-0.0.7.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file flowx_sdk-0.0.7.tar.gz.

File metadata

  • Download URL: flowx_sdk-0.0.7.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

Hashes for flowx_sdk-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ddad84a8c8f51e4f75d8afb5370c9ef6e45b8c96d1fee2ce8092c4291a4cf266
MD5 00d1a94c7faef5c253969fcb15f5eed0
BLAKE2b-256 5767cdbae1fffb25f0c405176587d34c8e18a51e74454e5169b0aac990ff74d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page