@ocap/asset 1.17.1 → 1.17.4
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/index.js +3 -3
- package/package.json +9 -9
package/lib/index.js
CHANGED
@@ -9,6 +9,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const set_1 = __importDefault(require("lodash/set"));
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
11
11
|
const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
|
12
|
+
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
12
13
|
const flat_1 = __importDefault(require("flat"));
|
13
14
|
const mustache_1 = __importDefault(require("mustache"));
|
14
15
|
const is_absolute_url_1 = __importDefault(require("is-absolute-url"));
|
@@ -20,7 +21,6 @@ const mcrypto_1 = require("@ocap/mcrypto");
|
|
20
21
|
const util_1 = require("@ocap/util");
|
21
22
|
const contract_1 = require("@ocap/contract");
|
22
23
|
const debug_1 = __importDefault(require("debug"));
|
23
|
-
const lodash_1 = require("lodash");
|
24
24
|
const debug = (0, debug_1.default)('@ocap/asset');
|
25
25
|
const SUPPORTED_HOOK_NAMES = ['mint', 'postMint'];
|
26
26
|
const SUPPORTED_HOOK_TYPES = ['contract', 'url'];
|
@@ -66,7 +66,7 @@ const isValidFactory = (props) => {
|
|
66
66
|
throw new Error('Factory settlement prop should only be instant or periodic');
|
67
67
|
}
|
68
68
|
// input.tokens and input.assets should not be empty
|
69
|
-
if (['value', 'tokens', 'assets'].every((x) => (0,
|
69
|
+
if (['value', 'tokens', 'assets'].every((x) => (0, isEmpty_1.default)(props.input[x]))) {
|
70
70
|
throw new Error('Factory input should contain at least one token or asset');
|
71
71
|
}
|
72
72
|
if ((0, uniqBy_1.default)(props.input.tokens, 'address').length !== props.input.tokens.length) {
|
@@ -109,7 +109,7 @@ const isValidFactory = (props) => {
|
|
109
109
|
if (quota.value <= 0 && Object.keys(quota.tokens).every((x) => quota[x] <= 0)) {
|
110
110
|
return true;
|
111
111
|
}
|
112
|
-
if ((0,
|
112
|
+
if ((0, isEmpty_1.default)(props.hooks)) {
|
113
113
|
throw new Error('Factory hooks should not be empty for instant settlement');
|
114
114
|
}
|
115
115
|
const mintHook = props.hooks.find((x) => x.name === 'mint');
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ocap/asset",
|
3
3
|
"description": "Utility to work with asset and factory on ArcBlock blockchain",
|
4
|
-
"version": "1.17.
|
4
|
+
"version": "1.17.4",
|
5
5
|
"author": {
|
6
6
|
"name": "wangshijun",
|
7
7
|
"email": "shijun@arcblock.io",
|
@@ -18,13 +18,13 @@
|
|
18
18
|
"wangshijun <shijun@arcblock.io> (https://github.com/wangshijun)"
|
19
19
|
],
|
20
20
|
"dependencies": {
|
21
|
-
"@arcblock/did": "1.17.
|
22
|
-
"@arcblock/did-util": "1.17.
|
23
|
-
"@arcblock/vc": "1.17.
|
24
|
-
"@ocap/contract": "1.17.
|
25
|
-
"@ocap/mcrypto": "1.17.
|
26
|
-
"@ocap/util": "1.17.
|
27
|
-
"@ocap/wallet": "1.17.
|
21
|
+
"@arcblock/did": "1.17.4",
|
22
|
+
"@arcblock/did-util": "1.17.4",
|
23
|
+
"@arcblock/vc": "1.17.4",
|
24
|
+
"@ocap/contract": "1.17.4",
|
25
|
+
"@ocap/mcrypto": "1.17.4",
|
26
|
+
"@ocap/util": "1.17.4",
|
27
|
+
"@ocap/wallet": "1.17.4",
|
28
28
|
"debug": "^4.3.3",
|
29
29
|
"flat": "^5.0.2",
|
30
30
|
"is-absolute-url": "^3.0.3",
|
@@ -71,5 +71,5 @@
|
|
71
71
|
"build": "tsc",
|
72
72
|
"build:watch": "npm run build -- -w"
|
73
73
|
},
|
74
|
-
"gitHead": "
|
74
|
+
"gitHead": "296f3dccba7a691244212a51481fffcf142fc138"
|
75
75
|
}
|