@settlemint/sdk-mcp 2.1.2 → 2.1.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/dist/mcp.js CHANGED
@@ -62694,7 +62694,7 @@ var {
62694
62694
  var package_default = {
62695
62695
  name: "@settlemint/sdk-mcp",
62696
62696
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
62697
- version: "2.1.2",
62697
+ version: "2.1.3",
62698
62698
  type: "module",
62699
62699
  private: false,
62700
62700
  license: "FSL-1.1-MIT",
@@ -62736,8 +62736,8 @@ var package_default = {
62736
62736
  "@graphql-tools/load": "8.1.0",
62737
62737
  "@graphql-tools/url-loader": "8.0.31",
62738
62738
  "@modelcontextprotocol/sdk": "1.9.0",
62739
- "@settlemint/sdk-js": "2.1.2",
62740
- "@settlemint/sdk-utils": "2.1.2",
62739
+ "@settlemint/sdk-js": "2.1.3",
62740
+ "@settlemint/sdk-utils": "2.1.3",
62741
62741
  "@commander-js/extra-typings": "11.1.0",
62742
62742
  commander: "11.1.0",
62743
62743
  zod: "3.24.2"
@@ -66344,24 +66344,18 @@ function generateResponse(pincode, salt, challenge) {
66344
66344
  const hashedPincode = hashPincode(pincode, salt);
66345
66345
  return createHash("sha256").update(`${hashedPincode}_${challenge}`).digest("hex");
66346
66346
  }
66347
- async function getPincodeVerificationResponse({
66347
+ async function getPincodeVerificationChallenges({
66348
66348
  userWalletAddress,
66349
- pincode,
66350
66349
  accessToken,
66351
66350
  instance,
66352
66351
  nodeId
66353
66352
  }) {
66354
- const response = await fetch(`${instance}/cm/nodes/${encodeURIComponent(nodeId)}/user-wallets/${encodeURIComponent(userWalletAddress)}/verifications/challenges`, {
66353
+ const response = await fetch(`${instance}/cm/nodes/${encodeURIComponent(nodeId)}/user-wallets/${encodeURIComponent(userWalletAddress)}/verifications/challenges?type=PINCODE`, {
66355
66354
  method: "POST",
66356
66355
  headers: {
66357
66356
  "Content-Type": "application/json",
66358
66357
  "x-auth-token": accessToken
66359
- },
66360
- body: JSON.stringify({
66361
- pincode,
66362
- verificationType: "PINCODE",
66363
- name: "pincode"
66364
- })
66358
+ }
66365
66359
  });
66366
66360
  if (!response.ok) {
66367
66361
  if (response.status === 404) {
@@ -66370,15 +66364,16 @@ async function getPincodeVerificationResponse({
66370
66364
  throw new Error("Failed to get verification challenge");
66371
66365
  }
66372
66366
  const verificationChallenges = await response.json();
66373
- if (!verificationChallenges.length) {
66374
- throw new Error("No verification challenges received");
66375
- }
66376
- const firstChallenge = verificationChallenges[0];
66377
- const challenge = firstChallenge?.challenge;
66378
- if (!challenge?.secret || !challenge?.salt) {
66367
+ return verificationChallenges;
66368
+ }
66369
+ function getPincodeVerificationChallengeResponse({
66370
+ verificationChallenge,
66371
+ pincode
66372
+ }) {
66373
+ if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {
66379
66374
  throw new Error("Could not authenticate pin code, invalid challenge format");
66380
66375
  }
66381
- const { secret, salt } = challenge;
66376
+ const { secret, salt } = verificationChallenge.challenge;
66382
66377
  return generateResponse(pincode, salt, secret);
66383
66378
  }
66384
66379
  function createSettleMintClient(options) {
@@ -66480,7 +66475,8 @@ function createSettleMintClient(options) {
66480
66475
  config: getPlatformConfig(gqlClient)
66481
66476
  },
66482
66477
  wallet: {
66483
- pincodeVerificationResponse: (args) => getPincodeVerificationResponse({
66478
+ pincodeVerificationChallengeResponse: getPincodeVerificationChallengeResponse,
66479
+ pincodeVerificationChallenges: (args) => getPincodeVerificationChallenges({
66484
66480
  ...args,
66485
66481
  instance: validatedOptions.instance,
66486
66482
  accessToken: validatedOptions.accessToken
@@ -68159,4 +68155,4 @@ await main().catch((error2) => {
68159
68155
  process.exit(1);
68160
68156
  });
68161
68157
 
68162
- //# debugId=B8FF58F514008CCC64756E2164756E21
68158
+ //# debugId=8CAC4F797D370B9C64756E2164756E21