@lucid-evolution/provider 0.1.46 → 0.1.49

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
@@ -37,7 +37,8 @@ __export(src_exports, {
37
37
  Kupmios: () => Kupmios,
38
38
  KupmiosError: () => KupmiosError,
39
39
  Maestro: () => Maestro,
40
- generateEmulatorAccount: () => generateEmulatorAccount
40
+ generateEmulatorAccount: () => generateEmulatorAccount,
41
+ generateEmulatorAccountFrommPrivateKey: () => generateEmulatorAccountFrommPrivateKey
41
42
  });
42
43
  module.exports = __toCommonJS(src_exports);
43
44
 
@@ -51,7 +52,7 @@ var import_utils = require("@lucid-evolution/utils");
51
52
  // package.json
52
53
  var package_default = {
53
54
  name: "@lucid-evolution/provider",
54
- version: "0.1.46",
55
+ version: "0.1.49",
55
56
  description: "",
56
57
  main: "./dist/index.js",
57
58
  types: "./dist/index.d.ts",
@@ -81,8 +82,8 @@ var package_default = {
81
82
  "@anastasia-labs/cardano-multiplatform-lib-nodejs": "@anastasia-labs/cardano-multiplatform-lib-browser"
82
83
  },
83
84
  dependencies: {
84
- "@anastasia-labs/cardano-multiplatform-lib-browser": "^5.3.1-3",
85
- "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^5.3.1-3",
85
+ "@anastasia-labs/cardano-multiplatform-lib-browser": "^6.0.1-2",
86
+ "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^6.0.1-2",
86
87
  "@effect/platform": "^0.59.2",
87
88
  "@effect/schema": "^0.68.26",
88
89
  "@lucid-evolution/core-types": "workspace:*",
@@ -166,6 +167,9 @@ var Blockfrost = class {
166
167
  coinsPerUtxoByte: BigInt(result.coins_per_utxo_size),
167
168
  collateralPercentage: parseInt(result.collateral_percent),
168
169
  maxCollateralInputs: parseInt(result.max_collateral_inputs),
170
+ minFeeRefScriptCostPerByte: parseInt(
171
+ result.min_fee_ref_script_cost_per_byte
172
+ ),
169
173
  costModels: result.cost_models
170
174
  };
171
175
  }
@@ -911,6 +915,7 @@ var toProtocolParameters = (result) => {
911
915
  coinsPerUtxoByte: BigInt(result.minUtxoDepositCoefficient),
912
916
  collateralPercentage: result.collateralPercentage,
913
917
  maxCollateralInputs: result.maxCollateralInputs,
918
+ minFeeRefScriptCostPerByte: result.minFeeReferenceScripts.base,
914
919
  costModels: {
915
920
  PlutusV1: Object.fromEntries(
916
921
  result.plutusCostModels["plutus:v1"].map((value, index) => [
@@ -986,6 +991,21 @@ var import_utils5 = require("@lucid-evolution/utils");
986
991
  var import_core_utils2 = require("@lucid-evolution/core-utils");
987
992
  var import_wallet = require("@lucid-evolution/wallet");
988
993
  var import_cardano_multiplatform_lib_nodejs = require("@anastasia-labs/cardano-multiplatform-lib-nodejs");
994
+ async function generateEmulatorAccountFrommPrivateKey(assets) {
995
+ const privateKey = CML.PrivateKey.generate_ed25519().to_bech32();
996
+ const priv = CML.PrivateKey.from_bech32(privateKey);
997
+ const pubKeyHash = priv.to_public().hash();
998
+ const address = CML.EnterpriseAddress.new(
999
+ 0,
1000
+ CML.Credential.new_pub_key(pubKeyHash)
1001
+ ).to_address().to_bech32(void 0);
1002
+ return {
1003
+ seedPhrase: "",
1004
+ address,
1005
+ assets,
1006
+ privateKey
1007
+ };
1008
+ }
989
1009
  function generateEmulatorAccount(assets) {
990
1010
  const seedPhrase = (0, import_utils4.generateSeedPhrase)();
991
1011
  return {
@@ -995,7 +1015,8 @@ function generateEmulatorAccount(assets) {
995
1015
  accountIndex: 0,
996
1016
  network: "Custom"
997
1017
  }).address,
998
- assets
1018
+ assets,
1019
+ privateKey: ""
999
1020
  };
1000
1021
  }
1001
1022
  var Emulator = class {
@@ -1753,6 +1774,9 @@ var Maestro = class {
1753
1774
  coinsPerUtxoByte: BigInt(result.min_utxo_deposit_coefficient),
1754
1775
  collateralPercentage: parseInt(result.collateral_percentage),
1755
1776
  maxCollateralInputs: parseInt(result.max_collateral_inputs),
1777
+ minFeeRefScriptCostPerByte: parseInt(
1778
+ result.min_fee_ref_script_cost_per_byte
1779
+ ),
1756
1780
  costModels: {
1757
1781
  PlutusV1: Object.fromEntries(
1758
1782
  result.plutus_cost_models.plutus_v1.map(
@@ -1765,7 +1789,7 @@ var Maestro = class {
1765
1789
  )
1766
1790
  ),
1767
1791
  PlutusV3: Object.fromEntries(
1768
- result.plutus_cost_models.plutus_v2.map(
1792
+ result.plutus_cost_models.plutus_v3.map(
1769
1793
  (value, index) => [index.toString(), value]
1770
1794
  )
1771
1795
  )
@@ -2369,6 +2393,7 @@ var Koios = class {
2369
2393
  coinsPerUtxoByte: result.coins_per_utxo_size,
2370
2394
  collateralPercentage: result.collateral_percent,
2371
2395
  maxCollateralInputs: result.max_collateral_inputs,
2396
+ minFeeRefScriptCostPerByte: result.min_fee_ref_script_cost_per_byte,
2372
2397
  costModels: {
2373
2398
  PlutusV1: Object.fromEntries(
2374
2399
  result.cost_models.PlutusV1.map((value, index) => [
@@ -2595,5 +2620,6 @@ var Koios = class {
2595
2620
  Kupmios,
2596
2621
  KupmiosError,
2597
2622
  Maestro,
2598
- generateEmulatorAccount
2623
+ generateEmulatorAccount,
2624
+ generateEmulatorAccountFrommPrivateKey
2599
2625
  });
package/dist/index.d.cts CHANGED
@@ -54,7 +54,9 @@ type EmulatorAccount = {
54
54
  address: Address;
55
55
  assets: Assets;
56
56
  outputData?: OutputData;
57
+ privateKey: string;
57
58
  };
59
+ declare function generateEmulatorAccountFrommPrivateKey(assets: Assets): Promise<EmulatorAccount>;
58
60
  declare function generateEmulatorAccount(assets: Assets): EmulatorAccount;
59
61
  declare class Emulator implements Provider {
60
62
  ledger: Record<FlatOutRef, {
@@ -154,4 +156,4 @@ declare class Koios implements Provider {
154
156
  evaluateTx(tx: Transaction, additionalUTxOs?: UTxO[]): Promise<EvalRedeemer[]>;
155
157
  }
156
158
 
157
- export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount };
159
+ export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount, generateEmulatorAccountFrommPrivateKey };
package/dist/index.d.ts CHANGED
@@ -54,7 +54,9 @@ type EmulatorAccount = {
54
54
  address: Address;
55
55
  assets: Assets;
56
56
  outputData?: OutputData;
57
+ privateKey: string;
57
58
  };
59
+ declare function generateEmulatorAccountFrommPrivateKey(assets: Assets): Promise<EmulatorAccount>;
58
60
  declare function generateEmulatorAccount(assets: Assets): EmulatorAccount;
59
61
  declare class Emulator implements Provider {
60
62
  ledger: Record<FlatOutRef, {
@@ -154,4 +156,4 @@ declare class Koios implements Provider {
154
156
  evaluateTx(tx: Transaction, additionalUTxOs?: UTxO[]): Promise<EvalRedeemer[]>;
155
157
  }
156
158
 
157
- export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount };
159
+ export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount, generateEmulatorAccountFrommPrivateKey };
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { applyDoubleCborEncoding } from "@lucid-evolution/utils";
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@lucid-evolution/provider",
11
- version: "0.1.46",
11
+ version: "0.1.49",
12
12
  description: "",
13
13
  main: "./dist/index.js",
14
14
  types: "./dist/index.d.ts",
@@ -38,8 +38,8 @@ var package_default = {
38
38
  "@anastasia-labs/cardano-multiplatform-lib-nodejs": "@anastasia-labs/cardano-multiplatform-lib-browser"
39
39
  },
40
40
  dependencies: {
41
- "@anastasia-labs/cardano-multiplatform-lib-browser": "^5.3.1-3",
42
- "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^5.3.1-3",
41
+ "@anastasia-labs/cardano-multiplatform-lib-browser": "^6.0.1-2",
42
+ "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^6.0.1-2",
43
43
  "@effect/platform": "^0.59.2",
44
44
  "@effect/schema": "^0.68.26",
45
45
  "@lucid-evolution/core-types": "workspace:*",
@@ -123,6 +123,9 @@ var Blockfrost = class {
123
123
  coinsPerUtxoByte: BigInt(result.coins_per_utxo_size),
124
124
  collateralPercentage: parseInt(result.collateral_percent),
125
125
  maxCollateralInputs: parseInt(result.max_collateral_inputs),
126
+ minFeeRefScriptCostPerByte: parseInt(
127
+ result.min_fee_ref_script_cost_per_byte
128
+ ),
126
129
  costModels: result.cost_models
127
130
  };
128
131
  }
@@ -872,6 +875,7 @@ var toProtocolParameters = (result) => {
872
875
  coinsPerUtxoByte: BigInt(result.minUtxoDepositCoefficient),
873
876
  collateralPercentage: result.collateralPercentage,
874
877
  maxCollateralInputs: result.maxCollateralInputs,
878
+ minFeeRefScriptCostPerByte: result.minFeeReferenceScripts.base,
875
879
  costModels: {
876
880
  PlutusV1: Object.fromEntries(
877
881
  result.plutusCostModels["plutus:v1"].map((value, index) => [
@@ -950,6 +954,21 @@ import { coreToUtxo, getAddressDetails } from "@lucid-evolution/utils";
950
954
  import { fromHex as fromHex2 } from "@lucid-evolution/core-utils";
951
955
  import { walletFromSeed } from "@lucid-evolution/wallet";
952
956
  import { RedeemerTag } from "@anastasia-labs/cardano-multiplatform-lib-nodejs";
957
+ async function generateEmulatorAccountFrommPrivateKey(assets) {
958
+ const privateKey = CML.PrivateKey.generate_ed25519().to_bech32();
959
+ const priv = CML.PrivateKey.from_bech32(privateKey);
960
+ const pubKeyHash = priv.to_public().hash();
961
+ const address = CML.EnterpriseAddress.new(
962
+ 0,
963
+ CML.Credential.new_pub_key(pubKeyHash)
964
+ ).to_address().to_bech32(void 0);
965
+ return {
966
+ seedPhrase: "",
967
+ address,
968
+ assets,
969
+ privateKey
970
+ };
971
+ }
953
972
  function generateEmulatorAccount(assets) {
954
973
  const seedPhrase = generateSeedPhrase();
955
974
  return {
@@ -959,7 +978,8 @@ function generateEmulatorAccount(assets) {
959
978
  accountIndex: 0,
960
979
  network: "Custom"
961
980
  }).address,
962
- assets
981
+ assets,
982
+ privateKey: ""
963
983
  };
964
984
  }
965
985
  var Emulator = class {
@@ -1717,6 +1737,9 @@ var Maestro = class {
1717
1737
  coinsPerUtxoByte: BigInt(result.min_utxo_deposit_coefficient),
1718
1738
  collateralPercentage: parseInt(result.collateral_percentage),
1719
1739
  maxCollateralInputs: parseInt(result.max_collateral_inputs),
1740
+ minFeeRefScriptCostPerByte: parseInt(
1741
+ result.min_fee_ref_script_cost_per_byte
1742
+ ),
1720
1743
  costModels: {
1721
1744
  PlutusV1: Object.fromEntries(
1722
1745
  result.plutus_cost_models.plutus_v1.map(
@@ -1729,7 +1752,7 @@ var Maestro = class {
1729
1752
  )
1730
1753
  ),
1731
1754
  PlutusV3: Object.fromEntries(
1732
- result.plutus_cost_models.plutus_v2.map(
1755
+ result.plutus_cost_models.plutus_v3.map(
1733
1756
  (value, index) => [index.toString(), value]
1734
1757
  )
1735
1758
  )
@@ -2337,6 +2360,7 @@ var Koios = class {
2337
2360
  coinsPerUtxoByte: result.coins_per_utxo_size,
2338
2361
  collateralPercentage: result.collateral_percent,
2339
2362
  maxCollateralInputs: result.max_collateral_inputs,
2363
+ minFeeRefScriptCostPerByte: result.min_fee_ref_script_cost_per_byte,
2340
2364
  costModels: {
2341
2365
  PlutusV1: Object.fromEntries(
2342
2366
  result.cost_models.PlutusV1.map((value, index) => [
@@ -2562,5 +2586,6 @@ export {
2562
2586
  Kupmios,
2563
2587
  KupmiosError,
2564
2588
  Maestro,
2565
- generateEmulatorAccount
2589
+ generateEmulatorAccount,
2590
+ generateEmulatorAccountFrommPrivateKey
2566
2591
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/provider",
3
- "version": "0.1.46",
3
+ "version": "0.1.49",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,15 +25,15 @@
25
25
  "@anastasia-labs/cardano-multiplatform-lib-nodejs": "@anastasia-labs/cardano-multiplatform-lib-browser"
26
26
  },
27
27
  "dependencies": {
28
- "@anastasia-labs/cardano-multiplatform-lib-browser": "^5.3.1-3",
29
- "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^5.3.1-3",
28
+ "@anastasia-labs/cardano-multiplatform-lib-browser": "^6.0.1-2",
29
+ "@anastasia-labs/cardano-multiplatform-lib-nodejs": "^6.0.1-2",
30
30
  "@effect/platform": "^0.59.2",
31
31
  "@effect/schema": "^0.68.26",
32
32
  "effect": "^3.5.6",
33
- "@lucid-evolution/core-types": "0.1.15",
34
- "@lucid-evolution/core-utils": "0.1.13",
35
- "@lucid-evolution/utils": "0.1.37",
36
- "@lucid-evolution/wallet": "0.1.41"
33
+ "@lucid-evolution/core-types": "0.1.16",
34
+ "@lucid-evolution/core-utils": "0.1.14",
35
+ "@lucid-evolution/utils": "0.1.38",
36
+ "@lucid-evolution/wallet": "0.1.43"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^20.12.8",