@arcblock/did-util 1.28.4 → 1.28.5
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/esm/index.mjs +2 -1
- package/lib/_virtual/rolldown_runtime.cjs +29 -0
- package/lib/index.cjs +4 -1
- package/package.json +8 -8
package/esm/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Hasher, types } from "@ocap/mcrypto";
|
|
2
2
|
import { fromHash } from "@arcblock/did";
|
|
3
3
|
import { createMessage } from "@ocap/message";
|
|
4
|
-
import
|
|
4
|
+
import ocapProto from "@ocap/proto";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
7
|
+
const { transactions } = ocapProto;
|
|
7
8
|
/**
|
|
8
9
|
* Create an itx address
|
|
9
10
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/lib/index.cjs
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
1
2
|
let _ocap_mcrypto = require("@ocap/mcrypto");
|
|
2
3
|
let _arcblock_did = require("@arcblock/did");
|
|
3
4
|
let _ocap_message = require("@ocap/message");
|
|
4
5
|
let _ocap_proto = require("@ocap/proto");
|
|
6
|
+
_ocap_proto = require_rolldown_runtime.__toESM(_ocap_proto);
|
|
5
7
|
|
|
6
8
|
//#region src/index.ts
|
|
9
|
+
const { transactions } = _ocap_proto.default;
|
|
7
10
|
/**
|
|
8
11
|
* Create an itx address
|
|
9
12
|
*/
|
|
10
13
|
function toItxAddress(itx, type, role = _ocap_mcrypto.types.RoleType.ROLE_TX) {
|
|
11
|
-
if (
|
|
14
|
+
if (transactions.indexOf(type) === -1) throw new Error(`Unsupported itx type ${type}`);
|
|
12
15
|
const itxBytes = (0, _ocap_message.createMessage)(type, itx).serializeBinary();
|
|
13
16
|
return (0, _arcblock_did.fromHash)(_ocap_mcrypto.Hasher.SHA3.hash256(itxBytes), role);
|
|
14
17
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/did-util",
|
|
3
3
|
"description": "Helper function to calculate did",
|
|
4
|
-
"version": "1.28.
|
|
4
|
+
"version": "1.28.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "wangshijun",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"wangshijun <shijun@arcblock.io> (https://github.com/wangshijun)"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@arcblock/did": "1.28.
|
|
23
|
-
"@ocap/mcrypto": "1.28.
|
|
24
|
-
"@ocap/message": "1.28.
|
|
25
|
-
"@ocap/proto": "1.28.
|
|
26
|
-
"@ocap/
|
|
27
|
-
"@ocap/
|
|
28
|
-
"@ocap/wallet": "1.28.
|
|
22
|
+
"@arcblock/did": "1.28.5",
|
|
23
|
+
"@ocap/mcrypto": "1.28.5",
|
|
24
|
+
"@ocap/message": "1.28.5",
|
|
25
|
+
"@ocap/proto": "1.28.5",
|
|
26
|
+
"@ocap/types": "1.28.5",
|
|
27
|
+
"@ocap/util": "1.28.5",
|
|
28
|
+
"@ocap/wallet": "1.28.5"
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"main": "./lib/index.cjs",
|