Repository navigation
Gw/kalshi poc - #11278
Gw/kalshi poc#11278georgeweiler wants to merge 4 commits into
Conversation
Replace the single-session KycController state with `sessions`, keyed by
vendor, so a second vendor (e.g. Kalshi) can hold its own session next to
Iron. Every session method takes `{ vendor }`; there is no active vendor.
- Add getSessionDecision (none/new/pending/approved/rejected/retry), moved
from RampsController's resolveVbaKycStatus
- Add acceptVendorDisclaimers so vendor terms accepted before a session
exists are stored on the controller, then submitted by
recordVendorDisclaimers({ vendor })
- Drop the stored email/vendor/geoCountry and their 'different X' guards;
email is only required when creating a session
- One SumSub flow on screen at a time; per-vendor polling loops
- Make vendor required on KycService.fetchVendorDisclaimers and
createUkycSession
- Remove dead KycPhase / KycProduct types
- RampsController passes vendor 'iron' and reads getSessionDecision
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions Also require a session id in the controller's session lookup, stop recordVendorDisclaimers recreating an entry cleared mid-request, and update ARCHITECTURE.md's state and selectors sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- KycVendor gains kalshi; startSession registers relay-registered vendors with a caller-supplied email and skips the partner identity token and vendor customer call - KycService.postOnboardingStep and KycController verify/resend email code, send/verify phone code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ 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 49beb9f. Configure here.
| session = await this.messenger.call( | ||
| 'KycController:fetchSessionStatusOnce', | ||
| session.id, | ||
| vendorParams, |
There was a problem hiding this comment.
VBA clear wipes every vendor
High Severity
hydrateVbaOnboarding still calls KycController:clearState when the Iron session 404s. That action now deletes every vendor entry, so a missing VBA session also drops Kalshi or MoonPay progress the user already completed.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 49beb9f. Configure here.
|
|
||
| this.update((state) => { | ||
| state.email = email; | ||
| state.vendor = params.vendor; |
There was a problem hiding this comment.
Session create drops terms country
Medium Severity
startSession overwrites residenceCountry with geo when it creates a session, but leaves any vendorDisclaimersAccepted from acceptVendorDisclaimers in place. recordVendorDisclaimers can then submit terms for a different country than the session, and later catalog checks use the new country.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 49beb9f. Configure here.


Explanation
References
Checklist
Note
High Risk
Breaking changes to persisted KYC state and many controller/service APIs that orchestrate identity sessions, disclaimers, and SumSub flows; ramps onboarding now depends on the new decision API.
Overview
Breaking refactor of
@metamask/kyc-controllerfrom a single active session tosessionskeyed by identity vendor (moonpay,iron,kalshi). Per-vendor entries hold session status, provider flow, residence country, disclaimer acceptance, and consent state;clearState/resetwipe all vendors and stop each vendor’s polling loop.Session APIs now require
{ vendor }(read/refresh/poll status, disclaimers, provider flow, etc.).startSessionno longer throws on vendor/country/email mismatches and only needs a verified email when creating a session.KycService.fetchVendorDisclaimersandcreateUkycSessionrequire an explicitvendor(no MoonPay default).Vendor terms flow: new
acceptVendorDisclaimersstores local acceptance before a session exists;recordVendorDisclaimers({ vendor })submits that stored acceptance once a session exists.hasCompletedVendorDisclaimersonly counts submitted acceptance against the catalog for the entry’sresidenceCountry.New surface:
getSessionDecision({ vendor })(and exportedgetKycSessionDecision) maps a vendor entry tonone|new|pending|approved|rejected|retry. Selectors are nowselectKycSession(state, vendor)andselectKycSessionStatus(state, vendor). Removed publicKycPhase,KycProduct, and related disclaimer types.launchProviderFlowreturnsfailedwithout mutating state if another vendor’s SumSub UI is already open.Kalshi / relay-registered vendors: adds
kalshi,VENDORS_REGISTERED_BY_RELAY, optionalemailon session creation,KycService.postOnboardingStep, and controller messenger actions for vendor email/SMS OTP steps.@metamask/ramps-controlleradopts the new KYC actions (vendor-scoped calls +KycController:getSessionDecision) sohydrateVbaOnboardingderiveskycStatusfrom the decision instead of inline session parsing. Clients must migrate persisted KYC state to the new shape.Reviewed by Cursor Bugbot for commit 49beb9f. Bugbot is set up for automated code reviews on this repo. Configure here.