@lucid-evolution/utils 0.0.1 → 0.1.0
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 +13 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -0
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -61,6 +61,7 @@ __export(src_exports, {
|
|
|
61
61
|
scriptHashToCredential: () => scriptHashToCredential,
|
|
62
62
|
slotToUnixTime: () => slotToUnixTime,
|
|
63
63
|
stakeCredentialOf: () => stakeCredentialOf,
|
|
64
|
+
toCMLTransactionHash: () => toCMLTransactionHash,
|
|
64
65
|
toLabel: () => toLabel,
|
|
65
66
|
toNativeScript: () => toNativeScript,
|
|
66
67
|
toPublicKey: () => toPublicKey,
|
|
@@ -1107,6 +1108,17 @@ function coresToTxOutputs(outputs) {
|
|
|
1107
1108
|
}
|
|
1108
1109
|
return result;
|
|
1109
1110
|
}
|
|
1111
|
+
|
|
1112
|
+
// src/tx.ts
|
|
1113
|
+
var CML10 = __toESM(require("@dcspark/cardano-multiplatform-lib-nodejs"), 1);
|
|
1114
|
+
var import_core_utils3 = require("@lucid-evolution/core-utils");
|
|
1115
|
+
var import_lucid_cardano2 = require("lucid-cardano");
|
|
1116
|
+
function toCMLTransactionHash(body) {
|
|
1117
|
+
const TransactionHash3 = import_lucid_cardano2.C.hash_transaction(
|
|
1118
|
+
import_lucid_cardano2.C.TransactionBody.from_bytes((0, import_core_utils3.fromHex)(body.to_cbor_hex()))
|
|
1119
|
+
);
|
|
1120
|
+
return CML10.TransactionHash.from_hex(TransactionHash3.to_hex());
|
|
1121
|
+
}
|
|
1110
1122
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1111
1123
|
0 && (module.exports = {
|
|
1112
1124
|
PROTOCOL_PARAMETERS_DEFAULT,
|
|
@@ -1140,6 +1152,7 @@ function coresToTxOutputs(outputs) {
|
|
|
1140
1152
|
scriptHashToCredential,
|
|
1141
1153
|
slotToUnixTime,
|
|
1142
1154
|
stakeCredentialOf,
|
|
1155
|
+
toCMLTransactionHash,
|
|
1143
1156
|
toLabel,
|
|
1144
1157
|
toNativeScript,
|
|
1145
1158
|
toPublicKey,
|
package/dist/index.d.cts
CHANGED
|
@@ -75,4 +75,6 @@ declare function fromUnit(unit: Unit): {
|
|
|
75
75
|
declare function toUnit(policyId: PolicyId, name?: string | null, label?: number | null): Unit;
|
|
76
76
|
declare function addAssets(...assets: Assets[]): Assets;
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
declare function toCMLTransactionHash(body: CML.TransactionBody): CML.TransactionHash;
|
|
79
|
+
|
|
80
|
+
export { PROTOCOL_PARAMETERS_DEFAULT, addAssets, addressFromHexOrBech32, assetsToValue, coreToOutRef, coreToTxOutput, coreToUtxo, coresToOutRefs, coresToTxOutputs, coresToUtxos, createCostModels, credentialToAddress, credentialToRewardAddress, datumToHash, fromLabel, fromScriptRef, fromUnit, generatePrivateKey, generateSeedPhrase, getAddressDetails, keyHashToCredential, mintingPolicyToId, nativeFromJson, nativeJSFromJson, nativeScriptFromJson, networkToId, paymentCredentialOf, scriptHashToCredential, slotToUnixTime, stakeCredentialOf, toCMLTransactionHash, toLabel, toNativeScript, toPublicKey, toScriptRef, toUnit, unixTimeToSlot, utxoToCore, utxoToTransactionInput, utxoToTransactionOutput, utxosToCores, validatorToAddress, validatorToRewardAddress, validatorToScriptHash, valueToAssets };
|
package/dist/index.d.ts
CHANGED
|
@@ -75,4 +75,6 @@ declare function fromUnit(unit: Unit): {
|
|
|
75
75
|
declare function toUnit(policyId: PolicyId, name?: string | null, label?: number | null): Unit;
|
|
76
76
|
declare function addAssets(...assets: Assets[]): Assets;
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
declare function toCMLTransactionHash(body: CML.TransactionBody): CML.TransactionHash;
|
|
79
|
+
|
|
80
|
+
export { PROTOCOL_PARAMETERS_DEFAULT, addAssets, addressFromHexOrBech32, assetsToValue, coreToOutRef, coreToTxOutput, coreToUtxo, coresToOutRefs, coresToTxOutputs, coresToUtxos, createCostModels, credentialToAddress, credentialToRewardAddress, datumToHash, fromLabel, fromScriptRef, fromUnit, generatePrivateKey, generateSeedPhrase, getAddressDetails, keyHashToCredential, mintingPolicyToId, nativeFromJson, nativeJSFromJson, nativeScriptFromJson, networkToId, paymentCredentialOf, scriptHashToCredential, slotToUnixTime, stakeCredentialOf, toCMLTransactionHash, toLabel, toNativeScript, toPublicKey, toScriptRef, toUnit, unixTimeToSlot, utxoToCore, utxoToTransactionInput, utxoToTransactionOutput, utxosToCores, validatorToAddress, validatorToRewardAddress, validatorToScriptHash, valueToAssets };
|
package/dist/index.js
CHANGED
|
@@ -1031,6 +1031,17 @@ function coresToTxOutputs(outputs) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return result;
|
|
1033
1033
|
}
|
|
1034
|
+
|
|
1035
|
+
// src/tx.ts
|
|
1036
|
+
import * as CML10 from "@dcspark/cardano-multiplatform-lib-nodejs";
|
|
1037
|
+
import { fromHex as fromHex2 } from "@lucid-evolution/core-utils";
|
|
1038
|
+
import { C } from "lucid-cardano";
|
|
1039
|
+
function toCMLTransactionHash(body) {
|
|
1040
|
+
const TransactionHash3 = C.hash_transaction(
|
|
1041
|
+
C.TransactionBody.from_bytes(fromHex2(body.to_cbor_hex()))
|
|
1042
|
+
);
|
|
1043
|
+
return CML10.TransactionHash.from_hex(TransactionHash3.to_hex());
|
|
1044
|
+
}
|
|
1034
1045
|
export {
|
|
1035
1046
|
PROTOCOL_PARAMETERS_DEFAULT,
|
|
1036
1047
|
addAssets,
|
|
@@ -1063,6 +1074,7 @@ export {
|
|
|
1063
1074
|
scriptHashToCredential,
|
|
1064
1075
|
slotToUnixTime,
|
|
1065
1076
|
stakeCredentialOf,
|
|
1077
|
+
toCMLTransactionHash,
|
|
1066
1078
|
toLabel,
|
|
1067
1079
|
toNativeScript,
|
|
1068
1080
|
toPublicKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-evolution/utils",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"lucid-cardano": "^0.10.7",
|
|
22
22
|
"tsup": "^8.0.2",
|
|
23
23
|
"typescript": "^5.3.3",
|
|
24
|
-
"@lucid-evolution/bip39": "0.0
|
|
25
|
-
"@lucid-evolution/core-types": "0.0
|
|
26
|
-
"@lucid-evolution/core-utils": "0.0
|
|
27
|
-
"@lucid-evolution/
|
|
28
|
-
"@lucid-evolution/
|
|
24
|
+
"@lucid-evolution/bip39": "0.2.0",
|
|
25
|
+
"@lucid-evolution/core-types": "0.1.0",
|
|
26
|
+
"@lucid-evolution/core-utils": "0.1.0",
|
|
27
|
+
"@lucid-evolution/crc8": "0.1.0",
|
|
28
|
+
"@lucid-evolution/plutus": "0.1.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsup-node src/index.ts --format esm,cjs --dts --clean",
|