> For the complete documentation index, see [llms.txt](https://docs.quipuswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract/entrypoints-overview/fa2-entrypoints/balance_of.md).

# balance\_of

An entrypoint that retrieves a user's LP tokens amount and sends it to the callback contract. Works exactly like FA2 **balance\_of** entrypoint according to [TZIP-012](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-12/tzip-12.md).

### Call parameters

```pascaligo
type token_id_t         is nat

type balance_request_t  is [@layout:comb] record [
  owner                   : address;
  token_id                : token_id_t;
]

type balance_response_t is [@layout:comb] record [
  request                 : balance_request_t;
  balance                 : nat;
]

type balance_of_t       is [@layout:comb] record [
  requests                : list(balance_request_t);
  callback                : contract(list(balance_response_t));
]
```

#### bal\_request\_t

| Field      | Type         | Description     |
| ---------- | ------------ | --------------- |
| owner      | address      | Owner of tokens |
| toeken\_id | token\_id\_t | Token ID        |

#### bal\_response\_t

| Field    | Type                                 | Description        |
| -------- | ------------------------------------ | ------------------ |
| requests | [bal\_request\_t](#bal_request_type) | Balance of request |
| balance  | nat                                  | Balance of token   |

#### balance\_of\_t

<table><thead><tr><th>Field</th><th width="286.1463414634146">Type</th><th>Description</th></tr></thead><tbody><tr><td>requests</td><td>list(<a href="#bal_response_type">bal_response_t</a>)</td><td>Balance of requests</td></tr><tr><td>callback</td><td>contract(list(<a href="#bal_response_type">bal_response_t</a>))</td><td>Callback contract</td></tr></tbody></table>

### Usage

{% tabs %}
{% tab title="🌮 Taquito" %}

```javascript
const dexCoreAddress = "KT1...";
const params = [
    {
        owner: "tz1.../KT1...",
        token_id: 1,
    },
    ...
];
const dexCore = await tezos.contract.at(dexCoreAddress);
const result = await dexCore.contract.views
  .balance_of(params)
  .read();
```

{% endtab %}
{% endtabs %}

### Errors

* `412` - non payable entrypoint (can't accept TEZ tokens during call of an entrypoint).
* `FA2_TOKEN_UNDEFINED` - token with `token_id` doesn't exist.
