@ocap/asset 1.14.23 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/index.js +12 -6
- package/package.json +9 -9
package/lib/index.js
CHANGED
@@ -168,13 +168,16 @@ const findPrerenderKeys = (obj, keyword) => {
|
|
168
168
|
* @param {object} params.issuer issuer object
|
169
169
|
*/
|
170
170
|
const mintFromFactory = ({ factory, inputs, owner, issuer }) => {
|
171
|
-
const { output, address: factoryAddress, data } = factory;
|
172
|
-
debug(
|
171
|
+
const { output, address: factoryAddress, numMinted, data } = factory;
|
172
|
+
debug(
|
173
|
+
'mintFromFactory.args',
|
174
|
+
JSON.stringify({ output, factoryAddress, numMinted, inputs, owner, issuer, data }, null, 2)
|
175
|
+
);
|
173
176
|
const asset = JSON.parse(
|
174
177
|
mustache.render(JSON.stringify(output), {
|
175
178
|
input: inputs,
|
176
179
|
data: data.value || data,
|
177
|
-
ctx: { factory: factoryAddress, owner, issuer },
|
180
|
+
ctx: { factory: factoryAddress, id: numMinted + 1, owner, issuer },
|
178
181
|
})
|
179
182
|
);
|
180
183
|
|
@@ -198,10 +201,13 @@ const preMintFromFactory = ({ factory, inputs, owner, issuer }) => {
|
|
198
201
|
}
|
199
202
|
|
200
203
|
let asset = null;
|
201
|
-
const { output, address: factoryAddress, data } = factory;
|
204
|
+
const { output, numMinted, address: factoryAddress, data } = factory;
|
202
205
|
const { wallet, name } = issuer;
|
203
206
|
|
204
|
-
debug(
|
207
|
+
debug(
|
208
|
+
'preMintFromFactory.args',
|
209
|
+
JSON.stringify({ output, factoryAddress, numMinted, inputs, owner, issuer, data }, null, 2)
|
210
|
+
);
|
205
211
|
|
206
212
|
const extra = {};
|
207
213
|
const issuerObject = { id: wallet.address, pk: toBase58(wallet.publicKey), name };
|
@@ -211,7 +217,7 @@ const preMintFromFactory = ({ factory, inputs, owner, issuer }) => {
|
|
211
217
|
mustache.render(JSON.stringify(templateObject), {
|
212
218
|
input: { ...inputs, ...extra },
|
213
219
|
data: data.value || data,
|
214
|
-
ctx: { factory: factoryAddress, owner, issuer: issuerObject },
|
220
|
+
ctx: { factory: factoryAddress, id: numMinted + 1, owner, issuer: issuerObject },
|
215
221
|
})
|
216
222
|
);
|
217
223
|
|
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.
|
4
|
+
"version": "1.15.0",
|
5
5
|
"author": {
|
6
6
|
"name": "wangshijun",
|
7
7
|
"email": "shijun@arcblock.io",
|
@@ -15,13 +15,13 @@
|
|
15
15
|
"access": "public"
|
16
16
|
},
|
17
17
|
"dependencies": {
|
18
|
-
"@arcblock/did": "1.
|
19
|
-
"@arcblock/did-util": "1.
|
20
|
-
"@arcblock/vc": "1.
|
21
|
-
"@ocap/contract": "1.
|
22
|
-
"@ocap/mcrypto": "1.
|
23
|
-
"@ocap/util": "1.
|
24
|
-
"@ocap/wallet": "1.
|
18
|
+
"@arcblock/did": "1.15.0",
|
19
|
+
"@arcblock/did-util": "1.15.0",
|
20
|
+
"@arcblock/vc": "1.15.0",
|
21
|
+
"@ocap/contract": "1.15.0",
|
22
|
+
"@ocap/mcrypto": "1.15.0",
|
23
|
+
"@ocap/util": "1.15.0",
|
24
|
+
"@ocap/wallet": "1.15.0",
|
25
25
|
"debug": "^4.3.3",
|
26
26
|
"empty-value": "^1.0.1",
|
27
27
|
"flat": "^5.0.2",
|
@@ -73,5 +73,5 @@
|
|
73
73
|
"test": "jest --forceExit --detectOpenHandles",
|
74
74
|
"coverage": "yarn test -- --coverage"
|
75
75
|
},
|
76
|
-
"gitHead": "
|
76
|
+
"gitHead": "200364b55e5906688e2cad5fa0631735336cc423"
|
77
77
|
}
|