@lucid-evolution/utils 0.1.20 → 0.1.21

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
@@ -926,6 +926,9 @@ function slotToUnixTime(network, slot) {
926
926
  return (0, import_plutus2.slotToBeginUnixTime)(slot, import_plutus2.SLOT_CONFIG_NETWORK[network]);
927
927
  }
928
928
 
929
+ // src/utxo.ts
930
+ var CSL = __toESM(require("@emurgo/cardano-serialization-lib-nodejs"), 1);
931
+
929
932
  // src/value.ts
930
933
  var import_core_utils4 = require("@lucid-evolution/core-utils");
931
934
  function valueToAssets(value) {
@@ -1051,10 +1054,16 @@ function utxosToCores(utxos) {
1051
1054
  return result;
1052
1055
  }
1053
1056
  function coreToUtxo(coreUtxo) {
1054
- const out = CML.TransactionOutput.from_cbor_hex(coreUtxo.to_cbor_hex());
1057
+ const utxoCore = CSL.TransactionUnspentOutput.from_bytes(
1058
+ coreUtxo.to_cbor_bytes()
1059
+ );
1055
1060
  const utxo = {
1056
- ...coreToOutRef(CML.TransactionInput.from_cbor_hex(coreUtxo.to_cbor_hex())),
1057
- ...coreToTxOutput(out)
1061
+ ...coreToOutRef(
1062
+ CML.TransactionInput.from_cbor_bytes(utxoCore.input().to_bytes())
1063
+ ),
1064
+ ...coreToTxOutput(
1065
+ CML.TransactionOutput.from_cbor_bytes(utxoCore.output().to_bytes())
1066
+ )
1058
1067
  };
1059
1068
  return utxo;
1060
1069
  }
package/dist/index.js CHANGED
@@ -844,6 +844,9 @@ function slotToUnixTime(network, slot) {
844
844
  return slotToBeginUnixTime(slot, SLOT_CONFIG_NETWORK[network]);
845
845
  }
846
846
 
847
+ // src/utxo.ts
848
+ import * as CSL from "@emurgo/cardano-serialization-lib-nodejs";
849
+
847
850
  // src/value.ts
848
851
  import { fromHex as fromHex4, toHex as toHex3 } from "@lucid-evolution/core-utils";
849
852
  function valueToAssets(value) {
@@ -969,10 +972,16 @@ function utxosToCores(utxos) {
969
972
  return result;
970
973
  }
971
974
  function coreToUtxo(coreUtxo) {
972
- const out = CML.TransactionOutput.from_cbor_hex(coreUtxo.to_cbor_hex());
975
+ const utxoCore = CSL.TransactionUnspentOutput.from_bytes(
976
+ coreUtxo.to_cbor_bytes()
977
+ );
973
978
  const utxo = {
974
- ...coreToOutRef(CML.TransactionInput.from_cbor_hex(coreUtxo.to_cbor_hex())),
975
- ...coreToTxOutput(out)
979
+ ...coreToOutRef(
980
+ CML.TransactionInput.from_cbor_bytes(utxoCore.input().to_bytes())
981
+ ),
982
+ ...coreToTxOutput(
983
+ CML.TransactionOutput.from_cbor_bytes(utxoCore.output().to_bytes())
984
+ )
976
985
  };
977
986
  return utxo;
978
987
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/utils",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,11 +22,14 @@
22
22
  "author": "",
23
23
  "license": "MIT",
24
24
  "browser": {
25
- "@anastasia-labs/cardano-multiplatform-lib-nodejs": "@anastasia-labs/cardano-multiplatform-lib-browser"
25
+ "@anastasia-labs/cardano-multiplatform-lib-nodejs": "@anastasia-labs/cardano-multiplatform-lib-browser",
26
+ "@emurgo/cardano-serialization-lib-nodejs": "@emurgo/cardano-serialization-lib-browser"
26
27
  },
27
28
  "dependencies": {
28
- "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^5.3.1-2",
29
29
  "@anastasia-labs/cardano-multiplatform-lib-browser": "^5.3.1-2",
30
+ "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^5.3.1-2",
31
+ "@emurgo/cardano-serialization-lib-browser": "^11.5.0",
32
+ "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0",
30
33
  "cborg": "^4.2.0",
31
34
  "@lucid-evolution/bip39": "0.2.8",
32
35
  "@lucid-evolution/core-types": "0.1.8",