A basic Python Async Client for interacting with the SHKeeper API to manage cryptocurrency invoices.
This library is still under development and is intended for basic usage at the moment.
- Fetch available cryptocurrencies.
- Create and update cryptocurrency invoices.
- Supports integration with multiple cryptocurrencies and fiat currencies.
- Easy-to-use methods for interacting with the SHKeeper API.
Note: This library is still in development, and the API may change in future versions.
You can install this package via pip (from source) by cloning the repository:
git clone https://github.com/botsgalaxy/python-shkeeper-api-client.git
cd python-shkeeper-api-client
pip install .Here is a very basic example of how to use the library:
from sh_keeper import SHKeeper, Invoice
# Initialize the SHKeeper client
base_url = "https://api.shkeeper.io/api/v1" # The base URL for SHKeeper API
callback_url = "http://your-callback-url.com" # Where you receive updates about payments
sh_keeper = SHKeeper(base_url=base_url, callback_url=callback_url)
# Fetch available cryptocurrencies
crypto, crypto_list = await sh_keeper.get_crypto_currencies()
print(crypto) # List of cryptocurrency symbols
print(crypto_list) # List of cryptocurrency display names
# Create an invoice
invoice = await sh_keeper.create_invoice(
crypto_name="ETH-USDC",
external_id="order_123",
amount="100",
api_key="your_api_key",
callback_url="http://example.com/callback"
)
# Access invoice details
print(f"Invoice Amount: {invoice.amount}")
print(f"Wallet Address: {invoice.wallet}")The SHKeeper client requires the following configuration:
base_url: The base URL for the SHKeeper API (e.g.,https://api.shkeeper.io).api_key: Your SHKeeper API key for authentication.callback_url: A URL that SHKeeper will use to send notifications about created invoices.
You can provide the callback_url when initializing the SHKeeper class or pass it directly when creating an invoice.
Fetches the available cryptocurrencies from the SHKeeper API.
-
Returns: A tuple containing two lists:
- A list of cryptocurrency symbols (e.g.,
["BTC", "ETH", "BNB"]). - A list of cryptocurrency display names (e.g.,
[{"display_name": "Bitcoin", "name": "BTC"}]).
- A list of cryptocurrency symbols (e.g.,
-
Raises:
SHKeeperErrorif the API call fails or returns an error.
Creates an invoice for a specific cryptocurrency in SHKeeper.
-
Parameters:
crypto_name(str): The name of the cryptocurrency (e.g.,"BTC","ETH-USDC").external_id(str): The unique order ID or invoice ID from your store.amount(str): The amount in fiat currency (e.g.,"100").api_key(str): Your SHKeeper API key.fiat(str): The fiat currency code (default:"USD").callback_url(str): The URL to send notifications (optional if set during initialization).
-
Returns: An
Invoiceobject containing the created invoice details. -
Raises:
SHKeeperErrorif the API call fails or returns an error.
This project is open for contributions! If you'd like to help improve it, feel free to fork the repository and submit a pull request.
If you encounter any issues, feel free to open an issue on the GitHub repository.
- Author: BotsGalaxy
- Telegram: primeakash