@blocklet/did-space-js 1.1.34 → 1.2.0
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.
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PutNftObjectCommand = void 0;
|
|
7
7
|
const util_1 = require("@ocap/util");
|
|
8
|
-
const env_1 =
|
|
8
|
+
const env_1 = require("@blocklet/sdk/lib/env");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const fs_extra_1 = require("fs-extra");
|
|
11
11
|
const form_data_1 = __importDefault(require("form-data"));
|
|
@@ -21,7 +21,7 @@ class PutNftObjectCommand extends base_1.BaseCommand {
|
|
|
21
21
|
tempCacheObjectHash;
|
|
22
22
|
constructor(input) {
|
|
23
23
|
super(input);
|
|
24
|
-
this.tempCacheObjectKey = (0, path_1.join)(env_1.
|
|
24
|
+
this.tempCacheObjectKey = (0, path_1.join)(env_1.env.dataDir, 'temp-uploads', Date.now() + this.input.display.key);
|
|
25
25
|
(0, fs_extra_1.ensureDirSync)((0, path_1.dirname)(this.tempCacheObjectKey));
|
|
26
26
|
}
|
|
27
27
|
getUrl() {
|
|
@@ -92,8 +92,8 @@ class PutNftObjectCommand extends base_1.BaseCommand {
|
|
|
92
92
|
created: currentTime,
|
|
93
93
|
updated: currentTime,
|
|
94
94
|
};
|
|
95
|
-
(0, did_document_1.signDidDocument)(didDocument, wallet);
|
|
96
|
-
return
|
|
95
|
+
const signed = await (0, did_document_1.signDidDocument)(didDocument, wallet);
|
|
96
|
+
return signed;
|
|
97
97
|
}
|
|
98
98
|
async getAxiosRequestConfig() {
|
|
99
99
|
try {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { WalletObject } from '@ocap/wallet';
|
|
2
2
|
import { DidDocument } from './did-document';
|
|
3
|
-
export declare function signDidDocument(didDocument: DidDocument, wallet: WalletObject): DidDocument
|
|
3
|
+
export declare function signDidDocument(didDocument: DidDocument, wallet: WalletObject): Promise<DidDocument>;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.signDidDocument = void 0;
|
|
7
7
|
const util_1 = require("@ocap/util");
|
|
8
8
|
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
9
|
-
function signDidDocument(didDocument, wallet) {
|
|
10
|
-
didDocument.proof.jws = (0, util_1.toBase64)(wallet.sign((0, json_stable_stringify_1.default)(didDocument)));
|
|
9
|
+
async function signDidDocument(didDocument, wallet) {
|
|
10
|
+
didDocument.proof.jws = (0, util_1.toBase64)(await wallet.sign((0, json_stable_stringify_1.default)(didDocument)));
|
|
11
11
|
return didDocument;
|
|
12
12
|
}
|
|
13
13
|
exports.signDidDocument = signDidDocument;
|
|
@@ -84,7 +84,7 @@ async function signRequest({ url, method, data, headers, wallet, delegation, thr
|
|
|
84
84
|
}
|
|
85
85
|
const signUrl = getSignUrl({ url });
|
|
86
86
|
const signData = (0, isString_1.default)(data?.data) ? data : {};
|
|
87
|
-
const token =
|
|
87
|
+
const token = await wallet.signJWT({
|
|
88
88
|
digest: mcrypto_1.Hasher.SHA3.hash256((0, json_stable_stringify_1.default)({
|
|
89
89
|
url: signUrl,
|
|
90
90
|
method,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/did-space-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"link": "yarn link"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@arcblock/did": "^1.
|
|
33
|
-
"@arcblock/jwt": "^1.
|
|
34
|
-
"@arcblock/validator": "^1.
|
|
35
|
-
"@blocklet/
|
|
36
|
-
"@did-space/constants": "^1.
|
|
37
|
-
"@did-space/core": "^1.
|
|
38
|
-
"@ocap/mcrypto": "^1.
|
|
39
|
-
"@ocap/util": "^1.
|
|
40
|
-
"@ocap/wallet": "^1.
|
|
32
|
+
"@arcblock/did": "^1.26.3",
|
|
33
|
+
"@arcblock/jwt": "^1.26.3",
|
|
34
|
+
"@arcblock/validator": "^1.26.3",
|
|
35
|
+
"@blocklet/sdk": "1.16.54-beta-20251029-055649-a9143beb",
|
|
36
|
+
"@did-space/constants": "^1.2.0",
|
|
37
|
+
"@did-space/core": "^1.2.0",
|
|
38
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
39
|
+
"@ocap/util": "^1.26.3",
|
|
40
|
+
"@ocap/wallet": "^1.26.3",
|
|
41
41
|
"agentkeepalive": "^4.6.0",
|
|
42
42
|
"axios": "^1.10.0",
|
|
43
43
|
"base64-url": "^2.3.3",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"ts-jest": "^28.0.8",
|
|
79
79
|
"typescript": "^4.9.5"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "c455cb9acf497bf06861a7df9a46db13032cf6f9"
|
|
82
82
|
}
|