@arcblock/did-connect-js 1.29.27 → 1.30.1

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.
@@ -1,5 +1,5 @@
1
1
  import { __require } from "../_virtual/rolldown_runtime.mjs";
2
- import { require_package } from "../package.mjs";
2
+ import { require_package } from "../did/did-connect/package.mjs";
3
3
  import { fromJSON, isValid } from "@ocap/wallet";
4
4
  import * as Jwt from "@arcblock/jwt";
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { __require } from "../_virtual/rolldown_runtime.mjs";
2
- import { require_package } from "../package.mjs";
2
+ import { require_package } from "../did/did-connect/package.mjs";
3
3
  import base_default, { DEFAULT_CHAIN_INFO } from "./base.mjs";
4
- import { appInfo, chainInfo, claims } from "../schema/index.mjs";
4
+ import { appInfo, chainInfo, claims, vValidate } from "../schema/index.mjs";
5
5
  import qs from "node:querystring";
6
6
  import { toAddress } from "@arcblock/did";
7
7
  import Client from "@ocap/client";
@@ -361,7 +361,7 @@ var WalletAuthenticator = class WalletAuthenticator extends base_default {
361
361
  }
362
362
  result.mfaCode = shuffle(result.mfaCode);
363
363
  }
364
- const { value, error } = claims[name].validate(result);
364
+ const { value, error } = vValidate(claims[name], result);
365
365
  if (error) throw new Error(`Invalid ${name} claim: ${error.message}`);
366
366
  return value;
367
367
  }));
@@ -520,12 +520,12 @@ var WalletAuthenticator = class WalletAuthenticator extends base_default {
520
520
  if (allowEmpty === false) throw new Error("Wallet authenticator can not work with invalid appInfo: empty");
521
521
  return null;
522
522
  }
523
- const { value, error } = appInfo.validate(info);
523
+ const { value, error } = vValidate(appInfo, info);
524
524
  if (error) throw new Error(`Wallet authenticator can not work with invalid appInfo: ${error.message}`);
525
525
  return value;
526
526
  }
527
527
  _isValidChainInfo(x) {
528
- const { error } = chainInfo.validate(x);
528
+ const { error } = vValidate(chainInfo, x);
529
529
  return !error;
530
530
  }
531
531
  tryWithTimeout(asyncFn, label = "") {
@@ -1,4 +1,4 @@
1
- import { __commonJSMin } from "./_virtual/rolldown_runtime.mjs";
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.mjs";
2
2
 
3
3
  //#region package.json
4
4
  var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -28,7 +28,7 @@ var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28
28
  "@ocap/wallet": "workspace:*",
29
29
  "cors": "^2.8.5",
30
30
  "debug": "^4.4.3",
31
- "json-stable-stringify": "^1.0.1",
31
+ "fast-json-stable-stringify": "^2.1.0",
32
32
  "lodash": "^4.17.23",
33
33
  "tweetnacl-sealedbox-js": "^1.2.0"
34
34
  },
@@ -38,7 +38,6 @@ var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38
38
  "@ocap/e2e-test": "workspace:*",
39
39
  "@types/cors": "^2.8.17",
40
40
  "@types/debug": "^4.1.12",
41
- "@types/json-stable-stringify": "^1.0.36",
42
41
  "@types/lodash": "^4.17.13",
43
42
  "@types/node": "^22.7.5",
44
43
  "axios": "^1.13.4",
@@ -1,5 +1,5 @@
1
1
  import { __require } from "../_virtual/rolldown_runtime.mjs";
2
- import { require_package } from "../package.mjs";
2
+ import { require_package } from "../did/did-connect/package.mjs";
3
3
  import { PROTECTED_KEYS, SESSION_STATUS, decrypt, encrypt } from "../protocol.mjs";
4
4
  import { isValid } from "@arcblock/did";
5
5
  import { fromBase64, stripHexPrefix, toBase64 } from "@ocap/util";
@@ -9,7 +9,7 @@ import random from "lodash/random.js";
9
9
  import * as Mcrypto from "@ocap/mcrypto";
10
10
  import omit from "lodash/omit.js";
11
11
  import url from "url";
12
- import stringify from "json-stable-stringify";
12
+ import stringify from "fast-json-stable-stringify";
13
13
  import cloneDeep from "lodash/cloneDeep.js";
14
14
  import get from "lodash/get.js";
15
15
  import isPlainObject from "lodash/isPlainObject.js";
@@ -1,5 +1,5 @@
1
1
  import { __require } from "../_virtual/rolldown_runtime.mjs";
2
- import { require_package } from "../package.mjs";
2
+ import { require_package } from "../did/did-connect/package.mjs";
3
3
  import { isHonoApp } from "../adapters/detect.mjs";
4
4
  import { attachExpress } from "../adapters/express.mjs";
5
5
  import { attachHono } from "../adapters/hono.mjs";