Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate Solana GPT Wallet into examples #219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pegasus1134
Copy link

Related Issue

Fixes #126 (Example Request: Solana GPT Wallet).

Changes Made

This PR adds the following changes:

  • Added the Solana GPT Wallet to examples/solana-gpt-wallet/.
  • Integrated an AI-powered interface for interacting with Solana wallets.

Implemented the following features:

  • Token Swaps: Enabled via Jupiter API (Devnet) - Currently not fully functional.
  • Token Sends: Supports native SOL and SPL token transfers.
  • Transaction History: Tracks and displays recent transactions.
  • Automated Test SOL Airdrops: One-click 2 SOL airdrop for testing purposes.

Implementation Details

  • Built with Next.js, React, and TypeScript for a modern and scalable interface.
  • Blockchain interactions are powered by @solana/web3.js and @solana/spl-token:
  • Swaps: Uses the Jupiter API for token exchange.
  • Transfers: Implements SystemProgram.transfer for SOL and SPL token transactions.
  • Integrated OpenAI GPT-4o-mini for natural language processing.
  • Used Zustand for real-time state management.

Transaction Executed by Agent

Example transaction:

  • Type: Token transfer (SOL).
  • Transaction ID: View Transaction on Solscan.
  • From: HTBCtG3qRnsQeH2phvsmHnYMZcXgCgB3GE3WUDEJX8c.
  • To: B2pCag7JEgoaXuZ1WUCzfWrD9LhYQm3sN58ao1BzCETb.

Prompt Used

Transfer 3 SOL to wallet address B2pCag7JEgoaXuZ1WUCzfWrD9LhYQm3sN58ao1BzCETb

Additional Notes

Limitations:

  • Swap functionality depends on the Jupiter API, which has limited support on Devnet.
  • Currently supports GPT-4o-mini; future updates could integrate other AI models.

All features were tested locally on Solana Devnet.

Checklist

  • [ ✅ ] I have tested these changes locally
  • [ ✅ ] I have updated the documentation
  • [ ✅ ] I have added a transaction link
  • [ ✅ ] I have added the prompt used to test it

@pegasus1134
Copy link
Author

Project deployed at https://solana-gpt-wallet.vercel.app for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example Request: Solana GPT Wallet
1 participant