@metamask-previews/kyc-controller 0.0.0-preview-e57e5c3dc → 0.0.0-preview-c449b8da8

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 +0 -8
  2. package/README.md +2 -10
  3. package/dist/index.cjs +10 -34
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +7 -18
  6. package/dist/index.d.cts.map +1 -1
  7. package/dist/index.d.mts +7 -18
  8. package/dist/index.d.mts.map +1 -1
  9. package/dist/index.mjs +9 -11
  10. package/dist/index.mjs.map +1 -1
  11. package/package.json +3 -24
  12. package/dist/KycController-method-action-types.cjs +0 -7
  13. package/dist/KycController-method-action-types.cjs.map +0 -1
  14. package/dist/KycController-method-action-types.d.cts +0 -168
  15. package/dist/KycController-method-action-types.d.cts.map +0 -1
  16. package/dist/KycController-method-action-types.d.mts +0 -168
  17. package/dist/KycController-method-action-types.d.mts.map +0 -1
  18. package/dist/KycController-method-action-types.mjs +0 -6
  19. package/dist/KycController-method-action-types.mjs.map +0 -1
  20. package/dist/KycController.cjs +0 -1085
  21. package/dist/KycController.cjs.map +0 -1
  22. package/dist/KycController.d.cts +0 -255
  23. package/dist/KycController.d.cts.map +0 -1
  24. package/dist/KycController.d.mts +0 -255
  25. package/dist/KycController.d.mts.map +0 -1
  26. package/dist/KycController.mjs +0 -1080
  27. package/dist/KycController.mjs.map +0 -1
  28. package/dist/KycService-method-action-types.cjs +0 -7
  29. package/dist/KycService-method-action-types.cjs.map +0 -1
  30. package/dist/KycService-method-action-types.d.cts +0 -121
  31. package/dist/KycService-method-action-types.d.cts.map +0 -1
  32. package/dist/KycService-method-action-types.d.mts +0 -121
  33. package/dist/KycService-method-action-types.d.mts.map +0 -1
  34. package/dist/KycService-method-action-types.mjs +0 -6
  35. package/dist/KycService-method-action-types.mjs.map +0 -1
  36. package/dist/KycService.cjs +0 -417
  37. package/dist/KycService.cjs.map +0 -1
  38. package/dist/KycService.d.cts +0 -307
  39. package/dist/KycService.d.cts.map +0 -1
  40. package/dist/KycService.d.mts +0 -307
  41. package/dist/KycService.d.mts.map +0 -1
  42. package/dist/KycService.mjs +0 -413
  43. package/dist/KycService.mjs.map +0 -1
  44. package/dist/countryCodes.cjs +0 -274
  45. package/dist/countryCodes.cjs.map +0 -1
  46. package/dist/countryCodes.d.cts +0 -18
  47. package/dist/countryCodes.d.cts.map +0 -1
  48. package/dist/countryCodes.d.mts +0 -18
  49. package/dist/countryCodes.d.mts.map +0 -1
  50. package/dist/countryCodes.mjs +0 -270
  51. package/dist/countryCodes.mjs.map +0 -1
  52. package/dist/crypto.cjs +0 -154
  53. package/dist/crypto.cjs.map +0 -1
  54. package/dist/crypto.d.cts +0 -84
  55. package/dist/crypto.d.cts.map +0 -1
  56. package/dist/crypto.d.mts +0 -84
  57. package/dist/crypto.d.mts.map +0 -1
  58. package/dist/crypto.mjs +0 -149
  59. package/dist/crypto.mjs.map +0 -1
  60. package/dist/encoding.cjs +0 -40
  61. package/dist/encoding.cjs.map +0 -1
  62. package/dist/encoding.d.cts +0 -24
  63. package/dist/encoding.d.cts.map +0 -1
  64. package/dist/encoding.d.mts +0 -24
  65. package/dist/encoding.d.mts.map +0 -1
  66. package/dist/encoding.mjs +0 -35
  67. package/dist/encoding.mjs.map +0 -1
  68. package/dist/selectors.cjs +0 -30
  69. package/dist/selectors.cjs.map +0 -1
  70. package/dist/selectors.d.cts +0 -24
  71. package/dist/selectors.d.cts.map +0 -1
  72. package/dist/selectors.d.mts +0 -24
  73. package/dist/selectors.d.mts.map +0 -1
  74. package/dist/selectors.mjs +0 -24
  75. package/dist/selectors.mjs.map +0 -1
  76. package/dist/types.cjs +0 -10
  77. package/dist/types.cjs.map +0 -1
  78. package/dist/types.d.cts +0 -124
  79. package/dist/types.d.cts.map +0 -1
  80. package/dist/types.d.mts +0 -124
  81. package/dist/types.d.mts.map +0 -1
  82. package/dist/types.mjs +0 -9
  83. package/dist/types.mjs.map +0 -1
  84. package/dist/ukyc/constants.cjs +0 -75
  85. package/dist/ukyc/constants.cjs.map +0 -1
  86. package/dist/ukyc/constants.d.cts +0 -69
  87. package/dist/ukyc/constants.d.cts.map +0 -1
  88. package/dist/ukyc/constants.d.mts +0 -69
  89. package/dist/ukyc/constants.d.mts.map +0 -1
  90. package/dist/ukyc/constants.mjs +0 -72
  91. package/dist/ukyc/constants.mjs.map +0 -1
  92. package/dist/ukyc/deriveClientMaterial.cjs +0 -65
  93. package/dist/ukyc/deriveClientMaterial.cjs.map +0 -1
  94. package/dist/ukyc/deriveClientMaterial.d.cts +0 -54
  95. package/dist/ukyc/deriveClientMaterial.d.cts.map +0 -1
  96. package/dist/ukyc/deriveClientMaterial.d.mts +0 -54
  97. package/dist/ukyc/deriveClientMaterial.d.mts.map +0 -1
  98. package/dist/ukyc/deriveClientMaterial.mjs +0 -60
  99. package/dist/ukyc/deriveClientMaterial.mjs.map +0 -1
  100. package/dist/ukyc/jwtChain.cjs +0 -54
  101. package/dist/ukyc/jwtChain.cjs.map +0 -1
  102. package/dist/ukyc/jwtChain.d.cts +0 -40
  103. package/dist/ukyc/jwtChain.d.cts.map +0 -1
  104. package/dist/ukyc/jwtChain.d.mts +0 -40
  105. package/dist/ukyc/jwtChain.d.mts.map +0 -1
  106. package/dist/ukyc/jwtChain.mjs +0 -50
  107. package/dist/ukyc/jwtChain.mjs.map +0 -1
  108. package/dist/ukyc/localUserSecret.cjs +0 -98
  109. package/dist/ukyc/localUserSecret.cjs.map +0 -1
  110. package/dist/ukyc/localUserSecret.d.cts +0 -65
  111. package/dist/ukyc/localUserSecret.d.cts.map +0 -1
  112. package/dist/ukyc/localUserSecret.d.mts +0 -65
  113. package/dist/ukyc/localUserSecret.d.mts.map +0 -1
  114. package/dist/ukyc/localUserSecret.mjs +0 -92
  115. package/dist/ukyc/localUserSecret.mjs.map +0 -1
  116. package/dist/ukyc/storageAccessToken.cjs +0 -139
  117. package/dist/ukyc/storageAccessToken.cjs.map +0 -1
  118. package/dist/ukyc/storageAccessToken.d.cts +0 -99
  119. package/dist/ukyc/storageAccessToken.d.cts.map +0 -1
  120. package/dist/ukyc/storageAccessToken.d.mts +0 -99
  121. package/dist/ukyc/storageAccessToken.d.mts.map +0 -1
  122. package/dist/ukyc/storageAccessToken.mjs +0 -133
  123. package/dist/ukyc/storageAccessToken.mjs.map +0 -1
  124. package/dist/ukyc/testToken.cjs +0 -61
  125. package/dist/ukyc/testToken.cjs.map +0 -1
  126. package/dist/ukyc/testToken.d.cts +0 -50
  127. package/dist/ukyc/testToken.d.cts.map +0 -1
  128. package/dist/ukyc/testToken.d.mts +0 -50
  129. package/dist/ukyc/testToken.d.mts.map +0 -1
  130. package/dist/ukyc/testToken.mjs +0 -57
  131. package/dist/ukyc/testToken.mjs.map +0 -1
  132. package/dist/ukyc/wrapEncryptionKey.cjs +0 -28
  133. package/dist/ukyc/wrapEncryptionKey.cjs.map +0 -1
  134. package/dist/ukyc/wrapEncryptionKey.d.cts +0 -34
  135. package/dist/ukyc/wrapEncryptionKey.d.cts.map +0 -1
  136. package/dist/ukyc/wrapEncryptionKey.d.mts +0 -34
  137. package/dist/ukyc/wrapEncryptionKey.d.mts.map +0 -1
  138. package/dist/ukyc/wrapEncryptionKey.mjs +0 -25
  139. package/dist/ukyc/wrapEncryptionKey.mjs.map +0 -1
  140. package/dist/ukyc/wrapUserKey.cjs +0 -80
  141. package/dist/ukyc/wrapUserKey.cjs.map +0 -1
  142. package/dist/ukyc/wrapUserKey.d.cts +0 -26
  143. package/dist/ukyc/wrapUserKey.d.cts.map +0 -1
  144. package/dist/ukyc/wrapUserKey.d.mts +0 -26
  145. package/dist/ukyc/wrapUserKey.d.mts.map +0 -1
  146. package/dist/ukyc/wrapUserKey.mjs +0 -76
  147. package/dist/ukyc/wrapUserKey.mjs.map +0 -1
  148. package/dist/ukyc/wrappedRelayPayload.cjs +0 -32
  149. package/dist/ukyc/wrappedRelayPayload.cjs.map +0 -1
  150. package/dist/ukyc/wrappedRelayPayload.d.cts +0 -35
  151. package/dist/ukyc/wrappedRelayPayload.d.cts.map +0 -1
  152. package/dist/ukyc/wrappedRelayPayload.d.mts +0 -35
  153. package/dist/ukyc/wrappedRelayPayload.d.mts.map +0 -1
  154. package/dist/ukyc/wrappedRelayPayload.mjs +0 -28
  155. package/dist/ukyc/wrappedRelayPayload.mjs.map +0 -1
package/dist/encoding.mjs DELETED
@@ -1,35 +0,0 @@
1
- import { base64ToBytes, bytesToBase64 } from "@metamask/utils";
2
- /**
3
- * Shared base64url encoding helpers used by frame crypto and UKYC modules.
4
- *
5
- * These are platform-agnostic: they rely on `@metamask/utils` rather than
6
- * `Buffer` / `atob`, so they run unchanged on mobile, extension, and web.
7
- */
8
- /**
9
- * Encodes bytes as unpadded base64url (RFC 4648 §5). This is the wire shape
10
- * used for `storage_id`, `signing_public_key`, and Ed25519 signatures in the
11
- * UKYC storage API.
12
- *
13
- * @param bytes - The bytes to encode.
14
- * @returns The base64url string without `=` padding.
15
- */
16
- export function toBase64Url(bytes) {
17
- return bytesToBase64(bytes)
18
- .replace(/\+/gu, '-')
19
- .replace(/\//gu, '_')
20
- .replace(/[=]+$/u, '');
21
- }
22
- /**
23
- * Decodes an unpadded (or padded) base64url string back to bytes. Inverse of
24
- * {@link toBase64Url}.
25
- *
26
- * @param value - The base64url string.
27
- * @returns The decoded bytes.
28
- */
29
- export function base64UrlToBytes(value) {
30
- return base64ToBytes(value
31
- .replace(/-/gu, '+')
32
- .replace(/_/gu, '/')
33
- .padEnd(value.length + ((4 - (value.length % 4)) % 4), '='));
34
- }
35
- //# sourceMappingURL=encoding.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encoding.mjs","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,wBAAwB;AAE/D;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,OAAO,aAAa,CAAC,KAAK,CAAC;SACxB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,aAAa,CAClB,KAAK;SACF,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["import { base64ToBytes, bytesToBase64 } from '@metamask/utils';\n\n/**\n * Shared base64url encoding helpers used by frame crypto and UKYC modules.\n *\n * These are platform-agnostic: they rely on `@metamask/utils` rather than\n * `Buffer` / `atob`, so they run unchanged on mobile, extension, and web.\n */\n\n/**\n * Encodes bytes as unpadded base64url (RFC 4648 §5). This is the wire shape\n * used for `storage_id`, `signing_public_key`, and Ed25519 signatures in the\n * UKYC storage API.\n *\n * @param bytes - The bytes to encode.\n * @returns The base64url string without `=` padding.\n */\nexport function toBase64Url(bytes: Uint8Array): string {\n return bytesToBase64(bytes)\n .replace(/\\+/gu, '-')\n .replace(/\\//gu, '_')\n .replace(/[=]+$/u, '');\n}\n\n/**\n * Decodes an unpadded (or padded) base64url string back to bytes. Inverse of\n * {@link toBase64Url}.\n *\n * @param value - The base64url string.\n * @returns The decoded bytes.\n */\nexport function base64UrlToBytes(value: string): Uint8Array {\n return base64ToBytes(\n value\n .replace(/-/gu, '+')\n .replace(/_/gu, '/')\n .padEnd(value.length + ((4 - (value.length % 4)) % 4), '='),\n );\n}\n"]}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectIsKycRequiredForProduct = exports.selectKycSumSub = exports.selectKycPhase = void 0;
4
- const reselect_1 = require("reselect");
5
- const selectKycRequiredByProduct = (state) => state.kycRequiredByProduct;
6
- /**
7
- * Selects the current flow phase.
8
- *
9
- * @param state - The KycController state.
10
- * @returns The current phase.
11
- */
12
- const selectKycPhase = (state) => state.phase;
13
- exports.selectKycPhase = selectKycPhase;
14
- /**
15
- * Selects the SumSub sub-flow state.
16
- *
17
- * @param state - The KycController state.
18
- * @returns The SumSub state.
19
- */
20
- const selectKycSumSub = (state) => state.sumsub;
21
- exports.selectKycSumSub = selectKycSumSub;
22
- /**
23
- * Creates a selector that returns whether KYC is required for a product.
24
- *
25
- * @param product - The consuming feature.
26
- * @returns A selector returning the cached requirement, or `undefined`.
27
- */
28
- const selectIsKycRequiredForProduct = (product) => (0, reselect_1.createSelector)([selectKycRequiredByProduct], (map) => map[product]);
29
- exports.selectIsKycRequiredForProduct = selectIsKycRequiredForProduct;
30
- //# sourceMappingURL=selectors.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectors.cjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAK1C,MAAM,0BAA0B,GAAG,CACjC,KAAyB,EACmB,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC;AAE5E;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAC5B,KAAyB,EACI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;AAFjC,QAAA,cAAc,kBAEmB;AAE9C;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAC7B,KAAyB,EACK,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;AAFnC,QAAA,eAAe,mBAEoB;AAEhD;;;;;GAKG;AACI,MAAM,6BAA6B,GAAG,CAC3C,OAAmB,EACmC,EAAE,CACxD,IAAA,yBAAc,EACZ,CAAC,0BAA0B,CAAC,EAC5B,CAAC,GAAG,EAAuB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAC3C,CAAC;AANS,QAAA,6BAA6B,iCAMtC","sourcesContent":["import { createSelector } from 'reselect';\n\nimport type { KycControllerState } from './KycController.js';\nimport type { KycProduct } from './types.js';\n\nconst selectKycRequiredByProduct = (\n state: KycControllerState,\n): KycControllerState['kycRequiredByProduct'] => state.kycRequiredByProduct;\n\n/**\n * Selects the current flow phase.\n *\n * @param state - The KycController state.\n * @returns The current phase.\n */\nexport const selectKycPhase = (\n state: KycControllerState,\n): KycControllerState['phase'] => state.phase;\n\n/**\n * Selects the SumSub sub-flow state.\n *\n * @param state - The KycController state.\n * @returns The SumSub state.\n */\nexport const selectKycSumSub = (\n state: KycControllerState,\n): KycControllerState['sumsub'] => state.sumsub;\n\n/**\n * Creates a selector that returns whether KYC is required for a product.\n *\n * @param product - The consuming feature.\n * @returns A selector returning the cached requirement, or `undefined`.\n */\nexport const selectIsKycRequiredForProduct = (\n product: KycProduct,\n): ((state: KycControllerState) => boolean | undefined) =>\n createSelector(\n [selectKycRequiredByProduct],\n (map): boolean | undefined => map[product],\n );\n"]}
@@ -1,24 +0,0 @@
1
- import type { KycControllerState } from "./KycController.cjs";
2
- import type { KycProduct } from "./types.cjs";
3
- /**
4
- * Selects the current flow phase.
5
- *
6
- * @param state - The KycController state.
7
- * @returns The current phase.
8
- */
9
- export declare const selectKycPhase: (state: KycControllerState) => KycControllerState['phase'];
10
- /**
11
- * Selects the SumSub sub-flow state.
12
- *
13
- * @param state - The KycController state.
14
- * @returns The SumSub state.
15
- */
16
- export declare const selectKycSumSub: (state: KycControllerState) => KycControllerState['sumsub'];
17
- /**
18
- * Creates a selector that returns whether KYC is required for a product.
19
- *
20
- * @param product - The consuming feature.
21
- * @returns A selector returning the cached requirement, or `undefined`.
22
- */
23
- export declare const selectIsKycRequiredForProduct: (product: KycProduct) => (state: KycControllerState) => boolean | undefined;
24
- //# sourceMappingURL=selectors.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,4BAA2B;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAmB;AAM7C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,kBAAkB,KACxB,kBAAkB,CAAC,OAAO,CAAgB,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UACnB,kBAAkB,KACxB,kBAAkB,CAAC,QAAQ,CAAiB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,YAC/B,UAAU,aACT,kBAAkB,KAAK,OAAO,GAAG,SAI1C,CAAC"}
@@ -1,24 +0,0 @@
1
- import type { KycControllerState } from "./KycController.mjs";
2
- import type { KycProduct } from "./types.mjs";
3
- /**
4
- * Selects the current flow phase.
5
- *
6
- * @param state - The KycController state.
7
- * @returns The current phase.
8
- */
9
- export declare const selectKycPhase: (state: KycControllerState) => KycControllerState['phase'];
10
- /**
11
- * Selects the SumSub sub-flow state.
12
- *
13
- * @param state - The KycController state.
14
- * @returns The SumSub state.
15
- */
16
- export declare const selectKycSumSub: (state: KycControllerState) => KycControllerState['sumsub'];
17
- /**
18
- * Creates a selector that returns whether KYC is required for a product.
19
- *
20
- * @param product - The consuming feature.
21
- * @returns A selector returning the cached requirement, or `undefined`.
22
- */
23
- export declare const selectIsKycRequiredForProduct: (product: KycProduct) => (state: KycControllerState) => boolean | undefined;
24
- //# sourceMappingURL=selectors.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectors.d.mts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,4BAA2B;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAmB;AAM7C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,kBAAkB,KACxB,kBAAkB,CAAC,OAAO,CAAgB,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UACnB,kBAAkB,KACxB,kBAAkB,CAAC,QAAQ,CAAiB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,YAC/B,UAAU,aACT,kBAAkB,KAAK,OAAO,GAAG,SAI1C,CAAC"}
@@ -1,24 +0,0 @@
1
- import { createSelector } from "reselect";
2
- const selectKycRequiredByProduct = (state) => state.kycRequiredByProduct;
3
- /**
4
- * Selects the current flow phase.
5
- *
6
- * @param state - The KycController state.
7
- * @returns The current phase.
8
- */
9
- export const selectKycPhase = (state) => state.phase;
10
- /**
11
- * Selects the SumSub sub-flow state.
12
- *
13
- * @param state - The KycController state.
14
- * @returns The SumSub state.
15
- */
16
- export const selectKycSumSub = (state) => state.sumsub;
17
- /**
18
- * Creates a selector that returns whether KYC is required for a product.
19
- *
20
- * @param product - The consuming feature.
21
- * @returns A selector returning the cached requirement, or `undefined`.
22
- */
23
- export const selectIsKycRequiredForProduct = (product) => createSelector([selectKycRequiredByProduct], (map) => map[product]);
24
- //# sourceMappingURL=selectors.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectors.mjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB;AAK1C,MAAM,0BAA0B,GAAG,CACjC,KAAyB,EACmB,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAyB,EACI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,KAAyB,EACK,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,OAAmB,EACmC,EAAE,CACxD,cAAc,CACZ,CAAC,0BAA0B,CAAC,EAC5B,CAAC,GAAG,EAAuB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAC3C,CAAC","sourcesContent":["import { createSelector } from 'reselect';\n\nimport type { KycControllerState } from './KycController.js';\nimport type { KycProduct } from './types.js';\n\nconst selectKycRequiredByProduct = (\n state: KycControllerState,\n): KycControllerState['kycRequiredByProduct'] => state.kycRequiredByProduct;\n\n/**\n * Selects the current flow phase.\n *\n * @param state - The KycController state.\n * @returns The current phase.\n */\nexport const selectKycPhase = (\n state: KycControllerState,\n): KycControllerState['phase'] => state.phase;\n\n/**\n * Selects the SumSub sub-flow state.\n *\n * @param state - The KycController state.\n * @returns The SumSub state.\n */\nexport const selectKycSumSub = (\n state: KycControllerState,\n): KycControllerState['sumsub'] => state.sumsub;\n\n/**\n * Creates a selector that returns whether KYC is required for a product.\n *\n * @param product - The consuming feature.\n * @returns A selector returning the cached requirement, or `undefined`.\n */\nexport const selectIsKycRequiredForProduct = (\n product: KycProduct,\n): ((state: KycControllerState) => boolean | undefined) =>\n createSelector(\n [selectKycRequiredByProduct],\n (map): boolean | undefined => map[product],\n );\n"]}
package/dist/types.cjs DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- /**
3
- * Shared types for the KYC controller and service.
4
- *
5
- * The KYC flow is vendor-backed (currently MoonPay for identity + SumSub for
6
- * document verification) but the surface exposed to consumers (ramps, card) is
7
- * intentionally vendor-neutral so a future vendor swap does not ripple out.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- //# sourceMappingURL=types.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG","sourcesContent":["/**\n * Shared types for the KYC controller and service.\n *\n * The KYC flow is vendor-backed (currently MoonPay for identity + SumSub for\n * document verification) but the surface exposed to consumers (ramps, card) is\n * intentionally vendor-neutral so a future vendor swap does not ripple out.\n */\n\n/**\n * A MetaMask feature that consumes KYC. Used to key the per-product\n * \"is KYC required\" cache so ramps and card can share one controller.\n */\nexport type KycProduct = 'ramps' | 'card';\n\n/**\n * Identity vendors supported behind the KYC surface.\n */\nexport type KycVendor = 'moonpay';\n\n/**\n * Phases of the end-to-end identity flow.\n *\n * - `idle` — nothing started.\n * - `terms` — waiting for the customer to accept the vendor terms.\n * - `session` — creating the vendor session.\n * - `check` — running the invisible connection-check frame.\n * - `auth` — running the visible authentication (OTP) frame.\n * - `form` — authenticated. When the flow is scoped to a product, the\n * KYC-required check runs automatically from here; otherwise the consumer\n * drives it manually via `checkKycRequired`.\n * - `submit` — submitting the KYC-required check.\n * - `done` — flow complete; see `kycRequiredByProduct` / `sumsub`. When KYC is\n * required, the document-verification sub-flow is launched automatically.\n * - `error` — flow halted; see `error`.\n */\nexport type KycPhase =\n | 'idle'\n | 'terms'\n | 'session'\n | 'check'\n | 'auth'\n | 'form'\n | 'submit'\n | 'done'\n | 'error';\n\n/**\n * Progress of the SumSub document-verification sub-flow.\n *\n * - `polling` — the SDK finished and the controller is polling the UKYC\n * backend for the session's final decision (see `KycSessionStatus`). The\n * sub-flow resolves to `complete` or `failed` once a terminal status arrives.\n * - `vendorProcessing` — session creation reported that the applicant is\n * already approved on the relay (`kycStatus`) while the vendor is still\n * finalizing its own decision (`finalStatus`). There is nothing left for the\n * applicant to do, so the SDK is not launched; see `statusMessage`.\n */\nexport type KycSumSubStatus =\n | 'idle'\n | 'creatingSession'\n | 'fetchingToken'\n | 'launching'\n | 'inProgress'\n | 'polling'\n | 'complete'\n | 'failed'\n | 'vendorProcessing';\n\n/**\n * The status of a UKYC session, returned by the `GET /sessions/{id}/status`\n * endpoint and polled after the SumSub SDK completes to determine the final\n * verification decision.\n */\nexport type KycSessionStatus = {\n /**\n * The overall status of the session. Terminal values (e.g. `approved`,\n * `completed`, `rejected`, `failed`, `blocked`) end polling; any other value\n * keeps polling.\n */\n finalStatus: string;\n /** Optional human-readable message describing the status. */\n statusMessage?: string;\n /** The vendor-agnostic external user id associated with the session. */\n externalUserId: string;\n /** The KYC decision status. */\n kycStatus: string;\n /** The identity vendor that handled the session. */\n vendor: string;\n /** The vendor-specific status. */\n vendorStatus: string;\n};\n\n/**\n * A single disclaimer/term the customer must accept before a session is\n * created.\n */\nexport type KycDisclaimer = {\n id: string;\n // Mirrors the vendor API response field, which is snake_case.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n display_name: string;\n url: string;\n};\n\n/**\n * Parameters passed to a platform SumSub launcher.\n */\nexport type KycSumSubLaunchParams = {\n /**\n * The applicant access token used to initialize the SumSub SDK.\n */\n applicantAccessToken: string;\n\n /**\n * Called by the SDK when the access token expires; must resolve with a fresh\n * applicant access token.\n */\n onTokenExpiration: () => Promise<string>;\n\n /**\n * Called when the SDK reports a status transition.\n */\n onStatusChange?: (prevStatus: string, newStatus: string) => void;\n\n /**\n * BCP-47 locale for the SDK UI.\n */\n locale?: string;\n\n /**\n * Enables SDK debug logging.\n */\n debug?: boolean;\n};\n\n/**\n * Platform adapter that launches the native/web SumSub SDK.\n *\n * The KYC controller is platform-agnostic and does not import any SDK; each\n * client (mobile / extension / web) injects an implementation of this\n * interface. The controller owns all orchestration (session creation, token\n * exchange, token refresh, state) and only delegates the actual SDK\n * presentation to `launch`.\n */\nexport type KycSumSubLauncher = {\n /**\n * Whether the underlying SDK is available in the current runtime (e.g. the\n * native module is linked). When `false`, `startSumSub` fails fast.\n */\n isAvailable(): boolean;\n\n /**\n * Presents the SumSub verification flow and resolves with the SDK result.\n */\n launch(params: KycSumSubLaunchParams): Promise<Record<string, unknown>>;\n};\n"]}
package/dist/types.d.cts DELETED
@@ -1,124 +0,0 @@
1
- /**
2
- * Shared types for the KYC controller and service.
3
- *
4
- * The KYC flow is vendor-backed (currently MoonPay for identity + SumSub for
5
- * document verification) but the surface exposed to consumers (ramps, card) is
6
- * intentionally vendor-neutral so a future vendor swap does not ripple out.
7
- */
8
- /**
9
- * A MetaMask feature that consumes KYC. Used to key the per-product
10
- * "is KYC required" cache so ramps and card can share one controller.
11
- */
12
- export type KycProduct = 'ramps' | 'card';
13
- /**
14
- * Identity vendors supported behind the KYC surface.
15
- */
16
- export type KycVendor = 'moonpay';
17
- /**
18
- * Phases of the end-to-end identity flow.
19
- *
20
- * - `idle` — nothing started.
21
- * - `terms` — waiting for the customer to accept the vendor terms.
22
- * - `session` — creating the vendor session.
23
- * - `check` — running the invisible connection-check frame.
24
- * - `auth` — running the visible authentication (OTP) frame.
25
- * - `form` — authenticated. When the flow is scoped to a product, the
26
- * KYC-required check runs automatically from here; otherwise the consumer
27
- * drives it manually via `checkKycRequired`.
28
- * - `submit` — submitting the KYC-required check.
29
- * - `done` — flow complete; see `kycRequiredByProduct` / `sumsub`. When KYC is
30
- * required, the document-verification sub-flow is launched automatically.
31
- * - `error` — flow halted; see `error`.
32
- */
33
- export type KycPhase = 'idle' | 'terms' | 'session' | 'check' | 'auth' | 'form' | 'submit' | 'done' | 'error';
34
- /**
35
- * Progress of the SumSub document-verification sub-flow.
36
- *
37
- * - `polling` — the SDK finished and the controller is polling the UKYC
38
- * backend for the session's final decision (see `KycSessionStatus`). The
39
- * sub-flow resolves to `complete` or `failed` once a terminal status arrives.
40
- * - `vendorProcessing` — session creation reported that the applicant is
41
- * already approved on the relay (`kycStatus`) while the vendor is still
42
- * finalizing its own decision (`finalStatus`). There is nothing left for the
43
- * applicant to do, so the SDK is not launched; see `statusMessage`.
44
- */
45
- export type KycSumSubStatus = 'idle' | 'creatingSession' | 'fetchingToken' | 'launching' | 'inProgress' | 'polling' | 'complete' | 'failed' | 'vendorProcessing';
46
- /**
47
- * The status of a UKYC session, returned by the `GET /sessions/{id}/status`
48
- * endpoint and polled after the SumSub SDK completes to determine the final
49
- * verification decision.
50
- */
51
- export type KycSessionStatus = {
52
- /**
53
- * The overall status of the session. Terminal values (e.g. `approved`,
54
- * `completed`, `rejected`, `failed`, `blocked`) end polling; any other value
55
- * keeps polling.
56
- */
57
- finalStatus: string;
58
- /** Optional human-readable message describing the status. */
59
- statusMessage?: string;
60
- /** The vendor-agnostic external user id associated with the session. */
61
- externalUserId: string;
62
- /** The KYC decision status. */
63
- kycStatus: string;
64
- /** The identity vendor that handled the session. */
65
- vendor: string;
66
- /** The vendor-specific status. */
67
- vendorStatus: string;
68
- };
69
- /**
70
- * A single disclaimer/term the customer must accept before a session is
71
- * created.
72
- */
73
- export type KycDisclaimer = {
74
- id: string;
75
- display_name: string;
76
- url: string;
77
- };
78
- /**
79
- * Parameters passed to a platform SumSub launcher.
80
- */
81
- export type KycSumSubLaunchParams = {
82
- /**
83
- * The applicant access token used to initialize the SumSub SDK.
84
- */
85
- applicantAccessToken: string;
86
- /**
87
- * Called by the SDK when the access token expires; must resolve with a fresh
88
- * applicant access token.
89
- */
90
- onTokenExpiration: () => Promise<string>;
91
- /**
92
- * Called when the SDK reports a status transition.
93
- */
94
- onStatusChange?: (prevStatus: string, newStatus: string) => void;
95
- /**
96
- * BCP-47 locale for the SDK UI.
97
- */
98
- locale?: string;
99
- /**
100
- * Enables SDK debug logging.
101
- */
102
- debug?: boolean;
103
- };
104
- /**
105
- * Platform adapter that launches the native/web SumSub SDK.
106
- *
107
- * The KYC controller is platform-agnostic and does not import any SDK; each
108
- * client (mobile / extension / web) injects an implementation of this
109
- * interface. The controller owns all orchestration (session creation, token
110
- * exchange, token refresh, state) and only delegates the actual SDK
111
- * presentation to `launch`.
112
- */
113
- export type KycSumSubLauncher = {
114
- /**
115
- * Whether the underlying SDK is available in the current runtime (e.g. the
116
- * native module is linked). When `false`, `startSumSub` fails fast.
117
- */
118
- isAvailable(): boolean;
119
- /**
120
- * Presents the SumSub verification flow and resolves with the SDK result.
121
- */
122
- launch(params: KycSumSubLaunchParams): Promise<Record<string, unknown>>;
123
- };
124
- //# sourceMappingURL=types.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,OAAO,GACP,SAAS,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,CAAC;AAEZ;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,iBAAiB,GACjB,eAAe,GACf,WAAW,GACX,YAAY,GACZ,SAAS,GACT,UAAU,GACV,QAAQ,GACR,kBAAkB,CAAC;AAEvB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IAGX,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzE,CAAC"}
package/dist/types.d.mts DELETED
@@ -1,124 +0,0 @@
1
- /**
2
- * Shared types for the KYC controller and service.
3
- *
4
- * The KYC flow is vendor-backed (currently MoonPay for identity + SumSub for
5
- * document verification) but the surface exposed to consumers (ramps, card) is
6
- * intentionally vendor-neutral so a future vendor swap does not ripple out.
7
- */
8
- /**
9
- * A MetaMask feature that consumes KYC. Used to key the per-product
10
- * "is KYC required" cache so ramps and card can share one controller.
11
- */
12
- export type KycProduct = 'ramps' | 'card';
13
- /**
14
- * Identity vendors supported behind the KYC surface.
15
- */
16
- export type KycVendor = 'moonpay';
17
- /**
18
- * Phases of the end-to-end identity flow.
19
- *
20
- * - `idle` — nothing started.
21
- * - `terms` — waiting for the customer to accept the vendor terms.
22
- * - `session` — creating the vendor session.
23
- * - `check` — running the invisible connection-check frame.
24
- * - `auth` — running the visible authentication (OTP) frame.
25
- * - `form` — authenticated. When the flow is scoped to a product, the
26
- * KYC-required check runs automatically from here; otherwise the consumer
27
- * drives it manually via `checkKycRequired`.
28
- * - `submit` — submitting the KYC-required check.
29
- * - `done` — flow complete; see `kycRequiredByProduct` / `sumsub`. When KYC is
30
- * required, the document-verification sub-flow is launched automatically.
31
- * - `error` — flow halted; see `error`.
32
- */
33
- export type KycPhase = 'idle' | 'terms' | 'session' | 'check' | 'auth' | 'form' | 'submit' | 'done' | 'error';
34
- /**
35
- * Progress of the SumSub document-verification sub-flow.
36
- *
37
- * - `polling` — the SDK finished and the controller is polling the UKYC
38
- * backend for the session's final decision (see `KycSessionStatus`). The
39
- * sub-flow resolves to `complete` or `failed` once a terminal status arrives.
40
- * - `vendorProcessing` — session creation reported that the applicant is
41
- * already approved on the relay (`kycStatus`) while the vendor is still
42
- * finalizing its own decision (`finalStatus`). There is nothing left for the
43
- * applicant to do, so the SDK is not launched; see `statusMessage`.
44
- */
45
- export type KycSumSubStatus = 'idle' | 'creatingSession' | 'fetchingToken' | 'launching' | 'inProgress' | 'polling' | 'complete' | 'failed' | 'vendorProcessing';
46
- /**
47
- * The status of a UKYC session, returned by the `GET /sessions/{id}/status`
48
- * endpoint and polled after the SumSub SDK completes to determine the final
49
- * verification decision.
50
- */
51
- export type KycSessionStatus = {
52
- /**
53
- * The overall status of the session. Terminal values (e.g. `approved`,
54
- * `completed`, `rejected`, `failed`, `blocked`) end polling; any other value
55
- * keeps polling.
56
- */
57
- finalStatus: string;
58
- /** Optional human-readable message describing the status. */
59
- statusMessage?: string;
60
- /** The vendor-agnostic external user id associated with the session. */
61
- externalUserId: string;
62
- /** The KYC decision status. */
63
- kycStatus: string;
64
- /** The identity vendor that handled the session. */
65
- vendor: string;
66
- /** The vendor-specific status. */
67
- vendorStatus: string;
68
- };
69
- /**
70
- * A single disclaimer/term the customer must accept before a session is
71
- * created.
72
- */
73
- export type KycDisclaimer = {
74
- id: string;
75
- display_name: string;
76
- url: string;
77
- };
78
- /**
79
- * Parameters passed to a platform SumSub launcher.
80
- */
81
- export type KycSumSubLaunchParams = {
82
- /**
83
- * The applicant access token used to initialize the SumSub SDK.
84
- */
85
- applicantAccessToken: string;
86
- /**
87
- * Called by the SDK when the access token expires; must resolve with a fresh
88
- * applicant access token.
89
- */
90
- onTokenExpiration: () => Promise<string>;
91
- /**
92
- * Called when the SDK reports a status transition.
93
- */
94
- onStatusChange?: (prevStatus: string, newStatus: string) => void;
95
- /**
96
- * BCP-47 locale for the SDK UI.
97
- */
98
- locale?: string;
99
- /**
100
- * Enables SDK debug logging.
101
- */
102
- debug?: boolean;
103
- };
104
- /**
105
- * Platform adapter that launches the native/web SumSub SDK.
106
- *
107
- * The KYC controller is platform-agnostic and does not import any SDK; each
108
- * client (mobile / extension / web) injects an implementation of this
109
- * interface. The controller owns all orchestration (session creation, token
110
- * exchange, token refresh, state) and only delegates the actual SDK
111
- * presentation to `launch`.
112
- */
113
- export type KycSumSubLauncher = {
114
- /**
115
- * Whether the underlying SDK is available in the current runtime (e.g. the
116
- * native module is linked). When `false`, `startSumSub` fails fast.
117
- */
118
- isAvailable(): boolean;
119
- /**
120
- * Presents the SumSub verification flow and resolves with the SDK result.
121
- */
122
- launch(params: KycSumSubLaunchParams): Promise<Record<string, unknown>>;
123
- };
124
- //# sourceMappingURL=types.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,OAAO,GACP,SAAS,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,CAAC;AAEZ;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,iBAAiB,GACjB,eAAe,GACf,WAAW,GACX,YAAY,GACZ,SAAS,GACT,UAAU,GACV,QAAQ,GACR,kBAAkB,CAAC;AAEvB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IAGX,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzE,CAAC"}
package/dist/types.mjs DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Shared types for the KYC controller and service.
3
- *
4
- * The KYC flow is vendor-backed (currently MoonPay for identity + SumSub for
5
- * document verification) but the surface exposed to consumers (ramps, card) is
6
- * intentionally vendor-neutral so a future vendor swap does not ripple out.
7
- */
8
- export {};
9
- //# sourceMappingURL=types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * Shared types for the KYC controller and service.\n *\n * The KYC flow is vendor-backed (currently MoonPay for identity + SumSub for\n * document verification) but the surface exposed to consumers (ramps, card) is\n * intentionally vendor-neutral so a future vendor swap does not ripple out.\n */\n\n/**\n * A MetaMask feature that consumes KYC. Used to key the per-product\n * \"is KYC required\" cache so ramps and card can share one controller.\n */\nexport type KycProduct = 'ramps' | 'card';\n\n/**\n * Identity vendors supported behind the KYC surface.\n */\nexport type KycVendor = 'moonpay';\n\n/**\n * Phases of the end-to-end identity flow.\n *\n * - `idle` — nothing started.\n * - `terms` — waiting for the customer to accept the vendor terms.\n * - `session` — creating the vendor session.\n * - `check` — running the invisible connection-check frame.\n * - `auth` — running the visible authentication (OTP) frame.\n * - `form` — authenticated. When the flow is scoped to a product, the\n * KYC-required check runs automatically from here; otherwise the consumer\n * drives it manually via `checkKycRequired`.\n * - `submit` — submitting the KYC-required check.\n * - `done` — flow complete; see `kycRequiredByProduct` / `sumsub`. When KYC is\n * required, the document-verification sub-flow is launched automatically.\n * - `error` — flow halted; see `error`.\n */\nexport type KycPhase =\n | 'idle'\n | 'terms'\n | 'session'\n | 'check'\n | 'auth'\n | 'form'\n | 'submit'\n | 'done'\n | 'error';\n\n/**\n * Progress of the SumSub document-verification sub-flow.\n *\n * - `polling` — the SDK finished and the controller is polling the UKYC\n * backend for the session's final decision (see `KycSessionStatus`). The\n * sub-flow resolves to `complete` or `failed` once a terminal status arrives.\n * - `vendorProcessing` — session creation reported that the applicant is\n * already approved on the relay (`kycStatus`) while the vendor is still\n * finalizing its own decision (`finalStatus`). There is nothing left for the\n * applicant to do, so the SDK is not launched; see `statusMessage`.\n */\nexport type KycSumSubStatus =\n | 'idle'\n | 'creatingSession'\n | 'fetchingToken'\n | 'launching'\n | 'inProgress'\n | 'polling'\n | 'complete'\n | 'failed'\n | 'vendorProcessing';\n\n/**\n * The status of a UKYC session, returned by the `GET /sessions/{id}/status`\n * endpoint and polled after the SumSub SDK completes to determine the final\n * verification decision.\n */\nexport type KycSessionStatus = {\n /**\n * The overall status of the session. Terminal values (e.g. `approved`,\n * `completed`, `rejected`, `failed`, `blocked`) end polling; any other value\n * keeps polling.\n */\n finalStatus: string;\n /** Optional human-readable message describing the status. */\n statusMessage?: string;\n /** The vendor-agnostic external user id associated with the session. */\n externalUserId: string;\n /** The KYC decision status. */\n kycStatus: string;\n /** The identity vendor that handled the session. */\n vendor: string;\n /** The vendor-specific status. */\n vendorStatus: string;\n};\n\n/**\n * A single disclaimer/term the customer must accept before a session is\n * created.\n */\nexport type KycDisclaimer = {\n id: string;\n // Mirrors the vendor API response field, which is snake_case.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n display_name: string;\n url: string;\n};\n\n/**\n * Parameters passed to a platform SumSub launcher.\n */\nexport type KycSumSubLaunchParams = {\n /**\n * The applicant access token used to initialize the SumSub SDK.\n */\n applicantAccessToken: string;\n\n /**\n * Called by the SDK when the access token expires; must resolve with a fresh\n * applicant access token.\n */\n onTokenExpiration: () => Promise<string>;\n\n /**\n * Called when the SDK reports a status transition.\n */\n onStatusChange?: (prevStatus: string, newStatus: string) => void;\n\n /**\n * BCP-47 locale for the SDK UI.\n */\n locale?: string;\n\n /**\n * Enables SDK debug logging.\n */\n debug?: boolean;\n};\n\n/**\n * Platform adapter that launches the native/web SumSub SDK.\n *\n * The KYC controller is platform-agnostic and does not import any SDK; each\n * client (mobile / extension / web) injects an implementation of this\n * interface. The controller owns all orchestration (session creation, token\n * exchange, token refresh, state) and only delegates the actual SDK\n * presentation to `launch`.\n */\nexport type KycSumSubLauncher = {\n /**\n * Whether the underlying SDK is available in the current runtime (e.g. the\n * native module is linked). When `false`, `startSumSub` fails fast.\n */\n isAvailable(): boolean;\n\n /**\n * Presents the SumSub verification flow and resolves with the SDK result.\n */\n launch(params: KycSumSubLaunchParams): Promise<Record<string, unknown>>;\n};\n"]}
@@ -1,75 +0,0 @@
1
- "use strict";
2
- /**
3
- * Constants for the UKYC client-derived key material and storage-authorization
4
- * layer. See the architecture doc, section "Client-Derived Material".
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.UKYC_JWKS_PATH = exports.UKYC_CAPABILITY_AUTH_SCHEME = exports.UKYC_STORAGE_ACCESS_TOKEN_AUDIENCES = exports.UKYC_KWIL_AUDIENCE = exports.UKYC_STORAGE_ACCESS_TOKEN_AUDIENCE = exports.UKYC_STORAGE_ACCESS_TOKEN_VERSION = exports.UKYC_KDF_INFO = exports.UKYC_DERIVED_KEY_SIZES = exports.UKYC_LOCAL_USER_SECRET_SIZE_BYTES = exports.UKYC_LOCAL_USER_SECRET_PATH = void 0;
8
- /**
9
- * Fully-qualified key path for the `local_user_secret` in Encrypted User
10
- * Storage.
11
- */
12
- exports.UKYC_LOCAL_USER_SECRET_PATH = `ukyc.local_user_secret`;
13
- /**
14
- * Size of the `local_user_secret` in bytes. 32 bytes (256 bits) provides high
15
- * entropy and matches the input length expected by the HKDF-SHA256 derivations
16
- * below.
17
- */
18
- exports.UKYC_LOCAL_USER_SECRET_SIZE_BYTES = 32;
19
- /**
20
- * Byte length of each value derived from `local_user_secret`.
21
- *
22
- * `signingKey` is 32 bytes because it is used directly as the Ed25519
23
- * private key (for Ed25519 the 32-byte seed *is* the private key).
24
- */
25
- exports.UKYC_DERIVED_KEY_SIZES = {
26
- storageId: 32,
27
- dataEncryptionKey: 32,
28
- signingKey: 32,
29
- relayTunnelKey: 32,
30
- };
31
- /**
32
- * HKDF `info` labels providing domain separation between the values derived
33
- * from `local_user_secret`.
34
- */
35
- exports.UKYC_KDF_INFO = {
36
- storageId: 'metamask.ukyc.storage.v1.storage_id',
37
- dataEncryptionKey: 'metamask.ukyc.storage.v1.data_encryption_key',
38
- signingKey: 'metamask.ukyc.storage.v1.signing_key',
39
- relayTunnelKey: 'metamask.ukyc.storage.v1.relay_tunnel_key',
40
- };
41
- /**
42
- * Version bound into every `storage_access_token` payload.
43
- */
44
- exports.UKYC_STORAGE_ACCESS_TOKEN_VERSION = 1;
45
- /**
46
- * Audience identifying the UKYC user-storage service. Required by UKYC Storage
47
- * when it verifies a `storage_access_token`.
48
- */
49
- exports.UKYC_STORAGE_ACCESS_TOKEN_AUDIENCE = 'metamask:user-storage:ukyc';
50
- /**
51
- * Audience identifying the idOS Kwil credential-registry nodes. Required by
52
- * idOS Kwil when it verifies a `storage_access_token`.
53
- */
54
- exports.UKYC_KWIL_AUDIENCE = 'idos:kwil';
55
- /**
56
- * Full audience list bound into every `storage_access_token` payload. `aud`
57
- * lists every verifier that may accept the token, so both UKYC Storage and
58
- * idOS Kwil can each find their own entry.
59
- */
60
- exports.UKYC_STORAGE_ACCESS_TOKEN_AUDIENCES = [
61
- exports.UKYC_STORAGE_ACCESS_TOKEN_AUDIENCE,
62
- exports.UKYC_KWIL_AUDIENCE,
63
- ];
64
- /**
65
- * Authorization scheme under which a signed `storage_access_token` envelope is
66
- * carried to UKYC Storage: `Authorization: AccessToken <base64url(envelope)>`.
67
- * The credentials portion is what `encodeStorageAccessTokenForHeader` returns.
68
- */
69
- exports.UKYC_CAPABILITY_AUTH_SCHEME = 'AccessToken';
70
- /**
71
- * Standard well-known path where the Fractal encryption service publishes its
72
- * JWKS (the Ed25519 public keys used to sign the `jwtChain`).
73
- */
74
- exports.UKYC_JWKS_PATH = '/.well-known/jwks.json';
75
- //# sourceMappingURL=constants.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/ukyc/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AACU,QAAA,2BAA2B,GAAG,wBAAiC,CAAC;AAE7E;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,EAAE,CAAC;AAEpD;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG;IACpC,SAAS,EAAE,EAAE;IACb,iBAAiB,EAAE,EAAE;IACrB,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,EAAE;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,qCAAqC;IAChD,iBAAiB,EAAE,8CAA8C;IACjE,UAAU,EAAE,sCAAsC;IAClD,cAAc,EAAE,2CAA2C;CACnD,CAAC;AAEX;;GAEG;AACU,QAAA,iCAAiC,GAAG,CAAC,CAAC;AAEnD;;;GAGG;AACU,QAAA,kCAAkC,GAC7C,4BAAqC,CAAC;AAExC;;;GAGG;AACU,QAAA,kBAAkB,GAAG,WAAoB,CAAC;AAEvD;;;;GAIG;AACU,QAAA,mCAAmC,GAAG;IACjD,0CAAkC;IAClC,0BAAkB;CACV,CAAC;AAEX;;;;GAIG;AACU,QAAA,2BAA2B,GAAG,aAAsB,CAAC;AAElE;;;GAGG;AACU,QAAA,cAAc,GAAG,wBAAwB,CAAC","sourcesContent":["/**\n * Constants for the UKYC client-derived key material and storage-authorization\n * layer. See the architecture doc, section \"Client-Derived Material\".\n */\n\n/**\n * Fully-qualified key path for the `local_user_secret` in Encrypted User\n * Storage.\n */\nexport const UKYC_LOCAL_USER_SECRET_PATH = `ukyc.local_user_secret` as const;\n\n/**\n * Size of the `local_user_secret` in bytes. 32 bytes (256 bits) provides high\n * entropy and matches the input length expected by the HKDF-SHA256 derivations\n * below.\n */\nexport const UKYC_LOCAL_USER_SECRET_SIZE_BYTES = 32;\n\n/**\n * Byte length of each value derived from `local_user_secret`.\n *\n * `signingKey` is 32 bytes because it is used directly as the Ed25519\n * private key (for Ed25519 the 32-byte seed *is* the private key).\n */\nexport const UKYC_DERIVED_KEY_SIZES = {\n storageId: 32,\n dataEncryptionKey: 32,\n signingKey: 32,\n relayTunnelKey: 32,\n} as const;\n\n/**\n * HKDF `info` labels providing domain separation between the values derived\n * from `local_user_secret`.\n */\nexport const UKYC_KDF_INFO = {\n storageId: 'metamask.ukyc.storage.v1.storage_id',\n dataEncryptionKey: 'metamask.ukyc.storage.v1.data_encryption_key',\n signingKey: 'metamask.ukyc.storage.v1.signing_key',\n relayTunnelKey: 'metamask.ukyc.storage.v1.relay_tunnel_key',\n} as const;\n\n/**\n * Version bound into every `storage_access_token` payload.\n */\nexport const UKYC_STORAGE_ACCESS_TOKEN_VERSION = 1;\n\n/**\n * Audience identifying the UKYC user-storage service. Required by UKYC Storage\n * when it verifies a `storage_access_token`.\n */\nexport const UKYC_STORAGE_ACCESS_TOKEN_AUDIENCE =\n 'metamask:user-storage:ukyc' as const;\n\n/**\n * Audience identifying the idOS Kwil credential-registry nodes. Required by\n * idOS Kwil when it verifies a `storage_access_token`.\n */\nexport const UKYC_KWIL_AUDIENCE = 'idos:kwil' as const;\n\n/**\n * Full audience list bound into every `storage_access_token` payload. `aud`\n * lists every verifier that may accept the token, so both UKYC Storage and\n * idOS Kwil can each find their own entry.\n */\nexport const UKYC_STORAGE_ACCESS_TOKEN_AUDIENCES = [\n UKYC_STORAGE_ACCESS_TOKEN_AUDIENCE,\n UKYC_KWIL_AUDIENCE,\n] as const;\n\n/**\n * Authorization scheme under which a signed `storage_access_token` envelope is\n * carried to UKYC Storage: `Authorization: AccessToken <base64url(envelope)>`.\n * The credentials portion is what `encodeStorageAccessTokenForHeader` returns.\n */\nexport const UKYC_CAPABILITY_AUTH_SCHEME = 'AccessToken' as const;\n\n/**\n * Standard well-known path where the Fractal encryption service publishes its\n * JWKS (the Ed25519 public keys used to sign the `jwtChain`).\n */\nexport const UKYC_JWKS_PATH = '/.well-known/jwks.json';\n"]}
@@ -1,69 +0,0 @@
1
- /**
2
- * Constants for the UKYC client-derived key material and storage-authorization
3
- * layer. See the architecture doc, section "Client-Derived Material".
4
- */
5
- /**
6
- * Fully-qualified key path for the `local_user_secret` in Encrypted User
7
- * Storage.
8
- */
9
- export declare const UKYC_LOCAL_USER_SECRET_PATH: "ukyc.local_user_secret";
10
- /**
11
- * Size of the `local_user_secret` in bytes. 32 bytes (256 bits) provides high
12
- * entropy and matches the input length expected by the HKDF-SHA256 derivations
13
- * below.
14
- */
15
- export declare const UKYC_LOCAL_USER_SECRET_SIZE_BYTES = 32;
16
- /**
17
- * Byte length of each value derived from `local_user_secret`.
18
- *
19
- * `signingKey` is 32 bytes because it is used directly as the Ed25519
20
- * private key (for Ed25519 the 32-byte seed *is* the private key).
21
- */
22
- export declare const UKYC_DERIVED_KEY_SIZES: {
23
- readonly storageId: 32;
24
- readonly dataEncryptionKey: 32;
25
- readonly signingKey: 32;
26
- readonly relayTunnelKey: 32;
27
- };
28
- /**
29
- * HKDF `info` labels providing domain separation between the values derived
30
- * from `local_user_secret`.
31
- */
32
- export declare const UKYC_KDF_INFO: {
33
- readonly storageId: "metamask.ukyc.storage.v1.storage_id";
34
- readonly dataEncryptionKey: "metamask.ukyc.storage.v1.data_encryption_key";
35
- readonly signingKey: "metamask.ukyc.storage.v1.signing_key";
36
- readonly relayTunnelKey: "metamask.ukyc.storage.v1.relay_tunnel_key";
37
- };
38
- /**
39
- * Version bound into every `storage_access_token` payload.
40
- */
41
- export declare const UKYC_STORAGE_ACCESS_TOKEN_VERSION = 1;
42
- /**
43
- * Audience identifying the UKYC user-storage service. Required by UKYC Storage
44
- * when it verifies a `storage_access_token`.
45
- */
46
- export declare const UKYC_STORAGE_ACCESS_TOKEN_AUDIENCE: "metamask:user-storage:ukyc";
47
- /**
48
- * Audience identifying the idOS Kwil credential-registry nodes. Required by
49
- * idOS Kwil when it verifies a `storage_access_token`.
50
- */
51
- export declare const UKYC_KWIL_AUDIENCE: "idos:kwil";
52
- /**
53
- * Full audience list bound into every `storage_access_token` payload. `aud`
54
- * lists every verifier that may accept the token, so both UKYC Storage and
55
- * idOS Kwil can each find their own entry.
56
- */
57
- export declare const UKYC_STORAGE_ACCESS_TOKEN_AUDIENCES: readonly ["metamask:user-storage:ukyc", "idos:kwil"];
58
- /**
59
- * Authorization scheme under which a signed `storage_access_token` envelope is
60
- * carried to UKYC Storage: `Authorization: AccessToken <base64url(envelope)>`.
61
- * The credentials portion is what `encodeStorageAccessTokenForHeader` returns.
62
- */
63
- export declare const UKYC_CAPABILITY_AUTH_SCHEME: "AccessToken";
64
- /**
65
- * Standard well-known path where the Fractal encryption service publishes its
66
- * JWKS (the Ed25519 public keys used to sign the `jwtChain`).
67
- */
68
- export declare const UKYC_JWKS_PATH = "/.well-known/jwks.json";
69
- //# sourceMappingURL=constants.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/ukyc/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,2BAA2B,0BAAoC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,kCAAkC,8BACR,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,aAAuB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,sDAGtC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,eAAyB,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,cAAc,2BAA2B,CAAC"}