# Rankdem API

## Documentation for [**rankdem.com**](https://www.rankdem.com/)

## **Contracts:**

TREASURY\_PROGRAM\_ID

```typescript
EEmcFBL7pNPnVVG4J3NZjSeVQN3pS95LYammtNjTkprJ
```

RANK\_PROGRAM\_ID

```typescript
3WP3wv1aqvkgnXRtRKJVq4zHmURArn6HsmP9RiKyTbKu
```

## **JavaScript:**

\
Fetch Uploaded NFT accounts:

```typescript
const offset = 40;
const len = 8 ;
const accounts = await connection.getProgramAccounts(
  new web3.PublicKey(RANK_PROGRAM_ID),
  {
    dataSlice: { offset: offset, length: offset + len }
  }
);

return accounts.map((account) => account.pubkey);
```

Parse account data into Key and Rank

```typescript
const provider = new AnchorProvider(connection, wallet, {})
setProvider(provider)
const program = new Program(idl as Idl, RANK_PROGRAM_ID)

const accountsAnchor = await program.account.rankAccountState.fetchMultiple(accounts)

this.loadedNfts = accountsAnchor.map((data : any) => {
   // Get data with something like below
   // return new NFTState(data.nftPublicKey, data.rank.toNumber())
});
```


---

# 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://wildcat-labs.gitbook.io/rankdem-api/rankdem-api.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.
