# IReceiveBalanceApproval

## IReceiveBalanceApproval

`IReceiveBalanceApproval` is an interface for a smart contract consuming Bank balances approved to them in the same transaction by other contracts or externally owned accounts (EOA).

### receiveBalanceApproval

```solidity
function receiveBalanceApproval(address owner, uint256 amount, bytes extraData) external
```

Called by the Bank in `approveBalanceAndCall` function after the balance `owner` approved `amount` of their balance in the Bank for the contract. This way, the depositor can approve balance and call the contract to use the approved balance in a single transaction.

The implementation must ensure this function can only be called by the Bank. The Bank does *not* guarantee that the `amount` approved by the `owner` currently exists on their balance. That is, the `owner` could approve more balance than they currently have. This works the same as `Bank.approve` function. The contract must ensure the actual balance is checked before performing any action based on it.

#### Parameters

| Name      | Type    | Description                                                                              |
| --------- | ------- | ---------------------------------------------------------------------------------------- |
| owner     | address | Address of the Bank balance owner who approved their balance to be used by the contract. |
| amount    | uint256 | The amount of the Bank balance approved by the owner to be used by the contract.         |
| extraData | bytes   | The `extraData` passed to `Bank.approveBalanceAndCall`.                                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.threshold.network/app-development/tbtc-contracts-api/tbtc-v2-api/ireceivebalanceapproval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
