Sometimes, when I set message listener, I get such an error on incoming transaction. I even have bought Lite payment plan but the issue persists. I set my handler just like in example.
async def set_transaction_handler():
tonapi = AsyncTonapi(api_key=TONAPI_KEY)
# Subscribe to transaction events for the specified accounts
await tonapi.sse.subscribe_to_transactions(
accounts=ACCOUNTS, handler=handler, args=(tonapi,)
)
async def handler(event: TransactionEventData, tonapi: AsyncTonapi) -> None:
"""
Handle SSEvent for transactions.
:param event: The SSEvent object containing transaction details.
:param tonapi: An instance of AsyncTonapi for interacting with TON API.
"""
print("Transaction received")
trace = await tonapi.traces.get_trace(event.tx_hash)
Traceback (most recent call last):
File "/home/b4cksl4sh/PycharmProjects/autoWallet/main.py", line 96, in <module>
asyncio.run(set_transaction_handler())
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/b4cksl4sh/PycharmProjects/autoWallet/main.py", line 32, in set_transaction_handler
await tonapi.sse.subscribe_to_transactions(
File "/home/b4cksl4sh/PycharmProjects/autoWallet/.venv/lib/python3.12/site-packages/pytonapi/async_tonapi/methods/sse.py", line 41, in subscribe_to_transactions
result = await handler(event, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/b4cksl4sh/PycharmProjects/autoWallet/main.py", line 79, in handler
trace = await tonapi.traces.get_trace(event.tx_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/b4cksl4sh/PycharmProjects/autoWallet/.venv/lib/python3.12/site-packages/pytonapi/async_tonapi/methods/traces.py", line 21, in get_trace
response_data = await self._get(method=method)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/b4cksl4sh/PycharmProjects/autoWallet/.venv/lib/python3.12/site-packages/pytonapi/async_tonapi/client.py", line 253, in _get
return await request("GET", method, headers, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/b4cksl4sh/PycharmProjects/autoWallet/.venv/lib/python3.12/site-packages/pytonapi/async_tonapi/client.py", line 196, in _request
return await self.__process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/b4cksl4sh/PycharmProjects/autoWallet/.venv/lib/python3.12/site-packages/pytonapi/async_tonapi/client.py", line 101, in __process_response
raise error_class(error_message)
pytonapi.exceptions.TONAPINotFoundError: entity not found