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

Fix embedded wallets #107

Closed
wants to merge 0 commits into from
Closed

Conversation

0xNoushad
Copy link

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

  • [✅] 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

@thearyanag
Copy link
Member

hey @0xNoushad - can you pls rebase the branch

@0xNoushad 0xNoushad force-pushed the fix-embedded-wallets branch from 00fddff to b1b6cbb Compare January 2, 2025 21:56
@0xNoushad 0xNoushad closed this Jan 2, 2025
@0xNoushad 0xNoushad force-pushed the fix-embedded-wallets branch from b1b6cbb to bfa7872 Compare January 2, 2025 22:05
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.

Embedded Wallets
2 participants