user2560: I need to know the amount of Ada remaining in an account in a off-chain Haskell plutus program. Should I use the wallet web interface of the kind:
http://localhost:8090/v2/wallets/$WALLET_ID
or there is some direct Plutus library call or haskell serialization library for that?

user1108: Assuming you are using React in the front-end,you can use the serialization library created by emurgo.After installing their library you first connect to a wallet like this. I will be connecting to a yoroi wallet , for any other wallet you can just swap out the name and it works same way.
import {Value} from "@emurgo/cardano-serialization-lib-asmjs"
let Buffer = require('buffer/').Buffer

const [balance,setBalance] = useState()
let API = ""
const connectToWallet = async () =>{
        try {
            API = await window.cardano.yoroi.enable();
        } catch(err) {
            console.log(err);
        }
}

After you enable it , it will return a api key. You can then use the API key to get the balance of wallet.
    getBalance = async () => {
        try {
            const balanceCBORHex = await API.getBalance();
            const balance = Value.from_bytes(Buffer.from(balanceCBORHex, "hex")).coin().to_str();
            setBalance(balance)

        } catch (err) {
            console.log(err)
        }
 
    }


2560: <p>I need to know the amount of Ada remaining in an account in a off-chain Haskell plutus program. Should I use the wallet web interface of the kind:</p>
<p>http://localhost:8090/v2/wallets/$WALLET_ID</p>
<p>or there is some direct Plutus library call or haskell serialization library for that?</p>
 1108: <p>Assuming you are using React in the front-end,you can use the serialization library created by emurgo.After installing their library you first connect to a wallet like this. I will be connecting to a yoroi wallet , for any other wallet you can just swap out the name and it works same way.</p>
<pre><code>import {Value} from &quot;@emurgo/cardano-serialization-lib-asmjs&quot;
let Buffer = require('buffer/').Buffer
</code></pre>
<pre><code>const [balance,setBalance] = useState()
let API = &quot;&quot;
const connectToWallet = async () =&gt;{
        try {
            API = await window.cardano.yoroi.enable();
        } catch(err) {
            console.log(err);
        }
}
</code></pre>
<p>After you enable it , it will return a api key. You can then use the API key to get the balance of wallet.</p>
<pre><code>    getBalance = async () =&gt; {
        try {
            const balanceCBORHex = await API.getBalance();
            const balance = Value.from_bytes(Buffer.from(balanceCBORHex, &quot;hex&quot;)).coin().to_str();
            setBalance(balance)

        } catch (err) {
            console.log(err)
        }
 
    }
</code></pre>
