title: how to get the the amount of the given token address in anchor solana?
body: <p>I'm getting two token addresses  address as input for a function in my solana program. How can fetch the balance for the two token. using getTokenSupply in solana webjs i can get it in javascript how can i get that in rust.</p>
  <pre><code> const data = await Connection.getTokenSupply(from_pairs);
   const data2 = await Connection.getTokenSupply(to_pairs);
   console.log(data, data2)
  </code></pre>
  <p>what is similar approach in anchor rust?</p>