forked from snogcel/govobject-proposal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
757 lines (629 loc) · 36.9 KB
/
index.html
File metadata and controls
757 lines (629 loc) · 36.9 KB
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
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dash Governance Tools</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.1.0.js" integrity="sha256-slogkvB1K3VOkzAI8QITxV3VzpOnkeNVsKvtkYLMjfk=" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="bitcore-lib-dash.js"></script>
<script src="https://dev-test.dash.org:3001/socket.io/socket.io.js"></script>
<script type="text/javascript">
var Bitcore = require('bitcore-lib-dash');
var apiserversocket = 'https://dev-test.dash.org:3001/';
//number of days to have as buffer for proposal start date before jumping to next month
var bufferdays = 3;
var blockheight;
var progresstxt = "As of yet your transaction has 0 confirmations. We'll wait for 6 confirmations until you can submit your proposal. Waiting for new blocks to confirm...";
var gov = new Bitcore.GovObject.Proposal();
$(document).ready(function() {
$("#time").val(Math.floor((new Date).getTime() / 1000));
prepareTime();
$("#progresstxt").text(progresstxt);
$('#prepareProposal').click(function() {
copyToClipboard($(this).attr('id'));
});
$('#submitProposal').click(function() {
copyToClipboard($(this).attr('id'));
});
$('#feeTxid').focus(function() {
if ($(this).hasClass('validationError')) {
$(this).val('');
}
$(this).removeClass('validationError');
});
$('.createProposal input').focus(function() {
if ($(this).hasClass('validationError')) {
$(this).val('');
}
$(this).removeClass('validationError');
});
$('#btnPrepare').click(function() {
var proposal = new ProposalGenerator(gov);
var validProposal = proposal.validate();
if (validProposal) {
proposal.walletCommands();
proposal.transactionListener(proposal);
$('#btnEdit').click(function() {
proposal.createProposal();
});
$('#btnNew').click(function() {
proposal.resetProposal();
});
}
});
});
var ProposalGenerator = function(gov) {
this._mode = 'proposal';
this.gov = gov;
this.gov.network = 'livenet';
// proposal basic fields
this.gov.name = $('#name').val();
this.gov.url = $('#url').val();
this.gov.payment_address = $('#payment_address').val();
this.gov.payment_amount = parseFloat($('#payment_amount').val());
// format dates for govobject serialization
var start_epoch = $('#start_epoch');
var startdate = formattedDateForSuperblockHeight(start_epoch.val());
console.log('startdate: ' + startdate);
this.gov.start_epoch = (new Date(startdate) / 1000) || null;
var enddate = formattedDateForSuperblockHeight(start_epoch.val(),$('#end_epoch').val());
console.log('enddate: ' + enddate);
this.gov.end_epoch = (new Date(enddate) / 1000) || null;
// hidden elements
this.gov.type = parseInt($('#type').val());
};
ProposalGenerator.prototype.validate = function() {
try {
var gov = this.gov.serialize();
}
catch (e) {
switch(e.message) {
case 'Invalid Name':
console.log("error: invalid name");
$('#name').addClass('validationError');
$('#name').val("Invalid name. Please enter a name without spaces and weird characters. E.g. can use a '-' or '_' instead of a space.");
break;
case 'Invalid URL':
console.log("Error: invalid url");
$('#url').addClass('validationError');
$('#url').val("There is a formatting error in your URL. Did you forget the leading 'http://'?");
break;
case 'Invalid Payment Amount':
console.log("Error: invalid payment amount");
$('#payment_amount').addClass('validationError');
$('#payment_amount').val("Invalid payment amount. Please enter a number from 1 - 7500");
break;
case 'Invalid Timespan':
console.log("Error: invalid timespan");
$('#start_epoch, #end_epoch').addClass('validationError');
break;
case 'Invalid Start Date':
console.log("Error: invalid start date");
$('#start_epoch').addClass('validationError');
break;
case 'Invalid End Date':
console.log("Error: invalid end date");
$('#end_epoch').addClass('validationError');
break;
case 'Invalid Address':
console.log("Error: invalid address");
$('#payment_address').addClass('validationError');
$('#payment_address').val("Invalid Dash Address. Please just copy & paste from wallet.");
break;
default:
console.log(e);
break;
}
return false;
}
return true;
};
ProposalGenerator.prototype.walletCommands = function() {
var gov = this.gov;
var prepCommand = "gobject prepare "+$('#parentHash').val() + " " + $('#revision').val() +" " + $('#time').val() +" " + gov.serialize();
console.log(prepCommand);
$("textarea#prepareProposal").val(prepCommand);
if(this._mode == 'proposal') {
setFormEditable(true);
$('.walletCommands#walletCommandsHeader').removeClass('hidden');
$('.walletCommands#walletCommandsPrepare').removeClass('hidden');
$('.walletCommands#walletCommandsTx').removeClass('hidden');
//$('.walletCommands#walletCommandsProgress').removeClass('hidden');
//$('.walletCommands#walletCommandsSubmit').removeClass('hidden');
this._mode = 'command';
}
};
ProposalGenerator.prototype.createProposal = function() {
$('#feeTxid').val("");
$('#submitProposal').val("");
if(this._mode == 'command') {
setFormEditable(false);
$('.walletCommands#walletCommandsHeader').addClass('hidden');
$('.walletCommands#walletCommandsPrepare').addClass('hidden');
$('.walletCommands#walletCommandsTx').addClass('hidden');
$('.walletCommands#walletCommandsProgress').addClass('hidden');
$('.walletCommands#walletCommandsSubmit').addClass('hidden');
this._mode = 'proposal';
}
};
ProposalGenerator.prototype.resetProposal = function() {
$('.createProposal input').each(function() {
$(this).val('');
});
setFormEditable(true);
};
ProposalGenerator.prototype.transactionListener = function(proposal) {
$('#feeTxid').on('input', function() {
if ($(this).val().length > 0) {
var submitCommand = "gobject submit " + $('#parentHash').val() + " " + $('#revision').val() + " " + $('#time').val() + " " + proposal.gov.serialize() + " " + $(this).val();
console.log(submitCommand);
var txidfield = $('#feeTxid');
console.log('value entered: ' + txidfield.val());
$('textarea#submitProposal').val(submitCommand);
txidfield.change(function() {
// Check input( $( this ).val() ) for validity here
console.log('there is something wrong with your transaction ID: ' + $('#feeTxid').val() + ' Please copy and paste it here .');
txidfield.val('')
});
//some checks if feeTxid seems valid before we check the api
if (txidfield.val().length == 64) {
if (isAlphaNumeric(txidfield.val())) {
txidfield.unbind( "change" );
console.log('feeTxid seems good: ' + txidfield.val());
console.log("wait while we check the api!");
// first check if transactionid is already in api
$.getJSON(apiserversocket + 'insight-api-dash/tx/' + txidfield.val(), function(data) {
txidfield.attr("disabled", true);
$('.walletCommands#walletCommandsProgress').removeClass('hidden');
var txid = data.tx;
var confirmations = data.confirmations;
var conftxt;
var conftxt2;
var progbarval;
console.log('Transaction has ' + confirmations + ' confirmation(s)');
progbarval = 100/6*confirmations;
$("#progressbar").progressbar({value: progbarval})
.children('.ui-progressbar-value')
.html(progbarval.toPrecision(3) + '%')
.css("display", "block");
if (confirmations != 'undefined' && $.isNumeric(confirmations)) {
var socket = io(apiserversocket);
if (confirmations == 0) {
// we have to count the blocks and wait for 6 confirmations
console.log("we have to count the blocks and wait for 6 confirmations");
eventToListenTo = 'block';
room = 'inv';
socket.on('connect', function() {
// Join the room.
socket.emit('subscribe', room);
console.log("listening for '" + eventToListenTo + "' in '" + room + "'");
});
socket.on(eventToListenTo, function(data) {
console.log("New block received: " + data + " time: " + data.time);
blockhash = data;
// let's check if transaction is really in this block or not
if (confirmations == 0) {
$.getJSON(apiserversocket + 'insight-api-dash/txs/?block=' + blockhash, function(data) {
var txs = data.txs;
var found;
var numOfTxs = txs.length;
for (var i = 0; i < numOfTxs; i++) {
console.log('txs' + i + ': ' + txs[i].txid);
if (txs[i].txid == txidfield.val()) {
console.log('found tx!');
found = true;
}
}
if (found) {
console.log('all good. Count up confirmations.');
confirmations = confirmations + 1;
progbarval = 100/6*confirmations;
$("#progressbar").progressbar({value: progbarval})
.children('.ui-progressbar-value')
.html(progbarval.toPrecision(3) + '%')
.css("display", "block");
if (confirmations == 1) {
conftxt = 'confirmation';
conftxt2 = 'confirmations';
}
else if (confirmations == 5) {
conftxt = 'confirmations';
conftxt2 = 'confirmation';
}
else {
conftxt = 'confirmations';
conftxt2 = 'confirmations';
}
$("#progresstxt").text("Your transaction has " + confirmations + " " + conftxt + ". Waiting for " + (6 - confirmations) + " more " + conftxt2 + "...");
console.log('we have ' + confirmations + ' confirmations...');
}
else {
console.log('txid not in new block');
}
}).fail(function(jqXHR) {
if (jqXHR.status == 400) {
// there seems to be a problem with your feeTxid because txid is not found in api
console.log('block hash not found in api!');
} else {
console.log('There seems to be a problem with the api connection. Maybe endpoint resyncing?');
}
});
}
else {
// for the time being just count up the confirmations without confirming everytime if the transaction is still inside the previous blocks
confirmations = confirmations + 1;
progbarval = 100/6*confirmations;
if (confirmations == 1) {
conftxt = 'confirmation';
conftxt2 = 'confirmations';
}
else if (confirmations == 5) {
conftxt = 'confirmations';
conftxt2 = 'confirmation';
}
else {
conftxt = 'confirmations';
conftxt2 = 'confirmations';
}
$("#progresstxt").text("Your transaction has " + confirmations + " " + conftxt + ". Waiting for " + (6 - confirmations) + " more " + conftxt2 + "...");
console.log('we have ' + confirmations + ' confirmations...');
}
if (confirmations >= 6) {
progbarval = 100;
$("#progresstxt").text("Your transaction has " + confirmations + " confirmations. You can now submit the proposal.");
$('.walletCommands#walletCommandsSubmit').removeClass('hidden');
}
$("#progressbar").progressbar({value: progbarval})
.children('.ui-progressbar-value')
.html(progbarval.toPrecision(3) + '%')
.css("display", "block");
});
}
else if (confirmations > 0 && confirmations <= 5) {
// we have to count the blocks and wait for outstanding confirmations
console.log("we have to count the blocks and wait for outstanding confirmations");
eventToListenTo = 'block';
room = 'inv';
socket.on('connect', function() {
// Join the room.
socket.emit('subscribe', room);
console.log("listening for '" + eventToListenTo + "' in '" + room + "'");
});
socket.on(eventToListenTo, function(data) {
console.log("New block received: " + data + " time: " + data.time);
// for the time being just count up the confirmations without confirming everytime if the transaction is still inside the previous blocks
confirmations = confirmations + 1;
progbarval = 100/6*confirmations;
$("#progressbar").progressbar({value: progbarval})
.children('.ui-progressbar-value')
.html(progbarval.toPrecision(3) + '%')
.css("display", "block");
if (confirmations = 1) {
conftxt = 'confirmation';
conftxt2 = 'confirmations';
}
else if (confirmations = 5) {
conftxt = 'confirmations';
conftxt2 = 'confirmation';
}
else {
conftxt = 'confirmations';
conftxt2 = 'confirmations';
}
$("#progresstxt").text("Your transaction has " + confirmations + " " + conftxt + ". Waiting for " + (6 - confirmations) + " more " + conftxt2 + "...");
console.log('we have ' + confirmations + ' confirmations...');
if (confirmations >= 6) {
progbarval = 100;
$("#progressbar").progressbar({value: progbarval})
.children('.ui-progressbar-value')
.html(progbarval + '%')
.css("display", "block");
$('.walletCommands#walletCommandsSubmit').removeClass('hidden');
}
});
}
else {
// already reached 6 or more confirmations, so we can proceed
progbarval = 100;
$("#progressbar").progressbar({value: progbarval})
.children('.ui-progressbar-value')
.html(progbarval + '%')
.css("display", "block");
$("#progresstxt").text("Your transaction has " + confirmations + " confirmations. You can now submit the proposal.");
console.log("already reached 6 or more confirmations, so we can proceed");
$('.walletCommands#walletCommandsSubmit').removeClass('hidden');
}
}
else {
console.log('Something went terribly wrong. Faulty api data?');
txidfield.attr("disabled", false);
}
}).fail(function(jqXHR) {
if (jqXHR.status == 400) {
// there seems to be a problem with your feeTxid because txid is not found in api
console.log('problem with feeTxid! Ask for new input!');
alert("Check again and please enter your correct TxID!");
txidfield.attr("disabled", false);
} else {
txidfield.attr("disabled", false);
console.log('There seems to be a problem with the api connection');
}
});
}
else {
$('#feeTxid').addClass('validationError');
$('#feeTxid').val('Your transacton ID is invalid. It must be alphanumeric. Please just copy & paste from console.');
console.log("there is something wrong with your transaction ID. It must be alphanumeric!")
}
}
else {
$('#feeTxid').addClass('validationError');
$('#feeTxid').val('Your transacton ID is invalid. Please just copy & paste from console.');
console.log("there is something wrong with your transaction ID. It must be exactly 64 characters!")
}
}
else {
$('textarea#submitProposal').val('');
$('.walletCommands#walletCommandsSubmit').addClass('hidden');
}
});
};
prepareTime = function() {
$.getJSON(apiserversocket + "insight-api-dash/status?q=getinfo", function( data ) {
var timefield = $("#time");
timefield.val(Math.floor((new Date).getTime() / 1000));
console.log('time: ' + timefield.val());
blockheight = data.info.blocks;
console.log('network: ' + gov.network);
var budgetPaymentCycleBlocks = getBudgetPaymentCycleBlocks();
var nextsuperblock = Math.round(blockheight/budgetPaymentCycleBlocks) * budgetPaymentCycleBlocks;
var selectblock = nextsuperblock;
console.log('budgetPaymentCycleBlocks: ' + budgetPaymentCycleBlocks);
console.log('blockheight: ' + blockheight);
console.log('next superblock ' + nextsuperblock);
var optionsStart = [];
var optionsEnd = [];
var numOfSuperBlockDates = 12;
// Clear the options first
var start_epoch = $("#start_epoch");
var end_epoch = $("#end_epoch");
start_epoch.find("option").each(function(index, option) {
$(option).remove();
});
end_epoch.find("option").each(function(index, option) {
$(option).remove();
});
var blocksleft = nextsuperblock - blockheight;
for (i = 0; i < numOfSuperBlockDates; i ++)
{
var timeleft;
var blockdiff = nextsuperblock - blockheight;
var nextsuperblocktimestamp = $.now() + blockdiff * (2.6 * 60 * 1000);
var d = $.datepicker.formatDate('yy-mm-dd', new Date(nextsuperblocktimestamp));
if (i == 0) {
var daysleft = Math.round( blocksleft/554 * 10) / 10; // day rounded to one decimal
if (daysleft >= 2) {
timeleft = daysleft + ' days'
}
else {
timeleft = daysleft + ' day'
}
optionsStart.push("<option value='" + nextsuperblock + "'>block " + nextsuperblock + " in " + timeleft + " (" + d + ")</option>");
}
else {
if (i == 1) {
timeleft = '1 month';
}
else {
timeleft = i + ' months';
}
optionsStart.push("<option value='" + nextsuperblock + "'>block " + nextsuperblock + " in " + timeleft + " (" + d + ")</option>");
if (i == numOfSuperBlockDates - 1) {
timeleft = numOfSuperBlockDates + ' month';
nextsuperblock += budgetPaymentCycleBlocks;
}
}
nextsuperblock += budgetPaymentCycleBlocks;
}
start_epoch.append(optionsStart.join(""));
//populate budget cycle dropdown
for (i = 1; i < 100; i ++)
{
if (i == 1) {
optionsEnd.push("<option value='" + i + "'>one-time payment</option>");
}
else {
optionsEnd.push("<option value='" + i + "'>payment once a month for " + i + " months</option>");
}
}
end_epoch.append(optionsEnd.join(""));
//if next superblock is less than n (bufferdays) days (60*24*bufferdays/2.6) away, select next month's superblock by default so proposal has more time to be voted upon
if (selectblock - blockheight < (60*24*bufferdays/2.6)) {
selectblock += budgetPaymentCycleBlocks;
start_epoch.val(selectblock);
}
});
};
function setFormEditable(edit) {
$('.createProposal input').each(function() {
$(this).attr("disabled", edit);
});
$('.createProposal select').each(function() {
$(this).attr("disabled", edit);
});
if (edit === true) {
$('#btnPrepare').addClass('hidden');
$('#btnEdit').removeClass('hidden');
$('#btnNew').removeClass('hidden');
} else {
$('#btnPrepare').removeClass('hidden');
$('#btnEdit').addClass('hidden');
$('#btnNew').addClass('hidden');
}
}
var copyToClipboard = function(id) {
document.getElementById(id).select();
document.execCommand('copy');
};
getBudgetPaymentCycleBlocks = function() {
// Amount of blocks in a months period of time (using 2.6 minutes per) = (60*24*30)/2.6
if (gov.network == 'livenet') {
return 16616;
}
else {
//for testing purposes
return 50; //ten times per day
}
};
formattedDateForSuperblockHeight = function(startheight, months) {
months = months || 0;
var endheight;
var blockdiff;
if (months !== 0) {
endheight = (parseInt(startheight) + (getBudgetPaymentCycleBlocks()*months));
blockdiff = endheight - blockheight;
}
else {
blockdiff = startheight - blockheight;
}
var superblocktimestamp = $.now() + blockdiff * (2.6 * 60 * 1000);
return $.datepicker.formatDate('yy-mm-dd', new Date(superblocktimestamp));
};
function isAlphaNumeric(str) {
var code, i, len;
for (i = 0, len = str.length; i < len; i++) {
code = str.charCodeAt(i);
if (!(code > 47 && code < 58) && // numeric (0-9)
!(code > 64 && code < 91) && // upper alpha (A-Z)
!(code > 96 && code < 123)) { // lower alpha (a-z)
return false;
}
}
return true;
}
</script>
<style type="text/css">
textarea { background-color:#fafafa !important; }
#header { margin-top:2em; }
.createProposal { }
#createProposalHeader { margin-top:1em; }
#createProposalForm { margin-top:1em; }
.walletCommands { }
#walletCommandsHeader { margin-top:2em; }
#walletCommandsPrepare { margin-top:2em; }
#walletCommandsTx { margin-top:2em; }
#walletCommandsProgress { margin-top:2em; }
#walletCommandsSubmit { margin-top:2em; }
.validationError { background-color:#ffe6e6; }
</style>
</head>
<body>
<div class="col-xs-10 col-xs-offset-1">
<div class="row" id="header">
<div class="col-xs-12">
<h1>Dash Budget Proposal Generator</h1>
Generate budget proposal commands you can copy/paste into your Dash wallet to prepare a budget proposal and submit it to the network.
</div>
</div>
<div class="row createProposal" id="createProposalHeader">
<div class="col-xs-12">
<h2>Create a Proposal</h2>
Enter details for your proposal and click 'Create Proposal'. This will generate a command you can run in your local wallet to prepare the proposal at a cost of 0.33 Dash
</div>
</div>
<div class="row createProposal" id="createProposalForm">
<div class="col-xs-6">
<div class="form-group">
<label for="name">Proposal Name:</label>
<input type="text" class="form-control" id="name" value="" placeholder="proposal-name">
</div>
<div class="form-group">
<label for="url">Proposal Description URL:</label>
<input type="text" class="form-control" id="url" value="" placeholder="https://www.dashcentral.org/p/proposal-name">
</div>
<div class="form-group">
<label for="start_epoch">Proposal Start Date:</label>
<select name="start_epoch" class="form-control" id="start_epoch"></select>
</div>
<div type="submit" class="btn btn-primary" id="btnPrepare">Create Proposal</div>
<div type="submit" class="btn btn-primary hidden" id="btnEdit">Edit Proposal</div>
<div type="submit" class="btn btn-primary hidden" id="btnNew">New Proposal</div>
<div class="form-group" style="display:none;">
<label for="type">type:</label>
<input type="text" class="form-control" id="type" value="1" placeholder="1">
</div>
<div class="form-group" style="display:none;">
<label for="parentHash">parent-hash:</label>
<input type="text" class="form-control" id="parentHash" value="0" placeholder="0">
</div>
<div class="form-group" style="display:none;">
<label for="revision">revision:</label>
<input type="text" class="form-control" id="revision" value="1" placeholder="1">
</div>
<div class="form-group" style="display:none;">
<label for="time">Creation Time:</label>
<input type="text" class="form-control" id="time" value="" placeholder="">
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label for="payment_address">Payment Address:</label>
<input type="text" class="form-control" id="payment_address" value="" placeholder="">
</div>
<div class="form-group">
<label for="payment_amount">Monthly Payment Amount in Dash:</label>
<input type="text" class="form-control" id="payment_amount" value="" placeholder="0">
</div>
<div class="form-group">
<label for="end_epoch">Choose payment cycle:</label>
<select name="end_epoch" class="form-control" id="end_epoch"></select>
</div>
</div>
</div>
<div class="row walletCommands hidden" id="walletCommandsHeader">
<div class="col-xs-12">
<h2>Wallet Commands</h2>
</div>
</div>
<div class="row walletCommands hidden" id="walletCommandsPrepare">
<div class="col-xs-12">
<div class="form-group">
<label for="prepareProposal">Prepare-Proposal Command:</label>
<div>Paste this proposal command into your Dash wallet console to spend a Fee transaction of 0.33 DASH.</div>
<textarea readonly class="form-control" id="prepareProposal" rows="4" placeholder=""></textarea>
</div>
</div>
</div>
<div class="row walletCommands hidden" id="walletCommandsTx">
<div class="col-xs-12">
<div class="form-group">
<label for="feeTxid">Fee Transaction ID:</label>
<div>Paste the transaction ID returned by the wallet below to generate the final submit command.</div>
<input type="text" class="form-control" id="feeTxid" value="" placeholder="<fee-txid>">
</div>
</div>
</div>
<div class="row walletCommands hidden" id="walletCommandsProgress">
<div class="col-xs-12">
<div class="form-group">
<label for="feeTxid">Fee Transaction Progress:</label>
<div id="progresstxt">We'll wait for 6 confirmations. Waiting for new blocks to confirm...</div>
<div id="progressbar"></div>
</div>
</div>
</div>
<div class="row walletCommands hidden" id="walletCommandsSubmit">
<div class="col-xs-12">
<div class="form-group">
<label for="submitProposal">Submit Proposal Command:</label>
<div>Paste the Fee TX id to generate the proposal submit command. This is the final step and can be completed after 6 confirmations on the fee tx.</div>
<textarea readonly class="form-control" id="submitProposal" rows="4" placeholder=""></textarea>
</div>
</div>
</div>
</div>
</body>
</html>