@metamask-previews/kyc-controller 0.0.0-preview-823dcff → 0.0.0-preview-e57e5c3dc

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 +8 -0
  2. package/README.md +10 -2
  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 +168 -0
  6. package/dist/KycController-method-action-types.d.cts.map +1 -0
  7. package/dist/KycController-method-action-types.d.mts +168 -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 +1085 -0
  12. package/dist/KycController.cjs.map +1 -0
  13. package/dist/KycController.d.cts +255 -0
  14. package/dist/KycController.d.cts.map +1 -0
  15. package/dist/KycController.d.mts +255 -0
  16. package/dist/KycController.d.mts.map +1 -0
  17. package/dist/KycController.mjs +1080 -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 +121 -0
  22. package/dist/KycService-method-action-types.d.cts.map +1 -0
  23. package/dist/KycService-method-action-types.d.mts +121 -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 +417 -0
  28. package/dist/KycService.cjs.map +1 -0
  29. package/dist/KycService.d.cts +307 -0
  30. package/dist/KycService.d.cts.map +1 -0
  31. package/dist/KycService.d.mts +307 -0
  32. package/dist/KycService.d.mts.map +1 -0
  33. package/dist/KycService.mjs +413 -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 +124 -0
  78. package/dist/types.d.cts.map +1 -0
  79. package/dist/types.d.mts +124 -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 +28 -0
  132. package/dist/ukyc/wrapEncryptionKey.cjs.map +1 -0
  133. package/dist/ukyc/wrapEncryptionKey.d.cts +34 -0
  134. package/dist/ukyc/wrapEncryptionKey.d.cts.map +1 -0
  135. package/dist/ukyc/wrapEncryptionKey.d.mts +34 -0
  136. package/dist/ukyc/wrapEncryptionKey.d.mts.map +1 -0
  137. package/dist/ukyc/wrapEncryptionKey.mjs +25 -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
@@ -10,5 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
  ### Added
11
11
 
12
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))
13
+ - Add `KycController` and `KycService` for managing KYC / identity verification state across MetaMask clients ([#9615](https://github.com/MetaMask/core/pull/9615))
14
+ - `KycController` (`BaseController`) owns the flow state machine, the Check/Auth frame message protocol, X25519 credential decryption, and SumSub orchestration via an injected `KycSumSubLauncher` adapter.
15
+ - `KycService` extends `BaseDataService` and performs the Universal KYC (UKYC) HTTP calls via an injected `fetch`, sourcing the auth bearer token and geolocation through the messenger.
16
+ - Exposes a vendor-neutral, per-product surface (`ramps`, `card`) plus reselect selectors.
17
+ - Add automatic post-authentication continuation to `KycController`
18
+ - Add optional `baseUrl` option to `KycService` constructor that overrides the base URL derived from `env`, enabling clients to target a custom (e.g. local or staging) KYC API
19
+ - Add UKYC session-status polling to `KycController`
20
+ - Add handling in `KycController.startSumSub` for applicants already being processed by the vendor
13
21
 
14
22
  [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
- This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
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 */\nexport type KycControllerInitializeAction = {\n type: `KycController:initialize`;\n handler: KycController['initialize'];\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 - 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. See\n * {@link initialize} for how the product drives the automatic post\n * authentication continuation.\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 * Runs the SumSub document-verification sub-flow end to end:\n *\n * 1. requests a per-session wrapping key from the UKYC backend;\n * 2. verifies its `jwtChain` against the Fractal JWKS and confirms the\n * 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` and creates\n * the UKYC session (handing over the wrapped key and the token);\n * 5. fetches the SumSub applicant access token; and\n * 6. presents the SDK via the injected launcher.\n *\n * If session creation reports 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 * 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 * Union of all KycController action types.\n */\nexport type KycControllerMethodActions =\n | KycControllerInitializeAction\n | KycControllerLoadDisclaimersAction\n | KycControllerAcceptTermsAndStartSessionAction\n | KycControllerClearSavedTermsAction\n | KycControllerHandleFrameMessageAction\n | KycControllerBuildCheckFrameUrlAction\n | KycControllerBuildAuthFrameUrlAction\n | KycControllerBuildResetFrameUrlAction\n | KycControllerCheckKycRequiredAction\n | KycControllerGetKycStatusAction\n | KycControllerStartSumSubAction\n | KycControllerGetSessionStatusAction\n | KycControllerResetAction;\n"]}
@@ -0,0 +1,168 @@
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
+ */
18
+ export type KycControllerInitializeAction = {
19
+ type: `KycController:initialize`;
20
+ handler: KycController['initialize'];
21
+ };
22
+ /**
23
+ * Loads the disclaimers for the resolved (or provided) country.
24
+ *
25
+ * @param params - Optional parameters.
26
+ * @param params.country - ISO 3166-1 alpha-3 country code override.
27
+ */
28
+ export type KycControllerLoadDisclaimersAction = {
29
+ type: `KycController:loadDisclaimers`;
30
+ handler: KycController['loadDisclaimers'];
31
+ };
32
+ /**
33
+ * Captures terms acceptance for the currently loaded disclaimers and creates
34
+ * a session.
35
+ *
36
+ * @param params - Optional parameters.
37
+ * @param params.email - The account email to associate with the session.
38
+ * @param params.product - The consuming feature the flow runs for. See
39
+ * {@link initialize} for how the product drives the automatic post
40
+ * authentication continuation.
41
+ */
42
+ export type KycControllerAcceptTermsAndStartSessionAction = {
43
+ type: `KycController:acceptTermsAndStartSession`;
44
+ handler: KycController['acceptTermsAndStartSession'];
45
+ };
46
+ /**
47
+ * Clears the persisted terms acceptance.
48
+ */
49
+ export type KycControllerClearSavedTermsAction = {
50
+ type: `KycController:clearSavedTerms`;
51
+ handler: KycController['clearSavedTerms'];
52
+ };
53
+ /**
54
+ * Handles a message posted by a Check/Auth frame and advances the flow.
55
+ *
56
+ * The transport-agnostic caller (WebView on mobile, iframe on web) forwards
57
+ * the raw message and injects the returned `reply` back into the frame.
58
+ *
59
+ * @param params - The parameters.
60
+ * @param params.message - The raw message posted by the frame.
61
+ * @returns An object whose optional `reply` should be posted back.
62
+ */
63
+ export type KycControllerHandleFrameMessageAction = {
64
+ type: `KycController:handleFrameMessage`;
65
+ handler: KycController['handleFrameMessage'];
66
+ };
67
+ /**
68
+ * Builds the Check-frame URL, or `null` when no session exists yet.
69
+ *
70
+ * @returns The Check-frame URL or `null`.
71
+ */
72
+ export type KycControllerBuildCheckFrameUrlAction = {
73
+ type: `KycController:buildCheckFrameUrl`;
74
+ handler: KycController['buildCheckFrameUrl'];
75
+ };
76
+ /**
77
+ * Builds the Auth-frame URL, or `null` when no client token is available.
78
+ *
79
+ * @returns The Auth-frame URL or `null`.
80
+ */
81
+ export type KycControllerBuildAuthFrameUrlAction = {
82
+ type: `KycController:buildAuthFrameUrl`;
83
+ handler: KycController['buildAuthFrameUrl'];
84
+ };
85
+ /**
86
+ * Builds the Reset-frame URL.
87
+ *
88
+ * @returns The Reset-frame URL.
89
+ */
90
+ export type KycControllerBuildResetFrameUrlAction = {
91
+ type: `KycController:buildResetFrameUrl`;
92
+ handler: KycController['buildResetFrameUrl'];
93
+ };
94
+ /**
95
+ * Checks whether KYC is required for a product and caches the result.
96
+ *
97
+ * @param params - The parameters.
98
+ * @param params.product - The consuming feature.
99
+ * @param params.country - Optional alpha-3 country override.
100
+ * @returns Whether KYC is required.
101
+ */
102
+ export type KycControllerCheckKycRequiredAction = {
103
+ type: `KycController:checkKycRequired`;
104
+ handler: KycController['checkKycRequired'];
105
+ };
106
+ /**
107
+ * Reads the cached "is KYC required" result for a product.
108
+ *
109
+ * @param params - The parameters.
110
+ * @param params.product - The consuming feature.
111
+ * @returns The cached value, or `undefined` if not yet checked.
112
+ */
113
+ export type KycControllerGetKycStatusAction = {
114
+ type: `KycController:getKycStatus`;
115
+ handler: KycController['getKycStatus'];
116
+ };
117
+ /**
118
+ * Runs the SumSub document-verification sub-flow end to end:
119
+ *
120
+ * 1. requests a per-session wrapping key from the UKYC backend;
121
+ * 2. verifies its `jwtChain` against the Fractal JWKS and confirms the
122
+ * attested session server public key;
123
+ * 3. derives the `data_encryption_key` from the wallet's UKYC
124
+ * `local_user_secret` and wraps it for the session server;
125
+ * 4. mints a client-signed, read-only `ukyc_capability_token` and creates
126
+ * the UKYC session (handing over the wrapped key and the token);
127
+ * 5. fetches the SumSub applicant access token; and
128
+ * 6. presents the SDK via the injected launcher.
129
+ *
130
+ * If session creation reports the applicant is already approved on the relay
131
+ * while the vendor is still finalizing (`kycStatus: approved`,
132
+ * `finalStatus: pending`), the sub-flow stops at step 4 with a
133
+ * `vendorProcessing` status and a message rather than launching the SDK.
134
+ *
135
+ * @param params - Optional parameters.
136
+ * @param params.locale - BCP-47 locale for the SDK UI.
137
+ * @param params.debug - Enables SDK debug logging.
138
+ * @returns The SDK result.
139
+ */
140
+ export type KycControllerStartSumSubAction = {
141
+ type: `KycController:startSumSub`;
142
+ handler: KycController['startSumSub'];
143
+ };
144
+ /**
145
+ * Fetches the current UKYC session status for the active sub-flow and records
146
+ * it on state. Useful for a one-off refresh outside the automatic polling
147
+ * loop that {@link startSumSub} runs.
148
+ *
149
+ * @returns The fetched session status.
150
+ * @throws If there is no active SumSub session to query.
151
+ */
152
+ export type KycControllerGetSessionStatusAction = {
153
+ type: `KycController:getSessionStatus`;
154
+ handler: KycController['getSessionStatus'];
155
+ };
156
+ /**
157
+ * Resets the flow to idle, clearing session tokens and sub-flow state while
158
+ * preserving persisted terms acceptance and the per-product cache.
159
+ */
160
+ export type KycControllerResetAction = {
161
+ type: `KycController:reset`;
162
+ handler: KycController['reset'];
163
+ };
164
+ /**
165
+ * Union of all KycController action types.
166
+ */
167
+ export type KycControllerMethodActions = KycControllerInitializeAction | KycControllerLoadDisclaimersAction | KycControllerAcceptTermsAndStartSessionAction | KycControllerClearSavedTermsAction | KycControllerHandleFrameMessageAction | KycControllerBuildCheckFrameUrlAction | KycControllerBuildAuthFrameUrlAction | KycControllerBuildResetFrameUrlAction | KycControllerCheckKycRequiredAction | KycControllerGetKycStatusAction | KycControllerStartSumSubAction | KycControllerGetSessionStatusAction | KycControllerResetAction;
168
+ //# 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;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACtC,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;;;;;;;;;GASG;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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACvC,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;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,6BAA6B,GAC7B,kCAAkC,GAClC,6CAA6C,GAC7C,kCAAkC,GAClC,qCAAqC,GACrC,qCAAqC,GACrC,oCAAoC,GACpC,qCAAqC,GACrC,mCAAmC,GACnC,+BAA+B,GAC/B,8BAA8B,GAC9B,mCAAmC,GACnC,wBAAwB,CAAC"}
@@ -0,0 +1,168 @@
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
+ */
18
+ export type KycControllerInitializeAction = {
19
+ type: `KycController:initialize`;
20
+ handler: KycController['initialize'];
21
+ };
22
+ /**
23
+ * Loads the disclaimers for the resolved (or provided) country.
24
+ *
25
+ * @param params - Optional parameters.
26
+ * @param params.country - ISO 3166-1 alpha-3 country code override.
27
+ */
28
+ export type KycControllerLoadDisclaimersAction = {
29
+ type: `KycController:loadDisclaimers`;
30
+ handler: KycController['loadDisclaimers'];
31
+ };
32
+ /**
33
+ * Captures terms acceptance for the currently loaded disclaimers and creates
34
+ * a session.
35
+ *
36
+ * @param params - Optional parameters.
37
+ * @param params.email - The account email to associate with the session.
38
+ * @param params.product - The consuming feature the flow runs for. See
39
+ * {@link initialize} for how the product drives the automatic post
40
+ * authentication continuation.
41
+ */
42
+ export type KycControllerAcceptTermsAndStartSessionAction = {
43
+ type: `KycController:acceptTermsAndStartSession`;
44
+ handler: KycController['acceptTermsAndStartSession'];
45
+ };
46
+ /**
47
+ * Clears the persisted terms acceptance.
48
+ */
49
+ export type KycControllerClearSavedTermsAction = {
50
+ type: `KycController:clearSavedTerms`;
51
+ handler: KycController['clearSavedTerms'];
52
+ };
53
+ /**
54
+ * Handles a message posted by a Check/Auth frame and advances the flow.
55
+ *
56
+ * The transport-agnostic caller (WebView on mobile, iframe on web) forwards
57
+ * the raw message and injects the returned `reply` back into the frame.
58
+ *
59
+ * @param params - The parameters.
60
+ * @param params.message - The raw message posted by the frame.
61
+ * @returns An object whose optional `reply` should be posted back.
62
+ */
63
+ export type KycControllerHandleFrameMessageAction = {
64
+ type: `KycController:handleFrameMessage`;
65
+ handler: KycController['handleFrameMessage'];
66
+ };
67
+ /**
68
+ * Builds the Check-frame URL, or `null` when no session exists yet.
69
+ *
70
+ * @returns The Check-frame URL or `null`.
71
+ */
72
+ export type KycControllerBuildCheckFrameUrlAction = {
73
+ type: `KycController:buildCheckFrameUrl`;
74
+ handler: KycController['buildCheckFrameUrl'];
75
+ };
76
+ /**
77
+ * Builds the Auth-frame URL, or `null` when no client token is available.
78
+ *
79
+ * @returns The Auth-frame URL or `null`.
80
+ */
81
+ export type KycControllerBuildAuthFrameUrlAction = {
82
+ type: `KycController:buildAuthFrameUrl`;
83
+ handler: KycController['buildAuthFrameUrl'];
84
+ };
85
+ /**
86
+ * Builds the Reset-frame URL.
87
+ *
88
+ * @returns The Reset-frame URL.
89
+ */
90
+ export type KycControllerBuildResetFrameUrlAction = {
91
+ type: `KycController:buildResetFrameUrl`;
92
+ handler: KycController['buildResetFrameUrl'];
93
+ };
94
+ /**
95
+ * Checks whether KYC is required for a product and caches the result.
96
+ *
97
+ * @param params - The parameters.
98
+ * @param params.product - The consuming feature.
99
+ * @param params.country - Optional alpha-3 country override.
100
+ * @returns Whether KYC is required.
101
+ */
102
+ export type KycControllerCheckKycRequiredAction = {
103
+ type: `KycController:checkKycRequired`;
104
+ handler: KycController['checkKycRequired'];
105
+ };
106
+ /**
107
+ * Reads the cached "is KYC required" result for a product.
108
+ *
109
+ * @param params - The parameters.
110
+ * @param params.product - The consuming feature.
111
+ * @returns The cached value, or `undefined` if not yet checked.
112
+ */
113
+ export type KycControllerGetKycStatusAction = {
114
+ type: `KycController:getKycStatus`;
115
+ handler: KycController['getKycStatus'];
116
+ };
117
+ /**
118
+ * Runs the SumSub document-verification sub-flow end to end:
119
+ *
120
+ * 1. requests a per-session wrapping key from the UKYC backend;
121
+ * 2. verifies its `jwtChain` against the Fractal JWKS and confirms the
122
+ * attested session server public key;
123
+ * 3. derives the `data_encryption_key` from the wallet's UKYC
124
+ * `local_user_secret` and wraps it for the session server;
125
+ * 4. mints a client-signed, read-only `ukyc_capability_token` and creates
126
+ * the UKYC session (handing over the wrapped key and the token);
127
+ * 5. fetches the SumSub applicant access token; and
128
+ * 6. presents the SDK via the injected launcher.
129
+ *
130
+ * If session creation reports the applicant is already approved on the relay
131
+ * while the vendor is still finalizing (`kycStatus: approved`,
132
+ * `finalStatus: pending`), the sub-flow stops at step 4 with a
133
+ * `vendorProcessing` status and a message rather than launching the SDK.
134
+ *
135
+ * @param params - Optional parameters.
136
+ * @param params.locale - BCP-47 locale for the SDK UI.
137
+ * @param params.debug - Enables SDK debug logging.
138
+ * @returns The SDK result.
139
+ */
140
+ export type KycControllerStartSumSubAction = {
141
+ type: `KycController:startSumSub`;
142
+ handler: KycController['startSumSub'];
143
+ };
144
+ /**
145
+ * Fetches the current UKYC session status for the active sub-flow and records
146
+ * it on state. Useful for a one-off refresh outside the automatic polling
147
+ * loop that {@link startSumSub} runs.
148
+ *
149
+ * @returns The fetched session status.
150
+ * @throws If there is no active SumSub session to query.
151
+ */
152
+ export type KycControllerGetSessionStatusAction = {
153
+ type: `KycController:getSessionStatus`;
154
+ handler: KycController['getSessionStatus'];
155
+ };
156
+ /**
157
+ * Resets the flow to idle, clearing session tokens and sub-flow state while
158
+ * preserving persisted terms acceptance and the per-product cache.
159
+ */
160
+ export type KycControllerResetAction = {
161
+ type: `KycController:reset`;
162
+ handler: KycController['reset'];
163
+ };
164
+ /**
165
+ * Union of all KycController action types.
166
+ */
167
+ export type KycControllerMethodActions = KycControllerInitializeAction | KycControllerLoadDisclaimersAction | KycControllerAcceptTermsAndStartSessionAction | KycControllerClearSavedTermsAction | KycControllerHandleFrameMessageAction | KycControllerBuildCheckFrameUrlAction | KycControllerBuildAuthFrameUrlAction | KycControllerBuildResetFrameUrlAction | KycControllerCheckKycRequiredAction | KycControllerGetKycStatusAction | KycControllerStartSumSubAction | KycControllerGetSessionStatusAction | KycControllerResetAction;
168
+ //# 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":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA2B;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACtC,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;;;;;;;;;GASG;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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACvC,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;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,6BAA6B,GAC7B,kCAAkC,GAClC,6CAA6C,GAC7C,kCAAkC,GAClC,qCAAqC,GACrC,qCAAqC,GACrC,oCAAoC,GACpC,qCAAqC,GACrC,mCAAmC,GACnC,+BAA+B,GAC/B,8BAA8B,GAC9B,mCAAmC,GACnC,wBAAwB,CAAC"}
@@ -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 */\nexport type KycControllerInitializeAction = {\n type: `KycController:initialize`;\n handler: KycController['initialize'];\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 - 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. See\n * {@link initialize} for how the product drives the automatic post\n * authentication continuation.\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 * Runs the SumSub document-verification sub-flow end to end:\n *\n * 1. requests a per-session wrapping key from the UKYC backend;\n * 2. verifies its `jwtChain` against the Fractal JWKS and confirms the\n * 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` and creates\n * the UKYC session (handing over the wrapped key and the token);\n * 5. fetches the SumSub applicant access token; and\n * 6. presents the SDK via the injected launcher.\n *\n * If session creation reports 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 * 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 * Union of all KycController action types.\n */\nexport type KycControllerMethodActions =\n | KycControllerInitializeAction\n | KycControllerLoadDisclaimersAction\n | KycControllerAcceptTermsAndStartSessionAction\n | KycControllerClearSavedTermsAction\n | KycControllerHandleFrameMessageAction\n | KycControllerBuildCheckFrameUrlAction\n | KycControllerBuildAuthFrameUrlAction\n | KycControllerBuildResetFrameUrlAction\n | KycControllerCheckKycRequiredAction\n | KycControllerGetKycStatusAction\n | KycControllerStartSumSubAction\n | KycControllerGetSessionStatusAction\n | KycControllerResetAction;\n"]}