> For the complete documentation index, see [llms.txt](https://yuga.gitbook.io/zkyuga-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yuga.gitbook.io/zkyuga-whitepaper/developer-guide/erc721/getbalance.md).

# getBalance

## getBalance

The `getBalance` method in the ERC-721 token standard serves to retrieve the count of tokens owned by a specific Ethereum address. Unlike ERC-20's balance, which reflects a quantity, ERC-721's balance represents the count of unique, non-fungible tokens owned by an address. This method is accessible through the `ERC721Instance` object, and obtainable via appropriate methods from the `ZkyugaClient` or related libraries.

### Function Signature

```javascript
getBalance(address: string): Promise<BigNumber>
```

#### Parameters

| Parameter | Type   | Description                                                                            |
| --------- | ------ | -------------------------------------------------------------------------------------- |
| address   | string | The Ethereum address for which you want to retrieve the count of ERC-721 tokens owned. |

#### Returns

* A `Promise` resolving to a `BigNumber` indicating the count of ERC-721 tokens owned by the provided Ethereum address.

### Usage Example

Begin by instantiating the desired ERC-721 token contract:

```javascript
const erc721 = zkyugaClient.getERC721Instance("your ERC-721 contract address here");
```

Then, utilize the `getBalance` method to retrieve token ownership information for the specified Ethereum address:

```javascript
const address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e";
const tokenCount = await erc721.getBalance(address);
console.log(`Token Count: ${tokenCount.toString()}`);
```

### Notes

* ERC-721 tokens are non-fungible, signifying each token's uniqueness. Thus, the `getBalance` method provides a count of these distinct tokens owned by an address, unlike ERC-20's balance, which sums up the number of tokens.
* Ensure the validity of the provided Ethereum address to avoid potential errors or inaccurate data retrieval.

***
