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

Embedded Wallet Interface #121

Closed
wants to merge 0 commits into from
Closed

Embedded Wallet Interface #121

wants to merge 0 commits into from

Conversation

0xNoushad
Copy link

Pull Request Description

Related Issue

Fixes sendaifun#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

@0xNoushad
Copy link
Author

Hey @thearyanag I deleted the old file due to errors and replaced it with a simpler version.

@thearyanag thearyanag changed the title new Embedded Wallet Interface Jan 3, 2025
@0xNoushad 0xNoushad closed this Jan 5, 2025
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
1 participant