mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-13 23:16:55 +00:00
fix
This commit is contained in:
@@ -78,10 +78,10 @@ npm install solana-agent-kit
|
||||
## Quick Start
|
||||
|
||||
```typescript
|
||||
import { SolanaAgent, createSolanaTools } from "solana-agent-kit";
|
||||
agent: SolanaAgentKit, createSolanaTools } from "solana-agent-kit";
|
||||
|
||||
// Initialize with private key and optional RPC URL
|
||||
const agent = new SolanaAgent(
|
||||
const agent = new SolanaAgentKit(
|
||||
"your-wallet-private-key-as-base58",
|
||||
"https://api.mainnet-beta.solana.com",
|
||||
"your-openai-api-key"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
--dark-hl-1: #D4D4D4;
|
||||
--light-hl-2: #A31515;
|
||||
--dark-hl-2: #CE9178;
|
||||
--light-hl-3: #AF00DB;
|
||||
--dark-hl-3: #C586C0;
|
||||
--light-hl-3: #000000;
|
||||
--dark-hl-3: #C8C8C8;
|
||||
--light-hl-4: #001080;
|
||||
--dark-hl-4: #9CDCFE;
|
||||
--light-hl-5: #008000;
|
||||
@@ -15,8 +15,10 @@
|
||||
--dark-hl-6: #569CD6;
|
||||
--light-hl-7: #0070C1;
|
||||
--dark-hl-7: #4FC1FF;
|
||||
--light-hl-8: #098658;
|
||||
--dark-hl-8: #B5CEA8;
|
||||
--light-hl-8: #AF00DB;
|
||||
--dark-hl-8: #C586C0;
|
||||
--light-hl-9: #098658;
|
||||
--dark-hl-9: #B5CEA8;
|
||||
--light-code-background: #FFFFFF;
|
||||
--dark-code-background: #1E1E1E;
|
||||
}
|
||||
@@ -31,6 +33,7 @@
|
||||
--hl-6: var(--light-hl-6);
|
||||
--hl-7: var(--light-hl-7);
|
||||
--hl-8: var(--light-hl-8);
|
||||
--hl-9: var(--light-hl-9);
|
||||
--code-background: var(--light-code-background);
|
||||
} }
|
||||
|
||||
@@ -44,6 +47,7 @@
|
||||
--hl-6: var(--dark-hl-6);
|
||||
--hl-7: var(--dark-hl-7);
|
||||
--hl-8: var(--dark-hl-8);
|
||||
--hl-9: var(--dark-hl-9);
|
||||
--code-background: var(--dark-code-background);
|
||||
} }
|
||||
|
||||
@@ -57,6 +61,7 @@
|
||||
--hl-6: var(--light-hl-6);
|
||||
--hl-7: var(--light-hl-7);
|
||||
--hl-8: var(--light-hl-8);
|
||||
--hl-9: var(--light-hl-9);
|
||||
--code-background: var(--light-code-background);
|
||||
}
|
||||
|
||||
@@ -70,6 +75,7 @@
|
||||
--hl-6: var(--dark-hl-6);
|
||||
--hl-7: var(--dark-hl-7);
|
||||
--hl-8: var(--dark-hl-8);
|
||||
--hl-9: var(--dark-hl-9);
|
||||
--code-background: var(--dark-code-background);
|
||||
}
|
||||
|
||||
@@ -82,4 +88,5 @@
|
||||
.hl-6 { color: var(--hl-6); }
|
||||
.hl-7 { color: var(--hl-7); }
|
||||
.hl-8 { color: var(--hl-8); }
|
||||
.hl-9 { color: var(--hl-9); }
|
||||
pre, code { background: var(--code-background); }
|
||||
|
||||
@@ -1 +1 @@
|
||||
window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7Wc33OcOBLH/xf8OuVYv2DsNyc5V+Uuu5taJ3sPUykXBnnCmQEWNPHOpvK/XwmYoXvUjIXxPiXlUX+7JX1oSSDpR1CXT01wtfoRPGZFGlwxvlwERbzRwVVwW+ZxEV+vdWH+k5lgEWzrPLgKkjxuGt28wT+ffzObPFjsfw2uguDnYq+qGD+oJmXRmHqbmLL2kTzD5YH8IqjiWhfGjXRwzC64hJ4LnZisLHwdD8Xn+H2K81x7td/Zoeh8f3dxmta6aSb4BSZz/JeVLuLsLq6yu0e98/LvmEz0zy/kwG2t/9zqxtzE20Sbm22R+rUBaTYnjlRXebn7XD5qP+Bw+fme35V5PoF3wmhODGtt3sZ5XCTayzsqPsfvJivMrzefvZwOZed4NHVcNA/aL52BwvMYX2eN0fX7chNnfv3rmMzz35T5d31b5pMicIxmEvapzjZxvZsQA2E0s+9TP8D3Jed4y3WRXjeNNn4ZDRWf2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Dq/WXnz//DxMMox3YVwAA";
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
119
docs/index.html
119
docs/index.html
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
154
docs/media/CONTRIBUTING.md
Normal file
154
docs/media/CONTRIBUTING.md
Normal file
@@ -0,0 +1,154 @@
|
||||
# Contributing to Solana Agent Kit
|
||||
|
||||
First off, thank you for considering contributing to Solana Agent Kit! 🎉 Your contributions are **greatly appreciated**.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Contributing to Solana Agent Kit](#contributing-to-solana-agent-kit)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Code of Conduct](#code-of-conduct)
|
||||
- [How Can I Contribute?](#how-can-i-contribute)
|
||||
- [Reporting Bugs](#reporting-bugs)
|
||||
- [Suggesting Enhancements](#suggesting-enhancements)
|
||||
- [Your First Code Contribution](#your-first-code-contribution)
|
||||
- [Pull Requests](#pull-requests)
|
||||
- [Style Guides](#style-guides)
|
||||
- [Code Style](#code-style)
|
||||
- [Commit Messages](#commit-messages)
|
||||
- [Naming Conventions](#naming-conventions)
|
||||
- [Development Setup](#development-setup)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installation](#installation)
|
||||
- [Building the Project](#building-the-project)
|
||||
- [Running Tests](#running-tests)
|
||||
- [Generating Documentation](#generating-documentation)
|
||||
- [Security](#security)
|
||||
- [License](#license)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project adheres to the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). By participating, you are expected to uphold this code. Please report unacceptable behavior to [aryan@sendai.fun](mailto:aryan@sendai.fun).
|
||||
|
||||
## How Can I Contribute?
|
||||
|
||||
### Reporting Bugs
|
||||
|
||||
**Great**! Opening an issue is the best way to help us improve. Here's how you can report a bug:
|
||||
|
||||
1. **Search** the [existing issues](https://github.com/sendaifun/solana-agent-kit/issues) to make sure it hasn't been reported.
|
||||
2. **Open a new issue** and fill out the template with as much information as possible.
|
||||
3. **Provide reproduction steps** if applicable.
|
||||
|
||||
### Suggesting Enhancements
|
||||
|
||||
We welcome your ideas for improving Solana Agent Kit! To suggest an enhancement:
|
||||
|
||||
1. **Search** the [existing issues](https://github.com/sendaifun/solana-agent-kit/issues) to see if it's already been suggested.
|
||||
2. **Open a new issue** and describe your idea in detail.
|
||||
|
||||
### Your First Code Contribution
|
||||
|
||||
Unsure where to start? You can help out by:
|
||||
|
||||
- Fixing simple bugs.
|
||||
- Improving documentation.
|
||||
- Adding tests.
|
||||
|
||||
Check out the [Good First Issues](https://github.com/sendaifun/solana-agent-kit/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) to get started!
|
||||
|
||||
### Pull Requests
|
||||
|
||||
1. **Fork** the repository.
|
||||
2. **Create** a new branch for your feature or bugfix.
|
||||
```bash
|
||||
git checkout -b feature/your-feature-name
|
||||
```
|
||||
3. **Commit** your changes with clear and descriptive messages.
|
||||
4. **Push** to your fork.
|
||||
```bash
|
||||
git push origin feature/your-feature-name
|
||||
```
|
||||
5. **Open a Pull Request** against the `main` branch of this repository.
|
||||
|
||||
## Style Guides
|
||||
|
||||
### Code Style
|
||||
|
||||
- **Language**: TypeScript
|
||||
- **Formatting**: Follow the existing codebase formatting. Consider using [Prettier](https://prettier.io/) for consistent code formatting.
|
||||
- **Code Quality**: Adhere to the code quality rules defined in `.eslintrc`. Ensure all checks pass before submitting a PR.
|
||||
|
||||
### Commit Messages
|
||||
|
||||
Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for your commit messages. Examples:
|
||||
|
||||
- `feat: add ability to deploy new SPL token`
|
||||
- `fix: handle edge case when deploying collection`
|
||||
- `docs: update README with new usage examples`
|
||||
|
||||
### Naming Conventions
|
||||
|
||||
- **Variables and Functions**: `camelCase`
|
||||
- **Classes and Types**: `PascalCase`
|
||||
- **Constants**: `UPPER_SNAKE_CASE`
|
||||
|
||||
## Development Setup
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- **Node.js**: v23.x or higher
|
||||
- **npm**: v10.x or higher
|
||||
- **Git**: Installed and configured
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone** the repository:
|
||||
```bash
|
||||
git clone https://github.com/yourusername/solana-agent-kit.git
|
||||
```
|
||||
2. **Navigate** to the project directory:
|
||||
```bash
|
||||
cd solana-agent-kit
|
||||
```
|
||||
3. **Install** dependencies:
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Building the Project
|
||||
|
||||
To compile the TypeScript code:
|
||||
|
||||
```bash
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
|
||||
To execute the test suite:
|
||||
|
||||
```bash
|
||||
pnpm run test
|
||||
```
|
||||
|
||||
### Generating Documentation
|
||||
|
||||
To generate the project documentation using TypeDoc:
|
||||
|
||||
```bash
|
||||
npm run docs
|
||||
```
|
||||
|
||||
The documentation will be available in the `docs/` directory.
|
||||
|
||||
## Security
|
||||
|
||||
This toolkit handles sensitive information such as private keys and API keys. **Ensure you never commit `.env` files or any sensitive data**. Review the `.gitignore` to confirm that sensitive files are excluded.
|
||||
|
||||
For security vulnerabilities, please follow the [responsible disclosure](mailto:aryan@sendai.fun) process.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [ISC License](LICENSE).
|
||||
|
||||
---
|
||||
@@ -21,19 +21,19 @@ Create a new TypeScript file in the `src/tools/` directory for your tool (e.g.,
|
||||
|
||||
```typescript:src/tools/custom_tool.ts
|
||||
import { Tool } from "langchain/tools";
|
||||
import { SolanaAgent } from "../agent";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
|
||||
export class CustomTool extends Tool {
|
||||
name = "custom_tool";
|
||||
description = "Description of what the custom tool does.";
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(input: string): Promise<string> {
|
||||
try {
|
||||
const result = await this.solanaAgent.customFunction(input);
|
||||
const result = await this.solanaKit.customFunction(input);
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
message: "Custom tool executed successfully",
|
||||
@@ -87,7 +87,7 @@ export function createSolanaTools(agent: SolanaAgentKit) {
|
||||
### 6. Usage Example
|
||||
|
||||
```typescript
|
||||
import { SolanaAgent, createSolanaTools } from "solana-agent-kit";
|
||||
agent: SolanaAgentKit, createSolanaTools } from "solana-agent-kit";
|
||||
|
||||
const agent = new SolanaAgent(
|
||||
"your-wallet-private-key-as-base58",
|
||||
@@ -118,19 +118,19 @@ Here's a complete example of implementing a tool to fetch token prices:
|
||||
|
||||
```typescript:src/tools/fetch_token_price.ts
|
||||
import { Tool } from "langchain/tools";
|
||||
import { SolanaAgent } from "../agent";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
|
||||
export class FetchTokenPriceTool extends Tool {
|
||||
name = "fetch_token_price";
|
||||
description = "Fetches the current price of a specified token.";
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(tokenSymbol: string): Promise<string> {
|
||||
try {
|
||||
const price = await this.solanaAgent.getTokenPrice(tokenSymbol);
|
||||
const price = await this.solanaKit.getTokenPrice(tokenSymbol);
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
message: `Price fetched successfully for ${tokenSymbol}.`,
|
||||
|
||||
@@ -42,12 +42,12 @@ import { BN } from "@coral-xyz/anchor";
|
||||
* Main class for interacting with Solana blockchain
|
||||
* Provides a unified interface for token operations, NFT management, trading and more
|
||||
*
|
||||
* @class SolanaAgent
|
||||
* @class SolanaAgentKit
|
||||
* @property {Connection} connection - Solana RPC connection
|
||||
* @property {Keypair} wallet - Wallet keypair for signing transactions
|
||||
* @property {PublicKey} wallet_address - Public key of the wallet
|
||||
*/
|
||||
export class SolanaAgent {
|
||||
export class SolanaAgentKit {
|
||||
public connection: Connection;
|
||||
public wallet: Keypair;
|
||||
public wallet_address: PublicKey;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SolanaAgent } from "./agent";
|
||||
import { SolanaAgentKit } from "./agent";
|
||||
import { createSolanaTools } from "./langchain";
|
||||
|
||||
export { SolanaAgent, createSolanaTools };
|
||||
export { SolanaAgentKit, createSolanaTools };
|
||||
|
||||
// Optional: Export types that users might need
|
||||
export * from "./types";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import Decimal from "decimal.js";
|
||||
import { Tool } from "langchain/tools";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { create_image } from "../tools/create_image";
|
||||
import { BN } from "@coral-xyz/anchor";
|
||||
import { FEE_TIERS } from "../tools";
|
||||
@@ -17,14 +17,14 @@ export class SolanaBalanceTool extends Tool {
|
||||
Inputs:
|
||||
tokenAddress: string, eg "So11111111111111111111111111111111111111112" (optional)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(input: string): Promise<string> {
|
||||
try {
|
||||
const tokenAddress = input ? new PublicKey(input) : undefined;
|
||||
const balance = await this.solanaAgent.getBalance(tokenAddress);
|
||||
const balance = await this.solanaKit.getBalance(tokenAddress);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -50,7 +50,7 @@ export class SolanaTransferTool extends Tool {
|
||||
amount: number, eg 1 (required)
|
||||
mint?: string, eg "So11111111111111111111111111111111111111112" or "SENDdRQtYMWaQrBroBrJ2Q53fgVuq95CV9UPGEvpCxa" (optional)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export class SolanaTransferTool extends Tool {
|
||||
? new PublicKey(parsedInput.mint)
|
||||
: undefined;
|
||||
|
||||
const tx = await this.solanaAgent.transfer(
|
||||
const tx = await this.solanaKit.transfer(
|
||||
recipient,
|
||||
parsedInput.amount,
|
||||
mintAddress,
|
||||
@@ -98,7 +98,7 @@ export class SolanaDeployTokenTool extends Tool {
|
||||
decimals?: number, eg 9 (optional, defaults to 9)
|
||||
initialSupply?: number, eg 1000000 (optional)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export class SolanaDeployTokenTool extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input);
|
||||
|
||||
const result = await this.solanaAgent.deployToken(
|
||||
const result = await this.solanaKit.deployToken(
|
||||
parsedInput.name,
|
||||
parsedInput.uri,
|
||||
parsedInput.symbol,
|
||||
@@ -139,7 +139,7 @@ export class SolanaDeployCollectionTool extends Tool {
|
||||
uri: string, eg "https://example.com/collection.json" (required)
|
||||
royaltyBasisPoints?: number, eg 500 for 5% (optional)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ export class SolanaDeployCollectionTool extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input);
|
||||
|
||||
const result = await this.solanaAgent.deployCollection(parsedInput);
|
||||
const result = await this.solanaKit.deployCollection(parsedInput);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -173,9 +173,9 @@ export class SolanaMintNFTTool extends Tool {
|
||||
collectionMint: string, eg "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w" (required) - The address of the collection to mint into
|
||||
name: string, eg "My NFT" (required)
|
||||
uri: string, eg "https://example.com/nft.json" (required)
|
||||
recipient?: string, eg "9aUn5swQzUTRanaaTwmszxiv89cvFwUCjEBv1vZCoT1u" (optional) - The wallet to receive the NFT, defaults to agent's wallet which is ${this.solanaAgent.wallet_address.toString()}`;
|
||||
recipient?: string, eg "9aUn5swQzUTRanaaTwmszxiv89cvFwUCjEBv1vZCoT1u" (optional) - The wallet to receive the NFT, defaults to agent's wallet which is ${this.solanaKit.wallet_address.toString()}`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ export class SolanaMintNFTTool extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input);
|
||||
|
||||
const result = await this.solanaAgent.mintNFT(
|
||||
const result = await this.solanaKit.mintNFT(
|
||||
new PublicKey(parsedInput.collectionMint),
|
||||
{
|
||||
name: parsedInput.name,
|
||||
@@ -191,7 +191,7 @@ export class SolanaMintNFTTool extends Tool {
|
||||
},
|
||||
parsedInput.recipient
|
||||
? new PublicKey(parsedInput.recipient)
|
||||
: this.solanaAgent.wallet_address,
|
||||
: this.solanaKit.wallet_address,
|
||||
);
|
||||
|
||||
return JSON.stringify({
|
||||
@@ -225,7 +225,7 @@ export class SolanaTradeTool extends Tool {
|
||||
inputMint?: string, eg "So11111111111111111111111111111111111111112" (optional)
|
||||
slippageBps?: number, eg 100 (optional)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ export class SolanaTradeTool extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input);
|
||||
|
||||
const tx = await this.solanaAgent.trade(
|
||||
const tx = await this.solanaKit.trade(
|
||||
new PublicKey(parsedInput.outputMint),
|
||||
parsedInput.inputAmount,
|
||||
parsedInput.inputMint
|
||||
@@ -264,18 +264,18 @@ export class SolanaRequestFundsTool extends Tool {
|
||||
name = "solana_request_funds";
|
||||
description = "Request SOL from Solana faucet (devnet/testnet only)";
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(_input: string): Promise<string> {
|
||||
try {
|
||||
await this.solanaAgent.requestFaucetFunds();
|
||||
await this.solanaKit.requestFaucetFunds();
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
message: "Successfully requested faucet funds",
|
||||
network: this.solanaAgent.connection.rpcEndpoint.split("/")[2],
|
||||
network: this.solanaKit.connection.rpcEndpoint.split("/")[2],
|
||||
});
|
||||
} catch (error: any) {
|
||||
return JSON.stringify({
|
||||
@@ -296,7 +296,7 @@ export class SolanaRegisterDomainTool extends Tool {
|
||||
spaceKB: number, eg 1 (optional, default is 1)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ export class SolanaRegisterDomainTool extends Tool {
|
||||
const parsedInput = toJSON(input);
|
||||
this.validateInput(parsedInput);
|
||||
|
||||
const tx = await this.solanaAgent.registerDomain(
|
||||
const tx = await this.solanaKit.registerDomain(
|
||||
parsedInput.name,
|
||||
parsedInput.spaceKB || 1,
|
||||
);
|
||||
@@ -347,14 +347,14 @@ export class SolanaResolveDomainTool extends Tool {
|
||||
domain: string, eg "pumpfun.sol" or "pumpfun"(required)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(input: string): Promise<string> {
|
||||
try {
|
||||
const domain = input.trim();
|
||||
const publicKey = await this.solanaAgent.resolveSolDomain(domain);
|
||||
const publicKey = await this.solanaKit.resolveSolDomain(domain);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -379,14 +379,14 @@ export class SolanaGetDomainTool extends Tool {
|
||||
account: string, eg "4Be9CvxqHW6BYiRAxW9Q3xu1ycTMWaL5z8NX4HR3ha7t" (required)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(input: string): Promise<string> {
|
||||
try {
|
||||
const account = new PublicKey(input.trim());
|
||||
const domain = await this.solanaAgent.getPrimaryDomain(account);
|
||||
const domain = await this.solanaKit.getPrimaryDomain(account);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -407,12 +407,12 @@ export class SolanaGetWalletAddressTool extends Tool {
|
||||
name = "solana_get_wallet_address";
|
||||
description = `Get the wallet address of the agent`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
async _call(_input: string): Promise<string> {
|
||||
return this.solanaAgent.wallet_address.toString();
|
||||
return this.solanaKit.wallet_address.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ export class SolanaPumpfunTokenLaunchTool extends Tool {
|
||||
description: string, eg "PumpFun Token is a token on the Solana blockchain",
|
||||
imageUrl: string, eg "https://i.imgur.com/UFm07Np_d.png`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ export class SolanaPumpfunTokenLaunchTool extends Tool {
|
||||
this.validateInput(parsedInput);
|
||||
|
||||
// Launch token with validated input
|
||||
await this.solanaAgent.launchPumpFunToken(
|
||||
await this.solanaKit.launchPumpFunToken(
|
||||
parsedInput.tokenName,
|
||||
parsedInput.tokenTicker,
|
||||
parsedInput.description,
|
||||
@@ -498,7 +498,7 @@ export class SolanaCreateImageTool extends Tool {
|
||||
description =
|
||||
"Create an image using OpenAI's DALL-E. Input should be a string prompt for the image.";
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ export class SolanaCreateImageTool extends Tool {
|
||||
protected async _call(input: string): Promise<string> {
|
||||
try {
|
||||
this.validateInput(input);
|
||||
const result = await create_image(this.solanaAgent, input.trim());
|
||||
const result = await create_image(this.solanaKit, input.trim());
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -535,7 +535,7 @@ export class SolanaLendAssetTool extends Tool {
|
||||
Inputs (input is a json string):
|
||||
amount: number, eg 1, 0.01 (required)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ export class SolanaLendAssetTool extends Tool {
|
||||
try {
|
||||
let amount = JSON.parse(input).amount || input;
|
||||
|
||||
const tx = await this.solanaAgent.lendAssets(amount);
|
||||
const tx = await this.solanaKit.lendAssets(amount);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -565,13 +565,13 @@ export class SolanaTPSCalculatorTool extends Tool {
|
||||
name = "solana_get_tps";
|
||||
description = "Get the current TPS of the Solana network";
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
async _call(_input: string): Promise<string> {
|
||||
try {
|
||||
const tps = await this.solanaAgent.getTPS();
|
||||
const tps = await this.solanaKit.getTPS();
|
||||
return `Solana (mainnet-beta) current transactions per second: ${tps}`;
|
||||
} catch (error: any) {
|
||||
return `Error fetching TPS: ${error.message}`;
|
||||
@@ -586,7 +586,7 @@ export class SolanaStakeTool extends Tool {
|
||||
Inputs ( input is a JSON string ):
|
||||
amount: number, eg 1 or 0.01 (required)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ export class SolanaStakeTool extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input) || Number(input);
|
||||
|
||||
const tx = await this.solanaAgent.stake(parsedInput.amount);
|
||||
const tx = await this.solanaKit.stake(parsedInput.amount);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -622,13 +622,13 @@ export class SolanaFetchPriceTool extends Tool {
|
||||
Inputs:
|
||||
- tokenId: string, the mint address of the token, e.g., "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
async _call(input: string): Promise<string> {
|
||||
try {
|
||||
const price = await this.solanaAgent.fetchTokenPrice(input.trim());
|
||||
const price = await this.solanaKit.fetchTokenPrice(input.trim());
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
tokenId: input.trim(),
|
||||
@@ -651,7 +651,7 @@ export class SolanaTokenDataTool extends Tool {
|
||||
Inputs: mintAddress is required.
|
||||
mintAddress: string, eg "So11111111111111111111111111111111111111112" (required)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -659,8 +659,7 @@ export class SolanaTokenDataTool extends Tool {
|
||||
try {
|
||||
const parsedInput = input.trim();
|
||||
|
||||
const tokenData =
|
||||
await this.solanaAgent.getTokenDataByAddress(parsedInput);
|
||||
const tokenData = await this.solanaKit.getTokenDataByAddress(parsedInput);
|
||||
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
@@ -683,14 +682,14 @@ export class SolanaTokenDataByTickerTool extends Tool {
|
||||
Inputs: ticker is required.
|
||||
ticker: string, eg "USDC" (required)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected async _call(input: string): Promise<string> {
|
||||
try {
|
||||
const ticker = input.trim();
|
||||
const tokenData = await this.solanaAgent.getTokenDataByTicker(ticker);
|
||||
const tokenData = await this.solanaKit.getTokenDataByTicker(ticker);
|
||||
return JSON.stringify({
|
||||
status: "success",
|
||||
tokenData: tokenData,
|
||||
@@ -717,7 +716,7 @@ export class SolanaCompressedAirdropTool extends Tool {
|
||||
priorityFeeInLamports: number, the priority fee in lamports. Default is 30_000. (optional)
|
||||
shouldLog: boolean, whether to log progress to stdout. Default is false. (optional)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -725,7 +724,7 @@ export class SolanaCompressedAirdropTool extends Tool {
|
||||
try {
|
||||
const parsedInput = JSON.parse(input);
|
||||
|
||||
const txs = await this.solanaAgent.sendCompressedAirdrop(
|
||||
const txs = await this.solanaKit.sendCompressedAirdrop(
|
||||
parsedInput.mintAddress,
|
||||
parsedInput.amount,
|
||||
parsedInput.decimals,
|
||||
@@ -761,7 +760,7 @@ export class SolanaCreateSingleSidedWhirlpoolTool extends Tool {
|
||||
- maxPrice: number, eg: 5.0 (required, maximum price at which liquidity is added)
|
||||
- feeTier: number, eg: 0.30 (required, fee tier for the pool)`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -781,7 +780,7 @@ export class SolanaCreateSingleSidedWhirlpoolTool extends Tool {
|
||||
);
|
||||
}
|
||||
|
||||
const txId = await this.solanaAgent.createOrcaSingleSidedWhirlpool(
|
||||
const txId = await this.solanaKit.createOrcaSingleSidedWhirlpool(
|
||||
depositTokenAmount,
|
||||
depositTokenMint,
|
||||
otherTokenMint,
|
||||
@@ -816,7 +815,7 @@ export class SolanaRaydiumCreateAmmV4 extends Tool {
|
||||
startTime: number(seconds), eg: now number or zero (required)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -824,7 +823,7 @@ export class SolanaRaydiumCreateAmmV4 extends Tool {
|
||||
try {
|
||||
let inputFormat = JSON.parse(input);
|
||||
|
||||
const tx = await this.solanaAgent.raydiumCreateAmmV4(
|
||||
const tx = await this.solanaKit.raydiumCreateAmmV4(
|
||||
new PublicKey(inputFormat.marketId),
|
||||
new BN(inputFormat.baseAmount),
|
||||
new BN(inputFormat.quoteAmount),
|
||||
@@ -858,7 +857,7 @@ export class SolanaRaydiumCreateClmm extends Tool {
|
||||
startTime: number(seconds), eg: now number or zero (required)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -866,7 +865,7 @@ export class SolanaRaydiumCreateClmm extends Tool {
|
||||
try {
|
||||
let inputFormat = JSON.parse(input);
|
||||
|
||||
const tx = await this.solanaAgent.raydiumCreateClmm(
|
||||
const tx = await this.solanaKit.raydiumCreateClmm(
|
||||
new PublicKey(inputFormat.mint1),
|
||||
new PublicKey(inputFormat.mint2),
|
||||
|
||||
@@ -904,7 +903,7 @@ export class SolanaRaydiumCreateCpmm extends Tool {
|
||||
startTime: number(seconds), eg: now number or zero (required)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -912,7 +911,7 @@ export class SolanaRaydiumCreateCpmm extends Tool {
|
||||
try {
|
||||
let inputFormat = JSON.parse(input);
|
||||
|
||||
const tx = await this.solanaAgent.raydiumCreateCpmm(
|
||||
const tx = await this.solanaKit.raydiumCreateCpmm(
|
||||
new PublicKey(inputFormat.mint1),
|
||||
new PublicKey(inputFormat.mint2),
|
||||
|
||||
@@ -950,7 +949,7 @@ export class SolanaOpenbookCreateMarket extends Tool {
|
||||
tickSize: number (required)
|
||||
`;
|
||||
|
||||
constructor(private solanaAgent: SolanaAgent) {
|
||||
constructor(private solanaKit: SolanaAgentKit) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -958,7 +957,7 @@ export class SolanaOpenbookCreateMarket extends Tool {
|
||||
try {
|
||||
let inputFormat = JSON.parse(input);
|
||||
|
||||
const tx = await this.solanaAgent.openbookCreateMarket(
|
||||
const tx = await this.solanaKit.openbookCreateMarket(
|
||||
new PublicKey(inputFormat.baseMint),
|
||||
new PublicKey(inputFormat.quoteMint),
|
||||
|
||||
@@ -981,32 +980,32 @@ export class SolanaOpenbookCreateMarket extends Tool {
|
||||
}
|
||||
}
|
||||
|
||||
export function createSolanaTools(solanaAgent: SolanaAgent) {
|
||||
export function createSolanaTools(solanaKit: SolanaAgentKit) {
|
||||
return [
|
||||
new SolanaBalanceTool(solanaAgent),
|
||||
new SolanaTransferTool(solanaAgent),
|
||||
new SolanaDeployTokenTool(solanaAgent),
|
||||
new SolanaDeployCollectionTool(solanaAgent),
|
||||
new SolanaMintNFTTool(solanaAgent),
|
||||
new SolanaTradeTool(solanaAgent),
|
||||
new SolanaRequestFundsTool(solanaAgent),
|
||||
new SolanaRegisterDomainTool(solanaAgent),
|
||||
new SolanaGetWalletAddressTool(solanaAgent),
|
||||
new SolanaPumpfunTokenLaunchTool(solanaAgent),
|
||||
new SolanaCreateImageTool(solanaAgent),
|
||||
new SolanaLendAssetTool(solanaAgent),
|
||||
new SolanaTPSCalculatorTool(solanaAgent),
|
||||
new SolanaStakeTool(solanaAgent),
|
||||
new SolanaFetchPriceTool(solanaAgent),
|
||||
new SolanaResolveDomainTool(solanaAgent),
|
||||
new SolanaGetDomainTool(solanaAgent),
|
||||
new SolanaTokenDataTool(solanaAgent),
|
||||
new SolanaTokenDataByTickerTool(solanaAgent),
|
||||
new SolanaCompressedAirdropTool(solanaAgent),
|
||||
new SolanaRaydiumCreateAmmV4(solanaAgent),
|
||||
new SolanaRaydiumCreateClmm(solanaAgent),
|
||||
new SolanaRaydiumCreateCpmm(solanaAgent),
|
||||
new SolanaOpenbookCreateMarket(solanaAgent),
|
||||
new SolanaCreateSingleSidedWhirlpoolTool(solanaAgent),
|
||||
new SolanaBalanceTool(solanaKit),
|
||||
new SolanaTransferTool(solanaKit),
|
||||
new SolanaDeployTokenTool(solanaKit),
|
||||
new SolanaDeployCollectionTool(solanaKit),
|
||||
new SolanaMintNFTTool(solanaKit),
|
||||
new SolanaTradeTool(solanaKit),
|
||||
new SolanaRequestFundsTool(solanaKit),
|
||||
new SolanaRegisterDomainTool(solanaKit),
|
||||
new SolanaGetWalletAddressTool(solanaKit),
|
||||
new SolanaPumpfunTokenLaunchTool(solanaKit),
|
||||
new SolanaCreateImageTool(solanaKit),
|
||||
new SolanaLendAssetTool(solanaKit),
|
||||
new SolanaTPSCalculatorTool(solanaKit),
|
||||
new SolanaStakeTool(solanaKit),
|
||||
new SolanaFetchPriceTool(solanaKit),
|
||||
new SolanaResolveDomainTool(solanaKit),
|
||||
new SolanaGetDomainTool(solanaKit),
|
||||
new SolanaTokenDataTool(solanaKit),
|
||||
new SolanaTokenDataByTickerTool(solanaKit),
|
||||
new SolanaCompressedAirdropTool(solanaKit),
|
||||
new SolanaRaydiumCreateAmmV4(solanaKit),
|
||||
new SolanaRaydiumCreateClmm(solanaKit),
|
||||
new SolanaRaydiumCreateCpmm(solanaKit),
|
||||
new SolanaOpenbookCreateMarket(solanaKit),
|
||||
new SolanaCreateSingleSidedWhirlpoolTool(solanaKit),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import OpenAI from "openai";
|
||||
|
||||
/**
|
||||
@@ -10,7 +10,7 @@ import OpenAI from "openai";
|
||||
* @returns Object containing the generated image URLs
|
||||
*/
|
||||
export async function create_image(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
prompt: string,
|
||||
size: "256x256" | "512x512" | "1024x1024" = "1024x1024",
|
||||
n: number = 1,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Keypair, PublicKey, Transaction } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { BN, Wallet } from "@coral-xyz/anchor";
|
||||
import { Decimal } from "decimal.js";
|
||||
import {
|
||||
@@ -99,7 +99,7 @@ export const FEE_TIERS = {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { SolanaAgentKit } from "your-sdk";
|
||||
* agent: SolanaAgentKitKit } from "your-sdk";
|
||||
* import { PublicKey } from "@solana/web3.js";
|
||||
* import { BN } from "@coral-xyz/anchor";
|
||||
* import Decimal from "decimal.js";
|
||||
@@ -125,7 +125,7 @@ export const FEE_TIERS = {
|
||||
* ```
|
||||
*/
|
||||
export async function createOrcaSingleSidedWhirlpool(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
depositTokenAmount: BN,
|
||||
depositTokenMint: PublicKey,
|
||||
otherTokenMint: PublicKey,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import {
|
||||
generateSigner,
|
||||
keypairIdentity,
|
||||
@@ -23,7 +23,7 @@ import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
|
||||
* @returns Object containing collection address and metadata
|
||||
*/
|
||||
export async function deploy_collection(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
options: CollectionOptions,
|
||||
): Promise<CollectionDeployment> {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
|
||||
import { generateSigner, keypairIdentity } from "@metaplex-foundation/umi";
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
* @returns Object containing token mint address and initial account (if supply was minted)
|
||||
*/
|
||||
export async function deploy_token(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
name: string,
|
||||
uri: string,
|
||||
symbol: string,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Get the balance of SOL or an SPL token for the agent's wallet
|
||||
@@ -8,7 +8,7 @@ import { SolanaAgent } from "../index";
|
||||
* @returns Promise resolving to the balance as a number (in UI units) or null if account doesn't exist
|
||||
*/
|
||||
export async function get_balance(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
token_address?: PublicKey,
|
||||
): Promise<number | null> {
|
||||
if (!token_address)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getPrimaryDomain as _getPrimaryDomain } from "@bonfida/spl-name-service";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Retrieves the primary .sol domain associated with a given Solana public key.
|
||||
@@ -15,7 +15,7 @@ import { SolanaAgent } from "../index";
|
||||
* @throws Error if the domain is stale or if the domain resolution fails
|
||||
*/
|
||||
export async function getPrimaryDomain(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
account: PublicKey,
|
||||
): Promise<string> {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
export async function getTPS(agent: SolanaAgentKit): Promise<number> {
|
||||
const perfSamples = await agent.connection.getRecentPerformanceSamples();
|
||||
|
||||
@@ -55,7 +55,7 @@ async function uploadMetadata(
|
||||
}
|
||||
|
||||
async function createTokenTransaction(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
mintKeypair: Keypair,
|
||||
metadataResponse: any,
|
||||
options?: PumpFunTokenOptions,
|
||||
@@ -149,7 +149,7 @@ async function signAndSendTransaction(
|
||||
* @returns - Signature of the transaction, mint address and metadata URI, if successful, else error
|
||||
*/
|
||||
export async function launchPumpFunToken(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
tokenName: string,
|
||||
tokenTicker: string,
|
||||
description: string,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { VersionedTransaction } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Lend tokens for yields using Lulo
|
||||
@@ -8,7 +8,7 @@ import { SolanaAgent } from "../index";
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function lendAsset(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
): Promise<string> {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { generateSigner, keypairIdentity } from "@metaplex-foundation/umi";
|
||||
import { create, mplCore } from "@metaplex-foundation/mpl-core";
|
||||
import { fetchCollection } from "@metaplex-foundation/mpl-core";
|
||||
@@ -20,7 +20,7 @@ import { MintCollectionNFTResponse } from "../types";
|
||||
* @returns Object containing NFT mint address and token account
|
||||
*/
|
||||
export async function mintCollectionNFT(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
collectionMint: PublicKey,
|
||||
metadata: {
|
||||
name: string;
|
||||
|
||||
@@ -5,10 +5,10 @@ import {
|
||||
} from "@raydium-io/raydium-sdk-v2";
|
||||
import { MintLayout, TOKEN_PROGRAM_ID } from "@solana/spl-token";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
export async function openbookCreateMarket(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
baseMint: PublicKey,
|
||||
quoteMint: PublicKey,
|
||||
lotSize: number = 1,
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
import { MintLayout, TOKEN_PROGRAM_ID } from "@solana/spl-token";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import BN from "bn.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
export async function raydiumCreateAmmV4(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
marketId: PublicKey,
|
||||
baseAmount: BN,
|
||||
quoteAmount: BN,
|
||||
|
||||
@@ -7,10 +7,10 @@ import { MintLayout } from "@solana/spl-token";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import BN from "bn.js";
|
||||
import Decimal from "decimal.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
export async function raydiumCreateClmm(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
mint1: PublicKey,
|
||||
mint2: PublicKey,
|
||||
configId: PublicKey,
|
||||
|
||||
@@ -7,10 +7,10 @@ import {
|
||||
import { MintLayout } from "@solana/spl-token";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import BN from "bn.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
export async function raydiumCreateCpmm(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
mintA: PublicKey,
|
||||
mintB: PublicKey,
|
||||
configId: PublicKey,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { registerDomainNameV2 } from "@bonfida/spl-name-service";
|
||||
import { Transaction } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { getAssociatedTokenAddressSync } from "@solana/spl-token";
|
||||
import { TOKENS } from "../constants";
|
||||
|
||||
@@ -12,7 +12,7 @@ import { TOKENS } from "../constants";
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function registerDomain(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
name: string,
|
||||
spaceKB: number = 1,
|
||||
): Promise<string> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
|
||||
|
||||
/**
|
||||
@@ -8,7 +8,7 @@ import { LAMPORTS_PER_SOL } from "@solana/web3.js";
|
||||
* @throws Error if the request fails or times out
|
||||
*/
|
||||
export async function request_faucet_funds(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
): Promise<string> {
|
||||
const tx = await agent.connection.requestAirdrop(
|
||||
agent.wallet_address,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { resolve } from "@bonfida/spl-name-service";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Resolves a .sol domain to a Solana PublicKey.
|
||||
@@ -15,7 +15,7 @@ import { SolanaAgent } from "../index";
|
||||
* @throws Error if the domain resolution fails
|
||||
*/
|
||||
export async function resolveSolDomain(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
domain: string,
|
||||
): Promise<PublicKey> {
|
||||
if (!domain || typeof domain !== "string") {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
PublicKey,
|
||||
TransactionInstruction,
|
||||
} from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import {
|
||||
buildAndSignTx,
|
||||
calculateComputeUnitPrice,
|
||||
@@ -56,7 +56,7 @@ export const getAirdropCostEstimate = (
|
||||
* @param shouldLog Whether to log progress to stdout. Defaults to false.
|
||||
*/
|
||||
export async function sendCompressedAirdrop(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
mintAddress: PublicKey,
|
||||
amount: number,
|
||||
decimals: number,
|
||||
@@ -119,7 +119,7 @@ export async function sendCompressedAirdrop(
|
||||
}
|
||||
|
||||
async function processAll(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
mint: PublicKey,
|
||||
recipients: PublicKey[],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { VersionedTransaction } from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Stake SOL with Jup validator
|
||||
@@ -8,7 +8,7 @@ import { SolanaAgent } from "../index";
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function stakeWithJup(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
): Promise<string> {
|
||||
try {
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
PublicKey,
|
||||
LAMPORTS_PER_SOL,
|
||||
} from "@solana/web3.js";
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { TOKENS, DEFAULT_OPTIONS, JUP_API } from "../constants";
|
||||
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ import { TOKENS, DEFAULT_OPTIONS, JUP_API } from "../constants";
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function trade(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
outputMint: PublicKey,
|
||||
inputAmount: number,
|
||||
inputMint: PublicKey = TOKENS.USDC,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../index";
|
||||
import { SolanaAgentKit } from "../index";
|
||||
import { PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
|
||||
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
|
||||
import {
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function transfer(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
to: PublicKey,
|
||||
amount: number,
|
||||
mint?: PublicKey,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../agent";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import { Transaction, Keypair, TransactionInstruction } from "@solana/web3.js";
|
||||
import { Connection, ComputeBudgetProgram } from "@solana/web3.js";
|
||||
|
||||
@@ -74,7 +74,7 @@ export async function getPriorityFees(connection: Connection): Promise<{
|
||||
* @returns Transaction ID
|
||||
*/
|
||||
export async function sendTx(
|
||||
agent: SolanaAgent,
|
||||
agent: SolanaAgentKit,
|
||||
tx: Transaction,
|
||||
otherKeypairs?: Keypair[],
|
||||
) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgent } from "../src";
|
||||
agent: SolanaAgentKit } from "../src";
|
||||
import { createSolanaTools } from "../src/langchain";
|
||||
import { HumanMessage } from "@langchain/core/messages";
|
||||
import { MemorySaver } from "@langchain/langgraph";
|
||||
|
||||
Reference in New Issue
Block a user