Vity Toolkit
TelegramTwitterGithubRequest new tool
  • Introduction
    • Vity Toolkit
    • 🚀Quick Start - Langchain
    • 🚀Quick Start - Vercel AI
  • Features
    • Apps and Actions
    • How can I use Action directly?
    • Agent Authentication
    • Extensions
  • Tools
    • Superteam Earn
    • Solana Wallet
    • Reddit
    • Gibwork
    • Twitter
  • EXAMPLES
    • AI Bounty Finder
Powered by GitBook
On this page
  • Quick Start
  • Supported Actions
  1. Tools

Solana Wallet

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

PreviousSuperteam EarnNextReddit

Last updated 5 months ago

A Solana wallet is a digital account that allows users to store, send, receive, and use SOL cryptocurrency on the Solana blockchain.

Quick Start

1

Install the package.

npm install vity-toolkit langchain @langchain/openai
2

Initialize Vity Toolkit and Langchain.

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>",
});
3

Add the tool.

const tools = toolKit.getTools({ apps: [App.SOLANA_WALLET] });
4

Define the Agent.

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 });
5

Execute the Agent.

const response = await agentExecutor.invoke({ input: "Create a Solana Wallet and give me it's public key. Also tell me it's balance." });
console.log(response);

Supported Actions

Action
Description

Generate a new Solana wallet keypair.

Retrieve the balance of a Solana account.

Get the public key of the current user who is using the Vity Toolkit.

Transfer Solana tokens like SOL, USDC, BONK, etc. to another account on any network.

Action.SOLANA_WALLET_GENERATE_KEYPAIR
Action.SOLANA_WALLET_GET_BALANCE
Action.SOLANA_WALLET_GET_MY_PUBLIC_KEY
Action.SOLANA_WALLET_TRANSFER