mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-19 13:18:13 +02:00
QRCode coder and Donations
This commit is contained in:
parent
364f84fac2
commit
be5a3fdf10
1 changed files with 45 additions and 0 deletions
45
donation.py
Normal file
45
donation.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import requests
|
||||
import qrcode
|
||||
|
||||
|
||||
= qrcode.QRCode(
|
||||
version=1,
|
||||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||||
box_size=10,
|
||||
border=4,
|
||||
)
|
||||
|
||||
|
||||
def donationPN():
|
||||
url = 'PM8TJbSH9iCPZ2bz9D7MTHpaCnT35Pm4kfJ6gRccoKmMjz5qsQ6rBWpBRCnJHMpTo8kc5K2SF4MADA9f4uKwc5iC8A3FtKJc7eb5wFDF3vcuSfneaC15'
|
||||
qr.add_data(url)
|
||||
qr.print_ascii()
|
||||
print("PayNym: " + url)
|
||||
|
||||
def donationAddr():
|
||||
url = 'bc1qf5c88chttajazrlwudt7x9xx5u0qf8y2lguj62'
|
||||
qr.add_data(url)
|
||||
qr.print_ascii()
|
||||
print("Bitcoin Address Bech32: " + url)
|
||||
|
||||
def donationLN():
|
||||
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('"')
|
||||
qr.add_data(ln1)
|
||||
qr.print_ascii()
|
||||
print("LND Invoice: " + ln1)
|
||||
|
||||
def decodeQR():
|
||||
url = input("Insert your Bitcoin Address to show the QRCode: ")
|
||||
qr.add_data(url)
|
||||
qr.print_ascii()
|
||||
print("Bitcoin Address: " + url)
|
||||
Loading…
Add table
Add a link
Reference in a new issue