@settlemint/sdk-js 1.1.3-pr1322fc8f → 1.1.3-pr3d226c76
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/dist/challenge.cjs +72 -0
- package/dist/challenge.cjs.map +1 -0
- package/dist/challenge.d.cts +19 -0
- package/dist/challenge.d.ts +19 -0
- package/dist/challenge.mjs +47 -0
- package/dist/challenge.mjs.map +1 -0
- package/dist/settlemint.cjs +45 -51
- package/dist/settlemint.cjs.map +1 -1
- package/dist/settlemint.d.cts +9 -9
- package/dist/settlemint.d.ts +9 -9
- package/dist/settlemint.mjs +45 -51
- package/dist/settlemint.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/challenge.ts
|
|
21
|
+
var challenge_exports = {};
|
|
22
|
+
__export(challenge_exports, {
|
|
23
|
+
handleChallenge: () => handleChallenge
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(challenge_exports);
|
|
26
|
+
var import_node_crypto = require("crypto");
|
|
27
|
+
function hashPincode(pincode, salt) {
|
|
28
|
+
return (0, import_node_crypto.createHash)("sha256").update(`${salt}${pincode}`).digest("hex");
|
|
29
|
+
}
|
|
30
|
+
function generateChallengeResponse(pincode, salt, challenge) {
|
|
31
|
+
const hashedPincode = hashPincode(pincode, salt);
|
|
32
|
+
return (0, import_node_crypto.createHash)("sha256").update(`${hashedPincode}_${challenge}`).digest("hex");
|
|
33
|
+
}
|
|
34
|
+
async function handleChallenge({
|
|
35
|
+
userWalletAddress,
|
|
36
|
+
pincode,
|
|
37
|
+
accessToken,
|
|
38
|
+
instance,
|
|
39
|
+
nodeId
|
|
40
|
+
}) {
|
|
41
|
+
const response = await fetch(`${instance}/cm/nodes/${nodeId}/${userWalletAddress}/verifications`, {
|
|
42
|
+
method: "POST",
|
|
43
|
+
headers: {
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
"x-auth-token": accessToken
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify({
|
|
48
|
+
pincode,
|
|
49
|
+
verificationType: "PINCODE",
|
|
50
|
+
name: "pincode"
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
if (!response.ok) {
|
|
54
|
+
throw new Error("Failed to handle challenge");
|
|
55
|
+
}
|
|
56
|
+
const verificationChallenges = await response.json();
|
|
57
|
+
if (!verificationChallenges.length) {
|
|
58
|
+
throw new Error("No verification challenges received");
|
|
59
|
+
}
|
|
60
|
+
const firstChallenge = verificationChallenges[0];
|
|
61
|
+
const challenge = firstChallenge?.challenge;
|
|
62
|
+
if (!challenge?.secret || !challenge?.salt) {
|
|
63
|
+
throw new Error("Could not authenticate pin code, invalid challenge format");
|
|
64
|
+
}
|
|
65
|
+
const { secret, salt } = challenge;
|
|
66
|
+
return generateChallengeResponse(pincode, salt, secret);
|
|
67
|
+
}
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
handleChallenge
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=challenge.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/challenge.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\nfunction hashPincode(pincode: string, salt: string): string {\n return createHash(\"sha256\").update(`${salt}${pincode}`).digest(\"hex\");\n}\n\nfunction generateChallengeResponse(pincode: string, salt: string, challenge: string): string {\n const hashedPincode = hashPincode(pincode, salt);\n return createHash(\"sha256\").update(`${hashedPincode}_${challenge}`).digest(\"hex\");\n}\n\nexport interface HandleChallengeArgs {\n userWalletAddress: string;\n pincode: string;\n accessToken: string;\n instance: string;\n nodeId: string;\n}\n\n/**\n * Handles a challenge for a user wallet address.\n * @param userWalletAddress - The user's wallet address.\n * @param pincode - The user's pincode.\n * @param accessToken - The user's access token.\n * @param instance - The instance URL.\n * @param nodeId - The node ID.\n * @returns The challenge response.\n */\nexport async function handleChallenge({\n userWalletAddress,\n pincode,\n accessToken,\n instance,\n nodeId,\n}: HandleChallengeArgs) {\n const response = await fetch(`${instance}/cm/nodes/${nodeId}/${userWalletAddress}/verifications`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-auth-token\": accessToken,\n },\n body: JSON.stringify({\n pincode,\n verificationType: \"PINCODE\",\n name: \"pincode\",\n }),\n });\n\n if (!response.ok) {\n throw new Error(\"Failed to handle challenge\");\n }\n\n const verificationChallenges: { challenge: { secret: string; salt: string } }[] = await response.json();\n if (!verificationChallenges.length) {\n throw new Error(\"No verification challenges received\");\n }\n\n const firstChallenge = verificationChallenges[0];\n const challenge = firstChallenge?.challenge as { secret: string; salt: string } | null;\n if (!challenge?.secret || !challenge?.salt) {\n throw new Error(\"Could not authenticate pin code, invalid challenge format\");\n }\n\n const { secret, salt } = challenge;\n return generateChallengeResponse(pincode, salt, secret);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B;AAE3B,SAAS,YAAY,SAAiB,MAAsB;AAC1D,aAAO,+BAAW,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,EAAE,EAAE,OAAO,KAAK;AACtE;AAEA,SAAS,0BAA0B,SAAiB,MAAc,WAA2B;AAC3F,QAAM,gBAAgB,YAAY,SAAS,IAAI;AAC/C,aAAO,+BAAW,QAAQ,EAAE,OAAO,GAAG,aAAa,IAAI,SAAS,EAAE,EAAE,OAAO,KAAK;AAClF;AAmBA,eAAsB,gBAAgB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,aAAa,MAAM,IAAI,iBAAiB,kBAAkB;AAAA,IAChG,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,IAClB;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,MAClB,MAAM;AAAA,IACR,CAAC;AAAA,EACH,CAAC;AAED,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AAEA,QAAM,yBAA4E,MAAM,SAAS,KAAK;AACtG,MAAI,CAAC,uBAAuB,QAAQ;AAClC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACvD;AAEA,QAAM,iBAAiB,uBAAuB,CAAC;AAC/C,QAAM,YAAY,gBAAgB;AAClC,MAAI,CAAC,WAAW,UAAU,CAAC,WAAW,MAAM;AAC1C,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AAEA,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,SAAO,0BAA0B,SAAS,MAAM,MAAM;AACxD;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface HandleChallengeArgs {
|
|
2
|
+
userWalletAddress: string;
|
|
3
|
+
pincode: string;
|
|
4
|
+
accessToken: string;
|
|
5
|
+
instance: string;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Handles a challenge for a user wallet address.
|
|
10
|
+
* @param userWalletAddress - The user's wallet address.
|
|
11
|
+
* @param pincode - The user's pincode.
|
|
12
|
+
* @param accessToken - The user's access token.
|
|
13
|
+
* @param instance - The instance URL.
|
|
14
|
+
* @param nodeId - The node ID.
|
|
15
|
+
* @returns The challenge response.
|
|
16
|
+
*/
|
|
17
|
+
declare function handleChallenge({ userWalletAddress, pincode, accessToken, instance, nodeId, }: HandleChallengeArgs): Promise<string>;
|
|
18
|
+
|
|
19
|
+
export { type HandleChallengeArgs, handleChallenge };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface HandleChallengeArgs {
|
|
2
|
+
userWalletAddress: string;
|
|
3
|
+
pincode: string;
|
|
4
|
+
accessToken: string;
|
|
5
|
+
instance: string;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Handles a challenge for a user wallet address.
|
|
10
|
+
* @param userWalletAddress - The user's wallet address.
|
|
11
|
+
* @param pincode - The user's pincode.
|
|
12
|
+
* @param accessToken - The user's access token.
|
|
13
|
+
* @param instance - The instance URL.
|
|
14
|
+
* @param nodeId - The node ID.
|
|
15
|
+
* @returns The challenge response.
|
|
16
|
+
*/
|
|
17
|
+
declare function handleChallenge({ userWalletAddress, pincode, accessToken, instance, nodeId, }: HandleChallengeArgs): Promise<string>;
|
|
18
|
+
|
|
19
|
+
export { type HandleChallengeArgs, handleChallenge };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/challenge.ts
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
function hashPincode(pincode, salt) {
|
|
4
|
+
return createHash("sha256").update(`${salt}${pincode}`).digest("hex");
|
|
5
|
+
}
|
|
6
|
+
function generateChallengeResponse(pincode, salt, challenge) {
|
|
7
|
+
const hashedPincode = hashPincode(pincode, salt);
|
|
8
|
+
return createHash("sha256").update(`${hashedPincode}_${challenge}`).digest("hex");
|
|
9
|
+
}
|
|
10
|
+
async function handleChallenge({
|
|
11
|
+
userWalletAddress,
|
|
12
|
+
pincode,
|
|
13
|
+
accessToken,
|
|
14
|
+
instance,
|
|
15
|
+
nodeId
|
|
16
|
+
}) {
|
|
17
|
+
const response = await fetch(`${instance}/cm/nodes/${nodeId}/${userWalletAddress}/verifications`, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
"x-auth-token": accessToken
|
|
22
|
+
},
|
|
23
|
+
body: JSON.stringify({
|
|
24
|
+
pincode,
|
|
25
|
+
verificationType: "PINCODE",
|
|
26
|
+
name: "pincode"
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error("Failed to handle challenge");
|
|
31
|
+
}
|
|
32
|
+
const verificationChallenges = await response.json();
|
|
33
|
+
if (!verificationChallenges.length) {
|
|
34
|
+
throw new Error("No verification challenges received");
|
|
35
|
+
}
|
|
36
|
+
const firstChallenge = verificationChallenges[0];
|
|
37
|
+
const challenge = firstChallenge?.challenge;
|
|
38
|
+
if (!challenge?.secret || !challenge?.salt) {
|
|
39
|
+
throw new Error("Could not authenticate pin code, invalid challenge format");
|
|
40
|
+
}
|
|
41
|
+
const { secret, salt } = challenge;
|
|
42
|
+
return generateChallengeResponse(pincode, salt, secret);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
handleChallenge
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=challenge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/challenge.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\nfunction hashPincode(pincode: string, salt: string): string {\n return createHash(\"sha256\").update(`${salt}${pincode}`).digest(\"hex\");\n}\n\nfunction generateChallengeResponse(pincode: string, salt: string, challenge: string): string {\n const hashedPincode = hashPincode(pincode, salt);\n return createHash(\"sha256\").update(`${hashedPincode}_${challenge}`).digest(\"hex\");\n}\n\nexport interface HandleChallengeArgs {\n userWalletAddress: string;\n pincode: string;\n accessToken: string;\n instance: string;\n nodeId: string;\n}\n\n/**\n * Handles a challenge for a user wallet address.\n * @param userWalletAddress - The user's wallet address.\n * @param pincode - The user's pincode.\n * @param accessToken - The user's access token.\n * @param instance - The instance URL.\n * @param nodeId - The node ID.\n * @returns The challenge response.\n */\nexport async function handleChallenge({\n userWalletAddress,\n pincode,\n accessToken,\n instance,\n nodeId,\n}: HandleChallengeArgs) {\n const response = await fetch(`${instance}/cm/nodes/${nodeId}/${userWalletAddress}/verifications`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-auth-token\": accessToken,\n },\n body: JSON.stringify({\n pincode,\n verificationType: \"PINCODE\",\n name: \"pincode\",\n }),\n });\n\n if (!response.ok) {\n throw new Error(\"Failed to handle challenge\");\n }\n\n const verificationChallenges: { challenge: { secret: string; salt: string } }[] = await response.json();\n if (!verificationChallenges.length) {\n throw new Error(\"No verification challenges received\");\n }\n\n const firstChallenge = verificationChallenges[0];\n const challenge = firstChallenge?.challenge as { secret: string; salt: string } | null;\n if (!challenge?.secret || !challenge?.salt) {\n throw new Error(\"Could not authenticate pin code, invalid challenge format\");\n }\n\n const { secret, salt } = challenge;\n return generateChallengeResponse(pincode, salt, secret);\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,YAAY,SAAiB,MAAsB;AAC1D,SAAO,WAAW,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,EAAE,EAAE,OAAO,KAAK;AACtE;AAEA,SAAS,0BAA0B,SAAiB,MAAc,WAA2B;AAC3F,QAAM,gBAAgB,YAAY,SAAS,IAAI;AAC/C,SAAO,WAAW,QAAQ,EAAE,OAAO,GAAG,aAAa,IAAI,SAAS,EAAE,EAAE,OAAO,KAAK;AAClF;AAmBA,eAAsB,gBAAgB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,aAAa,MAAM,IAAI,iBAAiB,kBAAkB;AAAA,IAChG,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,IAClB;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,MAClB,MAAM;AAAA,IACR,CAAC;AAAA,EACH,CAAC;AAED,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AAEA,QAAM,yBAA4E,MAAM,SAAS,KAAK;AACtG,MAAI,CAAC,uBAAuB,QAAQ;AAClC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACvD;AAEA,QAAM,iBAAiB,uBAAuB,CAAC;AAC/C,QAAM,YAAY,gBAAgB;AAClC,MAAI,CAAC,WAAW,UAAU,CAAC,WAAW,MAAM;AAC1C,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AAEA,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,SAAO,0BAA0B,SAAS,MAAM,MAAM;AACxD;","names":[]}
|
package/dist/settlemint.cjs
CHANGED
|
@@ -29,6 +29,50 @@ var import_validation3 = require("@settlemint/sdk-utils/validation");
|
|
|
29
29
|
var import_graphql_request = require("graphql-request");
|
|
30
30
|
var import_zod2 = require("zod");
|
|
31
31
|
|
|
32
|
+
// src/challenge.ts
|
|
33
|
+
var import_node_crypto = require("crypto");
|
|
34
|
+
function hashPincode(pincode, salt) {
|
|
35
|
+
return (0, import_node_crypto.createHash)("sha256").update(`${salt}${pincode}`).digest("hex");
|
|
36
|
+
}
|
|
37
|
+
function generateChallengeResponse(pincode, salt, challenge) {
|
|
38
|
+
const hashedPincode = hashPincode(pincode, salt);
|
|
39
|
+
return (0, import_node_crypto.createHash)("sha256").update(`${hashedPincode}_${challenge}`).digest("hex");
|
|
40
|
+
}
|
|
41
|
+
async function handleChallenge({
|
|
42
|
+
userWalletAddress,
|
|
43
|
+
pincode,
|
|
44
|
+
accessToken,
|
|
45
|
+
instance,
|
|
46
|
+
nodeId
|
|
47
|
+
}) {
|
|
48
|
+
const response = await fetch(`${instance}/cm/nodes/${nodeId}/${userWalletAddress}/verifications`, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: {
|
|
51
|
+
"Content-Type": "application/json",
|
|
52
|
+
"x-auth-token": accessToken
|
|
53
|
+
},
|
|
54
|
+
body: JSON.stringify({
|
|
55
|
+
pincode,
|
|
56
|
+
verificationType: "PINCODE",
|
|
57
|
+
name: "pincode"
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
throw new Error("Failed to handle challenge");
|
|
62
|
+
}
|
|
63
|
+
const verificationChallenges = await response.json();
|
|
64
|
+
if (!verificationChallenges.length) {
|
|
65
|
+
throw new Error("No verification challenges received");
|
|
66
|
+
}
|
|
67
|
+
const firstChallenge = verificationChallenges[0];
|
|
68
|
+
const challenge = firstChallenge?.challenge;
|
|
69
|
+
if (!challenge?.secret || !challenge?.salt) {
|
|
70
|
+
throw new Error("Could not authenticate pin code, invalid challenge format");
|
|
71
|
+
}
|
|
72
|
+
const { secret, salt } = challenge;
|
|
73
|
+
return generateChallengeResponse(pincode, salt, secret);
|
|
74
|
+
}
|
|
75
|
+
|
|
32
76
|
// src/helpers/graphql.ts
|
|
33
77
|
var import_gql = require("gql.tada");
|
|
34
78
|
var import_gql2 = require("gql.tada");
|
|
@@ -1527,56 +1571,6 @@ var ClientOptionsSchema = import_zod.z.object({
|
|
|
1527
1571
|
instance: import_validation2.UrlSchema
|
|
1528
1572
|
});
|
|
1529
1573
|
|
|
1530
|
-
// src/pincode-verification.ts
|
|
1531
|
-
var import_node_crypto = require("crypto");
|
|
1532
|
-
function hashPincode(pincode, salt) {
|
|
1533
|
-
return (0, import_node_crypto.createHash)("sha256").update(`${salt}${pincode}`).digest("hex");
|
|
1534
|
-
}
|
|
1535
|
-
function generateResponse(pincode, salt, challenge) {
|
|
1536
|
-
const hashedPincode = hashPincode(pincode, salt);
|
|
1537
|
-
return (0, import_node_crypto.createHash)("sha256").update(`${hashedPincode}_${challenge}`).digest("hex");
|
|
1538
|
-
}
|
|
1539
|
-
async function getPincodeVerificationResponse({
|
|
1540
|
-
userWalletAddress,
|
|
1541
|
-
pincode,
|
|
1542
|
-
accessToken,
|
|
1543
|
-
instance,
|
|
1544
|
-
nodeId
|
|
1545
|
-
}) {
|
|
1546
|
-
const response = await fetch(
|
|
1547
|
-
`${instance}/cm/nodes/${encodeURIComponent(nodeId)}/user-wallets/${encodeURIComponent(userWalletAddress)}/verifications/challenges`,
|
|
1548
|
-
{
|
|
1549
|
-
method: "POST",
|
|
1550
|
-
headers: {
|
|
1551
|
-
"Content-Type": "application/json",
|
|
1552
|
-
"x-auth-token": accessToken
|
|
1553
|
-
},
|
|
1554
|
-
body: JSON.stringify({
|
|
1555
|
-
pincode,
|
|
1556
|
-
verificationType: "PINCODE",
|
|
1557
|
-
name: "pincode"
|
|
1558
|
-
})
|
|
1559
|
-
}
|
|
1560
|
-
);
|
|
1561
|
-
if (!response.ok) {
|
|
1562
|
-
if (response.status === 404) {
|
|
1563
|
-
throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
|
|
1564
|
-
}
|
|
1565
|
-
throw new Error("Failed to get verification challenge");
|
|
1566
|
-
}
|
|
1567
|
-
const verificationChallenges = await response.json();
|
|
1568
|
-
if (!verificationChallenges.length) {
|
|
1569
|
-
throw new Error("No verification challenges received");
|
|
1570
|
-
}
|
|
1571
|
-
const firstChallenge = verificationChallenges[0];
|
|
1572
|
-
const challenge = firstChallenge?.challenge;
|
|
1573
|
-
if (!challenge?.secret || !challenge?.salt) {
|
|
1574
|
-
throw new Error("Could not authenticate pin code, invalid challenge format");
|
|
1575
|
-
}
|
|
1576
|
-
const { secret, salt } = challenge;
|
|
1577
|
-
return generateResponse(pincode, salt, secret);
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
1574
|
// src/settlemint.ts
|
|
1581
1575
|
function createSettleMintClient(options) {
|
|
1582
1576
|
(0, import_runtime.ensureServer)();
|
|
@@ -1680,7 +1674,7 @@ function createSettleMintClient(options) {
|
|
|
1680
1674
|
config: getPlatformConfig(gqlClient)
|
|
1681
1675
|
},
|
|
1682
1676
|
wallet: {
|
|
1683
|
-
|
|
1677
|
+
handleChallenge: (args) => handleChallenge({
|
|
1684
1678
|
...args,
|
|
1685
1679
|
instance: validatedOptions.instance,
|
|
1686
1680
|
accessToken: validatedOptions.accessToken
|