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: add Quai integration #2083

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Conversation

0xalank
Copy link
Contributor

@0xalank 0xalank commented Jan 9, 2025

Based on the code and files provided, I'll fill out the PR template for the Quai plugin integration:

Relates to

Integration of Quai Network functionality into Eliza OS plugins ecosystem

Risks

Low:

  • Only implements basic token transfer functionality
  • Uses established quais library (v1.0.0-alpha.25)
  • Includes input validation for addresses and amounts
  • No direct interaction with smart contracts yet

Background

What does this PR do?

Adds a new Quai Network plugin (@elizaos/plugin-quai) that enables:

  • Native QUAI token transfers
  • Secure transaction signing
  • Network connection management
  • Environment-based configuration
  • Address and transaction validation

What kind of change is this?

Features (non-breaking change which adds functionality):

  • New plugin for Quai Network integration
  • Core transfer functionality
  • Basic configuration and validation utilities

Documentation changes needed?

My changes require a change to the project documentation:

  • Added comprehensive README.md for the plugin
  • Includes installation, configuration, and usage instructions
  • Documents API reference and troubleshooting steps

Testing

Where should a reviewer start?

  1. Review the core plugin structure in index.ts
  2. Check token transfer implementation in actions/transfer.ts
  3. Examine utility functions in utils.ts
  4. Review configuration validation and error handling

Detailed testing steps

  1. Configure environment variables:
QUAI_PRIVATE_KEY=your-quai-private-key
QUAI_RPC_URL=https://rpc.quai.network
  1. Test token transfer:
const result = await eliza.execute({
  action: 'SEND_TOKEN',
  content: {
    recipient: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
    amount: '10'
  }
});
  1. Verify address validation:
  • Test with invalid addresses
  • Test with null token addresses
  • Test with malformed addresses
  1. Check error handling:
  • Test with insufficient balance
  • Test with invalid network connection
  • Test with missing configuration

Deploy Notes

Database changes

None - This plugin doesn't interact with any database

Deployment instructions

  1. Install dependencies:
pnpm install
  1. Build the plugin:
pnpm build
  1. Run tests:
pnpm test
  1. Ensure environment variables are properly configured in deployment environment

This PR sets up the foundation for Quai Network integration, focusing on secure and reliable token transfers while maintaining consistency with Eliza's plugin architecture.

Discord username

alank7528

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @0xalank! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

@odilitime odilitime changed the base branch from main to develop January 10, 2025 00:49
@odilitime odilitime changed the title add Quai integration feat: add Quai integration Jan 10, 2025
@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Jan 10, 2025
wtfsayo
wtfsayo previously approved these changes Jan 11, 2025
@wtfsayo wtfsayo merged commit 7e455cf into elizaOS:develop Jan 11, 2025
3 checks passed
0xpi-ai pushed a commit to 0xpi-ai/NayariAI that referenced this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants