@blocklet/sdk 1.16.54-beta-20251021-070951-25e3083c → 1.16.54-beta-20251024-030947-6f2889bf
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/service/blocklet.d.ts +4 -1
- package/lib/service/blocklet.js +4 -2
- package/lib/service/signature.d.ts +13 -7
- package/lib/service/signature.js +42 -8
- package/lib/util/app-info.d.ts +1 -1
- package/lib/util/jest-setup.js +7 -2
- package/lib/wallet.d.ts +7 -5
- package/lib/wallet.js +24 -17
- package/package.json +17 -17
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Client from '@blocklet/server-js';
|
|
2
2
|
import { LOGIN_PROVIDER } from '@blocklet/constant';
|
|
3
|
+
import { AxiosHeaders } from 'axios';
|
|
3
4
|
type PartialDeep<T> = {
|
|
4
5
|
[K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
|
|
5
6
|
};
|
|
@@ -14,7 +15,9 @@ declare class BlockletService {
|
|
|
14
15
|
constructor(httpEndpoint?: string);
|
|
15
16
|
}
|
|
16
17
|
interface BlockletService {
|
|
17
|
-
login: (params: object
|
|
18
|
+
login: (params: object, options?: {
|
|
19
|
+
headers: AxiosHeaders;
|
|
20
|
+
}) => Promise<{
|
|
18
21
|
user: Object;
|
|
19
22
|
token: string;
|
|
20
23
|
refreshToken: string;
|
package/lib/service/blocklet.js
CHANGED
|
@@ -230,9 +230,11 @@ class BlockletService {
|
|
|
230
230
|
const fn = client[api];
|
|
231
231
|
this[api] = apiFnMap[api] ? apiFnMap[api](fn) : apiFallback(fn);
|
|
232
232
|
});
|
|
233
|
-
this.login = async (data) => {
|
|
233
|
+
this.login = async (data, options) => {
|
|
234
234
|
try {
|
|
235
|
-
const { data: resData } = await service_api_1.default.post('/api/user/login', data
|
|
235
|
+
const { data: resData } = await service_api_1.default.post('/api/user/login', data, {
|
|
236
|
+
headers: options?.headers,
|
|
237
|
+
});
|
|
236
238
|
if (resData?.user) {
|
|
237
239
|
fixAvatar(resData.user);
|
|
238
240
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { SerializedWallet } from '@ocap/wallet';
|
|
2
|
+
import { DIDTypeArg } from '@arcblock/did';
|
|
3
|
+
import { EncodingType } from '@ocap/util';
|
|
1
4
|
export interface RemoteSignResponse {
|
|
2
5
|
signature: string;
|
|
3
6
|
publicKey?: string;
|
|
@@ -10,12 +13,15 @@ export interface RemoteSignETHResponse {
|
|
|
10
13
|
signature: string;
|
|
11
14
|
publicKey?: string;
|
|
12
15
|
}
|
|
13
|
-
export interface
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
export interface RemoteSignOptions {
|
|
17
|
+
keyType?: 'sk' | 'psk';
|
|
18
|
+
type?: DIDTypeArg;
|
|
19
|
+
doSign?: boolean;
|
|
20
|
+
version?: string;
|
|
21
|
+
encoding?: EncodingType;
|
|
22
|
+
hashBeforeSign?: boolean;
|
|
17
23
|
}
|
|
18
|
-
export declare function remoteSign(payload: unknown): Promise<RemoteSignResponse>;
|
|
24
|
+
export declare function remoteSign(payload: unknown, options?: RemoteSignOptions): Promise<RemoteSignResponse>;
|
|
19
25
|
export declare function remoteSignJWT(payload: unknown, options?: any): Promise<RemoteSignJWTResponse>;
|
|
20
|
-
export declare function remoteSignETH(data: string,
|
|
21
|
-
export declare function remoteDeriveWallet(sub: string, type?: any, index?: number): Promise<
|
|
26
|
+
export declare function remoteSignETH(data: string, options?: RemoteSignOptions): Promise<RemoteSignETHResponse>;
|
|
27
|
+
export declare function remoteDeriveWallet(sub: string, type?: any, index?: number, options?: RemoteSignOptions): Promise<SerializedWallet>;
|
package/lib/service/signature.js
CHANGED
|
@@ -9,8 +9,12 @@ exports.remoteSignETH = remoteSignETH;
|
|
|
9
9
|
exports.remoteDeriveWallet = remoteDeriveWallet;
|
|
10
10
|
const axios_1 = __importDefault(require("axios"));
|
|
11
11
|
const env_1 = require("@blocklet/env");
|
|
12
|
+
const debug_1 = __importDefault(require("debug"));
|
|
13
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
14
|
+
const error_1 = require("@blocklet/error");
|
|
12
15
|
const constants_1 = require("../util/constants");
|
|
13
16
|
const parse_docker_endpoint_1 = require("../util/parse-docker-endpoint");
|
|
17
|
+
const debug = (0, debug_1.default)('@blocklet/sdk:remote-sign');
|
|
14
18
|
const { serverVersion } = env_1.blockletEnv;
|
|
15
19
|
const signClient = axios_1.default.create({
|
|
16
20
|
proxy: false,
|
|
@@ -42,6 +46,21 @@ const normalizePayload = (payload) => {
|
|
|
42
46
|
}
|
|
43
47
|
return payload;
|
|
44
48
|
};
|
|
49
|
+
const getPayloadInfo = (payload) => {
|
|
50
|
+
if (payload !== undefined) {
|
|
51
|
+
if (typeof payload === 'string') {
|
|
52
|
+
return { payloadPreview: payload.substring(0, 100), payloadType: 'string' };
|
|
53
|
+
}
|
|
54
|
+
if (Buffer.isBuffer(payload)) {
|
|
55
|
+
return { payloadPreview: `Buffer(${payload.length} bytes)`, payloadType: 'Buffer' };
|
|
56
|
+
}
|
|
57
|
+
if (typeof payload === 'object') {
|
|
58
|
+
const preview = JSON.stringify(payload).substring(0, 100);
|
|
59
|
+
return { payloadPreview: preview, payloadType: 'object' };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return {};
|
|
63
|
+
};
|
|
45
64
|
/**
|
|
46
65
|
* Generic remote signing API caller
|
|
47
66
|
* @param endpoint - API endpoint (e.g., '/api/sign', '/api/sign/jwt')
|
|
@@ -50,29 +69,44 @@ const normalizePayload = (payload) => {
|
|
|
50
69
|
*/
|
|
51
70
|
async function callRemoteSignAPI(endpoint, requestBody) {
|
|
52
71
|
const { apiKey } = ensureRemoteContext();
|
|
72
|
+
const startTime = Date.now();
|
|
73
|
+
// Prepare payload preview for logging (avoid logging sensitive data)
|
|
74
|
+
const payloadInfo = getPayloadInfo(requestBody.payload);
|
|
75
|
+
debug(`Remote Sign API call started: ${endpoint}`, {
|
|
76
|
+
...payloadInfo,
|
|
77
|
+
body: (0, omit_1.default)(requestBody, 'payload'),
|
|
78
|
+
});
|
|
53
79
|
try {
|
|
54
80
|
const { data } = await signClient.post(endpoint, {
|
|
55
81
|
...requestBody,
|
|
56
82
|
apiKey,
|
|
57
83
|
});
|
|
84
|
+
const duration = Date.now() - startTime;
|
|
85
|
+
debug(`Remote Sign API call succeeded: ${endpoint} in ${duration}`, {
|
|
86
|
+
responseKeys: Object.keys(data),
|
|
87
|
+
});
|
|
58
88
|
return data;
|
|
59
89
|
}
|
|
60
90
|
catch (error) {
|
|
61
|
-
const
|
|
62
|
-
const message =
|
|
91
|
+
const duration = Date.now() - startTime;
|
|
92
|
+
const message = (0, error_1.formatError)(error);
|
|
93
|
+
debug(`Remote Sign API call failed: ${endpoint} in ${duration}`, {
|
|
94
|
+
message,
|
|
95
|
+
});
|
|
63
96
|
throw new Error(`Remote signing API request failed: ${message}`);
|
|
64
97
|
}
|
|
65
98
|
}
|
|
66
|
-
function remoteSign(payload) {
|
|
99
|
+
function remoteSign(payload, options) {
|
|
67
100
|
const normalized = normalizePayload(payload);
|
|
68
|
-
return callRemoteSignAPI('/api/sign', { payload: normalized });
|
|
101
|
+
return callRemoteSignAPI('/api/sign', { payload: normalized, options });
|
|
69
102
|
}
|
|
70
103
|
function remoteSignJWT(payload, options) {
|
|
71
104
|
return callRemoteSignAPI('/api/sign/jwt', { payload, options });
|
|
72
105
|
}
|
|
73
|
-
function remoteSignETH(data,
|
|
74
|
-
|
|
106
|
+
function remoteSignETH(data, options) {
|
|
107
|
+
const { hashBeforeSign, ...restOptions } = options || {};
|
|
108
|
+
return callRemoteSignAPI('/api/sign/eth', { data, hashBeforeSign, options: restOptions });
|
|
75
109
|
}
|
|
76
|
-
function remoteDeriveWallet(sub, type, index) {
|
|
77
|
-
return callRemoteSignAPI('/api/sign/derive', { sub, type, index });
|
|
110
|
+
function remoteDeriveWallet(sub, type, index, options) {
|
|
111
|
+
return callRemoteSignAPI('/api/sign/derive', { sub, type, index, options });
|
|
78
112
|
}
|
package/lib/util/app-info.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export declare function getBlockletInfoSimple(getBlocklet?: () => Promise<ABTNod
|
|
|
17
17
|
federated: import("@blocklet/server-js").FederatedConfig;
|
|
18
18
|
appPid: string;
|
|
19
19
|
blocklet: import("@blocklet/server-js").BlockletState;
|
|
20
|
+
version: string;
|
|
20
21
|
description: string;
|
|
21
22
|
name: string;
|
|
22
|
-
version: string;
|
|
23
23
|
} | {
|
|
24
24
|
version: any;
|
|
25
25
|
name: string;
|
package/lib/util/jest-setup.js
CHANGED
|
@@ -11,6 +11,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
11
11
|
const parse_1 = require("@blocklet/meta/lib/parse");
|
|
12
12
|
const mcrypto_1 = require("@ocap/mcrypto");
|
|
13
13
|
const wallet_1 = require("@ocap/wallet");
|
|
14
|
+
const did_ext_1 = require("@arcblock/did-ext");
|
|
14
15
|
function setupJest() {
|
|
15
16
|
try {
|
|
16
17
|
const dir = process.cwd();
|
|
@@ -29,13 +30,17 @@ function setupJest() {
|
|
|
29
30
|
process.env.BLOCKLET_COMPONENT_DID = meta.did;
|
|
30
31
|
process.env.BLOCKLET_DATA_DIR = path_1.default.join(tmpDir, wallet.address);
|
|
31
32
|
process.env.BLOCKLET_LOG_DIR = path_1.default.join(tmpDir, wallet.address);
|
|
32
|
-
process.env.BLOCKLET_APP_SK = wallet.secretKey;
|
|
33
|
-
process.env.BLOCKLET_APP_PSK = wallet.secretKey;
|
|
33
|
+
// process.env.BLOCKLET_APP_SK = wallet.secretKey;
|
|
34
|
+
// process.env.BLOCKLET_APP_PSK = wallet.secretKey;
|
|
35
|
+
process.env.BLOCKLET_APP_PK = wallet.publicKey;
|
|
36
|
+
process.env.BLOCKLET_APP_PPK = wallet.publicKey;
|
|
34
37
|
process.env.BLOCKLET_APP_ID = wallet.address;
|
|
35
38
|
process.env.BLOCKLET_APP_PID = wallet.address;
|
|
36
39
|
process.env.BLOCKLET_APP_IDS = wallet.address;
|
|
37
40
|
process.env.BLOCKLET_APP_NAME = meta.title;
|
|
38
41
|
process.env.BLOCKLET_APP_DESCRIPTION = meta.description;
|
|
42
|
+
process.env.BLOCKLET_APP_EK = (0, did_ext_1.fromAppDid)(meta.did, process.env.ABT_NODE_PK, undefined, 1).secretKey;
|
|
43
|
+
process.env.BLOCKLET_APP_ASK = (0, did_ext_1.fromAppDid)(meta.did, process.env.ABT_NODE_PK, undefined, 1).secretKey;
|
|
39
44
|
process.env.BLOCKLET_APP_URL = 'http://192.168.0.10:3030';
|
|
40
45
|
process.env.BLOCKLET_MOUNT_POINTS = JSON.stringify([
|
|
41
46
|
{
|
package/lib/wallet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WalletObject } from '@ocap/wallet';
|
|
2
|
-
import { DIDTypeShortcut } from '@arcblock/did';
|
|
2
|
+
import { DIDTypeShortcut, DIDTypeArg } from '@arcblock/did';
|
|
3
3
|
import { LRUCache } from 'lru-cache';
|
|
4
4
|
export declare const cacheWallet: LRUCache<string, WalletObject<string>, unknown>;
|
|
5
5
|
/**
|
|
@@ -11,20 +11,22 @@ export declare const getPkWallet: (type?: DIDTypeShortcut, appPk?: string) => Wa
|
|
|
11
11
|
* Create a remote wallet with sign and signJWT methods that call blocklet-service
|
|
12
12
|
* @param publicKey - The public key to create the wallet from
|
|
13
13
|
* @param type - The wallet type
|
|
14
|
+
* @param keyType - Key type to use ('sk' or 'psk')
|
|
14
15
|
* @returns Wallet object with remote sign and signJWT methods
|
|
15
16
|
*/
|
|
16
|
-
export declare const createRemoteWallet: (publicKey: string, type?: any) => WalletObject;
|
|
17
|
+
export declare const createRemoteWallet: (publicKey: string, type?: any, keyType?: "sk" | "psk") => WalletObject;
|
|
17
18
|
/**
|
|
18
19
|
* @param {string} [type=process.env.CHAIN_TYPE] can only be 'eth|ethereum' or 'default|arcblock'
|
|
19
20
|
* @param {string} [appSk=process.env.BLOCKLET_APP_SK] must be hex
|
|
21
|
+
* @param {string} [keyType='sk'] key type to use ('sk' or 'psk')
|
|
20
22
|
* @return {WalletObject} {WalletObject}
|
|
21
23
|
*/
|
|
22
24
|
export declare const getWallet: {
|
|
23
|
-
(type?: DIDTypeShortcut, appSk?: string): WalletObject;
|
|
25
|
+
(type?: DIDTypeShortcut, appSk?: string, keyType?: "sk" | "psk"): WalletObject;
|
|
24
26
|
getPermanentWallet: () => WalletObject<string>;
|
|
25
27
|
getEthereumWallet: (permanent?: boolean) => WalletObject<string>;
|
|
26
28
|
getPkWallet: (type?: DIDTypeShortcut, appPk?: string) => WalletObject;
|
|
27
|
-
deriveWallet: (sub: string, type?:
|
|
29
|
+
deriveWallet: (sub: string, type?: DIDTypeArg, index?: number) => Promise<WalletObject>;
|
|
28
30
|
getAccessWallet: () => WalletObject<string>;
|
|
29
31
|
};
|
|
30
32
|
/**
|
|
@@ -34,7 +36,7 @@ export declare const getWallet: {
|
|
|
34
36
|
* @param index - Index for deriving wallet (default: 0)
|
|
35
37
|
* @returns Wallet object with sign and signJWT methods
|
|
36
38
|
*/
|
|
37
|
-
export declare const deriveWallet: (sub: string, type?:
|
|
39
|
+
export declare const deriveWallet: (sub: string, type?: DIDTypeArg, index?: number) => Promise<WalletObject>;
|
|
38
40
|
export declare const getPermanentWallet: () => WalletObject<string>;
|
|
39
41
|
export declare const getEthereumWallet: (permanent?: boolean) => WalletObject<string>;
|
|
40
42
|
export declare const getAccessWallet: () => WalletObject<string>;
|
package/lib/wallet.js
CHANGED
|
@@ -33,9 +33,10 @@ exports.getPkWallet = getPkWallet;
|
|
|
33
33
|
* Create a remote wallet with sign and signJWT methods that call blocklet-service
|
|
34
34
|
* @param publicKey - The public key to create the wallet from
|
|
35
35
|
* @param type - The wallet type
|
|
36
|
+
* @param keyType - Key type to use ('sk' or 'psk')
|
|
36
37
|
* @returns Wallet object with remote sign and signJWT methods
|
|
37
38
|
*/
|
|
38
|
-
const createRemoteWallet = (publicKey, type) => {
|
|
39
|
+
const createRemoteWallet = (publicKey, type, keyType = 'sk') => {
|
|
39
40
|
if (!publicKey) {
|
|
40
41
|
throw new Error('Missing publicKey for creating remote wallet');
|
|
41
42
|
}
|
|
@@ -43,9 +44,10 @@ const createRemoteWallet = (publicKey, type) => {
|
|
|
43
44
|
const baseWallet = (0, wallet_1.fromPublicKey)(publicKey, type);
|
|
44
45
|
const remoteWallet = Object.create(baseWallet);
|
|
45
46
|
// Add remote sign method
|
|
46
|
-
|
|
47
|
+
// Support full wallet.sign signature: sign(data, encoding?, hashBeforeSign?)
|
|
48
|
+
remoteWallet.sign = async (payload, encoding, hashBeforeSign) => {
|
|
47
49
|
try {
|
|
48
|
-
const { signature } = await (0, signature_1.remoteSign)(payload);
|
|
50
|
+
const { signature } = await (0, signature_1.remoteSign)(payload, { keyType, encoding, hashBeforeSign });
|
|
49
51
|
if (!signature) {
|
|
50
52
|
throw new Error('Empty signature returned from blocklet-service');
|
|
51
53
|
}
|
|
@@ -59,7 +61,7 @@ const createRemoteWallet = (publicKey, type) => {
|
|
|
59
61
|
// Match the signature: signJWT(payload?, doSign?, version?)
|
|
60
62
|
remoteWallet.signJWT = async (payload, doSign, version) => {
|
|
61
63
|
try {
|
|
62
|
-
const { token } = await (0, signature_1.remoteSignJWT)(payload, { doSign, version });
|
|
64
|
+
const { token } = await (0, signature_1.remoteSignJWT)(payload, { doSign, version, keyType });
|
|
63
65
|
if (!token) {
|
|
64
66
|
throw new Error('Empty JWT token returned from blocklet-service');
|
|
65
67
|
}
|
|
@@ -72,7 +74,7 @@ const createRemoteWallet = (publicKey, type) => {
|
|
|
72
74
|
// Add remote signETH method
|
|
73
75
|
remoteWallet.signETH = async (data, hashBeforeSign) => {
|
|
74
76
|
try {
|
|
75
|
-
const { signature } = await (0, signature_1.remoteSignETH)(data, hashBeforeSign);
|
|
77
|
+
const { signature } = await (0, signature_1.remoteSignETH)(data, { hashBeforeSign, keyType });
|
|
76
78
|
if (!signature) {
|
|
77
79
|
throw new Error('Empty signature returned from blocklet-service');
|
|
78
80
|
}
|
|
@@ -88,13 +90,14 @@ exports.createRemoteWallet = createRemoteWallet;
|
|
|
88
90
|
/**
|
|
89
91
|
* @param {string} [type=process.env.CHAIN_TYPE] can only be 'eth|ethereum' or 'default|arcblock'
|
|
90
92
|
* @param {string} [appSk=process.env.BLOCKLET_APP_SK] must be hex
|
|
93
|
+
* @param {string} [keyType='sk'] key type to use ('sk' or 'psk')
|
|
91
94
|
* @return {WalletObject} {WalletObject}
|
|
92
95
|
*/
|
|
93
|
-
const getWallet = (type, appSk = process.env.BLOCKLET_APP_SK) => {
|
|
96
|
+
const getWallet = (type, appSk = process.env.BLOCKLET_APP_SK, keyType = 'sk') => {
|
|
94
97
|
// BLOCKLET_WALLET_TYPE is for backward compatibility
|
|
95
98
|
// eslint-disable-next-line no-param-reassign
|
|
96
99
|
type = type || process.env.CHAIN_TYPE || process.env.BLOCKLET_WALLET_TYPE;
|
|
97
|
-
const cacheKey = [type, appSk || REMOTE_CACHE_PLACEHOLDER].join('_');
|
|
100
|
+
const cacheKey = [type, appSk || REMOTE_CACHE_PLACEHOLDER, keyType].join('_');
|
|
98
101
|
const cache = exports.cacheWallet.get(cacheKey);
|
|
99
102
|
if (cache)
|
|
100
103
|
return cache;
|
|
@@ -102,8 +105,12 @@ const getWallet = (type, appSk = process.env.BLOCKLET_APP_SK) => {
|
|
|
102
105
|
? (0, wallet_1.WalletType)(type)
|
|
103
106
|
: (0, wallet_1.WalletType)({ role: mcrypto_1.types.RoleType.ROLE_APPLICATION, pk: mcrypto_1.types.KeyType.ED25519, hash: mcrypto_1.types.HashType.SHA3 });
|
|
104
107
|
if (!appSk) {
|
|
105
|
-
|
|
106
|
-
const
|
|
108
|
+
// Select public key based on keyType
|
|
109
|
+
const appPk = keyType === 'psk' ? process.env.BLOCKLET_APP_PPK : process.env.BLOCKLET_APP_PK;
|
|
110
|
+
if (!appPk) {
|
|
111
|
+
throw new Error(`Missing public key for ${keyType.toUpperCase()} wallet: BLOCKLET_APP_P${keyType.toUpperCase()}`);
|
|
112
|
+
}
|
|
113
|
+
const currentWallet = (0, exports.createRemoteWallet)(appPk, walletType, keyType);
|
|
107
114
|
exports.cacheWallet.set(cacheKey, currentWallet);
|
|
108
115
|
return currentWallet;
|
|
109
116
|
}
|
|
@@ -127,22 +134,22 @@ const deriveWallet = async (sub, type, index) => {
|
|
|
127
134
|
return (0, did_ext_1.fromAppDid)(sub, appSk, type, index);
|
|
128
135
|
}
|
|
129
136
|
// No secret key available, use remote fromAppDid
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
const walletJSON = await (0, signature_1.remoteDeriveWallet)(sub, type, index);
|
|
138
|
+
const wallet = (0, wallet_1.fromJSON)(walletJSON);
|
|
139
|
+
if (!(0, wallet_1.isValid)(wallet, true)) {
|
|
140
|
+
throw new Error('Invalid response from remote fromAppDid: wallet is invalid');
|
|
133
141
|
}
|
|
134
|
-
|
|
135
|
-
return (0, exports.createRemoteWallet)(publicKey, walletType);
|
|
142
|
+
return wallet;
|
|
136
143
|
};
|
|
137
144
|
exports.deriveWallet = deriveWallet;
|
|
138
145
|
// BLOCKLET_WALLET_TYPE is for backward compatibility
|
|
139
|
-
const getPermanentWallet = () => (0, exports.getWallet)(process.env.CHAIN_TYPE || process.env.BLOCKLET_WALLET_TYPE, process.env.BLOCKLET_APP_PSK);
|
|
146
|
+
const getPermanentWallet = () => (0, exports.getWallet)(process.env.CHAIN_TYPE || process.env.BLOCKLET_WALLET_TYPE, process.env.BLOCKLET_APP_PSK, 'psk');
|
|
140
147
|
exports.getPermanentWallet = getPermanentWallet;
|
|
141
|
-
const getEthereumWallet = (permanent = false) => (0, exports.getWallet)('ethereum', permanent ? process.env.BLOCKLET_APP_PSK : process.env.BLOCKLET_APP_SK);
|
|
148
|
+
const getEthereumWallet = (permanent = false) => (0, exports.getWallet)('ethereum', permanent ? process.env.BLOCKLET_APP_PSK : process.env.BLOCKLET_APP_SK, permanent ? 'psk' : 'sk');
|
|
142
149
|
exports.getEthereumWallet = getEthereumWallet;
|
|
143
150
|
const getAccessWallet = () => (0, exports.getWallet)(process.env.CHAIN_TYPE || process.env.BLOCKLET_WALLET_TYPE,
|
|
144
151
|
// Compatible with previous version where APP_ASK does not exist
|
|
145
|
-
process.env.BLOCKLET_APP_ASK || process.env.BLOCKLET_APP_SK);
|
|
152
|
+
process.env.BLOCKLET_APP_ASK || process.env.BLOCKLET_APP_SK, 'sk');
|
|
146
153
|
exports.getAccessWallet = getAccessWallet;
|
|
147
154
|
// Expose helper methods as properties of getWallet
|
|
148
155
|
exports.getWallet.getPermanentWallet = exports.getPermanentWallet;
|
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-20251024-030947-6f2889bf",
|
|
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",
|
|
@@ -28,26 +28,26 @@
|
|
|
28
28
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@abtnode/constant": "1.16.54-beta-
|
|
32
|
-
"@abtnode/db-cache": "1.16.54-beta-
|
|
33
|
-
"@abtnode/util": "1.16.54-beta-
|
|
34
|
-
"@arcblock/did": "^1.26.
|
|
35
|
-
"@arcblock/did-connect-js": "^1.26.
|
|
36
|
-
"@arcblock/did-ext": "^1.26.
|
|
37
|
-
"@arcblock/jwt": "^1.26.
|
|
38
|
-
"@arcblock/ws": "^1.26.
|
|
39
|
-
"@blocklet/constant": "1.16.54-beta-
|
|
40
|
-
"@blocklet/env": "1.16.54-beta-
|
|
31
|
+
"@abtnode/constant": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
32
|
+
"@abtnode/db-cache": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
33
|
+
"@abtnode/util": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
34
|
+
"@arcblock/did": "^1.26.3",
|
|
35
|
+
"@arcblock/did-connect-js": "^1.26.3",
|
|
36
|
+
"@arcblock/did-ext": "^1.26.3",
|
|
37
|
+
"@arcblock/jwt": "^1.26.3",
|
|
38
|
+
"@arcblock/ws": "^1.26.3",
|
|
39
|
+
"@blocklet/constant": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
40
|
+
"@blocklet/env": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
41
41
|
"@blocklet/error": "^0.2.5",
|
|
42
|
-
"@blocklet/meta": "1.16.54-beta-
|
|
43
|
-
"@blocklet/server-js": "1.16.54-beta-
|
|
42
|
+
"@blocklet/meta": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
43
|
+
"@blocklet/server-js": "1.16.54-beta-20251024-030947-6f2889bf",
|
|
44
44
|
"@blocklet/theme": "^3.1.51",
|
|
45
45
|
"@did-connect/authenticator": "^2.2.8",
|
|
46
46
|
"@did-connect/handler": "^2.2.8",
|
|
47
47
|
"@nedb/core": "^2.1.5",
|
|
48
|
-
"@ocap/mcrypto": "^1.26.
|
|
49
|
-
"@ocap/util": "^1.26.
|
|
50
|
-
"@ocap/wallet": "^1.26.
|
|
48
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
49
|
+
"@ocap/util": "^1.26.3",
|
|
50
|
+
"@ocap/wallet": "^1.26.3",
|
|
51
51
|
"axios": "^1.7.9",
|
|
52
52
|
"cheerio": "1.0.0-rc.12",
|
|
53
53
|
"debug": "^4.4.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"ts-node": "^10.9.1",
|
|
88
88
|
"typescript": "^5.6.3"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "73e5a3a80b82a2a7c62d42fdc08207b28e67633e"
|
|
91
91
|
}
|