@lucid-evolution/provider 0.1.74 → 0.1.77

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
@@ -47,12 +47,12 @@ var CML = __toESM(require("@anastasia-labs/cardano-multiplatform-lib-nodejs"), 1
47
47
 
48
48
  // src/blockfrost.ts
49
49
  var import_core_utils = require("@lucid-evolution/core-utils");
50
- var import_utils = require("@lucid-evolution/utils");
50
+ var import_utils2 = require("@lucid-evolution/utils");
51
51
 
52
52
  // package.json
53
53
  var package_default = {
54
54
  name: "@lucid-evolution/provider",
55
- version: "0.1.74",
55
+ version: "0.1.77",
56
56
  description: "",
57
57
  main: "./dist/index.js",
58
58
  types: "./dist/index.d.ts",
@@ -102,6 +102,7 @@ var package_default = {
102
102
 
103
103
  // src/internal/blockfrost.ts
104
104
  var import_effect = require("effect");
105
+ var import_utils = require("@lucid-evolution/utils");
105
106
  var toAditionalUTXOs = (utxos) => (utxos || []).map((utxo) => [
106
107
  {
107
108
  txId: utxo.txHash,
@@ -122,11 +123,11 @@ var toTxOutScript = (scriptRef) => {
122
123
  if (scriptRef) {
123
124
  switch (scriptRef.type) {
124
125
  case "PlutusV1":
125
- return { "plutus:v1": scriptRef.script };
126
+ return { "plutus:v1": (0, import_utils.applySingleCborEncoding)(scriptRef.script) };
126
127
  case "PlutusV2":
127
- return { "plutus:v2": scriptRef.script };
128
+ return { "plutus:v2": (0, import_utils.applySingleCborEncoding)(scriptRef.script) };
128
129
  case "PlutusV3":
129
- return { "plutus:v3": scriptRef.script };
130
+ return { "plutus:v3": (0, import_utils.applySingleCborEncoding)(scriptRef.script) };
130
131
  default:
131
132
  return void 0;
132
133
  }
@@ -140,6 +141,16 @@ var fromAssets = (assets) => (0, import_effect.pipe)(
140
141
  ]),
141
142
  (r) => import_effect.Record.isEmptyRecord(r) ? void 0 : r
142
143
  );
144
+ var fromLegacyRedeemerTag = (redeemerTag) => {
145
+ switch (redeemerTag) {
146
+ case "certificate":
147
+ return "publish";
148
+ case "withdrawal":
149
+ return "withdraw";
150
+ default:
151
+ return redeemerTag;
152
+ }
153
+ };
143
154
 
144
155
  // src/blockfrost.ts
145
156
  var Blockfrost = class {
@@ -365,21 +376,21 @@ var Blockfrost = class {
365
376
  `${this.url}/scripts/${r.reference_script_hash}/json`,
366
377
  { headers: { project_id: this.projectId, lucid } }
367
378
  ).then((res) => res.json());
368
- return (0, import_utils.scriptFromNative)(native);
379
+ return (0, import_utils2.scriptFromNative)(native);
369
380
  case "plutusV1":
370
381
  return {
371
382
  type: "PlutusV1",
372
- script
383
+ script: (0, import_utils2.applyDoubleCborEncoding)(script)
373
384
  };
374
385
  case "plutusV2":
375
386
  return {
376
387
  type: "PlutusV2",
377
- script
388
+ script: (0, import_utils2.applyDoubleCborEncoding)(script)
378
389
  };
379
390
  case "plutusV3":
380
391
  return {
381
392
  type: "PlutusV3",
382
- script
393
+ script: (0, import_utils2.applyDoubleCborEncoding)(script)
383
394
  };
384
395
  }
385
396
  })() : void 0
@@ -419,7 +430,9 @@ var Blockfrost = class {
419
430
  ([redeemerPointer, data]) => {
420
431
  const [pTag, pIndex] = redeemerPointer.split(":");
421
432
  evalRedeemers.push({
422
- redeemer_tag: pTag,
433
+ redeemer_tag: fromLegacyRedeemerTag(
434
+ pTag
435
+ ),
423
436
  redeemer_index: Number(pIndex),
424
437
  ex_units: { mem: Number(data.memory), steps: Number(data.steps) }
425
438
  });
@@ -438,7 +451,7 @@ var handleRateLimit = async (count) => {
438
451
  var lucid = package_default.version;
439
452
 
440
453
  // src/kupmios.ts
441
- var import_utils3 = require("@lucid-evolution/utils");
454
+ var import_utils4 = require("@lucid-evolution/utils");
442
455
  var S3 = __toESM(require("@effect/schema/Schema"), 1);
443
456
  var import_effect2 = require("effect");
444
457
  var import_platform = require("@effect/platform");
@@ -446,7 +459,7 @@ var import_schema = require("@effect/schema");
446
459
 
447
460
  // src/internal/ogmios.ts
448
461
  var S = __toESM(require("@effect/schema/Schema"), 1);
449
- var import_utils2 = require("@lucid-evolution/utils");
462
+ var import_utils3 = require("@lucid-evolution/utils");
450
463
  var JSONRPCSchema = (schema) => S.extend(
451
464
  S.Struct({
452
465
  jsonrpc: S.String,
@@ -574,11 +587,20 @@ var toOgmiosUTxOs = (utxos) => {
574
587
  if (scriptRef) {
575
588
  switch (scriptRef.type) {
576
589
  case "PlutusV1":
577
- return { language: "plutus:v1", cbor: scriptRef.script };
590
+ return {
591
+ language: "plutus:v1",
592
+ cbor: (0, import_utils3.applySingleCborEncoding)(scriptRef.script)
593
+ };
578
594
  case "PlutusV2":
579
- return { language: "plutus:v2", cbor: scriptRef.script };
595
+ return {
596
+ language: "plutus:v2",
597
+ cbor: (0, import_utils3.applySingleCborEncoding)(scriptRef.script)
598
+ };
580
599
  case "PlutusV3":
581
- return { language: "plutus:v3", cbor: scriptRef.script };
600
+ return {
601
+ language: "plutus:v3",
602
+ cbor: (0, import_utils3.applySingleCborEncoding)(scriptRef.script)
603
+ };
582
604
  default:
583
605
  return null;
584
606
  }
@@ -588,7 +610,7 @@ var toOgmiosUTxOs = (utxos) => {
588
610
  const newAssets = {};
589
611
  Object.entries(assets).forEach(([unit, amount]) => {
590
612
  if (unit == "lovelace") return;
591
- const { policyId, assetName } = (0, import_utils2.fromUnit)(unit);
613
+ const { policyId, assetName } = (0, import_utils3.fromUnit)(unit);
592
614
  if (!newAssets[policyId]) {
593
615
  newAssets[policyId] = {};
594
616
  }
@@ -709,7 +731,7 @@ var Kupmios = class {
709
731
  async getUtxosWithUnit(addressOrCredential, unit) {
710
732
  const isAddress = typeof addressOrCredential === "string";
711
733
  const queryPredicate = isAddress ? addressOrCredential : addressOrCredential.hash;
712
- const { policyId, assetName } = (0, import_utils3.fromUnit)(unit);
734
+ const { policyId, assetName } = (0, import_utils4.fromUnit)(unit);
713
735
  const pattern = `${this.kupoUrl}/matches/${queryPredicate}${isAddress ? "" : "/*"}?unspent&policy_id=${policyId}${assetName ? `&asset_name=${assetName}` : ""}`;
714
736
  const schema = S3.Array(UTxOSchema);
715
737
  const program = fetchKupoParse(pattern, schema).pipe(
@@ -721,7 +743,7 @@ var Kupmios = class {
721
743
  return utxos;
722
744
  }
723
745
  async getUtxoByUnit(unit) {
724
- const { policyId, assetName } = (0, import_utils3.fromUnit)(unit);
746
+ const { policyId, assetName } = (0, import_utils4.fromUnit)(unit);
725
747
  const pattern = `${this.kupoUrl}/matches/${policyId}.${assetName ? `${assetName}` : "*"}?unspent`;
726
748
  const schema = S3.Array(UTxOSchema);
727
749
  const program = fetchKupoParse(pattern, schema).pipe(
@@ -896,17 +918,17 @@ var getScriptEffect = (kupoUrl, script_hash) => import_effect2.Effect.gen(functi
896
918
  case "plutus:v1":
897
919
  return {
898
920
  type: "PlutusV1",
899
- script
921
+ script: (0, import_utils4.applyDoubleCborEncoding)(script)
900
922
  };
901
923
  case "plutus:v2":
902
924
  return {
903
925
  type: "PlutusV2",
904
- script
926
+ script: (0, import_utils4.applyDoubleCborEncoding)(script)
905
927
  };
906
928
  case "plutus:v3":
907
929
  return {
908
930
  type: "PlutusV3",
909
- script
931
+ script: (0, import_utils4.applyDoubleCborEncoding)(script)
910
932
  };
911
933
  }
912
934
  })
@@ -1013,8 +1035,8 @@ var kupmiosUtxosToUtxos = (kupoURL, utxos) => import_effect2.Effect.forEach(
1013
1035
  );
1014
1036
 
1015
1037
  // src/emulator.ts
1016
- var import_utils4 = require("@lucid-evolution/utils");
1017
1038
  var import_utils5 = require("@lucid-evolution/utils");
1039
+ var import_utils6 = require("@lucid-evolution/utils");
1018
1040
  var import_core_utils2 = require("@lucid-evolution/core-utils");
1019
1041
  var import_wallet = require("@lucid-evolution/wallet");
1020
1042
  async function generateEmulatorAccountFrommPrivateKey(assets) {
@@ -1033,7 +1055,7 @@ async function generateEmulatorAccountFrommPrivateKey(assets) {
1033
1055
  };
1034
1056
  }
1035
1057
  function generateEmulatorAccount(assets) {
1036
- const seedPhrase = (0, import_utils4.generateSeedPhrase)();
1058
+ const seedPhrase = (0, import_utils5.generateSeedPhrase)();
1037
1059
  return {
1038
1060
  seedPhrase,
1039
1061
  address: (0, import_wallet.walletFromSeed)(seedPhrase, {
@@ -1058,7 +1080,7 @@ var Emulator = class {
1058
1080
  time;
1059
1081
  protocolParameters;
1060
1082
  datumTable = {};
1061
- constructor(accounts, protocolParameters = import_utils4.PROTOCOL_PARAMETERS_DEFAULT) {
1083
+ constructor(accounts, protocolParameters = import_utils5.PROTOCOL_PARAMETERS_DEFAULT) {
1062
1084
  const GENESIS_HASH = "00".repeat(32);
1063
1085
  this.blockHeight = 0;
1064
1086
  this.slot = 0;
@@ -1124,7 +1146,7 @@ var Emulator = class {
1124
1146
  if (typeof addressOrCredential === "string") {
1125
1147
  return addressOrCredential === utxo.address ? utxo : [];
1126
1148
  } else {
1127
- const { paymentCredential } = (0, import_utils5.getAddressDetails)(utxo.address);
1149
+ const { paymentCredential } = (0, import_utils6.getAddressDetails)(utxo.address);
1128
1150
  return paymentCredential?.hash === addressOrCredential.hash ? utxo : [];
1129
1151
  }
1130
1152
  });
@@ -1141,7 +1163,7 @@ var Emulator = class {
1141
1163
  if (typeof addressOrCredential === "string") {
1142
1164
  return addressOrCredential === utxo.address && utxo.assets[unit] > 0n ? utxo : [];
1143
1165
  } else {
1144
- const { paymentCredential } = (0, import_utils5.getAddressDetails)(utxo.address);
1166
+ const { paymentCredential } = (0, import_utils6.getAddressDetails)(utxo.address);
1145
1167
  return paymentCredential?.hash === addressOrCredential.hash && utxo.assets[unit] > 0n ? utxo : [];
1146
1168
  }
1147
1169
  });
@@ -1476,7 +1498,7 @@ It does not exist or was already spent.`
1476
1498
  It does not exist or was already spent.`
1477
1499
  );
1478
1500
  }
1479
- const { paymentCredential } = (0, import_utils5.getAddressDetails)(entry.utxo.address);
1501
+ const { paymentCredential } = (0, import_utils6.getAddressDetails)(entry.utxo.address);
1480
1502
  if (paymentCredential?.type === "Script") {
1481
1503
  throw new Error("Collateral inputs can only contain vkeys.");
1482
1504
  }
@@ -1497,7 +1519,7 @@ It does not exist or was already spent.`
1497
1519
  body.withdrawals().get(rawAddress).toString()
1498
1520
  );
1499
1521
  const rewardAddress = rawAddress.to_address().to_bech32(void 0);
1500
- const { stakeCredential } = (0, import_utils5.getAddressDetails)(rewardAddress);
1522
+ const { stakeCredential } = (0, import_utils6.getAddressDetails)(rewardAddress);
1501
1523
  checkAndConsumeHash(stakeCredential, "Reward", index);
1502
1524
  if (this.chain[rewardAddress]?.delegation.rewards !== withdrawal) {
1503
1525
  throw new Error(
@@ -1530,7 +1552,7 @@ It does not exist or was already spent.`
1530
1552
  CML.NetworkInfo.testnet().network_id(),
1531
1553
  deregistration.stake_credential()
1532
1554
  ).to_address().to_bech32(void 0);
1533
- const { stakeCredential } = (0, import_utils5.getAddressDetails)(rewardAddress);
1555
+ const { stakeCredential } = (0, import_utils6.getAddressDetails)(rewardAddress);
1534
1556
  checkAndConsumeHash(stakeCredential, "Cert", index);
1535
1557
  if (!this.chain[rewardAddress]?.registeredStake) {
1536
1558
  throw new Error(
@@ -1547,7 +1569,7 @@ It does not exist or was already spent.`
1547
1569
  delegation.stake_credential()
1548
1570
  ).to_address().to_bech32(void 0);
1549
1571
  const poolId = delegation.pool().to_bech32("pool");
1550
- const { stakeCredential } = (0, import_utils5.getAddressDetails)(rewardAddress);
1572
+ const { stakeCredential } = (0, import_utils6.getAddressDetails)(rewardAddress);
1551
1573
  checkAndConsumeHash(stakeCredential, "Cert", index);
1552
1574
  if (!this.chain[rewardAddress]?.registeredStake && !certRequests.find(
1553
1575
  (request) => request.type === "Registration" && request.rewardAddress === rewardAddress
@@ -1562,7 +1584,7 @@ It does not exist or was already spent.`
1562
1584
  }
1563
1585
  }
1564
1586
  resolvedInputs.forEach(({ entry: { utxo } }, index) => {
1565
- const { paymentCredential } = (0, import_utils5.getAddressDetails)(utxo.address);
1587
+ const { paymentCredential } = (0, import_utils6.getAddressDetails)(utxo.address);
1566
1588
  checkAndConsumeHash(paymentCredential, "Spend", index);
1567
1589
  });
1568
1590
  const outputs = (() => {
@@ -1576,7 +1598,7 @@ It does not exist or was already spent.`
1576
1598
  ),
1577
1599
  output
1578
1600
  );
1579
- const utxo = (0, import_utils5.coreToUtxo)(unspentOutput);
1601
+ const utxo = (0, import_utils6.coreToUtxo)(unspentOutput);
1580
1602
  if (utxo.datumHash) consumedHashes.add(utxo.datumHash);
1581
1603
  collected.push({
1582
1604
  utxo,
@@ -1673,7 +1695,7 @@ It does not exist or was already spent.`
1673
1695
  steps: Number(legacyRedeemer.ex_units().steps())
1674
1696
  },
1675
1697
  redeemer_index: Number(legacyRedeemer.index()),
1676
- redeemer_tag: (0, import_utils4.fromCMLRedeemerTag)(legacyRedeemer.tag())
1698
+ redeemer_tag: (0, import_utils5.fromCMLRedeemerTag)(legacyRedeemer.tag())
1677
1699
  });
1678
1700
  }
1679
1701
  return evalRedeemers;
@@ -1691,7 +1713,7 @@ It does not exist or was already spent.`
1691
1713
  steps: Number(redeemerVal.ex_units().steps())
1692
1714
  },
1693
1715
  redeemer_index: Number(key.index),
1694
- redeemer_tag: (0, import_utils4.fromCMLRedeemerTag)(key.tag())
1716
+ redeemer_tag: (0, import_utils5.fromCMLRedeemerTag)(key.tag())
1695
1717
  });
1696
1718
  }
1697
1719
  }
@@ -1767,7 +1789,7 @@ ${"\u2581".repeat(60)}
1767
1789
  };
1768
1790
 
1769
1791
  // src/maestro.ts
1770
- var import_utils6 = require("@lucid-evolution/utils");
1792
+ var import_utils7 = require("@lucid-evolution/utils");
1771
1793
  var import_core_utils3 = require("@lucid-evolution/core-utils");
1772
1794
  var Maestro = class {
1773
1795
  url;
@@ -2034,7 +2056,7 @@ var Maestro = class {
2034
2056
  const additionalMaestroUTxOs = (additionalUTxOs || []).map((utxo) => ({
2035
2057
  tx_hash: utxo.txHash,
2036
2058
  index: utxo.outputIndex,
2037
- txout_cbor: (0, import_utils6.utxoToCore)(utxo).output().to_cbor_hex()
2059
+ txout_cbor: (0, import_utils7.utxoToCore)(utxo).output().to_cbor_hex()
2038
2060
  }));
2039
2061
  const payload = {
2040
2062
  cbor: tx,
@@ -2062,21 +2084,21 @@ var toScriptRef = (reference_script) => {
2062
2084
  if (reference_script && reference_script.bytes) {
2063
2085
  switch (reference_script.type) {
2064
2086
  case "native":
2065
- return (0, import_utils6.scriptFromNative)(reference_script.json);
2087
+ return (0, import_utils7.scriptFromNative)(reference_script.json);
2066
2088
  case "plutusv1":
2067
2089
  return {
2068
2090
  type: "PlutusV1",
2069
- script: reference_script.bytes
2091
+ script: (0, import_utils7.applyDoubleCborEncoding)(reference_script.bytes)
2070
2092
  };
2071
2093
  case "plutusv2":
2072
2094
  return {
2073
2095
  type: "PlutusV2",
2074
- script: reference_script.bytes
2096
+ script: (0, import_utils7.applyDoubleCborEncoding)(reference_script.bytes)
2075
2097
  };
2076
2098
  case "plutusv3":
2077
2099
  return {
2078
2100
  type: "PlutusV3",
2079
- script: reference_script.bytes
2101
+ script: (0, import_utils7.applyDoubleCborEncoding)(reference_script.bytes)
2080
2102
  };
2081
2103
  default:
2082
2104
  return void 0;
@@ -2088,12 +2110,13 @@ var lucid2 = package_default.version;
2088
2110
  // src/koios.ts
2089
2111
  var S5 = __toESM(require("@effect/schema/Schema"), 1);
2090
2112
  var import_core_utils4 = require("@lucid-evolution/core-utils");
2091
- var import_utils7 = require("@lucid-evolution/utils");
2113
+ var import_utils9 = require("@lucid-evolution/utils");
2092
2114
 
2093
2115
  // src/internal/koios.ts
2094
2116
  var import_platform2 = require("@effect/platform");
2095
2117
  var S4 = __toESM(require("@effect/schema/Schema"), 1);
2096
2118
  var import_effect3 = require("effect");
2119
+ var import_utils8 = require("@lucid-evolution/utils");
2097
2120
  var ProtocolParametersSchema2 = S4.Struct({
2098
2121
  pvt_motion_no_confidence: S4.Number,
2099
2122
  pvt_committee_normal: S4.Number,
@@ -2355,17 +2378,17 @@ var toScriptRef2 = (reference_script) => {
2355
2378
  case "plutusV1":
2356
2379
  return {
2357
2380
  type: "PlutusV1",
2358
- script: reference_script.bytes
2381
+ script: (0, import_utils8.applyDoubleCborEncoding)(reference_script.bytes)
2359
2382
  };
2360
2383
  case "plutusV2":
2361
2384
  return {
2362
2385
  type: "PlutusV2",
2363
- script: reference_script.bytes
2386
+ script: (0, import_utils8.applyDoubleCborEncoding)(reference_script.bytes)
2364
2387
  };
2365
2388
  case "plutusV3":
2366
2389
  return {
2367
2390
  type: "PlutusV3",
2368
- script: reference_script.bytes
2391
+ script: (0, import_utils8.applyDoubleCborEncoding)(reference_script.bytes)
2369
2392
  };
2370
2393
  default:
2371
2394
  return void 0;
@@ -2475,7 +2498,7 @@ var Koios = class {
2475
2498
  return result;
2476
2499
  }
2477
2500
  async getUtxoByUnit(unit) {
2478
- let { policyId, assetName } = (0, import_utils7.fromUnit)(unit);
2501
+ let { policyId, assetName } = (0, import_utils9.fromUnit)(unit);
2479
2502
  const url = `${this.baseUrl}/asset_addresses?_asset_policy=${policyId}&_asset_name=${assetName}`;
2480
2503
  const result = await (0, import_effect4.pipe)(
2481
2504
  getWithSchemaValidation(url, S5.Array(AssetAddressSchema)),
package/dist/index.js CHANGED
@@ -3,12 +3,15 @@ import * as CML from "@anastasia-labs/cardano-multiplatform-lib-nodejs";
3
3
 
4
4
  // src/blockfrost.ts
5
5
  import { fromHex, sleep } from "@lucid-evolution/core-utils";
6
- import { scriptFromNative } from "@lucid-evolution/utils";
6
+ import {
7
+ applyDoubleCborEncoding,
8
+ scriptFromNative
9
+ } from "@lucid-evolution/utils";
7
10
 
8
11
  // package.json
9
12
  var package_default = {
10
13
  name: "@lucid-evolution/provider",
11
- version: "0.1.74",
14
+ version: "0.1.77",
12
15
  description: "",
13
16
  main: "./dist/index.js",
14
17
  types: "./dist/index.d.ts",
@@ -58,6 +61,7 @@ var package_default = {
58
61
 
59
62
  // src/internal/blockfrost.ts
60
63
  import { pipe, Record } from "effect";
64
+ import { applySingleCborEncoding } from "@lucid-evolution/utils";
61
65
  var toAditionalUTXOs = (utxos) => (utxos || []).map((utxo) => [
62
66
  {
63
67
  txId: utxo.txHash,
@@ -78,11 +82,11 @@ var toTxOutScript = (scriptRef) => {
78
82
  if (scriptRef) {
79
83
  switch (scriptRef.type) {
80
84
  case "PlutusV1":
81
- return { "plutus:v1": scriptRef.script };
85
+ return { "plutus:v1": applySingleCborEncoding(scriptRef.script) };
82
86
  case "PlutusV2":
83
- return { "plutus:v2": scriptRef.script };
87
+ return { "plutus:v2": applySingleCborEncoding(scriptRef.script) };
84
88
  case "PlutusV3":
85
- return { "plutus:v3": scriptRef.script };
89
+ return { "plutus:v3": applySingleCborEncoding(scriptRef.script) };
86
90
  default:
87
91
  return void 0;
88
92
  }
@@ -96,6 +100,16 @@ var fromAssets = (assets) => pipe(
96
100
  ]),
97
101
  (r) => Record.isEmptyRecord(r) ? void 0 : r
98
102
  );
103
+ var fromLegacyRedeemerTag = (redeemerTag) => {
104
+ switch (redeemerTag) {
105
+ case "certificate":
106
+ return "publish";
107
+ case "withdrawal":
108
+ return "withdraw";
109
+ default:
110
+ return redeemerTag;
111
+ }
112
+ };
99
113
 
100
114
  // src/blockfrost.ts
101
115
  var Blockfrost = class {
@@ -325,17 +339,17 @@ var Blockfrost = class {
325
339
  case "plutusV1":
326
340
  return {
327
341
  type: "PlutusV1",
328
- script
342
+ script: applyDoubleCborEncoding(script)
329
343
  };
330
344
  case "plutusV2":
331
345
  return {
332
346
  type: "PlutusV2",
333
- script
347
+ script: applyDoubleCborEncoding(script)
334
348
  };
335
349
  case "plutusV3":
336
350
  return {
337
351
  type: "PlutusV3",
338
- script
352
+ script: applyDoubleCborEncoding(script)
339
353
  };
340
354
  }
341
355
  })() : void 0
@@ -375,7 +389,9 @@ var Blockfrost = class {
375
389
  ([redeemerPointer, data]) => {
376
390
  const [pTag, pIndex] = redeemerPointer.split(":");
377
391
  evalRedeemers.push({
378
- redeemer_tag: pTag,
392
+ redeemer_tag: fromLegacyRedeemerTag(
393
+ pTag
394
+ ),
379
395
  redeemer_index: Number(pIndex),
380
396
  ex_units: { mem: Number(data.memory), steps: Number(data.steps) }
381
397
  });
@@ -394,7 +410,7 @@ var handleRateLimit = async (count) => {
394
410
  var lucid = package_default.version;
395
411
 
396
412
  // src/kupmios.ts
397
- import { fromUnit as fromUnit2 } from "@lucid-evolution/utils";
413
+ import { applyDoubleCborEncoding as applyDoubleCborEncoding2, fromUnit as fromUnit2 } from "@lucid-evolution/utils";
398
414
  import * as S3 from "@effect/schema/Schema";
399
415
  import { Effect, pipe as pipe2, Array as _Array, Schedule, Data } from "effect";
400
416
  import {
@@ -406,7 +422,7 @@ import { ArrayFormatter } from "@effect/schema";
406
422
 
407
423
  // src/internal/ogmios.ts
408
424
  import * as S from "@effect/schema/Schema";
409
- import { fromUnit } from "@lucid-evolution/utils";
425
+ import { applySingleCborEncoding as applySingleCborEncoding2, fromUnit } from "@lucid-evolution/utils";
410
426
  var JSONRPCSchema = (schema) => S.extend(
411
427
  S.Struct({
412
428
  jsonrpc: S.String,
@@ -534,11 +550,20 @@ var toOgmiosUTxOs = (utxos) => {
534
550
  if (scriptRef) {
535
551
  switch (scriptRef.type) {
536
552
  case "PlutusV1":
537
- return { language: "plutus:v1", cbor: scriptRef.script };
553
+ return {
554
+ language: "plutus:v1",
555
+ cbor: applySingleCborEncoding2(scriptRef.script)
556
+ };
538
557
  case "PlutusV2":
539
- return { language: "plutus:v2", cbor: scriptRef.script };
558
+ return {
559
+ language: "plutus:v2",
560
+ cbor: applySingleCborEncoding2(scriptRef.script)
561
+ };
540
562
  case "PlutusV3":
541
- return { language: "plutus:v3", cbor: scriptRef.script };
563
+ return {
564
+ language: "plutus:v3",
565
+ cbor: applySingleCborEncoding2(scriptRef.script)
566
+ };
542
567
  default:
543
568
  return null;
544
569
  }
@@ -856,17 +881,17 @@ var getScriptEffect = (kupoUrl, script_hash) => Effect.gen(function* () {
856
881
  case "plutus:v1":
857
882
  return {
858
883
  type: "PlutusV1",
859
- script
884
+ script: applyDoubleCborEncoding2(script)
860
885
  };
861
886
  case "plutus:v2":
862
887
  return {
863
888
  type: "PlutusV2",
864
- script
889
+ script: applyDoubleCborEncoding2(script)
865
890
  };
866
891
  case "plutus:v3":
867
892
  return {
868
893
  type: "PlutusV3",
869
- script
894
+ script: applyDoubleCborEncoding2(script)
870
895
  };
871
896
  }
872
897
  })
@@ -1731,7 +1756,11 @@ ${"\u2581".repeat(60)}
1731
1756
  };
1732
1757
 
1733
1758
  // src/maestro.ts
1734
- import { scriptFromNative as scriptFromNative2, utxoToCore } from "@lucid-evolution/utils";
1759
+ import {
1760
+ applyDoubleCborEncoding as applyDoubleCborEncoding3,
1761
+ scriptFromNative as scriptFromNative2,
1762
+ utxoToCore
1763
+ } from "@lucid-evolution/utils";
1735
1764
  import { fromHex as fromHex3 } from "@lucid-evolution/core-utils";
1736
1765
  var Maestro = class {
1737
1766
  url;
@@ -2030,17 +2059,17 @@ var toScriptRef = (reference_script) => {
2030
2059
  case "plutusv1":
2031
2060
  return {
2032
2061
  type: "PlutusV1",
2033
- script: reference_script.bytes
2062
+ script: applyDoubleCborEncoding3(reference_script.bytes)
2034
2063
  };
2035
2064
  case "plutusv2":
2036
2065
  return {
2037
2066
  type: "PlutusV2",
2038
- script: reference_script.bytes
2067
+ script: applyDoubleCborEncoding3(reference_script.bytes)
2039
2068
  };
2040
2069
  case "plutusv3":
2041
2070
  return {
2042
2071
  type: "PlutusV3",
2043
- script: reference_script.bytes
2072
+ script: applyDoubleCborEncoding3(reference_script.bytes)
2044
2073
  };
2045
2074
  default:
2046
2075
  return void 0;
@@ -2062,6 +2091,7 @@ import {
2062
2091
  } from "@effect/platform";
2063
2092
  import * as S4 from "@effect/schema/Schema";
2064
2093
  import { Effect as Effect2, pipe as pipe3 } from "effect";
2094
+ import { applyDoubleCborEncoding as applyDoubleCborEncoding4 } from "@lucid-evolution/utils";
2065
2095
  var ProtocolParametersSchema2 = S4.Struct({
2066
2096
  pvt_motion_no_confidence: S4.Number,
2067
2097
  pvt_committee_normal: S4.Number,
@@ -2323,17 +2353,17 @@ var toScriptRef2 = (reference_script) => {
2323
2353
  case "plutusV1":
2324
2354
  return {
2325
2355
  type: "PlutusV1",
2326
- script: reference_script.bytes
2356
+ script: applyDoubleCborEncoding4(reference_script.bytes)
2327
2357
  };
2328
2358
  case "plutusV2":
2329
2359
  return {
2330
2360
  type: "PlutusV2",
2331
- script: reference_script.bytes
2361
+ script: applyDoubleCborEncoding4(reference_script.bytes)
2332
2362
  };
2333
2363
  case "plutusV3":
2334
2364
  return {
2335
2365
  type: "PlutusV3",
2336
- script: reference_script.bytes
2366
+ script: applyDoubleCborEncoding4(reference_script.bytes)
2337
2367
  };
2338
2368
  default:
2339
2369
  return void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/provider",
3
- "version": "0.1.74",
3
+ "version": "0.1.77",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -32,8 +32,8 @@
32
32
  "effect": "^3.10.4",
33
33
  "@lucid-evolution/core-types": "0.1.21",
34
34
  "@lucid-evolution/core-utils": "0.1.16",
35
- "@lucid-evolution/utils": "0.1.56",
36
- "@lucid-evolution/wallet": "0.1.62"
35
+ "@lucid-evolution/utils": "0.1.59",
36
+ "@lucid-evolution/wallet": "0.1.65"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^20.12.8",