> 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/erc1155/getbalance.md).

# getBalance

The `getBalance` method for the ERC-1155 token standard retrieves the balance of a specific token ID owned by a specified Ethereum address. Unlike ERC-721, which tracks ownership of individual unique tokens, ERC-1155 allows users to own multiple quantities of a particular token type. The method is part of the `ERC1155Instance` object, which can be obtained through an appropriate method of the `ZkyugaClient` or the relevant library.

## Method Signature

```javascript
getBalance(userAddress: string, id: string): Promise<BigNumber>
```

### Parameters

<table><thead><tr><th width="153">Parameter</th><th width="124">Type</th><th>Description</th></tr></thead><tbody><tr><td>userAddress</td><td>string</td><td>The Ethereum address for which you want to retrieve the token balance.</td></tr><tr><td>id</td><td>string</td><td>The specific ID of the ERC-1155 token for which the balance is being checked.</td></tr></tbody></table>

### Returns

* A `Promise` resolving to a `BigNumber` that indicates the balance of the specified ERC-1155 token ID owned by the given Ethereum address.

## Usage Example

First, instantiate the desired ERC-1155 token contract:

```javascript
const erc1155 = zkyugaClient.getERC1155Instance("your ERC-1155 contract address here");
```

Then, call the `getBalance` method for the desired Ethereum address and token ID:

```javascript
const userAddress = "0xBbF289D846208c16EDc8474705C748aff07732dB";
const tokenId = "token-specific-id";
const tokenBalance = await erc1155.getBalance(userAddress, tokenId);
console.log(`Token Balance for ID ${tokenId}: ${tokenBalance.toString()}`);
```

## Notes

* ERC-1155 is a multi-token standard where a user can own multiple quantities of a specific token type. The `getBalance` method provides the balance for a specific token ID owned by an address.
* Always ensure the validity of the Ethereum address and token ID provided; otherwise, the method might throw an error or return inaccurate results.

***
