# Can I get balance coin of account (address)?

**URL:** <https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972>\
**Category:** Move\
**Created:** [August 11, 2024, 7:42am UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972 "2024-08-11T07:42:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryptojame](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/cryptojame/32/30801_2.png) [@cryptojame](https://forums.sui.io/u/cryptojame)\
**Post date:** [August 11, 2024, 7:42am UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972/1 "2024-08-11T07:42:55Z")

</div>

Hello guys  
Can I get the token’s account (sender) balance in contract programming?

---

<div class="post-metadata">

**Author:** ![amnn](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/amnn/32/25_2.png) [@amnn](https://forums.sui.io/u/amnn)\
**Post date:** [August 12, 2024, 10:57am UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972/2 "2024-08-12T10:57:41Z")

</div>

Hi @cryptojame,

No, it’s not possible to access information about a sender other than through the objects they authorize you to access in the transaction. This is because of Sui’s Object-centric programming model, you can read more about it in [this blog post](https://blog.sui.io/all-about-objects/). Sui is set-up this way so that:

- Users get greater control over what they authorize a transaction to do (for example, if they only want to authorize a transaction to use up to `X` SUI, they can do that by passing in a `Coin<SUI>` with a balance of `X`, and they will know that the transaction cannot access other coins that they own but they didn’t pass in as inputs).
- The system can take advantage of this information to run transactions in parallel.

---

<div class="post-metadata">

**Author:** ![cryptojame](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/cryptojame/32/30801_2.png) [@cryptojame](https://forums.sui.io/u/cryptojame)\
**Post date:** [August 13, 2024, 2:32pm UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972/3 "2024-08-13T14:32:27Z")

</div>

Hi @amnn  
Hum so we can’t know how many tokens a user is holding right? I mean just want to see how many tokens the user is holding.

---

<div class="post-metadata">

**Author:** ![amnn](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/amnn/32/25_2.png) [@amnn](https://forums.sui.io/u/amnn)\
**Post date:** [August 13, 2024, 2:57pm UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972/4 "2024-08-13T14:57:57Z")

</div>

This is not something you can access on-chain, but off-chain, you can make an RPC call for this information:

In JSON-RPC, [suix\_getBalance](https://docs.sui.io/sui-api-ref#suix_getbalance).

```json
{
    "jsonrpc": "2.0",
    "method": "suix_getBalance",
    "id": 1,
    "params": [$OWNER]
}

```

In GraphQL, [Address.balance](https://docs.sui.io/references/sui-api/sui-graphql/reference/types/objects/address#addressbalancebalance-):

```graphql
{
    address(address: $owner) {
        balance { 
            totalBalance
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![cryptojame](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/cryptojame/32/30801_2.png) [@cryptojame](https://forums.sui.io/u/cryptojame)\
**Post date:** [August 13, 2024, 6:00pm UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972/5 "2024-08-13T18:00:53Z")

</div>

Thank @amnn  
It’s easy if use sui client or sui sdk guy. I mean want to get the coin’s balance in sui contract (move) on-chain.

---

<div class="post-metadata">

**Author:** ![amnn](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/amnn/32/25_2.png) [@amnn](https://forums.sui.io/u/amnn)\
**Post date:** [August 13, 2024, 7:58pm UTC](https://forums.sui.io/t/can-i-get-balance-coin-of-account-address/45972/6 "2024-08-13T19:58:47Z")

</div>

As you’ve described it, what you want to do (get the entire balance for an address, in Move, on-chain) is not possible, but maybe there is another way to get you unblocked. Can you share some more details about what you’re trying to achieve and how this request fits into it?
