user4314: I am trying to develop a simple program where I am able to generate an address successfully using a public key and a stake key. The network type is TestNet.
How can I check the balance of the generated address?
Code snippet is as follow:
var existingaddresses = _Addresses.Find(x => x.WalletId == wallet.Id).ToList().Count;
            var user = _users.Find(x => x.Id == wallet.UserId).FirstOrDefault();
            NetworkType net;
            if (IsMainNet)
            {
                net = NetworkType.Mainnet;
            }
            else
            {
                net = NetworkType.Testnet;
            }
            Mnemonic mnc = keyService.Restore(wallet.Words, WordLists.English);
            PrivateKey masterKey = mnc.GetRootKey(user.Password);
            string PaymentPath = $"m/1852'/1815'/0'/0/"+ existingaddresses;
            PrivateKey paymentPrv = masterKey.Derive(PaymentPath);
            PublicKey paymentPub = paymentPrv.GetPublicKey(false);
            string stakePath = $"m/1852'/1815'/0'/2/"+existingaddresses;
            PrivateKey stakePrv = masterKey.Derive(stakePath);
            PublicKey stakePub = stakePrv.GetPublicKey(false);

            Address address = addressService.GetAddress(paymentPub, stakePub, net, AddressType.Base);

Now I want to check the balance of the generated address.

user1142: You can use the Blockfrost.io API to get information about the address. I'd recommend using the blockfrost-dotnet package for this.

4314: <p>I am trying to develop a simple program where I am able to generate an address successfully using a public key and a stake key. The network type is <code>TestNet</code>.</p>
<p>How can I check the balance of the generated address?</p>
<p>Code snippet is as follow:</p>
<pre><code>var existingaddresses = _Addresses.Find(x =&gt; x.WalletId == wallet.Id).ToList().Count;
            var user = _users.Find(x =&gt; x.Id == wallet.UserId).FirstOrDefault();
            NetworkType net;
            if (IsMainNet)
            {
                net = NetworkType.Mainnet;
            }
            else
            {
                net = NetworkType.Testnet;
            }
            Mnemonic mnc = keyService.Restore(wallet.Words, WordLists.English);
            PrivateKey masterKey = mnc.GetRootKey(user.Password);
            string PaymentPath = $&quot;m/1852'/1815'/0'/0/&quot;+ existingaddresses;
            PrivateKey paymentPrv = masterKey.Derive(PaymentPath);
            PublicKey paymentPub = paymentPrv.GetPublicKey(false);
            string stakePath = $&quot;m/1852'/1815'/0'/2/&quot;+existingaddresses;
            PrivateKey stakePrv = masterKey.Derive(stakePath);
            PublicKey stakePub = stakePrv.GetPublicKey(false);

            Address address = addressService.GetAddress(paymentPub, stakePub, net, AddressType.Base);
</code></pre>
<p>Now I want to check the balance of the generated address.</p>
 1142: <p>You can use the <a href="https://blockfrost.io/" rel="nofollow noreferrer">Blockfrost.io</a> API to get information about the address. I'd recommend using the <a href="https://github.com/blockfrost/blockfrost-dotnet" rel="nofollow noreferrer">blockfrost-dotnet</a> package for this.</p>
