From ddbf6b376d73700c7e7e0a3f3f9fd0189a8fa5e2 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Mon, 23 Mar 2026 23:18:14 +0100 Subject: [PATCH] Drop generated shared source artifact --- packages/shared/src/index.js | 42 ------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 packages/shared/src/index.js diff --git a/packages/shared/src/index.js b/packages/shared/src/index.js deleted file mode 100644 index ab8726a..0000000 --- a/packages/shared/src/index.js +++ /dev/null @@ -1,42 +0,0 @@ -export const PICO_PER_PEY = 100000000n; -export const TX_TYPE_LABELS = { - 0: "unset", - 1: "miner", - 2: "protocol", - 3: "burn", - 4: "convert", - 5: "transfer", - 6: "stake", - 7: "create-token", - 8: "audit", - 9: "return", - 10: "rollup" -}; -export function formatAtomic(value, decimals = 8) { - const atomic = typeof value === "bigint" ? value : BigInt(value); - const negative = atomic < 0n; - const abs = negative ? atomic * -1n : atomic; - const div = 10n ** BigInt(decimals); - const whole = abs / div; - const fraction = abs % div; - const fractionText = fraction.toString().padStart(decimals, "0").replace(/0+$/, ""); - return `${negative ? "-" : ""}${whole.toString()}${fractionText ? `.${fractionText}` : ""}`; -} -export function formatPercent(value) { - if (value === null || Number.isNaN(value)) { - return "n/a"; - } - return `${value.toFixed(2)}%`; -} -export function txTypeLabel(type) { - if (type === null || type === undefined) { - return "unknown"; - } - return TX_TYPE_LABELS[type] ?? `type-${type}`; -} -export function shortHash(hash, left = 8, right = 8) { - if (!hash || hash.length <= left + right) { - return hash; - } - return `${hash.slice(0, left)}...${hash.slice(-right)}`; -}