# FA2 Token entrypoints

This section has an explanation about using yToken `tokens`.

Each market has related token and it's ID. It allows users to operate their liquidity as one of `yTokens` that bound to lending market.

### Entrypoints

#### transfer

Allows transfer batch (list) of token *transfers*. Each *transfer* in the batch is specified between one source (`from_`) address and a list of *destinations*. Each *destination* specifies `token_id`, the `amount` to be transferred from the source and address of the *destination* (`to_`).

{% content-ref url="fa2-token-entrypoints/transfer" %}
[transfer](https://yupana-finance.gitbook.io/yupana-document-portal/developer-space/ytoken-contract-methods/fa2-token-entrypoints/transfer)
{% endcontent-ref %}

#### update\_operators

FA2 interface [specifies](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-12/tzip-12.md#operators) an entrypoint to update operators. Operators are permitted per specific token owner and token ID (`token_id`). Once permitted, an operator can transfer tokens of that type belonging to the owner. To update own tokens operators user should use `update_oprators` call.

{% content-ref url="fa2-token-entrypoints/update\_operators" %}
[update\_operators](https://yupana-finance.gitbook.io/yupana-document-portal/developer-space/ytoken-contract-methods/fa2-token-entrypoints/update_operators)
{% endcontent-ref %}

#### balance\_of

Gets the balance of multiple account/token pairs. Accepts a list of `balance_of_request`s (`token_id` and `owner`) and a callback contract `callback` which accepts a list of `balance_of_response` (`balance_of_request` and requested `balance`) records.

{% content-ref url="fa2-token-entrypoints/balance\_of" %}
[balance\_of](https://yupana-finance.gitbook.io/yupana-document-portal/developer-space/ytoken-contract-methods/fa2-token-entrypoints/balance_of)
{% endcontent-ref %}

#### get\_total\_supply

Gets total supply of token by it's `token_id` and sends a callback with value to received contract `callback` which accepts a `nat` (natural number).

{% content-ref url="fa2-token-entrypoints/get\_total\_supply" %}
[get\_total\_supply](https://yupana-finance.gitbook.io/yupana-document-portal/developer-space/ytoken-contract-methods/fa2-token-entrypoints/get_total_supply)
{% endcontent-ref %}

### General errors

* `yToken/token-lambda-not-set` - lambda of called entrypoint is not set yet.
* `cant-unpack-token-lambda` - lambda bytes of function is broken.
