@p2pdotme/sdk 1.2.1 → 1.2.3
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/README.md +1 -1
- package/dist/country.cjs +117 -2
- package/dist/country.cjs.map +1 -1
- package/dist/country.d.cts +13 -1
- package/dist/country.d.ts +13 -1
- package/dist/country.mjs +114 -2
- package/dist/country.mjs.map +1 -1
- package/dist/fraud-engine.cjs +2 -1
- package/dist/fraud-engine.cjs.map +1 -1
- package/dist/fraud-engine.mjs +2 -1
- package/dist/fraud-engine.mjs.map +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/orders.cjs +42 -1
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +2 -0
- package/dist/orders.d.ts +2 -0
- package/dist/orders.mjs +42 -1
- package/dist/orders.mjs.map +1 -1
- package/dist/prices.cjs +42 -1
- package/dist/prices.cjs.map +1 -1
- package/dist/prices.d.cts +1 -0
- package/dist/prices.d.ts +1 -0
- package/dist/prices.mjs +42 -1
- package/dist/prices.mjs.map +1 -1
- package/dist/profile.cjs +42 -1
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.d.cts +2 -0
- package/dist/profile.d.ts +2 -0
- package/dist/profile.mjs +42 -1
- package/dist/profile.mjs.map +1 -1
- package/dist/qr-parsers.cjs +50 -1
- package/dist/qr-parsers.cjs.map +1 -1
- package/dist/qr-parsers.d.cts +1 -0
- package/dist/qr-parsers.d.ts +1 -0
- package/dist/qr-parsers.mjs +50 -1
- package/dist/qr-parsers.mjs.map +1 -1
- package/dist/react.cjs +71 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +18 -1
- package/dist/react.d.ts +18 -1
- package/dist/react.mjs +71 -2
- package/dist/react.mjs.map +1 -1
- package/dist/stake.cjs +28 -1
- package/dist/stake.cjs.map +1 -1
- package/dist/stake.d.cts +1 -0
- package/dist/stake.d.ts +1 -0
- package/dist/stake.mjs +28 -1
- package/dist/stake.mjs.map +1 -1
- package/dist/zkkyc.cjs +234 -51
- package/dist/zkkyc.cjs.map +1 -1
- package/dist/zkkyc.d.cts +106 -5
- package/dist/zkkyc.d.ts +106 -5
- package/dist/zkkyc.mjs +230 -50
- package/dist/zkkyc.mjs.map +1 -1
- package/package.json +32 -12
package/dist/zkkyc.cjs
CHANGED
|
@@ -32,12 +32,15 @@ var zkkyc_exports = {};
|
|
|
32
32
|
__export(zkkyc_exports, {
|
|
33
33
|
DEFAULT_RECLAIM_PROVIDER_IDS: () => DEFAULT_RECLAIM_PROVIDER_IDS,
|
|
34
34
|
RECLAIM_APP_LINKS: () => RECLAIM_APP_LINKS,
|
|
35
|
+
SIMPLE_KYC_DEFAULT_TENANT: () => SIMPLE_KYC_DEFAULT_TENANT,
|
|
35
36
|
SOCIAL_PLATFORM_NAMES: () => SOCIAL_PLATFORM_NAMES,
|
|
36
37
|
ZK_PASSPORT_APP_LINKS: () => ZK_PASSPORT_APP_LINKS,
|
|
37
38
|
ZkkycError: () => ZkkycError,
|
|
38
39
|
createReclaimFlow: () => createReclaimFlow,
|
|
40
|
+
createSimpleKycFlow: () => createSimpleKycFlow,
|
|
39
41
|
createZkPassportFlow: () => createZkPassportFlow,
|
|
40
|
-
createZkkyc: () => createZkkyc
|
|
42
|
+
createZkkyc: () => createZkkyc,
|
|
43
|
+
resumeSimpleKycFlow: () => resumeSimpleKycFlow
|
|
41
44
|
});
|
|
42
45
|
module.exports = __toCommonJS(zkkyc_exports);
|
|
43
46
|
|
|
@@ -75,7 +78,8 @@ var CURRENCY = {
|
|
|
75
78
|
EUR: "EUR",
|
|
76
79
|
NGN: "NGN",
|
|
77
80
|
USD: "USD",
|
|
78
|
-
COP: "COP"
|
|
81
|
+
COP: "COP",
|
|
82
|
+
ECU: "ECU"
|
|
79
83
|
};
|
|
80
84
|
var CURRENCY_CODES = Object.values(CURRENCY);
|
|
81
85
|
|
|
@@ -169,6 +173,20 @@ var ZodZkPassportRegisterParamsSchema = import_zod2.z.object({
|
|
|
169
173
|
params: ZodSolidityVerifierParametersSchema,
|
|
170
174
|
isIDCard: import_zod2.z.boolean()
|
|
171
175
|
});
|
|
176
|
+
var ZodSimpleKycSubmitParamsSchema = import_zod2.z.object({
|
|
177
|
+
/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */
|
|
178
|
+
nullifier: import_zod2.z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {
|
|
179
|
+
message: "nullifier must be a bytes32 hex string"
|
|
180
|
+
}),
|
|
181
|
+
/** Remaining limit in micro-USDC (part of the signed struct). */
|
|
182
|
+
limit: import_zod2.z.bigint(),
|
|
183
|
+
/** Attestation expiry (unix seconds). */
|
|
184
|
+
expiry: import_zod2.z.bigint(),
|
|
185
|
+
/** 65-byte secp256k1 signature (hex). */
|
|
186
|
+
signature: import_zod2.z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {
|
|
187
|
+
message: "signature must be a hex string"
|
|
188
|
+
})
|
|
189
|
+
});
|
|
172
190
|
|
|
173
191
|
// src/contracts/abis/index.ts
|
|
174
192
|
var import_viem2 = require("viem");
|
|
@@ -947,6 +965,32 @@ var reputationManagerAbi = [
|
|
|
947
965
|
outputs: [],
|
|
948
966
|
stateMutability: "nonpayable",
|
|
949
967
|
type: "function"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
inputs: [
|
|
971
|
+
{ internalType: "bytes32", name: "nullifier", type: "bytes32" },
|
|
972
|
+
{ internalType: "uint256", name: "limit", type: "uint256" },
|
|
973
|
+
{ internalType: "uint256", name: "expiry", type: "uint256" },
|
|
974
|
+
{ internalType: "bytes", name: "signature", type: "bytes" }
|
|
975
|
+
],
|
|
976
|
+
name: "submitKycAttestation",
|
|
977
|
+
outputs: [],
|
|
978
|
+
stateMutability: "nonpayable",
|
|
979
|
+
type: "function"
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
inputs: [],
|
|
983
|
+
name: "kycRp",
|
|
984
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
985
|
+
stateMutability: "view",
|
|
986
|
+
type: "function"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
990
|
+
name: "kycVerified",
|
|
991
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
992
|
+
stateMutability: "view",
|
|
993
|
+
type: "function"
|
|
950
994
|
}
|
|
951
995
|
];
|
|
952
996
|
|
|
@@ -1036,6 +1080,33 @@ function prepareSubmitAnonAadharProof(reputationManagerAddress, params) {
|
|
|
1036
1080
|
)()
|
|
1037
1081
|
);
|
|
1038
1082
|
}
|
|
1083
|
+
function prepareSubmitKycAttestation(reputationManagerAddress, params) {
|
|
1084
|
+
return validate(
|
|
1085
|
+
ZodSimpleKycSubmitParamsSchema,
|
|
1086
|
+
params,
|
|
1087
|
+
(message, cause, data) => new ZkkycError(message, { code: "VALIDATION_ERROR", cause, context: { params: data } })
|
|
1088
|
+
).andThen(
|
|
1089
|
+
(validated) => import_neverthrow2.Result.fromThrowable(
|
|
1090
|
+
() => ({
|
|
1091
|
+
to: reputationManagerAddress,
|
|
1092
|
+
data: (0, import_viem3.encodeFunctionData)({
|
|
1093
|
+
abi: ABIS.EXTERNAL.REPUTATION_MANAGER,
|
|
1094
|
+
functionName: "submitKycAttestation",
|
|
1095
|
+
args: [
|
|
1096
|
+
validated.nullifier,
|
|
1097
|
+
validated.limit,
|
|
1098
|
+
validated.expiry,
|
|
1099
|
+
validated.signature
|
|
1100
|
+
]
|
|
1101
|
+
})
|
|
1102
|
+
}),
|
|
1103
|
+
(error) => new ZkkycError("Failed to encode submitKycAttestation", {
|
|
1104
|
+
code: "ENCODE_ERROR",
|
|
1105
|
+
cause: error
|
|
1106
|
+
})
|
|
1107
|
+
)()
|
|
1108
|
+
);
|
|
1109
|
+
}
|
|
1039
1110
|
function prepareZkPassportRegister(reputationManagerAddress, params) {
|
|
1040
1111
|
return validate(
|
|
1041
1112
|
ZodZkPassportRegisterParamsSchema,
|
|
@@ -1083,7 +1154,8 @@ function createZkkyc(config) {
|
|
|
1083
1154
|
return {
|
|
1084
1155
|
prepareSocialVerify: (params) => prepareSocialVerify(reputationManagerAddress, params),
|
|
1085
1156
|
prepareSubmitAnonAadharProof: (params) => prepareSubmitAnonAadharProof(reputationManagerAddress, params),
|
|
1086
|
-
prepareZkPassportRegister: (params) => prepareZkPassportRegister(reputationManagerAddress, params)
|
|
1157
|
+
prepareZkPassportRegister: (params) => prepareZkPassportRegister(reputationManagerAddress, params),
|
|
1158
|
+
prepareSubmitKycAttestation: (params) => prepareSubmitKycAttestation(reputationManagerAddress, params)
|
|
1087
1159
|
};
|
|
1088
1160
|
}
|
|
1089
1161
|
|
|
@@ -1093,7 +1165,8 @@ var DEFAULT_RECLAIM_PROVIDER_IDS = {
|
|
|
1093
1165
|
github: "033f0c06-2eb3-48c8-894c-5599c3356d1c",
|
|
1094
1166
|
x: "aad95818-f726-4a34-be97-8d1f47631b03",
|
|
1095
1167
|
instagram: "7e5b59a9-56c5-490c-a169-82a443f9b507",
|
|
1096
|
-
facebook: "2701510b-c835-4820-84f0-d9e74569656b"
|
|
1168
|
+
facebook: "2701510b-c835-4820-84f0-d9e74569656b",
|
|
1169
|
+
binance: "7e40c007-f432-4d47-ac00-3e0762f8a7a0"
|
|
1097
1170
|
};
|
|
1098
1171
|
var ZK_PASSPORT_APP_LINKS = {
|
|
1099
1172
|
IOS: "https://apps.apple.com/us/app/zkpassport/id6477371975",
|
|
@@ -1102,6 +1175,7 @@ var ZK_PASSPORT_APP_LINKS = {
|
|
|
1102
1175
|
var RECLAIM_APP_LINKS = {
|
|
1103
1176
|
ANDROID: "https://play.google.com/store/apps/details?id=org.reclaimprotocol.app"
|
|
1104
1177
|
};
|
|
1178
|
+
var SIMPLE_KYC_DEFAULT_TENANT = "p2p-reputation";
|
|
1105
1179
|
|
|
1106
1180
|
// src/zkkyc/orchestrators/reclaim.ts
|
|
1107
1181
|
var import_neverthrow3 = require("neverthrow");
|
|
@@ -1112,7 +1186,8 @@ var SOCIAL_PLATFORM_NAMES = {
|
|
|
1112
1186
|
github: "GitHub",
|
|
1113
1187
|
x: "X",
|
|
1114
1188
|
instagram: "Instagram",
|
|
1115
|
-
facebook: "Facebook"
|
|
1189
|
+
facebook: "Facebook",
|
|
1190
|
+
binance: "Binance"
|
|
1116
1191
|
};
|
|
1117
1192
|
|
|
1118
1193
|
// src/zkkyc/orchestrators/reclaim.ts
|
|
@@ -1142,12 +1217,19 @@ function createReclaimFlow(params) {
|
|
|
1142
1217
|
} = params;
|
|
1143
1218
|
const socialName = SOCIAL_PLATFORM_NAMES[platform];
|
|
1144
1219
|
const providerId = providerIds[platform];
|
|
1220
|
+
let reclaimProofRequest = null;
|
|
1145
1221
|
let sessionId;
|
|
1222
|
+
let requestUrl = "";
|
|
1146
1223
|
if (existingSessionId) {
|
|
1147
1224
|
sessionId = existingSessionId;
|
|
1148
1225
|
} else {
|
|
1149
|
-
|
|
1150
|
-
launchOptions: {
|
|
1226
|
+
reclaimProofRequest = await ReclaimProofRequest.init(appId, appSecret, providerId, {
|
|
1227
|
+
launchOptions: {
|
|
1228
|
+
canUseDeferredDeepLinksFlow: true,
|
|
1229
|
+
verificationMode: "app"
|
|
1230
|
+
},
|
|
1231
|
+
useAppClip: true,
|
|
1232
|
+
log: true
|
|
1151
1233
|
});
|
|
1152
1234
|
const statusUrl = reclaimProofRequest.getStatusUrl();
|
|
1153
1235
|
sessionId = statusUrl.split("/").pop() || "";
|
|
@@ -1161,54 +1243,72 @@ function createReclaimFlow(params) {
|
|
|
1161
1243
|
walletAddress,
|
|
1162
1244
|
contextDescription ?? `Social verification for ${socialName}`
|
|
1163
1245
|
);
|
|
1164
|
-
|
|
1246
|
+
requestUrl = await reclaimProofRequest.getRequestUrl();
|
|
1165
1247
|
onStatus?.({ type: "session_created", sessionId, requestUrl });
|
|
1166
|
-
if (typeof window !== "undefined") {
|
|
1167
|
-
reclaimProofRequest.triggerReclaimFlow();
|
|
1168
|
-
}
|
|
1169
1248
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
1174
|
-
code: "RECLAIM_POLLING_ABORTED"
|
|
1175
|
-
});
|
|
1249
|
+
let aborted = false;
|
|
1250
|
+
const pollForProof = async () => {
|
|
1251
|
+
if (reclaimProofRequest && typeof window !== "undefined") {
|
|
1252
|
+
reclaimProofRequest.triggerReclaimFlow({ verificationMode: "app" });
|
|
1176
1253
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1254
|
+
onStatus?.({ type: "polling_started", sessionId });
|
|
1255
|
+
while (true) {
|
|
1256
|
+
if (aborted || signal?.aborted) {
|
|
1257
|
+
throw new ZkkycError("Reclaim polling aborted", {
|
|
1258
|
+
code: "RECLAIM_POLLING_ABORTED"
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
const response = await fetch(`${RECLAIM_SESSION_API}/${sessionId}`);
|
|
1262
|
+
const data = await response.json();
|
|
1263
|
+
if (data?.session?.proofs?.length > 0) {
|
|
1264
|
+
const proofs = data.session.proofs;
|
|
1265
|
+
onStatus?.({ type: "proof_received" });
|
|
1266
|
+
if (platform === "github" && proofs.length > 0) {
|
|
1267
|
+
const first = proofs[0];
|
|
1268
|
+
if (first?.publicData && Object.keys(first.publicData).length === 0) {
|
|
1269
|
+
throw new ZkkycError("GitHub verification eligibility criteria not met", {
|
|
1270
|
+
code: "RECLAIM_PROOF_INVALID"
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1188
1273
|
}
|
|
1274
|
+
const transformedProofs = proofs.map((proof) => transformForOnchain(proof));
|
|
1275
|
+
onStatus?.({ type: "proof_transformed" });
|
|
1276
|
+
return {
|
|
1277
|
+
_socialName: socialName,
|
|
1278
|
+
proofs: transformedProofs,
|
|
1279
|
+
sessionId
|
|
1280
|
+
};
|
|
1189
1281
|
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1282
|
+
if (data?.message?.includes("Session not found")) {
|
|
1283
|
+
throw new ZkkycError("Reclaim session not found", {
|
|
1284
|
+
code: "RECLAIM_SESSION_NOT_FOUND",
|
|
1285
|
+
context: { sessionId }
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
if (data?.session?.statusV2 === "PROOF_GENERATION_FAILED") {
|
|
1289
|
+
throw new ZkkycError("Reclaim proof generation failed", {
|
|
1290
|
+
code: "RECLAIM_PROOF_GENERATION_FAILED",
|
|
1291
|
+
context: { sessionId }
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
await new Promise((resolve) => setTimeout(resolve, pollingIntervalMs));
|
|
1203
1295
|
}
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1296
|
+
};
|
|
1297
|
+
const session = {
|
|
1298
|
+
sessionId,
|
|
1299
|
+
requestUrl,
|
|
1300
|
+
start: () => import_neverthrow3.ResultAsync.fromPromise(pollForProof(), (error) => {
|
|
1301
|
+
if (error instanceof ZkkycError) return error;
|
|
1302
|
+
return new ZkkycError("Reclaim verification flow failed", {
|
|
1303
|
+
code: "RECLAIM_INIT_FAILED",
|
|
1304
|
+
cause: error
|
|
1208
1305
|
});
|
|
1306
|
+
}),
|
|
1307
|
+
abort: () => {
|
|
1308
|
+
aborted = true;
|
|
1209
1309
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1310
|
+
};
|
|
1311
|
+
return session;
|
|
1212
1312
|
})(),
|
|
1213
1313
|
(error) => {
|
|
1214
1314
|
if (error instanceof ZkkycError) return error;
|
|
@@ -1220,10 +1320,90 @@ function createReclaimFlow(params) {
|
|
|
1220
1320
|
);
|
|
1221
1321
|
}
|
|
1222
1322
|
|
|
1223
|
-
// src/zkkyc/orchestrators/
|
|
1323
|
+
// src/zkkyc/orchestrators/simple-kyc.ts
|
|
1224
1324
|
var import_neverthrow4 = require("neverthrow");
|
|
1225
|
-
function
|
|
1325
|
+
function createSimpleKycFlow(params) {
|
|
1326
|
+
const { baseUrl, walletAddress, tenant, redirectUrl, country, state, onStatus } = params;
|
|
1226
1327
|
return import_neverthrow4.ResultAsync.fromPromise(
|
|
1328
|
+
(async () => {
|
|
1329
|
+
const res = await fetch(`${baseUrl}/v1/widget/public-sessions`, {
|
|
1330
|
+
method: "POST",
|
|
1331
|
+
headers: { "Content-Type": "application/json" },
|
|
1332
|
+
body: JSON.stringify({
|
|
1333
|
+
wallet_pubkey: walletAddress,
|
|
1334
|
+
redirect_uri: redirectUrl,
|
|
1335
|
+
tenant,
|
|
1336
|
+
country,
|
|
1337
|
+
state
|
|
1338
|
+
})
|
|
1339
|
+
});
|
|
1340
|
+
if (!res.ok) {
|
|
1341
|
+
const body = await res.text();
|
|
1342
|
+
throw new ZkkycError(`simple-kyc session creation failed: ${res.status} ${body}`, {
|
|
1343
|
+
code: "SIMPLE_KYC_SESSION_FAILED",
|
|
1344
|
+
context: { status: res.status }
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
const data = await res.json();
|
|
1348
|
+
const widgetUrl = data.widget_url;
|
|
1349
|
+
onStatus?.({ type: "session_created", widgetUrl });
|
|
1350
|
+
return {
|
|
1351
|
+
widgetUrl,
|
|
1352
|
+
redirect: () => {
|
|
1353
|
+
if (typeof window !== "undefined") {
|
|
1354
|
+
onStatus?.({ type: "redirecting", widgetUrl });
|
|
1355
|
+
window.location.href = widgetUrl;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
};
|
|
1359
|
+
})(),
|
|
1360
|
+
(error) => {
|
|
1361
|
+
if (error instanceof ZkkycError) return error;
|
|
1362
|
+
return new ZkkycError("simple-kyc flow failed to start", {
|
|
1363
|
+
code: "SIMPLE_KYC_SESSION_FAILED",
|
|
1364
|
+
cause: error
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
);
|
|
1368
|
+
}
|
|
1369
|
+
function resumeSimpleKycFlow(args) {
|
|
1370
|
+
return import_neverthrow4.ResultAsync.fromPromise(
|
|
1371
|
+
(async () => {
|
|
1372
|
+
const res = await fetch(`${args.baseUrl}/v1/widget/attestation`, {
|
|
1373
|
+
method: "POST",
|
|
1374
|
+
headers: { "Content-Type": "application/json" },
|
|
1375
|
+
body: JSON.stringify({ code: args.code })
|
|
1376
|
+
});
|
|
1377
|
+
if (!res.ok) {
|
|
1378
|
+
const body = await res.text();
|
|
1379
|
+
throw new ZkkycError(`simple-kyc attestation redemption failed: ${res.status} ${body}`, {
|
|
1380
|
+
code: "SIMPLE_KYC_REDEEM_FAILED",
|
|
1381
|
+
context: { status: res.status }
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
const d = await res.json();
|
|
1385
|
+
return {
|
|
1386
|
+
nullifier: d.nullifier,
|
|
1387
|
+
limit: BigInt(d.limit),
|
|
1388
|
+
expiry: BigInt(d.expiry),
|
|
1389
|
+
signature: d.signature,
|
|
1390
|
+
identityHash: d.identity_hash
|
|
1391
|
+
};
|
|
1392
|
+
})(),
|
|
1393
|
+
(error) => {
|
|
1394
|
+
if (error instanceof ZkkycError) return error;
|
|
1395
|
+
return new ZkkycError("simple-kyc attestation redemption failed", {
|
|
1396
|
+
code: "SIMPLE_KYC_REDEEM_FAILED",
|
|
1397
|
+
cause: error
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
// src/zkkyc/orchestrators/zk-passport.ts
|
|
1404
|
+
var import_neverthrow5 = require("neverthrow");
|
|
1405
|
+
function createZkPassportFlow(params) {
|
|
1406
|
+
return import_neverthrow5.ResultAsync.fromPromise(
|
|
1227
1407
|
(async () => {
|
|
1228
1408
|
const mod = await import("@zkpassport/sdk").catch(() => {
|
|
1229
1409
|
throw new ZkkycError(
|
|
@@ -1319,7 +1499,7 @@ function createZkPassportFlow(params) {
|
|
|
1319
1499
|
});
|
|
1320
1500
|
const session = {
|
|
1321
1501
|
url,
|
|
1322
|
-
result:
|
|
1502
|
+
result: import_neverthrow5.ResultAsync.fromPromise(resultPromise, (error) => {
|
|
1323
1503
|
if (error instanceof ZkkycError) return error;
|
|
1324
1504
|
return new ZkkycError("ZK Passport flow failed", {
|
|
1325
1505
|
code: "ZK_PASSPORT_VERIFICATION_FAILED",
|
|
@@ -1345,11 +1525,14 @@ function createZkPassportFlow(params) {
|
|
|
1345
1525
|
0 && (module.exports = {
|
|
1346
1526
|
DEFAULT_RECLAIM_PROVIDER_IDS,
|
|
1347
1527
|
RECLAIM_APP_LINKS,
|
|
1528
|
+
SIMPLE_KYC_DEFAULT_TENANT,
|
|
1348
1529
|
SOCIAL_PLATFORM_NAMES,
|
|
1349
1530
|
ZK_PASSPORT_APP_LINKS,
|
|
1350
1531
|
ZkkycError,
|
|
1351
1532
|
createReclaimFlow,
|
|
1533
|
+
createSimpleKycFlow,
|
|
1352
1534
|
createZkPassportFlow,
|
|
1353
|
-
createZkkyc
|
|
1535
|
+
createZkkyc,
|
|
1536
|
+
resumeSimpleKycFlow
|
|
1354
1537
|
});
|
|
1355
1538
|
//# sourceMappingURL=zkkyc.cjs.map
|