mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-17 13:07:17 +02:00
'Refactored by Sourcery'
This commit is contained in:
parent
29232e5850
commit
caeaa8b72d
1 changed files with 13 additions and 12 deletions
|
|
@ -1875,14 +1875,14 @@ def OpenNodecreatecharge():
|
|||
selection = input("Select a FIAT currency: ")
|
||||
amt = input(f"Amount in {selection}: ")
|
||||
curl = (
|
||||
'curl https://api.opennode.co/v1/charges -X POST -H '
|
||||
+ f'"Authorization: {b}"'
|
||||
f'curl https://api.opennode.co/v1/charges -X POST -H "Authorization: {b}"'
|
||||
+ ' -H "Content-Type: application/json" -d '
|
||||
+ "'{"
|
||||
+ f'"amount": "{amt}", "currency": "{selection.upper()}"'
|
||||
+ "}'"
|
||||
)
|
||||
|
||||
|
||||
sh = os.popen(curl).read()
|
||||
clear()
|
||||
blogo()
|
||||
|
|
@ -1890,9 +1890,9 @@ def OpenNodecreatecharge():
|
|||
d = json.loads(n)
|
||||
dd = d['data']
|
||||
qq = dd['lightning_invoice']
|
||||
pp = dd['address']
|
||||
nn = qq['payreq']
|
||||
mm = nn.lower()
|
||||
pp = dd['address']
|
||||
while True:
|
||||
try:
|
||||
print("\n----------------------------------------------------------------------------------------------------")
|
||||
|
|
@ -1911,8 +1911,8 @@ def OpenNodecreatecharge():
|
|||
if pay in ["I", "i"]:
|
||||
node_not = input("Do you want to pay this invoice 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 = {"ip_port":"", "tls":"", "macaroon":"", "ln":""}
|
||||
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
|
||||
if lndconnectload['ip_port']:
|
||||
print("\nInvoice: " + mm + "\n")
|
||||
|
|
@ -1933,7 +1933,7 @@ def OpenNodecreatecharge():
|
|||
qr.print_ascii()
|
||||
print("\033[0;37;40m")
|
||||
qr.clear()
|
||||
print("\nAmount in sats: {} sats".format(dd['amount']))
|
||||
print(f"\nAmount in sats: {dd['amount']} sats")
|
||||
print("\nOnchain Address: " + pp)
|
||||
input("\nContinue...")
|
||||
clear()
|
||||
|
|
@ -1943,14 +1943,14 @@ def OpenNodecreatecharge():
|
|||
elif fiat in ["N", "n"]:
|
||||
amt = input("Amount in sats: ")
|
||||
curl = (
|
||||
'curl https://api.opennode.co/v1/charges -X POST -H'
|
||||
+ f'"Authorization: {b}"'
|
||||
f'curl https://api.opennode.co/v1/charges -X POST -H"Authorization: {b}"'
|
||||
+ ' -H "Content-Type: application/json" -d '
|
||||
+ "'{"
|
||||
+ f'"amount": "{amt}", "currency": "BTC"'
|
||||
+ "}'"
|
||||
)
|
||||
|
||||
|
||||
sh = os.popen(curl).read()
|
||||
clear()
|
||||
blogo()
|
||||
|
|
@ -1959,8 +1959,8 @@ def OpenNodecreatecharge():
|
|||
dd = d['data']
|
||||
qq = dd['lightning_invoice']
|
||||
nn = qq['payreq']
|
||||
pp = dd['address']
|
||||
mm = nn.lower()
|
||||
pp = dd['address']
|
||||
while True:
|
||||
try:
|
||||
print("\n----------------------------------------------------------------------------------------------------")
|
||||
|
|
@ -2001,7 +2001,7 @@ def OpenNodecreatecharge():
|
|||
qr.print_ascii()
|
||||
print("\033[0;37;40m")
|
||||
qr.clear()
|
||||
print("\nAmount in sats: {} sats".format(dd['amount']))
|
||||
print(f"\nAmount in sats: {dd['amount']} sats")
|
||||
print("\nOnchain Address: " + pp)
|
||||
input("\nContinue...")
|
||||
clear()
|
||||
|
|
@ -2970,10 +2970,11 @@ def getPoolSlushCheck():
|
|||
s = n
|
||||
|
||||
if s > sq:
|
||||
newblock = "\a\n\n\t\t\u001b[31;1m New Block Mined \u001b[38;5;27m{}\u001b[31;1m! \u001b[38;5;202mFresh sats for you!\033[0;37;40m".format(s)
|
||||
sq = s
|
||||
newblock = f"\a\n\n\t\t\u001b[31;1m New Block Mined \u001b[38;5;27m{s}\u001b[31;1m! \u001b[38;5;202mFresh sats for you!\033[0;37;40m"
|
||||
|
||||
sq = s
|
||||
else:
|
||||
newblock = s
|
||||
newblock = s
|
||||
|
||||
clear()
|
||||
blogo()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue