Skip to content

feat: add 1CA to embedded wallets #4575

Merged
svenvoskamp merged 47 commits intomainfrom
APKT-3099
Jun 30, 2025
Merged

feat: add 1CA to embedded wallets #4575
svenvoskamp merged 47 commits intomainfrom
APKT-3099

Conversation

@svenvoskamp
Copy link
Copy Markdown
Contributor

@svenvoskamp svenvoskamp commented Jun 27, 2025

Description

This PR adds 1CA flow to the embedded wallet. Instead of directly calling the w3mFrameProvider, we now call a new introduced method in the SIWXUtil called authConnectorAuthenticate. This method will check if SIWX is enabled and will then add the SIWXMessage to the w3mFrameProvider connect method.

It will also handle the signature that we get back from the w3mFrameProvider and will add the session accordingly.

More changes:

  • Test changes
  • Call SIWXUtil method in clients
  • Handle a case where onSocialConnected is triggering before we've added the session to SIWX

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

svenvoskamp added 30 commits May 6, 2025 09:33
cursor[bot]

This comment was marked as outdated.

@svenvoskamp svenvoskamp requested a review from a team June 27, 2025 14:47
cursor[bot]

This comment was marked as outdated.

Co-authored-by: Enes <enesozturk.d@gmail.com>
Copy link
Copy Markdown
Contributor

@enesozturk enesozturk left a comment

Choose a reason for hiding this comment

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

Left non blocking comments

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Invalid `chainId` Fallback Causes SIWX Errors

The chainId for siwx.createMessage() falls back to an empty string '' when ChainController.getActiveCaipNetwork()?.caipNetworkId is undefined. This empty string is an invalid CaipNetworkId (e.g., 'eip155:1') and is incorrectly type-cast, leading to potential errors or unexpected behavior during SIWX message creation and processing. The function should instead throw an error or return early if the active CAIP network is unavailable.

packages/controllers/src/utils/SIWXUtil.ts#L250-L251

const siwxMessage = await siwx.createMessage({
chainId: ChainController.getActiveCaipNetwork()?.caipNetworkId || ('' as CaipNetworkId),

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@svenvoskamp svenvoskamp added this pull request to the merge queue Jun 30, 2025
@svenvoskamp svenvoskamp changed the title [DO NOT MERGE] feat: add 1CA to embedded wallets feat: add 1CA to embedded wallets Jun 30, 2025
Merged via the queue into main with commit 3eae9b3 Jun 30, 2025
41 checks passed
@svenvoskamp svenvoskamp deleted the APKT-3099 branch June 30, 2025 08:18
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.

3 participants