@ocap/asset 1.18.51 → 1.18.52
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 +11 -11
package/lib/index.js
CHANGED
@@ -178,7 +178,7 @@ const preMintFromFactory = ({ factory, inputs, owner, issuer, }) => {
|
|
178
178
|
const extra = {};
|
179
179
|
const issuerObject = { id: wallet.address, pk: (0, util_1.toBase58)(wallet.publicKey), name };
|
180
180
|
const render = (templateObject) => JSON.parse(mustache_1.default.render(JSON.stringify(templateObject), {
|
181
|
-
input:
|
181
|
+
input: { ...inputs, ...extra },
|
182
182
|
data: data.value || data,
|
183
183
|
ctx: { factory: factoryAddress, id: numMinted + 1, owner, issuer: issuerObject },
|
184
184
|
}));
|
@@ -198,7 +198,7 @@ const preMintFromFactory = ({ factory, inputs, owner, issuer, }) => {
|
|
198
198
|
const vcRootPath = key.split('.').slice(0, -1).join('.');
|
199
199
|
const vcIdPath = vcRootPath.split('.').concat(['id']).join('.');
|
200
200
|
const typeInfo = (0, did_1.toTypeInfo)(issuerObject.id);
|
201
|
-
const vcType =
|
201
|
+
const vcType = { ...typeInfo, role: mcrypto_1.types.RoleType.ROLE_VC };
|
202
202
|
const vcId = (0, did_1.fromPublicKeyHash)(wallet.hash((0, vc_1.stableStringify)(subjectObject)), vcType);
|
203
203
|
extra.id = vcId;
|
204
204
|
extra.proofType = vc_1.proofTypes[typeInfo.pk];
|
@@ -241,7 +241,7 @@ const preMintFromFactory = ({ factory, inputs, owner, issuer, }) => {
|
|
241
241
|
// calculate address
|
242
242
|
const address = (0, did_util_1.toAssetAddress)(asset);
|
243
243
|
// return extra inputs
|
244
|
-
return { address, issuer: issuerObject, variables:
|
244
|
+
return { address, issuer: issuerObject, variables: { ...inputs, ...extra }, asset };
|
245
245
|
};
|
246
246
|
exports.preMintFromFactory = preMintFromFactory;
|
247
247
|
const formatFactoryState = (state) => {
|
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.18.
|
4
|
+
"version": "1.18.52",
|
5
5
|
"author": {
|
6
6
|
"name": "wangshijun",
|
7
7
|
"email": "shijun@arcblock.io",
|
@@ -18,15 +18,15 @@
|
|
18
18
|
"wangshijun <shijun@arcblock.io> (https://github.com/wangshijun)"
|
19
19
|
],
|
20
20
|
"dependencies": {
|
21
|
-
"@arcblock/did": "1.18.
|
22
|
-
"@arcblock/did-util": "1.18.
|
23
|
-
"@arcblock/validator": "1.18.
|
24
|
-
"@arcblock/vc": "1.18.
|
25
|
-
"@ocap/contract": "1.18.
|
26
|
-
"@ocap/mcrypto": "1.18.
|
27
|
-
"@ocap/types": "1.18.
|
28
|
-
"@ocap/util": "1.18.
|
29
|
-
"@ocap/wallet": "1.18.
|
21
|
+
"@arcblock/did": "1.18.52",
|
22
|
+
"@arcblock/did-util": "1.18.52",
|
23
|
+
"@arcblock/validator": "1.18.52",
|
24
|
+
"@arcblock/vc": "1.18.52",
|
25
|
+
"@ocap/contract": "1.18.52",
|
26
|
+
"@ocap/mcrypto": "1.18.52",
|
27
|
+
"@ocap/types": "1.18.52",
|
28
|
+
"@ocap/util": "1.18.52",
|
29
|
+
"@ocap/wallet": "1.18.52",
|
30
30
|
"debug": "^4.3.4",
|
31
31
|
"flat": "^5.0.2",
|
32
32
|
"is-absolute-url": "^3.0.3",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"build": "tsc",
|
75
75
|
"build:watch": "npm run build -- -w"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "96239c70a503c2a045dbef508c3086251dee7ce5"
|
78
78
|
}
|