@blocklet/sdk 1.16.54-beta-20251030-060219-f2f1ed96 → 1.16.54-beta-20251031-043051-f3b56e3a
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/lib/wallet.js +5 -2
- package/package.json +9 -11
package/lib/wallet.js
CHANGED
|
@@ -106,14 +106,17 @@ const getWallet = (type, appSk = process.env.BLOCKLET_APP_SK, keyType = 'sk') =>
|
|
|
106
106
|
: (0, wallet_1.WalletType)({ role: mcrypto_1.types.RoleType.ROLE_APPLICATION, pk: mcrypto_1.types.KeyType.ED25519, hash: mcrypto_1.types.HashType.SHA3 });
|
|
107
107
|
if (!appSk) {
|
|
108
108
|
let appPk;
|
|
109
|
+
let envKey;
|
|
109
110
|
if ((0, did_1.isEthereumType)((0, did_1.DidType)(type))) {
|
|
110
111
|
appPk = keyType === 'psk' ? process.env.BLOCKLET_APP_PPK_ETH : process.env.BLOCKLET_APP_PK_ETH;
|
|
112
|
+
envKey = keyType === 'psk' ? 'BLOCKLET_APP_PPK_ETH' : 'BLOCKLET_APP_PK_ETH';
|
|
111
113
|
}
|
|
112
114
|
else {
|
|
113
115
|
appPk = keyType === 'psk' ? process.env.BLOCKLET_APP_PPK : process.env.BLOCKLET_APP_PK;
|
|
116
|
+
envKey = keyType === 'psk' ? 'BLOCKLET_APP_PPK' : 'BLOCKLET_APP_PK';
|
|
114
117
|
}
|
|
115
118
|
if (!appPk) {
|
|
116
|
-
throw new Error(`Missing public key for ${keyType.toUpperCase()} wallet:
|
|
119
|
+
throw new Error(`Missing public key for ${keyType.toUpperCase()} wallet: ${envKey}`);
|
|
117
120
|
}
|
|
118
121
|
const currentWallet = (0, exports.createRemoteWallet)(appPk, walletType, keyType);
|
|
119
122
|
exports.cacheWallet.set(cacheKey, currentWallet);
|
|
@@ -153,7 +156,7 @@ const getPermanentWallet = () => (0, exports.getWallet)(process.env.CHAIN_TYPE |
|
|
|
153
156
|
exports.getPermanentWallet = getPermanentWallet;
|
|
154
157
|
const getEthereumWallet = (permanent = false) => (0, exports.getWallet)('ethereum', permanent ? process.env.BLOCKLET_APP_PSK : process.env.BLOCKLET_APP_SK, permanent ? 'psk' : 'sk');
|
|
155
158
|
exports.getEthereumWallet = getEthereumWallet;
|
|
156
|
-
const getAccessWallet = () => (0, exports.getWallet)(
|
|
159
|
+
const getAccessWallet = () => (0, exports.getWallet)('arcblock',
|
|
157
160
|
// Compatible with previous version where APP_ASK does not exist
|
|
158
161
|
process.env.BLOCKLET_APP_ASK || process.env.BLOCKLET_APP_SK, 'sk');
|
|
159
162
|
exports.getAccessWallet = getAccessWallet;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.54-beta-
|
|
6
|
+
"version": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
7
7
|
"description": "graphql client to read/write data on abt node",
|
|
8
8
|
"homepage": "https://www.arcblock.io/docs/blocklet-sdk-nodejs",
|
|
9
9
|
"main": "lib/index.js",
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
"verify": "npm run lint:fix && npm run test && npm run build",
|
|
17
17
|
"lint": "eslint src tests service",
|
|
18
18
|
"lint:fix": "npm run lint -- --fix",
|
|
19
|
-
"test": "bun test --bail --timeout 30000",
|
|
20
|
-
"coverage": "bun test --bail --timeout 30000 --coverage",
|
|
21
19
|
"clean": "rm -fr lib",
|
|
22
20
|
"prebuild": "npm run clean && npm run types",
|
|
23
21
|
"types": "rm -rf ./src/types && node tools/version.js && ts-node tools/types.js && rm -f ./src/types/index.ts && prettier --write ./src/types/notification.ts",
|
|
@@ -28,19 +26,19 @@
|
|
|
28
26
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
29
27
|
"license": "Apache-2.0",
|
|
30
28
|
"dependencies": {
|
|
31
|
-
"@abtnode/constant": "1.16.54-beta-
|
|
32
|
-
"@abtnode/db-cache": "1.16.54-beta-
|
|
33
|
-
"@abtnode/util": "1.16.54-beta-
|
|
29
|
+
"@abtnode/constant": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
30
|
+
"@abtnode/db-cache": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
31
|
+
"@abtnode/util": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
34
32
|
"@arcblock/did": "^1.27.0",
|
|
35
33
|
"@arcblock/did-connect-js": "^1.27.0",
|
|
36
34
|
"@arcblock/did-ext": "^1.27.0",
|
|
37
35
|
"@arcblock/jwt": "^1.27.0",
|
|
38
36
|
"@arcblock/ws": "^1.27.0",
|
|
39
|
-
"@blocklet/constant": "1.16.54-beta-
|
|
40
|
-
"@blocklet/env": "1.16.54-beta-
|
|
37
|
+
"@blocklet/constant": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
38
|
+
"@blocklet/env": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
41
39
|
"@blocklet/error": "^0.2.5",
|
|
42
|
-
"@blocklet/meta": "1.16.54-beta-
|
|
43
|
-
"@blocklet/server-js": "1.16.54-beta-
|
|
40
|
+
"@blocklet/meta": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
41
|
+
"@blocklet/server-js": "1.16.54-beta-20251031-043051-f3b56e3a",
|
|
44
42
|
"@blocklet/theme": "^3.1.54",
|
|
45
43
|
"@did-connect/authenticator": "^2.2.8",
|
|
46
44
|
"@did-connect/handler": "^2.2.8",
|
|
@@ -84,5 +82,5 @@
|
|
|
84
82
|
"ts-node": "^10.9.1",
|
|
85
83
|
"typescript": "^5.6.3"
|
|
86
84
|
},
|
|
87
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "3c8d3d08531c55eef3de4d9657b2452850d5bcc7"
|
|
88
86
|
}
|