@metamask-previews/kyc-controller 0.0.0-preview-efd9e28b2 → 0.0.0-preview-b123e43e2
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 +0 -6
- package/dist/KycController.cjs +141 -250
- 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 +141 -250
- 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 +1 -21
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +1 -21
- 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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AAG,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;IAoKpC;;;;;;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;IAoIF;;;;;;;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,
|
|
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;
|
|
13
13
|
import { BaseController } from "@metamask/base-controller";
|
|
14
14
|
import { stringToBytes } from "@metamask/utils";
|
|
15
15
|
import { x25519 } from "@noble/curves/ed25519";
|
|
@@ -32,44 +32,10 @@ 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
|
-
// SumSub
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
|
|
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
|
-
}
|
|
35
|
+
// The SumSub SDK status that signals the applicant finished the flow
|
|
36
|
+
// successfully. Any other resolution (abandonment, failure, or a non-success
|
|
37
|
+
// outcome) must not be recorded as `complete`.
|
|
38
|
+
const SUMSUB_COMPLETED_STATUS = 'Completed';
|
|
73
39
|
// Phases that represent an active vendor-session flow (tokens issued and/or
|
|
74
40
|
// Check/Auth frames in progress). A repeat `initialize` while in one of these
|
|
75
41
|
// must not restart the session and disrupt the in-flight flow.
|
|
@@ -933,169 +899,145 @@ export class KycController extends BaseController {
|
|
|
933
899
|
async startSumSub(params) {
|
|
934
900
|
// A new sub-flow supersedes any polling still running from a prior run.
|
|
935
901
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_stopPolling).call(this);
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
902
|
+
if (!__classPrivateFieldGet(this, _KycController_sumsubLauncher, "f").isAvailable()) {
|
|
903
|
+
const error = 'SumSub SDK is not available in this runtime.';
|
|
904
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUpdate).call(this, (state) => {
|
|
905
|
+
state.sumsub.status = 'failed';
|
|
906
|
+
state.sumsub.result = { error };
|
|
907
|
+
});
|
|
908
|
+
throw new Error(error);
|
|
909
|
+
}
|
|
942
910
|
// Capture the flow generation so each async step can detect a `reset()`
|
|
943
911
|
// that lands mid-flight and avoid writing stale sub-flow state (or, worse,
|
|
944
912
|
// presenting the SDK) on a controller that is now idle.
|
|
945
913
|
const generation = __classPrivateFieldGet(this, _KycController_generation, "f");
|
|
946
914
|
try {
|
|
947
|
-
if (!
|
|
948
|
-
const error = 'SumSub SDK is not available in this runtime.';
|
|
915
|
+
if (!this.state.sumsub.sessionId) {
|
|
949
916
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUpdate).call(this, (state) => {
|
|
950
|
-
state.sumsub.status = '
|
|
951
|
-
state.sumsub.result =
|
|
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;
|
|
917
|
+
state.sumsub.status = 'creatingSession';
|
|
918
|
+
state.sumsub.result = null;
|
|
919
|
+
state.sumsub.sessionStatus = null;
|
|
985
920
|
});
|
|
986
|
-
const
|
|
987
|
-
|
|
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) {
|
|
921
|
+
const created = await __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_createUkycSession).call(this, generation);
|
|
922
|
+
if (!created) {
|
|
998
923
|
return {};
|
|
999
924
|
}
|
|
1000
|
-
//
|
|
1001
|
-
//
|
|
1002
|
-
//
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
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';
|
|
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
|
-
}
|
|
925
|
+
// A user who already finished the journey can return to a session the
|
|
926
|
+
// relay has already approved (`kycStatus`) while the vendor is still
|
|
927
|
+
// finalizing its own decision (`finalStatus`). There is nothing left to
|
|
928
|
+
// verify, so stop here and surface a message rather than launching the
|
|
929
|
+
// SDK again.
|
|
930
|
+
if (created.vendorProcessing) {
|
|
931
|
+
return {
|
|
932
|
+
kycStatus: created.kycStatus,
|
|
933
|
+
finalStatus: created.finalStatus,
|
|
934
|
+
};
|
|
1063
935
|
}
|
|
1064
|
-
return result;
|
|
1065
936
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
937
|
+
// Empty string is a valid "no id to poll" session id used by tests and
|
|
938
|
+
// must not be coalesced away as missing.
|
|
939
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
940
|
+
const sessionId = this.state.sumsub.sessionId || '';
|
|
941
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
942
|
+
state.sumsub.status = 'fetchingToken';
|
|
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.
|
|
1072
969
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1073
|
-
|
|
970
|
+
throw new Error('KYC flow was reset; SumSub session is no longer active.');
|
|
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;
|
|
1074
978
|
}
|
|
1075
|
-
__classPrivateFieldGet(this, _KycController_instances, "m",
|
|
1076
|
-
status
|
|
1077
|
-
|
|
1078
|
-
errorCode: null,
|
|
979
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
980
|
+
state.sumsub.status =
|
|
981
|
+
next === SUMSUB_COMPLETED_STATUS ? 'complete' : 'inProgress';
|
|
1079
982
|
});
|
|
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.
|
|
1080
1005
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1081
1006
|
state.sumsub.status = 'complete';
|
|
1082
|
-
state.sumsub.result = { alreadyCompleted: true };
|
|
1083
|
-
state.statusMessage = 'KYC already completed.';
|
|
1084
|
-
state.phase = 'done';
|
|
1085
|
-
state.error = null;
|
|
1086
1007
|
});
|
|
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) {
|
|
1087
1019
|
return { alreadyCompleted: true };
|
|
1088
1020
|
}
|
|
1089
|
-
|
|
1021
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUserStatus).call(this, {
|
|
1022
|
+
status: 'completed',
|
|
1023
|
+
sumsubSessionId: null,
|
|
1024
|
+
errorCode: null,
|
|
1025
|
+
});
|
|
1090
1026
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1091
|
-
state.sumsub.status = '
|
|
1092
|
-
state.sumsub.result =
|
|
1027
|
+
state.sumsub.status = 'complete';
|
|
1028
|
+
state.sumsub.result = { alreadyCompleted: true };
|
|
1029
|
+
state.statusMessage = 'KYC already completed.';
|
|
1030
|
+
state.phase = 'done';
|
|
1031
|
+
state.error = null;
|
|
1093
1032
|
});
|
|
1094
|
-
return
|
|
1033
|
+
return { alreadyCompleted: true };
|
|
1095
1034
|
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1035
|
+
const result = { error: String(error) };
|
|
1036
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1037
|
+
state.sumsub.status = 'failed';
|
|
1038
|
+
state.sumsub.result = result;
|
|
1039
|
+
});
|
|
1040
|
+
return result;
|
|
1099
1041
|
}
|
|
1100
1042
|
}
|
|
1101
1043
|
/**
|
|
@@ -1265,26 +1207,18 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1265
1207
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1266
1208
|
return;
|
|
1267
1209
|
}
|
|
1268
|
-
//
|
|
1269
|
-
//
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
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`.
|
|
1210
|
+
// `startSumSub` records `sumsub.status = 'failed'` for thrown steps,
|
|
1211
|
+
// an SDK close without Completed, *and* a terminal UKYC rejection
|
|
1212
|
+
// after the SDK reported Completed. Only rewind when there is no
|
|
1213
|
+
// session-status decision yet (abandonment / thrown step). A
|
|
1214
|
+
// Completed-then-rejected poll writes `sessionStatus` and is a
|
|
1215
|
+
// finished flow: refresh user status and land on `done`.
|
|
1282
1216
|
if (this.state.sumsub.status === 'failed' &&
|
|
1283
1217
|
this.state.sumsub.sessionStatus === null) {
|
|
1284
1218
|
const sumsubError = sumsubResult?.error;
|
|
1285
1219
|
throw new Error(typeof sumsubError === 'string'
|
|
1286
1220
|
? sumsubError
|
|
1287
|
-
: 'SumSub verification
|
|
1221
|
+
: 'SumSub verification did not complete.');
|
|
1288
1222
|
}
|
|
1289
1223
|
// After SumSub, refresh user-keyed status for the Money toast and start
|
|
1290
1224
|
// polling while still pending. Soft-fail: toast refresh must not rewind
|
|
@@ -1325,41 +1259,20 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1325
1259
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1326
1260
|
return;
|
|
1327
1261
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1262
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_applyUpdate).call(this, (state) => {
|
|
1263
|
+
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_clearAcceptedTerms).call(this, state);
|
|
1264
|
+
state.activeProduct = null;
|
|
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';
|
|
1331
1273
|
});
|
|
1274
|
+
await this.loadDisclaimers();
|
|
1332
1275
|
}
|
|
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();
|
|
1363
1276
|
}, _KycController_recordSessionDisclaimers =
|
|
1364
1277
|
/**
|
|
1365
1278
|
* Fetches the session-scoped disclaimer catalog and records consents
|
|
@@ -1725,28 +1638,6 @@ async function _KycController_fetchAndApplyUserStatus() {
|
|
|
1725
1638
|
tick();
|
|
1726
1639
|
}, __classPrivateFieldGet(this, _KycController_userStatusPollIntervalMs, "f")), "f");
|
|
1727
1640
|
__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
|
-
}
|
|
1750
1641
|
}, _KycController_stopUserStatusPolling = function _KycController_stopUserStatusPolling() {
|
|
1751
1642
|
__classPrivateFieldSet(this, _KycController_userStatusPollToken, __classPrivateFieldGet(this, _KycController_userStatusPollToken, "f") + 1, "f");
|
|
1752
1643
|
__classPrivateFieldSet(this, _KycController_userStatusPolling, false, "f");
|