@lucid-evolution/provider 0.1.46 → 0.1.47
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 +22 -4
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -3
- package/package.json +3 -3
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.
|
|
55
|
+
version: "0.1.47",
|
|
55
56
|
description: "",
|
|
56
57
|
main: "./dist/index.js",
|
|
57
58
|
types: "./dist/index.d.ts",
|
|
@@ -986,6 +987,21 @@ var import_utils5 = require("@lucid-evolution/utils");
|
|
|
986
987
|
var import_core_utils2 = require("@lucid-evolution/core-utils");
|
|
987
988
|
var import_wallet = require("@lucid-evolution/wallet");
|
|
988
989
|
var import_cardano_multiplatform_lib_nodejs = require("@anastasia-labs/cardano-multiplatform-lib-nodejs");
|
|
990
|
+
async function generateEmulatorAccountFrommPrivateKey(assets) {
|
|
991
|
+
const privateKey = CML.PrivateKey.generate_ed25519().to_bech32();
|
|
992
|
+
const priv = CML.PrivateKey.from_bech32(privateKey);
|
|
993
|
+
const pubKeyHash = priv.to_public().hash();
|
|
994
|
+
const address = CML.EnterpriseAddress.new(
|
|
995
|
+
0,
|
|
996
|
+
CML.Credential.new_pub_key(pubKeyHash)
|
|
997
|
+
).to_address().to_bech32(void 0);
|
|
998
|
+
return {
|
|
999
|
+
seedPhrase: "",
|
|
1000
|
+
address,
|
|
1001
|
+
assets,
|
|
1002
|
+
privateKey
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
989
1005
|
function generateEmulatorAccount(assets) {
|
|
990
1006
|
const seedPhrase = (0, import_utils4.generateSeedPhrase)();
|
|
991
1007
|
return {
|
|
@@ -995,7 +1011,8 @@ function generateEmulatorAccount(assets) {
|
|
|
995
1011
|
accountIndex: 0,
|
|
996
1012
|
network: "Custom"
|
|
997
1013
|
}).address,
|
|
998
|
-
assets
|
|
1014
|
+
assets,
|
|
1015
|
+
privateKey: ""
|
|
999
1016
|
};
|
|
1000
1017
|
}
|
|
1001
1018
|
var Emulator = class {
|
|
@@ -2595,5 +2612,6 @@ var Koios = class {
|
|
|
2595
2612
|
Kupmios,
|
|
2596
2613
|
KupmiosError,
|
|
2597
2614
|
Maestro,
|
|
2598
|
-
generateEmulatorAccount
|
|
2615
|
+
generateEmulatorAccount,
|
|
2616
|
+
generateEmulatorAccountFrommPrivateKey
|
|
2599
2617
|
});
|
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.
|
|
11
|
+
version: "0.1.47",
|
|
12
12
|
description: "",
|
|
13
13
|
main: "./dist/index.js",
|
|
14
14
|
types: "./dist/index.d.ts",
|
|
@@ -950,6 +950,21 @@ import { coreToUtxo, getAddressDetails } from "@lucid-evolution/utils";
|
|
|
950
950
|
import { fromHex as fromHex2 } from "@lucid-evolution/core-utils";
|
|
951
951
|
import { walletFromSeed } from "@lucid-evolution/wallet";
|
|
952
952
|
import { RedeemerTag } from "@anastasia-labs/cardano-multiplatform-lib-nodejs";
|
|
953
|
+
async function generateEmulatorAccountFrommPrivateKey(assets) {
|
|
954
|
+
const privateKey = CML.PrivateKey.generate_ed25519().to_bech32();
|
|
955
|
+
const priv = CML.PrivateKey.from_bech32(privateKey);
|
|
956
|
+
const pubKeyHash = priv.to_public().hash();
|
|
957
|
+
const address = CML.EnterpriseAddress.new(
|
|
958
|
+
0,
|
|
959
|
+
CML.Credential.new_pub_key(pubKeyHash)
|
|
960
|
+
).to_address().to_bech32(void 0);
|
|
961
|
+
return {
|
|
962
|
+
seedPhrase: "",
|
|
963
|
+
address,
|
|
964
|
+
assets,
|
|
965
|
+
privateKey
|
|
966
|
+
};
|
|
967
|
+
}
|
|
953
968
|
function generateEmulatorAccount(assets) {
|
|
954
969
|
const seedPhrase = generateSeedPhrase();
|
|
955
970
|
return {
|
|
@@ -959,7 +974,8 @@ function generateEmulatorAccount(assets) {
|
|
|
959
974
|
accountIndex: 0,
|
|
960
975
|
network: "Custom"
|
|
961
976
|
}).address,
|
|
962
|
-
assets
|
|
977
|
+
assets,
|
|
978
|
+
privateKey: ""
|
|
963
979
|
};
|
|
964
980
|
}
|
|
965
981
|
var Emulator = class {
|
|
@@ -2562,5 +2578,6 @@ export {
|
|
|
2562
2578
|
Kupmios,
|
|
2563
2579
|
KupmiosError,
|
|
2564
2580
|
Maestro,
|
|
2565
|
-
generateEmulatorAccount
|
|
2581
|
+
generateEmulatorAccount,
|
|
2582
|
+
generateEmulatorAccountFrommPrivateKey
|
|
2566
2583
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-evolution/provider",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@effect/schema": "^0.68.26",
|
|
32
32
|
"effect": "^3.5.6",
|
|
33
33
|
"@lucid-evolution/core-types": "0.1.15",
|
|
34
|
-
"@lucid-evolution/core-utils": "0.1.13",
|
|
35
34
|
"@lucid-evolution/utils": "0.1.37",
|
|
36
|
-
"@lucid-evolution/
|
|
35
|
+
"@lucid-evolution/core-utils": "0.1.13",
|
|
36
|
+
"@lucid-evolution/wallet": "0.1.42"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^20.12.8",
|