@lucid-evolution/utils 0.1.38 → 0.1.40

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/dist/index.cjs CHANGED
@@ -281,6 +281,12 @@ function validatorToScriptHash(validator) {
281
281
  applyDoubleCborEncoding(validator.script)
282
282
  )
283
283
  ).hash().to_hex();
284
+ case "PlutusV3":
285
+ return CML.PlutusScript.from_v3(
286
+ CML.PlutusV3Script.from_cbor_hex(
287
+ applyDoubleCborEncoding(validator.script)
288
+ )
289
+ ).hash().to_hex();
284
290
  default:
285
291
  throw new Error("No variant matched");
286
292
  }
@@ -303,6 +309,12 @@ function toScriptRef(script) {
303
309
  applyDoubleCborEncoding(script.script)
304
310
  )
305
311
  );
312
+ case "PlutusV3":
313
+ return CML.Script.new_plutus_v3(
314
+ CML.PlutusV3Script.from_cbor_hex(
315
+ applyDoubleCborEncoding(script.script)
316
+ )
317
+ );
306
318
  default:
307
319
  throw new Error("No variant matched.");
308
320
  }
@@ -539,6 +551,9 @@ function createCostModels(costModels) {
539
551
  for (const cost of Object.values(costModels.PlutusV2)) {
540
552
  costmodel[1]?.push(cost);
541
553
  }
554
+ for (const cost of Object.values(costModels.PlutusV3)) {
555
+ costmodel[2]?.push(cost);
556
+ }
542
557
  return CML.CostModels.from_json(JSON.stringify(costmodel));
543
558
  }
544
559
  var PROTOCOL_PARAMETERS_DEFAULT = {
package/dist/index.js CHANGED
@@ -198,6 +198,12 @@ function validatorToScriptHash(validator) {
198
198
  applyDoubleCborEncoding(validator.script)
199
199
  )
200
200
  ).hash().to_hex();
201
+ case "PlutusV3":
202
+ return CML.PlutusScript.from_v3(
203
+ CML.PlutusV3Script.from_cbor_hex(
204
+ applyDoubleCborEncoding(validator.script)
205
+ )
206
+ ).hash().to_hex();
201
207
  default:
202
208
  throw new Error("No variant matched");
203
209
  }
@@ -220,6 +226,12 @@ function toScriptRef(script) {
220
226
  applyDoubleCborEncoding(script.script)
221
227
  )
222
228
  );
229
+ case "PlutusV3":
230
+ return CML.Script.new_plutus_v3(
231
+ CML.PlutusV3Script.from_cbor_hex(
232
+ applyDoubleCborEncoding(script.script)
233
+ )
234
+ );
223
235
  default:
224
236
  throw new Error("No variant matched.");
225
237
  }
@@ -456,6 +468,9 @@ function createCostModels(costModels) {
456
468
  for (const cost of Object.values(costModels.PlutusV2)) {
457
469
  costmodel[1]?.push(cost);
458
470
  }
471
+ for (const cost of Object.values(costModels.PlutusV3)) {
472
+ costmodel[2]?.push(cost);
473
+ }
459
474
  return CML.CostModels.from_json(JSON.stringify(costmodel));
460
475
  }
461
476
  var PROTOCOL_PARAMETERS_DEFAULT = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/utils",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,8 +26,8 @@
26
26
  "@emurgo/cardano-serialization-lib-nodejs": "@emurgo/cardano-serialization-lib-browser"
27
27
  },
28
28
  "dependencies": {
29
- "@anastasia-labs/cardano-multiplatform-lib-browser": "^6.0.1-2",
30
- "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^6.0.1-2",
29
+ "@anastasia-labs/cardano-multiplatform-lib-browser": "6.0.2-1",
30
+ "@anastasia-labs/cardano-multiplatform-lib-nodejs": "6.0.2-1",
31
31
  "@effect/schema": "^0.68.16",
32
32
  "@emurgo/cardano-serialization-lib-browser": "^11.5.0",
33
33
  "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0",
@@ -36,11 +36,11 @@
36
36
  "bip39": "^3.1.0",
37
37
  "cborg": "^4.2.0",
38
38
  "effect": "^3.1.2",
39
- "@lucid-evolution/core-types": "0.1.16",
40
- "@lucid-evolution/core-utils": "0.1.14",
39
+ "@lucid-evolution/core-types": "0.1.17",
40
+ "@lucid-evolution/core-utils": "0.1.15",
41
41
  "@lucid-evolution/crc8": "0.1.8",
42
- "@lucid-evolution/plutus": "0.1.22",
43
- "@lucid-evolution/uplc": "0.2.11"
42
+ "@lucid-evolution/plutus": "0.1.23",
43
+ "@lucid-evolution/uplc": "0.2.12"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^20.12.8",