# How can I query the balance of a contract from the SDK?

**URL:** <https://forum.fuel.network/t/how-can-i-query-the-balance-of-a-contract-from-the-sdk/1090>\
**Category:** Rust SDK\
**Tags:** faqs\
**Created:** [December 20, 2022, 4:03pm UTC](https://forum.fuel.network/t/how-can-i-query-the-balance-of-a-contract-from-the-sdk/1090 "2022-12-20T16:03:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sarah/32/13_2.png) [@sarah](https://forum.fuel.network/u/sarah)\
**Post date:** [December 20, 2022, 4:03pm UTC](https://forum.fuel.network/t/how-can-i-query-the-balance-of-a-contract-from-the-sdk/1090/1 "2022-12-20T16:03:35Z")

</div>

You can get the balance of a contract using the provider as shown in the example below:

```rust
let provider = wallet.get_provider().unwrap();
let balance = provider
     .get_contract_asset_balance(
          &Bech32ContractId::from(MyContractID.clone()),
          AssetId::from(*MyTokenAssetContractID.clone())
     )
     .await
     .unwrap();

```

You can also use the `get_balances` method if you have the contract instance.

```rust
let contract_balances = contract_instance.get_balances().await?;

```
