Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Related Issue
Fixes #55
Changes Made
PR addresses the need for managing embedded wallets more efficiently by introducing a WalletManager and SolanaAgentKit class with improved methods to handle wallet creation, connection, and interaction. Key changes include:
Addition of a WalletManager singleton for centralized wallet management.
Implementation of KeypairWallet to support private key-based wallet signing.
Integration of SolanaAgentKit for agent-level wallet handling, supporting both keypair and wallet ID-based configurations.
Implementation Details
i have used singleton pattern that Ensures a single instance managing all wallets.
Wallet Registration: Enables adding wallets using private keys, keypairs, or WalletAdapter objects.
Utility Functions: Provides methods to check connection, retrieve wallets, disconnect wallets, and generate new keypairs.
SolanaAgentKit
Wallet Initialization: Accepts a private key or wallet ID to initialize the wallet, linking it to the provided RPC URL.
Configuration: Flexible support for either a Config object or a direct OpenAI API key.
Keypair Management: Enables retrieval and logging of keypair details if used.
Transaction executed by agent
Example transaction:
Prompt Used
Additional Notes
Deprecates the direct use of OpenAI API keys in constructors to encourage better configuration .
Checklist