@blocklet/meta 1.6.3 → 1.6.4

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/payment.js CHANGED
@@ -5,14 +5,7 @@ const { isValidFactory } = require('@ocap/asset');
5
5
  const { toFactoryAddress } = require('@arcblock/did-util');
6
6
  const { getBlockletPurchaseTemplate } = require('@arcblock/nft/lib/templates');
7
7
 
8
- const isFreeBlocklet = (meta) => {
9
- if (!meta.payment) {
10
- return true;
11
- }
12
-
13
- const priceList = (meta.payment.price || []).map((x) => x.value || 0);
14
- return priceList.every((x) => x === 0);
15
- };
8
+ const { isFreeBlocklet } = require('./util');
16
9
 
17
10
  const createShareContract = ({ tokens = [], shares = [] }) => {
18
11
  const zeroBN = new BN(0);
package/lib/util.js CHANGED
@@ -82,7 +82,17 @@ const getRequiredMissingConfigs = (blocklet) => {
82
82
  return missingConfigs;
83
83
  };
84
84
 
85
+ const isFreeBlocklet = (meta) => {
86
+ if (!meta.payment) {
87
+ return true;
88
+ }
89
+
90
+ const priceList = (meta.payment.price || []).map((x) => x.value || 0);
91
+ return priceList.every((x) => x === 0);
92
+ };
93
+
85
94
  module.exports = {
95
+ isFreeBlocklet,
86
96
  forEachBlocklet,
87
97
  isAuthServiceEnabled,
88
98
  getRequiredMissingConfigs,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.3",
6
+ "version": "1.6.4",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,14 +18,14 @@
18
18
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@arcblock/did": "^1.13.71",
22
- "@arcblock/did-ext": "^1.13.71",
23
- "@arcblock/did-util": "^1.13.71",
24
- "@arcblock/nft": "^1.13.71",
25
- "@ocap/asset": "^1.13.71",
26
- "@ocap/mcrypto": "^1.13.71",
27
- "@ocap/util": "^1.13.71",
28
- "@ocap/wallet": "^1.13.71",
21
+ "@arcblock/did": "^1.13.77",
22
+ "@arcblock/did-ext": "^1.13.77",
23
+ "@arcblock/did-util": "^1.13.77",
24
+ "@arcblock/nft": "^1.13.77",
25
+ "@ocap/asset": "^1.13.77",
26
+ "@ocap/mcrypto": "^1.13.77",
27
+ "@ocap/util": "^1.13.77",
28
+ "@ocap/wallet": "^1.13.77",
29
29
  "ajv": "^7.0.3",
30
30
  "debug": "^4.3.3",
31
31
  "fs-extra": "^10.0.0",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "jest": "^27.3.1"
44
44
  },
45
- "gitHead": "3642ccce1e0ab0e1937e32a7dc119a9763bc21c2"
45
+ "gitHead": "1c144cb9fb9a9952bc92f25cabbdb47a378cbd24"
46
46
  }