@siphoyawe/mina-cli 1.2.1 → 1.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/README.md +27 -17
- package/dist/index.js +309 -101
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import React12 from "react";
|
|
|
7
7
|
import { render } from "ink";
|
|
8
8
|
|
|
9
9
|
// src/commands/wizard.tsx
|
|
10
|
-
import { useState as useState2, useEffect as useEffect2, useCallback } from "react";
|
|
10
|
+
import React3, { useState as useState2, useEffect as useEffect2, useCallback } from "react";
|
|
11
11
|
import { Box as Box8, Text as Text8, useApp, useInput as useInput2 } from "ink";
|
|
12
12
|
import {
|
|
13
13
|
Mina,
|
|
@@ -21,30 +21,41 @@ import {
|
|
|
21
21
|
|
|
22
22
|
// src/ui/theme.ts
|
|
23
23
|
var theme = {
|
|
24
|
-
// Primary
|
|
24
|
+
// Primary palette - Cyber Luxe
|
|
25
25
|
primary: "#7DD3FC",
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
26
|
+
// Cyan - main accent, bright and attention-grabbing
|
|
27
|
+
primaryDim: "#38BDF8",
|
|
28
|
+
// Dimmer cyan for subtle accents
|
|
29
|
+
secondary: "#94A3B8",
|
|
30
|
+
// Slate - refined supporting text
|
|
31
|
+
muted: "#64748B",
|
|
32
|
+
// Subtle gray - disabled/placeholder
|
|
33
|
+
// Status colors - Vivid & Clear
|
|
34
|
+
success: "#10B981",
|
|
35
|
+
// Emerald - completed/success
|
|
36
|
+
error: "#EF4444",
|
|
35
37
|
// Red - error/failed
|
|
36
|
-
warning: "#
|
|
37
|
-
//
|
|
38
|
+
warning: "#F59E0B",
|
|
39
|
+
// Amber - warning/pending
|
|
38
40
|
// UI elements
|
|
39
|
-
border: "#
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
41
|
+
border: "#334155",
|
|
42
|
+
// Slate border - more visible
|
|
43
|
+
borderLight: "#475569",
|
|
44
|
+
// Lighter border for emphasis
|
|
45
|
+
background: "#0F172A",
|
|
46
|
+
// Deep navy background
|
|
47
|
+
// Accent colors for visual interest
|
|
48
|
+
accent: "#A78BFA",
|
|
49
|
+
// Violet accent
|
|
50
|
+
accentAlt: "#F472B6",
|
|
51
|
+
// Pink accent
|
|
52
|
+
info: "#38BDF8",
|
|
47
53
|
// Light blue info
|
|
54
|
+
highlight: "#22D3EE",
|
|
55
|
+
// Bright cyan for highlights
|
|
56
|
+
// Gradient-like effects (text colors)
|
|
57
|
+
gradientStart: "#7DD3FC",
|
|
58
|
+
gradientEnd: "#A78BFA"
|
|
48
59
|
};
|
|
49
60
|
var borders = {
|
|
50
61
|
// Single line box
|
|
@@ -66,28 +77,64 @@ var borders = {
|
|
|
66
77
|
doubleTopLeft: "\u2554",
|
|
67
78
|
doubleTopRight: "\u2557",
|
|
68
79
|
doubleBottomLeft: "\u255A",
|
|
69
|
-
doubleBottomRight: "\u255D"
|
|
80
|
+
doubleBottomRight: "\u255D",
|
|
81
|
+
// Round corners (softer look)
|
|
82
|
+
roundTopLeft: "\u256D",
|
|
83
|
+
roundTopRight: "\u256E",
|
|
84
|
+
roundBottomLeft: "\u2570",
|
|
85
|
+
roundBottomRight: "\u256F",
|
|
86
|
+
// Heavy box (bold appearance)
|
|
87
|
+
heavyHorizontal: "\u2501",
|
|
88
|
+
heavyVertical: "\u2503"
|
|
70
89
|
};
|
|
71
90
|
var symbols = {
|
|
91
|
+
// Status indicators
|
|
72
92
|
pending: "\u25CB",
|
|
73
|
-
active: "\
|
|
93
|
+
active: "\u25C6",
|
|
74
94
|
completed: "\u2713",
|
|
75
95
|
failed: "\u2717",
|
|
76
|
-
|
|
96
|
+
// Navigation & UI
|
|
77
97
|
bullet: "\u2022",
|
|
78
98
|
arrow: "\u203A",
|
|
99
|
+
arrowRight: "\u2192",
|
|
100
|
+
arrowLeft: "\u2190",
|
|
101
|
+
arrowUp: "\u2191",
|
|
102
|
+
arrowDown: "\u2193",
|
|
103
|
+
pointer: "\u25B8",
|
|
104
|
+
pointerFilled: "\u25B6",
|
|
105
|
+
// Checks & crosses
|
|
79
106
|
check: "\u2714",
|
|
80
107
|
cross: "\u2718",
|
|
108
|
+
checkCircle: "\u25C9",
|
|
109
|
+
// Misc UI
|
|
81
110
|
search: "\u2315",
|
|
82
|
-
star: "\u2605"
|
|
111
|
+
star: "\u2605",
|
|
112
|
+
starEmpty: "\u2606",
|
|
113
|
+
diamond: "\u25C7",
|
|
114
|
+
diamondFilled: "\u25C6",
|
|
115
|
+
circle: "\u25CF",
|
|
116
|
+
circleEmpty: "\u25CB",
|
|
117
|
+
square: "\u25A0",
|
|
118
|
+
squareEmpty: "\u25A1",
|
|
119
|
+
// Progress
|
|
120
|
+
progressFull: "\u2588",
|
|
121
|
+
progressMid: "\u2593",
|
|
122
|
+
progressLight: "\u2591",
|
|
123
|
+
// Separators
|
|
124
|
+
dot: "\xB7",
|
|
125
|
+
pipe: "\u2502",
|
|
126
|
+
dash: "\u2500"
|
|
83
127
|
};
|
|
84
|
-
var MINA_LOGO =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
128
|
+
var MINA_LOGO = `\u2554\u2566\u2557\u2566\u2554\u2557\u2554\u2554\u2550\u2557
|
|
129
|
+
\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2560\u2550\u2563
|
|
130
|
+
\u2569 \u2569\u2569\u255D\u255A\u255D\u2569 \u2569`;
|
|
131
|
+
var MINA_LOGO_LARGE = `
|
|
132
|
+
\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557
|
|
133
|
+
\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
|
|
134
|
+
\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551
|
|
135
|
+
\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551
|
|
136
|
+
\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551
|
|
137
|
+
\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D`;
|
|
91
138
|
var TAGLINE = "Cross-chain bridge to Hyperliquid";
|
|
92
139
|
|
|
93
140
|
// src/ui/Box.tsx
|
|
@@ -98,9 +145,12 @@ function Box({
|
|
|
98
145
|
borderColor = theme.border,
|
|
99
146
|
bordered = true,
|
|
100
147
|
padding = 1,
|
|
148
|
+
accent = false,
|
|
149
|
+
emphasis = false,
|
|
101
150
|
children,
|
|
102
151
|
...props
|
|
103
152
|
}) {
|
|
153
|
+
const effectiveBorderColor = accent ? theme.primary : borderColor;
|
|
104
154
|
if (!bordered) {
|
|
105
155
|
return /* @__PURE__ */ jsx(InkBox, { padding, ...props, children });
|
|
106
156
|
}
|
|
@@ -108,13 +158,17 @@ function Box({
|
|
|
108
158
|
InkBox,
|
|
109
159
|
{
|
|
110
160
|
flexDirection: "column",
|
|
111
|
-
borderStyle: "round",
|
|
112
|
-
borderColor,
|
|
161
|
+
borderStyle: emphasis ? "double" : "round",
|
|
162
|
+
borderColor: effectiveBorderColor,
|
|
113
163
|
paddingX: padding,
|
|
114
164
|
paddingY: padding > 0 ? 1 : 0,
|
|
115
165
|
...props,
|
|
116
166
|
children: [
|
|
117
|
-
title && /* @__PURE__ */ jsx(InkBox, { marginBottom: 1, children: /* @__PURE__ */
|
|
167
|
+
title && /* @__PURE__ */ jsx(InkBox, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { color: accent ? theme.primary : theme.secondary, bold: true, children: [
|
|
168
|
+
symbols.diamond,
|
|
169
|
+
" ",
|
|
170
|
+
title
|
|
171
|
+
] }) }),
|
|
118
172
|
children
|
|
119
173
|
]
|
|
120
174
|
}
|
|
@@ -123,9 +177,25 @@ function Box({
|
|
|
123
177
|
function Divider({
|
|
124
178
|
width = 40,
|
|
125
179
|
color = theme.border,
|
|
126
|
-
char
|
|
180
|
+
char,
|
|
181
|
+
label,
|
|
182
|
+
heavy = false
|
|
127
183
|
}) {
|
|
128
|
-
|
|
184
|
+
const dividerChar = char || (heavy ? borders.heavyHorizontal : borders.horizontal);
|
|
185
|
+
if (label) {
|
|
186
|
+
const labelLength = label.length + 2;
|
|
187
|
+
const sideWidth = Math.max(3, Math.floor((width - labelLength) / 2));
|
|
188
|
+
return /* @__PURE__ */ jsxs(InkBox, { children: [
|
|
189
|
+
/* @__PURE__ */ jsx(Text, { color, children: dividerChar.repeat(sideWidth) }),
|
|
190
|
+
/* @__PURE__ */ jsxs(Text, { color: theme.muted, children: [
|
|
191
|
+
" ",
|
|
192
|
+
label,
|
|
193
|
+
" "
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsx(Text, { color, children: dividerChar.repeat(sideWidth) })
|
|
196
|
+
] });
|
|
197
|
+
}
|
|
198
|
+
return /* @__PURE__ */ jsx(Text, { color, children: dividerChar.repeat(width) });
|
|
129
199
|
}
|
|
130
200
|
|
|
131
201
|
// src/ui/Header.tsx
|
|
@@ -134,24 +204,52 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
134
204
|
function Header({
|
|
135
205
|
showTagline = true,
|
|
136
206
|
tagline = TAGLINE,
|
|
137
|
-
compact = false
|
|
207
|
+
compact = false,
|
|
208
|
+
large = false
|
|
138
209
|
}) {
|
|
139
210
|
if (compact) {
|
|
140
211
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
|
|
212
|
+
/* @__PURE__ */ jsxs2(Box2, { children: [
|
|
213
|
+
/* @__PURE__ */ jsx2(Text2, { color: theme.accent, children: symbols.diamond }),
|
|
214
|
+
/* @__PURE__ */ jsx2(Text2, { color: theme.primary, bold: true, children: " MINA " }),
|
|
215
|
+
/* @__PURE__ */ jsx2(Text2, { color: theme.accent, children: symbols.diamond })
|
|
216
|
+
] }),
|
|
217
|
+
showTagline && /* @__PURE__ */ jsx2(Text2, { color: theme.muted, children: tagline })
|
|
143
218
|
] });
|
|
144
219
|
}
|
|
220
|
+
const logo = large ? MINA_LOGO_LARGE : MINA_LOGO;
|
|
145
221
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
146
|
-
/* @__PURE__ */ jsx2(
|
|
147
|
-
|
|
222
|
+
/* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: logo.split("\n").filter((line) => line.length > 0).map((line, index, arr) => /* @__PURE__ */ jsx2(
|
|
223
|
+
Text2,
|
|
224
|
+
{
|
|
225
|
+
color: index === 0 ? theme.primary : index === arr.length - 1 ? theme.accent : theme.primaryDim,
|
|
226
|
+
bold: true,
|
|
227
|
+
children: line
|
|
228
|
+
},
|
|
229
|
+
index
|
|
230
|
+
)) }),
|
|
231
|
+
showTagline && /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ jsxs2(Box2, { children: [
|
|
232
|
+
/* @__PURE__ */ jsxs2(Text2, { color: theme.border, children: [
|
|
233
|
+
borders.roundTopLeft,
|
|
234
|
+
borders.heavyHorizontal
|
|
235
|
+
] }),
|
|
236
|
+
/* @__PURE__ */ jsxs2(Text2, { color: theme.muted, children: [
|
|
237
|
+
" ",
|
|
238
|
+
tagline,
|
|
239
|
+
" "
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ jsxs2(Text2, { color: theme.border, children: [
|
|
242
|
+
borders.heavyHorizontal,
|
|
243
|
+
borders.roundTopRight
|
|
244
|
+
] })
|
|
245
|
+
] }) })
|
|
148
246
|
] });
|
|
149
247
|
}
|
|
150
248
|
|
|
151
249
|
// src/ui/Select.tsx
|
|
152
250
|
import { Box as Box3, Text as Text3 } from "ink";
|
|
153
251
|
import InkSelectInput from "ink-select-input";
|
|
154
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
252
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
155
253
|
function Select({
|
|
156
254
|
items,
|
|
157
255
|
onSelect,
|
|
@@ -161,7 +259,8 @@ function Select({
|
|
|
161
259
|
label,
|
|
162
260
|
limit
|
|
163
261
|
}) {
|
|
164
|
-
const inkItems = items.map((item) => ({
|
|
262
|
+
const inkItems = items.map((item, index) => ({
|
|
263
|
+
key: `${item.label}-${String(item.value)}-${index}`,
|
|
165
264
|
label: item.label,
|
|
166
265
|
value: item
|
|
167
266
|
}));
|
|
@@ -177,27 +276,44 @@ function Select({
|
|
|
177
276
|
const item = items.find((i) => i.label === label2);
|
|
178
277
|
const isDisabled = item?.disabled;
|
|
179
278
|
return /* @__PURE__ */ jsxs3(Box3, { children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
279
|
+
/* @__PURE__ */ jsx3(Text3, { color: isSelected ? theme.primary : theme.border, children: isSelected ? symbols.pointerFilled : " " }),
|
|
280
|
+
/* @__PURE__ */ jsx3(Text3, { children: " " }),
|
|
281
|
+
/* @__PURE__ */ jsx3(
|
|
282
|
+
Text3,
|
|
283
|
+
{
|
|
284
|
+
color: isSelected ? theme.primary : isDisabled ? theme.muted : theme.secondary,
|
|
285
|
+
bold: isSelected,
|
|
286
|
+
children: label2
|
|
287
|
+
}
|
|
288
|
+
),
|
|
289
|
+
item?.description && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
290
|
+
/* @__PURE__ */ jsxs3(Text3, { color: theme.border, children: [
|
|
291
|
+
" ",
|
|
292
|
+
symbols.dash,
|
|
293
|
+
" "
|
|
294
|
+
] }),
|
|
295
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.muted, dimColor: true, children: item.description })
|
|
189
296
|
] })
|
|
190
297
|
] });
|
|
191
298
|
};
|
|
192
|
-
const indicatorComponent = (
|
|
299
|
+
const indicatorComponent = () => /* @__PURE__ */ jsx3(Text3, { children: " " });
|
|
193
300
|
if (disabled) {
|
|
194
301
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
195
302
|
label && /* @__PURE__ */ jsx3(Text3, { color: theme.muted, dimColor: true, children: label }),
|
|
196
|
-
/* @__PURE__ */ jsx3(Text3, { color: theme.muted, dimColor: true, children:
|
|
303
|
+
/* @__PURE__ */ jsx3(Box3, { children: /* @__PURE__ */ jsxs3(Text3, { color: theme.muted, dimColor: true, children: [
|
|
304
|
+
symbols.circleEmpty,
|
|
305
|
+
" (disabled)"
|
|
306
|
+
] }) })
|
|
197
307
|
] });
|
|
198
308
|
}
|
|
199
309
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
200
|
-
label && /* @__PURE__ */
|
|
310
|
+
label && /* @__PURE__ */ jsxs3(Box3, { marginBottom: 1, children: [
|
|
311
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.borderLight, children: borders.vertical }),
|
|
312
|
+
/* @__PURE__ */ jsxs3(Text3, { color: theme.secondary, children: [
|
|
313
|
+
" ",
|
|
314
|
+
label
|
|
315
|
+
] })
|
|
316
|
+
] }),
|
|
201
317
|
/* @__PURE__ */ jsx3(
|
|
202
318
|
InkSelectInput,
|
|
203
319
|
{
|
|
@@ -252,13 +368,13 @@ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
|
252
368
|
function getStatusIndicator(status) {
|
|
253
369
|
switch (status) {
|
|
254
370
|
case "pending":
|
|
255
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.muted, children: symbols.
|
|
371
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.muted, children: symbols.circleEmpty });
|
|
256
372
|
case "active":
|
|
257
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.
|
|
373
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: /* @__PURE__ */ jsx4(InkSpinner, { type: "dots" }) });
|
|
258
374
|
case "completed":
|
|
259
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.success, children: symbols.
|
|
375
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.success, children: symbols.checkCircle });
|
|
260
376
|
case "failed":
|
|
261
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.error, children: symbols.
|
|
377
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.error, children: symbols.cross });
|
|
262
378
|
}
|
|
263
379
|
}
|
|
264
380
|
function getStatusColor(status) {
|
|
@@ -266,28 +382,36 @@ function getStatusColor(status) {
|
|
|
266
382
|
case "pending":
|
|
267
383
|
return theme.muted;
|
|
268
384
|
case "active":
|
|
269
|
-
return theme.
|
|
385
|
+
return theme.highlight;
|
|
270
386
|
case "completed":
|
|
271
387
|
return theme.success;
|
|
272
388
|
case "failed":
|
|
273
389
|
return theme.error;
|
|
274
390
|
}
|
|
275
391
|
}
|
|
392
|
+
function getConnectorStyle(currentStatus, nextStatus) {
|
|
393
|
+
if (currentStatus === "completed") {
|
|
394
|
+
return { char: borders.vertical, color: theme.success };
|
|
395
|
+
}
|
|
396
|
+
if (currentStatus === "active") {
|
|
397
|
+
return { char: borders.vertical, color: theme.highlight };
|
|
398
|
+
}
|
|
399
|
+
return { char: borders.vertical, color: theme.border };
|
|
400
|
+
}
|
|
276
401
|
function StepItem({
|
|
277
402
|
step,
|
|
278
403
|
index,
|
|
279
404
|
showNumber,
|
|
280
405
|
showTimestamp,
|
|
281
|
-
isLast
|
|
406
|
+
isLast,
|
|
407
|
+
nextStep
|
|
282
408
|
}) {
|
|
283
409
|
const color = getStatusColor(step.status);
|
|
410
|
+
const connector = !isLast ? getConnectorStyle(step.status, nextStep?.status || "pending") : null;
|
|
284
411
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
285
412
|
/* @__PURE__ */ jsxs4(Box4, { children: [
|
|
286
413
|
/* @__PURE__ */ jsx4(Box4, { width: 3, children: getStatusIndicator(step.status) }),
|
|
287
|
-
showNumber && /* @__PURE__ */ jsx4(Box4, { width: 4, children: /* @__PURE__ */
|
|
288
|
-
index + 1,
|
|
289
|
-
"."
|
|
290
|
-
] }) }),
|
|
414
|
+
showNumber && /* @__PURE__ */ jsx4(Box4, { width: 4, children: /* @__PURE__ */ jsx4(Text4, { color, dimColor: step.status === "pending", children: String(index + 1).padStart(2, "0") }) }),
|
|
291
415
|
/* @__PURE__ */ jsx4(Box4, { flexGrow: 1, children: /* @__PURE__ */ jsx4(
|
|
292
416
|
Text4,
|
|
293
417
|
{
|
|
@@ -297,10 +421,19 @@ function StepItem({
|
|
|
297
421
|
children: step.label
|
|
298
422
|
}
|
|
299
423
|
) }),
|
|
424
|
+
step.status === "active" && /* @__PURE__ */ jsxs4(Box4, { marginLeft: 1, children: [
|
|
425
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: "[" }),
|
|
426
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: "processing" }),
|
|
427
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: "]" })
|
|
428
|
+
] }),
|
|
300
429
|
showTimestamp && step.timestamp && /* @__PURE__ */ jsx4(Box4, { marginLeft: 2, children: /* @__PURE__ */ jsx4(Text4, { color: theme.muted, dimColor: true, children: step.timestamp }) })
|
|
301
430
|
] }),
|
|
302
|
-
step.description && /* @__PURE__ */ jsx4(Box4, { marginLeft: showNumber ? 7 : 3, children: /* @__PURE__ */
|
|
303
|
-
|
|
431
|
+
step.description && /* @__PURE__ */ jsx4(Box4, { marginLeft: showNumber ? 7 : 3, children: /* @__PURE__ */ jsxs4(Text4, { color: step.status === "failed" ? theme.error : theme.muted, dimColor: step.status !== "failed", children: [
|
|
432
|
+
symbols.pointer,
|
|
433
|
+
" ",
|
|
434
|
+
step.description
|
|
435
|
+
] }) }),
|
|
436
|
+
connector && /* @__PURE__ */ jsx4(Box4, { marginLeft: 1, children: /* @__PURE__ */ jsx4(Text4, { color: connector.color, children: connector.char }) })
|
|
304
437
|
] });
|
|
305
438
|
}
|
|
306
439
|
function ProgressSteps({
|
|
@@ -310,7 +443,13 @@ function ProgressSteps({
|
|
|
310
443
|
title
|
|
311
444
|
}) {
|
|
312
445
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
313
|
-
title && /* @__PURE__ */
|
|
446
|
+
title && /* @__PURE__ */ jsxs4(Box4, { marginBottom: 1, children: [
|
|
447
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.borderLight, children: borders.vertical }),
|
|
448
|
+
/* @__PURE__ */ jsxs4(Text4, { color: theme.secondary, bold: true, children: [
|
|
449
|
+
" ",
|
|
450
|
+
title
|
|
451
|
+
] })
|
|
452
|
+
] }),
|
|
314
453
|
steps.map((step, index) => /* @__PURE__ */ jsx4(
|
|
315
454
|
StepItem,
|
|
316
455
|
{
|
|
@@ -318,7 +457,8 @@ function ProgressSteps({
|
|
|
318
457
|
index,
|
|
319
458
|
showNumber: showNumbers,
|
|
320
459
|
showTimestamp: showTimestamps,
|
|
321
|
-
isLast: index === steps.length - 1
|
|
460
|
+
isLast: index === steps.length - 1,
|
|
461
|
+
nextStep: steps[index + 1]
|
|
322
462
|
},
|
|
323
463
|
index
|
|
324
464
|
))
|
|
@@ -751,14 +891,23 @@ async function createSigner(privateKey, chainId, rpcUrl) {
|
|
|
751
891
|
8453: base,
|
|
752
892
|
43114: avalanche,
|
|
753
893
|
56: bsc,
|
|
754
|
-
// HyperEVM
|
|
894
|
+
// HyperEVM Mainnet
|
|
755
895
|
999: {
|
|
756
896
|
id: 999,
|
|
757
897
|
name: "HyperEVM",
|
|
758
|
-
nativeCurrency: { name: "
|
|
898
|
+
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
|
|
759
899
|
rpcUrls: {
|
|
760
900
|
default: { http: ["https://rpc.hyperliquid.xyz/evm"] }
|
|
761
901
|
}
|
|
902
|
+
},
|
|
903
|
+
// HyperEVM Testnet
|
|
904
|
+
998: {
|
|
905
|
+
id: 998,
|
|
906
|
+
name: "HyperEVM Testnet",
|
|
907
|
+
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
|
|
908
|
+
rpcUrls: {
|
|
909
|
+
default: { http: ["https://rpc.hyperliquid-testnet.xyz/evm"] }
|
|
910
|
+
}
|
|
762
911
|
}
|
|
763
912
|
};
|
|
764
913
|
const chain = chainMap[chainId];
|
|
@@ -794,7 +943,7 @@ async function createSigner(privateKey, chainId, rpcUrl) {
|
|
|
794
943
|
}
|
|
795
944
|
|
|
796
945
|
// src/commands/wizard.tsx
|
|
797
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
946
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
798
947
|
var initialState = {
|
|
799
948
|
step: "chain",
|
|
800
949
|
chain: null,
|
|
@@ -808,15 +957,60 @@ var initialState = {
|
|
|
808
957
|
executionStatus: ""
|
|
809
958
|
};
|
|
810
959
|
function NavigationHints({ step }) {
|
|
960
|
+
const Key = ({ children }) => /* @__PURE__ */ jsx8(Text8, { color: theme.borderLight, children: "[" });
|
|
961
|
+
const renderHint = (key, action, isLast = false) => /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
962
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.secondary, children: key }),
|
|
963
|
+
/* @__PURE__ */ jsxs8(Text8, { color: theme.muted, children: [
|
|
964
|
+
" ",
|
|
965
|
+
action
|
|
966
|
+
] }),
|
|
967
|
+
!isLast && /* @__PURE__ */ jsxs8(Text8, { color: theme.border, children: [
|
|
968
|
+
" ",
|
|
969
|
+
symbols.dot,
|
|
970
|
+
" "
|
|
971
|
+
] })
|
|
972
|
+
] });
|
|
811
973
|
const hints = {
|
|
812
|
-
chain:
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
974
|
+
chain: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
975
|
+
renderHint("\u2191\u2193", "Navigate"),
|
|
976
|
+
renderHint("Enter", "Select"),
|
|
977
|
+
renderHint("q", "Quit", true)
|
|
978
|
+
] }),
|
|
979
|
+
token: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
980
|
+
renderHint("\u2191\u2193", "Navigate"),
|
|
981
|
+
renderHint("Enter", "Select"),
|
|
982
|
+
renderHint("b", "Back"),
|
|
983
|
+
renderHint("q", "Quit", true)
|
|
984
|
+
] }),
|
|
985
|
+
amount: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
986
|
+
renderHint("0-9", "Type amount"),
|
|
987
|
+
renderHint("Enter", "Confirm"),
|
|
988
|
+
renderHint("b", "Back"),
|
|
989
|
+
renderHint("q", "Quit", true)
|
|
990
|
+
] }),
|
|
991
|
+
key: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
992
|
+
renderHint("Paste", "Private key"),
|
|
993
|
+
renderHint("Enter", "Confirm"),
|
|
994
|
+
renderHint("b", "Back"),
|
|
995
|
+
renderHint("q", "Quit", true)
|
|
996
|
+
] }),
|
|
997
|
+
confirm: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
998
|
+
renderHint("Enter", "Execute bridge"),
|
|
999
|
+
renderHint("b", "Back"),
|
|
1000
|
+
renderHint("q", "Quit", true)
|
|
1001
|
+
] }),
|
|
1002
|
+
execute: /* @__PURE__ */ jsxs8(Text8, { color: theme.muted, children: [
|
|
1003
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.primary, children: symbols.active }),
|
|
1004
|
+
" Processing transaction..."
|
|
1005
|
+
] })
|
|
818
1006
|
};
|
|
819
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ jsxs8(Box8, { marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: theme.border, children: [
|
|
1008
|
+
/* @__PURE__ */ jsxs8(Text8, { color: theme.muted, children: [
|
|
1009
|
+
symbols.pointer,
|
|
1010
|
+
" "
|
|
1011
|
+
] }),
|
|
1012
|
+
hints[step]
|
|
1013
|
+
] });
|
|
820
1014
|
}
|
|
821
1015
|
function StepIndicator({ currentStep }) {
|
|
822
1016
|
const steps = ["chain", "token", "amount", "key", "confirm", "execute"];
|
|
@@ -829,27 +1023,41 @@ function StepIndicator({ currentStep }) {
|
|
|
829
1023
|
execute: "Execute"
|
|
830
1024
|
};
|
|
831
1025
|
const currentIndex = steps.indexOf(currentStep);
|
|
832
|
-
return /* @__PURE__ */
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
/* @__PURE__ */ jsxs8(
|
|
1026
|
+
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginBottom: 1, children: [
|
|
1027
|
+
/* @__PURE__ */ jsx8(Box8, { marginBottom: 1, children: steps.map((step, index) => {
|
|
1028
|
+
const isActive = index === currentIndex;
|
|
1029
|
+
const isCompleted = index < currentIndex;
|
|
1030
|
+
const isLast = index === steps.length - 1;
|
|
1031
|
+
return /* @__PURE__ */ jsxs8(React3.Fragment, { children: [
|
|
1032
|
+
/* @__PURE__ */ jsx8(
|
|
1033
|
+
Text8,
|
|
1034
|
+
{
|
|
1035
|
+
color: isCompleted ? theme.success : isActive ? theme.primary : theme.muted,
|
|
1036
|
+
bold: isActive,
|
|
1037
|
+
children: isCompleted ? symbols.checkCircle : isActive ? symbols.diamondFilled : symbols.circleEmpty
|
|
1038
|
+
}
|
|
1039
|
+
),
|
|
1040
|
+
!isLast && /* @__PURE__ */ jsx8(Text8, { color: isCompleted ? theme.success : theme.border, children: isCompleted ? "\u2501\u2501" : "\u2500\u2500" })
|
|
1041
|
+
] }, step);
|
|
1042
|
+
}) }),
|
|
1043
|
+
/* @__PURE__ */ jsx8(Box8, { children: steps.map((step, index) => {
|
|
1044
|
+
const isActive = index === currentIndex;
|
|
1045
|
+
const isCompleted = index < currentIndex;
|
|
1046
|
+
const isLast = index === steps.length - 1;
|
|
1047
|
+
const label = stepLabels[step];
|
|
1048
|
+
const paddedLabel = label.padEnd(isLast ? label.length : 5, " ");
|
|
1049
|
+
return /* @__PURE__ */ jsx8(
|
|
838
1050
|
Text8,
|
|
839
1051
|
{
|
|
840
1052
|
color: isActive ? theme.primary : isCompleted ? theme.success : theme.muted,
|
|
841
1053
|
bold: isActive,
|
|
842
1054
|
dimColor: !isActive && !isCompleted,
|
|
843
|
-
children:
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
),
|
|
850
|
-
/* @__PURE__ */ jsx8(Text8, { color: theme.muted, dimColor: true, children: separator })
|
|
851
|
-
] }, step);
|
|
852
|
-
}) });
|
|
1055
|
+
children: paddedLabel.slice(0, isLast ? void 0 : 5)
|
|
1056
|
+
},
|
|
1057
|
+
step
|
|
1058
|
+
);
|
|
1059
|
+
}) })
|
|
1060
|
+
] });
|
|
853
1061
|
}
|
|
854
1062
|
function ChainSelectionStep({
|
|
855
1063
|
onSelect,
|
|
@@ -2721,7 +2929,7 @@ function getHistory(limit = 10, address) {
|
|
|
2721
2929
|
}
|
|
2722
2930
|
|
|
2723
2931
|
// src/commands/history.tsx
|
|
2724
|
-
import { Fragment, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2932
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2725
2933
|
function formatDate(timestamp) {
|
|
2726
2934
|
return new Date(timestamp).toLocaleString("en-US", {
|
|
2727
2935
|
month: "2-digit",
|
|
@@ -2852,7 +3060,7 @@ function HistoryCommand({
|
|
|
2852
3060
|
entries.length !== 1 ? "s" : ""
|
|
2853
3061
|
] })
|
|
2854
3062
|
] }) }),
|
|
2855
|
-
entries.length === 0 ? /* @__PURE__ */ jsx14(EmptyState, { address }) : /* @__PURE__ */ jsxs14(
|
|
3063
|
+
entries.length === 0 ? /* @__PURE__ */ jsx14(EmptyState, { address }) : /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
2856
3064
|
/* @__PURE__ */ jsx14(
|
|
2857
3065
|
Table,
|
|
2858
3066
|
{
|
|
@@ -2889,7 +3097,7 @@ import {
|
|
|
2889
3097
|
Mina as Mina5,
|
|
2890
3098
|
getChains as getChains6
|
|
2891
3099
|
} from "@siphoyawe/mina-sdk";
|
|
2892
|
-
import { Fragment as
|
|
3100
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2893
3101
|
function truncateAddress2(address) {
|
|
2894
3102
|
if (address.length <= 14) return address;
|
|
2895
3103
|
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
@@ -3101,7 +3309,7 @@ function BalanceCommand({
|
|
|
3101
3309
|
borders.horizontal.repeat(boxWidth - 2),
|
|
3102
3310
|
borders.rightT
|
|
3103
3311
|
] }) }),
|
|
3104
|
-
!hasAnyBalances ? /* @__PURE__ */ jsx15(
|
|
3312
|
+
!hasAnyBalances ? /* @__PURE__ */ jsx15(Fragment4, { children: /* @__PURE__ */ jsxs15(Box15, { children: [
|
|
3105
3313
|
/* @__PURE__ */ jsx15(Text15, { color: theme.border, children: borders.vertical }),
|
|
3106
3314
|
/* @__PURE__ */ jsx15(Box15, { width: boxWidth - 2, justifyContent: "center", children: /* @__PURE__ */ jsx15(Text15, { color: theme.muted, children: "No balances found" }) }),
|
|
3107
3315
|
/* @__PURE__ */ jsx15(Text15, { color: theme.border, children: borders.vertical })
|
|
@@ -3499,7 +3707,7 @@ function ConfigCommand({ action, key: configKey, value }) {
|
|
|
3499
3707
|
}
|
|
3500
3708
|
|
|
3501
3709
|
// src/index.tsx
|
|
3502
|
-
var VERSION = "1.2.
|
|
3710
|
+
var VERSION = "1.2.2";
|
|
3503
3711
|
var program = new Command();
|
|
3504
3712
|
program.name("mina").description("Mina Bridge CLI - Bridge assets from any chain to Hyperliquid").version(VERSION, "-v, --version", "Display the current version").helpOption("-h, --help", "Display help information");
|
|
3505
3713
|
program.command("wizard").description("Launch the interactive bridge wizard").action(() => {
|