-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
473 lines (443 loc) · 19.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AirGap.it - Offline Ethereum Signer</title>
<link rel="stylesheet" href="./static/styles/bulma.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.modal-background {
background-color: grey;
}
.identicon {
width: 100%;
height: auto;
padding-bottom: 100%;
background-size: cover;
background-repeat: no-repeat;
border-radius: 50%;
-webkit-box-shadow: inset hsla(0, 0%, 100%, .5) 0 2px 2px, inset rgba(0, 0, 0, .6) 0 -1px 8px;
box-shadow: inset 0 2px 2px hsla(0, 0%, 100%, .5), inset 0 -1px 8px rgba(0, 0, 0, .6);
}
::placeholder {
color: rgba(0, 0, 0, .2);
}
.navbar-brand > .navbar-item {
padding-left: 0;
}
</style>
</head>
<body>
<nav class="navbar ">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="#">
<img src="./static/images/airgap_logo.png" height="28">
</a>
<div class="navbar-menu">
<div class="navbar-start">
<a href="#" class="navbar-item">
Signer
</a>
</div>
<div class="navbar-end">
<a href="#" class="navbar-item" onclick="showModal('disclaimer_modal')">
Disclaimer
</a>
</div>
</div>
</div>
</div>
</nav>
<section class="section">
<div class="container">
<h1 class="title">AirGap.it - Offline Ethereum Transaction Signer</h1>
<h2 class="subtitle">
An opensource easy to review Ethereum transaction signer. Intended to be used for air-gapped setups.
</h2>
<br/>
<form id="transaction_form">
<div class="media">
<figure class="media-left">
<p class="image is-64x64">
<img class="identicon" id="to_identicon">
</p>
</figure>
<div class="media-content">
<div class="content">
<label class="label">To Address</label>
<div class="field has-addons">
<p class="control is-expanded">
<input required pattern="0x[0-9a-fA-F]{40}" id="tx_to_address" class="input"
type="text"
placeholder="0x77A562Df2B17E8b0aa78571597a78b32D7d5c86E">
<span id="tx_to_address_error" class="help is-danger" style="display:none;">This address is invalid</span>
</p>
<p class="control">
<a id="startScan" class="button is-info" onclick="startScan()"
style="display:table;margin: 0 auto;">Scan QR</a>
</p>
</div>
</div>
</div>
</div>
<br/>
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Amount to Send</label>
<div class="field has-addons">
<p class="control is-expanded">
<input required id="tx_amount" class="input" type="number" placeholder="0.01"
step="any">
</p>
<p class="control">
<a class="button is-static">
ETH
</a>
</p>
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">Gas Limit</label>
<p class="control">
<input required id="tx_gas_limit" class="input" type="number" placeholder="21000"
value="21000">
</p>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">Gas Price</label>
<p class="control">
<div class="select is-fullwidth">
<select id="tx_gasprice_selector">
<option value="1">1 GWEI (slower)</option>
<option value="5">5 GWEI (slow)</option>
<option selected value="10">10 GWEI (normal)</option>
<option value="20">20 GWEI (fast)</option>
<option value="40">40 GWEI (faster)</option>
</select>
</div>
</p>
</div>
</div>
</div>
<div class="field">
<label class="label">Nonce</label>
<div class="field has-addons">
<p class="control is-expanded">
<input required id="tx_nonce" class="input" type="number" placeholder="1">
</p>
</div>
</div>
<div class="field">
<label class="label">Data (optional)</label>
<p class="control">
<input pattern="0x[0-9a-fA-F]*" id="tx_data" class="input" type="text"
placeholder="0x61697267611702e697420726f636b7321">
</p>
</div>
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Wallet Unlock Method</label>
<p class="control">
<div class="select">
<select id="unlock_selector">
<option selected disabled value="">-- Select Option --</option>
<option value="keystore_unlock">Keystore File (UTC / JSON)</option>
<option value="private_key_unlock">Private Key</option>
<option value="mnemonic_unlock">Mnemonic Phrase</option>
</select>
</div>
</p>
</div>
</div>
<div class="column">
<div id="mnemonic_unlock" class="unlock_method" style="display: none">
<div class="field">
<label class="label">Mnemonic Code</label>
<p class="control">
<textarea id="mnemonic_unlock_mnemonic" class="textarea required_unlock_field"
placeholder="elbow lobster slab upper vacant mutual punch sponsor glow faith custom neglect sell announce awkward"></textarea>
</p>
</div>
<label class="label">Derivation Path</label>
<p class="control">
<input id="mnemonic_unlock_derivation_path" class="input required_unlock_field"
type="text"
placeholder="m/44'/60'/0'/0/0"
value="m/44'/60'/0'/0/0">
</p>
<label class="label">Passphrase (optional)</label>
<p class="control">
<input id="mnemonic_unlock_passphrase" class="input" type="password"
placeholder="a secret passphrase">
</p>
</div>
<div id="private_key_unlock" class="unlock_method" style="display: none">
<div class="field">
<label class="label">Private Key</label>
<p class="control">
<textarea id="private_key_unlock_key" class="textarea required_unlock_field"
placeholder="0x395f32eea9d43817764e91ba32684369c59506d6a46ef4fbf4460fb501e76694"></textarea>
</p>
</div>
</div>
<div id="keystore_unlock" class="unlock_method" style="display: none">
<div class="field">
<label class="label">Keystore File (UTC / JSON)</label>
<p class="control">
<input class="input required_unlock_field" type="file" id="keystore_unlock_file">
</p>
</div>
<label class="label">Passphrase (optional)</label>
<p class="control">
<input class="input" type="password" placeholder="a secret passphrase"
id="keystore_unlock_passphrase">
</p>
</div>
</div>
</div>
<div class="block">
<button type="submit" id="generate_and_sign_button" class="button is-primary" onsubmit=""
style="display: none">Generate and Sign
</button>
</div>
</form>
</div>
</section>
<div id="error_modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Error</p>
<button class="delete" onclick="dismissModal('error_modal')"></button>
</header>
<section class="modal-card-body">
<span id="error_message"></span>
<!-- Content ... -->
</section>
<footer class="modal-card-foot">
<a class="button" onclick="dismissModal('error_modal')">Cancel</a>
</footer>
</div>
</div>
<div id="confirm_modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Your Signed Transaction</p>
</header>
<section class="modal-card-body">
<div class="columns is-fullwidth">
<div class="column">
<p class="image is-64x64">
<img class="identicon" id="from_identicon_confirm">
</p>
</div>
<div class="column has-text-centered">
<large>→</large>
<br>
<large>Amount: <strong><span id="amount_confirm"></span></strong> ETH</large>
<br>
<small>Fee: <strong><span id="fee_confirm"></span></strong> ETH</small>
</div>
<div class="column">
<p class="image is-64x64 is-pulled-right">
<img class="identicon" id="to_identicon_confirm">
</p>
</div>
</div>
<div class="columns">
<div class="column is-half is-offset-one-quarter">
<figure class="image is-square">
<img id="qr_holder" src="#">
</figure>
</div>
</div>
</section>
<footer class="modal-card-foot">
<a class="button" onclick="dismissModal('confirm_modal')">Cancel</a>
<a class="button" onclick="donate()">Donate</a>
</footer>
</div>
</div>
<div id="qr_modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Scan QR</p>
<button class="delete" onclick="stopScan()"></button>
</header>
<video id="preview" style="height:400px;width:100%;"></video>
</div>
</div>
<div id="disclaimer_modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Disclaimer</p>
<button class="delete" onclick="dismissModal('disclaimer_modal')"></button>
</header>
<section class="modal-card-body">
<p>
Be safe & secure: We highly recommend that you read our guide on How to Prevent Loss & Theft for
some
recommendations on how to be proactive about your security.
</p>
<p>
Always backup your keys on paper: AirGap is not using any form of persistence, if you forget to
write
down
your keys, they're gone forever. There's no going back.
</p>
<p>
We are not responsible for any loss: Ethereum, AirGap.it Signer and AirGap.it Broadcaster, and some
of
the
underlying
Javascript libraries we use are under active development. While we have thoroughly tested & tens of
thousands of
wallets have been successfully created by people all over the globe, there is always the possibility
something
unexpected happens that causes your funds to be lost. Please do not invest more than you are willing
to
lose, and
please be careful.
</p>
<p>
Translations of AirGap.it: The community has done an amazing job translating AirGap.it into a
variety of
languages. However, AirGap.it can only verify the validity and accuracy of the information provided
in
English
and, because of this, the English version of our website is the official text.
</p>
<p>
MIT License Copyright © 2017 AirGap.it
</p>
<p>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated
documentation files (the "Software"), to deal in the Software without restriction, including without
limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software,
and
to
permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the
Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT
LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL
THE
AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT,
TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE
SOFTWARE.
</p>
</section>
<footer class="modal-card-foot">
<a class="button" onclick="dismissModal('disclaimer_modal')">OK</a>
</footer>
</div>
</div>
<div id="donate_modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Help us</p>
<button class="delete" onclick="dismissModal('donate_modal')"></button>
</header>
<section class="modal-card-body">
<p>
Make a gift to support our effort in developing free and open source software. Through the generosity of
people like you, our work can make a difference.
</p>
<br/>
<div class="field">
<label class="label">Amount to Donate</label>
<div class="field has-addons">
<p class="control is-expanded">
<input required id="amount_donate" value="0.1" class="input" type="number" placeholder="0.01">
</p>
<p class="control">
<a class="button is-static">
ETH
</a>
</p>
</div>
</div>
<div class="field">
<label class="label">Nonce</label>
<div class="field has-addons">
<p class="control is-expanded">
<input required id="nonce_donate" class="input" type="number" placeholder="1">
</p>
</div>
</div>
<figure class="image is-square">
<img id="qr_donate_holder" src="#">
</figure>
</section>
</div>
</div>
<div id="qr_not_supported" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">QR Scanner not supported</p>
<button class="delete" onclick="dismissModal('qr_not_supported')"></button>
</header>
<section class="modal-card-body">
<p>
Scanning QR codes is not supported by your browser. Please use Chrome or Firefox to use this feature.
</p>
</section>
</div>
</div>
<div id="file_protocol_detected" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">File protocol detected</p>
<button class="delete" onclick="dismissModal('file_protocol_detected')"></button>
</header>
<section class="modal-card-body">
<p>
Due to security restrictions, browsers do not allow camera access when opening html files directly. You need to start a small
server to serve this file. Please read our readme on how to do that.
</p>
<p>
If you have already started the server, make sure you access this page over
<a href="http://localhost:8000">http://localhost:8000</a> (or whatever port your server uses) rather
than the <b>file://</b> protocol.
</p>
</section>
</div>
</div>
<script src="static/bundle.js"></script>
<footer class="footer">
<div class="container">
<div class="content has-text-centered">
<p>
<strong>AirGap.it</strong> v.1.0.2. The source code is licensed MIT.
</p>
</div>
</div>
</footer>
</body>
</html>