forked from muXxer/recover-iota-seed-from-ledger-mnemonics
-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_addresses_from_seed.py
63 lines (49 loc) · 1.73 KB
/
create_addresses_from_seed.py
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
# -*- coding: utf-8 -*-
from six.moves import input
from iota.crypto.addresses import AddressGenerator
#===============================================================================
def InputSeed():
print("\nPlease enter your seed:")
try:
return input(" IOTA Seed: ")
except KeyboardInterrupt:
return None
#===============================================================================
def InputIndex():
print("\nPlease enter address start index:")
try:
return input(" Address start index: ")
except KeyboardInterrupt:
return None
#===============================================================================
def InputAddressAmount():
print("\nPlease enter the amount of addresses to generate:")
try:
return input(" Address amount: ")
except KeyboardInterrupt:
return None
#===============================================================================
def CreateAddress():
print("\nWelcome to IOTA addresses generator!")
seed = InputSeed()
if seed == None:
return
index = InputIndex()
if index == None:
return
index = int(index)
amount = InputAddressAmount()
if amount == None:
return
amount = int(amount)
generator = AddressGenerator(seed)
addresses = generator.get_addresses(start=index, count=amount, step=1)
offset = 0
for address in addresses:
print("\nYour Address #%d: %s" % (index+offset, address))
print("\n https://thetangle.org/address/%s" % (address))
offset += 1
print()
#===============================================================================
if __name__ == '__main__':
CreateAddress()