Giter Site home page Giter Site logo

layerqa / aiocryptopay Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 10.0 217 KB

https://t.me/CryptoBot api asynchronous python wrapper

Home Page: https://pypi.org/project/aiocryptopay/

License: MIT License

Python 100.00%
asynchronous cryptobot cryptopay python

aiocryptopay's People

Contributors

katantdev avatar kylmakalle avatar layerqa avatar vladyslav49 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aiocryptopay's Issues

can't delete invoice with invoice_id

I use the getMe method to get all my invoices, some I can delete, but one - i can't .
I'm sure I'm taking the correct invoice_id, but when deleting it, it tells me that: [400] INVOICE NOT FOUND.
INVOICE IS PAID
I think it's not the api's fault, but some kind of bug.
image

import asyncio
from aiocryptopay import AioCryptoPay, Networks
from config import TEST_CRYPTO_BOT_API

async def main():
    crypto = AioCryptoPay(token=TEST_CRYPTO_BOT_API, network=Networks.TEST_NET)
    
    delete = await crypto.delete_invoice(invoice_id=169539)
    print(delete)
    
    await crypto.close()

asyncio.run(main())

BaseClient. RuntimeError: This event loop is already running

While I've been trying to run the code, I got RuntimeError. To solve it, I replaced from self._loop.run_until_complete(self._session.close()) to asyncio.create_task(self._session.close()) in del BaseClient class and it's works!
Author, please replace it in pypi.org

Перестал работать функция get_amount_by_fiat

Вчера работала.

summa = db[call.from_user.id]["invest"]

print(summa)

# Get amount in crypto by fiat summ
amount = await crypto.get_amount_by_fiat(summ=float(summa), asset='USDT', target='USD')
invoice = await crypto.create_invoice(asset='USDT', amount=float(amount))

image

Unclosed client session [Unclosed connector]

Во время создания invoice в коде произошла ошибка и он крашнулся. Теперь не могу подключиться к cryptobot

image

Dependency Conflict with pydantic in aiocryptopay Version 0.2.8

I encountered a dependency conflict issue related to the aiocryptopay package version 0.2.8 and its requirement for pydantic<2.0.0 and >=1.10.7. This specific requirement is incompatible with several other libraries that depend on different versions of pydantic, making it difficult to use aiocryptopay in conjunction with other packages.

As an example, the library aiogram (versions 3.0.0rc2, 3.0.0b9) depends on pydantic<3 and >=2.1.1, which conflicts with the constraints set by aiocryptopay.

The error message I received:

ERROR: Cannot install -r .\requirements.txt (line 1) and -r .\requirements.txt (line 25) because these package versions have conflicting dependencies.

The conflict is caused by:
aiocryptopay 0.2.8 depends on pydantic<2.0.0 and >=1.10.7
aiogram 3.0.0rc2 depends on pydantic<3 and >=2.1.1
aiocryptopay 0.2.8 depends on pydantic<2.0.0 and >=1.10.7
aiocryptopay 0.2.8 depends on pydantic<2.0.0 and >=1.10.7
aiogram 3.0.0b9 depends on pydantic~=2.1.1

Environment details:

  • Python version: Python 3.10
  • OS: Windows

The issue prevents me from using aiocryptopay in projects that also depend on other libraries with conflicting pydantic requirements. I kindly request an update to support a broader range of pydantic versions.

Thank you

TypeError: ClientSession.__init__() got an unexpected keyword argument 'params'

В ClientSession() библиотеки aiohttp передается **kwargs, который содержит ключи params и headers, но так как в последней версии aiohttp ClientSession не принимает в себя params, код выбрасывает ошибку.

Вот неработающая функция:

    def get_session(self, **kwargs):
        """Get cached session. One session per instance."""
        if isinstance(self._session, ClientSession) and not self._session.closed:
            return self._session

        ssl_context = ssl.create_default_context(cafile=certifi.where())
        connector = TCPConnector(ssl=ssl_context)

        self._session = ClientSession(connector=connector, **kwargs)
        return self._session

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.