@metamask-previews/kyc-controller 0.0.0-preview-d8fceeabc → 0.0.0-preview-efd9e28b2
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.
- package/CHANGELOG.md +6 -0
- package/dist/KycController.cjs +250 -141
- package/dist/KycController.cjs.map +1 -1
- package/dist/KycController.d.cts.map +1 -1
- package/dist/KycController.d.mts.map +1 -1
- package/dist/KycController.mjs +250 -141
- package/dist/KycController.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +21 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +21 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KycController.d.cts","sourceRoot":"","sources":["../src/KycController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,4CAA4C,EAC5C,4CAA4C,EAC7C,uDAAuD;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAK5C,OAAO,KAAK,EAAE,0BAA0B,EAAE,gDAA+C;AACzF,OAAO,KAAK,EAAE,uBAAuB,EAAE,6CAA4C;AAMnF,OAAO,KAAK,EAEV,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,UAAU,EACV,8BAA8B,EAC9B,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"KycController.d.cts","sourceRoot":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,GAAG,IAAI;IAInC;;;;OAIG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIlC;;;;OAIG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;;;;;;OAOG;IACG,gBAAgB,CAAC,MAAM,EAAE;QAC7B,OAAO,EAAE,UAAU,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,OAAO,CAAC;IAqDpB;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,GAAG,SAAS;IAIlE;;;;;;;;;;;;OAYG;IACH,mBAAmB,IAAI,mBAAmB,GAAG,IAAI;IAmKjD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,WAAW,CAAC,MAAM,CAAC,EAAE;QACzB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA2LpC;;;;;;OAMG;IACG,gBAAgB,IAAI,OAAO,CAAC;QAChC,MAAM,EAAE,aAAa,CAAC;QACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;IA0JF;;;;;;;OAOG;IACG,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAmHnD;;;OAGG;IACH,KAAK,IAAI,IAAI;IAuBb;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI;CA6FnB"}
|
package/dist/KycController.mjs
CHANGED
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _KycController_instances, _KycController_sumsubLauncher, _KycController_moonPayFrames, _KycController_generation, _KycController_sessionStatusPollIntervalMs, _KycController_pollTimer, _KycController_pollToken, _KycController_userStatusPollIntervalMs, _KycController_userStatusPollTimer, _KycController_userStatusPolling, _KycController_userStatusPollToken, _KycController_localUserSecretStore, _KycController_startConsentsSession, _KycController_recordSessionDisclaimers, _KycController_createSession, _KycController_clearAcceptedTerms, _KycController_continueAfterAuthentication, _KycController_requireTermsReacceptance, _KycController_buildUkycSessionVendorFields, _KycController_createUkycSession, _KycController_fetchAndApplyUserStatus, _KycController_applyUserStatus, _KycController_ensureUserStatusPolling, _KycController_stopUserStatusPolling, _KycController_startSessionStatusPolling, _KycController_pollSessionStatusOnce, _KycController_stopPolling, _KycController_cancelPendingSession, _KycController_updateIfCurrent, _KycController_applyUpdate, _KycController_assertAttestedServerPublicKey, _KycController_fail;
|
|
12
|
+
var _KycController_instances, _KycController_sumsubLauncher, _KycController_moonPayFrames, _KycController_generation, _KycController_sessionStatusPollIntervalMs, _KycController_pollTimer, _KycController_pollToken, _KycController_userStatusPollIntervalMs, _KycController_userStatusPollTimer, _KycController_userStatusPolling, _KycController_userStatusPollToken, _KycController_localUserSecretStore, _KycController_startConsentsSession, _KycController_rewindConsentsFlow, _KycController_recordSessionDisclaimers, _KycController_createSession, _KycController_clearAcceptedTerms, _KycController_continueAfterAuthentication, _KycController_requireTermsReacceptance, _KycController_buildUkycSessionVendorFields, _KycController_createUkycSession, _KycController_fetchAndApplyUserStatus, _KycController_applyUserStatus, _KycController_ensureUserStatusPolling, _KycController_resumeUserStatusAfterSumSub, _KycController_stopUserStatusPolling, _KycController_startSessionStatusPolling, _KycController_pollSessionStatusOnce, _KycController_stopPolling, _KycController_cancelPendingSession, _KycController_updateIfCurrent, _KycController_applyUpdate, _KycController_assertAttestedServerPublicKey, _KycController_fail;
|
|
13
13
|
import { BaseController } from "@metamask/base-controller";
|
|
14
14
|
import { stringToBytes } from "@metamask/utils";
|
|
15
15
|
import { x25519 } from "@noble/curves/ed25519";
|
|
@@ -32,10 +32,44 @@ const MOCK_JWT_TOKEN = 'mock-jwt-token';
|
|
|
32
32
|
// cover the KYC session's expected lifetime — including the provider journey —
|
|
33
33
|
// rather than a fixed short window, so this is a session-scoped window.
|
|
34
34
|
const UKYC_CAPABILITY_TOKEN_TTL_MS = 4 * 60 * 60 * 1000;
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
|
|
35
|
+
// SumSub statuses that mean the applicant submitted (see `KycSumSubSdkStatus`
|
|
36
|
+
// for what each one reports). `Completed` covers launchers that normalize the
|
|
37
|
+
// platform status before forwarding it. Review decisions (`Approved`,
|
|
38
|
+
// `FinallyRejected`, `TemporarilyDeclined`) are post-submission outcomes: the
|
|
39
|
+
// applicant finished the SDK, so UKYC is polled for the authoritative
|
|
40
|
+
// decision. Pre-submission statuses (`Ready`, `Initial`, `Incomplete`) must
|
|
41
|
+
// not be recorded as a completed verification.
|
|
42
|
+
const SUMSUB_COMPLETED_STATUSES = new Set([
|
|
43
|
+
'Completed',
|
|
44
|
+
'Pending',
|
|
45
|
+
'Approved',
|
|
46
|
+
'ActionCompleted',
|
|
47
|
+
'FinallyRejected',
|
|
48
|
+
'TemporarilyDeclined',
|
|
49
|
+
]);
|
|
50
|
+
// The only status meaning the SDK could not run, rather than reporting how far
|
|
51
|
+
// the applicant got before closing it.
|
|
52
|
+
const SUMSUB_FAILED_STATUS = 'Failed';
|
|
53
|
+
const SUMSUB_ABANDONED_MESSAGE = 'Identity verification was not finished — accept the terms to try again.';
|
|
54
|
+
/**
|
|
55
|
+
* Checks whether a SumSub status means the applicant submitted the flow.
|
|
56
|
+
*
|
|
57
|
+
* @param status - Status from a launcher callback or launch result.
|
|
58
|
+
* @returns Whether the applicant submitted, including a review decision.
|
|
59
|
+
*/
|
|
60
|
+
function isSumSubFlowCompleted(status) {
|
|
61
|
+
return typeof status === 'string' && SUMSUB_COMPLETED_STATUSES.has(status);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Checks whether the SDK failed to run, as opposed to the applicant closing it
|
|
65
|
+
* early. Only the former is worth reporting as an error.
|
|
66
|
+
*
|
|
67
|
+
* @param result - The result the launcher resolved with.
|
|
68
|
+
* @returns Whether the SDK failed to run.
|
|
69
|
+
*/
|
|
70
|
+
function isSumSubLaunchFailure(result) {
|
|
71
|
+
return (result.status === SUMSUB_FAILED_STATUS || typeof result.error === 'string');
|
|
72
|
+
}
|
|
39
73
|
// Phases that represent an active vendor-session flow (tokens issued and/or
|
|
40
74
|
// Check/Auth frames in progress). A repeat `initialize` while in one of these
|
|
41
75
|
// must not restart the session and disrupt the in-flight flow.
|
|
@@ -899,145 +933,169 @@ export class KycController extends BaseController {
|
|
|
899
933
|
async startSumSub(params) {
|
|
900
934
|
// A new sub-flow supersedes any polling still running from a prior run.
|
|
901
935
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_stopPolling).call(this);
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
throw new Error(error);
|
|
909
|
-
}
|
|
936
|
+
// Paused for the whole sub-flow: a tick landing while the SDK is on screen
|
|
937
|
+
// publishes `statusChanged`, pulling consumers (and their signing prompts)
|
|
938
|
+
// in front of a flow the applicant has not finished. Resumed in `finally`
|
|
939
|
+
// so abandonment, SDK failure, and callers that do not run
|
|
940
|
+
// `refreshKycStatus` (MoonPay post-auth) still restore the loop.
|
|
941
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_stopUserStatusPolling).call(this);
|
|
910
942
|
// Capture the flow generation so each async step can detect a `reset()`
|
|
911
943
|
// that lands mid-flight and avoid writing stale sub-flow state (or, worse,
|
|
912
944
|
// presenting the SDK) on a controller that is now idle.
|
|
913
945
|
const generation = __classPrivateFieldGet(this, _KycController_generation, "f");
|
|
914
946
|
try {
|
|
915
|
-
if (!this.
|
|
947
|
+
if (!__classPrivateFieldGet(this, _KycController_sumsubLauncher, "f").isAvailable()) {
|
|
948
|
+
const error = 'SumSub SDK is not available in this runtime.';
|
|
916
949
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUpdate).call(this, (state) => {
|
|
917
|
-
state.sumsub.status = '
|
|
918
|
-
state.sumsub.result =
|
|
919
|
-
|
|
950
|
+
state.sumsub.status = 'failed';
|
|
951
|
+
state.sumsub.result = { error };
|
|
952
|
+
});
|
|
953
|
+
throw new Error(error);
|
|
954
|
+
}
|
|
955
|
+
try {
|
|
956
|
+
if (!this.state.sumsub.sessionId) {
|
|
957
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUpdate).call(this, (state) => {
|
|
958
|
+
state.sumsub.status = 'creatingSession';
|
|
959
|
+
state.sumsub.result = null;
|
|
960
|
+
state.sumsub.sessionStatus = null;
|
|
961
|
+
});
|
|
962
|
+
const created = await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_createUkycSession).call(this, generation);
|
|
963
|
+
if (!created) {
|
|
964
|
+
return {};
|
|
965
|
+
}
|
|
966
|
+
// A user who already finished the journey can return to a session the
|
|
967
|
+
// relay has already approved (`kycStatus`) while the vendor is still
|
|
968
|
+
// finalizing its own decision (`finalStatus`). There is nothing left to
|
|
969
|
+
// verify, so stop here and surface a message rather than launching the
|
|
970
|
+
// SDK again.
|
|
971
|
+
if (created.vendorProcessing) {
|
|
972
|
+
return {
|
|
973
|
+
kycStatus: created.kycStatus,
|
|
974
|
+
finalStatus: created.finalStatus,
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
// Empty string is a valid "no id to poll" session id used by tests and
|
|
979
|
+
// must not be coalesced away as missing.
|
|
980
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
981
|
+
const sessionId = this.state.sumsub.sessionId || '';
|
|
982
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
983
|
+
state.sumsub.status = 'fetchingToken';
|
|
984
|
+
state.sumsub.sessionId = sessionId;
|
|
920
985
|
});
|
|
921
|
-
const
|
|
922
|
-
|
|
986
|
+
const { applicantAccessToken } = await this.messenger.call('KycService:createJourney', sessionId);
|
|
987
|
+
// A reset() may have landed while the session/token was being prepared.
|
|
988
|
+
// Gate the `launching` write and the decision to open the SDK behind a
|
|
989
|
+
// single generation check: `#updateIfCurrent` only writes when still
|
|
990
|
+
// current and reports whether it did. Since there is no `await` between
|
|
991
|
+
// this check and `launch` below, a successful result guarantees the SDK
|
|
992
|
+
// is never presented on a flow that a concurrent reset() returned to idle.
|
|
993
|
+
const stillCurrent = __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
994
|
+
state.sumsub.status = 'launching';
|
|
995
|
+
state.sumsub.applicantAccessToken = applicantAccessToken;
|
|
996
|
+
});
|
|
997
|
+
if (!stillCurrent) {
|
|
923
998
|
return {};
|
|
924
999
|
}
|
|
925
|
-
//
|
|
926
|
-
//
|
|
927
|
-
//
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1000
|
+
// Track whether the SDK ever reported a successful completion. A resolved
|
|
1001
|
+
// `launch` alone does not imply success — the applicant may have
|
|
1002
|
+
// abandoned the flow or the SDK may have reported a non-success outcome.
|
|
1003
|
+
let reachedCompletion = false;
|
|
1004
|
+
const result = await __classPrivateFieldGet(this, _KycController_sumsubLauncher, "f").launch({
|
|
1005
|
+
applicantAccessToken,
|
|
1006
|
+
onTokenExpiration: async () => {
|
|
1007
|
+
// A reset() may have superseded this flow while the SDK stayed open.
|
|
1008
|
+
// Refuse to refresh against the now-stale UKYC session rather than
|
|
1009
|
+
// silently keeping an orphaned SDK alive.
|
|
1010
|
+
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1011
|
+
throw new Error('KYC flow was reset; SumSub session is no longer active.');
|
|
1012
|
+
}
|
|
1013
|
+
const refreshed = await this.messenger.call('KycService:createJourney', sessionId);
|
|
1014
|
+
return refreshed.applicantAccessToken;
|
|
1015
|
+
},
|
|
1016
|
+
onStatusChange: (_prev, next) => {
|
|
1017
|
+
if (isSumSubFlowCompleted(next)) {
|
|
1018
|
+
reachedCompletion = true;
|
|
1019
|
+
}
|
|
1020
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1021
|
+
state.sumsub.status = isSumSubFlowCompleted(next)
|
|
1022
|
+
? 'complete'
|
|
1023
|
+
: 'inProgress';
|
|
1024
|
+
});
|
|
1025
|
+
},
|
|
1026
|
+
locale: params?.locale ?? 'en',
|
|
1027
|
+
debug: params?.debug ?? false,
|
|
1028
|
+
});
|
|
1029
|
+
// Some native SDKs resolve with their final status without first
|
|
1030
|
+
// delivering the corresponding state-change callback.
|
|
1031
|
+
reachedCompletion || (reachedCompletion = isSumSubFlowCompleted(result.status));
|
|
1032
|
+
// A resolved `launch` alone is not the final outcome: only a submission
|
|
1033
|
+
// is worth polling for a decision. Without one, the SDK status is the
|
|
1034
|
+
// only way to tell a failure from an applicant who closed the SDK early
|
|
1035
|
+
// — the UKYC session leaves its initial state as soon as the journey is
|
|
1036
|
+
// created, so it cannot stand in for "the applicant finished".
|
|
1037
|
+
let settledStatus = 'abandoned';
|
|
1038
|
+
if (reachedCompletion) {
|
|
1039
|
+
settledStatus = 'polling';
|
|
935
1040
|
}
|
|
1041
|
+
else if (isSumSubLaunchFailure(result)) {
|
|
1042
|
+
settledStatus = 'failed';
|
|
1043
|
+
}
|
|
1044
|
+
const applied = __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1045
|
+
state.sumsub.status = settledStatus;
|
|
1046
|
+
state.sumsub.result = result;
|
|
1047
|
+
});
|
|
1048
|
+
// Once the SDK completes, the authoritative verification decision comes
|
|
1049
|
+
// from the UKYC backend, not the SDK result. Poll the session status
|
|
1050
|
+
// until it reaches a terminal decision. Guard on `applied` so a `reset()`
|
|
1051
|
+
// that landed during `launch` cannot start polling on an idle flow.
|
|
1052
|
+
if (applied && reachedCompletion) {
|
|
1053
|
+
if (sessionId) {
|
|
1054
|
+
await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_startSessionStatusPolling).call(this, sessionId);
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
// No session id to poll against; fall back to treating the SDK
|
|
1058
|
+
// completion as the final outcome.
|
|
1059
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1060
|
+
state.sumsub.status = 'complete';
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
return result;
|
|
936
1065
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
state.sumsub.sessionId = sessionId;
|
|
944
|
-
});
|
|
945
|
-
const { applicantAccessToken } = await this.messenger.call('KycService:createJourney', sessionId);
|
|
946
|
-
// A reset() may have landed while the session/token was being prepared.
|
|
947
|
-
// Gate the `launching` write and the decision to open the SDK behind a
|
|
948
|
-
// single generation check: `#updateIfCurrent` only writes when still
|
|
949
|
-
// current and reports whether it did. Since there is no `await` between
|
|
950
|
-
// this check and `launch` below, a successful result guarantees the SDK
|
|
951
|
-
// is never presented on a flow that a concurrent reset() returned to idle.
|
|
952
|
-
const stillCurrent = __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
953
|
-
state.sumsub.status = 'launching';
|
|
954
|
-
state.sumsub.applicantAccessToken = applicantAccessToken;
|
|
955
|
-
});
|
|
956
|
-
if (!stillCurrent) {
|
|
957
|
-
return {};
|
|
958
|
-
}
|
|
959
|
-
// Track whether the SDK ever reported a successful completion. A resolved
|
|
960
|
-
// `launch` alone does not imply success — the applicant may have
|
|
961
|
-
// abandoned the flow or the SDK may have reported a non-success outcome.
|
|
962
|
-
let reachedCompletion = false;
|
|
963
|
-
const result = await __classPrivateFieldGet(this, _KycController_sumsubLauncher, "f").launch({
|
|
964
|
-
applicantAccessToken,
|
|
965
|
-
onTokenExpiration: async () => {
|
|
966
|
-
// A reset() may have superseded this flow while the SDK stayed open.
|
|
967
|
-
// Refuse to refresh against the now-stale UKYC session rather than
|
|
968
|
-
// silently keeping an orphaned SDK alive.
|
|
1066
|
+
catch (error) {
|
|
1067
|
+
// Applicant already finished KYC — treat as completed for Money toast.
|
|
1068
|
+
if (isSessionAlreadyCompletedError(error)) {
|
|
1069
|
+
// A reset() may have landed while `launch` was in flight; forcing
|
|
1070
|
+
// `completed` (and publishing `statusChanged`) on an idle controller
|
|
1071
|
+
// would resurrect a flow the consumer already tore down.
|
|
969
1072
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
970
|
-
|
|
971
|
-
}
|
|
972
|
-
const refreshed = await this.messenger.call('KycService:createJourney', sessionId);
|
|
973
|
-
return refreshed.applicantAccessToken;
|
|
974
|
-
},
|
|
975
|
-
onStatusChange: (_prev, next) => {
|
|
976
|
-
if (next === SUMSUB_COMPLETED_STATUS) {
|
|
977
|
-
reachedCompletion = true;
|
|
1073
|
+
return { alreadyCompleted: true };
|
|
978
1074
|
}
|
|
979
|
-
__classPrivateFieldGet(this, _KycController_instances, "m",
|
|
980
|
-
|
|
981
|
-
|
|
1075
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUserStatus).call(this, {
|
|
1076
|
+
status: 'completed',
|
|
1077
|
+
sumsubSessionId: null,
|
|
1078
|
+
errorCode: null,
|
|
982
1079
|
});
|
|
983
|
-
},
|
|
984
|
-
locale: params?.locale ?? 'en',
|
|
985
|
-
debug: params?.debug ?? false,
|
|
986
|
-
});
|
|
987
|
-
// A resolved `launch` alone is not the final outcome: only a SDK-reported
|
|
988
|
-
// completion is worth polling for a verification decision. Anything else
|
|
989
|
-
// (abandonment, non-success) is `failed` and must not be polled.
|
|
990
|
-
const applied = __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
991
|
-
state.sumsub.status = reachedCompletion ? 'polling' : 'failed';
|
|
992
|
-
state.sumsub.result = result;
|
|
993
|
-
});
|
|
994
|
-
// Once the SDK completes, the authoritative verification decision comes
|
|
995
|
-
// from the UKYC backend, not the SDK result. Poll the session status
|
|
996
|
-
// until it reaches a terminal decision. Guard on `applied` so a `reset()`
|
|
997
|
-
// that landed during `launch` cannot start polling on an idle flow.
|
|
998
|
-
if (applied && reachedCompletion) {
|
|
999
|
-
if (sessionId) {
|
|
1000
|
-
await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_startSessionStatusPolling).call(this, sessionId);
|
|
1001
|
-
}
|
|
1002
|
-
else {
|
|
1003
|
-
// No session id to poll against; fall back to treating the SDK
|
|
1004
|
-
// completion as the final outcome.
|
|
1005
1080
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1006
1081
|
state.sumsub.status = 'complete';
|
|
1082
|
+
state.sumsub.result = { alreadyCompleted: true };
|
|
1083
|
+
state.statusMessage = 'KYC already completed.';
|
|
1084
|
+
state.phase = 'done';
|
|
1085
|
+
state.error = null;
|
|
1007
1086
|
});
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
return result;
|
|
1011
|
-
}
|
|
1012
|
-
catch (error) {
|
|
1013
|
-
// Applicant already finished KYC — treat as completed for Money toast.
|
|
1014
|
-
if (isSessionAlreadyCompletedError(error)) {
|
|
1015
|
-
// A reset() may have landed while `launch` was in flight; forcing
|
|
1016
|
-
// `completed` (and publishing `statusChanged`) on an idle controller
|
|
1017
|
-
// would resurrect a flow the consumer already tore down.
|
|
1018
|
-
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1019
1087
|
return { alreadyCompleted: true };
|
|
1020
1088
|
}
|
|
1021
|
-
|
|
1022
|
-
status: 'completed',
|
|
1023
|
-
sumsubSessionId: null,
|
|
1024
|
-
errorCode: null,
|
|
1025
|
-
});
|
|
1089
|
+
const result = { error: String(error) };
|
|
1026
1090
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1027
|
-
state.sumsub.status = '
|
|
1028
|
-
state.sumsub.result =
|
|
1029
|
-
state.statusMessage = 'KYC already completed.';
|
|
1030
|
-
state.phase = 'done';
|
|
1031
|
-
state.error = null;
|
|
1091
|
+
state.sumsub.status = 'failed';
|
|
1092
|
+
state.sumsub.result = result;
|
|
1032
1093
|
});
|
|
1033
|
-
return
|
|
1094
|
+
return result;
|
|
1034
1095
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
state.sumsub.result = result;
|
|
1039
|
-
});
|
|
1040
|
-
return result;
|
|
1096
|
+
}
|
|
1097
|
+
finally {
|
|
1098
|
+
await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_resumeUserStatusAfterSumSub).call(this, generation);
|
|
1041
1099
|
}
|
|
1042
1100
|
}
|
|
1043
1101
|
/**
|
|
@@ -1207,18 +1265,26 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1207
1265
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1208
1266
|
return;
|
|
1209
1267
|
}
|
|
1210
|
-
//
|
|
1211
|
-
//
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1268
|
+
// The applicant closed the SDK without submitting. Nothing failed, so
|
|
1269
|
+
// rewind with `error` unset and let consumers offer a retry.
|
|
1270
|
+
if (this.state.sumsub.status === 'abandoned') {
|
|
1271
|
+
await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_rewindConsentsFlow).call(this, {
|
|
1272
|
+
error: null,
|
|
1273
|
+
statusMessage: SUMSUB_ABANDONED_MESSAGE,
|
|
1274
|
+
keepSumSubStatus: 'abandoned',
|
|
1275
|
+
});
|
|
1276
|
+
return;
|
|
1277
|
+
}
|
|
1278
|
+
// `startSumSub` records `failed` for thrown steps, an SDK that could not
|
|
1279
|
+
// run, *and* a terminal UKYC rejection after a submission. Only the first
|
|
1280
|
+
// two rewind. A rejection writes `sessionStatus` and is a finished flow:
|
|
1281
|
+
// refresh user status and land on `done`.
|
|
1216
1282
|
if (this.state.sumsub.status === 'failed' &&
|
|
1217
1283
|
this.state.sumsub.sessionStatus === null) {
|
|
1218
1284
|
const sumsubError = sumsubResult?.error;
|
|
1219
1285
|
throw new Error(typeof sumsubError === 'string'
|
|
1220
1286
|
? sumsubError
|
|
1221
|
-
: 'SumSub verification
|
|
1287
|
+
: 'SumSub verification could not run.');
|
|
1222
1288
|
}
|
|
1223
1289
|
// After SumSub, refresh user-keyed status for the Money toast and start
|
|
1224
1290
|
// polling while still pending. Soft-fail: toast refresh must not rewind
|
|
@@ -1259,20 +1325,41 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1259
1325
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1260
1326
|
return;
|
|
1261
1327
|
}
|
|
1262
|
-
__classPrivateFieldGet(this, _KycController_instances, "m",
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
state.sessionDisclaimers = null;
|
|
1266
|
-
// Session create ran before recording disclaimers. Drop the leftover
|
|
1267
|
-
// UKYC session so a later `startSumSub` cannot skip consent recording.
|
|
1268
|
-
state.sumsub = { ...getDefaultKycControllerState().sumsub };
|
|
1269
|
-
state.error = `Consents session failed: ${String(error)}`;
|
|
1270
|
-
state.statusMessage =
|
|
1271
|
-
'Consent / verification failed — accept the terms to try again.';
|
|
1272
|
-
state.phase = 'terms';
|
|
1328
|
+
await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_rewindConsentsFlow).call(this, {
|
|
1329
|
+
error: `Consents session failed: ${String(error)}`,
|
|
1330
|
+
statusMessage: 'Consent / verification failed — accept the terms to try again.',
|
|
1273
1331
|
});
|
|
1274
|
-
await this.loadDisclaimers();
|
|
1275
1332
|
}
|
|
1333
|
+
}, _KycController_rewindConsentsFlow =
|
|
1334
|
+
/**
|
|
1335
|
+
* Returns the consents path to the terms phase after a SumSub sub-flow that
|
|
1336
|
+
* produced no verification decision, and reloads the disclaimers the next
|
|
1337
|
+
* attempt has to re-accept.
|
|
1338
|
+
*
|
|
1339
|
+
* @param options - Rewind options.
|
|
1340
|
+
* @param options.error - Message for `error`, or `null` when the rewind is a
|
|
1341
|
+
* normal outcome rather than a failure.
|
|
1342
|
+
* @param options.statusMessage - Message for `statusMessage`.
|
|
1343
|
+
* @param options.keepSumSubStatus - Sub-flow status to survive the rewind,
|
|
1344
|
+
* for an outcome consumers still need once the call resolves. Defaults to the
|
|
1345
|
+
* reset `idle`.
|
|
1346
|
+
*/
|
|
1347
|
+
async function _KycController_rewindConsentsFlow({ error, statusMessage, keepSumSubStatus, }) {
|
|
1348
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUpdate).call(this, (state) => {
|
|
1349
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_clearAcceptedTerms).call(this, state);
|
|
1350
|
+
state.activeProduct = null;
|
|
1351
|
+
state.sessionDisclaimers = null;
|
|
1352
|
+
// Session create ran before recording disclaimers. Drop the leftover
|
|
1353
|
+
// UKYC session so a later `startSumSub` cannot skip consent recording.
|
|
1354
|
+
state.sumsub = { ...getDefaultKycControllerState().sumsub };
|
|
1355
|
+
if (keepSumSubStatus) {
|
|
1356
|
+
state.sumsub.status = keepSumSubStatus;
|
|
1357
|
+
}
|
|
1358
|
+
state.error = error;
|
|
1359
|
+
state.statusMessage = statusMessage;
|
|
1360
|
+
state.phase = 'terms';
|
|
1361
|
+
});
|
|
1362
|
+
await this.loadDisclaimers();
|
|
1276
1363
|
}, _KycController_recordSessionDisclaimers =
|
|
1277
1364
|
/**
|
|
1278
1365
|
* Fetches the session-scoped disclaimer catalog and records consents
|
|
@@ -1638,6 +1725,28 @@ async function _KycController_fetchAndApplyUserStatus() {
|
|
|
1638
1725
|
tick();
|
|
1639
1726
|
}, __classPrivateFieldGet(this, _KycController_userStatusPollIntervalMs, "f")), "f");
|
|
1640
1727
|
__classPrivateFieldGet(this, _KycController_userStatusPollTimer, "f").unref?.();
|
|
1728
|
+
}, _KycController_resumeUserStatusAfterSumSub =
|
|
1729
|
+
/**
|
|
1730
|
+
* Restores user-keyed `GET /kyc/status` polling after {@link startSumSub}
|
|
1731
|
+
* settles. Skipped when a `reset()` superseded the sub-flow.
|
|
1732
|
+
*
|
|
1733
|
+
* @param generation - Flow generation captured when the sub-flow started.
|
|
1734
|
+
*/
|
|
1735
|
+
async function _KycController_resumeUserStatusAfterSumSub(generation) {
|
|
1736
|
+
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
// `session_not_in_valid_state` already wrote `completed`. A follow-up
|
|
1740
|
+
// `GET /kyc/status` can still read a stale `pending` and must not undo it.
|
|
1741
|
+
if (this.state.userStatus === 'completed') {
|
|
1742
|
+
return;
|
|
1743
|
+
}
|
|
1744
|
+
try {
|
|
1745
|
+
await this.refreshKycStatus();
|
|
1746
|
+
}
|
|
1747
|
+
catch (error) {
|
|
1748
|
+
controllerLog('KYC status refresh failed:', error);
|
|
1749
|
+
}
|
|
1641
1750
|
}, _KycController_stopUserStatusPolling = function _KycController_stopUserStatusPolling() {
|
|
1642
1751
|
__classPrivateFieldSet(this, _KycController_userStatusPollToken, __classPrivateFieldGet(this, _KycController_userStatusPollToken, "f") + 1, "f");
|
|
1643
1752
|
__classPrivateFieldSet(this, _KycController_userStatusPolling, false, "f");
|