# 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);
}
```

***


---

# 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.kuthulu.xyz/contracts/kultists.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.
