-
Notifications
You must be signed in to change notification settings - Fork 0
/
findCoolWallet.html
71 lines (51 loc) · 1.71 KB
/
findCoolWallet.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
---
layout: default
---
<div class="container">
<h1>Find a cool wallet</h1>
<div class="form-group row">
<label for="str1" class="col-sm-2 col-form-label">String 1</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="str1" value="" required>
</div>
</div>
<div class="form-group row">
<label for="str2" class="col-sm-2 col-form-label">String 2</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="str2" value="" required>
</div>
</div>
<hr/>
<button id="startButton" class="btn btn-primary btn-lg" type="button">Start</button>
<div id="consoleDiv"></div>
</div>
{% include jquery.html %}
<script type="module">
import { Wallet } from "./assets/ethers-5.4.esm.min.js";
async function findCoolWallet() {
let count = 0
let found = false
let wallet
while (!found) {
count++
wallet = Wallet.createRandom()
if (String(wallet.address).endsWith($("#str1").val()) ||
String(wallet.address).endsWith($("#str2").val()) ||
String(wallet.address).startsWith($("#str1").val()) ||
String(wallet.address).startsWith($("#str2").val())
) {
found = true
}
$("#consoleDiv").html("<p>" + count + " " + wallet.address + " " + wallet.privateKey + "</p>")
await new Promise(resolve => setTimeout(resolve, 100)) // Wait .1 seconds each time
}
$("#consoleDiv").html("<p>Tried", count, "wallet(s) - Last one:<br/>" +
wallet.address + " " + wallet.privateKey + "<br/>" +
wallet.mnemonic + "</p>")
}
$(document).ready(function() {
$("#startButton").click(function() {
findCoolWallet()
});
});
</script>