@umbra-privacy/ceremony 0.1.4 → 0.2.3
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 +139 -93
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { render } from "ink";
|
|
|
5
5
|
|
|
6
6
|
// src/components/App.tsx
|
|
7
7
|
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
8
|
-
import { Box as
|
|
8
|
+
import { Box as Box7, Text as Text7, useApp, useInput as useInput2 } from "ink";
|
|
9
9
|
|
|
10
10
|
// src/cleanup.ts
|
|
11
11
|
var pendingLeaveQueue = null;
|
|
@@ -262,7 +262,7 @@ var STATUS_COLOR = {
|
|
|
262
262
|
function Header({ ceremony, subtitle }) {
|
|
263
263
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
264
264
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
265
|
-
/* @__PURE__ */ jsx(Text, { bold: true, color: "cyan", children: "\u25C6
|
|
265
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: "cyan", children: "\u25C6 Umbra Ceremony TUI" }),
|
|
266
266
|
ceremony && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
267
267
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }),
|
|
268
268
|
/* @__PURE__ */ jsx(Text, { bold: true, children: ceremony.name }),
|
|
@@ -271,6 +271,9 @@ function Header({ ceremony, subtitle }) {
|
|
|
271
271
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "]" })
|
|
272
272
|
] })
|
|
273
273
|
] }),
|
|
274
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: "Phase 2 trusted-setup contribution \xB7 Groth16 / BN254" }),
|
|
275
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: "You are adding fresh entropy to Umbra's circuit proving keys. The on-chain privacy of every deposit, claim and transfer holds as long as ONE contributor in this ceremony destroys their secret." }),
|
|
276
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "Press ? at any time for a full explanation of what is happening." }),
|
|
274
277
|
ceremony && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
275
278
|
ceremony.total_tracks,
|
|
276
279
|
" circuit",
|
|
@@ -688,8 +691,32 @@ function Attestation({ contribution }) {
|
|
|
688
691
|
] });
|
|
689
692
|
}
|
|
690
693
|
|
|
691
|
-
// src/components/
|
|
694
|
+
// src/components/InfoModal.tsx
|
|
695
|
+
import { Box as Box6, Text as Text6 } from "ink";
|
|
692
696
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
697
|
+
function InfoModal() {
|
|
698
|
+
return /* @__PURE__ */ jsx6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs6(
|
|
699
|
+
Box6,
|
|
700
|
+
{
|
|
701
|
+
flexDirection: "column",
|
|
702
|
+
borderStyle: "round",
|
|
703
|
+
borderColor: "cyan",
|
|
704
|
+
paddingX: 2,
|
|
705
|
+
paddingY: 1,
|
|
706
|
+
width: 84,
|
|
707
|
+
gap: 1,
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, color: "cyan", children: "Umbra Phase 2 Trusted-Setup Ceremony" }),
|
|
710
|
+
/* @__PURE__ */ jsx6(Text6, { children: "Umbra uses Groth16 zero-knowledge proofs to give Solana users on-chain privacy. Every circuit needs a one-time multi-party ceremony to generate its proving key safely \u2014 that is Phase 2. Each contributor adds their own secret entropy and destroys it afterward. The setup stays secure as long as AT LEAST ONE contributor erased theirs, which is why your single contribution genuinely matters." }),
|
|
711
|
+
/* @__PURE__ */ jsx6(Text6, { children: "What you will do: tap 20 keys to seed your entropy, download the latest challenge file, run snarkjs locally to combine your secret with the parameters, and upload the response. Your secret never leaves your machine. Erase it when you are done." }),
|
|
712
|
+
/* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Press B, Esc or ? to close" })
|
|
713
|
+
]
|
|
714
|
+
}
|
|
715
|
+
) });
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// src/components/App.tsx
|
|
719
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
693
720
|
var NAME_MAX_LEN = 100;
|
|
694
721
|
var NAME_VALID_RE = /^[\p{L}\p{N} _.\-]*$/u;
|
|
695
722
|
function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName }) {
|
|
@@ -705,6 +732,7 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
705
732
|
const [contributed, setContributed] = useState4({});
|
|
706
733
|
const [selectedIdx, setSelectedIdx] = useState4(0);
|
|
707
734
|
const [tab, setTab] = useState4(0);
|
|
735
|
+
const [showInfo, setShowInfo] = useState4(false);
|
|
708
736
|
useEffect4(() => {
|
|
709
737
|
if (!nameSet) return;
|
|
710
738
|
if (!initialCeremonyId) {
|
|
@@ -818,13 +846,28 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
818
846
|
}, [screen.name]);
|
|
819
847
|
useInput2((input, key) => {
|
|
820
848
|
const q = input.toLowerCase();
|
|
849
|
+
if (showInfo) {
|
|
850
|
+
if (key.escape || input === "?" || q === "b") {
|
|
851
|
+
setShowInfo(false);
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
if (q === "q") {
|
|
855
|
+
exit();
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
if (input === "?" && screen.name !== "entropy") {
|
|
861
|
+
setShowInfo(true);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
821
864
|
if (screen.name === "name-input") {
|
|
822
865
|
if (key.escape) {
|
|
823
866
|
exit();
|
|
824
867
|
return;
|
|
825
868
|
}
|
|
826
869
|
if (key.tab) {
|
|
827
|
-
|
|
870
|
+
setScreen({ name: "name-input", value: randomAnonName() });
|
|
828
871
|
return;
|
|
829
872
|
}
|
|
830
873
|
if (key.return) {
|
|
@@ -912,49 +955,52 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
912
955
|
goHome();
|
|
913
956
|
}
|
|
914
957
|
});
|
|
958
|
+
if (showInfo) {
|
|
959
|
+
return /* @__PURE__ */ jsx7(InfoModal, {});
|
|
960
|
+
}
|
|
915
961
|
if (screen.name === "name-input") {
|
|
916
962
|
const { value } = screen;
|
|
917
963
|
const canSubmit = value.trim().length > 0;
|
|
918
|
-
return /* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
965
|
+
/* @__PURE__ */ jsx7(Header, { ceremony: null }),
|
|
966
|
+
/* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginTop: 1, gap: 1, children: [
|
|
967
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Who are you contributing as?" }),
|
|
968
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Your display name appears next to your contributions in the public transcript. Pick anything \u2014 your real name, a handle, or hit Tab for a random anonymous name." }),
|
|
969
|
+
/* @__PURE__ */ jsxs7(Box7, { children: [
|
|
970
|
+
/* @__PURE__ */ jsx7(Text7, { color: "cyan", children: " > " }),
|
|
971
|
+
/* @__PURE__ */ jsx7(Text7, { children: value }),
|
|
972
|
+
/* @__PURE__ */ jsx7(Text7, { color: "cyan", inverse: true, children: " " })
|
|
927
973
|
] }),
|
|
928
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: canSubmit ? "Enter to continue \xB7 Tab rerolls random name \xB7 \u232B backspace \xB7 Esc to quit" : "Type a name, or press Tab to suggest a random anonymous one \xB7 Esc to quit" })
|
|
929
975
|
] })
|
|
930
976
|
] });
|
|
931
977
|
}
|
|
932
978
|
if (screen.name === "ceremony-picker") {
|
|
933
979
|
const { ceremonies, loading } = screen;
|
|
934
|
-
return /* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
loading ? /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
] }) : /* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
981
|
+
/* @__PURE__ */ jsx7(Header, { ceremony: null }),
|
|
982
|
+
loading ? /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Loading ceremonies..." }) : ceremonies.length === 0 ? /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", gap: 1, children: [
|
|
983
|
+
/* @__PURE__ */ jsx7(Text7, { color: "yellow", children: "No ceremonies found." }),
|
|
984
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "The server may not have any active ceremonies yet." }),
|
|
985
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Q to quit" })
|
|
986
|
+
] }) : /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
987
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Select a ceremony:" }),
|
|
988
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " " + "\u2500".repeat(60) }),
|
|
943
989
|
ceremonies.map((c, i) => {
|
|
944
990
|
const isSelected = i === selectedIdx;
|
|
945
991
|
const isOpen = c.status === "open";
|
|
946
992
|
const statusColor = c.status === "open" ? "green" : c.status === "completed" ? "cyan" : "yellow";
|
|
947
|
-
return /* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
993
|
+
return /* @__PURE__ */ jsxs7(Box7, { gap: 2, children: [
|
|
994
|
+
/* @__PURE__ */ jsxs7(Text7, { color: isSelected ? "cyan" : isOpen ? void 0 : "gray", children: [
|
|
949
995
|
isSelected ? "\u25B6 " : " ",
|
|
950
996
|
c.name.padEnd(30)
|
|
951
997
|
] }),
|
|
952
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ jsxs7(Text7, { color: statusColor, children: [
|
|
953
999
|
"[",
|
|
954
1000
|
c.status,
|
|
955
1001
|
"]"
|
|
956
1002
|
] }),
|
|
957
|
-
/* @__PURE__ */
|
|
1003
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
958
1004
|
c.track_count,
|
|
959
1005
|
" track",
|
|
960
1006
|
c.track_count !== 1 ? "s" : "",
|
|
@@ -965,12 +1011,12 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
965
1011
|
] })
|
|
966
1012
|
] }, c.id);
|
|
967
1013
|
}),
|
|
968
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " " + "\u2500".repeat(60) }),
|
|
969
1015
|
(() => {
|
|
970
1016
|
const c = ceremonies[selectedIdx];
|
|
971
1017
|
if (!c) return null;
|
|
972
1018
|
if (c.status === "initialized") {
|
|
973
|
-
return /* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ jsxs7(Text7, { color: "yellow", children: [
|
|
974
1020
|
" Not open yet \u2014 admin: run initialize ",
|
|
975
1021
|
"<id>",
|
|
976
1022
|
" then open ",
|
|
@@ -979,115 +1025,115 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
979
1025
|
] });
|
|
980
1026
|
}
|
|
981
1027
|
if (c.status === "finalizing") {
|
|
982
|
-
return /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ jsx7(Text7, { color: "yellow", children: " Contribution phase is closed \u2014 ceremony is applying the final beacon." });
|
|
983
1029
|
}
|
|
984
1030
|
if (c.status === "completed") {
|
|
985
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ jsx7(Text7, { color: "cyan", children: " Ceremony complete \u2014 verification keys are available." });
|
|
986
1032
|
}
|
|
987
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "\u2191/\u2193 select \xB7 Enter join \xB7 Q quit" });
|
|
988
1034
|
})()
|
|
989
1035
|
] })
|
|
990
1036
|
] });
|
|
991
1037
|
}
|
|
992
1038
|
if (screen.name === "loading") {
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1040
|
+
/* @__PURE__ */ jsx7(Header, { ceremony }),
|
|
1041
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Loading tracks..." })
|
|
996
1042
|
] });
|
|
997
1043
|
}
|
|
998
1044
|
if (screen.name === "error") {
|
|
999
1045
|
const backHint = !initialCeremonyId ? "\u232B Backspace \u2014 back to ceremony list \xB7 Q to quit" : screen.recoverable ? "\u232B Backspace / B to go back \xB7 Q to quit" : "Q to quit";
|
|
1000
|
-
return /* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1047
|
+
/* @__PURE__ */ jsx7(Header, { ceremony }),
|
|
1048
|
+
/* @__PURE__ */ jsxs7(Text7, { color: "red", bold: true, children: [
|
|
1003
1049
|
"\u2717 ",
|
|
1004
1050
|
screen.message
|
|
1005
1051
|
] }),
|
|
1006
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: backHint })
|
|
1007
1053
|
] });
|
|
1008
1054
|
}
|
|
1009
1055
|
if (screen.name === "tracks") {
|
|
1010
1056
|
const { tracks } = screen;
|
|
1011
1057
|
const openTracks = tracks.filter((t) => t.status === "open");
|
|
1012
1058
|
const myContributions = Object.values(contributed).filter((c) => c.ceremonyId === activeCeremonyId);
|
|
1013
|
-
const TabBar = () => /* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1059
|
+
const TabBar = () => /* @__PURE__ */ jsxs7(Box7, { gap: 1, marginBottom: 1, children: [
|
|
1060
|
+
/* @__PURE__ */ jsx7(Text7, { bold: tab === 0, color: tab === 0 ? "cyan" : void 0, dimColor: tab !== 0, children: tab === 0 ? "[ Dashboard ]" : " Dashboard " }),
|
|
1061
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "|" }),
|
|
1062
|
+
/* @__PURE__ */ jsx7(Text7, { bold: tab === 1, color: tab === 1 ? "cyan" : void 0, dimColor: tab !== 1, children: tab === 1 ? `[ My Contributions (${myContributions.length}) ]` : ` My Contributions (${myContributions.length}) ` }),
|
|
1063
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " Tab to switch" })
|
|
1018
1064
|
] });
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */
|
|
1065
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1066
|
+
/* @__PURE__ */ jsx7(Header, { ceremony }),
|
|
1067
|
+
/* @__PURE__ */ jsx7(TabBar, {}),
|
|
1022
1068
|
tab === 0 ? (
|
|
1023
1069
|
// ── Dashboard tab ────────────────────────────────────────────────
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1071
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1026
1072
|
" CIRCUIT".padEnd(30),
|
|
1027
1073
|
"TOTAL".padEnd(10),
|
|
1028
1074
|
"QUEUE".padEnd(8),
|
|
1029
1075
|
"STATUS".padEnd(14),
|
|
1030
1076
|
"MY CONTRIBUTIONS"
|
|
1031
1077
|
] }),
|
|
1032
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " " + "\u2500".repeat(68) }),
|
|
1033
1079
|
tracks.map((t, i) => {
|
|
1034
1080
|
const isSelected = i === selectedIdx;
|
|
1035
1081
|
const canContribute = t.status === "open";
|
|
1036
1082
|
const nameClipped = t.circuit_name.length > 26 ? t.circuit_name.slice(0, 24) + ".." : t.circuit_name;
|
|
1037
1083
|
const statusColor = t.status === "open" ? "green" : t.status === "finalized" ? "cyan" : "yellow";
|
|
1038
1084
|
const myContrib = contributed[t.id];
|
|
1039
|
-
return /* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
1085
|
+
return /* @__PURE__ */ jsxs7(Box7, { children: [
|
|
1086
|
+
/* @__PURE__ */ jsxs7(Text7, { color: isSelected ? "cyan" : canContribute ? void 0 : "gray", children: [
|
|
1041
1087
|
isSelected ? "\u25B6 " : " ",
|
|
1042
1088
|
nameClipped.padEnd(28),
|
|
1043
1089
|
String(t.contribution_count).padEnd(10),
|
|
1044
1090
|
String(t.queue_depth).padEnd(8)
|
|
1045
1091
|
] }),
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
myContrib ? isSelected ? /* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ jsx7(Text7, { color: statusColor, children: t.status.padEnd(14) }),
|
|
1093
|
+
myContrib ? isSelected ? /* @__PURE__ */ jsxs7(Text7, { color: "green", children: [
|
|
1048
1094
|
"\u2713 contributed (round #",
|
|
1049
1095
|
myContrib.sequenceNumber,
|
|
1050
1096
|
") \u2014 already done"
|
|
1051
|
-
] }) : /* @__PURE__ */
|
|
1097
|
+
] }) : /* @__PURE__ */ jsxs7(Text7, { color: "green", children: [
|
|
1052
1098
|
"\u2713 contributed (round #",
|
|
1053
1099
|
myContrib.sequenceNumber,
|
|
1054
1100
|
")"
|
|
1055
|
-
] }) : canContribute ? isSelected ? /* @__PURE__ */
|
|
1101
|
+
] }) : canContribute ? isSelected ? /* @__PURE__ */ jsx7(Text7, { color: "yellow", children: "\u2190 Enter to contribute" }) : /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "not contributed" }) : /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "\u2014" })
|
|
1056
1102
|
] }, t.id);
|
|
1057
1103
|
}),
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
openTracks.length === 0 ? /* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " " + "\u2500".repeat(68) }),
|
|
1105
|
+
openTracks.length === 0 ? /* @__PURE__ */ jsx7(Text7, { color: "yellow", children: "No open tracks \u2014 ceremony may be finalizing or complete." }) : /* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1060
1106
|
"\u2191/\u2193 select \xB7 Enter contribute \xB7 R refresh \xB7 Q quit",
|
|
1061
1107
|
!initialCeremonyId ? " \xB7 \u232B back to ceremony list" : ""
|
|
1062
1108
|
] })
|
|
1063
1109
|
] })
|
|
1064
1110
|
) : (
|
|
1065
1111
|
// ── My Contributions tab ─────────────────────────────────────────
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
1068
|
-
/* @__PURE__ */
|
|
1069
|
-
] }) : /* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx7(Box7, { flexDirection: "column", children: myContributions.length === 0 ? /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", gap: 1, children: [
|
|
1113
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "No contributions yet." }),
|
|
1114
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Switch to Dashboard tab and press Enter on a circuit to contribute." })
|
|
1115
|
+
] }) : /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1116
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1071
1117
|
" CIRCUIT".padEnd(28),
|
|
1072
1118
|
"ROUND".padEnd(8),
|
|
1073
1119
|
"HASH".padEnd(20),
|
|
1074
1120
|
"TIME"
|
|
1075
1121
|
] }),
|
|
1076
|
-
/* @__PURE__ */
|
|
1077
|
-
myContributions.map((c, i) => /* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " " + "\u2500".repeat(68) }),
|
|
1123
|
+
myContributions.map((c, i) => /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1124
|
+
/* @__PURE__ */ jsxs7(Box7, { children: [
|
|
1125
|
+
/* @__PURE__ */ jsx7(Text7, { color: "green", children: " \u2713 " }),
|
|
1126
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: c.circuitName.padEnd(24) }),
|
|
1127
|
+
/* @__PURE__ */ jsx7(Text7, { color: "yellow", children: "#" + c.sequenceNumber + " " }),
|
|
1128
|
+
/* @__PURE__ */ jsx7(Text7, { color: "cyan", children: c.contributionHash ? c.contributionHash.slice(0, 16) + "..." : "(pending)" })
|
|
1083
1129
|
] }),
|
|
1084
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1085
1131
|
" ",
|
|
1086
1132
|
c.verifiedAt ? new Date(c.verifiedAt).toLocaleString() : ""
|
|
1087
1133
|
] })
|
|
1088
1134
|
] }, i)),
|
|
1089
|
-
/* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: " " + "\u2500".repeat(68) }),
|
|
1136
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1091
1137
|
"Total: ",
|
|
1092
1138
|
myContributions.length,
|
|
1093
1139
|
" contribution",
|
|
@@ -1100,24 +1146,24 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
1100
1146
|
] });
|
|
1101
1147
|
}
|
|
1102
1148
|
if (screen.name === "joining") {
|
|
1103
|
-
return /* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1150
|
+
/* @__PURE__ */ jsx7(Header, { ceremony }),
|
|
1151
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Joining queue..." })
|
|
1106
1152
|
] });
|
|
1107
1153
|
}
|
|
1108
1154
|
if (screen.name === "queue") {
|
|
1109
1155
|
const { trackId, circuitName } = screen;
|
|
1110
1156
|
const priorContrib = contributed[trackId];
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
priorContrib && /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1158
|
+
/* @__PURE__ */ jsx7(Header, { ceremony, subtitle: `Circuit: ${circuitName}` }),
|
|
1159
|
+
priorContrib && /* @__PURE__ */ jsx7(Box7, { marginBottom: 1, paddingX: 1, children: /* @__PURE__ */ jsxs7(Text7, { color: "yellow", children: [
|
|
1114
1160
|
"\u26A0 You already contributed to this circuit (round #",
|
|
1115
1161
|
priorContrib.sequenceNumber,
|
|
1116
1162
|
").",
|
|
1117
1163
|
" ",
|
|
1118
1164
|
"Contributing again is allowed and adds more entropy."
|
|
1119
1165
|
] }) }),
|
|
1120
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ jsx7(
|
|
1121
1167
|
QueueView,
|
|
1122
1168
|
{
|
|
1123
1169
|
ceremonyId: activeCeremonyId,
|
|
@@ -1127,14 +1173,14 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
1127
1173
|
onError: (e) => setScreen({ name: "error", message: e.message, recoverable: true })
|
|
1128
1174
|
}
|
|
1129
1175
|
),
|
|
1130
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "\u232B Backspace to go back \xB7 Q to quit" })
|
|
1131
1177
|
] });
|
|
1132
1178
|
}
|
|
1133
1179
|
if (screen.name === "entropy") {
|
|
1134
1180
|
const { trackId, circuitName, slotStatus } = screen;
|
|
1135
|
-
return /* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1182
|
+
/* @__PURE__ */ jsx7(Header, { ceremony, subtitle: `Circuit: ${circuitName} \xB7 Your turn!` }),
|
|
1183
|
+
/* @__PURE__ */ jsx7(
|
|
1138
1184
|
EntropyCollector,
|
|
1139
1185
|
{
|
|
1140
1186
|
onComplete: (entropy) => setScreen({ name: "contribute", trackId, circuitName, slotStatus, entropy }),
|
|
@@ -1145,9 +1191,9 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
1145
1191
|
}
|
|
1146
1192
|
if (screen.name === "contribute") {
|
|
1147
1193
|
const { trackId, circuitName, slotStatus, entropy } = screen;
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */
|
|
1194
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1195
|
+
/* @__PURE__ */ jsx7(Header, { ceremony, subtitle: `Circuit: ${circuitName} \xB7 Contributing` }),
|
|
1196
|
+
/* @__PURE__ */ jsx7(
|
|
1151
1197
|
ContributeFlow,
|
|
1152
1198
|
{
|
|
1153
1199
|
ceremonyId: activeCeremonyId,
|
|
@@ -1176,17 +1222,17 @@ function App({ ceremonyId: initialCeremonyId, displayName: initialDisplayName })
|
|
|
1176
1222
|
}
|
|
1177
1223
|
if (screen.name === "done") {
|
|
1178
1224
|
const { contribution } = screen;
|
|
1179
|
-
return /* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1226
|
+
/* @__PURE__ */ jsx7(Header, { ceremony }),
|
|
1227
|
+
/* @__PURE__ */ jsx7(Attestation, { contribution }),
|
|
1228
|
+
/* @__PURE__ */ jsx7(Box7, { marginTop: 1, children: /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "\u232B Backspace / B = contribute to another circuit \xB7 Q to quit" }) })
|
|
1183
1229
|
] });
|
|
1184
1230
|
}
|
|
1185
1231
|
return null;
|
|
1186
1232
|
}
|
|
1187
1233
|
|
|
1188
1234
|
// src/index.tsx
|
|
1189
|
-
import { jsx as
|
|
1235
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1190
1236
|
var ceremonyId = process.env["CEREMONY_ID"] ?? "";
|
|
1191
1237
|
var displayName = process.env["CONTRIBUTOR_NAME"];
|
|
1192
1238
|
process.stdout.write("\x1B[?1049h\x1B[H");
|
|
@@ -1211,7 +1257,7 @@ process.on("SIGTERM", () => {
|
|
|
1211
1257
|
});
|
|
1212
1258
|
});
|
|
1213
1259
|
var { waitUntilExit } = render(
|
|
1214
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ jsx8(App, { ceremonyId, displayName }),
|
|
1215
1261
|
{ exitOnCtrlC: false }
|
|
1216
1262
|
);
|
|
1217
1263
|
await waitUntilExit();
|