-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
194 lines (168 loc) · 9.09 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
<html>
<head>
<title>New Kind of Wallet | NKN Wallet</title>
<link rel="stylesheet" href="css/style.min.css">
<link rel="stylesheet" href="css/custom.css">
<link rel="shortcut icon" href="assets/favicon.ico">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<img src="assets/nknmesh.png" alt="image" class="nknmesh">
<div class="container" style="margin-top: 5%;">
<div class="row">
<div class="col hideonsmall"></div>
<div class="col-6">
<h2>New Kind of Wallet<span style="font-size:12;"> v0.1<span></h2>
<ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active show" data-toggle="tab" href="#create">New Wallet</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#transfer">Load Wallet</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#name">Name Service</a></li>
</ul>
<div class="tab-content">
<div id="create" class="tab-pane fade in active show">
<div class="form-group"><br>
<input type='password' class="form-control" name='cpass' placeholder="Password" id='cpass'><br>
<input type='text' class="form-control" maxlength="12" name='nknname' placeholder="NKN Name (optional)" id='nknname'>
</div>
<p>NOTE: You will lose access to your wallet if you misplace the wallet file or forget your password. Please backup your wallet file, then write down the password on a piece of paper or tree bark, and keep them in a safe place.</p>
<button type="button" class="btn btn-success" onclick="createNew()">Create Wallet</button><br>
<h5 id="newaddr"><button type="button" style="display: none;" class="copybtn btn-light hide" id="copybtn" data-container="body" data-toggle="popover" data-placement="right" data-content="Copied!" onclick="copyToClipboard('#genaddr')">
<i class="fa fa-copy"></i>
</button></h5>
<div class="alert alert-danger alert-dismissible fade hide" role="alert" id="namefail">
<strong>Name Registration Failed!</strong> Error:
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-success alert-dismissible fade hide" role="alert" id="namesuccess">
<strong>Name Registrtion Successful!</strong> Txhash:
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-success alert-dismissible fade hide" role="alert" id="nameinvalid">
<strong>Name Invalid!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
<div id="transfer" class="tab-pane fade">
<br>
<h5>Load</h5>
<p></p>
<form id="jsonFile" name="jsonFile" enctype="multipart/form-data" method="post">
<fieldset>
<label for="fileinput" class="btn btn-secondary custom-file-upload">
<i class="fa fa-wallet"></i> Select Wallet File
</label><br>
<input id="fileinput" type="file"/>
<div class="form-group">
<input type='password' class="form-control" name='pass' placeholder="Password" id='pass'>
</div>
<input class="btn btn-success" type='button' id='btnLoad' value='Unlock' onclick='loadFile()'> <button type="button" class="btn btn-light" onclick="getBalance()">Refresh Balance</button>
</fieldset>
</form>
<span class="loadaddr" role="alert" id="loadaddr"></span>
<h1 id="nkn_balance"></h1>
<br>
<div class="alert alert-danger alert-dismissible fade hide" role="alert" id="badpass">
<strong>Password Incorrect!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<h5>Send</h5>
<div class="form-group">
<label for="addr">Recipent</label>
<input type='text' class="form-control" name='addr' onkeyup="resolvebtn()" placeholder="NKN Address/NKN Name" id='addr'><br>
<button type="button" class="btn btn-light resolvebtn" id="resolvebtn" onclick="resolveSend()">Resolve</button>
<span id="sendaddr"></span>
</div>
<div class="form-group">
<label for="addr">Amount</label>
<input type='number' class="form-control" name='amount' placeholder="1000.00" id='amount'>
</div>
<button type="button" class="btn btn-success" onclick="transfer()">Transfer</button>
<br><br>
<div class="alert alert-success alert-dismissible fade hide" role="alert" id="txsuccess">
<strong>Transfer Successful!</strong> TxHash:
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-danger alert-dismissible fade hide" role="alert" id="txfail">
<strong>Transfer Failed!</strong> Error:
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
<div id="name" class="tab-pane fade">
<br>
<h5>Resolve</h5>
<div class="form-group"><br>
<input type='text' class="form-control" maxlength="12" name='resname' placeholder="NKN Name" id='resname'>
</div>
<button type="button" class="btn btn-success" onclick="getNameaddr()">Resolve</button><br><br>
<span id="resolvederr"></span>
<h5 id="resaddr"><br><span id='resolvedaddr'></span><button type="button" style="display: none;" class="copybtn btn-light hide" id="rescopybtn" data-container="body" data-toggle="popover" data-placement="right" data-content="Copied!" onclick="copyToClipboard('#resolvedaddr')">
<i class="fa fa-copy"></i>
</button></h5>
<h5>Register</h5>
<div class="form-group"><br>
<input type='text' class="form-control" maxlength="12" name='registername' placeholder="Name" id='registername'><br>
<input type='password' class="form-control" maxlength="12" name='registerpass' placeholder="Wallet Password" id='registerpass'>
</div>
<button type="button" class="btn btn-success" onclick="registerName()">Register</button>
<span id="registerloadwalletalert"></span>
<div class="alert alert-success alert-dismissible fade hide" role="alert" id="registersuccess">
<strong>Registration Successful!</strong> TxHash:
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-danger alert-dismissible fade hide" role="alert" id="registerfail">
<strong>Registration Failed!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<h5>Delete</h5>
<div class="form-group"><br>
<input type='password' class="form-control" maxlength="12" name='deletepass' placeholder="Wallet Password" id='deletepass'>
</div>
<button type="button" class="btn btn-success" onclick="deleteName()">Delete</button>
<span id="loadwalletalert"></span><br><br>
<div class="alert alert-success alert-dismissible fade hide" role="alert" id="deletesuccess">
<strong>Name Deleted!</strong> TxHash:
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-danger alert-dismissible fade hide" role="alert" id="deletefail">
<strong>Deletion Failed!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-success alert-dismissible fade hide" role="alert" id="resnameinvalid">
<strong>Name Invalid!</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
</div>
<div class="col hideonsmall"></div>
</div>
</div>
<script src="js/nkn-wallet.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/script.js"></script>
</body>
</html>