diff --git a/.env.example b/.env.example index 092661c..dba7768 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,3 @@ OPENAI_API_KEY=your_openai_api_key_here RPC_URL=your_rpc_url_here -SOLANA_PRIVATE_KEY=your_solana_private_key_here \ No newline at end of file +SOLANA_PRIVATE_KEY=your_solana_private_key_here diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6b14ea8 --- /dev/null +++ b/CONTRIBUTING.md @@ -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. +- **Linting**: Adhere to the linting rules defined in `.eslintrc`. Ensure all linting 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). + +--- diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..e887a9d --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 SendAI + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 2470fe1..aba1a68 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ A powerful toolkit for interacting with the Solana blockchain, providing easy-to - Deploy new SPL tokens - Transfer SOL and SPL tokens - Check token balances + - Stake SOL - 🖼️ NFT Management - Deploy NFT collections @@ -108,6 +109,30 @@ const signature = await lendAsset( ); ``` +### Stake SOL + +```typescript +import { stakeWithJup } from 'solana-agent-kit'; + +const signature = await stakeWithJup( + agent, + 1 // amount in SOL +); +``` + +### Fetch Token Price + +```typescript +import { fetchPrice } from 'solana-agent-kit'; + +const price = await fetchPrice( + agent, + 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN' // Token mint address +); + +console.log('Price in USDC:', price); +``` + ## API Reference ### Core Functions @@ -140,6 +165,9 @@ Check SOL or token balance for the agent's wallet. Lend idle assets to earn interest with Lulo. +#### `stakeWithJup(agent, amount)` +Stake SOL with Jupiter to earn rewards. + ## Dependencies The toolkit relies on several key Solana and Metaplex libraries: diff --git a/docs/assets/search.js b/docs/assets/search.js index 6172d55..ba76e21 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7WbXW/jthKG/wt9K2TNDzmO77LdE6DonnbRzemNEQSMRHuFlSVVojYnCPLfC+rDGpojh7K2Vy1izjsvyUdDSuS+kjJ/rshm+0q+J1lMNpStA5LJgyIb8jVPZSZv9yrTvyWaBKQuU7IhUSqrSlUf7J+vvulDSoL+V7Ih5C3oVUPKjqpRnlW6rCOdlz6SC7s9kA9IIUuVadfpkJgumYCZMxXpJM98Ew/N5+R9lmmqvMZvcWw6P9+jjONSVdWEvCBkTv68UJlMHmWRPH5XL175nZCJ+dlSDNyW6u9aVfpO1pHSd3UW+40BGjbHR6yKNH+5z78rP+Ds9vMz/5Kn6QTekaA5HvZKf5SpzCLlld1qPifvIcn073f3XkmHtnMy6lJm1U75lTPQeB7j+6TSqvyUH2TiN79OyMw+x34T27ecky1VWXxbVUr7PclW85kM33/56stv23RWP2WdRd++1Ifirs78CwcaNtHHCqyTpZJatS3v8zwdBn1XZ01pqD44bc6u/yxcHdV/MZFg7U8yrcqdjFT1ofvprJS10pwucSNai/fWtd7TSJpClZHKtNyrdzNZTX2TWcNzrL9/FM1QoylPG/kPWfMfb8lF13ykJ47XkaR1mUzI2baembLMX2SqXz7KKqm+5EmmJwzkAg2eaShqp32KDRAyPTkO1admkT+Y8LM+hnb+aEXH6Nszz+VYigUW/l63QXdGTFXJPpO6Lt+B/tQMDLvIBBz+/yaZHpr/fnf/p6qKPKtQT6ON/SfCbGumSy+6MLy7430YM6G0jKWWlxgZQi83AycALo1nyir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shm+/D29g++b5eFQzcAAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7Wb227jNhCG34W+FbLhQU7su2y3AYpu20U37Y0RBIxEe4XIkipRmwZB3r2gDtbQHDmUtb1KYHP+GXI+DSmSfiVl/lyR9eaVPCVZTNaUXQckk3tF1uRrnspM3uxUpn9NNAlIXaZkTaJUVpWqPthfX3zT+5QE/bdkTchb0KuGlB1UozyrdFlHOi99JBd2eyAfkEKWKtNupINjeskE9JypSCd55ut4aD7H77NMU+U1fotD0/n+HmQcl6qqJvgFJnP854XKZPIgi+ThSb14+XdMJvpnl2LgtlT/1KrSt7KOlL6ts9hvDFCzOXHEqkjzl7v8SfkBZ7ef7/mnPE0n8I4YzYlhp/RHmcosUl7ereZz/O6TTP9+e+fldGg7x6MuZVZtlV85A43nMb5LKq3KT/leJn75dUxm9jn2S2zfco63VGXxTVUp7fckW81nMnz35asvv23TWf2UdRZ9+1Lvi9s68y8cqNmcOCotn/yy27ec6G0JZuVSSa3alnd5ng4p3tZZU4iqD06bk6sNFi4P6j8ZS7DSSDKtyq2MVPWh++qklDWvHU+oI1qL92bRPqYRN4UqI5VpuVPverKa+jqzhudQ7f8omqFGXR438h+y5o+35KJrPtITJ9YRp3WZTPDZtp7pssxfZKpfPsoqqb7kSaYnDOQCNZ4ZUNSmfUoYwGS6cxyqT82SYm/MT8YxtPNHKzpY35x4LsdcLDDz97oNujMSVJXsMqnr8h3oj4OBZmcFAYf/tyTTQ/Pfb+/+VFWRZxUa02hj/0SYRdR06UVnhnd3vA9jQSgtY6nlOYEMpucHAxMAJ+ITZRVp5j/o+jnRWqHz2pjuYrDB+4nFPeZepWpXyv00/4PR7ACe1WOVaBTpUf+DzWz3SZboRKafk3/qJE70y9c/Pk8KBbefHVaVJkUhd+pjMYm4hW03O4yiTPIy0S+3alqCbLtzwjh+DLd19rlZHJ+qgWhD/0fxZM0f1/Yo+ngPJpbhExGcLMHTnHc19C986XUqBsvyB4SiyhJ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hpmQpSw0CUstAkLDTMhSljoEtZ91LxFfVelVvEv7dvUZnPYrXglD90r1nCT4ZWEl2T9+vY2vFKtX9/AW5X5zng6nNkPKuxyUGGeKu3reTG8ng9yIZALmZfccEaJhQc6ya4n6sXgYBZIXgHJq4mSeX/SBfQY0PPt8nDpEggBHV+Z4dLooEMHHeqn01w8qZqLJzo/yigFGaCeGeivowCVFVBZTVGxx3oJxmjpJdNCEIELf4Mc6Jpfz1ox3V4+GnQAUX5AdVvx4GEGyRfCS2On9GN/l3AQAuPsN8w7pXVhZzwEuQq9RIatL1AKAIch95LpDgzT/sCwylOoyME4c7+B7rfYVbfFDkYc9FL4ibU30Ir2oMSBgAI2qR+b5gqf7K7wASEBhPxYSOs0l+0mXdxu0pWHAxnQZQ667JfY4doASANglftVql6muYYEAgKICD9Eui3LstmyBLCBmEK/MWvPBUG3QDCctkbCs3tJpocKk201NvocTI3cb6Y1utnWipICFeqn0u62giIKMGB+o358cx0MPBh3P6n2QAJAAEpW6DdhwRuBoF8ggcxTqDuL3yo7VSAk7ldGu6rQlgj04QOJE36Jg5UGWXhwkEful8f+ZE8WVhIFKF3Cbybs71nH3T1rQCh4FKnf89P9KGHb/Chh2/4oYRAEwfmV1e6q4aO5alh0Vw0BJgBZ5sfscPwIxgxMRsKPEXAXAoQDWGOrruz40dtfaHm0528OljXcL5vt2k+aK8xPiVVvALV+0HZ3pQEPYKCo30Q73KECvQJp435pa479v7fH/iBxYHoVfkB1t/tBn8CjR/0eveEnEUAGLtX9cn643gZGBnSI+819R/MwAwrMT6H/DRcIA0QxQeIBeeuDGfKT6i+9gXBA2eAeab4PSJEUKk0yRdab+7e3/wDIrU8JNjgAAA=="; \ No newline at end of file diff --git a/docs/classes/SolanaAgentKit.html b/docs/classes/SolanaAgentKit.html index 5117a69..554183d 100644 --- a/docs/classes/SolanaAgentKit.html +++ b/docs/classes/SolanaAgentKit.html @@ -1,7 +1,7 @@ SolanaAgentKit | solana-agent-kit

Class SolanaAgentKit

Main class for interacting with Solana blockchain Provides a unified interface for token operations, NFT management, and trading

SolanaAgentKit

-

Constructors

Constructors

Properties

connection openai_api_key wallet @@ -15,9 +15,10 @@ Provides a unified interface for token operations, NFT management, and tradingmintNFT registerDomain requestFaucetFunds +stake trade transfer -

Constructors

  • Parameters

    • private_key: string
    • rpc_url: string = "https://api.mainnet-beta.solana.com"
    • openai_api_key: string

    Returns SolanaAgentKit

Properties

connection: Connection

Solana RPC connection

-
openai_api_key: string
wallet: Keypair

Wallet keypair for signing transactions

-
wallet_address: PublicKey

Public key of the wallet

-

Methods

  • Parameters

    • decimals: number = DEFAULT_OPTIONS.TOKEN_DECIMALS

    Returns Promise<{
        mint: PublicKey;
    }>

  • Parameters

    • Optionaltoken_address: PublicKey

    Returns Promise<null | number>

  • Parameters

    • tokenName: string
    • tokenTicker: string
    • description: string
    • imageUrl: string
    • Optionaloptions: PumpFunTokenOptions

    Returns Promise<{
        metadataUri: any;
        mint: string;
        signature: string;
    }>

  • Parameters

    • amount: number

    Returns Promise<string>

  • Parameters

    • collectionMint: PublicKey
    • metadata: {
          creators?: {
              address: string;
              share: number;
          }[];
          name: string;
          sellerFeeBasisPoints?: number;
          symbol: string;
          uri: string;
      }
      • Optionalcreators?: {
            address: string;
            share: number;
        }[]
      • name: string
      • OptionalsellerFeeBasisPoints?: number
      • symbol: string
      • uri: string
    • Optionalrecipient: PublicKey

    Returns Promise<MintCollectionNFTResponse>

  • Parameters

    • name: string
    • OptionalspaceKB: number

    Returns Promise<string>

  • Returns Promise<string>

  • Parameters

    • outputMint: PublicKey
    • inputAmount: number
    • OptionalinputMint: PublicKey
    • slippageBps: number = DEFAULT_OPTIONS.SLIPPAGE_BPS

    Returns Promise<string>

  • Parameters

    • to: PublicKey
    • amount: number
    • Optionalmint: PublicKey

    Returns Promise<string>

+

Constructors

  • Parameters

    • private_key: string
    • rpc_url: string = "https://api.mainnet-beta.solana.com"
    • openai_api_key: string

    Returns SolanaAgentKit

Properties

connection: Connection

Solana RPC connection

+
openai_api_key: string
wallet: Keypair

Wallet keypair for signing transactions

+
wallet_address: PublicKey

Public key of the wallet

+

Methods

  • Parameters

    • decimals: number = DEFAULT_OPTIONS.TOKEN_DECIMALS

    Returns Promise<{
        mint: PublicKey;
    }>

  • Parameters

    • Optionaltoken_address: PublicKey

    Returns Promise<null | number>

  • Parameters

    • tokenName: string
    • tokenTicker: string
    • description: string
    • imageUrl: string
    • Optionaloptions: PumpFunTokenOptions

    Returns Promise<{
        metadataUri: any;
        mint: string;
        signature: string;
    }>

  • Parameters

    • amount: number

    Returns Promise<string>

  • Parameters

    • collectionMint: PublicKey
    • metadata: {
          creators?: {
              address: string;
              share: number;
          }[];
          name: string;
          sellerFeeBasisPoints?: number;
          symbol: string;
          uri: string;
      }
      • Optionalcreators?: {
            address: string;
            share: number;
        }[]
      • name: string
      • OptionalsellerFeeBasisPoints?: number
      • symbol: string
      • uri: string
    • Optionalrecipient: PublicKey

    Returns Promise<MintCollectionNFTResponse>

  • Parameters

    • name: string
    • OptionalspaceKB: number

    Returns Promise<string>

  • Returns Promise<string>

  • Parameters

    • amount: number

    Returns Promise<string>

  • Parameters

    • outputMint: PublicKey
    • inputAmount: number
    • OptionalinputMint: PublicKey
    • slippageBps: number = DEFAULT_OPTIONS.SLIPPAGE_BPS

    Returns Promise<string>

  • Parameters

    • to: PublicKey
    • amount: number
    • Optionalmint: PublicKey

    Returns Promise<string>

diff --git a/docs/functions/createSolanaTools.html b/docs/functions/createSolanaTools.html index d9c0079..371d646 100644 --- a/docs/functions/createSolanaTools.html +++ b/docs/functions/createSolanaTools.html @@ -1 +1 @@ -createSolanaTools | solana-agent-kit

Function createSolanaTools

  • Parameters

    Returns (
        | SolanaBalanceTool
        | SolanaTransferTool
        | SolanaDeployTokenTool
        | SolanaDeployCollectionTool
        | SolanaMintNFTTool
        | SolanaTradeTool
        | SolanaRequestFundsTool
        | SolanaRegisterDomainTool
        | SolanaGetWalletAddressTool
        | SolanaPumpfunTokenLaunchTool
        | SolanaCreateImageTool
        | SolanaLendAssetTool
        | SolanaTPSCalculatorTool)[]

+createSolanaTools | solana-agent-kit

Function createSolanaTools

  • Parameters

    Returns (
        | SolanaBalanceTool
        | SolanaTransferTool
        | SolanaDeployTokenTool
        | SolanaDeployCollectionTool
        | SolanaMintNFTTool
        | SolanaTradeTool
        | SolanaRequestFundsTool
        | SolanaRegisterDomainTool
        | SolanaGetWalletAddressTool
        | SolanaPumpfunTokenLaunchTool
        | SolanaCreateImageTool
        | SolanaLendAssetTool
        | SolanaTPSCalculatorTool
        | SolanaStakeTool)[]

diff --git a/docs/index.html b/docs/index.html index e4b3a2c..d3bb75a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,6 +6,7 @@
  • Deploy new SPL tokens
  • Transfer SOL and SPL tokens
  • Check token balances
  • +
  • Stake SOL
  • @@ -56,6 +57,9 @@
    import { lendAsset } from 'solana-agent-kit';
    import { PublicKey } from '@solana/web3.js';

    const signature = await lendAsset(
    agent,
    100, // amount
    );
    +
    import { stakeWithJup } from 'solana-agent-kit';

    const signature = await stakeWithJup(
    agent,
    1 // amount in SOL
    ); +
    +

    Deploy a new SPL token with optional initial supply.

    Create a new NFT collection with customizable metadata and royalties.

    Mint a new NFT as part of an existing collection.

    @@ -63,6 +67,7 @@

    Swap tokens using Jupiter Exchange integration.

    Check SOL or token balance for the agent's wallet.

    Lend idle assets to earn interest with Lulo.

    +

    Stake SOL with Jupiter to earn rewards.

    The toolkit relies on several key Solana and Metaplex libraries: