-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdonation.py
More file actions
147 lines (140 loc) · 4.18 KB
/
donation.py
File metadata and controls
147 lines (140 loc) · 4.18 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
#Developer: Curly60e
#PyBLOCK its a clock of the Bitcoin blockchain.
#Version: 0.5.0
import requests
import qrcode
from nodeconnection import *
#Dev PayNym
def donationPN():
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
url = 'PM8TJbSH9iCPZ2bz9D7MTHpaCnT35Pm4kfJ6gRccoKmMjz5qsQ6rBWpBRCnJHMpTo8kc5K2SF4MADA9f4uKwc5iC8A3FtKJc7eb5wFDF3vcuSfneaC15'
print("\033[1;30;47m")
qr.add_data(url)
qr.print_ascii()
print("\033[0;37;40m")
qr.clear()
print("PayNym: " + url)
def donationAddr():
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
url = 'bc1qf5c88chttajazrlwudt7x9xx5u0qf8y2lguj62'
print("\033[1;30;47m")
qr.add_data(url)
qr.print_ascii()
print("\033[0;37;40m")
qr.clear()
print("Bitcoin Address Bech32: " + url)
#Dev LN
def donationLN():
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
url = 'https://api.tippin.me/v1/public/addinvoice/royalfield370'
response = requests.get(url)
responseB = str(response.text)
responseC = responseB
lnreq = responseC.split(',')
lnbc1 = lnreq[1]
lnbc1S = str(lnbc1)
lnbc1R = lnbc1S.split(':')
lnbc1W = lnbc1R[1]
ln = str(lnbc1W)
ln1 = ln.strip('"')
node_not = input("Do you want to pay this tip with your node? Y/n: ")
if node_not in ["Y", "y"]:
lndconnectload = {"ip_port":"", "tls":"", "macaroon":"", "ln":""}
lndconnectData = pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload['ip_port']:
print("\nInvoice: " + ln1 + "\n")
payinvoice()
elif lndconnectload['ln']:
print("\nInvoice: " + ln1 + "\n")
localpayinvoice()
elif node_not in ["N", "n"]:
print("\033[1;30;47m")
qr.add_data(ln1)
qr.print_ascii()
print("\033[0;37;40m")
print("LND Invoice: " + ln1)
qr.clear()
response.close()
#Tester Address
def donationAddrTst():
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
url = 'bc1qwtzwu2evtchkvnf3ey6520yprsyv7vrjvhula5'
print("\033[1;30;47m")
qr.add_data(url)
qr.print_ascii()
print("\033[0;37;40m")
qr.clear()
print("Bitcoin Address Bech32: " + url)
#Tester LN
def donationLNTst():
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
url = 'https://api.tippin.me/v1/public/addinvoice/__B__T__C__'
response = requests.get(url)
responseB = str(response.text)
responseC = responseB
lnreq = responseC.split(',')
lnbc1 = lnreq[1]
lnbc1S = str(lnbc1)
lnbc1R = lnbc1S.split(':')
lnbc1W = lnbc1R[1]
ln = str(lnbc1W)
ln1 = ln.strip('"')
node_not = input("Do you want to pay this tip with your node? Y/n: ")
if node_not in ["Y", "y"]:
lndconnectload = {"ip_port":"", "tls":"", "macaroon":"", "ln":""}
lndconnectData = pickle.load(open("blndconnect.conf", "rb")) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload['ip_port']:
print("\nInvoice: " + ln1 + "\n")
payinvoice()
elif lndconnectload['ln']:
print("\nInvoice: " + ln1 + "\n")
localpayinvoice()
elif node_not in ["N", "n"]:
print("\033[1;30;47m")
qr.add_data(ln1)
qr.print_ascii()
print("\033[0;37;40m")
print("LND Invoice: " + ln1)
qr.clear()
response.close()
def decodeQR():
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
url = input("Insert your Bitcoin Address to show the QRCode: ")
print("\033[1;30;47m")
qr.add_data(url)
qr.print_ascii()
print("\033[0;37;40m")
qr.clear()
print("Bitcoin Address: " + url)