@siphoyawe/mina-cli 1.2.2 → 1.2.4
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 +289 -98
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="mina-cli-logo.svg" alt="Mina CLI" width="400" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">@siphoyawe/mina-cli</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Terminal-based cross-chain bridge to Hyperliquid</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
Bridge assets from any chain directly from your command line
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://www.npmjs.com/package/@siphoyawe/mina-cli">
|
|
17
|
+
<img src="https://img.shields.io/npm/v/@siphoyawe/mina-cli.svg" alt="npm version" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://www.typescriptlang.org/">
|
|
20
|
+
<img src="https://img.shields.io/badge/TypeScript-Ready-blue.svg" alt="TypeScript" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://opensource.org/licenses/MIT">
|
|
23
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" />
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
---
|
|
18
28
|
|
|
19
29
|
## Features
|
|
20
30
|
|
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,62 @@ 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
128
|
var MINA_LOGO = `
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
`;
|
|
129
|
+
\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557
|
|
130
|
+
\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
|
|
131
|
+
\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
|
|
132
|
+
\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
|
|
133
|
+
\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
|
|
134
|
+
\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D`;
|
|
135
|
+
var MINA_LOGO_LARGE = MINA_LOGO;
|
|
91
136
|
var TAGLINE = "Cross-chain bridge to Hyperliquid";
|
|
92
137
|
|
|
93
138
|
// src/ui/Box.tsx
|
|
@@ -98,9 +143,12 @@ function Box({
|
|
|
98
143
|
borderColor = theme.border,
|
|
99
144
|
bordered = true,
|
|
100
145
|
padding = 1,
|
|
146
|
+
accent = false,
|
|
147
|
+
emphasis = false,
|
|
101
148
|
children,
|
|
102
149
|
...props
|
|
103
150
|
}) {
|
|
151
|
+
const effectiveBorderColor = accent ? theme.primary : borderColor;
|
|
104
152
|
if (!bordered) {
|
|
105
153
|
return /* @__PURE__ */ jsx(InkBox, { padding, ...props, children });
|
|
106
154
|
}
|
|
@@ -108,13 +156,17 @@ function Box({
|
|
|
108
156
|
InkBox,
|
|
109
157
|
{
|
|
110
158
|
flexDirection: "column",
|
|
111
|
-
borderStyle: "round",
|
|
112
|
-
borderColor,
|
|
159
|
+
borderStyle: emphasis ? "double" : "round",
|
|
160
|
+
borderColor: effectiveBorderColor,
|
|
113
161
|
paddingX: padding,
|
|
114
162
|
paddingY: padding > 0 ? 1 : 0,
|
|
115
163
|
...props,
|
|
116
164
|
children: [
|
|
117
|
-
title && /* @__PURE__ */ jsx(InkBox, { marginBottom: 1, children: /* @__PURE__ */
|
|
165
|
+
title && /* @__PURE__ */ jsx(InkBox, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { color: accent ? theme.primary : theme.secondary, bold: true, children: [
|
|
166
|
+
symbols.diamond,
|
|
167
|
+
" ",
|
|
168
|
+
title
|
|
169
|
+
] }) }),
|
|
118
170
|
children
|
|
119
171
|
]
|
|
120
172
|
}
|
|
@@ -123,9 +175,25 @@ function Box({
|
|
|
123
175
|
function Divider({
|
|
124
176
|
width = 40,
|
|
125
177
|
color = theme.border,
|
|
126
|
-
char
|
|
178
|
+
char,
|
|
179
|
+
label,
|
|
180
|
+
heavy = false
|
|
127
181
|
}) {
|
|
128
|
-
|
|
182
|
+
const dividerChar = char || (heavy ? borders.heavyHorizontal : borders.horizontal);
|
|
183
|
+
if (label) {
|
|
184
|
+
const labelLength = label.length + 2;
|
|
185
|
+
const sideWidth = Math.max(3, Math.floor((width - labelLength) / 2));
|
|
186
|
+
return /* @__PURE__ */ jsxs(InkBox, { children: [
|
|
187
|
+
/* @__PURE__ */ jsx(Text, { color, children: dividerChar.repeat(sideWidth) }),
|
|
188
|
+
/* @__PURE__ */ jsxs(Text, { color: theme.muted, children: [
|
|
189
|
+
" ",
|
|
190
|
+
label,
|
|
191
|
+
" "
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ jsx(Text, { color, children: dividerChar.repeat(sideWidth) })
|
|
194
|
+
] });
|
|
195
|
+
}
|
|
196
|
+
return /* @__PURE__ */ jsx(Text, { color, children: dividerChar.repeat(width) });
|
|
129
197
|
}
|
|
130
198
|
|
|
131
199
|
// src/ui/Header.tsx
|
|
@@ -134,24 +202,38 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
134
202
|
function Header({
|
|
135
203
|
showTagline = true,
|
|
136
204
|
tagline = TAGLINE,
|
|
137
|
-
compact = false
|
|
205
|
+
compact = false,
|
|
206
|
+
large = false
|
|
138
207
|
}) {
|
|
139
208
|
if (compact) {
|
|
140
209
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
|
|
210
|
+
/* @__PURE__ */ jsxs2(Box2, { children: [
|
|
211
|
+
/* @__PURE__ */ jsx2(Text2, { color: theme.accent, children: symbols.diamond }),
|
|
212
|
+
/* @__PURE__ */ jsx2(Text2, { color: theme.primary, bold: true, children: " MINA " }),
|
|
213
|
+
/* @__PURE__ */ jsx2(Text2, { color: theme.accent, children: symbols.diamond })
|
|
214
|
+
] }),
|
|
215
|
+
showTagline && /* @__PURE__ */ jsx2(Text2, { color: theme.muted, children: tagline })
|
|
143
216
|
] });
|
|
144
217
|
}
|
|
218
|
+
const logo = large ? MINA_LOGO_LARGE : MINA_LOGO;
|
|
145
219
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
146
|
-
/* @__PURE__ */ jsx2(
|
|
147
|
-
|
|
220
|
+
/* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: logo.split("\n").filter((line) => line.length > 0).map((line, index) => /* @__PURE__ */ jsx2(
|
|
221
|
+
Text2,
|
|
222
|
+
{
|
|
223
|
+
color: theme.primary,
|
|
224
|
+
bold: true,
|
|
225
|
+
children: line
|
|
226
|
+
},
|
|
227
|
+
index
|
|
228
|
+
)) }),
|
|
229
|
+
showTagline && /* @__PURE__ */ jsx2(Box2, { marginTop: 1, children: /* @__PURE__ */ jsx2(Text2, { color: theme.muted, children: tagline }) })
|
|
148
230
|
] });
|
|
149
231
|
}
|
|
150
232
|
|
|
151
233
|
// src/ui/Select.tsx
|
|
152
234
|
import { Box as Box3, Text as Text3 } from "ink";
|
|
153
235
|
import InkSelectInput from "ink-select-input";
|
|
154
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
236
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
155
237
|
function Select({
|
|
156
238
|
items,
|
|
157
239
|
onSelect,
|
|
@@ -178,27 +260,44 @@ function Select({
|
|
|
178
260
|
const item = items.find((i) => i.label === label2);
|
|
179
261
|
const isDisabled = item?.disabled;
|
|
180
262
|
return /* @__PURE__ */ jsxs3(Box3, { children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
263
|
+
/* @__PURE__ */ jsx3(Text3, { color: isSelected ? theme.primary : theme.border, children: isSelected ? symbols.pointerFilled : " " }),
|
|
264
|
+
/* @__PURE__ */ jsx3(Text3, { children: " " }),
|
|
265
|
+
/* @__PURE__ */ jsx3(
|
|
266
|
+
Text3,
|
|
267
|
+
{
|
|
268
|
+
color: isSelected ? theme.primary : isDisabled ? theme.muted : theme.secondary,
|
|
269
|
+
bold: isSelected,
|
|
270
|
+
children: label2
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
item?.description && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
274
|
+
/* @__PURE__ */ jsxs3(Text3, { color: theme.border, children: [
|
|
275
|
+
" ",
|
|
276
|
+
symbols.dash,
|
|
277
|
+
" "
|
|
278
|
+
] }),
|
|
279
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.muted, dimColor: true, children: item.description })
|
|
190
280
|
] })
|
|
191
281
|
] });
|
|
192
282
|
};
|
|
193
|
-
const indicatorComponent = (
|
|
283
|
+
const indicatorComponent = () => /* @__PURE__ */ jsx3(Text3, { children: " " });
|
|
194
284
|
if (disabled) {
|
|
195
285
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
196
286
|
label && /* @__PURE__ */ jsx3(Text3, { color: theme.muted, dimColor: true, children: label }),
|
|
197
|
-
/* @__PURE__ */ jsx3(Text3, { color: theme.muted, dimColor: true, children:
|
|
287
|
+
/* @__PURE__ */ jsx3(Box3, { children: /* @__PURE__ */ jsxs3(Text3, { color: theme.muted, dimColor: true, children: [
|
|
288
|
+
symbols.circleEmpty,
|
|
289
|
+
" (disabled)"
|
|
290
|
+
] }) })
|
|
198
291
|
] });
|
|
199
292
|
}
|
|
200
293
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
201
|
-
label && /* @__PURE__ */
|
|
294
|
+
label && /* @__PURE__ */ jsxs3(Box3, { marginBottom: 1, children: [
|
|
295
|
+
/* @__PURE__ */ jsx3(Text3, { color: theme.borderLight, children: borders.vertical }),
|
|
296
|
+
/* @__PURE__ */ jsxs3(Text3, { color: theme.secondary, children: [
|
|
297
|
+
" ",
|
|
298
|
+
label
|
|
299
|
+
] })
|
|
300
|
+
] }),
|
|
202
301
|
/* @__PURE__ */ jsx3(
|
|
203
302
|
InkSelectInput,
|
|
204
303
|
{
|
|
@@ -253,13 +352,13 @@ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
|
253
352
|
function getStatusIndicator(status) {
|
|
254
353
|
switch (status) {
|
|
255
354
|
case "pending":
|
|
256
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.muted, children: symbols.
|
|
355
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.muted, children: symbols.circleEmpty });
|
|
257
356
|
case "active":
|
|
258
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.
|
|
357
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: /* @__PURE__ */ jsx4(InkSpinner, { type: "dots" }) });
|
|
259
358
|
case "completed":
|
|
260
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.success, children: symbols.
|
|
359
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.success, children: symbols.checkCircle });
|
|
261
360
|
case "failed":
|
|
262
|
-
return /* @__PURE__ */ jsx4(Text4, { color: theme.error, children: symbols.
|
|
361
|
+
return /* @__PURE__ */ jsx4(Text4, { color: theme.error, children: symbols.cross });
|
|
263
362
|
}
|
|
264
363
|
}
|
|
265
364
|
function getStatusColor(status) {
|
|
@@ -267,28 +366,36 @@ function getStatusColor(status) {
|
|
|
267
366
|
case "pending":
|
|
268
367
|
return theme.muted;
|
|
269
368
|
case "active":
|
|
270
|
-
return theme.
|
|
369
|
+
return theme.highlight;
|
|
271
370
|
case "completed":
|
|
272
371
|
return theme.success;
|
|
273
372
|
case "failed":
|
|
274
373
|
return theme.error;
|
|
275
374
|
}
|
|
276
375
|
}
|
|
376
|
+
function getConnectorStyle(currentStatus, nextStatus) {
|
|
377
|
+
if (currentStatus === "completed") {
|
|
378
|
+
return { char: borders.vertical, color: theme.success };
|
|
379
|
+
}
|
|
380
|
+
if (currentStatus === "active") {
|
|
381
|
+
return { char: borders.vertical, color: theme.highlight };
|
|
382
|
+
}
|
|
383
|
+
return { char: borders.vertical, color: theme.border };
|
|
384
|
+
}
|
|
277
385
|
function StepItem({
|
|
278
386
|
step,
|
|
279
387
|
index,
|
|
280
388
|
showNumber,
|
|
281
389
|
showTimestamp,
|
|
282
|
-
isLast
|
|
390
|
+
isLast,
|
|
391
|
+
nextStep
|
|
283
392
|
}) {
|
|
284
393
|
const color = getStatusColor(step.status);
|
|
394
|
+
const connector = !isLast ? getConnectorStyle(step.status, nextStep?.status || "pending") : null;
|
|
285
395
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
286
396
|
/* @__PURE__ */ jsxs4(Box4, { children: [
|
|
287
397
|
/* @__PURE__ */ jsx4(Box4, { width: 3, children: getStatusIndicator(step.status) }),
|
|
288
|
-
showNumber && /* @__PURE__ */ jsx4(Box4, { width: 4, children: /* @__PURE__ */
|
|
289
|
-
index + 1,
|
|
290
|
-
"."
|
|
291
|
-
] }) }),
|
|
398
|
+
showNumber && /* @__PURE__ */ jsx4(Box4, { width: 4, children: /* @__PURE__ */ jsx4(Text4, { color, dimColor: step.status === "pending", children: String(index + 1).padStart(2, "0") }) }),
|
|
292
399
|
/* @__PURE__ */ jsx4(Box4, { flexGrow: 1, children: /* @__PURE__ */ jsx4(
|
|
293
400
|
Text4,
|
|
294
401
|
{
|
|
@@ -298,10 +405,19 @@ function StepItem({
|
|
|
298
405
|
children: step.label
|
|
299
406
|
}
|
|
300
407
|
) }),
|
|
408
|
+
step.status === "active" && /* @__PURE__ */ jsxs4(Box4, { marginLeft: 1, children: [
|
|
409
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: "[" }),
|
|
410
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: "processing" }),
|
|
411
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.highlight, children: "]" })
|
|
412
|
+
] }),
|
|
301
413
|
showTimestamp && step.timestamp && /* @__PURE__ */ jsx4(Box4, { marginLeft: 2, children: /* @__PURE__ */ jsx4(Text4, { color: theme.muted, dimColor: true, children: step.timestamp }) })
|
|
302
414
|
] }),
|
|
303
|
-
step.description && /* @__PURE__ */ jsx4(Box4, { marginLeft: showNumber ? 7 : 3, children: /* @__PURE__ */
|
|
304
|
-
|
|
415
|
+
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: [
|
|
416
|
+
symbols.pointer,
|
|
417
|
+
" ",
|
|
418
|
+
step.description
|
|
419
|
+
] }) }),
|
|
420
|
+
connector && /* @__PURE__ */ jsx4(Box4, { marginLeft: 1, children: /* @__PURE__ */ jsx4(Text4, { color: connector.color, children: connector.char }) })
|
|
305
421
|
] });
|
|
306
422
|
}
|
|
307
423
|
function ProgressSteps({
|
|
@@ -311,7 +427,13 @@ function ProgressSteps({
|
|
|
311
427
|
title
|
|
312
428
|
}) {
|
|
313
429
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
314
|
-
title && /* @__PURE__ */
|
|
430
|
+
title && /* @__PURE__ */ jsxs4(Box4, { marginBottom: 1, children: [
|
|
431
|
+
/* @__PURE__ */ jsx4(Text4, { color: theme.borderLight, children: borders.vertical }),
|
|
432
|
+
/* @__PURE__ */ jsxs4(Text4, { color: theme.secondary, bold: true, children: [
|
|
433
|
+
" ",
|
|
434
|
+
title
|
|
435
|
+
] })
|
|
436
|
+
] }),
|
|
315
437
|
steps.map((step, index) => /* @__PURE__ */ jsx4(
|
|
316
438
|
StepItem,
|
|
317
439
|
{
|
|
@@ -319,7 +441,8 @@ function ProgressSteps({
|
|
|
319
441
|
index,
|
|
320
442
|
showNumber: showNumbers,
|
|
321
443
|
showTimestamp: showTimestamps,
|
|
322
|
-
isLast: index === steps.length - 1
|
|
444
|
+
isLast: index === steps.length - 1,
|
|
445
|
+
nextStep: steps[index + 1]
|
|
323
446
|
},
|
|
324
447
|
index
|
|
325
448
|
))
|
|
@@ -752,14 +875,23 @@ async function createSigner(privateKey, chainId, rpcUrl) {
|
|
|
752
875
|
8453: base,
|
|
753
876
|
43114: avalanche,
|
|
754
877
|
56: bsc,
|
|
755
|
-
// HyperEVM
|
|
878
|
+
// HyperEVM Mainnet
|
|
756
879
|
999: {
|
|
757
880
|
id: 999,
|
|
758
881
|
name: "HyperEVM",
|
|
759
|
-
nativeCurrency: { name: "
|
|
882
|
+
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
|
|
760
883
|
rpcUrls: {
|
|
761
884
|
default: { http: ["https://rpc.hyperliquid.xyz/evm"] }
|
|
762
885
|
}
|
|
886
|
+
},
|
|
887
|
+
// HyperEVM Testnet
|
|
888
|
+
998: {
|
|
889
|
+
id: 998,
|
|
890
|
+
name: "HyperEVM Testnet",
|
|
891
|
+
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
|
|
892
|
+
rpcUrls: {
|
|
893
|
+
default: { http: ["https://rpc.hyperliquid-testnet.xyz/evm"] }
|
|
894
|
+
}
|
|
763
895
|
}
|
|
764
896
|
};
|
|
765
897
|
const chain = chainMap[chainId];
|
|
@@ -795,7 +927,7 @@ async function createSigner(privateKey, chainId, rpcUrl) {
|
|
|
795
927
|
}
|
|
796
928
|
|
|
797
929
|
// src/commands/wizard.tsx
|
|
798
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
930
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
799
931
|
var initialState = {
|
|
800
932
|
step: "chain",
|
|
801
933
|
chain: null,
|
|
@@ -809,15 +941,60 @@ var initialState = {
|
|
|
809
941
|
executionStatus: ""
|
|
810
942
|
};
|
|
811
943
|
function NavigationHints({ step }) {
|
|
944
|
+
const Key = ({ children }) => /* @__PURE__ */ jsx8(Text8, { color: theme.borderLight, children: "[" });
|
|
945
|
+
const renderHint = (key, action, isLast = false) => /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
946
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.secondary, children: key }),
|
|
947
|
+
/* @__PURE__ */ jsxs8(Text8, { color: theme.muted, children: [
|
|
948
|
+
" ",
|
|
949
|
+
action
|
|
950
|
+
] }),
|
|
951
|
+
!isLast && /* @__PURE__ */ jsxs8(Text8, { color: theme.border, children: [
|
|
952
|
+
" ",
|
|
953
|
+
symbols.dot,
|
|
954
|
+
" "
|
|
955
|
+
] })
|
|
956
|
+
] });
|
|
812
957
|
const hints = {
|
|
813
|
-
chain:
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
958
|
+
chain: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
959
|
+
renderHint("\u2191\u2193", "Navigate"),
|
|
960
|
+
renderHint("Enter", "Select"),
|
|
961
|
+
renderHint("q", "Quit", true)
|
|
962
|
+
] }),
|
|
963
|
+
token: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
964
|
+
renderHint("\u2191\u2193", "Navigate"),
|
|
965
|
+
renderHint("Enter", "Select"),
|
|
966
|
+
renderHint("b", "Back"),
|
|
967
|
+
renderHint("q", "Quit", true)
|
|
968
|
+
] }),
|
|
969
|
+
amount: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
970
|
+
renderHint("0-9", "Type amount"),
|
|
971
|
+
renderHint("Enter", "Confirm"),
|
|
972
|
+
renderHint("b", "Back"),
|
|
973
|
+
renderHint("q", "Quit", true)
|
|
974
|
+
] }),
|
|
975
|
+
key: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
976
|
+
renderHint("Paste", "Private key"),
|
|
977
|
+
renderHint("Enter", "Confirm"),
|
|
978
|
+
renderHint("b", "Back"),
|
|
979
|
+
renderHint("q", "Quit", true)
|
|
980
|
+
] }),
|
|
981
|
+
confirm: /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
982
|
+
renderHint("Enter", "Execute bridge"),
|
|
983
|
+
renderHint("b", "Back"),
|
|
984
|
+
renderHint("q", "Quit", true)
|
|
985
|
+
] }),
|
|
986
|
+
execute: /* @__PURE__ */ jsxs8(Text8, { color: theme.muted, children: [
|
|
987
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.primary, children: symbols.active }),
|
|
988
|
+
" Processing transaction..."
|
|
989
|
+
] })
|
|
819
990
|
};
|
|
820
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ jsxs8(Box8, { marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: theme.border, children: [
|
|
992
|
+
/* @__PURE__ */ jsxs8(Text8, { color: theme.muted, children: [
|
|
993
|
+
symbols.pointer,
|
|
994
|
+
" "
|
|
995
|
+
] }),
|
|
996
|
+
hints[step]
|
|
997
|
+
] });
|
|
821
998
|
}
|
|
822
999
|
function StepIndicator({ currentStep }) {
|
|
823
1000
|
const steps = ["chain", "token", "amount", "key", "confirm", "execute"];
|
|
@@ -830,27 +1007,41 @@ function StepIndicator({ currentStep }) {
|
|
|
830
1007
|
execute: "Execute"
|
|
831
1008
|
};
|
|
832
1009
|
const currentIndex = steps.indexOf(currentStep);
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
/* @__PURE__ */ jsxs8(
|
|
1010
|
+
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginBottom: 1, children: [
|
|
1011
|
+
/* @__PURE__ */ jsx8(Box8, { marginBottom: 1, children: steps.map((step, index) => {
|
|
1012
|
+
const isActive = index === currentIndex;
|
|
1013
|
+
const isCompleted = index < currentIndex;
|
|
1014
|
+
const isLast = index === steps.length - 1;
|
|
1015
|
+
return /* @__PURE__ */ jsxs8(React3.Fragment, { children: [
|
|
1016
|
+
/* @__PURE__ */ jsx8(
|
|
1017
|
+
Text8,
|
|
1018
|
+
{
|
|
1019
|
+
color: isCompleted ? theme.success : isActive ? theme.primary : theme.muted,
|
|
1020
|
+
bold: isActive,
|
|
1021
|
+
children: isCompleted ? symbols.checkCircle : isActive ? symbols.diamondFilled : symbols.circleEmpty
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1024
|
+
!isLast && /* @__PURE__ */ jsx8(Text8, { color: isCompleted ? theme.success : theme.border, children: isCompleted ? "\u2501\u2501" : "\u2500\u2500" })
|
|
1025
|
+
] }, step);
|
|
1026
|
+
}) }),
|
|
1027
|
+
/* @__PURE__ */ jsx8(Box8, { children: steps.map((step, index) => {
|
|
1028
|
+
const isActive = index === currentIndex;
|
|
1029
|
+
const isCompleted = index < currentIndex;
|
|
1030
|
+
const isLast = index === steps.length - 1;
|
|
1031
|
+
const label = stepLabels[step];
|
|
1032
|
+
const paddedLabel = label.padEnd(isLast ? label.length : 5, " ");
|
|
1033
|
+
return /* @__PURE__ */ jsx8(
|
|
839
1034
|
Text8,
|
|
840
1035
|
{
|
|
841
1036
|
color: isActive ? theme.primary : isCompleted ? theme.success : theme.muted,
|
|
842
1037
|
bold: isActive,
|
|
843
1038
|
dimColor: !isActive && !isCompleted,
|
|
844
|
-
children:
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
),
|
|
851
|
-
/* @__PURE__ */ jsx8(Text8, { color: theme.muted, dimColor: true, children: separator })
|
|
852
|
-
] }, step);
|
|
853
|
-
}) });
|
|
1039
|
+
children: paddedLabel.slice(0, isLast ? void 0 : 5)
|
|
1040
|
+
},
|
|
1041
|
+
step
|
|
1042
|
+
);
|
|
1043
|
+
}) })
|
|
1044
|
+
] });
|
|
854
1045
|
}
|
|
855
1046
|
function ChainSelectionStep({
|
|
856
1047
|
onSelect,
|
|
@@ -2722,7 +2913,7 @@ function getHistory(limit = 10, address) {
|
|
|
2722
2913
|
}
|
|
2723
2914
|
|
|
2724
2915
|
// src/commands/history.tsx
|
|
2725
|
-
import { Fragment, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2916
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2726
2917
|
function formatDate(timestamp) {
|
|
2727
2918
|
return new Date(timestamp).toLocaleString("en-US", {
|
|
2728
2919
|
month: "2-digit",
|
|
@@ -2853,7 +3044,7 @@ function HistoryCommand({
|
|
|
2853
3044
|
entries.length !== 1 ? "s" : ""
|
|
2854
3045
|
] })
|
|
2855
3046
|
] }) }),
|
|
2856
|
-
entries.length === 0 ? /* @__PURE__ */ jsx14(EmptyState, { address }) : /* @__PURE__ */ jsxs14(
|
|
3047
|
+
entries.length === 0 ? /* @__PURE__ */ jsx14(EmptyState, { address }) : /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
2857
3048
|
/* @__PURE__ */ jsx14(
|
|
2858
3049
|
Table,
|
|
2859
3050
|
{
|
|
@@ -2890,7 +3081,7 @@ import {
|
|
|
2890
3081
|
Mina as Mina5,
|
|
2891
3082
|
getChains as getChains6
|
|
2892
3083
|
} from "@siphoyawe/mina-sdk";
|
|
2893
|
-
import { Fragment as
|
|
3084
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2894
3085
|
function truncateAddress2(address) {
|
|
2895
3086
|
if (address.length <= 14) return address;
|
|
2896
3087
|
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
@@ -3102,7 +3293,7 @@ function BalanceCommand({
|
|
|
3102
3293
|
borders.horizontal.repeat(boxWidth - 2),
|
|
3103
3294
|
borders.rightT
|
|
3104
3295
|
] }) }),
|
|
3105
|
-
!hasAnyBalances ? /* @__PURE__ */ jsx15(
|
|
3296
|
+
!hasAnyBalances ? /* @__PURE__ */ jsx15(Fragment4, { children: /* @__PURE__ */ jsxs15(Box15, { children: [
|
|
3106
3297
|
/* @__PURE__ */ jsx15(Text15, { color: theme.border, children: borders.vertical }),
|
|
3107
3298
|
/* @__PURE__ */ jsx15(Box15, { width: boxWidth - 2, justifyContent: "center", children: /* @__PURE__ */ jsx15(Text15, { color: theme.muted, children: "No balances found" }) }),
|
|
3108
3299
|
/* @__PURE__ */ jsx15(Text15, { color: theme.border, children: borders.vertical })
|