@ocap/asset 1.14.24 → 1.14.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/index.js +12 -6
  2. 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('mintFromFactory.args', JSON.stringify({ output, factoryAddress, inputs, owner, issuer, data }, null, 2));
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('preMintFromFactory.args', JSON.stringify({ output, factoryAddress, inputs, owner, issuer, data }, null, 2));
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.14.24",
4
+ "version": "1.14.25",
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.14.24",
19
- "@arcblock/did-util": "1.14.24",
20
- "@arcblock/vc": "1.14.24",
21
- "@ocap/contract": "1.14.24",
22
- "@ocap/mcrypto": "1.14.24",
23
- "@ocap/util": "1.14.24",
24
- "@ocap/wallet": "1.14.24",
18
+ "@arcblock/did": "1.14.25",
19
+ "@arcblock/did-util": "1.14.25",
20
+ "@arcblock/vc": "1.14.25",
21
+ "@ocap/contract": "1.14.25",
22
+ "@ocap/mcrypto": "1.14.25",
23
+ "@ocap/util": "1.14.25",
24
+ "@ocap/wallet": "1.14.25",
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": "83c2a3080ce30298e608d2325a534ff7e0c6f4a1"
76
+ "gitHead": "52a5499e4794af7f973a6e61dea78cb2e61c10a4"
77
77
  }