Skip to content

feat: adds webauthn session key support #1563

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

Merged
merged 117 commits into from
Jun 24, 2025
Merged

feat: adds webauthn session key support #1563

merged 117 commits into from
Jun 24, 2025

Conversation

linnall
Copy link
Collaborator

@linnall linnall commented Apr 24, 2025

Pull Request Checklist


PR-Codex overview

This PR introduces the NotAModularAccountV2Error class and updates various components to support modular account functionalities. It enhances error handling and modifies type definitions for better clarity and usability within the account validation process.

Detailed summary

  • Added NotAModularAccountV2Error class in aa-sdk/core/src/errors/account.ts.
  • Updated exports in aa-sdk/core/src/index.ts to include NotAModularAccountV2Error.
  • Created documentation for NotAModularAccountV2Error in docs/pages/reference/aa-sdk/core/classes/NotAModularAccountV2Error/constructor.mdx.
  • Modified type definitions in examples/ui-demo/src/hooks/useModularAccountV2Client.ts to use ModularAccountV2.
  • Enhanced validation actions in account-kit/smart-contracts/src/ma-v2/actions/install-validation/installValidation.ts to throw NotAModularAccountV2Error when applicable.
  • Added a new function isModularAccountV2 to check account type in account-kit/smart-contracts/src/ma-v2/account/common/modularAccountV2Base.ts.
  • Updated tests in account-kit/smart-contracts/src/ma-v2/client/client.test.ts to cover new validation scenarios involving WebAuthn.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 6:55pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 6:55pm

Copy link

graphite-app bot commented Apr 24, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

github-actions bot commented Apr 24, 2025

🌿 Documentation Preview

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Jun 24, 2025, 6:50 PM

@github-actions github-actions bot temporarily deployed to docs-preview April 24, 2025 22:19 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview April 29, 2025 19:10 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview April 29, 2025 21:24 Inactive
@github-actions github-actions bot had a problem deploying to docs-preview May 9, 2025 21:43 Failure
@github-actions github-actions bot temporarily deployed to docs-preview May 11, 2025 02:41 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview May 12, 2025 20:11 Inactive
@linnall linnall force-pushed the linna/webauth-tests branch from 36cd477 to 7549458 Compare May 12, 2025 20:21
@github-actions github-actions bot temporarily deployed to docs-preview May 12, 2025 20:21 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview May 12, 2025 20:28 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview May 13, 2025 00:03 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview June 18, 2025 19:56 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview June 18, 2025 19:58 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview June 19, 2025 12:54 Inactive
howydev
howydev previously approved these changes Jun 19, 2025
Copy link
Collaborator

@howydev howydev left a comment

Choose a reason for hiding this comment

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

some nits otherwise LGTM!

@github-actions github-actions bot temporarily deployed to docs-preview June 24, 2025 18:30 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview June 24, 2025 18:30 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview June 24, 2025 18:31 Inactive
@github-actions github-actions bot temporarily deployed to docs-preview June 24, 2025 18:49 Inactive
@linnall linnall requested review from moldy530 and howydev June 24, 2025 18:50
@linnall linnall merged commit 326d660 into main Jun 24, 2025
11 checks passed
@linnall linnall deleted the linna/webauth-tests branch June 24, 2025 20:16
moldy530 added a commit that referenced this pull request Jun 26, 2025
* chore: adds wip of webauthn client tests

* chore: updates webauthn test to use mocked window.credentials.get response

* chore: adds credential and mock response from self generated credential on try-webauthn.appspot.com

* fix: rename webAuthnCredentials to webAuthnAccountParams

* chore: adds to do

* feat: add ability to create a webauthn ModularAccountV2 without a signer

* chore: removes unused code

* fix: ensures presence of signer is explicit

* fix: refactor to not destructure

* feat: adds account functions for webauthn

* feat: add webauthn gas estimator

* chore: fix lint, change to use type narrowing instead

* feat: add webauthn signer

* chore: update dummy sig

* feat: modifies mav2 smart account client and mav2 client tests to work together

* fix: add documenting comment for webauthn gas estimator usage

* fix: adds documentation comment for webauthnGasEstimator usage

* chore: wip deploy webauthn account then sign message

* fix: prepend signatures with 0xff

* fix: prepend signature regardless of deferred actions data presence

* chore: wip debugging

* fix: debug

* chore: adds updated mock authenticator response

* fix: prefixes signature with offset

* chore: update credentials and mocked authenticator response

* chore: updates credentials and authenticator response

* chore: fix merge issues with main

* test: update tests using mock webauthn device (#1639)

* chore: wip format message to be EIP-712 and add lint fixes

* fix: inline documentation

Co-authored-by: Michael Moldoveanu <[email protected]>

* chore: removes debugging statements and linting fixes

* chore: rename types

* fix: refactor

* chore: remove debug statement

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: update return type

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: adds strongly typed errors

* chore: removes debug statements

* fix: fixes example in docs

* chore: add todo comment, removes debug statement

* chore: remove lint warnings

* refactor: encode sign parameters as a struct

* feat: enables installValidation to take a Modular Account with no signer (#1663)

* fix: run api spec generate as part of aa-sdk deploy (#1654)

* fix: run api spec generate as part of aa-sdk deploy

* ci: create aa-sdk copy of setup-pnpm composite action

* ci: remove unnecessary install node in pnpm composite action

* ci: try installing pnpm with exact action version

* ci: test with pnpm moved out of its own composite

* ci: fuck you install pnpm

* ci: ??????

* revert: install pnpm in its own setup composite

* ci: specify package.json for pnpm

---------

Co-authored-by: dslovinsky <[email protected]>

* feat(rn-signer): support passkeys in React Native (#1653)

* chore(release): publish v4.37.0 [skip-ci]

* feat: add erc20 sponsorship card (#1631)

* fix: remove trailing slash from alchemy rpc url (#1657)

* chore(release): publish v4.38.0 [skip-ci]

* fix: update copy (#1658)

* feat: add alchemy_requestPaymasterTokenQuote to aa-sdk (#1659)

* feat: add alchemy_requestPaymasterTokenQuote to aa-sdk

* fix: typo

* chore(release): publish v4.39.0 [skip-ci]

* feat: enables installValidation to take a Modular Account with no signer

* fix: test thank you howy

* test: update the rundler version we use in prool (#1646)

* chore: experimenting with types (#1665)

* chore: modifies types

---------

Co-authored-by: Daniel Slovinsky <[email protected]>
Co-authored-by: dslovinsky <[email protected]>
Co-authored-by: David Philipson <[email protected]>
Co-authored-by: Alchemy Bot <[email protected]>
Co-authored-by: Blake Duncan <[email protected]>
Co-authored-by: jakehobbs <[email protected]>
Co-authored-by: Andy <[email protected]>
Co-authored-by: Michael Moldoveanu <[email protected]>
Co-authored-by: howy <[email protected]>

* chore: lint

* feat: export WebAuthnValidationModule

* fix: typing for install validation decorator

* fix: typing on creation of clients to support alchemy configs

* fix: updates tests to retry transaction, updates hook with new InstallValidation params

* chore: removes unused import

* fix: uses session key provider

* fix: narrow account type to a modular account v2

* chore: adds wip of webauthn client tests

* chore: updates webauthn test to use mocked window.credentials.get response

* chore: adds credential and mock response from self generated credential on try-webauthn.appspot.com

* fix: rename webAuthnCredentials to webAuthnAccountParams

* chore: adds to do

* feat: add ability to create a webauthn ModularAccountV2 without a signer

* chore: removes unused code

* fix: ensures presence of signer is explicit

* fix: refactor to not destructure

* feat: adds account functions for webauthn

* feat: add webauthn gas estimator

* chore: fix lint, change to use type narrowing instead

* feat: add webauthn signer

* chore: update dummy sig

* feat: modifies mav2 smart account client and mav2 client tests to work together

* fix: add documenting comment for webauthn gas estimator usage

* fix: adds documentation comment for webauthnGasEstimator usage

* chore: wip deploy webauthn account then sign message

* fix: prepend signatures with 0xff

* fix: prepend signature regardless of deferred actions data presence

* chore: wip debugging

* fix: debug

* chore: adds updated mock authenticator response

* fix: prefixes signature with offset

* chore: update credentials and mocked authenticator response

* chore: updates credentials and authenticator response

* chore: fix merge issues with main

* test: update tests using mock webauthn device (#1639)

* chore: wip format message to be EIP-712 and add lint fixes

* fix: inline documentation

Co-authored-by: Michael Moldoveanu <[email protected]>

* chore: removes debugging statements and linting fixes

* chore: rename types

* fix: refactor

* chore: remove debug statement

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: update return type

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: adds strongly typed errors

* chore: removes debug statements

* fix: fixes example in docs

* chore: add todo comment, removes debug statement

* chore: remove lint warnings

* refactor: encode sign parameters as a struct

* feat: export WebAuthnValidationModule

* fix: typing on creation of clients to support alchemy configs

* fix: cleans up tests

* chore: removes unused import

* fix: webauthn session key test

* fix: removes duplicate identifier

* fix: remove unnecessary arg

* chore: removes to do comment

* chore: removes unnecessary account type check

* chore: updates yarn.lock and docs.yml

* fix: add back necessary account type checks

* fix: restore yarn.lock file

* fix: adds more granular errors

* chore: updates error docs

* fix: refactor

---------

Co-authored-by: howydev <[email protected]>
Co-authored-by: Michael Moldoveanu <[email protected]>
Co-authored-by: Daniel Slovinsky <[email protected]>
Co-authored-by: dslovinsky <[email protected]>
Co-authored-by: David Philipson <[email protected]>
Co-authored-by: Alchemy Bot <[email protected]>
Co-authored-by: Blake Duncan <[email protected]>
Co-authored-by: jakehobbs <[email protected]>
Co-authored-by: Andy <[email protected]>
moldy530 added a commit that referenced this pull request Jun 26, 2025
* chore: adds wip of webauthn client tests

* chore: updates webauthn test to use mocked window.credentials.get response

* chore: adds credential and mock response from self generated credential on try-webauthn.appspot.com

* fix: rename webAuthnCredentials to webAuthnAccountParams

* chore: adds to do

* feat: add ability to create a webauthn ModularAccountV2 without a signer

* chore: removes unused code

* fix: ensures presence of signer is explicit

* fix: refactor to not destructure

* feat: adds account functions for webauthn

* feat: add webauthn gas estimator

* chore: fix lint, change to use type narrowing instead

* feat: add webauthn signer

* chore: update dummy sig

* feat: modifies mav2 smart account client and mav2 client tests to work together

* fix: add documenting comment for webauthn gas estimator usage

* fix: adds documentation comment for webauthnGasEstimator usage

* chore: wip deploy webauthn account then sign message

* fix: prepend signatures with 0xff

* fix: prepend signature regardless of deferred actions data presence

* chore: wip debugging

* fix: debug

* chore: adds updated mock authenticator response

* fix: prefixes signature with offset

* chore: update credentials and mocked authenticator response

* chore: updates credentials and authenticator response

* chore: fix merge issues with main

* test: update tests using mock webauthn device (#1639)

* chore: wip format message to be EIP-712 and add lint fixes

* fix: inline documentation

Co-authored-by: Michael Moldoveanu <[email protected]>

* chore: removes debugging statements and linting fixes

* chore: rename types

* fix: refactor

* chore: remove debug statement

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: update return type

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: adds strongly typed errors

* chore: removes debug statements

* fix: fixes example in docs

* chore: add todo comment, removes debug statement

* chore: remove lint warnings

* refactor: encode sign parameters as a struct

* feat: enables installValidation to take a Modular Account with no signer (#1663)

* fix: run api spec generate as part of aa-sdk deploy (#1654)

* fix: run api spec generate as part of aa-sdk deploy

* ci: create aa-sdk copy of setup-pnpm composite action

* ci: remove unnecessary install node in pnpm composite action

* ci: try installing pnpm with exact action version

* ci: test with pnpm moved out of its own composite

* ci: fuck you install pnpm

* ci: ??????

* revert: install pnpm in its own setup composite

* ci: specify package.json for pnpm

---------

Co-authored-by: dslovinsky <[email protected]>

* feat(rn-signer): support passkeys in React Native (#1653)

* chore(release): publish v4.37.0 [skip-ci]

* feat: add erc20 sponsorship card (#1631)

* fix: remove trailing slash from alchemy rpc url (#1657)

* chore(release): publish v4.38.0 [skip-ci]

* fix: update copy (#1658)

* feat: add alchemy_requestPaymasterTokenQuote to aa-sdk (#1659)

* feat: add alchemy_requestPaymasterTokenQuote to aa-sdk

* fix: typo

* chore(release): publish v4.39.0 [skip-ci]

* feat: enables installValidation to take a Modular Account with no signer

* fix: test thank you howy

* test: update the rundler version we use in prool (#1646)

* chore: experimenting with types (#1665)

* chore: modifies types

---------

Co-authored-by: Daniel Slovinsky <[email protected]>
Co-authored-by: dslovinsky <[email protected]>
Co-authored-by: David Philipson <[email protected]>
Co-authored-by: Alchemy Bot <[email protected]>
Co-authored-by: Blake Duncan <[email protected]>
Co-authored-by: jakehobbs <[email protected]>
Co-authored-by: Andy <[email protected]>
Co-authored-by: Michael Moldoveanu <[email protected]>
Co-authored-by: howy <[email protected]>

* chore: lint

* feat: export WebAuthnValidationModule

* fix: typing for install validation decorator

* fix: typing on creation of clients to support alchemy configs

* fix: updates tests to retry transaction, updates hook with new InstallValidation params

* chore: removes unused import

* fix: uses session key provider

* fix: narrow account type to a modular account v2

* chore: adds wip of webauthn client tests

* chore: updates webauthn test to use mocked window.credentials.get response

* chore: adds credential and mock response from self generated credential on try-webauthn.appspot.com

* fix: rename webAuthnCredentials to webAuthnAccountParams

* chore: adds to do

* feat: add ability to create a webauthn ModularAccountV2 without a signer

* chore: removes unused code

* fix: ensures presence of signer is explicit

* fix: refactor to not destructure

* feat: adds account functions for webauthn

* feat: add webauthn gas estimator

* chore: fix lint, change to use type narrowing instead

* feat: add webauthn signer

* chore: update dummy sig

* feat: modifies mav2 smart account client and mav2 client tests to work together

* fix: add documenting comment for webauthn gas estimator usage

* fix: adds documentation comment for webauthnGasEstimator usage

* chore: wip deploy webauthn account then sign message

* fix: prepend signatures with 0xff

* fix: prepend signature regardless of deferred actions data presence

* chore: wip debugging

* fix: debug

* chore: adds updated mock authenticator response

* fix: prefixes signature with offset

* chore: update credentials and mocked authenticator response

* chore: updates credentials and authenticator response

* chore: fix merge issues with main

* test: update tests using mock webauthn device (#1639)

* chore: wip format message to be EIP-712 and add lint fixes

* fix: inline documentation

Co-authored-by: Michael Moldoveanu <[email protected]>

* chore: removes debugging statements and linting fixes

* chore: rename types

* fix: refactor

* chore: remove debug statement

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: update return type

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: adds strongly typed errors

* chore: removes debug statements

* fix: fixes example in docs

* chore: add todo comment, removes debug statement

* chore: remove lint warnings

* refactor: encode sign parameters as a struct

* feat: export WebAuthnValidationModule

* fix: typing on creation of clients to support alchemy configs

* fix: cleans up tests

* chore: removes unused import

* fix: webauthn session key test

* fix: removes duplicate identifier

* fix: remove unnecessary arg

* chore: removes to do comment

* chore: removes unnecessary account type check

* chore: updates yarn.lock and docs.yml

* fix: add back necessary account type checks

* fix: restore yarn.lock file

* fix: adds more granular errors

* chore: updates error docs

* fix: refactor

---------

Co-authored-by: howydev <[email protected]>
Co-authored-by: Michael Moldoveanu <[email protected]>
Co-authored-by: Daniel Slovinsky <[email protected]>
Co-authored-by: dslovinsky <[email protected]>
Co-authored-by: David Philipson <[email protected]>
Co-authored-by: Alchemy Bot <[email protected]>
Co-authored-by: Blake Duncan <[email protected]>
Co-authored-by: jakehobbs <[email protected]>
Co-authored-by: Andy <[email protected]>
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.

4 participants