> For the complete documentation index, see [llms.txt](https://docs.kuthulu.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kuthulu.xyz/contracts/kultists.md).

# Kultists

## Table of Contents

* [getWhaleSizes](#getwhalesizes)
* [getWhales](#getwhales)
* [getReRollCount](#getrerollcount)
* [getTokenDetails](#gettokendetails)
* [tokenURI](#tokenuri)

***

## <mark style="color:purple;">getWhaleSizes</mark>

#### Description

This function retrieves the list of whale sizes (token amounts owned by addresses) within the contract.

#### Input and Return Variables

| Variable | Type       | Description                                        |
| -------- | ---------- | -------------------------------------------------- |
| (return) | uint256\[] | List of token amounts that are owned by an address |

#### Example

```javascript
const contract = new ethers.Contract(contractAddress, contractABI, signer);

async function fetchWhaleSizes() {
  const whaleSizes = await contract.getWhaleSizes();
  console.log(whaleSizes);
}
```

***

## <mark style="color:purple;">getWhales</mark>

#### Description

This function retrieves the list of addresses that own a specific amount of tokens, specified by the `level` parameter.

#### Input and Return Variables

| Variable | Type       | Description                                    |
| -------- | ---------- | ---------------------------------------------- |
| level    | uint256    | The amount of tokens owned by a single address |
| (return) | address\[] | List of addresses that own that many tokens    |

#### Example

```javascript
const contract = new ethers.Contract(contractAddress, contractABI, signer);
const level = 1000;

async function fetchWhales() {
  const whales = await contract.getWhales(level);
  console.log(whales);
}
```

***

## <mark style="color:purple;">getReRollCount</mark>

#### Description

This function retrieves the number of re-rolls that a wallet has when minting a Kultist, specified by the `user` parameter.

#### Input and Return Variables

| Variable | Type    | Description                              |
| -------- | ------- | ---------------------------------------- |
| user     | address | The wallet address of the user to lookup |
| (return) | uint256 | The number of re-rolls a wallet has      |

#### Example

```javascript
const contract = new ethers.Contract(contractAddress, contractABI, signer);
const user = '0xYourWalletAddress';

async function fetchReRollCount() {
  const reRollCount = await contract.getReRollCount(user);
  console.log(reRollCount);
}
```

***

## <mark style="color:purple;">getTokenDetails</mark>

#### Description

This function retrieves details of a token with the given tokenID, including its summoning and reveal status and re-roll count.

#### Input and Return Variables

| Variable | Type       | Description                          |
| -------- | ---------- | ------------------------------------ |
| tokenID  | uint256    | The ID of the token to lookup        |
| (return) | uint256\[] | Will return the details of the token |

#### Example

```javascript
const contract = new ethers.Contract(contractAddress, contractABI, signer);
const tokenID = 1234;

async function fetchTokenDetails() {
  const tokenDetails = await contract.getTokenDetails(tokenID);
  console.log(tokenDetails);
}
```

***

## <mark style="color:purple;">tokenURI</mark>

#### Description

This function retrieves the token metadata URI for the given `_tokenID`, which could be different based on the revealed or summoned status of the token.

#### Input and Return Variables

| Variable  | Type    | Description                |
| --------- | ------- | -------------------------- |
| \_tokenID | uint256 | The unique Group ID        |
| (return)  | string  | The unique ID of the group |

#### Example

```javascript
const contract = new ethers.Contract(contractAddress, contractABI, signer);
const _tokenID = 5678;

async function fetchTokenURI() {
  const uri = await contract.tokenURI(_tokenID);
  console.log(uri);
}
```

***
