Closed Jul1111 closed 3 months ago
` from solders.pubkey import Pubkey
def get_wallet_balance(wallet_address,SOLANA_CLIENT): address = Pubkey(wallet_address) balance = SOLANA_CLIENT.get_balance(address) return balance['result']['value'] `
This is my code, i need to transforme a str in a pubkey Object to get the balance. But my editor say "Could not be resolve"
And my code cant be run unless i comment my import.
I have already install solders with
Pip install solders
This my version package : pip freeze anyio==4.4.0 certifi==2024.2.2 charset-normalizer==3.3.2 construct==2.10.68 construct-typing==0.5.6 h11==0.14.0 httpcore==1.0.5 httpx==0.27.0 idna==3.7 jsonalias==0.1.1 pyTelegramBotAPI==4.18.1 pytz==2024.1 requests==2.32.3 sniffio==1.3.1 solana==0.34.0 solders==0.21.0 typing_extensions==4.12.0 urllib3==2.2.1 websockets==11.0.3
pip freeze anyio==4.4.0 certifi==2024.2.2 charset-normalizer==3.3.2 construct==2.10.68 construct-typing==0.5.6 h11==0.14.0 httpcore==1.0.5 httpx==0.27.0 idna==3.7 jsonalias==0.1.1 pyTelegramBotAPI==4.18.1 pytz==2024.1 requests==2.32.3 sniffio==1.3.1 solana==0.34.0 solders==0.21.0 typing_extensions==4.12.0 urllib3==2.2.1 websockets==11.0.3
Its running animay, but i have a question its only can be a length of 32 ? and not more ?
` from solders.pubkey import Pubkey
def get_wallet_balance(wallet_address,SOLANA_CLIENT): address = Pubkey(wallet_address) balance = SOLANA_CLIENT.get_balance(address) return balance['result']['value'] `
This is my code, i need to transforme a str in a pubkey Object to get the balance. But my editor say "Could not be resolve"
And my code cant be run unless i comment my import.
I have already install solders with
Pip install solders
This my version package :
pip freeze anyio==4.4.0 certifi==2024.2.2 charset-normalizer==3.3.2 construct==2.10.68 construct-typing==0.5.6 h11==0.14.0 httpcore==1.0.5 httpx==0.27.0 idna==3.7 jsonalias==0.1.1 pyTelegramBotAPI==4.18.1 pytz==2024.1 requests==2.32.3 sniffio==1.3.1 solana==0.34.0 solders==0.21.0 typing_extensions==4.12.0 urllib3==2.2.1 websockets==11.0.3