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 Defly Web extension wallet provider #256

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

drichar
Copy link
Collaborator

@drichar drichar commented Sep 9, 2024

Description

This PR introduces support for the Defly Web (browser extension) wallet and refactors the existing Kibisis wallet implementation. It creates a new extendable AVMProvider class, which serves as a base for AVM Web Provider based wallets, improving code reusability and maintainability.

Details

  • Created new AVMProvider abstract class for common AVM Web Provider functionality
  • Refactored KibisisWallet to extend AVMProvider
  • Implemented DeflyWebWallet class extending AVMProvider
  • Added DEFLY_WEB to WalletId enum
  • Updated utility functions to support new wallet implementations
  • Implemented Defly-specific methods for enable, disable, and sign transactions

This refactors the Kibisis wallet client to use an extendable `AVMProvider` class, laying the groundwork for future wallet implementations that also use `@agoralabs-sh/avm-web-provider`.

- Created new `AVMProvider` abstract class
- Refactored `KibisisWallet` to extend `AVMProvider`
- Moved common AVM Web Provider functionality to `AVMProvider`
- Implemented abstract methods in `KibisisWallet` for Kibisis-specific behavior
- Created new `DeflyWebWallet` class extending `AVMProvider`
- Implemented Defly-specific methods for enable, disable, and sign transactions
- Added `DEFLY_WEB` to `WalletId` enum and `WalletMap`
- Updated utility functions to include Defly Web Wallet
@drichar drichar changed the title feat: add Defly Web support and refactor AVM-based wallets feat: add Defly Web extension wallet provider Sep 9, 2024
This addresses an issue where certain frameworks are unable to dynamically import `@agoralabs-sh/avm-web-provider` due to module format incompatibilities.

- Modified `_initializeAVMWebProviderSDK` method to handle both default and named exports
- Ensured compatibility between CommonJS (AVM Web Provider) and ESM (use-wallet)
@drichar drichar marked this pull request as ready for review October 24, 2024 16:39
Copy link
Contributor

@kieranroneill kieranroneill left a comment

Choose a reason for hiding this comment

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

Looks good from my end 👍

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.

2 participants