forked from TechGoku/Beldex-address-generator-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
29 lines (21 loc) · 837 Bytes
/
example.py
File metadata and controls
29 lines (21 loc) · 837 Bytes
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
from beldex.address import address ,Address, SubAddress, IntegratedAddress
def check_mainnet_address(addr_str):
try:
a = address(addr_str)
print("Address:", a)
print("Network:", a.net)
if isinstance(a, Address):
print("Type: Primary Address")
elif isinstance(a, SubAddress):
print("Type: Subaddress")
elif isinstance(a, IntegratedAddress):
print("Type: Integrated Address")
print("Payment ID:", a.payment_id())
print("Public Spend Key:", a.spend_key())
print("Public View Key:", a.view_key())
except Exception as e:
print("❌ Invalid Beldex address")
print("Error:", e)
if __name__ == "__main__":
user_input = input("Enter Beldex address: ").strip()
check_mainnet_address(user_input)