@ocap/asset 1.28.5 → 1.28.7

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/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  ```sh
17
17
  npm install @ocap/asset
18
18
  // or
19
- pnpm install @ocap/asset
19
+ bun install @ocap/asset
20
20
  ```
21
21
 
22
22
  ## Usage
package/esm/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { LiteralUnion, PartialDeep } from "type-fest";
2
- import { WalletObject } from "@ocap/wallet";
3
1
  import { TAssetFactoryState, TCreateAssetTx } from "@ocap/types";
2
+ import { WalletObject } from "@ocap/wallet";
3
+ import { LiteralUnion, PartialDeep } from "type-fest";
4
4
 
5
5
  //#region src/index.d.ts
6
6
  type $TSFixMe = any;
package/esm/index.mjs CHANGED
@@ -1,20 +1,20 @@
1
- import get from "lodash/get.js";
2
- import set from "lodash/set.js";
3
- import uniq from "lodash/uniq.js";
4
- import uniqBy from "lodash/uniqBy.js";
5
- import isEmpty from "lodash/isEmpty.js";
6
- import flatten from "flat";
7
- import mustache from "mustache";
8
- import isAbsoluteUrl from "is-absolute-url";
9
- import cloneDeep from "lodash/cloneDeep.js";
10
1
  import { fromPublicKeyHash, toTypeInfo } from "@arcblock/did";
11
- import { proofTypes, stableStringify, verify } from "@arcblock/vc";
12
- import { schemas } from "@arcblock/validator";
13
2
  import { toAssetAddress } from "@arcblock/did-util";
3
+ import { schemas } from "@arcblock/validator";
4
+ import { proofTypes, stableStringify, verify } from "@arcblock/vc";
5
+ import { compile, getQuota, validate } from "@ocap/contract";
14
6
  import { types } from "@ocap/mcrypto";
15
7
  import { toBase58, toBase64 } from "@ocap/util";
16
- import { compile, getQuota, validate } from "@ocap/contract";
17
8
  import Debug from "debug";
9
+ import flatten from "flat";
10
+ import isAbsoluteUrl from "is-absolute-url";
11
+ import cloneDeep from "lodash/cloneDeep.js";
12
+ import get from "lodash/get.js";
13
+ import isEmpty from "lodash/isEmpty.js";
14
+ import set from "lodash/set.js";
15
+ import uniq from "lodash/uniq.js";
16
+ import uniqBy from "lodash/uniqBy.js";
17
+ import mustache from "mustache";
18
18
 
19
19
  //#region src/index.ts
20
20
  const debug = Debug("@ocap/asset");
@@ -53,7 +53,7 @@ const isValidFactory = (props) => {
53
53
  try {
54
54
  const template = JSON.stringify(value.output, null, 2);
55
55
  if (mustache.parse(template).filter(([type]) => type === "name").some(([, notation]) => isValidNotation(notation) === false)) throw new Error("Invalid tags found in the output template");
56
- } catch (err) {
56
+ } catch (_err) {
57
57
  throw new Error("Factory output should be a valid mustache template when serialized as json");
58
58
  }
59
59
  const quota = getQuota(value.input);
@@ -189,7 +189,7 @@ const preMintFromFactory = async ({ factory, inputs, owner, issuer }) => {
189
189
  set(template, vcIdPath, vcId);
190
190
  if (!proofTypes[typeInfo.pk]) throw new Error("Unsupported signer type when create verifiable credential");
191
191
  let vcObj = render(get(template, vcRootPath));
192
- delete vcObj.proof;
192
+ vcObj.proof = void 0;
193
193
  const vcStr = stableStringify(vcObj);
194
194
  const signature = toBase64(await wallet.sign(vcStr));
195
195
  vcObj.proof = {
package/lib/index.cjs CHANGED
@@ -1,31 +1,31 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ let _arcblock_did = require("@arcblock/did");
3
+ let _arcblock_did_util = require("@arcblock/did-util");
4
+ let _arcblock_validator = require("@arcblock/validator");
5
+ let _arcblock_vc = require("@arcblock/vc");
6
+ let _ocap_contract = require("@ocap/contract");
7
+ let _ocap_mcrypto = require("@ocap/mcrypto");
8
+ let _ocap_util = require("@ocap/util");
9
+ let debug = require("debug");
10
+ debug = require_rolldown_runtime.__toESM(debug);
11
+ let flat = require("flat");
12
+ flat = require_rolldown_runtime.__toESM(flat);
13
+ let is_absolute_url = require("is-absolute-url");
14
+ is_absolute_url = require_rolldown_runtime.__toESM(is_absolute_url);
15
+ let lodash_cloneDeep = require("lodash/cloneDeep");
16
+ lodash_cloneDeep = require_rolldown_runtime.__toESM(lodash_cloneDeep);
2
17
  let lodash_get = require("lodash/get");
3
18
  lodash_get = require_rolldown_runtime.__toESM(lodash_get);
19
+ let lodash_isEmpty = require("lodash/isEmpty");
20
+ lodash_isEmpty = require_rolldown_runtime.__toESM(lodash_isEmpty);
4
21
  let lodash_set = require("lodash/set");
5
22
  lodash_set = require_rolldown_runtime.__toESM(lodash_set);
6
23
  let lodash_uniq = require("lodash/uniq");
7
24
  lodash_uniq = require_rolldown_runtime.__toESM(lodash_uniq);
8
25
  let lodash_uniqBy = require("lodash/uniqBy");
9
26
  lodash_uniqBy = require_rolldown_runtime.__toESM(lodash_uniqBy);
10
- let lodash_isEmpty = require("lodash/isEmpty");
11
- lodash_isEmpty = require_rolldown_runtime.__toESM(lodash_isEmpty);
12
- let flat = require("flat");
13
- flat = require_rolldown_runtime.__toESM(flat);
14
27
  let mustache = require("mustache");
15
28
  mustache = require_rolldown_runtime.__toESM(mustache);
16
- let is_absolute_url = require("is-absolute-url");
17
- is_absolute_url = require_rolldown_runtime.__toESM(is_absolute_url);
18
- let lodash_cloneDeep = require("lodash/cloneDeep");
19
- lodash_cloneDeep = require_rolldown_runtime.__toESM(lodash_cloneDeep);
20
- let _arcblock_did = require("@arcblock/did");
21
- let _arcblock_vc = require("@arcblock/vc");
22
- let _arcblock_validator = require("@arcblock/validator");
23
- let _arcblock_did_util = require("@arcblock/did-util");
24
- let _ocap_mcrypto = require("@ocap/mcrypto");
25
- let _ocap_util = require("@ocap/util");
26
- let _ocap_contract = require("@ocap/contract");
27
- let debug = require("debug");
28
- debug = require_rolldown_runtime.__toESM(debug);
29
29
 
30
30
  //#region src/index.ts
31
31
  const debug$1 = (0, debug.default)("@ocap/asset");
@@ -64,7 +64,7 @@ const isValidFactory = (props) => {
64
64
  try {
65
65
  const template = JSON.stringify(value.output, null, 2);
66
66
  if (mustache.default.parse(template).filter(([type]) => type === "name").some(([, notation]) => isValidNotation(notation) === false)) throw new Error("Invalid tags found in the output template");
67
- } catch (err) {
67
+ } catch (_err) {
68
68
  throw new Error("Factory output should be a valid mustache template when serialized as json");
69
69
  }
70
70
  const quota = (0, _ocap_contract.getQuota)(value.input);
@@ -200,7 +200,7 @@ const preMintFromFactory = async ({ factory, inputs, owner, issuer }) => {
200
200
  (0, lodash_set.default)(template, vcIdPath, vcId);
201
201
  if (!_arcblock_vc.proofTypes[typeInfo.pk]) throw new Error("Unsupported signer type when create verifiable credential");
202
202
  let vcObj = render((0, lodash_get.default)(template, vcRootPath));
203
- delete vcObj.proof;
203
+ vcObj.proof = void 0;
204
204
  const vcStr = (0, _arcblock_vc.stableStringify)(vcObj);
205
205
  const signature = (0, _ocap_util.toBase64)(await wallet.sign(vcStr));
206
206
  vcObj.proof = {
package/lib/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { LiteralUnion, PartialDeep } from "type-fest";
2
- import { WalletObject } from "@ocap/wallet";
3
1
  import { TAssetFactoryState, TCreateAssetTx } from "@ocap/types";
2
+ import { WalletObject } from "@ocap/wallet";
3
+ import { LiteralUnion, PartialDeep } from "type-fest";
4
4
 
5
5
  //#region src/index.d.ts
6
6
  type $TSFixMe = any;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ocap/asset",
3
3
  "description": "Utility to work with asset and factory on ArcBlock blockchain",
4
4
  "type": "module",
5
- "version": "1.28.5",
5
+ "version": "1.28.7",
6
6
  "author": {
7
7
  "name": "wangshijun",
8
8
  "email": "shijun@arcblock.io",
@@ -19,32 +19,27 @@
19
19
  "wangshijun <shijun@arcblock.io> (https://github.com/wangshijun)"
20
20
  ],
21
21
  "dependencies": {
22
+ "@arcblock/did": "1.28.7",
23
+ "@arcblock/did-util": "1.28.7",
24
+ "@arcblock/validator": "1.28.7",
25
+ "@arcblock/vc": "1.28.7",
26
+ "@ocap/contract": "1.28.7",
27
+ "@ocap/mcrypto": "1.28.7",
28
+ "@ocap/types": "1.28.7",
29
+ "@ocap/util": "1.28.7",
30
+ "@ocap/wallet": "1.28.7",
22
31
  "debug": "^4.3.6",
23
32
  "flat": "^5.0.2",
24
33
  "is-absolute-url": "^3.0.3",
25
34
  "json-stable-stringify": "^1.0.1",
26
35
  "lodash": "^4.17.21",
27
- "mustache": "^4.2.0",
28
- "@arcblock/did-util": "1.28.5",
29
- "@arcblock/validator": "1.28.5",
30
- "@arcblock/vc": "1.28.5",
31
- "@ocap/contract": "1.28.5",
32
- "@ocap/mcrypto": "1.28.5",
33
- "@ocap/types": "1.28.5",
34
- "@ocap/util": "1.28.5",
35
- "@arcblock/did": "1.28.5",
36
- "@ocap/wallet": "1.28.5"
36
+ "mustache": "^4.2.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@arcblock/eslint-config-ts": "0.3.3",
40
39
  "@types/flat": "^5.0.5",
41
- "@types/jest": "^29.5.13",
42
40
  "@types/mustache": "^4.2.5",
43
41
  "@types/node": "^22.7.5",
44
- "eslint": "^8.57.0",
45
- "jest": "^29.7.0",
46
42
  "prettier": "^3.3.2",
47
- "ts-jest": "^29.2.5",
48
43
  "tsdown": "^0.18.4",
49
44
  "type-fest": "^3.1.0",
50
45
  "typescript": "^5.6.2"
@@ -76,13 +71,13 @@
76
71
  "type": "git",
77
72
  "url": "https://github.com/ArcBlock/blockchain/tree/master/core/asset"
78
73
  },
79
- "gitHead": "87990c8b5e215107fc587c1ced0d6b3e2cd2483e",
80
74
  "scripts": {
81
- "lint": "eslint src tests",
82
- "lint:fix": "npm run lint -- --fix",
83
- "test": "jest --forceExit --detectOpenHandles",
75
+ "lint": "biome check",
76
+ "lint:fix": "biome check --write",
77
+ "test": "bun test",
84
78
  "coverage": "npm run test -- --coverage",
85
79
  "build": "tsdown",
86
80
  "build:watch": "tsdown -w"
87
- }
88
- }
81
+ },
82
+ "gitHead": "87990c8b5e215107fc587c1ced0d6b3e2cd2483e"
83
+ }