@hardkas/simulator 0.9.0-alpha → 0.9.2-alpha
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.js +8 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -624,6 +624,7 @@ function formatScenarioReport(results) {
|
|
|
624
624
|
|
|
625
625
|
// src/mass-profile.ts
|
|
626
626
|
import { estimateTransactionMass, estimateFeeFromMass } from "@hardkas/tx-builder";
|
|
627
|
+
import { formatSompiToKas } from "@hardkas/core";
|
|
627
628
|
function formatBigInt(n) {
|
|
628
629
|
return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
629
630
|
}
|
|
@@ -678,7 +679,7 @@ function compareMassProfiles(current, previous) {
|
|
|
678
679
|
};
|
|
679
680
|
}
|
|
680
681
|
function formatMassProfile(breakdown) {
|
|
681
|
-
const kasAmount =
|
|
682
|
+
const kasAmount = formatSompiToKas(breakdown.estimatedFeeSompi);
|
|
682
683
|
return [
|
|
683
684
|
"\u2550\u2550\u2550 Mass Profile \u2550\u2550\u2550",
|
|
684
685
|
` Inputs : ${breakdown.inputCount} inputs \u2192 ${formatBigInt(breakdown.inputMass)} mass`,
|
|
@@ -686,7 +687,7 @@ function formatMassProfile(breakdown) {
|
|
|
686
687
|
` Payload : ${breakdown.payloadBytes} bytes \u2192 ${formatBigInt(breakdown.payloadMass)} mass`,
|
|
687
688
|
` Total mass : ${formatBigInt(breakdown.totalMass)}`,
|
|
688
689
|
` Fee rate : ${formatBigInt(breakdown.feeRate)} sompi/mass`,
|
|
689
|
-
` Est. fee : ${formatBigInt(breakdown.estimatedFeeSompi)} sompi (${kasAmount
|
|
690
|
+
` Est. fee : ${formatBigInt(breakdown.estimatedFeeSompi)} sompi (${kasAmount} KAS)`
|
|
690
691
|
].join("\n");
|
|
691
692
|
}
|
|
692
693
|
function formatMassComparison(comparison) {
|
|
@@ -832,7 +833,7 @@ function simulateSilverDeploy(deployPlanArtifact, options = {}) {
|
|
|
832
833
|
};
|
|
833
834
|
const draft = {
|
|
834
835
|
schema: "hardkas.silver.deploySimulation",
|
|
835
|
-
hardkasVersion: options.hardkasVersion ?? deployPlanArtifact.hardkasVersion ?? "0.9.
|
|
836
|
+
hardkasVersion: options.hardkasVersion ?? deployPlanArtifact.hardkasVersion ?? "0.9.2-alpha",
|
|
836
837
|
version: SILVER_SIMULATOR_VERSION,
|
|
837
838
|
hashVersion: CURRENT_HASH_VERSION,
|
|
838
839
|
networkId: "simnet",
|
|
@@ -989,7 +990,7 @@ function simulateSilverSpend(spendPlanArtifact, simulatedState, options = {}) {
|
|
|
989
990
|
});
|
|
990
991
|
const draft = {
|
|
991
992
|
schema: "hardkas.silver.spendSimulation",
|
|
992
|
-
hardkasVersion: options.hardkasVersion ?? spendPlanArtifact.hardkasVersion ?? "0.9.
|
|
993
|
+
hardkasVersion: options.hardkasVersion ?? spendPlanArtifact.hardkasVersion ?? "0.9.2-alpha",
|
|
993
994
|
version: SILVER_SIMULATOR_VERSION,
|
|
994
995
|
hashVersion: CURRENT_HASH_VERSION,
|
|
995
996
|
networkId: "simnet",
|
|
@@ -1020,7 +1021,9 @@ function simulateSilverSpend(spendPlanArtifact, simulatedState, options = {}) {
|
|
|
1020
1021
|
spent: true,
|
|
1021
1022
|
spentByTxId: simulatedSpendTxId
|
|
1022
1023
|
};
|
|
1023
|
-
nextState.spentOutpoints = Array.from(
|
|
1024
|
+
nextState.spentOutpoints = Array.from(
|
|
1025
|
+
/* @__PURE__ */ new Set([...nextState.spentOutpoints, key])
|
|
1026
|
+
).sort();
|
|
1024
1027
|
return {
|
|
1025
1028
|
receipt,
|
|
1026
1029
|
state: normalizeState(nextState)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hardkas/simulator",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2-alpha",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@hardkas/
|
|
16
|
-
"@hardkas/
|
|
15
|
+
"@hardkas/tx-builder": "0.9.2-alpha",
|
|
16
|
+
"@hardkas/core": "0.9.2-alpha"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsup": "^8.3.5",
|