Skip to content

Conversation

@abretonc7s
Copy link

@abretonc7s abretonc7s commented Apr 28, 2025

Description

Purpose and Impact

This PR improves CAIP-294 wallet announcement logic to support mobile builds, ensuring announcements only occur for 'flask' mobile builds.

Key Implementation Details

  • Updated getBuildType in src/extension-provider/createExternalExtensionProvider.ts to map mobile rdns:
    • io.metamask.mobilestable
    • io.metamask.mobile.betabeta
    • io.metamask.mobile.flaskflask
  • Modified announceCaip294WalletData to skip announcements for non-flask mobile builds and include CAIP-348 targets for flask mobile builds.
  • Added tests in src/extension-provider/createExternalExtensionProvider.test.ts and src/initializeInpageProvider.test.ts to verify build type detection and announcement logic.

Breaking Changes

None. Changes are backward compatible.

- Added tests to ensure wallet is not announced for mobile builds unless the build type is 'flask'.
- Updated `getBuildType` function to recognize mobile build types and return appropriate values.
- Enhanced `announceCaip294WalletData` to handle mobile flask builds with CAIP-348 targets.
@abretonc7s abretonc7s requested a review from a team April 28, 2025 08:45
@abretonc7s abretonc7s changed the title feat: Enhance wallet announcement logic for mobile builds in CAIP-294 feat: Enhance CAIP-294 wallet announcement for mobile flask builds Apr 28, 2025
});

it('should announce wallet with caip-348 target for mobile flask', async () => {
const extensionId = 'test-extension-id';
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. mobile won't have an extension id, so a caip-348 target won't be announced.

@adonesky1
Copy link
Contributor

Superceded by: #419

@adonesky1 adonesky1 closed this Apr 28, 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.

5 participants