Skip to main content

Easy interaction with Cryptomus API, support for asynchronous approaches

Project description

Project Version License

Typing SVG

What are Cryptomus crypto payment gateway features?

🛡 Volatility protection

Automatic conversion of incoming payments into stablecoins will protect against cryptocurrency volatility.
The Withdrawal auto-convert feature allows you to withdraw your crypto in a preferred currency, and both features are completely free to use!

⚙ Transactions status management

  • Adjust the allowed payment accuracy.
  • View if an invoice has been overpaid or underpaid and send an additional invoice to collect a remaining amount.

% Flexible commissions for each coin

Set additional commissions or add a discount for chosen coins.


💬 Support team

  • Telegram
  • Email
  • Our website in the form of tickets
  • As a personal manager for our merchants

📄 Mass payouts

Make mass payouts to thousands of addresses with automatic conversion in just one moment.
All features


About This Project

This project is written on pure enthusiasm, I want this library to be usable and used regularly. This project has the ability to run synchronously or asynchronously, which makes it more flexible. The project will be maintained and improved, and you can buy me a coffee :) Thanks, have a good day!

Buy Me A Coffee

Installation

  • Installation using the pip package manager
$ pip install CryptomusAPI
  • Install from GitHub (requires git)
$ git clone https://github.com/Fsoky/CryptomusAPI
$ cd CryptomusAPI
$ python setup.py install
  • Or
$ pip install git+https://github.com/Fsoky/CryptomusAPI

Get Started

[!TIP] Refer to the documentation in any unclear situation: https://doc.cryptomus.com/
To get MERCHANT_ID and API_KEY register and send an application to https://cryptomus.com/

⚠ Make sure you have a ready project in which you will connect Cryptomus otherwise the key will not be issued!

  • You can use the asynchronous manager with
import asyncio
from CryptomusAPI import Cryptomus

MERCHANT_ID = "123ABC"
API_KEY = "12345ABCDE"


async def main() -> None:
    async with Cryptomus(MERCHANT_ID, API_KEY) as api:
        ...


if __name__ == "__main__":
    asyncio.run(main())
  • Or you can simply create an instance of the Cryptomus class
api = Cryptomus(MERCHANT_ID, API_KEY)

Creating an invoice

await api.payments.create_invoice(
    amount=10,
    order_id="TEST-ORDER-1", # This parameter must not contain spaces.
    currency="USD", # or crypto currency like TON
    lifetime=300 # Invoice lifetime (in seconds), default 3600
)

[!TIP] Enums can be used for parameters

from CryptomusAPI.enums import CryptoCurrency
...create_invoice(..., currency=CryptoCurrency.USDT)

Obtaining data from a method

invoice = await api.payments.create_invoice(...)
print(invoice.result.url) # >>> https://...

The module is under development, please be patient, thank you!

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

CryptomusAPI-1.0.1.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file CryptomusAPI-1.0.1.tar.gz.

File metadata

  • Download URL: CryptomusAPI-1.0.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for CryptomusAPI-1.0.1.tar.gz
Algorithm Hash digest
SHA256 611837c51fb3b42f8f36e844b58450be2a3ba9c595fbbc83b70231e3a7430ad5
MD5 075d58c0bc461d9649bc351511e0a78d
BLAKE2b-256 719b0f7be5696b85ed1c100c1c5d5f06c51d2715ccc15246d0c0f8c77e3fb657

See more details on using hashes here.

Supported by

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