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 new plugin hive #2390

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Draft

Conversation

gluneau
Copy link

@gluneau gluneau commented Jan 16, 2025

Relates to

Hive Blockchain Plugin Development - Wallet Provider Implementation

Risks

Low - Changes are confined to internal type handling and calculations in the wallet provider. No changes to core functionality or external APIs.

Background

What does this PR do?

  • Fixes type safety issues with dhive Asset handling in the wallet provider
  • Implements proper handling of Hive blockchain balance responses
  • Adds accurate calculations for effective HIVE Power including delegated stakes
  • Improves error handling and initialization checks

What kind of change is this?

Bug fixes:

  • Resolves type compatibility issues between dhive's Asset type and provider interface
  • Fixes unused delegated and received VESTS calculations
  • Corrects effective HIVE Power calculations

Improvements:

  • Enhanced type safety with proper interfaces
  • Better error messaging
  • More accurate wallet value calculations

Documentation changes needed?

My changes do not require a change to the project documentation as they are internal improvements to existing functionality.

Testing

Where should a reviewer start?

  1. Review the HiveAccount interface definition
  2. Check the normalizeAsset helper method
  3. Examine the effective HIVE Power calculations in getState

Detailed testing steps

  1. Test wallet provider initialization:

    • Verify proper handling of missing configuration
    • Check initialization with valid config
  2. Test balance retrieval:

    • Verify correct handling of different Asset formats
    • Check VESTS calculations including delegations
    • Validate price feed integration
  3. Test error cases:

    • Account not found
    • Invalid configuration
    • Network errors
  4. Verify calculations:

    • Confirm effective HIVE Power = owned VESTS - delegated + received
    • Validate HBD price conversions
    • Check total value calculations

Deploy Notes

No database changes or special deployment steps required. Standard deployment process applies.

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 @gluneau! Welcome to the elizaOS community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now an elizaOS contributor!

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.

1 participant