@metamask-previews/kyc-controller 0.0.0-preview-2f76f9aac → 0.0.0-preview-eedff6680

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/README.md +9 -1
  3. package/dist/KycController-method-action-types.cjs +7 -0
  4. package/dist/KycController-method-action-types.cjs.map +1 -0
  5. package/dist/KycController-method-action-types.d.cts +237 -0
  6. package/dist/KycController-method-action-types.d.cts.map +1 -0
  7. package/dist/KycController-method-action-types.d.mts +237 -0
  8. package/dist/KycController-method-action-types.d.mts.map +1 -0
  9. package/dist/KycController-method-action-types.mjs +6 -0
  10. package/dist/KycController-method-action-types.mjs.map +1 -0
  11. package/dist/KycController.cjs +1843 -0
  12. package/dist/KycController.cjs.map +1 -0
  13. package/dist/KycController.d.cts +393 -0
  14. package/dist/KycController.d.cts.map +1 -0
  15. package/dist/KycController.d.mts +393 -0
  16. package/dist/KycController.d.mts.map +1 -0
  17. package/dist/KycController.mjs +1838 -0
  18. package/dist/KycController.mjs.map +1 -0
  19. package/dist/KycService-method-action-types.cjs +7 -0
  20. package/dist/KycService-method-action-types.cjs.map +1 -0
  21. package/dist/KycService-method-action-types.d.cts +186 -0
  22. package/dist/KycService-method-action-types.d.cts.map +1 -0
  23. package/dist/KycService-method-action-types.d.mts +186 -0
  24. package/dist/KycService-method-action-types.d.mts.map +1 -0
  25. package/dist/KycService-method-action-types.mjs +6 -0
  26. package/dist/KycService-method-action-types.mjs.map +1 -0
  27. package/dist/KycService.cjs +628 -0
  28. package/dist/KycService.cjs.map +1 -0
  29. package/dist/KycService.d.cts +494 -0
  30. package/dist/KycService.d.cts.map +1 -0
  31. package/dist/KycService.d.mts +494 -0
  32. package/dist/KycService.d.mts.map +1 -0
  33. package/dist/KycService.mjs +624 -0
  34. package/dist/KycService.mjs.map +1 -0
  35. package/dist/countryCodes.cjs +274 -0
  36. package/dist/countryCodes.cjs.map +1 -0
  37. package/dist/countryCodes.d.cts +18 -0
  38. package/dist/countryCodes.d.cts.map +1 -0
  39. package/dist/countryCodes.d.mts +18 -0
  40. package/dist/countryCodes.d.mts.map +1 -0
  41. package/dist/countryCodes.mjs +270 -0
  42. package/dist/countryCodes.mjs.map +1 -0
  43. package/dist/crypto.cjs +154 -0
  44. package/dist/crypto.cjs.map +1 -0
  45. package/dist/crypto.d.cts +84 -0
  46. package/dist/crypto.d.cts.map +1 -0
  47. package/dist/crypto.d.mts +84 -0
  48. package/dist/crypto.d.mts.map +1 -0
  49. package/dist/crypto.mjs +149 -0
  50. package/dist/crypto.mjs.map +1 -0
  51. package/dist/encoding.cjs +40 -0
  52. package/dist/encoding.cjs.map +1 -0
  53. package/dist/encoding.d.cts +24 -0
  54. package/dist/encoding.d.cts.map +1 -0
  55. package/dist/encoding.d.mts +24 -0
  56. package/dist/encoding.d.mts.map +1 -0
  57. package/dist/encoding.mjs +35 -0
  58. package/dist/encoding.mjs.map +1 -0
  59. package/dist/index.cjs +34 -10
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +18 -7
  62. package/dist/index.d.cts.map +1 -1
  63. package/dist/index.d.mts +18 -7
  64. package/dist/index.d.mts.map +1 -1
  65. package/dist/index.mjs +11 -9
  66. package/dist/index.mjs.map +1 -1
  67. package/dist/selectors.cjs +30 -0
  68. package/dist/selectors.cjs.map +1 -0
  69. package/dist/selectors.d.cts +24 -0
  70. package/dist/selectors.d.cts.map +1 -0
  71. package/dist/selectors.d.mts +24 -0
  72. package/dist/selectors.d.mts.map +1 -0
  73. package/dist/selectors.mjs +24 -0
  74. package/dist/selectors.mjs.map +1 -0
  75. package/dist/types.cjs +10 -0
  76. package/dist/types.cjs.map +1 -0
  77. package/dist/types.d.cts +208 -0
  78. package/dist/types.d.cts.map +1 -0
  79. package/dist/types.d.mts +208 -0
  80. package/dist/types.d.mts.map +1 -0
  81. package/dist/types.mjs +9 -0
  82. package/dist/types.mjs.map +1 -0
  83. package/dist/ukyc/constants.cjs +75 -0
  84. package/dist/ukyc/constants.cjs.map +1 -0
  85. package/dist/ukyc/constants.d.cts +69 -0
  86. package/dist/ukyc/constants.d.cts.map +1 -0
  87. package/dist/ukyc/constants.d.mts +69 -0
  88. package/dist/ukyc/constants.d.mts.map +1 -0
  89. package/dist/ukyc/constants.mjs +72 -0
  90. package/dist/ukyc/constants.mjs.map +1 -0
  91. package/dist/ukyc/deriveClientMaterial.cjs +65 -0
  92. package/dist/ukyc/deriveClientMaterial.cjs.map +1 -0
  93. package/dist/ukyc/deriveClientMaterial.d.cts +54 -0
  94. package/dist/ukyc/deriveClientMaterial.d.cts.map +1 -0
  95. package/dist/ukyc/deriveClientMaterial.d.mts +54 -0
  96. package/dist/ukyc/deriveClientMaterial.d.mts.map +1 -0
  97. package/dist/ukyc/deriveClientMaterial.mjs +60 -0
  98. package/dist/ukyc/deriveClientMaterial.mjs.map +1 -0
  99. package/dist/ukyc/jwtChain.cjs +54 -0
  100. package/dist/ukyc/jwtChain.cjs.map +1 -0
  101. package/dist/ukyc/jwtChain.d.cts +40 -0
  102. package/dist/ukyc/jwtChain.d.cts.map +1 -0
  103. package/dist/ukyc/jwtChain.d.mts +40 -0
  104. package/dist/ukyc/jwtChain.d.mts.map +1 -0
  105. package/dist/ukyc/jwtChain.mjs +50 -0
  106. package/dist/ukyc/jwtChain.mjs.map +1 -0
  107. package/dist/ukyc/localUserSecret.cjs +98 -0
  108. package/dist/ukyc/localUserSecret.cjs.map +1 -0
  109. package/dist/ukyc/localUserSecret.d.cts +65 -0
  110. package/dist/ukyc/localUserSecret.d.cts.map +1 -0
  111. package/dist/ukyc/localUserSecret.d.mts +65 -0
  112. package/dist/ukyc/localUserSecret.d.mts.map +1 -0
  113. package/dist/ukyc/localUserSecret.mjs +92 -0
  114. package/dist/ukyc/localUserSecret.mjs.map +1 -0
  115. package/dist/ukyc/storageAccessToken.cjs +139 -0
  116. package/dist/ukyc/storageAccessToken.cjs.map +1 -0
  117. package/dist/ukyc/storageAccessToken.d.cts +99 -0
  118. package/dist/ukyc/storageAccessToken.d.cts.map +1 -0
  119. package/dist/ukyc/storageAccessToken.d.mts +99 -0
  120. package/dist/ukyc/storageAccessToken.d.mts.map +1 -0
  121. package/dist/ukyc/storageAccessToken.mjs +133 -0
  122. package/dist/ukyc/storageAccessToken.mjs.map +1 -0
  123. package/dist/ukyc/testToken.cjs +61 -0
  124. package/dist/ukyc/testToken.cjs.map +1 -0
  125. package/dist/ukyc/testToken.d.cts +50 -0
  126. package/dist/ukyc/testToken.d.cts.map +1 -0
  127. package/dist/ukyc/testToken.d.mts +50 -0
  128. package/dist/ukyc/testToken.d.mts.map +1 -0
  129. package/dist/ukyc/testToken.mjs +57 -0
  130. package/dist/ukyc/testToken.mjs.map +1 -0
  131. package/dist/ukyc/wrapEncryptionKey.cjs +37 -0
  132. package/dist/ukyc/wrapEncryptionKey.cjs.map +1 -0
  133. package/dist/ukyc/wrapEncryptionKey.d.cts +41 -0
  134. package/dist/ukyc/wrapEncryptionKey.d.cts.map +1 -0
  135. package/dist/ukyc/wrapEncryptionKey.d.mts +41 -0
  136. package/dist/ukyc/wrapEncryptionKey.d.mts.map +1 -0
  137. package/dist/ukyc/wrapEncryptionKey.mjs +34 -0
  138. package/dist/ukyc/wrapEncryptionKey.mjs.map +1 -0
  139. package/dist/ukyc/wrapUserKey.cjs +80 -0
  140. package/dist/ukyc/wrapUserKey.cjs.map +1 -0
  141. package/dist/ukyc/wrapUserKey.d.cts +26 -0
  142. package/dist/ukyc/wrapUserKey.d.cts.map +1 -0
  143. package/dist/ukyc/wrapUserKey.d.mts +26 -0
  144. package/dist/ukyc/wrapUserKey.d.mts.map +1 -0
  145. package/dist/ukyc/wrapUserKey.mjs +76 -0
  146. package/dist/ukyc/wrapUserKey.mjs.map +1 -0
  147. package/dist/ukyc/wrappedRelayPayload.cjs +32 -0
  148. package/dist/ukyc/wrappedRelayPayload.cjs.map +1 -0
  149. package/dist/ukyc/wrappedRelayPayload.d.cts +35 -0
  150. package/dist/ukyc/wrappedRelayPayload.d.cts.map +1 -0
  151. package/dist/ukyc/wrappedRelayPayload.d.mts +35 -0
  152. package/dist/ukyc/wrappedRelayPayload.d.mts.map +1 -0
  153. package/dist/ukyc/wrappedRelayPayload.mjs +28 -0
  154. package/dist/ukyc/wrappedRelayPayload.mjs.map +1 -0
  155. package/package.json +24 -3
package/CHANGELOG.md CHANGED
@@ -9,6 +9,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
- - Initial release of the `@metamask/kyc-controller` package for managing KYC / identity verification state across MetaMask clients ([#9781](https://github.com/MetaMask/core/pull/9781))
12
+ - Add session-scoped disclaimer APIs on `KycService` for the idOS / KYC-provider catalog ([#9979](https://github.com/MetaMask/core/pull/9979)):
13
+ - `fetchSessionDisclaimers({ sessionId })` calls `GET /sessions/{sessionId}/disclaimers`
14
+ - `submitSessionDisclaimers({ sessionId, idOS, kycProvider, credentialReusabilityConsentGiven })` calls `POST /sessions/{sessionId}/disclaimers`
15
+ - Add `KycService.submitVendorDisclaimers({ vendor, disclaimerIds })` (`POST /vendors/{vendor}/disclaimers`) to record Iron T&C signings, plus the `KycVendorSigning` response type. The consents path calls this alongside session-scoped disclaimers; vendor T&C ids are no longer sent on the session disclaimer POST. ([#9979](https://github.com/MetaMask/core/pull/9979))
16
+ - Add `KycConsentDocument`, `KycConsentRecord`, and `KycSessionDisclaimers` types for that catalog, plus in-memory `credentialReusabilityConsentGiven` and `sessionDisclaimers` controller state. `acceptTermsAndStartSession` forwards optional `credentialReusabilityConsentGiven` (default `false`). ([#9979](https://github.com/MetaMask/core/pull/9979))
17
+ - Parameterize Universal KYC vendor HTTP on `KycService` so identity vendors share one client surface instead of vendor-branded methods ([#9908](https://github.com/MetaMask/core/pull/9908)):
18
+ - `fetchDisclaimers({ vendor, country })` and `checkKycRequired({ vendor, ... })` call `/vendors/{vendor}/disclaimers` and `/vendors/{vendor}/kyc-required` (`vendor` defaults to `moonpay`)
19
+ - `createVendorCustomer({ vendor, email })` calls `POST /vendors/{vendor}/customers`
20
+ - `fetchKycStatus()` reads `GET /kyc/status`
21
+ - Add a consents-path KYC flow on `KycController` for non-MoonPay vendors (currently `iron`): empty-shell customer → disclaimers → consents → SumSub, skipping MoonPay Check/Auth frames. `initialize({ vendor })` and `createVendorCustomer({ vendor, email })` drive the path; `acceptTermsAndStartSession` requires `sumsubTncSigned` / `idosTncSigned`. ([#9908](https://github.com/MetaMask/core/pull/9908))
22
+ - Add `KycController.refreshKycStatus()` and the `KycController:statusChanged` event so consumers can poll user-keyed KYC status for toast / banner surfaces. ([#9908](https://github.com/MetaMask/core/pull/9908))
23
+ - Add `KycController.getCustomerIdentity()` (and `KycCustomerIdentity`) returning the vendor-scoped `{ vendor, id }` for the current session, or `null` before authentication and after `reset()`. ([#9908](https://github.com/MetaMask/core/pull/9908))
24
+ - Extend `KycProduct` with `'money'` and `KycVendor` with `'iron'`. ([#9908](https://github.com/MetaMask/core/pull/9908))
25
+ - Add `KycUserStatus` / `KycUserStatusResponse` types for the simplified `GET /kyc/status` payload. ([#9908](https://github.com/MetaMask/core/pull/9908))
26
+ - Add persisted `termsAcceptedVendor` state recording which vendor's disclaimers `acceptedDisclaimerIds` belong to, so stored acceptance is only reused for that vendor. ([#9908](https://github.com/MetaMask/core/pull/9908))
27
+ - Add persisted `sumsubTncAccepted` and `idosTncAccepted` state so T&C2 flags can be validated when resuming a consents-path session. ([#9908](https://github.com/MetaMask/core/pull/9908))
28
+ - Add `KycController.clearState()` (and the `KycController:clearState` action) restoring the default state, including the fields `reset()` preserves: the session email, terms acceptance, the per-product KYC-required cache and the user-keyed status. Intended for a full wallet reset. ([#9958](https://github.com/MetaMask/core/pull/9958))
29
+
30
+ ### Changed
31
+
32
+ - **BREAKING:** Replace wrapping-key exchange (`KycService.getWrappingKey`) and sending wrapped keys at session creation with encryption schemas from `createUkycSession` plus `setAuthorizations` (`POST /sessions/{id}/authorizations`). `createUkycSession` no longer accepts `wrappedEncryptionKey` or `ukycCapabilityToken`; both secrets are wrapped on the client against per-secret schemas and posted separately. ([#9944](https://github.com/MetaMask/core/pull/9944))
33
+ - **BREAKING:** Replace `KycService.submitConsents` (`POST /consents`) with session-scoped `fetchSessionDisclaimers` / `submitSessionDisclaimers` plus vendor T&C recording via `submitVendorDisclaimers`. Consents now use `{ key, version }` document records plus `credentialReusabilityConsentGiven` instead of Iron disclaimer ids and boolean T&C flags, and they require a UKYC session id. Iron content ids are posted separately to `POST /vendors/{vendor}/disclaimers`. The consents path records vendor T&Cs, then creates the UKYC session, then records session disclaimers. A 409 conflict is re-checked with a GET and only treated as success when every accepted document is consented. ([#9979](https://github.com/MetaMask/core/pull/9979))
34
+ - Make the `fetch` option on the `KycService` constructor optional; it now defaults to the runtime's native `fetch` (browser, React Native, Node 18+), so consumers no longer need to inject one. ([#9908](https://github.com/MetaMask/core/pull/9908))
35
+ - **BREAKING:** Invalidate terms acceptance when `termsAcceptedVendor` is `null` (pre-migration state), forcing reacceptance after the multi-vendor upgrade to ensure users review current vendor terms. ([#9908](https://github.com/MetaMask/core/pull/9908))
36
+ - **BREAKING:** Require `sumsubTncSigned` and `idosTncSigned` on `acceptTermsAndStartSession` for every vendor, so callers explicitly declare T&C2 acceptance. Zero-argument calls and omitted flags fail instead of defaulting to `true`. ([#9908](https://github.com/MetaMask/core/pull/9908))
37
+ - Rename `CreateUkycSessionParams.vendorId` to `vendor` for consistency with other service methods. ([#9908](https://github.com/MetaMask/core/pull/9908))
38
+ - Bump `@metamask/base-data-service` from `^0.1.3` to `^1.0.0` ([#9972](https://github.com/MetaMask/core/pull/9972))
39
+
40
+ ### Fixed
41
+
42
+ - Clear leftover MoonPay `sessionToken`, `accessToken`, and Check/Auth frame credentials when `initialize` or `createVendorCustomer` switches to another vendor, so `buildCheckFrameUrl` cannot return a MoonPay URL for a consents-path session. ([#9908](https://github.com/MetaMask/core/pull/9908))
43
+ - Rewind the consents path when SumSub fails before completion (thrown step or SDK close without `Completed`), instead of refreshing user status and forcing `phase` to `done`. A terminal UKYC rejection after the SDK completed still finishes as `done` so the decision can be reflected in user status. ([#9908](https://github.com/MetaMask/core/pull/9908))
44
+ - Make `createVendorCustomer` a no-op during in-progress phases (matching `initialize`), so a vendor switch cannot leave Check/Auth frames attached to the wrong vendor. ([#9908](https://github.com/MetaMask/core/pull/9908))
45
+ - Ignore Check/Auth frame completion unless the active vendor is MoonPay, and do not return a MoonPay customer id from `getCustomerIdentity()` under another vendor. ([#9908](https://github.com/MetaMask/core/pull/9908))
46
+ - Drop persisted terms acceptance on a vendor switch only after `createVendorCustomer` succeeds, so a failed or reset Money start cannot erase another vendor's stored acceptance. ([#9908](https://github.com/MetaMask/core/pull/9908))
47
+ - Clear `moonpayCustomerId` when the active vendor is not MoonPay, so `getCustomerIdentity()` cannot report a MoonPay customer id under another vendor. ([#9908](https://github.com/MetaMask/core/pull/9908))
48
+ - Call `unref()` on the user-status poll timer only when it exists. React Native and browser timers are numbers, so an unconditional `unref()` threw when status polling started outside Node. ([#9908](https://github.com/MetaMask/core/pull/9908))
49
+ - Skip the `session_not_in_valid_state` completion write when a `reset()` superseded the SumSub flow, so a late vendor response can no longer force `userStatus` to `completed` (and publish `statusChanged`) on an idle controller. ([#9908](https://github.com/MetaMask/core/pull/9908))
50
+ - Stop `initialize()` once a `reset()` or `clearState()` has superseded it, so a geolocation response arriving afterwards can no longer move the controller into the `terms` phase or reload disclaimers onto a controller that was just reset. ([#9958](https://github.com/MetaMask/core/pull/9958))
51
+ - Validate that `accessToken` and `country` are provided when calling `checkKycRequired` with vendor `moonpay`, failing fast with a clear error instead of posting `undefined` values to the API. ([#9908](https://github.com/MetaMask/core/pull/9908))
52
+ - Check for global `fetch` availability before binding in `KycService` constructor, throwing a descriptive error if `fetch` is neither provided nor globally available (e.g. older Node environments). ([#9908](https://github.com/MetaMask/core/pull/9908))
53
+ - Check for null bearer token before calling `assert()` in `#requestJson`, ensuring the custom "wallet signed in" error message is shown instead of a generic superstruct error. ([#9908](https://github.com/MetaMask/core/pull/9908))
54
+ - Require reacceptance of consents-path terms when `sumsubTncAccepted` or `idosTncAccepted` are `null` (pre-migration state), preventing invalid T&C2 flag submission on session resume. ([#9908](https://github.com/MetaMask/core/pull/9908))
13
55
 
14
56
  [Unreleased]: https://github.com/MetaMask/core/
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `@metamask/kyc-controller`
1
+ # KYC Controller `@metamask/kyc-controller`
2
2
 
3
3
  Shared KYC / identity verification controller used across MetaMask clients
4
4
 
@@ -10,6 +10,14 @@ or
10
10
 
11
11
  `npm install @metamask/kyc-controller`
12
12
 
13
+ ## Development
14
+
15
+ To rebuild the package automatically whenever you change a source file, run the `build:watch` script from core repository root folder:
16
+
17
+ `yarn workspace @metamask/kyc-controller run build:watch`
18
+
19
+ This watches `src/**/*.ts` and re-runs the build on each change (it also performs an initial build on start), which is useful when developing against a client that consumes this package locally.
20
+
13
21
  ## Contributing
14
22
 
15
23
  This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=KycController-method-action-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KycController-method-action-types.cjs","sourceRoot":"","sources":["../src/KycController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { KycController } from './KycController.js';\n\n/**\n * Resolves persisted terms + geolocation, and auto-creates a session when\n * terms are already accepted and an email is available.\n *\n * @param params - Optional parameters.\n * @param params.email - The account email to associate with the session.\n * @param params.product - The consuming feature the flow runs for. When\n * provided, the controller automatically runs the KYC-required check once\n * authentication completes (and chains into document verification when KYC\n * is required). When omitted, the flow stops at `form` and the consumer must\n * call `checkKycRequired` manually.\n * @param params.vendor - Identity vendor for this flow. Non-MoonPay vendors\n * skip Check/Auth frames and use the consents path. Defaults to `moonpay`.\n */\nexport type KycControllerInitializeAction = {\n type: `KycController:initialize`;\n handler: KycController['initialize'];\n};\n\n/**\n * Creates (or resumes) an empty-shell customer for the given identity\n * vendor. Exposed so a consumer can ensure the customer exists before\n * showing T&C screens independently of {@link initialize}.\n *\n * A call while a session flow is already in progress is a no-op — matching\n * {@link initialize} — so a vendor switch cannot leave Check/Auth frames\n * attached to the wrong vendor. Call {@link reset} first to start over.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor for the customer.\n * @param params.email - Email for the vendor customer.\n */\nexport type KycControllerCreateVendorCustomerAction = {\n type: `KycController:createVendorCustomer`;\n handler: KycController['createVendorCustomer'];\n};\n\n/**\n * Loads the disclaimers for the resolved (or provided) country.\n *\n * @param params - Optional parameters.\n * @param params.country - ISO 3166-1 alpha-3 country code override.\n */\nexport type KycControllerLoadDisclaimersAction = {\n type: `KycController:loadDisclaimers`;\n handler: KycController['loadDisclaimers'];\n};\n\n/**\n * Captures terms acceptance for the currently loaded disclaimers and creates\n * a session.\n *\n * @param params - The parameters.\n * @param params.email - The account email to associate with the session.\n * @param params.product - The consuming feature the flow runs for. See\n * {@link initialize} for how the product drives the automatic post\n * authentication continuation.\n * @param params.sumsubTncSigned - Whether Sumsub T&C were accepted (T&C2).\n * Required for every vendor so callers explicitly declare acceptance.\n * @param params.idosTncSigned - Whether idOS T&C were accepted (T&C2).\n * Required for every vendor so callers explicitly declare acceptance.\n * @param params.credentialReusabilityConsentGiven - Whether the customer\n * consented to reuse existing idOS credentials. Used when recording\n * session-scoped disclaimers on the consents path. Defaults to `false`.\n */\nexport type KycControllerAcceptTermsAndStartSessionAction = {\n type: `KycController:acceptTermsAndStartSession`;\n handler: KycController['acceptTermsAndStartSession'];\n};\n\n/**\n * Clears the persisted terms acceptance.\n */\nexport type KycControllerClearSavedTermsAction = {\n type: `KycController:clearSavedTerms`;\n handler: KycController['clearSavedTerms'];\n};\n\n/**\n * Handles a message posted by a Check/Auth frame and advances the flow.\n *\n * The transport-agnostic caller (WebView on mobile, iframe on web) forwards\n * the raw message and injects the returned `reply` back into the frame.\n *\n * @param params - The parameters.\n * @param params.message - The raw message posted by the frame.\n * @returns An object whose optional `reply` should be posted back.\n */\nexport type KycControllerHandleFrameMessageAction = {\n type: `KycController:handleFrameMessage`;\n handler: KycController['handleFrameMessage'];\n};\n\n/**\n * Builds the Check-frame URL, or `null` when no session exists yet.\n *\n * @returns The Check-frame URL or `null`.\n */\nexport type KycControllerBuildCheckFrameUrlAction = {\n type: `KycController:buildCheckFrameUrl`;\n handler: KycController['buildCheckFrameUrl'];\n};\n\n/**\n * Builds the Auth-frame URL, or `null` when no client token is available.\n *\n * @returns The Auth-frame URL or `null`.\n */\nexport type KycControllerBuildAuthFrameUrlAction = {\n type: `KycController:buildAuthFrameUrl`;\n handler: KycController['buildAuthFrameUrl'];\n};\n\n/**\n * Builds the Reset-frame URL.\n *\n * @returns The Reset-frame URL.\n */\nexport type KycControllerBuildResetFrameUrlAction = {\n type: `KycController:buildResetFrameUrl`;\n handler: KycController['buildResetFrameUrl'];\n};\n\n/**\n * Checks whether KYC is required for a product and caches the result.\n *\n * @param params - The parameters.\n * @param params.product - The consuming feature.\n * @param params.country - Optional alpha-3 country override.\n * @returns Whether KYC is required.\n */\nexport type KycControllerCheckKycRequiredAction = {\n type: `KycController:checkKycRequired`;\n handler: KycController['checkKycRequired'];\n};\n\n/**\n * Reads the cached \"is KYC required\" result for a product.\n *\n * @param params - The parameters.\n * @param params.product - The consuming feature.\n * @returns The cached value, or `undefined` if not yet checked.\n */\nexport type KycControllerGetKycStatusAction = {\n type: `KycController:getKycStatus`;\n handler: KycController['getKycStatus'];\n};\n\n/**\n * Returns the vendor-scoped identity for the currently authenticated\n * customer, or `null` when the flow has not yet captured a vendor customer\n * id (before authentication or after {@link reset}), or when a MoonPay id\n * is present under a different `activeVendor`.\n *\n * Exposed so consumers (e.g. ramps autoramp creation) can attach the vendor\n * customer id to downstream calls without reading the full KYC state, which\n * also holds session/access tokens. The id is session-scoped and never\n * persisted.\n *\n * @returns The current {@link KycCustomerIdentity}, or `null`.\n */\nexport type KycControllerGetCustomerIdentityAction = {\n type: `KycController:getCustomerIdentity`;\n handler: KycController['getCustomerIdentity'];\n};\n\n/**\n * Runs the SumSub document-verification sub-flow end to end:\n *\n * 1. creates a UKYC session, receiving per-secret encryption schemas;\n * 2. verifies each schema's `jwtChain` against the Fractal JWKS and confirms\n * the attested session server public key;\n * 3. derives the `data_encryption_key` from the wallet's UKYC\n * `local_user_secret` and wraps it for the session server;\n * 4. mints a client-signed, read-only `ukyc_capability_token`, wraps it the\n * same way as the encryption key, and submits both via authorizations;\n * 5. fetches the SumSub applicant access token; and\n * 6. presents the SDK via the injected launcher.\n *\n * If a UKYC session already exists (the consents path creates it before\n * recording session disclaimers), steps 1–4 are skipped.\n *\n * If authorizations report the applicant is already approved on the relay\n * while the vendor is still finalizing (`kycStatus: approved`,\n * `finalStatus: pending`), the sub-flow stops at step 4 with a\n * `vendorProcessing` status and a message rather than launching the SDK.\n *\n * @param params - Optional parameters.\n * @param params.locale - BCP-47 locale for the SDK UI.\n * @param params.debug - Enables SDK debug logging.\n * @returns The SDK result.\n */\nexport type KycControllerStartSumSubAction = {\n type: `KycController:startSumSub`;\n handler: KycController['startSumSub'];\n};\n\n/**\n * Refreshes the user-keyed simplified KYC status from `GET /kyc/status`,\n * stores it on state, publishes {@link KycControllerStatusChangedEvent}, and\n * schedules short-interval polling while the status is `pending`.\n *\n * @returns The latest status payload.\n */\nexport type KycControllerRefreshKycStatusAction = {\n type: `KycController:refreshKycStatus`;\n handler: KycController['refreshKycStatus'];\n};\n\n/**\n * Fetches the current UKYC session status for the active sub-flow and records\n * it on state. Useful for a one-off refresh outside the automatic polling\n * loop that {@link startSumSub} runs.\n *\n * @returns The fetched session status.\n * @throws If there is no active SumSub session to query.\n */\nexport type KycControllerGetSessionStatusAction = {\n type: `KycController:getSessionStatus`;\n handler: KycController['getSessionStatus'];\n};\n\n/**\n * Resets the flow to idle, clearing session tokens and sub-flow state while\n * preserving persisted terms acceptance and the per-product cache.\n */\nexport type KycControllerResetAction = {\n type: `KycController:reset`;\n handler: KycController['reset'];\n};\n\n/**\n * Restores the controller to its default state, discarding everything\n * {@link reset} deliberately keeps: the session email, the persisted terms\n * acceptance, the per-product KYC-required cache and the user-keyed status.\n *\n * Intended for a full wallet reset, where no trace of the previous\n * customer may survive into the next wallet.\n */\nexport type KycControllerClearStateAction = {\n type: `KycController:clearState`;\n handler: KycController['clearState'];\n};\n\n/**\n * Union of all KycController action types.\n */\nexport type KycControllerMethodActions =\n | KycControllerInitializeAction\n | KycControllerCreateVendorCustomerAction\n | KycControllerLoadDisclaimersAction\n | KycControllerAcceptTermsAndStartSessionAction\n | KycControllerClearSavedTermsAction\n | KycControllerHandleFrameMessageAction\n | KycControllerBuildCheckFrameUrlAction\n | KycControllerBuildAuthFrameUrlAction\n | KycControllerBuildResetFrameUrlAction\n | KycControllerCheckKycRequiredAction\n | KycControllerGetKycStatusAction\n | KycControllerGetCustomerIdentityAction\n | KycControllerStartSumSubAction\n | KycControllerRefreshKycStatusAction\n | KycControllerGetSessionStatusAction\n | KycControllerResetAction\n | KycControllerClearStateAction;\n"]}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { KycController } from "./KycController.cjs";
6
+ /**
7
+ * Resolves persisted terms + geolocation, and auto-creates a session when
8
+ * terms are already accepted and an email is available.
9
+ *
10
+ * @param params - Optional parameters.
11
+ * @param params.email - The account email to associate with the session.
12
+ * @param params.product - The consuming feature the flow runs for. When
13
+ * provided, the controller automatically runs the KYC-required check once
14
+ * authentication completes (and chains into document verification when KYC
15
+ * is required). When omitted, the flow stops at `form` and the consumer must
16
+ * call `checkKycRequired` manually.
17
+ * @param params.vendor - Identity vendor for this flow. Non-MoonPay vendors
18
+ * skip Check/Auth frames and use the consents path. Defaults to `moonpay`.
19
+ */
20
+ export type KycControllerInitializeAction = {
21
+ type: `KycController:initialize`;
22
+ handler: KycController['initialize'];
23
+ };
24
+ /**
25
+ * Creates (or resumes) an empty-shell customer for the given identity
26
+ * vendor. Exposed so a consumer can ensure the customer exists before
27
+ * showing T&C screens independently of {@link initialize}.
28
+ *
29
+ * A call while a session flow is already in progress is a no-op — matching
30
+ * {@link initialize} — so a vendor switch cannot leave Check/Auth frames
31
+ * attached to the wrong vendor. Call {@link reset} first to start over.
32
+ *
33
+ * @param params - The parameters.
34
+ * @param params.vendor - Identity vendor for the customer.
35
+ * @param params.email - Email for the vendor customer.
36
+ */
37
+ export type KycControllerCreateVendorCustomerAction = {
38
+ type: `KycController:createVendorCustomer`;
39
+ handler: KycController['createVendorCustomer'];
40
+ };
41
+ /**
42
+ * Loads the disclaimers for the resolved (or provided) country.
43
+ *
44
+ * @param params - Optional parameters.
45
+ * @param params.country - ISO 3166-1 alpha-3 country code override.
46
+ */
47
+ export type KycControllerLoadDisclaimersAction = {
48
+ type: `KycController:loadDisclaimers`;
49
+ handler: KycController['loadDisclaimers'];
50
+ };
51
+ /**
52
+ * Captures terms acceptance for the currently loaded disclaimers and creates
53
+ * a session.
54
+ *
55
+ * @param params - The parameters.
56
+ * @param params.email - The account email to associate with the session.
57
+ * @param params.product - The consuming feature the flow runs for. See
58
+ * {@link initialize} for how the product drives the automatic post
59
+ * authentication continuation.
60
+ * @param params.sumsubTncSigned - Whether Sumsub T&C were accepted (T&C2).
61
+ * Required for every vendor so callers explicitly declare acceptance.
62
+ * @param params.idosTncSigned - Whether idOS T&C were accepted (T&C2).
63
+ * Required for every vendor so callers explicitly declare acceptance.
64
+ * @param params.credentialReusabilityConsentGiven - Whether the customer
65
+ * consented to reuse existing idOS credentials. Used when recording
66
+ * session-scoped disclaimers on the consents path. Defaults to `false`.
67
+ */
68
+ export type KycControllerAcceptTermsAndStartSessionAction = {
69
+ type: `KycController:acceptTermsAndStartSession`;
70
+ handler: KycController['acceptTermsAndStartSession'];
71
+ };
72
+ /**
73
+ * Clears the persisted terms acceptance.
74
+ */
75
+ export type KycControllerClearSavedTermsAction = {
76
+ type: `KycController:clearSavedTerms`;
77
+ handler: KycController['clearSavedTerms'];
78
+ };
79
+ /**
80
+ * Handles a message posted by a Check/Auth frame and advances the flow.
81
+ *
82
+ * The transport-agnostic caller (WebView on mobile, iframe on web) forwards
83
+ * the raw message and injects the returned `reply` back into the frame.
84
+ *
85
+ * @param params - The parameters.
86
+ * @param params.message - The raw message posted by the frame.
87
+ * @returns An object whose optional `reply` should be posted back.
88
+ */
89
+ export type KycControllerHandleFrameMessageAction = {
90
+ type: `KycController:handleFrameMessage`;
91
+ handler: KycController['handleFrameMessage'];
92
+ };
93
+ /**
94
+ * Builds the Check-frame URL, or `null` when no session exists yet.
95
+ *
96
+ * @returns The Check-frame URL or `null`.
97
+ */
98
+ export type KycControllerBuildCheckFrameUrlAction = {
99
+ type: `KycController:buildCheckFrameUrl`;
100
+ handler: KycController['buildCheckFrameUrl'];
101
+ };
102
+ /**
103
+ * Builds the Auth-frame URL, or `null` when no client token is available.
104
+ *
105
+ * @returns The Auth-frame URL or `null`.
106
+ */
107
+ export type KycControllerBuildAuthFrameUrlAction = {
108
+ type: `KycController:buildAuthFrameUrl`;
109
+ handler: KycController['buildAuthFrameUrl'];
110
+ };
111
+ /**
112
+ * Builds the Reset-frame URL.
113
+ *
114
+ * @returns The Reset-frame URL.
115
+ */
116
+ export type KycControllerBuildResetFrameUrlAction = {
117
+ type: `KycController:buildResetFrameUrl`;
118
+ handler: KycController['buildResetFrameUrl'];
119
+ };
120
+ /**
121
+ * Checks whether KYC is required for a product and caches the result.
122
+ *
123
+ * @param params - The parameters.
124
+ * @param params.product - The consuming feature.
125
+ * @param params.country - Optional alpha-3 country override.
126
+ * @returns Whether KYC is required.
127
+ */
128
+ export type KycControllerCheckKycRequiredAction = {
129
+ type: `KycController:checkKycRequired`;
130
+ handler: KycController['checkKycRequired'];
131
+ };
132
+ /**
133
+ * Reads the cached "is KYC required" result for a product.
134
+ *
135
+ * @param params - The parameters.
136
+ * @param params.product - The consuming feature.
137
+ * @returns The cached value, or `undefined` if not yet checked.
138
+ */
139
+ export type KycControllerGetKycStatusAction = {
140
+ type: `KycController:getKycStatus`;
141
+ handler: KycController['getKycStatus'];
142
+ };
143
+ /**
144
+ * Returns the vendor-scoped identity for the currently authenticated
145
+ * customer, or `null` when the flow has not yet captured a vendor customer
146
+ * id (before authentication or after {@link reset}), or when a MoonPay id
147
+ * is present under a different `activeVendor`.
148
+ *
149
+ * Exposed so consumers (e.g. ramps autoramp creation) can attach the vendor
150
+ * customer id to downstream calls without reading the full KYC state, which
151
+ * also holds session/access tokens. The id is session-scoped and never
152
+ * persisted.
153
+ *
154
+ * @returns The current {@link KycCustomerIdentity}, or `null`.
155
+ */
156
+ export type KycControllerGetCustomerIdentityAction = {
157
+ type: `KycController:getCustomerIdentity`;
158
+ handler: KycController['getCustomerIdentity'];
159
+ };
160
+ /**
161
+ * Runs the SumSub document-verification sub-flow end to end:
162
+ *
163
+ * 1. creates a UKYC session, receiving per-secret encryption schemas;
164
+ * 2. verifies each schema's `jwtChain` against the Fractal JWKS and confirms
165
+ * the attested session server public key;
166
+ * 3. derives the `data_encryption_key` from the wallet's UKYC
167
+ * `local_user_secret` and wraps it for the session server;
168
+ * 4. mints a client-signed, read-only `ukyc_capability_token`, wraps it the
169
+ * same way as the encryption key, and submits both via authorizations;
170
+ * 5. fetches the SumSub applicant access token; and
171
+ * 6. presents the SDK via the injected launcher.
172
+ *
173
+ * If a UKYC session already exists (the consents path creates it before
174
+ * recording session disclaimers), steps 1–4 are skipped.
175
+ *
176
+ * If authorizations report the applicant is already approved on the relay
177
+ * while the vendor is still finalizing (`kycStatus: approved`,
178
+ * `finalStatus: pending`), the sub-flow stops at step 4 with a
179
+ * `vendorProcessing` status and a message rather than launching the SDK.
180
+ *
181
+ * @param params - Optional parameters.
182
+ * @param params.locale - BCP-47 locale for the SDK UI.
183
+ * @param params.debug - Enables SDK debug logging.
184
+ * @returns The SDK result.
185
+ */
186
+ export type KycControllerStartSumSubAction = {
187
+ type: `KycController:startSumSub`;
188
+ handler: KycController['startSumSub'];
189
+ };
190
+ /**
191
+ * Refreshes the user-keyed simplified KYC status from `GET /kyc/status`,
192
+ * stores it on state, publishes {@link KycControllerStatusChangedEvent}, and
193
+ * schedules short-interval polling while the status is `pending`.
194
+ *
195
+ * @returns The latest status payload.
196
+ */
197
+ export type KycControllerRefreshKycStatusAction = {
198
+ type: `KycController:refreshKycStatus`;
199
+ handler: KycController['refreshKycStatus'];
200
+ };
201
+ /**
202
+ * Fetches the current UKYC session status for the active sub-flow and records
203
+ * it on state. Useful for a one-off refresh outside the automatic polling
204
+ * loop that {@link startSumSub} runs.
205
+ *
206
+ * @returns The fetched session status.
207
+ * @throws If there is no active SumSub session to query.
208
+ */
209
+ export type KycControllerGetSessionStatusAction = {
210
+ type: `KycController:getSessionStatus`;
211
+ handler: KycController['getSessionStatus'];
212
+ };
213
+ /**
214
+ * Resets the flow to idle, clearing session tokens and sub-flow state while
215
+ * preserving persisted terms acceptance and the per-product cache.
216
+ */
217
+ export type KycControllerResetAction = {
218
+ type: `KycController:reset`;
219
+ handler: KycController['reset'];
220
+ };
221
+ /**
222
+ * Restores the controller to its default state, discarding everything
223
+ * {@link reset} deliberately keeps: the session email, the persisted terms
224
+ * acceptance, the per-product KYC-required cache and the user-keyed status.
225
+ *
226
+ * Intended for a full wallet reset, where no trace of the previous
227
+ * customer may survive into the next wallet.
228
+ */
229
+ export type KycControllerClearStateAction = {
230
+ type: `KycController:clearState`;
231
+ handler: KycController['clearState'];
232
+ };
233
+ /**
234
+ * Union of all KycController action types.
235
+ */
236
+ export type KycControllerMethodActions = KycControllerInitializeAction | KycControllerCreateVendorCustomerAction | KycControllerLoadDisclaimersAction | KycControllerAcceptTermsAndStartSessionAction | KycControllerClearSavedTermsAction | KycControllerHandleFrameMessageAction | KycControllerBuildCheckFrameUrlAction | KycControllerBuildAuthFrameUrlAction | KycControllerBuildResetFrameUrlAction | KycControllerCheckKycRequiredAction | KycControllerGetKycStatusAction | KycControllerGetCustomerIdentityAction | KycControllerStartSumSubAction | KycControllerRefreshKycStatusAction | KycControllerGetSessionStatusAction | KycControllerResetAction | KycControllerClearStateAction;
237
+ //# sourceMappingURL=KycController-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KycController-method-action-types.d.cts","sourceRoot":"","sources":["../src/KycController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA2B;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,aAAa,CAAC,4BAA4B,CAAC,CAAC;CACtD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,6BAA6B,GAC7B,uCAAuC,GACvC,kCAAkC,GAClC,6CAA6C,GAC7C,kCAAkC,GAClC,qCAAqC,GACrC,qCAAqC,GACrC,oCAAoC,GACpC,qCAAqC,GACrC,mCAAmC,GACnC,+BAA+B,GAC/B,sCAAsC,GACtC,8BAA8B,GAC9B,mCAAmC,GACnC,mCAAmC,GACnC,wBAAwB,GACxB,6BAA6B,CAAC"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { KycController } from "./KycController.mjs";
6
+ /**
7
+ * Resolves persisted terms + geolocation, and auto-creates a session when
8
+ * terms are already accepted and an email is available.
9
+ *
10
+ * @param params - Optional parameters.
11
+ * @param params.email - The account email to associate with the session.
12
+ * @param params.product - The consuming feature the flow runs for. When
13
+ * provided, the controller automatically runs the KYC-required check once
14
+ * authentication completes (and chains into document verification when KYC
15
+ * is required). When omitted, the flow stops at `form` and the consumer must
16
+ * call `checkKycRequired` manually.
17
+ * @param params.vendor - Identity vendor for this flow. Non-MoonPay vendors
18
+ * skip Check/Auth frames and use the consents path. Defaults to `moonpay`.
19
+ */
20
+ export type KycControllerInitializeAction = {
21
+ type: `KycController:initialize`;
22
+ handler: KycController['initialize'];
23
+ };
24
+ /**
25
+ * Creates (or resumes) an empty-shell customer for the given identity
26
+ * vendor. Exposed so a consumer can ensure the customer exists before
27
+ * showing T&C screens independently of {@link initialize}.
28
+ *
29
+ * A call while a session flow is already in progress is a no-op — matching
30
+ * {@link initialize} — so a vendor switch cannot leave Check/Auth frames
31
+ * attached to the wrong vendor. Call {@link reset} first to start over.
32
+ *
33
+ * @param params - The parameters.
34
+ * @param params.vendor - Identity vendor for the customer.
35
+ * @param params.email - Email for the vendor customer.
36
+ */
37
+ export type KycControllerCreateVendorCustomerAction = {
38
+ type: `KycController:createVendorCustomer`;
39
+ handler: KycController['createVendorCustomer'];
40
+ };
41
+ /**
42
+ * Loads the disclaimers for the resolved (or provided) country.
43
+ *
44
+ * @param params - Optional parameters.
45
+ * @param params.country - ISO 3166-1 alpha-3 country code override.
46
+ */
47
+ export type KycControllerLoadDisclaimersAction = {
48
+ type: `KycController:loadDisclaimers`;
49
+ handler: KycController['loadDisclaimers'];
50
+ };
51
+ /**
52
+ * Captures terms acceptance for the currently loaded disclaimers and creates
53
+ * a session.
54
+ *
55
+ * @param params - The parameters.
56
+ * @param params.email - The account email to associate with the session.
57
+ * @param params.product - The consuming feature the flow runs for. See
58
+ * {@link initialize} for how the product drives the automatic post
59
+ * authentication continuation.
60
+ * @param params.sumsubTncSigned - Whether Sumsub T&C were accepted (T&C2).
61
+ * Required for every vendor so callers explicitly declare acceptance.
62
+ * @param params.idosTncSigned - Whether idOS T&C were accepted (T&C2).
63
+ * Required for every vendor so callers explicitly declare acceptance.
64
+ * @param params.credentialReusabilityConsentGiven - Whether the customer
65
+ * consented to reuse existing idOS credentials. Used when recording
66
+ * session-scoped disclaimers on the consents path. Defaults to `false`.
67
+ */
68
+ export type KycControllerAcceptTermsAndStartSessionAction = {
69
+ type: `KycController:acceptTermsAndStartSession`;
70
+ handler: KycController['acceptTermsAndStartSession'];
71
+ };
72
+ /**
73
+ * Clears the persisted terms acceptance.
74
+ */
75
+ export type KycControllerClearSavedTermsAction = {
76
+ type: `KycController:clearSavedTerms`;
77
+ handler: KycController['clearSavedTerms'];
78
+ };
79
+ /**
80
+ * Handles a message posted by a Check/Auth frame and advances the flow.
81
+ *
82
+ * The transport-agnostic caller (WebView on mobile, iframe on web) forwards
83
+ * the raw message and injects the returned `reply` back into the frame.
84
+ *
85
+ * @param params - The parameters.
86
+ * @param params.message - The raw message posted by the frame.
87
+ * @returns An object whose optional `reply` should be posted back.
88
+ */
89
+ export type KycControllerHandleFrameMessageAction = {
90
+ type: `KycController:handleFrameMessage`;
91
+ handler: KycController['handleFrameMessage'];
92
+ };
93
+ /**
94
+ * Builds the Check-frame URL, or `null` when no session exists yet.
95
+ *
96
+ * @returns The Check-frame URL or `null`.
97
+ */
98
+ export type KycControllerBuildCheckFrameUrlAction = {
99
+ type: `KycController:buildCheckFrameUrl`;
100
+ handler: KycController['buildCheckFrameUrl'];
101
+ };
102
+ /**
103
+ * Builds the Auth-frame URL, or `null` when no client token is available.
104
+ *
105
+ * @returns The Auth-frame URL or `null`.
106
+ */
107
+ export type KycControllerBuildAuthFrameUrlAction = {
108
+ type: `KycController:buildAuthFrameUrl`;
109
+ handler: KycController['buildAuthFrameUrl'];
110
+ };
111
+ /**
112
+ * Builds the Reset-frame URL.
113
+ *
114
+ * @returns The Reset-frame URL.
115
+ */
116
+ export type KycControllerBuildResetFrameUrlAction = {
117
+ type: `KycController:buildResetFrameUrl`;
118
+ handler: KycController['buildResetFrameUrl'];
119
+ };
120
+ /**
121
+ * Checks whether KYC is required for a product and caches the result.
122
+ *
123
+ * @param params - The parameters.
124
+ * @param params.product - The consuming feature.
125
+ * @param params.country - Optional alpha-3 country override.
126
+ * @returns Whether KYC is required.
127
+ */
128
+ export type KycControllerCheckKycRequiredAction = {
129
+ type: `KycController:checkKycRequired`;
130
+ handler: KycController['checkKycRequired'];
131
+ };
132
+ /**
133
+ * Reads the cached "is KYC required" result for a product.
134
+ *
135
+ * @param params - The parameters.
136
+ * @param params.product - The consuming feature.
137
+ * @returns The cached value, or `undefined` if not yet checked.
138
+ */
139
+ export type KycControllerGetKycStatusAction = {
140
+ type: `KycController:getKycStatus`;
141
+ handler: KycController['getKycStatus'];
142
+ };
143
+ /**
144
+ * Returns the vendor-scoped identity for the currently authenticated
145
+ * customer, or `null` when the flow has not yet captured a vendor customer
146
+ * id (before authentication or after {@link reset}), or when a MoonPay id
147
+ * is present under a different `activeVendor`.
148
+ *
149
+ * Exposed so consumers (e.g. ramps autoramp creation) can attach the vendor
150
+ * customer id to downstream calls without reading the full KYC state, which
151
+ * also holds session/access tokens. The id is session-scoped and never
152
+ * persisted.
153
+ *
154
+ * @returns The current {@link KycCustomerIdentity}, or `null`.
155
+ */
156
+ export type KycControllerGetCustomerIdentityAction = {
157
+ type: `KycController:getCustomerIdentity`;
158
+ handler: KycController['getCustomerIdentity'];
159
+ };
160
+ /**
161
+ * Runs the SumSub document-verification sub-flow end to end:
162
+ *
163
+ * 1. creates a UKYC session, receiving per-secret encryption schemas;
164
+ * 2. verifies each schema's `jwtChain` against the Fractal JWKS and confirms
165
+ * the attested session server public key;
166
+ * 3. derives the `data_encryption_key` from the wallet's UKYC
167
+ * `local_user_secret` and wraps it for the session server;
168
+ * 4. mints a client-signed, read-only `ukyc_capability_token`, wraps it the
169
+ * same way as the encryption key, and submits both via authorizations;
170
+ * 5. fetches the SumSub applicant access token; and
171
+ * 6. presents the SDK via the injected launcher.
172
+ *
173
+ * If a UKYC session already exists (the consents path creates it before
174
+ * recording session disclaimers), steps 1–4 are skipped.
175
+ *
176
+ * If authorizations report the applicant is already approved on the relay
177
+ * while the vendor is still finalizing (`kycStatus: approved`,
178
+ * `finalStatus: pending`), the sub-flow stops at step 4 with a
179
+ * `vendorProcessing` status and a message rather than launching the SDK.
180
+ *
181
+ * @param params - Optional parameters.
182
+ * @param params.locale - BCP-47 locale for the SDK UI.
183
+ * @param params.debug - Enables SDK debug logging.
184
+ * @returns The SDK result.
185
+ */
186
+ export type KycControllerStartSumSubAction = {
187
+ type: `KycController:startSumSub`;
188
+ handler: KycController['startSumSub'];
189
+ };
190
+ /**
191
+ * Refreshes the user-keyed simplified KYC status from `GET /kyc/status`,
192
+ * stores it on state, publishes {@link KycControllerStatusChangedEvent}, and
193
+ * schedules short-interval polling while the status is `pending`.
194
+ *
195
+ * @returns The latest status payload.
196
+ */
197
+ export type KycControllerRefreshKycStatusAction = {
198
+ type: `KycController:refreshKycStatus`;
199
+ handler: KycController['refreshKycStatus'];
200
+ };
201
+ /**
202
+ * Fetches the current UKYC session status for the active sub-flow and records
203
+ * it on state. Useful for a one-off refresh outside the automatic polling
204
+ * loop that {@link startSumSub} runs.
205
+ *
206
+ * @returns The fetched session status.
207
+ * @throws If there is no active SumSub session to query.
208
+ */
209
+ export type KycControllerGetSessionStatusAction = {
210
+ type: `KycController:getSessionStatus`;
211
+ handler: KycController['getSessionStatus'];
212
+ };
213
+ /**
214
+ * Resets the flow to idle, clearing session tokens and sub-flow state while
215
+ * preserving persisted terms acceptance and the per-product cache.
216
+ */
217
+ export type KycControllerResetAction = {
218
+ type: `KycController:reset`;
219
+ handler: KycController['reset'];
220
+ };
221
+ /**
222
+ * Restores the controller to its default state, discarding everything
223
+ * {@link reset} deliberately keeps: the session email, the persisted terms
224
+ * acceptance, the per-product KYC-required cache and the user-keyed status.
225
+ *
226
+ * Intended for a full wallet reset, where no trace of the previous
227
+ * customer may survive into the next wallet.
228
+ */
229
+ export type KycControllerClearStateAction = {
230
+ type: `KycController:clearState`;
231
+ handler: KycController['clearState'];
232
+ };
233
+ /**
234
+ * Union of all KycController action types.
235
+ */
236
+ export type KycControllerMethodActions = KycControllerInitializeAction | KycControllerCreateVendorCustomerAction | KycControllerLoadDisclaimersAction | KycControllerAcceptTermsAndStartSessionAction | KycControllerClearSavedTermsAction | KycControllerHandleFrameMessageAction | KycControllerBuildCheckFrameUrlAction | KycControllerBuildAuthFrameUrlAction | KycControllerBuildResetFrameUrlAction | KycControllerCheckKycRequiredAction | KycControllerGetKycStatusAction | KycControllerGetCustomerIdentityAction | KycControllerStartSumSubAction | KycControllerRefreshKycStatusAction | KycControllerGetSessionStatusAction | KycControllerResetAction | KycControllerClearStateAction;
237
+ //# sourceMappingURL=KycController-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KycController-method-action-types.d.mts","sourceRoot":"","sources":["../src/KycController-method-action-types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=KycController-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KycController-method-action-types.mjs","sourceRoot":"","sources":["../src/KycController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { KycController } from './KycController.js';\n\n/**\n * Resolves persisted terms + geolocation, and auto-creates a session when\n * terms are already accepted and an email is available.\n *\n * @param params - Optional parameters.\n * @param params.email - The account email to associate with the session.\n * @param params.product - The consuming feature the flow runs for. When\n * provided, the controller automatically runs the KYC-required check once\n * authentication completes (and chains into document verification when KYC\n * is required). When omitted, the flow stops at `form` and the consumer must\n * call `checkKycRequired` manually.\n * @param params.vendor - Identity vendor for this flow. Non-MoonPay vendors\n * skip Check/Auth frames and use the consents path. Defaults to `moonpay`.\n */\nexport type KycControllerInitializeAction = {\n type: `KycController:initialize`;\n handler: KycController['initialize'];\n};\n\n/**\n * Creates (or resumes) an empty-shell customer for the given identity\n * vendor. Exposed so a consumer can ensure the customer exists before\n * showing T&C screens independently of {@link initialize}.\n *\n * A call while a session flow is already in progress is a no-op — matching\n * {@link initialize} — so a vendor switch cannot leave Check/Auth frames\n * attached to the wrong vendor. Call {@link reset} first to start over.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor for the customer.\n * @param params.email - Email for the vendor customer.\n */\nexport type KycControllerCreateVendorCustomerAction = {\n type: `KycController:createVendorCustomer`;\n handler: KycController['createVendorCustomer'];\n};\n\n/**\n * Loads the disclaimers for the resolved (or provided) country.\n *\n * @param params - Optional parameters.\n * @param params.country - ISO 3166-1 alpha-3 country code override.\n */\nexport type KycControllerLoadDisclaimersAction = {\n type: `KycController:loadDisclaimers`;\n handler: KycController['loadDisclaimers'];\n};\n\n/**\n * Captures terms acceptance for the currently loaded disclaimers and creates\n * a session.\n *\n * @param params - The parameters.\n * @param params.email - The account email to associate with the session.\n * @param params.product - The consuming feature the flow runs for. See\n * {@link initialize} for how the product drives the automatic post\n * authentication continuation.\n * @param params.sumsubTncSigned - Whether Sumsub T&C were accepted (T&C2).\n * Required for every vendor so callers explicitly declare acceptance.\n * @param params.idosTncSigned - Whether idOS T&C were accepted (T&C2).\n * Required for every vendor so callers explicitly declare acceptance.\n * @param params.credentialReusabilityConsentGiven - Whether the customer\n * consented to reuse existing idOS credentials. Used when recording\n * session-scoped disclaimers on the consents path. Defaults to `false`.\n */\nexport type KycControllerAcceptTermsAndStartSessionAction = {\n type: `KycController:acceptTermsAndStartSession`;\n handler: KycController['acceptTermsAndStartSession'];\n};\n\n/**\n * Clears the persisted terms acceptance.\n */\nexport type KycControllerClearSavedTermsAction = {\n type: `KycController:clearSavedTerms`;\n handler: KycController['clearSavedTerms'];\n};\n\n/**\n * Handles a message posted by a Check/Auth frame and advances the flow.\n *\n * The transport-agnostic caller (WebView on mobile, iframe on web) forwards\n * the raw message and injects the returned `reply` back into the frame.\n *\n * @param params - The parameters.\n * @param params.message - The raw message posted by the frame.\n * @returns An object whose optional `reply` should be posted back.\n */\nexport type KycControllerHandleFrameMessageAction = {\n type: `KycController:handleFrameMessage`;\n handler: KycController['handleFrameMessage'];\n};\n\n/**\n * Builds the Check-frame URL, or `null` when no session exists yet.\n *\n * @returns The Check-frame URL or `null`.\n */\nexport type KycControllerBuildCheckFrameUrlAction = {\n type: `KycController:buildCheckFrameUrl`;\n handler: KycController['buildCheckFrameUrl'];\n};\n\n/**\n * Builds the Auth-frame URL, or `null` when no client token is available.\n *\n * @returns The Auth-frame URL or `null`.\n */\nexport type KycControllerBuildAuthFrameUrlAction = {\n type: `KycController:buildAuthFrameUrl`;\n handler: KycController['buildAuthFrameUrl'];\n};\n\n/**\n * Builds the Reset-frame URL.\n *\n * @returns The Reset-frame URL.\n */\nexport type KycControllerBuildResetFrameUrlAction = {\n type: `KycController:buildResetFrameUrl`;\n handler: KycController['buildResetFrameUrl'];\n};\n\n/**\n * Checks whether KYC is required for a product and caches the result.\n *\n * @param params - The parameters.\n * @param params.product - The consuming feature.\n * @param params.country - Optional alpha-3 country override.\n * @returns Whether KYC is required.\n */\nexport type KycControllerCheckKycRequiredAction = {\n type: `KycController:checkKycRequired`;\n handler: KycController['checkKycRequired'];\n};\n\n/**\n * Reads the cached \"is KYC required\" result for a product.\n *\n * @param params - The parameters.\n * @param params.product - The consuming feature.\n * @returns The cached value, or `undefined` if not yet checked.\n */\nexport type KycControllerGetKycStatusAction = {\n type: `KycController:getKycStatus`;\n handler: KycController['getKycStatus'];\n};\n\n/**\n * Returns the vendor-scoped identity for the currently authenticated\n * customer, or `null` when the flow has not yet captured a vendor customer\n * id (before authentication or after {@link reset}), or when a MoonPay id\n * is present under a different `activeVendor`.\n *\n * Exposed so consumers (e.g. ramps autoramp creation) can attach the vendor\n * customer id to downstream calls without reading the full KYC state, which\n * also holds session/access tokens. The id is session-scoped and never\n * persisted.\n *\n * @returns The current {@link KycCustomerIdentity}, or `null`.\n */\nexport type KycControllerGetCustomerIdentityAction = {\n type: `KycController:getCustomerIdentity`;\n handler: KycController['getCustomerIdentity'];\n};\n\n/**\n * Runs the SumSub document-verification sub-flow end to end:\n *\n * 1. creates a UKYC session, receiving per-secret encryption schemas;\n * 2. verifies each schema's `jwtChain` against the Fractal JWKS and confirms\n * the attested session server public key;\n * 3. derives the `data_encryption_key` from the wallet's UKYC\n * `local_user_secret` and wraps it for the session server;\n * 4. mints a client-signed, read-only `ukyc_capability_token`, wraps it the\n * same way as the encryption key, and submits both via authorizations;\n * 5. fetches the SumSub applicant access token; and\n * 6. presents the SDK via the injected launcher.\n *\n * If a UKYC session already exists (the consents path creates it before\n * recording session disclaimers), steps 1–4 are skipped.\n *\n * If authorizations report the applicant is already approved on the relay\n * while the vendor is still finalizing (`kycStatus: approved`,\n * `finalStatus: pending`), the sub-flow stops at step 4 with a\n * `vendorProcessing` status and a message rather than launching the SDK.\n *\n * @param params - Optional parameters.\n * @param params.locale - BCP-47 locale for the SDK UI.\n * @param params.debug - Enables SDK debug logging.\n * @returns The SDK result.\n */\nexport type KycControllerStartSumSubAction = {\n type: `KycController:startSumSub`;\n handler: KycController['startSumSub'];\n};\n\n/**\n * Refreshes the user-keyed simplified KYC status from `GET /kyc/status`,\n * stores it on state, publishes {@link KycControllerStatusChangedEvent}, and\n * schedules short-interval polling while the status is `pending`.\n *\n * @returns The latest status payload.\n */\nexport type KycControllerRefreshKycStatusAction = {\n type: `KycController:refreshKycStatus`;\n handler: KycController['refreshKycStatus'];\n};\n\n/**\n * Fetches the current UKYC session status for the active sub-flow and records\n * it on state. Useful for a one-off refresh outside the automatic polling\n * loop that {@link startSumSub} runs.\n *\n * @returns The fetched session status.\n * @throws If there is no active SumSub session to query.\n */\nexport type KycControllerGetSessionStatusAction = {\n type: `KycController:getSessionStatus`;\n handler: KycController['getSessionStatus'];\n};\n\n/**\n * Resets the flow to idle, clearing session tokens and sub-flow state while\n * preserving persisted terms acceptance and the per-product cache.\n */\nexport type KycControllerResetAction = {\n type: `KycController:reset`;\n handler: KycController['reset'];\n};\n\n/**\n * Restores the controller to its default state, discarding everything\n * {@link reset} deliberately keeps: the session email, the persisted terms\n * acceptance, the per-product KYC-required cache and the user-keyed status.\n *\n * Intended for a full wallet reset, where no trace of the previous\n * customer may survive into the next wallet.\n */\nexport type KycControllerClearStateAction = {\n type: `KycController:clearState`;\n handler: KycController['clearState'];\n};\n\n/**\n * Union of all KycController action types.\n */\nexport type KycControllerMethodActions =\n | KycControllerInitializeAction\n | KycControllerCreateVendorCustomerAction\n | KycControllerLoadDisclaimersAction\n | KycControllerAcceptTermsAndStartSessionAction\n | KycControllerClearSavedTermsAction\n | KycControllerHandleFrameMessageAction\n | KycControllerBuildCheckFrameUrlAction\n | KycControllerBuildAuthFrameUrlAction\n | KycControllerBuildResetFrameUrlAction\n | KycControllerCheckKycRequiredAction\n | KycControllerGetKycStatusAction\n | KycControllerGetCustomerIdentityAction\n | KycControllerStartSumSubAction\n | KycControllerRefreshKycStatusAction\n | KycControllerGetSessionStatusAction\n | KycControllerResetAction\n | KycControllerClearStateAction;\n"]}