@@ -16,6 +16,12 @@ const coin = ref("btc");
1616const showOnDevice = ref (true );
1717const account = ref <HardwareAccount | null >(null );
1818
19+ const quickStart = [
20+ " Connect your OneKey over WebUSB" ,
21+ " Choose a derivation path" ,
22+ " Confirm the address on-device" ,
23+ ];
24+
1925async function connect() {
2026 error .value = " " ;
2127 status .value = " connecting" ;
@@ -42,47 +48,67 @@ async function fetchAddress() {
4248 </script >
4349
4450<template >
45- <div class =" mx-auto max-w-3xl" >
46- <div class =" mb-6" >
47- <p class =" text-xs uppercase tracking-widest text-ecash-500" >OneKey integration</p >
48- <h2 class =" mt-1 text-2xl font-bold" >Hardware Wallet</h2 >
49- <p class =" mt-2 max-w-2xl text-sm text-gray-400" >
50- Connect a OneKey device, derive addresses, and verify receive details
51- directly on your hardware wallet.
52- </p >
53- </div >
54-
55- <div class =" grid gap-4 lg:grid-cols-[1.2fr_0.8fr]" >
56- <section class =" rounded-xl border border-gray-800 bg-gray-900 p-5" >
57- <div class =" flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" >
58- <div >
59- <h3 class =" font-semibold text-white" >{{ wallet.name }} Device</h3 >
60- <p class =" mt-1 text-xs text-gray-500" >
61- Chromium + HTTPS or localhost · WebUSB required
62- </p >
51+ <div class =" mx-auto max-w-5xl" >
52+ <section class =" rounded-2xl border border-gray-800 bg-gray-900 p-5" >
53+ <div class =" flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between" >
54+ <div >
55+ <p class =" text-xs uppercase tracking-widest text-ecash-500" >OneKey integration</p >
56+ <h2 class =" mt-1 text-3xl font-black" >Hardware Wallet</h2 >
57+ <p class =" mt-2 max-w-2xl text-sm leading-6 text-gray-400" >
58+ Verify receive addresses directly on your OneKey device and prepare
59+ for higher-assurance signing workflows across the Drivechains
60+ Financial Hub.
61+ </p >
62+ </div >
63+
64+ <div class =" rounded-xl border border-gray-800 bg-gray-950 p-4 lg:w-72" >
65+ <p class =" text-xs uppercase tracking-widest text-gray-500" >Device status</p >
66+ <div class =" mt-3 flex items-center justify-between" >
67+ <span class =" text-sm font-semibold text-white" >{{ wallet.name }}</span >
68+ <span
69+ class =" rounded-full px-3 py-1 text-xs font-semibold"
70+ :class =" {
71+ 'bg-gray-800 text-gray-400': status === 'idle',
72+ 'bg-yellow-900 text-yellow-300': status === 'connecting',
73+ 'bg-ecash-900 text-ecash-400': status === 'connected',
74+ 'bg-red-900 text-red-300': status === 'error',
75+ }"
76+ >
77+ {{ status }}
78+ </span >
6379 </div >
64- <span
65- class =" rounded-full px-3 py-1 text-xs font-semibold"
66- :class =" {
67- 'bg-gray-800 text-gray-400': status === 'idle',
68- 'bg-yellow-900 text-yellow-300': status === 'connecting',
69- 'bg-ecash-900 text-ecash-400': status === 'connected',
70- 'bg-red-900 text-red-300': status === 'error',
71- }"
80+ <button
81+ class =" mt-4 w-full rounded-lg bg-ecash-500 px-4 py-2 text-sm font-semibold text-gray-950 hover:bg-ecash-400 disabled:opacity-40"
82+ :disabled =" status === 'connecting'"
83+ @click =" connect"
7284 >
73- {{ status }}
74- </span >
85+ {{ status === "connected" ? "Reconnect OneKey" : "Connect OneKey" }}
86+ </button >
7587 </div >
88+ </div >
89+ </section >
90+
91+ <section class =" mt-5 grid gap-4 md:grid-cols-3" >
92+ <div
93+ v-for =" (item, i) in quickStart"
94+ :key =" item"
95+ class =" rounded-xl border border-gray-800 bg-gray-900 p-4"
96+ >
97+ <span class =" flex h-8 w-8 items-center justify-center rounded-full bg-ecash-600 text-sm font-black text-white" >
98+ {{ i + 1 }}
99+ </span >
100+ <p class =" mt-3 text-sm font-semibold text-white" >{{ item }}</p >
101+ </div >
102+ </section >
103+
104+ <section class =" mt-5 grid gap-5 lg:grid-cols-[1.1fr_0.9fr]" >
105+ <div class =" rounded-xl border border-gray-800 bg-gray-900 p-5" >
106+ <h3 class =" font-semibold text-white" >Address verification</h3 >
107+ <p class =" mt-1 text-xs text-gray-500" >
108+ Chromium + HTTPS or localhost · WebUSB required
109+ </p >
76110
77- <button
78- class =" mt-5 rounded-lg bg-ecash-500 px-4 py-2 text-sm font-semibold text-gray-950 hover:bg-ecash-400 disabled:opacity-40"
79- :disabled =" status === 'connecting'"
80- @click =" connect"
81- >
82- {{ status === "connected" ? "Reconnect OneKey" : "Connect OneKey" }}
83- </button >
84-
85- <div v-if =" status === 'connected'" class =" mt-6 space-y-4 rounded-lg border border-gray-800 bg-gray-950 p-4" >
111+ <div class =" mt-5 space-y-4 rounded-lg border border-gray-800 bg-gray-950 p-4" >
86112 <label class =" block text-xs uppercase tracking-wide text-gray-500" >
87113 Derivation path
88114 <input
@@ -106,6 +132,7 @@ async function fetchAddress() {
106132
107133 <button
108134 class =" rounded border border-gray-700 px-4 py-2 text-sm font-semibold text-gray-200 hover:bg-gray-800"
135+ :disabled =" status !== 'connected'"
109136 @click =" fetchAddress"
110137 >
111138 Show address
@@ -125,9 +152,9 @@ async function fetchAddress() {
125152 <p v-if =" error" class =" mt-4 text-sm text-red-400" data-test =" hw-error" >
126153 {{ error }}
127154 </p >
128- </section >
155+ </div >
129156
130- <aside class =" space-y-4 " >
157+ <div class =" space-y-5 " >
131158 <div class =" rounded-xl border border-gray-800 bg-gray-900 p-4" >
132159 <h3 class =" font-semibold text-white" >Basic hardware tools</h3 >
133160 <ul class =" mt-3 space-y-2 text-sm text-gray-400" >
@@ -148,7 +175,7 @@ async function fetchAddress() {
148175 ] "
149176 cta="Upgrade for hardware signing"
150177 />
151- </aside >
152- </div >
178+ </div >
179+ </section >
153180 </div >
154181</template >
0 commit comments