Skip to content

1266.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Sep 18:58
4be7ba1

@metamask/kyc-controller 0.4.0

Added

  • Export MoonPayFrameHandler, MoonPayFrameHandlerOptions, and clearMoonPaySession so clients can own MoonPay Check/Auth frames after those methods left KycController (#10293)
  • Add sessionStatus (KycSessionStatus | null) to KycControllerState (#10293)
  • Add KycService.getSessionStatusForVendor, which fetches GET /sessions/latest/status/{vendor} and returns KycSessionStatus or null (#10293)
  • Add KycController.fetchVendorDisclaimers, which loads vendor T&Cs via KycService.fetchVendorDisclaimers (#10293)
  • Add KycController.hasCompletedVendorDisclaimers, which fetches the vendor T&C catalog and returns whether persisted vendorDisclaimersAccepted covers every fetched disclaimer (#10293)
  • Add KycController.recordVendorDisclaimers, which records vendor T&Cs via KycService.submitVendorDisclaimers and persists accepted ids on state (#10293)
  • Add KycController.startSession, which reuses the latest vendor session when one exists and otherwise creates the vendor customer and a UKYC session (#10293)
  • Add KycController.launchProviderFlow, which presents the identity-provider (SumSub) verification UI (#10293)
  • Add KycController.startSessionStatusPolling, which polls GET /sessions/{id}/status for state.sessionStatus.id until finalStatus is approved, rejected, or retry (#10293)
  • Expose current KycController methods as messenger actions: startSession, reset, clearState, getSessionStatusForVendor, refreshSessionStatus, startSessionStatusPolling, fetchSessionDisclaimers, recordSessionDisclaimers, hasCompletedSessionDisclaimers, fetchVendorDisclaimers, recordVendorDisclaimers, hasCompletedVendorDisclaimers, and launchProviderFlow (#10293)

Changed

  • BREAKING: Add required id to KycSessionStatus (#10293)
  • BREAKING: Rename CreateSessionParams to CreateMoonpaySessionParams, and KycService.createSession / KycService:createSession to createMoonpaySession / KycService:createMoonpaySession (#10293)
  • MoonPayFrameHandler.buildCheckFrameUrl no longer sets the skipKyc query parameter (#10293)
  • Bump @metamask/profile-sync-controller from ^32.1.0 to ^32.1.1 (#10220)

Removed

  • BREAKING: Remove unused KycCustomerIdentity (#10293)
  • BREAKING: Remove sessionStatusPollIntervalMs and userStatusPollIntervalMs from KycControllerOptions, and stop automatic session-status and user-status polling. Session-status polling is now opt-in through startSessionStatusPolling or refreshSessionStatus (#10293)
  • BREAKING: Remove the reselect dependency (#10293)
  • BREAKING: Remove the polling value from KycSumSubStatus (#10293)
  • BREAKING: Remove MoonPay Check/Auth frame methods from KycController: handleFrameMessage, buildCheckFrameUrl, buildAuthFrameUrl, and buildResetFrameUrl. Use MoonPayFrameHandler directly for frame protocol, URLs, and message handling (#10293)
  • BREAKING: Remove KycService.checkKycRequired, CheckKycRequiredParams, and the KycService:checkKycRequired messenger action (#10293)
  • BREAKING: Remove KycService.fetchKycStatus, KycService:fetchKycStatus, KycController.refreshKycStatus, KycController:refreshKycStatus, KycUserStatus, KycUserStatusResponse, and KycController:statusChanged (KycControllerStatusChangedEvent) (#10293)
  • BREAKING: Replace the previous KycController messenger method actions. Removed: initialize, createVendorCustomer, loadDisclaimers, acceptTermsAndStartSession, clearSavedTerms, checkKycRequired, getKycStatus, getCustomerIdentity, startSumSub, and getSessionStatus (#10293)
  • BREAKING: Replace selectKycPhase, selectKycSumSub, and selectIsKycRequiredForProduct with selectKycVendor and selectKycSessionStatus (#10293)