From c595123a65a73cde68d486ee33c1939818506dce Mon Sep 17 00:00:00 2001 From: user Date: Fri, 5 Apr 2024 22:46:58 +0300 Subject: [PATCH] fix --- app/core/models/user/wallet_mixin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/core/models/user/wallet_mixin.py b/app/core/models/user/wallet_mixin.py index 7ae7581..adb4293 100644 --- a/app/core/models/user/wallet_mixin.py +++ b/app/core/models/user/wallet_mixin.py @@ -28,14 +28,14 @@ class WalletMixin: # TODO: support more than 1000 items async with AsyncClient() as client: response = await client.get(f"https://tonapi.io/v2/accounts/{user_wallet_address}/nfts?limit=1000&offset=0&indirect_ownership=false") - response = response.json() - assert 'nft_items' in response + return response.json()['nft_items'] except BaseException as e: make_log(self, f"Error while fetching NFTs: {e}", level='error') await asyncio.sleep(2) return await get_nft_items_list() nfts_list = await get_nft_items_list() + make_log(self, f"Found {len(nfts_list)} NFTs", level='info') for nft_item in nfts_list: item_address = Address(nft_item['address']).to_string(1, 1, 1) owner_address = Address(nft_item['owner']['address']).to_string(1, 1, 1)