wallet works
This commit is contained in:
parent
97a61e4fce
commit
59c9dd5f74
@ -95,12 +95,11 @@ async def get_wallet_balances(wallet_address):
|
|||||||
commitment=Confirmed
|
commitment=Confirmed
|
||||||
)
|
)
|
||||||
|
|
||||||
logging.debug(f"Raw response: {json.dumps(response, indent=2, cls=SolanaEncoder)}")
|
|
||||||
|
|
||||||
if response.value:
|
if response.value:
|
||||||
for account in response.value:
|
for account in response.value:
|
||||||
if 'parsed' in account.account.data and 'info' in account.account.data['parsed']:
|
parsed_data = account.account.data.parsed
|
||||||
mint = account.account.data['parsed']['info']['mint']
|
if isinstance(parsed_data, dict) and 'info' in parsed_data:
|
||||||
|
mint = parsed_data['info']['mint']
|
||||||
balance_response = await solana_client.get_token_account_balance(account.pubkey)
|
balance_response = await solana_client.get_token_account_balance(account.pubkey)
|
||||||
if balance_response.value:
|
if balance_response.value:
|
||||||
amount = float(balance_response.value.ui_amount)
|
amount = float(balance_response.value.ui_amount)
|
||||||
@ -119,6 +118,14 @@ async def get_wallet_balances(wallet_address):
|
|||||||
logging.error(f"Error getting wallet balances: {str(e)}")
|
logging.error(f"Error getting wallet balances: {str(e)}")
|
||||||
|
|
||||||
return balances
|
return balances
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def get_non_zero_token_balances(wallet_address):
|
async def get_non_zero_token_balances(wallet_address):
|
||||||
non_zero_balances = {}
|
non_zero_balances = {}
|
||||||
logging.info(f"Getting non-zero balances for wallet: {wallet_address}")
|
logging.info(f"Getting non-zero balances for wallet: {wallet_address}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user