Skip to content

feat(kyc-controller): move moonpay keypair generation out of constructor - #10053

Merged
Akaryatrh merged 3 commits into
mainfrom
jl/kyc-controller-move-moonpay-keypair-out-of-constructor
Sep 2, 2026
Merged

feat(kyc-controller): move moonpay keypair generation out of constructor#10053
Akaryatrh merged 3 commits into
mainfrom
jl/kyc-controller-move-moonpay-keypair-out-of-constructor

Conversation

@jiexi

@jiexi jiexi commented Sep 1, 2026

Copy link
Copy Markdown
Member

Explanation

  • Moves moonpay keypair generation out of the constructor and into initialize() when moonpay is passed as the vendor

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes when MoonPay frame keys exist and how encrypted frame credentials are decrypted—callers must initialize with MoonPay before building Check/Auth URLs, which may be a breaking integration change.

Overview
MoonPay Check/Auth frame crypto is no longer created in the constructor. The controller keeps a nullable #moonpayFrameKeypair that is generated on initialize() when the vendor is MoonPay (or lazily on a repeat initialize mid-flow if the keypair was missing), and cleared when switching to a non-MoonPay vendor via initialize or createVendorCustomer.

Frame URLs and credential handling now depend on that keypair. buildCheckFrameUrl and buildAuthFrameUrl return null without it; frame credential decryption runs only when both an envelope and the MoonPay keypair are present.

Tests were updated so helpers call initialize({ vendor: 'moonpay' }) where needed, envelopeFor is async, and stale-completion cases no longer rely on a constructor-time key.

Reviewed by Cursor Bugbot for commit 7cce858. Bugbot is set up for automated code reviews on this repo. Configure here.

@jiexi
jiexi requested a review from a team as a code owner September 1, 2026 17:19
@jiexi
jiexi deployed to default-branch September 1, 2026 17:20 — with GitHub Actions Active
Comment thread packages/kyc-controller/src/KycController.ts
Comment thread packages/kyc-controller/src/KycController.ts Outdated
@cursor
cursor Bot requested review from Akaryatrh and georgeweiler September 1, 2026 17:26

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b7217aa. Configure here.

Comment thread packages/kyc-controller/src/KycController.ts Outdated
@jiexi
jiexi requested a review from a team as a code owner September 1, 2026 18:16
amitabh94
amitabh94 previously approved these changes Sep 1, 2026
@jiexi
jiexi force-pushed the jl/kyc-controller-move-moonpay-keypair-out-of-constructor branch from 80520ae to f8a976c Compare September 1, 2026 21:16
jiexi and others added 2 commits September 1, 2026 14:20
Co-authored-by: Cursor <cursoragent@cursor.com>
@jiexi

jiexi commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

controller hasn't been released yet. No changelog entries will actually survive after the first release. Marking this no-changelog to save some time

@Akaryatrh Akaryatrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Akaryatrh
Akaryatrh added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 0751d7f Sep 2, 2026
48 of 49 checks passed
@Akaryatrh
Akaryatrh deleted the jl/kyc-controller-move-moonpay-keypair-out-of-constructor branch September 2, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants