> For the complete documentation index, see [llms.txt](https://vity-toolkit.gitbook.io/vity-toolkit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vity-toolkit.gitbook.io/vity-toolkit/tools/superteam-earn.md).

# Superteam Earn

Guide to use superteam earn tool on your AI agent using Vity Toolkit

Superteam Earn allows developers, designers, and everyone else to find earning opportunities in Web3. Complete an on-chain bounty and receive a Proof of Work NFT to start building your on-chain resume.

### Quick Start <a href="#transfer-tokens-to-another-wallet-on-solana" id="transfer-tokens-to-another-wallet-on-solana"></a>

{% stepper %}
{% step %}

#### Install the package.

```bash
npm install vity-toolkit langchain @langchain/openai
```

{% endstep %}

{% step %}

#### Initialize Vity Toolkit and Langchain.

```typescript
import { ChatOpenAI } from "@langchain/openai";
import { App, LangchainToolkit } from "vity-toolkit";
import { createOpenAIFunctionsAgent, AgentExecutor } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";

const llm = new ChatOpenAI({ model: "gpt-4o" });
const toolKit = new LangchainToolkit({
    userPrivateKey: "<private_key>",
});
```

{% endstep %}

{% step %}

#### Add the tool.

```typescript
const tools = toolKit.getTools({ apps: [App.EARN] });
```

{% endstep %}

{% step %}

#### Define the Agent.

```typescript
const prompt = ChatPromptTemplate.fromMessages([
  ["system", "You are a helpful assistant"],
  ["placeholder", "{chat_history}"],
  ["human", "{input}"],
  ["placeholder", "{agent_scratchpad}"],
]);

const agent = await createOpenAIFunctionsAgent({
    llm,
    tools,
    prompt,
});

const agentExecutor = new AgentExecutor({ agent, tools, verbose: true });

```

{% endstep %}

{% step %}

#### Execute the Agent.

```typescript
const response = await agentExecutor.invoke({ input: "How much thatsmeadarsh has won till now?" });
console.log(response);
```

{% endstep %}
{% endstepper %}

### Supported Actions

<table><thead><tr><th>Action</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>Action.EARN_ACTIVITY_FEED
</code></pre></td><td>Get list of activities feed of users in superteam earn, like if someone submitted a bounty or added a new project in this profile, and much more.</td></tr><tr><td><pre><code>Action.EARN_FETCH_FEED
</code></pre></td><td>Fetches feed for a type (submission, pow, grant-application) and feed ID from Superteam Earn. It gives submission details with relative more submissions to the listing/bounty.</td></tr><tr><td><pre><code>Action.EARN_FETCH_GRANT_DETAILS
</code></pre></td><td>Fetches the grant details based on the provided slug.</td></tr><tr><td><pre><code>Action.EARN_FETCH_EXCLUSIVE_SPONSOR_GRANTS
</code></pre></td><td>Fetches grants associated with exclusive sponsor in Superteam Earn.</td></tr><tr><td><pre><code>Action.EARN_FETCH_USER_POWS
</code></pre></td><td>Fetches Proofs of Work (PoWs) for a specific user based on the provided user ID from Superteam Earn.</td></tr><tr><td><pre><code>Action.EARN_BOUNTY_LISTINGS
</code></pre></td><td>Fetches all the bounty listings based on various filters and criteria from the Superteam Earn homepage.</td></tr><tr><td><pre><code>Action.EARN_GRANT_LISTINGS
</code></pre></td><td>Fetches list of grants based on user region and other criteria from Superteam Earn.</td></tr><tr><td><pre><code>Action.EARN_SEARCH_USERS
</code></pre></td><td>Searches for user's details based on a query string, that can be a username, first name, or last name from the Superteam Earn homepage.</td></tr><tr><td><pre><code>Action.EARN_SUBMISSION_DETAILS
</code></pre></td><td>Fetches details of a specific submission based on the provided submission ID from the Superteam Earn homepage.</td></tr><tr><td><pre><code>Action.EARN_TOTAL_USER_COUNT
</code></pre></td><td>Fetches the total user count from the Superteam Earn.</td></tr><tr><td><pre><code>Action.EARN_FETCH_USER_PUBLIC_STATS
</code></pre></td><td>Fetches public statistics for a user like participations, wins and totalWinnings (amount) he/she won, based on the provided username from the Superteam Earn.</td></tr></tbody></table>
