We will check USDC token balance on Solana testnet.
Firstly, we will use https://usdcfaucet.com/ to airdrop some USDC tokens into our wallet.
Secondly, we check USDC token mint address on testnet cluster using Solana Explorer
Then we make an RPC call to POST https://api.testnet.solana.comhttps://api.testnet.solana.com using method getTokenAccountsByOwner, passing our wallet address and the token mint address
We will check USDC token balance on Solana testnet.
Firstly, we will use https://usdcfaucet.com/ to airdrop some USDC tokens into our wallet. Secondly, we check USDC token mint address on testnet cluster using Solana Explorer
https://explorer.solana.com/address/CpMah17kQEL2wqyMKt3mZBdTnZbkbfx4nqmQMFDP5vwp?cluster=testnet
Then we make an RPC call to
POST https://api.testnet.solana.comhttps://api.testnet.solana.com
using methodgetTokenAccountsByOwner
, passing our wallet address and the token mint addressThe response looks like below. Notice the unit of
amount
anduiAmount
Here is how to parse it in Swift
Read more