How to get the balance of Solana accoount? #99
Answered
by
Shpota
Chandra-Sekhar-Bala
asked this question in
Q&A
-
How do I get the account balance of Solana by providing public address? |
Beta Was this translation helpful? Give feedback.
Answered by
Shpota
Oct 29, 2024
Replies: 2 comments 1 reply
-
You can get it using the val connection = Connection(rpcUrl)
val wallet = PublicKey("DxPv2QMA5cWR5Xfg7tXr5YtJ1EEStg5Kiag9HhkY1mSx")
val balance = connection.getBalance(wallet) Please check integration tests or this repository to find ready-to-run examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Shpota
-
Thanks @Shpota, This works on getting account balance. code:
Logcat:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can get it using the
getBalance()
function.Please check integration tests or this repository to find ready-to-run examples.