@abtnode/core 1.16.54-beta-20251030-060219-f2f1ed96 → 1.16.54-beta-20251030-092518-0e109845

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.
Files changed (2) hide show
  1. package/lib/util/blocklet.js +19 -11
  2. package/package.json +24 -24
@@ -369,9 +369,6 @@ const getAppSystemEnvironments = (blocklet, nodeInfo, dataDirs) => {
369
369
  const appSk = toHex(wallet.secretKey);
370
370
  const appPk = toHex(wallet.publicKey);
371
371
 
372
- const ethWallet = fromSecretKey(appSk.slice(0, 66), 'ethereum');
373
- const ethPk = toHex(ethWallet.publicKey);
374
-
375
372
  const appId = wallet.address;
376
373
  const appName = title || name || result.name;
377
374
  const appDescription = description || result.description;
@@ -380,11 +377,6 @@ const getAppSystemEnvironments = (blocklet, nodeInfo, dataDirs) => {
380
377
  const appPid = blocklet.appPid || appId;
381
378
  const appPsk = toHex(isMigrated ? blocklet.migratedFrom[0].appSk : appSk);
382
379
 
383
- // Calculate permanent public key (PPK)
384
- const appPpk = isMigrated ? toHex(fromSecretKey(appPsk, wallet.type).publicKey) : appPk;
385
- const ethPermanentWallet = fromSecretKey(appPsk.slice(0, 66), 'ethereum');
386
- const appPpkEth = toHex(ethPermanentWallet.publicKey);
387
-
388
380
  /* 获取 did domain 方式:
389
381
  * 1. 先从 site 里读
390
382
  * 2. 如果没有,再拼接
@@ -406,12 +398,9 @@ const getAppSystemEnvironments = (blocklet, nodeInfo, dataDirs) => {
406
398
  return {
407
399
  BLOCKLET_DID: did, // BLOCKLET_DID is always same as BLOCKLET_APP_PID in structV2 application
408
400
  BLOCKLET_APP_PK: appPk,
409
- BLOCKLET_APP_PK_ETH: ethPk,
410
401
  BLOCKLET_APP_SK: appSk,
411
402
  BLOCKLET_APP_ID: appId,
412
403
  BLOCKLET_APP_PSK: appPsk, // permanent sk even the blocklet has been migrated
413
- BLOCKLET_APP_PPK: appPpk, // permanent pk corresponding to PSK
414
- BLOCKLET_APP_PPK_ETH: appPpkEth, // permanent pk corresponding to PSK for ethereum
415
404
  BLOCKLET_APP_PID: appPid, // permanent did even the blocklet has been migrated
416
405
  BLOCKLET_APP_NAME: appName,
417
406
  BLOCKLET_APP_NAME_SLUG: urlPathFriendly(slugify(appName)),
@@ -554,6 +543,21 @@ const getRuntimeEnvironments = (blocklet, nodeEnvironments, ancestors, isGreen =
554
543
  const rootBlockletInfo =
555
544
  blocklet === root ? blockletInfo : getBlockletInfo(root, nodeEnvironments.ABT_NODE_SK, { returnWallet: true });
556
545
 
546
+ const { wallet } = rootBlockletInfo;
547
+ const appSk = toHex(wallet.secretKey);
548
+ const appPk = toHex(wallet.publicKey);
549
+
550
+ const ethWallet = fromSecretKey(appSk.slice(0, 66), 'ethereum');
551
+ const ethPk = toHex(ethWallet.publicKey);
552
+
553
+ const isMigrated = Array.isArray(root.migratedFrom) && root.migratedFrom.length > 0;
554
+ const appPsk = toHex(isMigrated ? root.migratedFrom[0].appSk : appSk);
555
+
556
+ // Calculate permanent public key (PPK)
557
+ const appPpk = isMigrated ? toHex(fromSecretKey(appPsk, wallet.type).publicKey) : appPk;
558
+ const ethPermanentWallet = fromSecretKey(appPsk.slice(0, 66), 'ethereum');
559
+ const appPpkEth = toHex(ethPermanentWallet.publicKey);
560
+
557
561
  const env = {
558
562
  ...blocklet.configObj,
559
563
  ...getSharedConfigObj((ancestors || [])[0], blocklet, true),
@@ -570,6 +574,10 @@ const getRuntimeEnvironments = (blocklet, nodeEnvironments, ancestors, isGreen =
570
574
  BLOCKLET_APP_ASK: accessWallet?.secretKey,
571
575
  ...nodeEnvironments,
572
576
  ...safeNodeEnvironments,
577
+ BLOCKLET_APP_PPK: appPpk, // permanent pk corresponding to PSK
578
+ BLOCKLET_APP_PPK_ETH: appPpkEth, // permanent pk corresponding to PSK for ethereum
579
+ BLOCKLET_APP_PK: appPk,
580
+ BLOCKLET_APP_PK_ETH: ethPk,
573
581
  };
574
582
 
575
583
  const aigne = get(root, 'settings.aigne', {});
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.54-beta-20251030-060219-f2f1ed96",
6
+ "version": "1.16.54-beta-20251030-092518-0e109845",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,21 +19,21 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/analytics": "1.16.54-beta-20251030-060219-f2f1ed96",
23
- "@abtnode/auth": "1.16.54-beta-20251030-060219-f2f1ed96",
24
- "@abtnode/certificate-manager": "1.16.54-beta-20251030-060219-f2f1ed96",
25
- "@abtnode/constant": "1.16.54-beta-20251030-060219-f2f1ed96",
26
- "@abtnode/cron": "1.16.54-beta-20251030-060219-f2f1ed96",
27
- "@abtnode/db-cache": "1.16.54-beta-20251030-060219-f2f1ed96",
28
- "@abtnode/docker-utils": "1.16.54-beta-20251030-060219-f2f1ed96",
29
- "@abtnode/logger": "1.16.54-beta-20251030-060219-f2f1ed96",
30
- "@abtnode/models": "1.16.54-beta-20251030-060219-f2f1ed96",
31
- "@abtnode/queue": "1.16.54-beta-20251030-060219-f2f1ed96",
32
- "@abtnode/rbac": "1.16.54-beta-20251030-060219-f2f1ed96",
33
- "@abtnode/router-provider": "1.16.54-beta-20251030-060219-f2f1ed96",
34
- "@abtnode/static-server": "1.16.54-beta-20251030-060219-f2f1ed96",
35
- "@abtnode/timemachine": "1.16.54-beta-20251030-060219-f2f1ed96",
36
- "@abtnode/util": "1.16.54-beta-20251030-060219-f2f1ed96",
22
+ "@abtnode/analytics": "1.16.54-beta-20251030-092518-0e109845",
23
+ "@abtnode/auth": "1.16.54-beta-20251030-092518-0e109845",
24
+ "@abtnode/certificate-manager": "1.16.54-beta-20251030-092518-0e109845",
25
+ "@abtnode/constant": "1.16.54-beta-20251030-092518-0e109845",
26
+ "@abtnode/cron": "1.16.54-beta-20251030-092518-0e109845",
27
+ "@abtnode/db-cache": "1.16.54-beta-20251030-092518-0e109845",
28
+ "@abtnode/docker-utils": "1.16.54-beta-20251030-092518-0e109845",
29
+ "@abtnode/logger": "1.16.54-beta-20251030-092518-0e109845",
30
+ "@abtnode/models": "1.16.54-beta-20251030-092518-0e109845",
31
+ "@abtnode/queue": "1.16.54-beta-20251030-092518-0e109845",
32
+ "@abtnode/rbac": "1.16.54-beta-20251030-092518-0e109845",
33
+ "@abtnode/router-provider": "1.16.54-beta-20251030-092518-0e109845",
34
+ "@abtnode/static-server": "1.16.54-beta-20251030-092518-0e109845",
35
+ "@abtnode/timemachine": "1.16.54-beta-20251030-092518-0e109845",
36
+ "@abtnode/util": "1.16.54-beta-20251030-092518-0e109845",
37
37
  "@aigne/aigne-hub": "^0.10.3",
38
38
  "@arcblock/did": "^1.27.0",
39
39
  "@arcblock/did-connect-js": "^1.27.0",
@@ -45,15 +45,15 @@
45
45
  "@arcblock/pm2-events": "^0.0.5",
46
46
  "@arcblock/validator": "^1.27.0",
47
47
  "@arcblock/vc": "^1.27.0",
48
- "@blocklet/constant": "1.16.54-beta-20251030-060219-f2f1ed96",
48
+ "@blocklet/constant": "1.16.54-beta-20251030-092518-0e109845",
49
49
  "@blocklet/did-space-js": "^1.2.0",
50
- "@blocklet/env": "1.16.54-beta-20251030-060219-f2f1ed96",
50
+ "@blocklet/env": "1.16.54-beta-20251030-092518-0e109845",
51
51
  "@blocklet/error": "^0.2.5",
52
- "@blocklet/meta": "1.16.54-beta-20251030-060219-f2f1ed96",
53
- "@blocklet/resolver": "1.16.54-beta-20251030-060219-f2f1ed96",
54
- "@blocklet/sdk": "1.16.54-beta-20251030-060219-f2f1ed96",
55
- "@blocklet/server-js": "1.16.54-beta-20251030-060219-f2f1ed96",
56
- "@blocklet/store": "1.16.54-beta-20251030-060219-f2f1ed96",
52
+ "@blocklet/meta": "1.16.54-beta-20251030-092518-0e109845",
53
+ "@blocklet/resolver": "1.16.54-beta-20251030-092518-0e109845",
54
+ "@blocklet/sdk": "1.16.54-beta-20251030-092518-0e109845",
55
+ "@blocklet/server-js": "1.16.54-beta-20251030-092518-0e109845",
56
+ "@blocklet/store": "1.16.54-beta-20251030-092518-0e109845",
57
57
  "@blocklet/theme": "^3.1.54",
58
58
  "@fidm/x509": "^1.2.1",
59
59
  "@ocap/mcrypto": "^1.27.0",
@@ -118,5 +118,5 @@
118
118
  "express": "^4.18.2",
119
119
  "unzipper": "^0.10.11"
120
120
  },
121
- "gitHead": "a4182e02a693b097c76b6a9907a8a1d4816ee914"
121
+ "gitHead": "431bc01b2abde0a41abe300cf3eef94476add035"
122
122
  }