Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Defly Web extension wallet provider (#317)
* refactor(wallets): create extendable AVMProvider for Kibisis client 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 * feat: add Defly Web Wallet initial support - 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 * fix(avm): resolve dynamic import issues with AVM Web Provider 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) * chore: restore comments and JSDoc blocks * docs(avm): update comments for abstract and common methods * chore: fix import order * test(kibisis): fix failing test * fix(defly-web): use correct provider ID in constructor * feat(examples): add Defly Web provider * test(defly-web): add tests for Defly Web provider * refactor(provider): extract shared AVM provider functionality Extract common AVM Web Provider functionality into abstract base class to support both Kibisis and Defly Web providers. Update implementations to use `algosdk` v3 and new network configuration system. - Create abstract `AVMProvider` class with shared provider logic - Move common methods from Kibisis to `AVMProvider` - Update transaction handling for `algosdk` v3 API - Add network configuration and genesis hash fallback - Implement Defly Web provider using shared base class * refactor(tests): remove ts-nocheck from AVM wallet provider tests Enable proper TypeScript type checking in AVM provider tests by introducing type-safe utility types for testing protected methods. - Remove `@ts-nocheck` comments from Defly Web and Kibisis tests - Add `TestableDeflyWebWallet` and `TestableKibisisWallet` utility types - Update `vi.spyOn` calls to use proper type assertions - Remove unnecessary type assertions from mock implementations - Add proper return type to `mockSignTransactionsResponseOnce`
- Loading branch information