mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-14 07:26:46 +00:00
fix
This commit is contained in:
@@ -53,7 +53,7 @@ export class CustomTool extends Tool {
|
||||
### 3. Add Supporting Functions to SolanaAgentKit
|
||||
|
||||
```typescript:src/agent/index.ts
|
||||
export class SolanaAgent {
|
||||
export class SolanaAgentKit {
|
||||
// ... existing code ...
|
||||
|
||||
async customFunction(input: string): Promise<string> {
|
||||
|
||||
@@ -3,7 +3,7 @@ import OpenAI from "openai";
|
||||
|
||||
/**
|
||||
* Generate an image using OpenAI's DALL-E
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param prompt Text description of the image to generate
|
||||
* @param size Image size ('256x256', '512x512', or '1024x1024') (default: '1024x1024')
|
||||
* @param n Number of images to generate (default: 1)
|
||||
|
||||
@@ -99,7 +99,7 @@ export const FEE_TIERS = {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* agent: SolanaAgentKitKit } from "your-sdk";
|
||||
* import { SolanaAgentKit } from "your-sdk";
|
||||
* import { PublicKey } from "@solana/web3.js";
|
||||
* import { BN } from "@coral-xyz/anchor";
|
||||
* import Decimal from "decimal.js";
|
||||
|
||||
@@ -18,7 +18,7 @@ import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
|
||||
|
||||
/**
|
||||
* Deploy a new NFT collection
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param options Collection options including name, URI, royalties, and creators
|
||||
* @returns Object containing collection address and metadata
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
|
||||
/**
|
||||
* Deploy a new SPL token
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param name Name of the token
|
||||
* @param uri URI for the token metadata
|
||||
* @param symbol Symbol of the token
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Get the balance of SOL or an SPL token for the agent's wallet
|
||||
* @param agent - SolanaAgent instance
|
||||
* @param agent - SolanaAgentKit instance
|
||||
* @param token_address - Optional SPL token mint address. If not provided, returns SOL balance
|
||||
* @returns Promise resolving to the balance as a number (in UI units) or null if account doesn't exist
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import { SolanaAgentKit } from "../index";
|
||||
* a specified Solana public key. If the primary domain is stale or an error occurs during
|
||||
* the resolution, it throws an error.
|
||||
*
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param account The Solana public key for which to retrieve the primary domain
|
||||
* @returns A promise that resolves to the primary .sol domain as a string
|
||||
* @throws Error if the domain is stale or if the domain resolution fails
|
||||
|
||||
@@ -140,7 +140,7 @@ async function signAndSendTransaction(
|
||||
|
||||
/**
|
||||
* Launch a token on Pump.fun
|
||||
* @param agent - SolanaAgent instance
|
||||
* @param agent - SolanaAgentKit instance
|
||||
* @param tokenName - Name of the token
|
||||
* @param tokenTicker - Ticker of the token
|
||||
* @param description - Description of the token
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Lend tokens for yields using Lulo
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param amount Amount of USDC to lend
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ import { MintCollectionNFTResponse } from "../types";
|
||||
|
||||
/**
|
||||
* Mint a new NFT as part of an existing collection
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param collectionMint Address of the collection's master NFT
|
||||
* @param metadata NFT metadata object
|
||||
* @param recipient Optional recipient address (defaults to wallet address)
|
||||
|
||||
@@ -6,7 +6,7 @@ import { TOKENS } from "../constants";
|
||||
|
||||
/**
|
||||
* Register a .sol domain name using Bonfida Name Service
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param name Domain name to register (without .sol)
|
||||
* @param spaceKB Space allocation in KB (max 10KB)
|
||||
* @returns Transaction signature
|
||||
|
||||
@@ -3,7 +3,7 @@ import { LAMPORTS_PER_SOL } from "@solana/web3.js";
|
||||
|
||||
/**
|
||||
* Request SOL from the Solana faucet (devnet/testnet only)
|
||||
* @param agent - SolanaAgent instance
|
||||
* @param agent - SolanaAgentKit instance
|
||||
* @returns Transaction signature
|
||||
* @throws Error if the request fails or times out
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import { SolanaAgentKit } from "../index";
|
||||
* to the corresponding Solana PublicKey. The domain can be provided with or without
|
||||
* the .sol suffix.
|
||||
*
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param domain The .sol domain to resolve. This can be provided with or without the .sol TLD suffix
|
||||
* @returns A promise that resolves to the corresponding Solana PublicKey
|
||||
* @throws Error if the domain resolution fails
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SolanaAgentKit } from "../index";
|
||||
|
||||
/**
|
||||
* Stake SOL with Jup validator
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param amount Amount of SOL to stake
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import { TOKENS, DEFAULT_OPTIONS, JUP_API } from "../constants";
|
||||
|
||||
/**
|
||||
* Swap tokens using Jupiter Exchange
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param outputMint Target token mint address
|
||||
* @param inputAmount Amount to swap (in token decimals)
|
||||
* @param inputMint Source token mint address (defaults to USDC)
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
|
||||
/**
|
||||
* Transfer SOL or SPL tokens to a recipient
|
||||
* @param agent SolanaAgent instance
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param to Recipient's public key
|
||||
* @param amount Amount to transfer
|
||||
* @param mint Optional mint address for SPL tokens
|
||||
|
||||
@@ -69,7 +69,7 @@ export async function getPriorityFees(connection: Connection): Promise<{
|
||||
|
||||
/**
|
||||
* Send a transaction with priority fees
|
||||
* @param agent - SolanaAgent instance
|
||||
* @param agent - SolanaAgentKit instance
|
||||
* @param tx - Transaction to send
|
||||
* @returns Transaction ID
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user