forked from ameba23/mmt-metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
278 lines (261 loc) · 10.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Better Multisig Wallet</title>
<link rel="stylesheet" href="./assets/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/css/jquery-ui.min.css">
<style>
/* TODO: put this somewhere else */
.invisible {
display: none;
}
.incompleteUnfilled {
display: none;
}
.paymentsUnfilled {
display: none;
}
.addressesUnfilled {
display: none;
}
.requestsUnfilled {
display: none;
}
#payTo {
width: 400px;
}
</style>
<!-- Insert this line above script imports -->
<script>
delete module.exports
</script>
<script src="./assets/scripts/jquery-3.3.1.min.js"></script>
<script src="./assets/scripts/jquery-ui.min.js"></script>
<!-- normal script imports etc -->
<script>
// TODO: put this somewhere else
$(function() {
$( "#tabs" ).tabs();
});
function backToTables() {
$('#transactionDetails').attr("class","invisible")
$('#transactionTables').attr("class","visible")
}
function displayNumCosigners(value) {
$('#displayNumCosigners').text(value)
$('#inputRequiredCosigners').attr("max",value)
displayCosignerFields(value)
}
function displayCosignerFields(num) {
//$("#chooseCosignerSection").html($(".chooseCosigner").clone())
for (var i = 1; i <= num; i++){
// $(".chooseCosigner").clone()
// .find(".cosignerNumber")
// .text(i)
// .end()
// .find(".chooseCosignerKey")
// .attr("name",i)
// .attr("class", "chooseCosignerKeyReady")
// .end()
// .attr("class","chooseCosignerReady")
// .insertAfter(".chooseCosigner")
$("#chooseCosigner"+i).attr("class","visible")
}
for (var i = 7; i > (num); i--) $("#chooseCosigner"+i).attr("class","invisible")
}
function displayReqCosigners(value) {
$('#displayReqCosigners').text(value)
}
</script>
</head>
<body>
<div id="root">
<div class = "container">
<h1>better multisig wallet</h1>
<div id="notifications"></div>
<div id="initiateWallet" class="invisible">
<p>Wallet name : <input type="text" name="inputWalletName" id="inputWalletName"></p>
<p>Number cosigners:
<input type="range" id="inputNumberCosigners" max="7" min="1" value="3" oninput="displayNumCosigners(this.value)" onchange="displayNumCosigners(this.value)"><span id="displayNumCosigners">3</span></p>
<p>Required cosigners:
<input type="range" id="inputRequiredCosigners" max="7" min="1" value="2" oninput="displayReqCosigners(this.value)" onchange="displayReqCosigners(this.value)"><span id="displayReqCosigners">2</span></p>
<div id="chooseCosignerSection">
<div id="chooseCosigner1" class = "visible">Choose cosigner <span class = "cosignerNumber">1</span>: <input id="chooseCosignerKey1" ></div>
<div id="chooseCosigner2" class = "visible">Choose cosigner <span class = "cosignerNumber">2</span>: <input id="chooseCosignerKey2" ></div>
<div id="chooseCosigner3" class = "visible">Choose cosigner <span class = "cosignerNumber">3</span>: <input id="chooseCosignerKey3" ></div>
<div id="chooseCosigner4" class = "invisible">Choose cosigner <span class = "cosignerNumber">4</span>: <input id="chooseCosignerKey4"></div>
<div id="chooseCosigner5" class = "invisible">Choose cosigner <span class = "cosignerNumber">5</span>: <input id="chooseCosignerKey5"></div>
<div id="chooseCosigner6" class = "invisible">Choose cosigner <span class = "cosignerNumber">6</span>: <input id="chooseCosignerKey6"></div>
<div id="chooseCosigner7" class = "invisible">Choose cosigner <span class = "cosignerNumber">7</span>: <input id="chooseCosignerKey7"></div>
</div>
<button id="initiateWalletConfirm">Initiate Wallet</button>
</div>
<div id="sharePubKey" class="invisible">
<button>Share public key with cosigners</button>
<button id="ignoreInvitation"> Ignore invitation</button>
</div>
<div id="everythingElse">
<div id="walletInfo">
<div id="needSsbInfo">
<b><span id="walletName"></span></b> -
<span id="requiredCosigners"></span> of <span id="numberCosigners"></span> signatures required.
</div>
Confirmed balance: <span class="balance"></span> BTC
<p>Cosigners: <span id="displayCosigners"></span></p>
</div>
<div id="tabs">
<ul>
<li><a href="#history">Transactions</a></li>
<li><a href="#send">Send</a></li>
<li><a href="#recieve">Recieve</a></li>
<li><a href="#addresses">Addresses</a></li>
<li><a href="#coins">Coins</a></li>
<li><a href="#contacts">Contacts</a></li>
</ul>
<div id="history">
<div id="transactionTables" class="visible">
<h3> Incomplete transactions </h3>
<table class = "table">
<thead>
<tr>
<th> Date </th>
<th> Initiated by </th>
<th> Cosigners </th>
<th> Description and comments </th>
<th> Rate </th>
<th> Amount </th>
<th> Recipient(s) </th>
<th> Options </th>
</tr>
</thead>
<tbody id="incompleteTbody">
<tr class="incompleteUnfilled">
<td class="date"></td>
<td class="initiatedBy"></td>
<td class="cosigners"></td>
<td class="comment"></td>
<td class="rate"></td>
<td class="amount"></td>
<td class="recipients"></td>
<td class="options">
<button class="details">Details</button>
</td>
</tr>
</tbody>
</table>
<h3> Broadcast transactions </h3>
<table class = "table">
<thead>
<tr>
<th> Date </th>
<th> Cosigners </th>
<th> Description and comments </th>
<th> Rate </transactionComment>
<th> Amount </th>
<th> Confirmations </th>
<th> Recipient(s) </th>
<th> Options </th>
</tr>
</thead>
<tbody id="paymentsTbody">
<tr class="paymentsUnfilled">
<td class="date"></td>
<td class="cosigners"></td>
<td class="comment"></td>
<td class="rate"></td>
<td class="amount"></td>
<td class="confirmations"></td>
<td class="recipients"></td>
<td class="options">
<button class="details">Details</button>
</td>
</tr>
</tbody>
</table>
</div>
<div id="transactionDetails" class="invisible">
<h5> Details for transaction <span id="txid"></span> </h5>
<p> Amount <span id="transactionDetailsAmount"></span> </p>
<p> Status: <span id="status"></span> </p>
<p> Initiated by: <span id="initiatedBy"></span></p>
<p> Signed by: <span id="signedBy"></span></p>
<p> Outputs: <span id="outputs"></span></p>
<p> Comments: <span id="comments"></span></p>
<p> Add a comment: <input type="text" name="addTransactionComment" id="addTransactionComment" ></p>
<span id="signButton"></span>
<button id="addComment">Add comment</button>
<button id="toTable" onclick='backToTables()'>Back to other transactions</button>
</div>
</div>
<div id="send">
<p>Balance available: <span class="balance"></span> BTC</p>
<p>Pay to: <input type="text" name="payTo" id="payTo" ></p>
<p>Amount: <input type="text" name="sendAmount" id="sendAmount" ></p>
<p>Description: <input type="text" name="sendComment" id="sendComment" ></p>
<button id="createTransaction">Create transaction</button>
<p><span id="sendVerifyErrors"></span></p>
</div>
<div id="recieve">
<p> Recieve address: <span id="recieveAddress"></span><button id="addressToClipboard">Copy to clipboard</button></p>
<div id="qrCode"></div>
<p> Memo <input type="text" name="memo" id="memo" oninput='' ></p>
<p> Requested Amount (optional) <input type="text" name="requestedAmount" id="requestedAmount" oninput=''></p>
<p> Expires: (drop down box?) </p>
<button id="recieveMemo">Save memo to recieve address</button>
<br><br>
<h4> Existing requests: </h4>
<table class = "table">
<thead>
<tr>
<th> Address </th>
<th> Memo </th>
</tr>
</thead>
<tbody id="requestsTbody">
<tr class="requestsUnfilled">
<td class="address"></td>
<td class="memo"></td>
</tr>
</tbody>
</table>
</div>
<div id="addresses">
<table class = "table">
<thead>
<tr>
<th> Address </th>
<th> Amount </th>
<th> Comments </th>
</tr>
</thead>
<tbody id="addressesTbody">
<tr class="addressesUnfilled">
<td class="address"></td>
<td class="amount"></td>
<td class="comments"></td>
</tr>
</tbody>
</table>
</div>
<div id="coins">
<p>coming soon</p>
</div>
<div id="contacts">
<p>coming soon</p>
</div>
</div>
</div>
</div>
</div>
<script>
var Client = require('ssb-client')
var config = require('./config')()
var App = require('./app/')
Client(config.keys, config, (err, server) => {
if (err) return console.error(err)
App(document.getElementById('root'), server)
})
</script>
</body>
</html>