mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-13 12:33:15 +02:00
- clock/data.py: add nosemgrep suppression on audited _cli subprocess call - clock/renderer.py: remove unreachable zen-mode check in heartbeat() - nodeconnection.py: extract _run_ln helper with nosemgrep suppression - SPV/spvblock.py: add nosemgrep suppression on audited subprocess calls Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8730 lines
286 KiB
Python
8730 lines
286 KiB
Python
#Developer: Curly60e
|
||
#Tester: __B__T__C__
|
||
#ℙ𝕪𝔹𝕃𝕆ℂ𝕂 𝕚𝕥𝕤 𝕒 𝔹𝕚𝕥𝕔𝕠𝕚𝕟 𝔻𝕒𝕤𝕙𝕓𝕠𝕒𝕣𝕕 𝕨𝕚𝕥𝕙 ℂ𝕪𝕡𝕙𝕖𝕣𝕡𝕦𝕟𝕜 𝕒𝕖𝕤𝕥𝕙𝕖𝕥𝕚𝕔.
|
||
|
||
import os
|
||
import os.path
|
||
import time as t
|
||
import psutil
|
||
import html2text
|
||
import qrcode
|
||
import random
|
||
import shlex
|
||
import xmltodict
|
||
import sys
|
||
import subprocess
|
||
import requests
|
||
import json
|
||
from imgterminal import createimagebitaxe
|
||
from cfonts import render, say
|
||
from clone import gitclone, satnode
|
||
from donation import donationAddr, donationPayNym, donationLN, donationAddrTst, donationLNTst, decodeQR
|
||
from feed import readFile
|
||
from logos import logoA, logoB, logoC
|
||
from sysinf import sysinfoDetail
|
||
from pblogo import blogo, tick, canceled
|
||
from apisnd import apisender, apisenderFile
|
||
from termcolor import colored, cprint
|
||
from terminal_matrix.matrix import doit
|
||
from PIL import Image
|
||
from robohash import Robohash
|
||
from pycoingecko import CoinGeckoAPI
|
||
from binascii import unhexlify
|
||
from embit import bip39
|
||
from embit.wordlists.bip39 import WORDLIST
|
||
from config import cfg
|
||
from log import get_logger
|
||
from shared.display import clear, close, sysinfo, rectangle, delay_print
|
||
from shared.formatting import get_ansi_color_code, get_color
|
||
from shared.ui import status_bar, show_error, loading
|
||
from shared.rich_ui import (
|
||
console, rich_status_bar, rich_header, rich_menu, rich_error, rich_prompt
|
||
)
|
||
logger = get_logger("SPV")
|
||
|
||
|
||
version = "4.0"
|
||
|
||
settings = {"gradient":"", "design":"block", "colorA":"green", "colorB":"yellow"}
|
||
settingsClock = {"gradient":"", "colorA":"green", "colorB":"yellow"}
|
||
|
||
def tmp():
|
||
t.sleep(15)
|
||
|
||
def counttxs():
|
||
try:
|
||
rr = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
rr.headers['Content-Type']
|
||
qs = rr.text
|
||
din = json.loads(qs)
|
||
an = din
|
||
bs = str(an)
|
||
a = bs
|
||
|
||
r = requests.get("https://mempool.space/api/mempool")
|
||
r.headers['Content-Type']
|
||
mempool_data = r.json()
|
||
s = mempool_data['count']
|
||
e = str(s)
|
||
n = int(s) / 10
|
||
nn = n
|
||
|
||
clear()
|
||
outputtxs = render(
|
||
f'{e} txs',
|
||
colors=['yellow', 'green'], # Usando colores predeterminados
|
||
align='center',
|
||
font='tiny',
|
||
)
|
||
|
||
print("\x1b[?25l" + outputtxs)
|
||
|
||
shq = int(n)
|
||
ss = str(rectangle(shq))
|
||
qq = ss.replace("None", "")
|
||
print(f"\033[A{qq}\033[A")
|
||
|
||
while True:
|
||
rr = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
rr.headers['Content-Type']
|
||
qs = rr.text
|
||
din = json.loads(qs)
|
||
an = din
|
||
bs = str(an)
|
||
a = bs
|
||
|
||
r = requests.get("https://mempool.space/api/mempool")
|
||
r.headers['Content-Type']
|
||
mempool_data = r.json()
|
||
s = mempool_data['count']
|
||
e = str(s)
|
||
n = int(s) / 10
|
||
nn = n
|
||
|
||
if int(e) > int(nn):
|
||
clear()
|
||
outputtxs = render(
|
||
f'{e} txs',
|
||
colors=['yellow', 'green'], # Usando colores predeterminados
|
||
align='center',
|
||
font='tiny',
|
||
)
|
||
print("\x1b[?25l" + outputtxs)
|
||
shq = int(n)
|
||
ss = str(rectangle(shq))
|
||
qq = ss.replace("None", "")
|
||
print(f"\033[A{qq}\033[A")
|
||
nn = e
|
||
|
||
current_block = requests.get('https://mempool.space/api/blocks/tip/height').text.strip()
|
||
if int(current_block) > int(qs):
|
||
print("\n\n\n")
|
||
output = render(current_block, colors=['yellow', 'green'], align='center', font='tiny')
|
||
print("\a\x1b[?25l" + output)
|
||
|
||
block_hash = requests.get('https://mempool.space/api/blocks/tip/hash').text.strip()
|
||
block_info = requests.get(f'https://mempool.space/api/block/{block_hash}').json()
|
||
tx_count = block_info.get('tx_count', 0)
|
||
|
||
outputtxs = render(f'{tx_count} txs', colors=['yellow', 'green'], align='center', font='tiny')
|
||
print("\x1b[?25l" + outputtxs)
|
||
sh = int(tx_count) / 10
|
||
shq = int(sh)
|
||
ss = str(rectangle(shq))
|
||
print(ss.replace("None", ""))
|
||
t.sleep(5)
|
||
|
||
if tx_count == 1:
|
||
try:
|
||
p = subprocess.Popen(['curl', 'https://ascii.live/forrest'])
|
||
p.wait(5)
|
||
except subprocess.TimeoutExpired:
|
||
p.kill()
|
||
|
||
print("\033[0;37;40m\x1b[?25l")
|
||
clear()
|
||
qs = current_block
|
||
nn = e
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
def blogo():
|
||
|
||
settings = cfg.settings
|
||
|
||
if settings["gradient"] == "grd":
|
||
output = render('PyBLOCK', gradient=[settings['colorA'], settings['colorB']], align='left', font=settings['design'])
|
||
else:
|
||
output = render('PyBLOCK', colors=[settings['colorA'], settings['colorB']], align='left', font=settings['design'])
|
||
|
||
print(output)
|
||
|
||
def tick():
|
||
print("""\033[1;32;40m
|
||
|
||
|
||
|
||
|
||
@
|
||
@
|
||
@
|
||
@@
|
||
@@
|
||
@@@
|
||
@@@ @@.
|
||
@@@@@@@
|
||
@@@@@@@@
|
||
@@@@
|
||
@@@@
|
||
@ @@@@
|
||
@@@@@@@@
|
||
@@@@@@@@
|
||
@@@
|
||
@@@
|
||
@@
|
||
@@
|
||
@
|
||
@
|
||
|
||
|
||
|
||
|
||
|
||
|
||
\033[0;37;40m""")
|
||
|
||
def canceled():
|
||
print(r"""
|
||
) ( (
|
||
( ( ( /( ( )\ ) )\ )
|
||
)\ )\ )\()) )\ ( (()/( ( (()/(
|
||
(((_)((((_)( ((_)\ (((_) )\ /(_)) )\ /(_))
|
||
)\___ )\ _ )\ _((_) )\___ ((_) (_)) ((_)(_))_
|
||
((/ __|(_)_\(_)| \| |((/ __|| __|| | | __|| \
|
||
| (__ / _ \ | .` | | (__ | _| | |__ | _| | |) |
|
||
\___|/_/ \_\ |_|\_| \___||___||____||___||___/
|
||
|
||
""")
|
||
|
||
|
||
|
||
def logoA():
|
||
print("""\n\n\033[1;33;40m
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*****@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@****************************#@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@***************************************@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@***********************************************@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@*****************************************************@@@@@@@@@@@@@
|
||
@@@@@@@@@@@***********************************************************@@@@@@@@@@
|
||
@@@@@@@@@****************************** *****************************@@@@@@@@
|
||
@@@@@@@******************************* *** ***********************@@@@@@
|
||
@@@@@@********************** .**** **** *************************@@@@@
|
||
@@@@*********************** ,* **************************@@@@
|
||
@@@**************************** ***************************@@
|
||
@@****************************** *. **********************#@
|
||
@@***************************** ******** *********************@
|
||
@****************************** *********** **********************
|
||
@***************************** *********** **********************
|
||
@***************************** ***********************
|
||
***************************** **************************
|
||
@*************************** ******** *************************
|
||
@*************************** ***********. ***********************
|
||
@********************* *** ************* ***********************
|
||
@@******************* ************ **********************@
|
||
@@******************** **********************@@
|
||
@@@************************** ,***********************@@
|
||
@@@@#*********************** *** *. **************************@@@@
|
||
@@@@@@********************* **** ***********************************@@@@@
|
||
@@@@@@@**************************** **********************************@@@@@@
|
||
@@@@@@@@@***************************************************************@@@@@@@@
|
||
@@@@@@@@@@@**********************************************************,@@@@@@@@@@
|
||
@@@@@@@@@@@@@@*****************************************************@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@***********************************************@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@***************************************@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@#***************************@@@@@@@@@@@@@@@@@@@@@@@@@@\033[0;37;40m
|
||
""")
|
||
|
||
def logoB():
|
||
print("""\n\n\033[1;33;40m
|
||
/////
|
||
////////////////////////////%
|
||
///////////////////////////////////////
|
||
///////////////////////////////////////////////
|
||
/////////////////////////////////////////////////////
|
||
///////////////////////////////////////////////////////////
|
||
////////////////////////////// /////////////////////////////
|
||
/////////////////////////////// /// ///////////////////////
|
||
////////////////////// .//// //// /////////////////////////
|
||
/////////////////////// */ //////////////////////////
|
||
//////////////////////////// *//////////////////////////
|
||
////////////////////////////// /. //////////////////////
|
||
///////////////////////////// //////// /////////////////////
|
||
////////////////////////////// //////////* //////////////////////
|
||
///////////////////////////// /////////// //////////////////////
|
||
///////////////////////////// ///////////////////////
|
||
///////////////////////////// */////////////////////////
|
||
/////////////////////////// //////// /////////////////////////
|
||
/////////////////////////// ///////////, ///////////////////////
|
||
///////////////////// /// ///////////// ///////////////////////
|
||
/////////////////// //////////// //////////////////////
|
||
//////////////////// //////////////////////
|
||
////////////////////////// *///////////////////////
|
||
%/////////////////////// /// /. //////////////////////////
|
||
///////////////////// //// ///////////////////////////////////
|
||
//////////////////////////// //////////////////////////////////
|
||
///////////////////////////////////////////////////////////////
|
||
//////////////////////////////////////////////////////////*
|
||
/////////////////////////////////////////////////////
|
||
///////////////////////////////////////////////
|
||
///////////////////////////////////////
|
||
%///////////////////////////
|
||
/////\033[0;37;40m
|
||
""")
|
||
|
||
def logoC():
|
||
print("""\n\n\033[1;33;40m
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@
|
||
@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@
|
||
@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@
|
||
@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&& &&&&&&&&&&&&&&&&&&&&&&&@@@@@@
|
||
@@@@@@&&&&&&&&&&&&&&&&&&&&&& *&&&& &&&& &&&&&&&&&&&&&&&&&&&&&&&&&@@@@@
|
||
@@@@&&&&&&&&&&&&&&&&&&&&&&& #& &&&&&&&&&&&&&&&&&&&&&&&&&&@@@@
|
||
@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&. %&&&&&&&&&&&&&&&&&&&&&&&&&&@@
|
||
@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &, &&&&&&&&&&&&&&&&&&&&&&@@
|
||
@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&. &&&&&&&& &&&&&&&&&&&&&&&&&&&&&@
|
||
@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&% &&&&&&&&&&&&&&&&&&&&&&
|
||
@&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&
|
||
@&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&
|
||
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& %&&&&&&&&&&&&&&&&&&&&&&&&&
|
||
@&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&
|
||
@&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&/ &&&&&&&&&&&&&&&&&&&&&&&
|
||
@&&&&&&&&&&&&&&&&&&&&& &&& &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&
|
||
@@&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@
|
||
@@&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@@
|
||
@@@&&&&&&&&&&&&&&&&&&&&&&&&&& %&&&&&&&&&&&&&&&&&&&&&&&@@
|
||
@@@@@&&&&&&&&&&&&&&&&&&&&&&& &&& &, &&&&&&&&&&&&&&&&&&&&&&&&&&@@@@
|
||
@@@@@@&&&&&&&&&&&&&&&&&&&&& &&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@
|
||
@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@
|
||
@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@
|
||
@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@\033[0;37;40m
|
||
""")
|
||
|
||
def gitclone():
|
||
url = "https://github.com/curly60e/satellite"
|
||
subprocess.run(["git", "clone", url])
|
||
os.makedirs("satellite/api/examples/.gnupg", exist_ok=True)
|
||
subprocess.run("gpg --full-generate-key --homedir satellite/api/examples/.gnupg", shell=True)
|
||
|
||
def satnode():
|
||
try:
|
||
subprocess.run("python3 satellite/api/examples/demo-rx.py &", shell=True)
|
||
t.sleep(5)
|
||
subprocess.run("python3 satellite/api/examples/api_data_reader.py --demo --plaintext ", shell=True)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
subprocess.run("ps -ef | grep api_data_reader.py | grep -v grep | awk '{print $2}' | xargs kill -9", shell=True)
|
||
subprocess.run("ps -ef | grep demo-rx.py | grep -v grep | awk '{print $2}' | xargs kill -9", shell=True)
|
||
|
||
def matrixsc():
|
||
if os.path.isdir('$HOME/pyblock/terminal_matrix'):
|
||
print("OK Pass")
|
||
else:
|
||
url = "https://github.com/curly60e/terminal_matrix.git"
|
||
subprocess.run(["git", "clone", url])
|
||
|
||
def main():
|
||
scriptpath = os.path.join(os.path.dirname(__file__), 'PyBlock.py')
|
||
subprocess.run(f"python3 {scriptpath}", shell=True)
|
||
|
||
|
||
if __name__ == "__main__":
|
||
typer.run(main)
|
||
|
||
|
||
def opreturnOnchainONLY():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"OP_RETURN Message", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
message = input("Message: ")
|
||
while len(message) > 70:
|
||
clear()
|
||
blogo()
|
||
print("Error! Only 80 characters allowed!")
|
||
message = input("\nMessage: ")
|
||
r = requests.post(
|
||
"https://opreturnbot.com/api/create",
|
||
json={"message": f"{message}...PyBLOCK"},
|
||
headers={"Content-Type": "application/json"},
|
||
timeout=15,
|
||
)
|
||
b = r.text
|
||
clear()
|
||
blogo()
|
||
print("\033[1;30;47m")
|
||
qr.add_data(b)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
print(f'LND Invoice: {b}')
|
||
qr.clear()
|
||
input("\nContinue...")
|
||
if lndconnectload['ln']:
|
||
invoiceN = b
|
||
invoice = invoiceN.lower()
|
||
lncli = " payinvoice "
|
||
lsd = subprocess.run(shlex.split(lndconnectload["ln"]) + ["decodepayreq", invoice], capture_output=True, text=True).stdout # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
lsd0 = str(lsd)
|
||
d = json.loads(lsd0)
|
||
url = f"https://opreturnbot.com/api/status/{d['payment_hash']}"
|
||
else:
|
||
cert_path = lndconnectload["tls"]
|
||
with open(lndconnectload["macaroon"], 'rb') as f:
|
||
macaroon = codecs.encode(f.read(), 'hex')
|
||
headers = {'Grpc-Metadata-macaroon': macaroon}
|
||
url = f'https://{lndconnectload["ip_port"]}/v1/payreq/{b}'
|
||
r = requests.get(url, headers=headers, verify=cert_path)
|
||
s = r.json()
|
||
url = f"https://opreturnbot.com/api/status/{s['payment_hash']}"
|
||
response = requests.get(url)
|
||
responseB = str(response.text)
|
||
responseC = responseB
|
||
clear()
|
||
blogo()
|
||
print("\nTransaction ID: " + responseC)
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def opreturn():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"OP_RETURN Message", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
message = input("Message: ")
|
||
while len(message) > 70:
|
||
clear()
|
||
blogo()
|
||
print("Error! Only 80 characters allowed!")
|
||
message = input("\nMessage: ")
|
||
r = requests.post(
|
||
"https://opreturnbot.com/api/create",
|
||
json={"message": f"{message}...PyBLOCK"},
|
||
headers={"Content-Type": "application/json"},
|
||
timeout=15,
|
||
)
|
||
b = r.text
|
||
clear()
|
||
blogo()
|
||
print("\033[1;30;47m")
|
||
qr.add_data(b)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
print(f'LND Invoice: {b}')
|
||
qr.clear()
|
||
input("\nContinue...")
|
||
if lndconnectload['ln']:
|
||
invoiceN = b
|
||
invoice = invoiceN.lower()
|
||
lncli = " payinvoice "
|
||
lsd = subprocess.run(shlex.split(lndconnectload["ln"]) + ["decodepayreq", invoice], capture_output=True, text=True).stdout # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
lsd0 = str(lsd)
|
||
d = json.loads(lsd0)
|
||
url = f"https://opreturnbot.com/api/status/{d['payment_hash']}"
|
||
else:
|
||
cert_path = lndconnectload["tls"]
|
||
with open(lndconnectload["macaroon"], 'rb') as f:
|
||
macaroon = codecs.encode(f.read(), 'hex')
|
||
headers = {'Grpc-Metadata-macaroon': macaroon}
|
||
url = f'https://{lndconnectload["ip_port"]}/v1/payreq/{b}'
|
||
r = requests.get(url, headers=headers, verify=cert_path)
|
||
s = r.json()
|
||
url = f"https://opreturnbot.com/api/status/{s['payment_hash']}"
|
||
response = requests.get(url)
|
||
responseB = str(response.text)
|
||
responseC = responseB
|
||
clear()
|
||
blogo()
|
||
print("\nTransaction ID: " + responseC)
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def opreturn_view():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"OP_RETURN Message", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("TX ID: ")
|
||
url2 = f'https://opreturnbot.com/api/view/{responseC}'
|
||
r = requests.get(url2)
|
||
r2 = str(r.text)
|
||
r3 = r2
|
||
clear()
|
||
blogo()
|
||
print("\nTransaction ID: " + responseC)
|
||
print(f'OP_RETURN Message: {r3}')
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def opretminer():
|
||
try:
|
||
conn = """curl -s 'https://bitcointicker.co/latestblocks/' | xargs --null | html2text | grep "Coinbase" -A 70 | tr -d '|' | grep -v "Coinbase" | grep '6.25'"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render(
|
||
"decoded coinbase", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
print(a)
|
||
input("")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#------------------------------------------------------------------
|
||
|
||
def bitaxeA(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Bitaxe Logs", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Your Bitaxe ip XXX.XXX.XXX.XXX: ")
|
||
url = f"http://{responseC}/api/ws"
|
||
try:
|
||
r = requests.get(url, timeout=10)
|
||
print(r.text)
|
||
except requests.RequestException as e:
|
||
print(f"Error connecting to Bitaxe: {e}")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def bitaxeB(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Bitaxe System", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Your Bitaxe ip XXX.XXX.XXX.XXX: ")
|
||
try:
|
||
r = requests.get(f"http://{responseC}/api/system/info", timeout=10)
|
||
a = json.dumps(r.json(), indent=2)
|
||
except requests.RequestException as e:
|
||
a = f"Error: {e}"
|
||
print("\nBitAxe ip: " + responseC)
|
||
print("\nSystem Info:\n" + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def bitaxeC(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Bitaxe Restart", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Your Bitaxe ip XXX.XXX.XXX.XXX: ")
|
||
try:
|
||
r = requests.post(f"http://{responseC}/api/system/restart", timeout=10)
|
||
a = r.text
|
||
except requests.RequestException as e:
|
||
a = f"Error: {e}"
|
||
print("\nBitAxe ip: " + responseC)
|
||
print("\nBitAxe Restarting:\n" + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#-----------------------------GAMES--------------------------------
|
||
#------------------------------------------------------------------
|
||
|
||
def gameroom():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
print("""
|
||
--------------------------------------
|
||
|
||
INITIATE ARCADE?
|
||
|
||
--------------------------------------
|
||
""".format(closed()))
|
||
input("\a\nContinue...")
|
||
conn = "ssh gameroom@bitreich.org"
|
||
subprocess.run(["ssh", "gameroom@bitreich.org"])
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#----------------------------------------------------------------------
|
||
|
||
#----------------------------------------------------------------------PhoenixSta
|
||
|
||
def callPhoenixLin():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Phoenix Linux", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
phoenix_url = "https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-linux-x64.zip"
|
||
if os.path.isdir('phoenixwallet'):
|
||
subprocess.run(["rm", "-rf", "phoenix-0.3.0-linux-x64.zip"], cwd="phoenixwallet")
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
else:
|
||
os.makedirs("phoenixwallet", exist_ok=True)
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
subprocess.run(["unzip", "-j", "phoenix-0.3.0-linux-x64.zip"], cwd="phoenixwallet")
|
||
clear()
|
||
blogo()
|
||
input("\a\nYou are going to launch your own Phoenix. Press Enter to Continue.")
|
||
input("\a\nDon't close this window to stay Online. Press Enter to Continue.")
|
||
input("\a\nOpen another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue.")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./phoenixd"], cwd="phoenixwallet")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callPhoenixWin():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Phoenix Windows", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
phoenix_url = "https://github.com/ACINQ/phoenixd/archive/refs/tags/v0.3.0.zip"
|
||
if os.path.isdir('phoenixwallet'):
|
||
subprocess.run(["rm", "-rf", "v0.3.0.zip"], cwd="phoenixwallet")
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
else:
|
||
os.makedirs("phoenixwallet", exist_ok=True)
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
subprocess.run(["unzip", "-j", "v0.3.0.zip"], cwd="phoenixwallet")
|
||
clear()
|
||
blogo()
|
||
input("\a\nYou are going to launch your own Phoenix. Press Enter to Continue.")
|
||
input("\a\nDon't close this window to stay Online. Press Enter to Continue.")
|
||
input("\a\nOpen another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue.")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./phoenixd"], cwd="phoenixwallet")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callPhoenixMacX64():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Phoenix MacOSX64", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
phoenix_url = "https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-macos-x64.zip"
|
||
if os.path.isdir('phoenixwallet'):
|
||
subprocess.run(["rm", "-rf", "phoenix-0.3.0-macos-x64.zip"], cwd="phoenixwallet")
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
else:
|
||
os.makedirs("phoenixwallet", exist_ok=True)
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
subprocess.run(["unzip", "-j", "phoenix-0.3.0-macos-x64.zip"], cwd="phoenixwallet")
|
||
clear()
|
||
blogo()
|
||
input("\a\nYou are going to launch your own Phoenix. Press Enter to Continue.")
|
||
input("\a\nDon't close this window to stay Online. Press Enter to Continue.")
|
||
input("\a\nOpen another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue.")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./phoenixd"], cwd="phoenixwallet")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callPhoenixMacARM():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Phoenix MacOSARM", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
phoenix_url = "https://github.com/ACINQ/phoenixd/releases/download/v0.3.0/phoenix-0.3.0-macos-arm64.zip"
|
||
if os.path.isdir('phoenixwallet'):
|
||
subprocess.run(["rm", "-rf", "phoenix-0.3.0-macos-arm64.zip"], cwd="phoenixwallet")
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
else:
|
||
os.makedirs("phoenixwallet", exist_ok=True)
|
||
subprocess.run(["wget", phoenix_url], cwd="phoenixwallet")
|
||
subprocess.run(["unzip", "-j", "phoenix-0.3.0-macos-arm64.zip"], cwd="phoenixwallet")
|
||
clear()
|
||
blogo()
|
||
input("\a\nYou are going to launch your own Phoenix. Press Enter to Continue.")
|
||
input("\a\nDon't close this window to stay Online. Press Enter to Continue.")
|
||
input("\a\nOpen another Terminal and Select Manage in the Phoenix Menu. Press Enter to Continue.")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./phoenixd"], cwd="phoenixwallet")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callPhoenix():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Manage your Phoenix", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./phoenix-cli", "--help"], cwd="phoenixwallet")
|
||
for _ in range(10):
|
||
responseC = input("\a\nType a command of the list: ")
|
||
subprocess.run(["./phoenix-cli"] + shlex.split(responseC), cwd="phoenixwallet") # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def wallPhoenix():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"PhoenixD Invoice Maker", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
responseC = input("Your PhoenixD Password: ")
|
||
responseD = input("Your Description: ")
|
||
responseE = input("Amount in Sats: ")
|
||
try:
|
||
r = requests.post(
|
||
"http://localhost:9740/createinvoice",
|
||
auth=("", responseC),
|
||
data={"description": responseD, "amountSat": responseE}
|
||
)
|
||
print(r.text)
|
||
except requests.RequestException as e:
|
||
print(f"Error creating invoice: {e}")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def wallPhoenixBOLT12():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"PhoenixD BOLT12 Maker", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
responseC = input("Your PhoenixD Password: ")
|
||
try:
|
||
r = requests.get("http://localhost:9740/getoffer", auth=("", responseC))
|
||
print(r.text)
|
||
except requests.RequestException as e:
|
||
print(f"Error getting offer: {e}")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
#----------------------------------------------------------------------PhoenixEnd
|
||
#-----------------------------Stats--------------------------------
|
||
|
||
def statsConn():
|
||
try:
|
||
conn = r"""curl -s https://www.bitcoinblockhalf.com/ | html2text | grep -E "Total" -A 10 | grep -v -E "\--" | tr -d '*' | tr -d '"' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("stats", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Stats--------------------------------
|
||
|
||
#-----------------------------Block Templates--------------------------------
|
||
|
||
def blockTmpConn():
|
||
try:
|
||
conn = """curl -s https://miningpool.observer/template-and-block | html2text | grep "Template and Block for" -A 13 """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("Templates and Blocks", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Block Templates--------------------------------
|
||
|
||
#-----------------------------Unspendable--------------------------------
|
||
|
||
def unspendableConn():
|
||
try:
|
||
conn = """curl -s https://get.txoutset.info/unspendable.csv """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("Bitcoin Unspendable", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Unspendable--------------------------------
|
||
|
||
def SHS():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render("SHS - Symbolic Hash Satoshi", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"python3 SHS.py", shell=True)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
#-----------------------------PGP--------------------------------
|
||
|
||
def pgpConn():
|
||
try:
|
||
conn = """curl -s https://web.archive.org/web/20110228054007/http://www.bitcoin.org/Satoshi_Nakamoto.asc"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render(
|
||
"pgp", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END PGP--------------------------------
|
||
|
||
#-----------------------------MT--------------------------------
|
||
def mtConn(): # here we convert the result of the command 'getblockcount' on a random art design
|
||
while True:
|
||
try:
|
||
conn = """curl -s 'https://blockchain.info/tobtc?currency=USD&value=1' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout.strip() # Leer y eliminar espacios en blanco
|
||
sats = a.lstrip('0.') # Eliminar ceros iniciales y el punto decimal
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("Moscow Time", colors=['yellow'], align='left', font='tiny')
|
||
outputT = render(f"{sats[:4]} sats", colors=['green'], align='left', font='tiny') # Mostrar solo los primeros 4 dígitos
|
||
print(output)
|
||
print(outputT)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def mtclock():
|
||
try:
|
||
conn = """curl -s 'https://blockchain.info/tobtc?currency=USD&value=1' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("Moscow Time", colors=['yellow'], align='left', font='tiny')
|
||
outputT = render(f"{a} sats", colors=['green'], align='left', font='tiny')
|
||
print(output)
|
||
print(outputT)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#-----------------------------END MT--------------------------------
|
||
|
||
#-----------------------------Satoshi--------------------------------
|
||
|
||
def satoshiConn():
|
||
try:
|
||
conn = """curl -s https://www.metzdowd.com/pipermail/cryptography/2009-January/014994.html | html2text | tail -n 82 | grep -v "Unsubscribe" | grep -v "Next message" | grep -v "Previous message"| grep -v "Messages sorted" | grep -v "More information" | grep -v "list]" """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render(
|
||
"𝐒𝐚𝐭𝐨𝐬𝐡𝐢 𝐍𝐚𝐤𝐚𝐦𝐨𝐭𝐨. 𝟎𝐱𝟏𝟖𝐂𝟎𝟗𝐄𝟖𝟔𝟓𝐄𝐂𝟗𝟒𝟖𝐀𝟏. 𝐃𝐄𝟒𝐄 𝐅𝐂𝐀𝟑 𝐄𝟏𝐀𝐁 𝟗𝐄𝟒𝟏 𝐂𝐄𝟗𝟔 𝐂𝐄𝐂𝐁 𝟏𝟖𝐂𝟎 𝟗𝐄𝟖𝟔 𝟓𝐄𝐂𝟗 𝟒𝟖𝐀𝟏.", colors=['green'], align='left', font='console'
|
||
)
|
||
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Satoshi--------------------------------
|
||
|
||
#-----------------------------Whale Alert--------------------------------
|
||
|
||
def whalalConn():
|
||
try:
|
||
api_key = os.environ.get("WHALE_ALERT_API_KEY", "")
|
||
if not api_key:
|
||
print("\n\033[1;31;40mSet WHALE_ALERT_API_KEY environment variable to use Whale Alert.\033[0;37;40m")
|
||
input("\nContinue...")
|
||
return
|
||
url = "https://api.whale-alert.io/v1/transactions"
|
||
params = {"api_key": api_key, "limit": 7, "min_value": 5000000, "currency": "btc"}
|
||
response = requests.get(url, params=params)
|
||
data = response.json()
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("whale alert", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
for tx in data.get("transactions", []):
|
||
blockchain = tx.get("blockchain", "unknown")
|
||
amount = tx.get("amount", 0)
|
||
amount_usd = tx.get("amount_usd", 0)
|
||
print(f" WHALE ALERT ₿ {amount} =${amount_usd:.0f}")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Whale Alert--------------------------------
|
||
#-----------------------------bwt.dev--------------------------------
|
||
|
||
def bwtConn():
|
||
try:
|
||
conn = "curl -s https://bwt.dev/banner.txt"
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END bwt.dev--------------------------------
|
||
#-----------------------------STARTBLOCKS--------------------------------
|
||
|
||
def allblocksConn():
|
||
try:
|
||
conn = """curl -s https://raw.githubusercontent.com/jlopp/bitcoin-blocks-by-mining-pool/master/blocks.csv """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("All Blocks", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------ENDBLOCKS--------------------------------
|
||
#-----------------------------STRLuxor--------------------------------
|
||
|
||
def luxorstats():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Luxor Pool", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('luxor'):
|
||
subprocess.run(["python3", "luxor.py", "--help"], cwd=os.path.join("luxor", "graphql-python-client"))
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("luxor", exist_ok=True)
|
||
subprocess.run(["git", "clone", "https://github.com/LuxorLabs/graphql-python-client.git"], cwd="luxor")
|
||
subprocess.run(["pip3", "install", "-r", "requirements3.txt"], cwd=os.path.join("luxor", "graphql-python-client"))
|
||
subprocess.run(["python3", "luxor.py", "--install-completion"], cwd=os.path.join("luxor", "graphql-python-client"))
|
||
clear()
|
||
blogo()
|
||
input("\a\nYou need to COPY the lines inside the file .env.example and create a NEW file .env with your Luxor API Key. Press Enter to Continue.")
|
||
input("\a\nOther way is this 2 commands: 1 - mv .env.example .env 2 - nano .env and paste your Luxor Api Key. Press Enter to Continue.")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
luxor_cwd = os.path.join("luxor", "graphql-python-client")
|
||
subprocess.run(["python3", "luxor.py", "--help"], cwd=luxor_cwd)
|
||
for _ in range(10):
|
||
responseC = input("\a\nType a command of the list: ")
|
||
subprocess.run(["python3", "luxor.py"] + shlex.split(responseC), cwd=luxor_cwd) # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
#-----------------------------ENDLuxor--------------------------------
|
||
|
||
#-----------------------------STRPickaxe--------------------------------
|
||
|
||
def PickaxeCon():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Foreman Pickaxe", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir('Pickaxe'):
|
||
print("...Follow the steps...")
|
||
else:
|
||
os.makedirs("Pickaxe", exist_ok=True)
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Your Foreman apiKey: ")
|
||
responseD = input("Your Foreman clientId: ")
|
||
subprocess.run(["curl", "https://tinyurl.com/service-install", "-Ls", "--output", "install.sh"], cwd="Pickaxe")
|
||
subprocess.run(["sudo", "bash", "install.sh", shlex.quote(responseD), shlex.quote(responseC)], cwd="Pickaxe")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#-----------------------------ENDPickaxe--------------------------------
|
||
#-----------------------------Dates--------------------------------
|
||
|
||
def datesConn():
|
||
try:
|
||
conn = """curl -s "https://bitcoinexplorer.org/fun" | html2text | grep "20" | grep -v -E "https" | grep -E " " | head -n 46 | tr -d '[' | tr -d ','"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("dates", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Dates--------------------------------
|
||
#-----------------------------Missing--------------------------------
|
||
|
||
def missingConn():
|
||
try:
|
||
conn = """curl -s https://miningpool.observer/missing/feed.xml | html2text | grep -v "link" | grep -v "https" | grep -v "Missing Transaction" """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("missing transactions", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Missing--------------------------------
|
||
#-----------------------------Quotes--------------------------------
|
||
|
||
def quotesConn():
|
||
try:
|
||
conn = """curl -s "https://bitcoinexplorer.org/api/quotes/all" | jq -C '.[]' | tr -d '{|}|]|,' | sed 's/text/Quote/g' | sed 's/speaker/By/g' | sed 's/url/Link/g' | sed 's/date/Date/g' | grep -v -E 'conQuote'"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("quotes", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Quotes--------------------------------
|
||
#-----------------------------Hashrate--------------------------------
|
||
|
||
def miningConn():
|
||
try:
|
||
conn = """curl -s "https://blockchain.info/q/hashrate" """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("hashrate", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END Hashrate--------------------------------
|
||
|
||
#-----------------------------Strings Dat--------------------------------
|
||
|
||
def decodeStrDat(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"strings", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Blk Dat: ").strip()
|
||
if not responseC.isdigit():
|
||
print("\n Invalid input. Must be a number.\n")
|
||
return
|
||
r = requests.get(f"https://bitcoinstrings.com/blk{responseC}.txt", timeout=15)
|
||
a = r.text
|
||
clear()
|
||
blogo()
|
||
print("\nBLK: " + responseC)
|
||
print("\nString: " + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------End Strings Dat--------------------------------
|
||
#---------------------------------ocean pool----------------------------------
|
||
|
||
def oceanH(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Ocean Hashrate", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Your Bitcoin Address: ").strip()
|
||
r = requests.get(f"https://ocean.xyz/data/csv/hashrates/worker/{responseC}", timeout=15)
|
||
a = r.text
|
||
print("\nAddress: " + responseC)
|
||
print("\nHashrate:\n" + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def oceanB(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Ocean Blocks", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
cmd = f"""curl -s 'https://ocean.xyz/data/json/blocksfound' | jq -C .[] """
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
print("\nBlocks:\n" + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def oceanE(): # show srings
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Ocean Earnings", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Your Bitcoin Address: ").strip()
|
||
r = requests.get(f"https://ocean.xyz/template/workers/earningscards?user={responseC}", timeout=15)
|
||
a = r.text
|
||
print("\nAddress: " + responseC)
|
||
print("\nEarnings:\n" + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#---------------------------------ocean pool end----------------------------------
|
||
#-----------------------------StatsLN--------------------------------
|
||
|
||
def stalnConn():
|
||
try:
|
||
conn = """curl -s 'https://1ml.com' | html2text | xargs -L 1 | grep -E "Number" -A 8"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render(
|
||
"lightning stats", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END StatsLN--------------------------------
|
||
#-----------------------------StatRanking--------------------------------
|
||
def ranConn():
|
||
try:
|
||
conn = """curl -s 'https://1ml.com/node?order=capacity&json=true' | jq -C '.[]' | xargs -L 1 | tr -d '{|}|]|,' | grep -v -E "last_update|color|noderank" | sed 's/alias/Node/g' | grep -v -E "addresses" | grep -E " " | sed 's/capacity/RANK/g'
|
||
"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("ranking", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#-----------------------------END Ranking--------------------------------
|
||
|
||
def trustednode():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
addv = """
|
||
---------------------------------------------------------------
|
||
|
||
REMEMBER TO INITIALIZE \033[1;35;40mTOR\033[0;37;40m ON THE SHELL
|
||
|
||
$ source torsocks on
|
||
|
||
---------------------------------------------------------------
|
||
|
||
"""
|
||
print(addv)
|
||
input("\a\nContinue...")
|
||
conn = "telnet cut45oarvxfvfydrjery6slyeca4zpal7tljygdt5bji7l3jsrrgwkad.onion 6023"
|
||
subprocess.run(conn, shell=True)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#-----------------------------END GAMES--------------------------------
|
||
|
||
#-----------------------------MINER POOL--------------------------------
|
||
|
||
def CroppedMinerComputer():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Bitcoin Miner", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('CroppedMiner'):
|
||
print("...Follow the steps...")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("CroppedMiner", exist_ok=True)
|
||
subprocess.run(["wget", "https://github.com/pooler/cpuminer/releases/download/v2.5.1/pooler-cpuminer-2.5.1-linux-x86_64.tar.gz"], cwd="CroppedMiner")
|
||
subprocess.run(["tar", "-xf", "pooler-cpuminer-2.5.1-linux-x86_64.tar.gz"], cwd="CroppedMiner")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Your Bitcoin Address: ")
|
||
responseD = input("Your Pass x: ")
|
||
responseE = input("Select your threads 2, 4, 6, 8, 10, ...: ")
|
||
subprocess.run(["./minerd", "-a", "sha256d", "-o", "stratum+tcp://pool.pyblock.xyz:4444", "-u", f"{responseC}.PyBLOCK", "-p", responseD, "-t", responseE], cwd="CroppedMiner")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def CroppedMinerRaspberry():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Bitcoin Miner", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('CroppedMiner'):
|
||
print("...Follow the steps...")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("CroppedMiner", exist_ok=True)
|
||
subprocess.run(["git", "clone", "https://github.com/jojapoppa/cpuminer-multi-arm.git"], cwd="CroppedMiner")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Your Bitcoin Address: ")
|
||
responseD = input("Your Pass x: ")
|
||
responseE = input("Select your threads 2, 4, 6, 8, 10, ...: ")
|
||
subprocess.run(["./cpuminer", "-a", "sha256d", "-o", "stratum+tcp://pool.pyblock.xyz:4444", "-u", f"{responseC}.PyBLOCK", "-p", responseD, "-t", responseE], cwd=os.path.join("CroppedMiner", "cpuminer-multi-arm"))
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------MINER POOL--------------------------------
|
||
|
||
#-----------------------------wttr.in--------------------------------
|
||
def wttrDataV1():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
weatherList = """
|
||
------------------------------------------------------------------------------------
|
||
|
||
|
||
|
||
\033[1;31;40m*\033[0;37;40m uruguay # city name
|
||
\033[1;31;40m*\033[0;37;40m ~Giza+pyramid # any location (+ for spaces)
|
||
\033[1;31;40m*\033[0;37;40m Москва # Unicode name of any location in any language
|
||
\033[1;31;40m*\033[0;37;40m muc # airport code (3 letters)
|
||
\033[1;31;40m*\033[0;37;40m @lightninghood.com # domain name
|
||
\033[1;31;40m*\033[0;37;40m 94107 # area codes
|
||
\033[1;31;40m*\033[0;37;40m -78.46,106.79 # GPS coordinates
|
||
\033[1;31;40m*\033[0;37;40m moon # Moon phase (add ,+US or ,+France for these cities)
|
||
\033[1;31;40m*\033[0;37;40m moon@2009-01-03 # Moon phase for the date (@2016-10-25)
|
||
|
||
PRESS \033[1;32;40mM\033[0;37;40m TO INSERT MORE DATA
|
||
|
||
------------------------------------------------------------------------------------
|
||
|
||
"""
|
||
print(weatherList)
|
||
selectData = input("Insert your data \033[1;31;40m*\033[0;37;40m : ")
|
||
if selectData in ['M', 'm']:
|
||
moreData = """
|
||
|
||
------------------------------------------------------------------------------------
|
||
Supported languages
|
||
|
||
ar af be ca da de el es et fr fa hi hu ia id it nb nl
|
||
oc pl pt-br ro ru tr th uk vi zh-cn zh-tw (supported)
|
||
|
||
------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------
|
||
Units
|
||
|
||
m # metric (SI) (used by default everywhere except US)
|
||
u # USCS (used by default in US)
|
||
M # show wind speed in m/s
|
||
|
||
------------------------------------------------------------------------------------
|
||
"""
|
||
print(moreData)
|
||
selectData2 = input("Insert your data \033[1;31;40m*\033[0;37;40m : ")
|
||
lang = input("Insert your language: ")
|
||
unit = input("Insert your metric units: ")
|
||
url = f"https://{lang}.wttr.in/{selectData2}?F&{unit}"
|
||
else:
|
||
url = f"https://wttr.in/{selectData}?F"
|
||
a = requests.get(url, headers={"User-Agent": "curl"}, timeout=15).text
|
||
clear()
|
||
blogo()
|
||
print(a)
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def wttrDataV2():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
weatherList = """
|
||
------------------------------------------------------------------------------------
|
||
|
||
|
||
|
||
\033[1;31;40m*\033[0;37;40m uruguay # city name
|
||
\033[1;31;40m*\033[0;37;40m ~Giza+pyramid # any location (+ for spaces)
|
||
\033[1;31;40m*\033[0;37;40m Москва # Unicode name of any location in any language
|
||
\033[1;31;40m*\033[0;37;40m muc # airport code (3 letters)
|
||
\033[1;31;40m*\033[0;37;40m @lightninghood.com # domain name
|
||
\033[1;31;40m*\033[0;37;40m 94107 # area codes
|
||
\033[1;31;40m*\033[0;37;40m -78.46,106.79 # GPS coordinates
|
||
|
||
PRESS \033[1;32;40mM\033[0;37;40m TO INSERT MORE DATA
|
||
|
||
------------------------------------------------------------------------------------
|
||
|
||
"""
|
||
print(weatherList)
|
||
selectData = input("Insert your data \033[1;31;40m*\033[0;37;40m : ")
|
||
if selectData in ['M', 'm']:
|
||
moreData = """
|
||
|
||
------------------------------------------------------------------------------------
|
||
Supported languages
|
||
|
||
ar af be ca da de el es et fr fa hi hu ia id it nb nl
|
||
oc pl pt-br ro ru tr th uk vi zh-cn zh-tw (supported)
|
||
|
||
------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------
|
||
Units
|
||
|
||
m # metric (SI) (used by default everywhere except US)
|
||
u # USCS (used by default in US)
|
||
M # show wind speed in m/s
|
||
|
||
------------------------------------------------------------------------------------
|
||
"""
|
||
print(moreData)
|
||
selectData2 = input("Insert your data \033[1;31;40m*\033[0;37;40m : ")
|
||
lang = input("Insert your language: ")
|
||
unit = input("Insert your metric units: ")
|
||
url = f"https://v2.wttr.in/{selectData2}?{unit}&F&lang={lang}"
|
||
else:
|
||
url = f"https://v2.wttr.in/{selectData}?F"
|
||
a = requests.get(url, headers={"User-Agent": "curl"}, timeout=15).text
|
||
clear()
|
||
blogo()
|
||
print(a)
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
#-----------------------------END wttr.in--------------------------------
|
||
|
||
#-----------------------------RATE.SX--------------------------------
|
||
|
||
def rateSXList():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
fiat = """
|
||
-------------------------------------------
|
||
AUD Australian dollar
|
||
BRL Brazilian real
|
||
CAD Canadian dollar
|
||
CHF Swiss franc
|
||
CLP Chilean peso
|
||
CNY Chinese yuan
|
||
CZK Czech koruna
|
||
DKK Danish krone
|
||
EUR Euro
|
||
GBP Pound sterling
|
||
HKD Hong Kong dollar
|
||
HUF Hungarian forint
|
||
IDR Indonesian rupiah
|
||
ILS Israeli shekel
|
||
INR Indian rupee
|
||
JPY Japanese yen
|
||
KRW South Korean won
|
||
MXN Mexican peso
|
||
MYR Malaysian ringgit
|
||
NOK Norwegian krone
|
||
NZD New Zealand dollar
|
||
PHP Philippine peso
|
||
PKR Pakistani rupee
|
||
PLN Polish zloty
|
||
RUB Russian ruble
|
||
SEK Swedish krona
|
||
SGD Singapore dollar
|
||
THB Thai baht
|
||
TRY Turkish lira
|
||
TWD New Taiwan dollar
|
||
USD Dollars
|
||
-------------------------------------------
|
||
"""
|
||
print(fiat)
|
||
selectFiat = input("Insert a Fiat currency: ")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
while True:
|
||
try:
|
||
a = requests.get(f"https://{selectFiat}.rate.sx/?F&n=1", headers={"User-Agent": "curl"}, timeout=15).text
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
print(a)
|
||
t.sleep(20)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def rateSXGraph():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
fiat = """
|
||
-------------------------------------------
|
||
AUD Australian dollar
|
||
BRL Brazilian real
|
||
CAD Canadian dollar
|
||
CHF Swiss franc
|
||
CLP Chilean peso
|
||
CNY Chinese yuan
|
||
CZK Czech koruna
|
||
DKK Danish krone
|
||
EUR Euro
|
||
GBP Pound sterling
|
||
HKD Hong Kong dollar
|
||
HUF Hungarian forint
|
||
IDR Indonesian rupiah
|
||
ILS Israeli shekel
|
||
INR Indian rupee
|
||
JPY Japanese yen
|
||
KRW South Korean won
|
||
MXN Mexican peso
|
||
MYR Malaysian ringgit
|
||
NOK Norwegian krone
|
||
NZD New Zealand dollar
|
||
PHP Philippine peso
|
||
PKR Pakistani rupee
|
||
PLN Polish zloty
|
||
RUB Russian ruble
|
||
SEK Swedish krona
|
||
SGD Singapore dollar
|
||
THB Thai baht
|
||
TRY Turkish lira
|
||
TWD New Taiwan dollar
|
||
USD Dollars
|
||
-------------------------------------------
|
||
"""
|
||
print(fiat)
|
||
selectFiat = input("Insert a Fiat currency: ")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
while True:
|
||
try:
|
||
r = requests.get(f"https://{selectFiat}.rate.sx/btc", headers={"User-Agent": "curl"}, timeout=15)
|
||
a = '\n'.join(line for line in r.text.splitlines() if 'Use' not in line)
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
print(a)
|
||
t.sleep(20)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
#-----------------------------END RATE.SX--------------------------------
|
||
|
||
|
||
#-----------------------------TEMPLATE--------------------------------
|
||
|
||
def PyBLOCKTemplate():
|
||
while True:
|
||
try:
|
||
conn = """curl -s "https://pool.pyblock.xyz/getblocktemplate.php" | jq -C '.transactions[]' | xargs -L 1 | tr -d '{|}|]|,' | tr -d '"' | grep -E ' ' | grep -vE 'depends'"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("pyblock block template", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nPress Enter to Refresh the Template or Ctrl +C to back to the Main Menu.")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
#-----------------------------COINGECKO--------------------------------
|
||
|
||
def CoingeckoPP():
|
||
try:
|
||
btcInfo = CoinGeckoAPI()
|
||
n = btcInfo.get_price(ids='bitcoin', vs_currencies='usd,eur,gbp,jpy,aud')
|
||
q = n['bitcoin']
|
||
usd = q['usd']
|
||
eur = q['eur']
|
||
gbp = q['gbp']
|
||
jpy = q['jpy']
|
||
aud = q['aud']
|
||
|
||
|
||
print("""
|
||
--------------------COINGECKO BITCOIN PRICE-----------------------
|
||
|
||
1 BTC = {} USD
|
||
1 BTC = {} EUR
|
||
1 BTC = {} GBP
|
||
1 BTC = {} JPY
|
||
1 BTC = {} AUD
|
||
|
||
------------------------------------------------------------------
|
||
|
||
...BUT...
|
||
|
||
1 BTC = 1 BTC
|
||
|
||
------------------------------------------------------------------
|
||
""".format(usd,eur,gbp,jpy,aud))
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END COINGECKO--------------------------------
|
||
|
||
|
||
#-----------------------------LNBITS--------------------------------
|
||
|
||
|
||
def loadFileConnLNBits(lnbitLoad):
|
||
lnbitLoad = {"wallet_name":"", "wallet_id":"", "admin_key":"", "invoice_read_key":""}
|
||
|
||
if os.path.isfile('lnbit.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("lnbit.conf", "r") as f:
|
||
lnbitData = json.load(f) # Load the file 'bclock.conf'
|
||
lnbitLoad = lnbitData # Copy the variable pathv to 'path'
|
||
else:
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO LNBITS.COM.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mlnbitSN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
lnbitLoad["wallet_name"] = input("Wallet name: ") # path to the bitcoin-cli
|
||
lnbitLoad["wallet_id"] = input("Wallet ID: ")
|
||
lnbitLoad["admin_key"] = input("Admin key: ")
|
||
lnbitLoad["invoice_read_key"] = input("Invoice/read key: ")
|
||
with open("lnbit.conf", "w") as f:
|
||
json.dump(lnbitLoad, f, indent=2)
|
||
return lnbitLoad
|
||
|
||
def createFileConnLNBits():
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO LNBITS.COM.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mlnbitSN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
lnbitLoad = {
|
||
'wallet_id': '',
|
||
'admin_key': '',
|
||
'invoice_read_key': '',
|
||
'wallet_name': input("Wallet name: "),
|
||
}
|
||
|
||
lnbitLoad["wallet_id"] = input("Wallet ID: ")
|
||
lnbitLoad["admin_key"] = input("Admin key: ")
|
||
lnbitLoad["invoice_read_key"] = input("Invoice/read key: ")
|
||
|
||
with open("lnbit.conf", "w") as f:
|
||
json.dump(lnbitLoad, f, indent=2)
|
||
|
||
def lnbitCreateNewInvoice():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
try:
|
||
print("\n\tLNBITS CREATE INVOICE\n")
|
||
amt = input("Amount: ")
|
||
memo = input("Memo: ")
|
||
a = loadFileConnLNBits(['invoice_read_key'])
|
||
b = str(a['invoice_read_key'])
|
||
curl = (
|
||
'curl -X POST https://legend.lnbits.com/api/v1/payments -d '
|
||
+ "'{"
|
||
+ f""""out": false, "amount": {amt}, "memo": "{memo} -PyBLOCK" """
|
||
+ "}'"
|
||
+ f""" -H "X-Api-Key: {b} " -H "Content-type: application/json" """
|
||
)
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
q = d['payment_request']
|
||
c = q.lower()
|
||
node_not = input("Do you want to pay this invoice with your node? Y/n: ")
|
||
|
||
while True:
|
||
if node_not in ["Y", "y"]:
|
||
lndconnectload = {"ip_port":"", "tls":"", "macaroon":"", "ln":""}
|
||
with open("blndconnect.conf", "r") as f:
|
||
lndconnectData = json.load(f) # Load the file 'bclock.conf'
|
||
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
|
||
if lndconnectload['ip_port']:
|
||
print("\nInvoice: " + c + "\n")
|
||
payinvoice()
|
||
elif lndconnectload['ln']:
|
||
print("\nInvoice: " + c + "\n")
|
||
localpayinvoice()
|
||
elif node_not in ["N", "n"]:
|
||
print("\033[1;30;47m")
|
||
qr.add_data(c)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
print(f'Lightning Invoice: {c}')
|
||
t.sleep(10)
|
||
dn = str(d['checking_id'])
|
||
checkcurl = (
|
||
f'curl -X GET https://legend.lnbits.com/api/v1/payments/{dn}'
|
||
+ f""" -H "X-Api-Key: {b}" -H "Content-type: application/json" """
|
||
)
|
||
|
||
|
||
rsh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
nn = str(rsh)
|
||
dd = json.loads(nn)
|
||
db = dd['paid']
|
||
if db != True:
|
||
continue
|
||
clear()
|
||
blogo()
|
||
tick()
|
||
t.sleep(2)
|
||
break
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def lnbitPayInvoice():
|
||
bolt = input("Invoice: ")
|
||
a = loadFileConnLNBits(['admin_key'])
|
||
b = str(a['admin_key'])
|
||
curl = (
|
||
'curl -X POST https://legend.lnbits.com/api/v1/payments -d '
|
||
+ "'{"
|
||
+ f""""out": true, "bolt11": "{bolt}" """
|
||
+ "}'"
|
||
+ f""" -H "X-Api-Key: {b}" -H "Content-type: application/json" """
|
||
)
|
||
|
||
try:
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
dn = str(d['checking_id'])
|
||
a = loadFileConnLNBits(['invoice_read_key'])
|
||
b = str(a['invoice_read_key'])
|
||
while True:
|
||
checkcurl = (
|
||
f'curl -X GET https://legend.lnbits.com/api/v1/payments/{dn}'
|
||
+ f""" -H "X-Api-Key: {b}" -H "Content-type: application/json" """
|
||
)
|
||
|
||
|
||
rsh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
nn = str(rsh)
|
||
dd = json.loads(nn)
|
||
db = dd['paid']
|
||
if db != True:
|
||
continue
|
||
tick()
|
||
t.sleep(2)
|
||
break
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def lnbitCreatePayWall():
|
||
while True:
|
||
try:
|
||
url = input("Url: ")
|
||
memo = input("Memo: ")
|
||
desc = input("Description: ")
|
||
amt = input("Amount in sats: ")
|
||
remb = input("Remembers Y/n: ")
|
||
a = loadFileConnLNBits(['admin_key'])
|
||
if remb in ["Y", "y"]:
|
||
remember = "true"
|
||
elif remb in ["N", "n"]:
|
||
remember = "false"
|
||
b = str(a['admin_key'])
|
||
curl = (
|
||
'curl -X POST https://legend.lnbits.com/paywall/api/v1/paywalls -d '
|
||
+ "'{"
|
||
+ f""""url": "{url}", "memo": "{memo}", "description": "{desc}", "amount": {amt}, "remembers": {remember} """
|
||
+ "}'"
|
||
+ f""" -H "Content-type: application/json" -H "X-Api-Key: {b}" """
|
||
)
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
print("\n\tPAYWALL CREATED SUCCESSFULLY\n")
|
||
t.sleep(2)
|
||
clear()
|
||
aa = loadFileConnLNBits(['invoice_read_key'])
|
||
bb = str(a['invoice_read_key'])
|
||
checkcurl = f"""curl -X GET https://lnbits.com/paywall/api/v1/paywalls -H "X-Api-Key: {bb}" """
|
||
|
||
|
||
sh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
while True:
|
||
print("\n\tLNBITS PAYWALL LIST\n")
|
||
for item_ in d:
|
||
s = item_
|
||
print(f'ID: {s["id"]}')
|
||
nd = input("\nSelect ID: ")
|
||
for item in d:
|
||
s = item
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||
print(
|
||
"""
|
||
\tLNBITS PAYWALL DECODED
|
||
|
||
ID: {}
|
||
Amount: {} sats
|
||
Description: {}
|
||
Memo: {}
|
||
Extras: {}
|
||
Remembers: {}
|
||
URL: {}
|
||
Wallet: {}
|
||
""".format(
|
||
nn,
|
||
s['amount'],
|
||
s['description'],
|
||
s['memo'],
|
||
s['extras'],
|
||
s['remembers'],
|
||
s['url'],
|
||
s['wallet'],
|
||
)
|
||
)
|
||
|
||
print("----------------------------------------------------------------------------------------------------------------\n")
|
||
input("Continue...")
|
||
clear()
|
||
blogo()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def lnbitListPawWall():
|
||
a = loadFileConnLNBits(['invoice_read_key'])
|
||
b = str(a['invoice_read_key'])
|
||
checkcurl = (
|
||
'curl -X GET https://legend.lnbits.com/paywall/api/v1/paywalls -H'
|
||
+ f""" "X-Api-Key: {b}" """
|
||
)
|
||
|
||
sh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
while True:
|
||
print("\n\tLNBITS PAYWALL LIST\n")
|
||
try:
|
||
for item_ in d:
|
||
s = item_
|
||
print(f'ID: {s["id"]}')
|
||
nd = input("\nSelect ID: ")
|
||
for item in d:
|
||
s = item
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNBITS PAYWALL DECODED
|
||
|
||
ID: {}
|
||
Amount: {} sats
|
||
Description: {}
|
||
Memo: {}
|
||
Extras: {}
|
||
Remembers: {}
|
||
URL: {}
|
||
Wallet: {}
|
||
""".format(s['id'], s['amount'], s['description'], s['memo'], s['extras'], s['remembers'], s['url'], s['wallet']))
|
||
print("----------------------------------------------------------------------------------------------------------------\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
input("Continue...")
|
||
clear()
|
||
blogo()
|
||
|
||
def lnbitDeletePayWall():
|
||
while True:
|
||
try:
|
||
a = loadFileConnLNBits(['invoice_read_key'])
|
||
b = str(a['invoice_read_key'])
|
||
checkcurl = (
|
||
'curl -X GET https://legend.lnbits.com/paywall/api/v1/paywalls -H'
|
||
+ f""" "X-Api-Key: {b}" """
|
||
)
|
||
|
||
sh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
while True:
|
||
print("\n\tLNBITS PAYWALL LIST\n")
|
||
try:
|
||
for item_ in d:
|
||
s = item_
|
||
print(f'ID: {s["id"]}')
|
||
nd = input("\nSelect ID: ")
|
||
for item in d:
|
||
s = item
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNBITS PAYWALL DECODED
|
||
|
||
ID: {}
|
||
Amount: {} sats
|
||
Description: {}
|
||
Memo: {}
|
||
Extras: {}
|
||
Remembers: {}
|
||
URL: {}
|
||
Wallet: {}
|
||
""".format(s['id'], s['amount'], s['description'], s['memo'], s['extras'], s['remembers'], s['url'], s['wallet']))
|
||
print("----------------------------------------------------------------------------------------------------------------\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
input("Continue...")
|
||
break
|
||
print("\n\tDELETE PAYWALL\n")
|
||
a = loadFileConnLNBits(['admin_key'])
|
||
b = str(a['admin_key'])
|
||
id = input("Insert PayWall ID: ")
|
||
curl = (
|
||
f"curl -X DELETE https://legend.lnbits.com/paywall/api/v1/paywalls/{id}"
|
||
+ f""" -H "X-Api-Key: {b}" """
|
||
)
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\n\tPAYWALL DELETED SUCCESSFULLY\n")
|
||
t.sleep(2)
|
||
clear()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def lnbitsLNURLw():
|
||
while True:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
print("""
|
||
----------------------
|
||
CREATE LNURL
|
||
----------------------\n""")
|
||
title = input("Title: ")
|
||
minwith = input("Minimum Withdraw: ")
|
||
maxwith = input("Maximum Withdraw: ")
|
||
usesw = input("Uses: ")
|
||
waittime = input("Wait Time: ")
|
||
isunique = input("Is unique? true/false: ")
|
||
a = loadFileConnLNBits(['admin_key'])
|
||
b = str(a['admin_key'])
|
||
curl = (
|
||
'curl -X POST https://legend.lnbits.com/withdraw/api/v1/links -d '
|
||
+ """'{"title":"""
|
||
+ f'"{title}", "min_withdrawable": {minwith}, "max_withdrawable": {maxwith}, "uses": {usesw}, "wait_time": {waittime}, "is_unique": {isunique}'
|
||
+ "}'"
|
||
+ f' -H "Content-type: application/json" -H "X-Api-Key: {b}"'
|
||
)
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
print("\n\tLNURLW CREATED SUCCESSFULLY\n")
|
||
t.sleep(2)
|
||
clear()
|
||
while True:
|
||
checkcurl = f'curl -X GET https://legend.lnbits.com/withdraw/api/v1/links -H "X-Api-Key: {b}"'
|
||
|
||
sh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
print("\n\tLNBITS LNURLW LIST\n")
|
||
for item_ in d:
|
||
s = item_
|
||
print(f'ID: {s["id"]} Uses: ' + str(s['uses']) + " Used: " + str(s['used']))
|
||
nd = input("\nSelect ID: ")
|
||
for item in d:
|
||
s = item
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNBITS LNURLW DECODED
|
||
|
||
ID: {}
|
||
LNURL: {}
|
||
Wait Time: {}
|
||
Uses: {}
|
||
Used: {}
|
||
Minimum Withdraw: {}
|
||
Maximum Withdraw: {}
|
||
""".format(s['id'], s['lnurl'], s['wait_time'], s['uses'], s['used'], s['min_withdrawable'], s['max_withdrawable']))
|
||
print("----------------------------------------------------------------------------------------------------------------\n")
|
||
input("Continue...")
|
||
clear()
|
||
blogo()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def lnbitsLNURLwList():
|
||
try:
|
||
while True:
|
||
a = loadFileConnLNBits(['admin_key'])
|
||
b = str(a['admin_key'])
|
||
checkcurl = f'curl -X GET https://legend.lnbits.com/withdraw/api/v1/links -H "X-Api-Key: {b}"'
|
||
|
||
sh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
print("\n\tLNBITS LNURLW LIST\n")
|
||
for item_ in d:
|
||
s = item_
|
||
print(f'ID: {s["id"]} Uses: ' + str(s['uses']) + " Used: " + str(s['used']))
|
||
nd = input("\nSelect ID: ")
|
||
for item in d:
|
||
s = item
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNBITS LNURLW DECODED
|
||
|
||
ID: {}
|
||
LNURL: {}
|
||
Wait Time: {}
|
||
Uses: {}
|
||
Used: {}
|
||
Minimum Withdraw: {}
|
||
Maximum Withdraw: {}
|
||
""".format(s['id'], s['lnurl'], s['wait_time'], s['uses'], s['used'], s['min_withdrawable'], s['max_withdrawable']))
|
||
print("----------------------------------------------------------------------------------------------------------------\n")
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
print("\n")
|
||
|
||
#-------------------------1d646820055e4e2da218e801eaacfc94----END LNBITS--------------------------------
|
||
#-----------------------------LNPAY--------------------------------
|
||
|
||
def loadFileConnLNPay(lnpayLoad):
|
||
lnpayLoad = {"key":""}
|
||
|
||
if os.path.isfile('lnpay.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("lnpay.conf", "r") as f:
|
||
lnpayData = json.load(f) # Load the file 'bclock.conf'
|
||
lnpayLoad = lnpayData # Copy the variable pathv to 'path'
|
||
else:
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO LNPAY.CO.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mlnpaySN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
lnpayLoad["key"] = input("API Key: ")
|
||
print("\n\tWALLET ACCESS KEYS\n")
|
||
lnpayLoad["wallet_key_id"] = input("Wallet Admin: ")
|
||
with open("lnpay.conf", "w") as f:
|
||
json.dump(lnpayLoad, f, indent=2)
|
||
clear()
|
||
blogo()
|
||
return lnpayLoad
|
||
|
||
def createFileConnLNPay():
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO LNPAY.CO.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mlnpaySN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
lnpayLoad["key"] = input("API Key: ")
|
||
print("\n\tWALLET ACCESS KEYS\n")
|
||
lnpayLoad["wallet_key_id"] = input("Wallet Admin: ")
|
||
with open("lnpay.conf", "w") as f:
|
||
json.dump(lnpayLoad, f, indent=2)
|
||
|
||
def lnpayGetBalance():
|
||
a = loadFileConnLNPay(['key'])
|
||
b = str(a['key'])
|
||
n = loadFileConnLNPay(['wallet_key_id'])
|
||
q = str(n['wallet_key_id'])
|
||
lnpay_py.initialize(b)
|
||
clear()
|
||
blogo()
|
||
my_wallet = LNPayWallet(q)
|
||
info = my_wallet.get_info()
|
||
print("\n---------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNPAY WALLET BALANCE
|
||
|
||
Wallet ID: {}
|
||
Wallet Name: {}
|
||
Balance: {} sats
|
||
""".format(info['id'], info['user_label'], info['balance']))
|
||
print("---------------------------------------------------------------------------------------------------\n")
|
||
input("\nContinue... ")
|
||
|
||
def lnpayCreateInvoice():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
a = loadFileConnLNPay(['key'])
|
||
b = str(a['key'])
|
||
n = loadFileConnLNPay(['wallet_key_id'])
|
||
q = str(n['wallet_key_id'])
|
||
lnpay_py.initialize(b)
|
||
clear()
|
||
blogo()
|
||
my_wallet = LNPayWallet(q)
|
||
amt = input("\nAmount in Sats: ")
|
||
memo = input("Memo: ")
|
||
invoice_params = {'num_satoshis': amt, 'memo': f'{memo} -PyBLOCK'}
|
||
try:
|
||
invoice = my_wallet.create_invoice(invoice_params)
|
||
clear()
|
||
blogo()
|
||
node_not = input("Do you want to pay this invoice with your node? Y/n: ")
|
||
while True:
|
||
if node_not in ["Y", "y"]:
|
||
lndconnectload = {"ip_port":"", "tls":"", "macaroon":"", "ln":""}
|
||
with open("blndconnect.conf", "r") as f:
|
||
lndconnectData = json.load(f) # Load the file 'bclock.conf'
|
||
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
|
||
if lndconnectload['ip_port']:
|
||
print("\nInvoice: " + invoice['payment_request'] + "\n")
|
||
payinvoice()
|
||
elif lndconnectload['ln']:
|
||
print("\nInvoice: " + invoice['payment_request'] + "\n")
|
||
localpayinvoice()
|
||
elif node_not in ["N", "n"]:
|
||
print("\033[1;30;47m")
|
||
qr.add_data(invoice['payment_request'])
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
print(f'Lightning Invoice: {invoice["payment_request"]}')
|
||
t.sleep(10)
|
||
curl = f'curl -u {b}: https://api.lnpay.co/v1/lntx/{invoice["id"]}?fields=settled,num_satoshis'
|
||
|
||
rsh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
nn = str(rsh)
|
||
dd = json.loads(nn)
|
||
db = dd['settled']
|
||
if db != 1:
|
||
continue
|
||
clear()
|
||
blogo()
|
||
tick()
|
||
t.sleep(2)
|
||
break
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def lnpayGetTransactions():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
a = loadFileConnLNPay(['key'])
|
||
b = str(a['key'])
|
||
n = loadFileConnLNPay(['wallet_key_id'])
|
||
q = str(n['wallet_key_id'])
|
||
lnpay_py.initialize(b)
|
||
clear()
|
||
blogo()
|
||
my_wallet = LNPayWallet(q)
|
||
|
||
transactions = my_wallet.get_transactions()
|
||
while True:
|
||
try:
|
||
print("\n\tLNPAY LIST PAYMENTS\n")
|
||
for transaction_ in transactions:
|
||
s = transaction_
|
||
q = s['lnTx']
|
||
|
||
print(f'ID: {s["id"]}')
|
||
nd = input("\nSelect ID: ")
|
||
for transaction in transactions:
|
||
s = transaction
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
nnn = s['lnTx']
|
||
print("""
|
||
\tLNPAY LIST PAYMENT DECODED
|
||
|
||
ID: {}
|
||
Amount: {} sats
|
||
Memo: {}
|
||
Invoice: {}
|
||
RHash: {}
|
||
""".format(nnn['id'], nnn['num_satoshis'], nnn['memo'], nnn['payment_request'], nnn['r_hash_decoded']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
print("\033[1;30;47m")
|
||
qr.add_data(nnn['payment_request'])
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
input("Continue...")
|
||
clear()
|
||
blogo()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
clear()
|
||
blogo()
|
||
|
||
def lnpayPayInvoice():
|
||
a = loadFileConnLNPay(['key'])
|
||
b = str(a['key'])
|
||
n = loadFileConnLNPay(['wallet_key_id'])
|
||
q = str(n['wallet_key_id'])
|
||
lnpay_py.initialize(b)
|
||
clear()
|
||
blogo()
|
||
my_wallet = LNPayWallet(q)
|
||
try:
|
||
print("\n\tLNPAY PAY INVOICE\n")
|
||
inv = input("\nInvoice: ")
|
||
curl = f'curl -u{b}: https://api.lnpay.co/v1/node/default/payments/decodeinvoice?payment_request={inv}'
|
||
|
||
clear()
|
||
rsh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
nn = str(rsh)
|
||
dd = json.loads(nn)
|
||
clear()
|
||
blogo()
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNPAY INVOICE DECODED
|
||
|
||
Destination: {}
|
||
Amount: {} sats
|
||
Memo: {}
|
||
Invoice: {}
|
||
""".format(dd['destination'], dd['num_satoshis'], dd['description'], inv))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
print("<<< Cancel Control + C")
|
||
input("\nEnter to Continue... ")
|
||
invoice_params = {
|
||
'payment_request': inv
|
||
}
|
||
pay_result = my_wallet.pay_invoice(invoice_params)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def lnpayTransBWallets():
|
||
a = loadFileConnLNPay(['key'])
|
||
b = str(a['key'])
|
||
n = loadFileConnLNPay(['wallet_key_id'])
|
||
q = str(n['wallet_key_id'])
|
||
lnpay_py.initialize(b)
|
||
clear()
|
||
blogo()
|
||
print("""\n\tLNPAY TRANSFER BETWEEN WALLETS
|
||
\nCaution: If you Transfer to another of your LNPay wallets
|
||
you will only access to your funds via Web.\n""")
|
||
try:
|
||
wall = input("Wallet destination ID: ")
|
||
amt = input("Amount in Sats: ")
|
||
memo = input("Memo: ")
|
||
my_wallet = LNPayWallet(q)
|
||
transfer_params = {
|
||
'dest_wallet_id': wall,
|
||
'num_satoshis': amt,
|
||
'memo': memo
|
||
}
|
||
transfer_result = my_wallet.internal_transfer(transfer_params)
|
||
p = transfer_result['wtx_transfer_in']
|
||
e = transfer_result['wtx_transfer_out']
|
||
f = e['wal']
|
||
v = p['wal']
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tLNPAY TRANSFER BETEWWN WALLETS INFORMATION
|
||
|
||
ID: {}
|
||
Amount: {} sats
|
||
Memo: {}
|
||
To Wallet: {}
|
||
From Wallet: {}
|
||
""".format(p['id'], p['num_satoshis'], p['user_label'], v['user_label'], f['user_label']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END LNPAY--------------------------------
|
||
#-----------------------------OPENNODE--------------------------------
|
||
|
||
def loadFileConnOpenNode(opennodeLoad):
|
||
opennodeLoad = {"key":"","wdr":"","inv":""}
|
||
|
||
if os.path.isfile('opennode.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("opennode.conf", "r") as f:
|
||
opennodeData = json.load(f) # Load the file 'bclock.conf'
|
||
opennodeLoad = opennodeData # Copy the variable pathv to 'path'
|
||
else:
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO OPENNODE.COM.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mopennodeSN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
opennodeLoad["key"] = input("API Read Only Key: ")
|
||
opennodeLoad["wdr"] = input("API Withdrawall Key: ")
|
||
opennodeLoad["inv"] = input("API Invoices Key: ")
|
||
with open("opennode.conf", "w") as f:
|
||
json.dump(opennodeLoad, f, indent=2)
|
||
clear()
|
||
blogo()
|
||
return opennodeLoad
|
||
|
||
def createFileConnOpenNode():
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO OPENNODE.COM.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mopennodeSN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
opennodeLoad = {'wdr': '', 'inv': '', 'key': input("API Read Only Key: ")}
|
||
opennodeLoad["wdr"] = input("API Withdrawall Key: ")
|
||
opennodeLoad["inv"] = input("API Invoices Key: ")
|
||
with open("opennode.conf", "w") as f:
|
||
json.dump(opennodeLoad, f, indent=2)
|
||
|
||
def OpenNodelistfunds():
|
||
a = loadFileConnOpenNode(['wdr'])
|
||
b = str(a['wdr'])
|
||
curl = f'curl https://api.opennode.co/v1/account/balance -H "Content-Type: application/json" -H "Authorization: {b}"'
|
||
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
r = d['data']
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
p = r['balance']
|
||
print("""
|
||
OPENNODE BALANCE
|
||
|
||
Amount: {} sats
|
||
""".format(p['BTC']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
input("Continue...")
|
||
|
||
def OpenNodeCheckStatus():
|
||
curl = "curl -X GET https://status.opennode.com/history.rss"
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
my_dict=xmltodict.parse(sh)
|
||
n=json.dumps(my_dict)
|
||
nn = str(n)
|
||
qq = json.loads(n)
|
||
a = qq['rss']
|
||
b = a['channel']
|
||
c = b['title']
|
||
d = b['item']
|
||
dd = d[0]
|
||
e = dd['title']
|
||
print("""
|
||
\n----------------------------------------------------------------------------------------------------
|
||
\n\t{}
|
||
|
||
{}\n
|
||
{}
|
||
|
||
\n----------------------------------------------------------------------------------------------------
|
||
""".format(c.upper(),e,b['pubDate']))
|
||
input("Enter to Continue...")
|
||
|
||
def OpenNodecreatecharge():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
a = loadFileConnOpenNode(['key'])
|
||
b = str(a['key'])
|
||
fiat = input("Are you going to pay in FIAT? Y/n:")
|
||
if fiat in ["Y", "y"]:
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tFIAT supported on OpenNode:
|
||
|
||
AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,
|
||
BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNH,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,
|
||
FJD,FKP,GBP,GEL,GGP,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,IMP,INR,IQD,IRR,ISK,
|
||
JEP,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,
|
||
MMK,MNT,MOP,MRO,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,
|
||
PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLL,SOS,SRD,SSP,STD,SVC,SYP,SZL,THB,TJS,
|
||
TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XAG,XAU,XCD,XDR,XOF,XPD,
|
||
XPF,XPT,YER,ZAR,ZMW,ZWL,USDC.
|
||
""")
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
selection = input("Select a FIAT currency: ")
|
||
amt = input(f"Amount in {selection}: ")
|
||
curl = (
|
||
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 = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
dd = d['data']
|
||
qq = dd['lightning_invoice']
|
||
nn = qq['payreq']
|
||
mm = nn.lower()
|
||
pp = dd['address']
|
||
while True:
|
||
try:
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE PAYMENT REQUEST
|
||
|
||
Amount: {} {}
|
||
ID: {}
|
||
Status: {}
|
||
Invoice: {}
|
||
Onchain Address: {}
|
||
Amount: {} sats
|
||
""".format(amt, selection.upper(), dd['id'], dd['status'], mm, pp, dd['amount']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
pay = input("Invoice or Onchain Address? I/O: ")
|
||
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"]:
|
||
with open("blndconnect.conf", "r") as f:
|
||
lndconnectData = json.load(f) # 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")
|
||
payinvoice()
|
||
elif lndconnectload['ln']:
|
||
print("\nInvoice: " + mm + "\n")
|
||
localpayinvoice()
|
||
elif node_not in ["N", "n"]:
|
||
print("\033[1;30;47m")
|
||
qr.add_data(mm)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
print("\nLightning Invoice: " + mm)
|
||
elif pay in ["O", "o"]:
|
||
print("\033[1;30;47m")
|
||
qr.add_data(pp)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
print(f"\nAmount in sats: {dd['amount']} sats")
|
||
print("\nOnchain Address: " + pp)
|
||
input("\nContinue...")
|
||
clear()
|
||
blogo()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif fiat in ["N", "n"]:
|
||
amt = input("Amount in sats: ")
|
||
curl = (
|
||
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 = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
dd = d['data']
|
||
qq = dd['lightning_invoice']
|
||
nn = qq['payreq']
|
||
mm = nn.lower()
|
||
pp = dd['address']
|
||
while True:
|
||
try:
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE PAYMENT REQUEST
|
||
|
||
Amount: {} sats
|
||
ID: {}
|
||
Status: {}
|
||
Invoice: {}
|
||
Onchain Address: {}
|
||
Amount: {} sats
|
||
""".format(amt, dd['id'], dd['status'], mm, pp, dd['amount']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
pay = input("Invoice or Onchain Address? I/O: ")
|
||
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"]:
|
||
with open("blndconnect.conf", "r") as f:
|
||
lndconnectData = json.load(f) # 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")
|
||
payinvoice()
|
||
elif lndconnectload['ln']:
|
||
print("\nInvoice: " + mm + "\n")
|
||
localpayinvoice()
|
||
elif node_not in ["N", "n"]:
|
||
print("\033[1;30;47m")
|
||
qr.add_data(mm)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
print("\nLightning Invoice: " + mm)
|
||
elif pay in ["O", "o"]:
|
||
print("\033[1;30;47m")
|
||
qr.add_data(pp)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
print(f"\nAmount in sats: {dd['amount']} sats")
|
||
print("\nOnchain Address: " + pp)
|
||
input("\nContinue...")
|
||
clear()
|
||
blogo()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def OpenNodeiniciatewithdrawal():
|
||
a = loadFileConnOpenNode(['wdr'])
|
||
b = str(a['wdr'])
|
||
c = loadFileConnOpenNode(['key'])
|
||
d = str(a['key'])
|
||
lnchain = input("Are you going to pay with Lightning or Onchain? L/O: ")
|
||
clear()
|
||
blogo()
|
||
if lnchain in ["L", "l"]:
|
||
try:
|
||
while True:
|
||
invoice = input("\nInvoice: ")
|
||
checkcurl = (
|
||
f'curl https://api.opennode.co/v1/charge/decode -X POST -H "Authorization: {b}" -H "Content-Type: application/json" -d '
|
||
+ "'{"
|
||
+ f'"pay_req": "{invoice}"'
|
||
+ "}'"
|
||
)
|
||
|
||
ssh = subprocess.run(checkcurl, shell=True, capture_output=True, text=True).stdout
|
||
nn = str(ssh)
|
||
dd = json.loads(nn)
|
||
print(dd)
|
||
if invoice != "":
|
||
break
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE TRANSFER REQUEST
|
||
|
||
Message: {}
|
||
""".format(dd['message']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
rr = dd['data']
|
||
ss = rr['pay_req']
|
||
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE TRANSFER REQUEST
|
||
|
||
Network: {}
|
||
Amount: {} sats
|
||
Destination: {}
|
||
Hash: {}
|
||
""".format(ss['network'],ss['amount'],ss['pub_key'],ss['hash']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
print("<<< Cancel Control + C")
|
||
input("\nEnter to Continue... ")
|
||
|
||
curl = (
|
||
f'curl https://api.opennode.co/v2/withdrawals -X POST -H "Content-Type: application/json" -H "Authorization: {b}"'
|
||
+ " -d '{"
|
||
+ f'"type": "ln", "address": "{invoice}", "callback_url": ""'
|
||
+ "}'"
|
||
)
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
clear()
|
||
blogo()
|
||
tick()
|
||
t.sleep(2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
|
||
elif lnchain in ["O", "o"]:
|
||
try:
|
||
while True:
|
||
print("\n\tOPENNODE TRANSFER REQUEST\n")
|
||
print("\n\tMinimum amount 200000 sats\n")
|
||
address = input("\nBitcoin Address: ")
|
||
amt = int(input("Amount in sats: "))
|
||
curl = (
|
||
f'curl https://api.opennode.co/v2/withdrawals -X POST -H "Content-Type: application/json" -H "Authorization: {b}"'
|
||
+ " -d '{"
|
||
+ f'"type": "chain", "amount": {amt}, "address": "{address}", "callback_url": ""'
|
||
+ "}'"
|
||
)
|
||
|
||
if amt < 199999:
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE TRANSFER REQUEST
|
||
|
||
Message: {}
|
||
""".format(d['message']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
elif amt > 200000:
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
dd = d['data']
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE TRANSFER REQUEST
|
||
|
||
Amount: {} sats
|
||
Address Destination: {}
|
||
Fee: {}
|
||
Status: {}
|
||
""".format(dd['amount'],dd['address'],dd['fee'], dd['status']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
input("\nContinue... ")
|
||
clear()
|
||
blogo()
|
||
logoB()
|
||
t.sleep(2)
|
||
break
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
|
||
def OpenNodeListPayments():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
a = loadFileConnOpenNode(['wdr'])
|
||
b = str(a['wdr'])
|
||
curl = f'curl https://api.opennode.co/v1/withdrawals -H "Content-Type: application/json" -H "Authorization: {b}"'
|
||
|
||
sh = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\n\tOPENNODE TRANSACTIONS LIST\n")
|
||
n = str(sh)
|
||
d = json.loads(n)
|
||
da = d['data']
|
||
while True:
|
||
try:
|
||
for item_ in da:
|
||
s = item_
|
||
n = s['status']
|
||
q = str(n)
|
||
print(f'ID: {s["id"]} {q}')
|
||
nd = input("\nSelect ID: ")
|
||
for item in da:
|
||
s = item
|
||
nn = s['id']
|
||
if nd == nn:
|
||
print("\n----------------------------------------------------------------------------------------------------")
|
||
print("""
|
||
\tOPENNODE TRANSACTION DECODED
|
||
ID: {}
|
||
Amount: {} sats
|
||
Type: {}
|
||
Invoice or Tx ID: {}
|
||
Status: {}
|
||
""".format(s['id'], s['amount'], s['type'], s['reference'], s['status']))
|
||
print("----------------------------------------------------------------------------------------------------\n")
|
||
print("\033[1;30;47m")
|
||
qr.add_data(s['reference'])
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
qr.clear()
|
||
input("Continue...")
|
||
clear()
|
||
blogo()
|
||
print("\n\tOPENNODE TRANSACTIONS LIST\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
#-----------------------------END OPENNODE--------------------------------
|
||
#-----------------------------TIPPINME--------------------------------
|
||
|
||
def loadFileTippinMe(tippinmeLoad):
|
||
tippinmeLoad = {"key":""}
|
||
|
||
if os.path.isfile('tippinme.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("tippinme.conf", "r") as f:
|
||
tippinmeData = json.load(f) # Load the file 'bclock.conf'
|
||
tippinmeLoad = tippinmeData # Copy the variable pathv to 'path'
|
||
else:
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOUR CONFIGURATION INFORMATION WILL BE SAVE IN '\033[1;33;40mtippinme.conf\033[0;37;40m'
|
||
IF YOU NEED TO START AGAIN, DELETE IT.\n
|
||
""")
|
||
tippinmeLoad["key"] = input("Twitter @user: ")
|
||
with open("tippinme.conf", "w") as f:
|
||
json.dump(tippinmeLoad, f, indent=2)
|
||
clear()
|
||
blogo()
|
||
return tippinmeLoad
|
||
|
||
def createFileTippinMe():
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOUR CONFIGURATION INFORMATION WILL BE SAVE IN '\033[1;33;40mtippinme.conf\033[0;37;40m'
|
||
IF YOU NEED TO START AGAIN, DELETE IT.\n
|
||
""")
|
||
tippinmeLoad = {'key': input("Twitter @user: ")}
|
||
with open("tippinme.conf", "w") as f:
|
||
json.dump(tippinmeLoad, f, indent=2)
|
||
|
||
def tippinmeGetInvoice():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
a = loadFileTippinMe(['key'])
|
||
b = str(a['key'])
|
||
try:
|
||
print("\n\tTIPPINME GENERATE INVOICE\n")
|
||
q = input("Amount in Sats: ")
|
||
clear()
|
||
blogo()
|
||
url = f'https://api.tippin.me/v1/public/addinvoice/{b}/{q}'
|
||
response = requests.get(url)
|
||
responseB = str(response.text)
|
||
responseC = responseB
|
||
lnreq = responseC.split(',')
|
||
lnurl = lnreq[1]
|
||
lnurlS = str(lnurl)
|
||
lnurlR = lnurlS.split(':')
|
||
lnurlW = lnbc1R[1]
|
||
ln = str(lnurlW)
|
||
ln1 = ln.strip('"')
|
||
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":""}
|
||
with open("blndconnect.conf", "r") as f:
|
||
lndconnectData = json.load(f) # 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(f'LND Invoice: {ln1}')
|
||
response.close()
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------END TIPPINME--------------------------------
|
||
|
||
def bip39convert():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"TinySeed", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('TinySeed'):
|
||
print("...pass...")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("TinySeed", exist_ok=True)
|
||
subprocess.run(["wget", "https://gist.githubusercontent.com/odudex/a29de0c91c4010a6b4c565d6f29fa0c6/raw/0349754c1b3f218ff61302acd1f346e0027ba215/TinySeed.py"], cwd="TinySeed")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Words to Tiny Seed: ")
|
||
subprocess.run(["python3", "TinySeed.py"] + shlex.split(responseC), cwd="TinySeed") # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
#-----------------------------TALLYCOIN------------------------------
|
||
|
||
def loadFileConnTallyCo(tallycoLoad):
|
||
tallycoLoad = {"tallyco.conf":"","id":""}
|
||
|
||
if os.path.isfile('tallyco.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("tallyco.conf", "r") as f:
|
||
tallyData = json.load(f) # Load the file 'bclock.conf'
|
||
tallycoLoad = tallyData # Copy the variable pathv to 'path'
|
||
else:
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO TALLYCO.IN.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mtallycoSN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
print("\nEXAMPLE: https://tallyco.in/s/{fundraiser_id}/\n")
|
||
tallycoLoad["id"] = input("User ID or Twitter @USER: ")
|
||
with open("tallyco.conf", "w") as f:
|
||
json.dump(tallycoLoad, f, indent=2)
|
||
clear()
|
||
blogo()
|
||
return tallycoLoad
|
||
|
||
def createFileConnTallyCo():
|
||
clear()
|
||
blogo()
|
||
print("""\n\t \033[1;33;40mATENTION\033[0;37;40m: YOU ARE GOING TO CREATE A FILE WITH YOUR INFORMATION OF CONNECTION TO TALLYCO.IN.
|
||
WE WILL NEED SOME INFORMATION FROM YOUR ACCOUNT THAT THE ONLY ONE THAT WILL HAVE ACCESS IS YOU.
|
||
IF YOU DELETE THIS FILE YOU WILL NEED TO PAY AGAIN TO GET ACCESS FROM PyBLOCK.
|
||
SAVE THE FILE '\033[1;33;40mtallycoSN.conf\033[0;37;40m' IN A SAFE PLACE.\n
|
||
""")
|
||
print("\nEXAMPLE: https://tallyco.in/s/{fundraiser_id}/\n")
|
||
tallycoLoad = {'fundraiser_id': '', 'id': input("User ID or Twitter @USER: ")}
|
||
with open("tallyco.conf", "w") as f:
|
||
json.dump(tallycoLoad, f, indent=2)
|
||
|
||
def tallycoGetPayment():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
c = loadFileConnTallyCo(['id'])
|
||
d = str(c['id'])
|
||
try:
|
||
amount = input("Amount in Sats: ")
|
||
print("""\nPayment Method Example: 'ln' or 'btc'
|
||
'ln' = Lightnin Netowrk
|
||
'btc'= Bitcoin Onchain Payment
|
||
\n""")
|
||
lnd_onchain = input("Payment Method: ")
|
||
curl = (
|
||
"curl -d "
|
||
+ f'"type=profile&id={d}&satoshi_amount={amount}&payment_method={lnd_onchain}"'
|
||
+ " -X POST https://api.tallyco.in/v1/payment/request/"
|
||
)
|
||
|
||
tallycomethod = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
n = str(tallycomethod)
|
||
d = json.loads(n)
|
||
clear()
|
||
blogo()
|
||
if lnd_onchain == "ln":
|
||
e = d['lightning_pay_request']
|
||
f = e.lower()
|
||
print("\033[1;30;47m")
|
||
qr.add_data(f)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
print(f'LND Invoice: {f}')
|
||
qr.clear()
|
||
input("\nContinue...")
|
||
elif lnd_onchain == "btc":
|
||
e = d['btc_address']
|
||
print("\033[1;30;47m")
|
||
qr.add_data(e)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
print(f'Amount: {d["cost"]}')
|
||
print(f'Bitcoin Address: {e}')
|
||
qr.clear()
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
def tallycoDonateid():
|
||
qr = qrcode.QRCode(
|
||
version=1,
|
||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||
box_size=10,
|
||
border=4,
|
||
)
|
||
clear()
|
||
blogo()
|
||
try:
|
||
donate = input("Donate to ID: ")
|
||
amount = input("Amount in Sats: ")
|
||
print("""\nPayment Method Example: 'ln' or 'btc'
|
||
'ln' = Lightnin Netowrk
|
||
'btc'= Bitcoin Onchain Payment
|
||
\n""")
|
||
lnd_onchain = input("Payment Method: ")
|
||
curl = (
|
||
"curl -d "
|
||
+ f'"type=profile&id={donate}&satoshi_amount={amount}&payment_method={lnd_onchain}"'
|
||
+ " -X POST https://api.tallyco.in/v1/payment/request/"
|
||
)
|
||
|
||
tallycomethod = subprocess.run(curl, shell=True, capture_output=True, text=True).stdout
|
||
n = str(tallycomethod)
|
||
d = json.loads(n)
|
||
clear()
|
||
blogo()
|
||
if lnd_onchain in ["ln", "lN", "Ln", "LN"]:
|
||
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":""}
|
||
with open("blndconnect.conf", "r") as f:
|
||
lndconnectData = json.load(f) # Load the file 'bclock.conf'
|
||
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
|
||
if lndconnectload['ip_port']:
|
||
e = d['lightning_pay_request']
|
||
f = e.lower()
|
||
print("\nInvoice: " + f + "\n")
|
||
payinvoice()
|
||
elif lndconnectload['ln']:
|
||
e = d['lightning_pay_request']
|
||
f = e.lower()
|
||
print("\nInvoice: " + f + "\n")
|
||
localpayinvoice()
|
||
elif node_not in ["N", "n"]:
|
||
e = d['lightning_pay_request']
|
||
f = e.lower()
|
||
print("\033[1;30;47m")
|
||
qr.add_data(f)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
print(f'LND Invoice: {f}')
|
||
qr.clear()
|
||
input("\nContinue...")
|
||
elif lnd_onchain in ["btc", "bTC", "BtC", "BTC", "BTc", "btC"]:
|
||
e = d['btc_address']
|
||
print("\033[1;30;47m")
|
||
qr.add_data(e)
|
||
qr.print_ascii()
|
||
print("\033[0;37;40m")
|
||
print(f'Amount: {d["cost"]}')
|
||
print(f'Bitcoin Address: {e}')
|
||
qr.clear()
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
#-----------------------------END TALLYCOIN------------------------------
|
||
#-----------------------------MEMPOOL.SPACE------------------------------
|
||
|
||
def callMemL():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Mempool-cli", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('mempoolcli'):
|
||
subprocess.run(["rm", "-rf", "mempool-cli_2.0.4_Linux_x86_64.tar.gz"], cwd="mempoolcli")
|
||
subprocess.run(["wget", "https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_x86_64.tar.gz"], cwd="mempoolcli")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("mempoolcli", exist_ok=True)
|
||
subprocess.run(["wget", "https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_x86_64.tar.gz"], cwd="mempoolcli")
|
||
subprocess.run(["tar", "-xvf", "mempool-cli_2.0.4_Linux_x86_64.tar.gz"], cwd="mempoolcli")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./mempool-cli"], cwd="mempoolcli")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callMemR():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Mempool-cli", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('mempoolcli'):
|
||
subprocess.run(["rm", "-rf", "mempool-cli_2.0.4_Linux_arm64.tar.gz"], cwd="mempoolcli")
|
||
subprocess.run(["wget", "https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_arm64.tar.gz"], cwd="mempoolcli")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("mempoolcli", exist_ok=True)
|
||
subprocess.run(["wget", "https://github.com/mempool/mempool-cli/releases/download/v2.0.4/mempool-cli_2.0.4_Linux_arm64.tar.gz"], cwd="mempoolcli")
|
||
subprocess.run(["tar", "-xvf", "mempool-cli_2.0.4_Linux_arm64.tar.gz"], cwd="mempoolcli")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
subprocess.run(["./mempool-cli"], cwd="mempoolcli")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def MemShellMenu(menunos):
|
||
if menunos in ["A", "a"]:
|
||
callMemL()
|
||
elif menunos in ["B", "b"]:
|
||
callMemR()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def MemShell():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Linux
|
||
\033[1;32;40mB.\033[0;37;40m Raspberry-Pi
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
MemShellMenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def fee():
|
||
try:
|
||
while True:
|
||
r = requests.get('https://mempool.space/api/v1/fees/recommended')
|
||
r.headers['Content-Type']
|
||
n = r.text
|
||
di = json.loads(n)
|
||
clear()
|
||
blogo()
|
||
print("""
|
||
------------------------
|
||
Fastest Fee: {}
|
||
Half Hour Fee: {}
|
||
Hour Fee: {}
|
||
------------------------
|
||
<<< Back Control + C
|
||
""".format(di['fastestFee'], di['halfHourFee'], di['hourFee']))
|
||
t.sleep(5)
|
||
print("\n\t Getting New Information")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def blocks():
|
||
try:
|
||
while True:
|
||
clear()
|
||
blogo()
|
||
print("\n\t Getting New Information")
|
||
r = requests.get('https://mempool.space/api/v1/fees/mempool-blocks')
|
||
r.headers['Content-Type']
|
||
n = r.text
|
||
di = json.loads(n)
|
||
for n in range(len(di)):
|
||
q = di[n]
|
||
clear()
|
||
blogo()
|
||
print("""
|
||
-----------------------------------------
|
||
BLOCK
|
||
-----------------------------------------
|
||
Block Size: {} bytes
|
||
Block VSize: {} bytes
|
||
Transactions: {}
|
||
Total Fees: {}
|
||
Median Fee: {}
|
||
-----------------------------------------
|
||
<<< Back Control + C
|
||
""".format(q['blockSize'], q['blockVSize'], q['nTx'], q['totalFees'], q['medianFee']))
|
||
t.sleep(3)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
|
||
def remoteHalving():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def remotegetblock():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def remotegetblockcount(): # get access to bitcoin-cli with the command getblockcount
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def remoteconsole(): # get into the console from bitcoin-cli
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def runthenumbersConn():
|
||
try:
|
||
conn = """curl -s https://bitcoinexplorer.org/api/blockchain/coins | jq | grep -E "supply" | awk '{print $2}' | tr -d '"' | tr -d ',' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("total amount", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def channelbalance():
|
||
try:
|
||
conn = """curl -s https://bitcoinexplorer.org/api/blockchain/coins | jq | grep -E "supply" | awk '{print $2}' | tr -d '"' | tr -d ',' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("channel balance", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
def listonchaintxs():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Onchain Txs", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("TX ID: ")
|
||
url2 = f'https://mempool.space/api/tx/{responseC}'
|
||
r = requests.get(url2)
|
||
r2 = str(r.text)
|
||
r3 = r2
|
||
clear()
|
||
blogo()
|
||
print("\nTransaction ID: " + responseC)
|
||
print(f'Onchain Txs: {r3}')
|
||
input("\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def balanceOC():
|
||
try:
|
||
conn = """curl -s https://bitcoinexplorer.org/api/blockchain/coins | jq | grep -E "supply" | awk '{print $2}' | tr -d '"' | tr -d ',' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("balance", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localkeysendC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatsendAC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
def localchatnewAC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatlistAC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatsendBC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatnewBC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatlistBC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatsendCC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatnewCC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchatlistCC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localchannelbalanceC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localnewaddressC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localbalanceOCC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localrebalancelndC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
# Remote connection with rest -------------------------------------
|
||
|
||
def getnewinvoice():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def payinvoice():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"invoice decoder", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Invoice: ")
|
||
url2 = f'https://lndecode.com/?invoice={responseC}'
|
||
r = requests.get(url2)
|
||
r2 = str(r.text)
|
||
r3 = r2
|
||
clear()
|
||
blogo()
|
||
print("\nInvoice: " + responseC)
|
||
print(f'Invoice: {r3}')
|
||
input("\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getnewaddress():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def listinvoice():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getinfo():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"node info", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Public Key: ")
|
||
cmd = f"curl -s 'https://1ml.com/node/'{responseC}/json'"
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nNode: " + responseC)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
|
||
def consoleLNC(): # get into the console from bitcoin-cli
|
||
try:
|
||
conn = """curl -s https://github.com/tomosaigon/lncli-commands | html2text | grep -E "## COMMANDS" -A 120"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("lncli-commands", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def locallistpeersQQC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localconnectpeerC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def locallistchaintxnsC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def locallistinvoicesC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def locallistchannelsC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localgetinfoC():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"node info", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Public Key: ")
|
||
cmd = f"curl -s https://1ml.com/node/{responseC}/json"
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nNode: " + responseC)
|
||
print(a)
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localaddinvoiceC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localpayinvoiceC():
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localgetnetworkinfoC():
|
||
try:
|
||
conn = """curl -s https://1ml.com/trends | html2text | grep -E "Increase|Decrease" -A 4 | tr -d '{|}|]|,' | tr -d '"' | tr -d '* [' | tr -d '-' | tr -d '#' | xargs -L 1"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render(
|
||
"lightning network info", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
print(a)
|
||
input("\a\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#-----------------------------Slush--------------------------------
|
||
|
||
def slDIFFConn():
|
||
try:
|
||
conn = """curl -s https://insights.braiins.com/api/v1.0/difficulty-stats"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("difficulty", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
b = json.loads(a)
|
||
print(f"""\n
|
||
|
||
Block epoch: {b['block_epoch']}
|
||
Difficulty: {b['difficulty']}
|
||
Epoch block time: {b['epoch_block_time']}
|
||
Estimated adjustment: {b['estimated_adjustment']}
|
||
Estimated adjustemnt date: {b['estimated_adjustment_date']}
|
||
Estimated next differece: {b['estimated_next_diff']}
|
||
Previous adjustment: {b['previous_adjustment']}
|
||
|
||
""")
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def slPOOLConn():
|
||
try:
|
||
conn = """curl -s https://insights.braiins.com/api/v1.0/pool-stats?json=1 | jq -C '.[]' | tr -d '{|}|]|,' | xargs -L 1 | grep -E " " """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("pool", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getPoolSlushCheck():
|
||
|
||
s = ""
|
||
sq = s
|
||
|
||
api = ""
|
||
try:
|
||
if os.path.isfile("config/braiinsAPI.conf"):
|
||
with open("config/braiinsAPI.conf", "r") as f:
|
||
apiv = json.load(f)
|
||
api = apiv
|
||
else:
|
||
clear()
|
||
blogo()
|
||
api = input("Insert Braiins API KEY: ")
|
||
with open("config/braiinsAPI.conf", "w") as f:
|
||
json.dump(api, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
while True:
|
||
try:
|
||
slushpoolbtc = f"curl https://pool.braiins.com/accounts/profile/json/btc/ -H 'SlushPool-Auth-Token:{api}' 2>/dev/null"
|
||
|
||
slushpoolbtcblock = f"curl https://pool.braiins.com/stats/json/btc/ -H 'SlushPool-Auth-Token:{api}' 2>/dev/null"
|
||
|
||
|
||
c = subprocess.run(slushpoolbtc, shell=True, capture_output=True, text=True).stdout
|
||
d = json.loads(c)
|
||
f = d['btc']
|
||
|
||
cblock = subprocess.run(slushpoolbtcblock, shell=True, capture_output=True, text=True).stdout
|
||
dblock = json.loads(cblock)
|
||
fblock = dblock['btc']
|
||
eblock = fblock['blocks']
|
||
for i in eblock:
|
||
qnq = sorted(eblock)
|
||
for n in qnq:
|
||
s = n
|
||
|
||
if s > sq:
|
||
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
|
||
|
||
clear()
|
||
blogo()
|
||
print("""\033[A
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[0;37;40mBraiins Pool
|
||
|
||
Username: {}
|
||
All Time reward: \u001b[38;5;40m{}\033[0;37;40m BTC
|
||
Today reward: \u001b[33;1m{}\033[0;37;40m BTC
|
||
Estimated reward: {} BTC
|
||
All Time reward: {} BTC
|
||
Hash Rate 5m: {} Gh/s
|
||
Hash Rate 60m: {} Gh/s
|
||
Hash Rate 24h: {} Gh/s
|
||
Hash Rate Scoring: \u001b[38;5;27m{}\033[0;37;40m Gh/s
|
||
Hash Rate Yesterday: {} Gh/s
|
||
Connected Workers: {}
|
||
Disconnected Workers: {}
|
||
Last Block discovered: {}
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[A""".format(d['username'], f['all_time_reward'], f['today_reward'], f['estimated_reward'], f['all_time_reward'], f['hash_rate_5m'], f['hash_rate_60m'], f['hash_rate_24h'], f['shares_yesterday'], f['hash_rate_yesterday'], f['ok_workers'], f['off_workers'],newblock))
|
||
|
||
t.sleep(10)
|
||
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
|
||
#-----------------------------END Slush--------------------------------
|
||
|
||
def ckpoolpoolLOCALOnchainONLY():
|
||
|
||
s = ""
|
||
sq = s
|
||
|
||
api = ""
|
||
try:
|
||
if os.path.isfile("config/CKPOOLAPI.conf"):
|
||
with open("config/CKPOOLAPI.conf", "r") as f:
|
||
apiv = json.load(f)
|
||
api = apiv
|
||
else:
|
||
clear()
|
||
blogo()
|
||
api = input("Insert CKPool Wallet.Worker: ")
|
||
with open("config/CKPOOLAPI.conf", "w") as f:
|
||
json.dump(api, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
while True:
|
||
try:
|
||
ckpool = f"curl https://solo.ckpool.org/users/{api} 2>/dev/null"
|
||
|
||
|
||
c = subprocess.run(ckpool, shell=True, capture_output=True, text=True).stdout
|
||
d = json.loads(c)
|
||
f = d['worker']
|
||
e = f[0]
|
||
|
||
clear()
|
||
blogo()
|
||
print("""\033[A
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[0;37;40mCKPool BTC
|
||
|
||
Username: {}
|
||
Hash Rate 1m: {}
|
||
Hash Rate 5m: {}
|
||
Hash Rate 1h: {}
|
||
Hash Rate 1d: {}
|
||
Hash Rate 7d: {}
|
||
Last Share: \u001b[38;5;27m{}\033[0;37;40m
|
||
Shares: {}
|
||
Best Share: {}
|
||
Best Ever: {}
|
||
Workers: {}
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[A""".format(e['workername'], e['hashrate1m'], e['hashrate5m'], e['hashrate1hr'], e['hashrate1d'], e['hashrate7d'], e['lastshare'], e['shares'], e['bestshare'], e['bestever'], d['workers']))
|
||
|
||
t.sleep(10)
|
||
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def pyblockpoolpoolLOCALOnchainONLY():
|
||
|
||
s = ""
|
||
sq = s
|
||
|
||
api = ""
|
||
try:
|
||
if os.path.isfile("config/PYBLOCKPOOLAPI.conf"):
|
||
with open("config/PYBLOCKPOOLAPI.conf", "r") as f:
|
||
apiv = json.load(f)
|
||
api = apiv
|
||
else:
|
||
clear()
|
||
blogo()
|
||
api = input("Insert your PyBLOCK Pool Wallet: ")
|
||
with open("config/PYBLOCKPOOLAPI.conf", "w") as f:
|
||
json.dump(api, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
while True:
|
||
try:
|
||
pyblockpool = f"curl https://pyblock.xyz:8443/users/{api} 2>/dev/null"
|
||
|
||
|
||
c = subprocess.run(pyblockpool, shell=True, capture_output=True, text=True).stdout
|
||
d = json.loads(c)
|
||
f = d['worker']
|
||
e = f[0]
|
||
|
||
clear()
|
||
blogo()
|
||
print("""\033[A
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[0;37;40mPYBLOCK Pool Miner Stats
|
||
|
||
Username: {}
|
||
Hash Rate 1m: {}
|
||
Hash Rate 5m: {}
|
||
Hash Rate 1h: {}
|
||
Hash Rate 1d: {}
|
||
Hash Rate 7d: {}
|
||
Last Share: \u001b[38;5;27m{}\033[0;37;40m
|
||
Shares: {}
|
||
Best Share: {}
|
||
Best Ever: {}
|
||
Workers: {}
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[A""".format(e['workername'], e['hashrate1m'], e['hashrate5m'], e['hashrate1hr'], e['hashrate1d'], e['hashrate7d'], e['lastshare'], e['shares'], e['bestshare'], e['bestever'], d['workers']))
|
||
|
||
t.sleep(10)
|
||
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def kanopoolpoolLOCALOnchainONLY():
|
||
|
||
s = ""
|
||
sq = s
|
||
|
||
api = ""
|
||
try:
|
||
if os.path.isfile("config/KANOPOOLUSER.conf") and os.path.isfile("config/KANOPOOLAPI.conf"):
|
||
with open("config/KANOPOOLUSER.conf", "r") as f:
|
||
apiv = json.load(f)
|
||
api = apiv
|
||
with open("config/KANOPOOLAPI.conf", "r") as f:
|
||
apiv2 = json.load(f)
|
||
api2 = apiv2
|
||
else:
|
||
clear()
|
||
blogo()
|
||
api = input("Insert KanoPool Username: ")
|
||
with open("config/KANOPOOLUSER.conf", "w") as f:
|
||
json.dump(api, f, indent=2)
|
||
api2 = input("Insert KanoPool API KEY: ")
|
||
with open("config/KANOPOOLAPI.conf", "w") as f:
|
||
json.dump(api2, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
while True:
|
||
try:
|
||
kanopool = f"curl https://kano.is/index.php?k=api&username={api}&api={api2}&json=y&work=y 2>/dev/null"
|
||
|
||
|
||
c = subprocess.run(kanopool, shell=True, capture_output=True, text=True).stdout
|
||
d = json.loads(c)
|
||
f = d['worker']
|
||
e = f[0]
|
||
|
||
clear()
|
||
blogo()
|
||
print("""\033[A
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[0;37;40mKanoPool BTC
|
||
|
||
Username: {}
|
||
Hash Rate 1m: {}
|
||
Hash Rate 5m: {}
|
||
Hash Rate 1h: {}
|
||
Hash Rate 1d: {}
|
||
Hash Rate 7d: {}
|
||
Last Share: \u001b[38;5;27m{}\033[0;37;40m
|
||
Shares: {}
|
||
Best Share: {}
|
||
Best Ever: {}
|
||
Workers: {}
|
||
|
||
--------------------------------------------------------------------------------------------
|
||
|
||
\033[A""".format(e['workername'], e['hashrate1m'], e['hashrate5m'], e['hashrate1hr'], e['hashrate1d'], e['hashrate7d'], e['lastshare'], e['shares'], e['bestshare'], e['bestever'], d['workers']))
|
||
|
||
t.sleep(10)
|
||
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
|
||
def getblock():
|
||
try:
|
||
conn = """curl -s https://developer.bitcoin.org/reference/rpc/getblockchaininfo.html | html2text | grep -E Result -A 50 | grep -v Result """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("getblockchaininfo", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def searchTXS():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Tx", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("TX: ")
|
||
url2 = f'https://mempool.space/api/tx/{responseC}'
|
||
r = requests.get(url2)
|
||
r2 = str(r.text)
|
||
r3 = r2
|
||
clear()
|
||
blogo()
|
||
print("\nTransaction ID: " + responseC)
|
||
print(f'Tx: {r3}')
|
||
input("\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def untxsConn():
|
||
try:
|
||
conn = """curl -s https://mempool.space/api/mempool/txids | jq -C '.[]' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("uncorfirmed txs", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getnewaddressOnchain():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def gettransactionsOnchain():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Tx", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("TX: ")
|
||
url2 = f'https://mempool.space/api/tx/{responseC}'
|
||
r = requests.get(url2)
|
||
r2 = str(r.text)
|
||
r3 = r2
|
||
clear()
|
||
blogo()
|
||
print("\nTransaction ID: " + responseC)
|
||
print(f'Tx: {r3}')
|
||
input("\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getblockcount(): # get access to bitcoin-cli with the command getblockcount
|
||
try:
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getbestblockhash():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Block Hash", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Shot enter to view the hash ")
|
||
url2 = f'https://mempool.space/api/blocks/tip/hash{responseC}'
|
||
r = requests.get(url2)
|
||
r2 = str(r.text)
|
||
r3 = r2
|
||
clear()
|
||
blogo()
|
||
print("\nHash: " + responseC)
|
||
print(f'Block Hash {r3}')
|
||
input("\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def getgenesis():
|
||
try:
|
||
conn = """curl -s https://en.bitcoin.it/wiki/Genesis_block | html2text | grep -E 52706 -A 48 | grep -v 52706"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("genesis", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def readHexBlock():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Block", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("BLOCK: ")
|
||
cmd = f"curl -s 'https://mempool.space/api/tx/{responseC}/hex' "
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nHex: " + responseC)
|
||
print("\nPyBLOCK Hex: " + a)
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def readHexTx():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Block", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("BLOCK: ")
|
||
cmd = f"curl -s https://mempool.space/api/blocks/{responseC}"
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nBlock: " + responseC)
|
||
print("\nPyBLOCK Decoded: " + a)
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def console(): # get into the console from bitcoin-cli
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"RPC", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("RPC Command: ")
|
||
cmd = f"""curl -s 'https://bitcoinexplorer.org/rpc-browser?method={responseC}#Help-Content' | html2text | grep -E "Arguments" -A 777 | grep -E -v "Recent|https|http|version|commit|released|Hidden Service|on Twitter|explorer|###### Project|###### App Details|###### Links" """
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nRPC: " + responseC)
|
||
print("\nPyBLOCK Help: " + a)
|
||
input("\n")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def screensv():
|
||
try:
|
||
doit()
|
||
except (KeyboardInterrupt, SystemExit):
|
||
matrix.close()
|
||
clear()
|
||
blogo()
|
||
menu()
|
||
|
||
#------------------------------------------------------
|
||
|
||
def artist(): # here we convert the result of the command 'getblockcount' on a random art design
|
||
while True:
|
||
try:
|
||
clear()
|
||
close()
|
||
design()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
|
||
def design():
|
||
settingsClock = cfg.settings_clock
|
||
clear()
|
||
# Obtener el número de bloque actual
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.raise_for_status()
|
||
current_block = r.json()
|
||
b = str(current_block)
|
||
|
||
clear()
|
||
close()
|
||
output = render(b, colors=[settingsClock['colorA'], settingsClock['colorB']], align='center')
|
||
print("\033[0;37;40m\x1b[?25l" + output)
|
||
|
||
while True:
|
||
x = b
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.raise_for_status()
|
||
current_block = r.json()
|
||
a = str(current_block)
|
||
|
||
if x < a:
|
||
clear()
|
||
close()
|
||
output = render(a, colors=[settingsClock['colorA'], settingsClock['colorB']], align='center')
|
||
print("\033[0;37;40m\x1b[?25l" + output)
|
||
b = a
|
||
t.sleep(10)
|
||
|
||
#--------------------------------- Hex Block Decoder Functions -------------------------------------
|
||
|
||
def getrawtx(): # show confirmations from transactions
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Tx", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Tx: ")
|
||
cmd = (
|
||
f"curl -s https://mempool.space/api/tx/{responseC}"
|
||
+ """/merkle-proof | jq -C '.[]'"""
|
||
)
|
||
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nTx: " + responseC)
|
||
print("\nMerkle Proof: " + a)
|
||
input("\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def runthenumbers():
|
||
try:
|
||
conn = """curl -s https://blockchain.info/q/totalbc """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("total amount", colors=['yellow'], align='left', font='tiny')
|
||
outputT = render(f"{a} sats", colors=['green'], align='left', font='tiny')
|
||
print(output)
|
||
print(outputT)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def countdownblock():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def countdownblockConn():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("run your node", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def localHalving():
|
||
try:
|
||
conn = """curl -s https://www.bitcoinblockhalf.com/ | html2text | grep -E "Blocks until mining reward is halved" | tr -d '*' """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("blocks to halving", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#--------------------------------- End Hex Block Decoder Functions -------------------------------------
|
||
|
||
def pdfconvert():
|
||
try:
|
||
conn = """curl -s https://nakamotoinstitute.org/library/bitcoin | html2text | grep October -A 449"""
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render("whitepaper", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
print(a)
|
||
input("\a\nControl + C...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#--------------------------------- NYMs -----------------------------------
|
||
|
||
def robotNym():
|
||
try:
|
||
if path['bitcoincli']:
|
||
lncli = " getinfo"
|
||
lsd = subprocess.run(lndconnectload['ln'] + lncli, shell=True, capture_output=True, text=True).stdout
|
||
lsd0 = str(lsd)
|
||
alias = json.loads(lsd0)
|
||
else:
|
||
cert_path = lndconnectload["tls"]
|
||
with open(lndconnectload["macaroon"], 'rb') as f:
|
||
macaroon = codecs.encode(f.read(), 'hex')
|
||
headers = {'Grpc-Metadata-macaroon': macaroon}
|
||
url = f'https://{lndconnectload["ip_port"]}/v1/getinfo'
|
||
r = requests.get(url, headers=headers, verify=cert_path)
|
||
alias = r.json()
|
||
|
||
hash = alias['identity_pubkey']
|
||
rh = Robohash(hash)
|
||
rh.assemble(roboset='set1')
|
||
with open("file.png", "wb") as f:
|
||
rh.img.save(f, format="png")
|
||
|
||
img_path = open("file.png", "rb")
|
||
img = Image.open(img_path)
|
||
|
||
h = 40
|
||
w = int((img.width / img.height) * 90)
|
||
|
||
img = img.resize((w,h), Image.ANTIALIAS)
|
||
img_arr = np.asarray(img)
|
||
h,w,c = img_arr.shape
|
||
|
||
for x in range(h):
|
||
for y in range(w):
|
||
pix = img_arr[x][y]
|
||
print(get_color(pix[0], pix[1], pix[2]), sep='', end='')
|
||
print()
|
||
image = "\n\t\t\t\t\t \u001b[31;1mNode\u001b[38;5;93mNym\033[0;37;40m\n"+ "\n\t \u001b[33;1m" + alias['identity_pubkey'] + "\033[0;37;40m"
|
||
print(image)
|
||
input("\n\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
|
||
#---------------------------------Warden Terminal----------------------------------
|
||
def callGitWardenTerminal():
|
||
if not os.path.isdir('warden_terminal'):
|
||
subprocess.run(["git", "clone", "https://github.com/pxsocs/warden_terminal.git"])
|
||
subprocess.run(["python3", "node_warden.py"], cwd="warden_terminal")
|
||
|
||
#---------------------------------Nostr Terminal----------------------------------
|
||
|
||
def callGitNostrLinTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Nostr Console Linux", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_console_pyblock'):
|
||
subprocess.run(["rm", "-rf", "nostr_console_linux_amd64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_amd64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["chmod", "+x", "nostr_console_linux_amd64"], cwd="nostr_console_pyblock")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_console_pyblock", exist_ok=True)
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_amd64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["chmod", "+x", "nostr_console_linux_amd64"], cwd="nostr_console_pyblock")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Paste your PrivateKey: ")
|
||
subprocess.run(["./nostr_console_linux_amd64", "-k", responseC, "-l"], cwd="nostr_console_pyblock")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitNostrLinarmTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Nostr Console Linux", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_console_pyblock'):
|
||
subprocess.run(["rm", "-rf", "nostr_console_linux_arm64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_arm64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["chmod", "+x", "nostr_console_linux_arm64"], cwd="nostr_console_pyblock")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_console_pyblock", exist_ok=True)
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_linux_arm64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["chmod", "+x", "nostr_console_linux_arm64"], cwd="nostr_console_pyblock")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Paste your PrivateKey: ")
|
||
subprocess.run(["./nostr_console_linux_arm64", "-k", responseC, "-l"], cwd="nostr_console_pyblock")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitNostrMacTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Nostr Console macOS", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_console_pyblock'):
|
||
subprocess.run(["rm", "-rf", "nostr_console_macos_amd64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_macos_amd64"], cwd="nostr_console_pyblock")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_console_pyblock", exist_ok=True)
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_macos_amd64"], cwd="nostr_console_pyblock")
|
||
clear()
|
||
blogo()
|
||
|
||
print(output)
|
||
responseC = input("Paste your PrivateKey: ")
|
||
subprocess.run(["./nostr_console_macos_amd64", "-k", responseC, "-l"], cwd="nostr_console_pyblock")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitNostrMacarmTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Nostr Console macOS", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_console_pyblock'):
|
||
subprocess.run(["rm", "-rf", "nostr_console_elf64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_elf64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["chmod", "+x", "nostr_console_elf64"], cwd="nostr_console_pyblock")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_console_pyblock", exist_ok=True)
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_elf64"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["chmod", "+x", "nostr_console_elf64"], cwd="nostr_console_pyblock")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Paste your PrivateKey: ")
|
||
subprocess.run(["./nostr_console_elf64", "-k", responseC, "-l"], cwd="nostr_console_pyblock")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitNostrWinTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Nostr Console Windows", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_console_pyblock'):
|
||
subprocess.run(["rm", "-rf", "nostr_console_windows_amd64.exe"], cwd="nostr_console_pyblock")
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_windows_amd64.exe"], cwd="nostr_console_pyblock")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_console_pyblock", exist_ok=True)
|
||
subprocess.run(["wget", "https://raw.githubusercontent.com/curly60e/pyblock/master/pybitblock/nostr_console_pyblock/nostr_console_windows_amd64.exe"], cwd="nostr_console_pyblock")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Paste your PrivateKey: ")
|
||
subprocess.run(["./nostr_console_windows_amd64.exe", "-k", responseC, "-l"], cwd="nostr_console_pyblock")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitNostrSeedTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"Nostr BIP39", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_seed'):
|
||
print("...pass...")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_seed", exist_ok=True)
|
||
subprocess.run(["wget", "https://gist.githubusercontent.com/odudex/93cfb5628b22f8675ab1939fd43133f4/raw/b48f047c0358a9ae50c2027106bdf5e37ee1fe5c/nostr_seed.py"], cwd="nostr_seed")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Hex to BIP39 & BIP39 to Hex: ")
|
||
subprocess.run(["python3", "nostr_seed.py"] + shlex.split(responseC), cwd="nostr_seed") # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitNostrQRSeedTerminal():
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"QR", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
if os.path.isdir ('nostr_QRseed'):
|
||
print("...pass...")
|
||
else: # Check if the file 'bclock.conf' is in the same folder
|
||
os.makedirs("nostr_QRseed", exist_ok=True)
|
||
subprocess.run(["wget", "https://gist.githubusercontent.com/odudex/9e848a91d23e967309bd1719910021e6/raw/dbe04893f4ee2e0aa020735528f7f19bb2d13a7e/nostr_c_seed_qr.py"], cwd="nostr_QRseed")
|
||
clear()
|
||
blogo()
|
||
print(output)
|
||
responseC = input("Hex to BIP39 QR & BIP39 to Hex QR: ")
|
||
subprocess.run(["python3", "nostr_c_seed_qr.py"] + shlex.split(responseC), cwd="nostr_QRseed") # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
|
||
def callGitBija():
|
||
if not os.path.isdir('bija'):
|
||
subprocess.run(["git", "clone", "--recurse-submodules", "https://github.com/BrightonBTC/bija"])
|
||
subprocess.run(["docker-compose", "up"], cwd="bija")
|
||
input("\a\nYou can now access Bija at http://localhost:5000")
|
||
|
||
#---------------------------------Bpytop----------------------------------
|
||
def callGitBpytop():
|
||
if not os.path.isdir('bpytop'):
|
||
subprocess.run(["pip3", "install", "bpytop"])
|
||
subprocess.run(["git", "clone", "https://github.com/aristocratos/bpytop.git"])
|
||
subprocess.run(["sudo", "make", "install"], cwd="bpytop")
|
||
subprocess.run(["bpytop"], cwd="bpytop")
|
||
|
||
def callGitRES():
|
||
if not os.path.isdir('resurrection_wallet_0.3.0_amd64.AppImage'):
|
||
subprocess.run(["wget", "https://github.com/ktecho/resurrection-wallet/releases/download/app-v0.3.0/resurrection_wallet_0.3.0_amd64.AppImage"])
|
||
subprocess.run(["chmod", "+x", "resurrection_wallet_0.3.0_amd64.AppImage"])
|
||
subprocess.run(["./resurrection_wallet_0.3.0_amd64.AppImage"])
|
||
input("\a\nFollow the Steps by Resurrection Wallet")
|
||
|
||
#---------------------------------UTXOracle----------------------------------
|
||
def callGitUTXOracle():
|
||
try:
|
||
conn = """curl -s 'https://utxo.live/oracle/' | html2text | grep -E "Date" -A 77 | grep -v "Date" """
|
||
a = subprocess.run(conn, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
closed()
|
||
output = render(
|
||
"utxoracle", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
print(a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
#---------------------------------Cashu----------------------------------
|
||
def callGitCashu():
|
||
if not os.path.isdir('Cashu'):
|
||
subprocess.run(["pip3", "install", "cashu"])
|
||
os.makedirs("Cashu", exist_ok=True)
|
||
subprocess.run(["cashu"], cwd="Cashu")
|
||
|
||
|
||
|
||
#--------------------------------- Menu section -----------------------------------
|
||
|
||
def MainMenuCROPPED(): #Main Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
try:
|
||
_price_r = requests.get("https://mempool.space/api/v1/prices", timeout=3)
|
||
_btc_price = f"{_price_r.json().get('USD', ''):,}"
|
||
except Exception:
|
||
_btc_price = ""
|
||
rich_status_bar(mode="lite", block_height=b, btc_price=_btc_price)
|
||
rich_header(n, b, version)
|
||
|
||
items = [
|
||
("A", "PyBLOCK", "red"),
|
||
("B", "Bitcoin", "rgb(255,102,0)"),
|
||
("L", "Lightning", "yellow"),
|
||
("P", "Platforms", "rgb(0,200,0)"),
|
||
("S", "Settings", "blue"),
|
||
("X", "Donate", "white"),
|
||
("Q", "Exit", "rgb(128,0,255)"),
|
||
]
|
||
rich_menu("Main Menu", items)
|
||
|
||
print("\x1b[?25h")
|
||
mainmenuLOCALcontrol(rich_prompt("Select option"))
|
||
|
||
def bitcoincoremenuLOCAL():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Bitcoin-cli Console
|
||
\u001b[38;5;202mB.\033[0;37;40m Show Genesis Block
|
||
\u001b[38;5;202mC.\033[0;37;40m Show Blockchain Information
|
||
\u001b[38;5;202mD.\033[0;37;40m Run the Numbers
|
||
\u001b[38;5;202mE.\033[0;37;40m Decode Block
|
||
\u001b[38;5;202mF.\033[0;37;40m Show QR from a Bitcoin Address
|
||
\u001b[38;5;202mG.\033[0;37;40m Show Merkle Proof from a Tx
|
||
\u001b[38;5;202mH.\033[0;37;40m Miscellaneous
|
||
\u001b[38;5;202mJ.\033[0;37;40m Whitepaper
|
||
\u001b[38;5;202mM.\033[0;37;40m Moscow Time
|
||
\u001b[38;5;202mO.\033[0;37;40m OP_RETURN
|
||
\u001b[38;5;202mZ.\033[0;37;40m Stats
|
||
\u001b[38;5;202mQ.\033[0;37;40m Hashrate
|
||
\u001b[38;5;202mU.\033[0;37;40m Unconfirmed Txs
|
||
\u001b[38;5;202mS.\033[0;37;40m Mempool
|
||
\u001b[38;5;202mPPC.\033[0;37;40m PyBLOCK PooL Computer
|
||
\u001b[38;5;202mPPR.\033[0;37;40m PyBLOCK PooL Raspberry
|
||
\u001b[38;5;202mVG.\033[0;37;40m Vanity Generator
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
bitcoincoremenuLOCALcontrolA(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def bitcoincoremenuLOCALOPRETURN():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Send OP_RETURN
|
||
\u001b[38;5;202mB.\033[0;37;40m View OP_RETURN
|
||
\u001b[38;5;202mC.\033[0;37;40m View Decoded Coinbase
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
bitcoincoremenuLOCALcontrolO(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def lightningnetworkLOCAL():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[33;1mA.\033[0;37;40m Lncli Console
|
||
\u001b[33;1mB.\033[0;37;40m New Invoice
|
||
\u001b[33;1mC.\033[0;37;40m Pay Invoice
|
||
\u001b[33;1mD.\033[0;37;40m Make a KeySend Payment
|
||
\u001b[33;1mE.\033[0;37;40m New Bitcoin Address
|
||
\u001b[33;1mF.\033[0;37;40m List Invoices
|
||
\u001b[33;1mG.\033[0;37;40m Channel Balance
|
||
\u001b[33;1mH.\033[0;37;40m Show Channels
|
||
\u001b[33;1mI.\033[0;37;40m Rebalance Channel
|
||
\u001b[33;1mJ.\033[0;37;40m Show Peers
|
||
\u001b[33;1mK.\033[0;37;40m Connect Peers
|
||
\u001b[33;1mL.\033[0;37;40m Onchain Balance
|
||
\u001b[33;1mM.\033[0;37;40m List Onchain Transactions
|
||
\u001b[33;1mN.\033[0;37;40m Get Node Info
|
||
\u001b[33;1mO.\033[0;37;40m Get Network Information
|
||
\u001b[33;1mP.\033[0;37;40m PyChat
|
||
\u001b[33;1mZ.\033[0;37;40m Stats
|
||
\u001b[33;1mT.\033[0;37;40m Ranking
|
||
\u001b[33;1mQ.\033[0;37;40m LNBits List LNURL \033[3;35;40mFREE\033[0;37;40m
|
||
\u001b[33;1mS.\033[0;37;40m LNBits Create LNURL \033[3;35;40mFREE\033[0;37;40m
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version))
|
||
lightningnetworkLOCALcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def chatConn():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Open
|
||
\u001b[38;5;202mB.\033[0;37;40m Close
|
||
\u001b[38;5;202mC.\033[0;37;40m Hidden
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
chatConnA(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def pyCHATA():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Write
|
||
\u001b[38;5;202mB.\033[0;37;40m Read
|
||
\u001b[38;5;202mC.\033[0;37;40m List
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
chatConnB(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def pyCHATB():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Write
|
||
\u001b[38;5;202mB.\033[0;37;40m Read
|
||
\u001b[38;5;202mC.\033[0;37;40m List
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
chatConnC(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def pyCHATC():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Write
|
||
\u001b[38;5;202mB.\033[0;37;40m Read
|
||
\u001b[38;5;202mC.\033[0;37;40m List
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
chatConnD(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
|
||
def APIMenuLOCAL():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m TippinMe
|
||
\033[1;32;40mB.\033[0;37;40m Tallycoin
|
||
\033[1;32;40mC.\033[0;37;40m Mempool
|
||
\033[1;32;40mD.\033[0;37;40m CoinGecko
|
||
\033[1;32;40mE.\033[0;37;40m Rate.sx
|
||
\033[1;32;40mF.\033[0;37;40m BWT
|
||
\033[1;32;40mG.\033[0;37;40m LNBits \033[3;35;40mFREE\033[0;37;40m
|
||
\033[1;32;40mH.\033[0;37;40m LNPay \033[3;35;40mFREE\033[0;37;40m
|
||
\033[1;32;40mI.\033[0;37;40m OpenNode \033[3;35;40mFREE\033[0;37;40m
|
||
\033[1;32;40mJ.\033[0;37;40m SatNode
|
||
\033[1;32;40mK.\033[0;37;40m Weather
|
||
\033[1;32;40mL.\033[0;37;40m Arcade
|
||
\033[1;32;40mM.\033[0;37;40m Whale Alert
|
||
\033[1;32;40mN.\033[0;37;40m Nostr
|
||
\033[1;32;40mO.\033[0;37;40m PhoenixD
|
||
\033[1;32;40mP.\033[0;37;40m Pickaxe
|
||
\033[1;32;40mQ.\033[0;37;40m Ocean Pool
|
||
\033[1;32;40mR.\033[0;37;40m Luxor Pool
|
||
\033[1;32;40mS.\033[0;37;40m Braiins Pool
|
||
\033[1;32;40mT.\033[0;37;40m TinySeed
|
||
\033[1;32;40mU.\033[0;37;40m UTXOracle
|
||
\033[1;32;40mW.\033[0;37;40m CK Pool
|
||
\033[1;32;40mX.\033[0;37;40m Template
|
||
\033[1;32;40mZ.\033[0;37;40m PyBLOCK Pool
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version))
|
||
platfformsLOCALcontrol(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def decodeHex(): # show hex
|
||
try:
|
||
clear()
|
||
blogo()
|
||
output = render(
|
||
"decode", colors=['yellow'], align='left', font='tiny'
|
||
)
|
||
|
||
print(output)
|
||
responseC = input("Block Height: ")
|
||
cmd = (
|
||
f"curl -s 'https://bitcoinexplorer.org/api/block/'{responseC}"
|
||
+ """ | jq -C '.[]' | tr -d '{|}|]|,'"""
|
||
)
|
||
a = subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout
|
||
clear()
|
||
blogo()
|
||
print("\nBlock: " + responseC)
|
||
print("\nDecoded: " + a)
|
||
input("\a\nContinue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def miscellaneousLOCAL():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Ascii ₿
|
||
\u001b[38;5;202mB.\033[0;37;40m System
|
||
\u001b[38;5;202mC.\033[0;37;40m Dates
|
||
\u001b[38;5;202mD.\033[0;37;40m Quotes
|
||
\u001b[38;5;202mH.\033[0;37;40m SHA256
|
||
\u001b[38;5;202mM.\033[0;37;40m Bitaxe Block
|
||
\u001b[38;5;202mP.\033[0;37;40m PGP
|
||
\u001b[38;5;202mS.\033[0;37;40m Satoshi Nakamoto
|
||
\u001b[38;5;202mX.\033[0;37;40m All Blocks
|
||
\u001b[38;5;202mSHS.\033[0;37;40m SHS
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
miscellaneousLOCALmenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def slushpoolREMOTEOnchainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Difficulty
|
||
\u001b[38;5;202mC.\033[0;37;40m Pool
|
||
\u001b[38;5;202mE.\033[0;37;40m Miner
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
slushpoolLOCALOnchainONLYMenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def slushpoolLOCALOnchainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Difficulty
|
||
\u001b[38;5;202mC.\033[0;37;40m Pool
|
||
\u001b[38;5;202mE.\033[0;37;40m Miner
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
slushpoolLOCALOnchainONLYMenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def runTheNumbersMenu():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Countdown Block
|
||
\033[1;32;40mB.\033[0;37;40m Countdown Halving
|
||
\033[1;32;40mC.\033[0;37;40m Audit
|
||
\033[1;32;40mD.\033[0;37;40m Templates & Blocks
|
||
\033[1;32;40mE.\033[0;37;40m Missing Transactions
|
||
\033[1;32;40mU.\033[0;37;40m Bitcoin Unspendable
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
runTheNumbersControl(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def runTheNumbersMenuConn():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Countdown Block
|
||
\033[1;32;40mB.\033[0;37;40m Countdown Halving
|
||
\033[1;32;40mC.\033[0;37;40m Audit
|
||
\033[1;32;40mD.\033[0;37;40m Templates & Blocks
|
||
\033[1;32;40mE.\033[0;37;40m Missing Transactions
|
||
\033[1;32;40mU.\033[0;37;40m Bitcoin Unspendable
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
runTheNumbersControlConn(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def weatherMenuOnchainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Version 1
|
||
\033[1;32;40mB.\033[0;37;40m Version 2
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuWeatherOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def weatherMenu():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Version 1
|
||
\033[1;32;40mB.\033[0;37;40m Version 2
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuWeather(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def dnt(): # Donation selection menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;15mA.\033[0;37;40m Developers Donation
|
||
\u001b[38;5;15mB.\033[0;37;40m Testers Donation
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuC(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def dntOnchainONLY(): # Donation selection menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;15mA.\033[0;37;40m Developers Donation
|
||
\u001b[38;5;15mB.\033[0;37;40m Testers Donation
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuCOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
|
||
def dntDev(): # Dev Donation Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mNode\033[0;37;40m: \033[1;33;40m{}\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Samourai PayNym
|
||
\u001b[38;5;202mB.\033[0;37;40m Bitcoin Address
|
||
\u001b[33;1mC.\033[0;37;40m Lightning Network
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuE(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def dntDevOnchainONLY(): # Dev Donation Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Samourai PayNym
|
||
\u001b[38;5;202mB.\033[0;37;40m Bitcoin Address
|
||
\u001b[33;1mC.\033[0;37;40m Lightning Network
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuEOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def dntTst(): # Tester Donation Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Bitcoin Address
|
||
\u001b[33;1mB.\033[0;37;40m Lightning Network
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuF(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def dntTstOnchainONLY(): # Tester Donation Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;202mA.\033[0;37;40m Bitcoin Address
|
||
\u001b[33;1mB.\033[0;37;40m Lightning Network
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuFOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
|
||
def satnodeMenu(): # Satnode Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Start SatNode
|
||
\033[1;32;40mB.\033[0;37;40m Feed
|
||
\033[1;32;40mC.\033[0;37;40m Setup
|
||
\033[1;34;40mS.\033[0;37;40m Send a Message to Space
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuD(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def satnodeMenuOnchainONLY(): # Satnode Menu
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Start SatNode
|
||
\033[1;32;40mB.\033[0;37;40m Feed
|
||
\033[1;32;40mC.\033[0;37;40m Setup
|
||
\033[1;34;40mS.\033[0;37;40m Send a Message to Space
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
menuD(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def rateSX():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Rate
|
||
\033[1;32;40mB.\033[0;37;40m Chart
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
rateSXMenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def rateSXOncainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Rate
|
||
\033[1;32;40mB.\033[0;37;40m Chart
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version ))
|
||
rateSXMenuOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def mempoolmenu():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Blocks
|
||
\033[1;32;40mB.\033[0;37;40m Recommended Fee
|
||
\033[1;32;40mC.\033[0;37;40m Mempool Shell
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
mempoolmenuS(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def mempoolmenuOnchainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Blocks
|
||
\033[1;32;40mB.\033[0;37;40m Recommended Fee
|
||
\033[1;32;40mC.\033[0;37;40m Mempool Shell
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
mempoolmenuSOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
|
||
def APILnbit():
|
||
bitLN = {"NN":"","pd":""}
|
||
if os.path.isfile('lnbitSN.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("lnbitSN.conf", "r") as f:
|
||
bitData = json.load(f) # Load the file 'bclock.conf'
|
||
bitLN = bitData # Copy the variable pathv to 'path'
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mLNBits SN:{} \033[1;34;40mPremium\033[0;37;40m
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\033[1;32;40mB.\033[0;37;40m Pay Invoice
|
||
\033[1;32;40mC.\033[0;37;40m New PayWall
|
||
\033[1;32;40mD.\033[0;37;40m Delete PayWall
|
||
\033[1;32;40mE.\033[0;37;40m List PayWalls
|
||
\033[1;32;40mF.\033[0;37;40m Create LNURL
|
||
\033[1;32;40mG.\033[0;37;40m List LNURL
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version, bitLN['NN'] ))
|
||
menuLNBPI(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APILnbitOnchainONLY():
|
||
bitLN = {"NN":"","pd":""}
|
||
if os.path.isfile('lnbitSN.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("lnbitSN.conf", "r") as f:
|
||
bitData = json.load(f) # Load the file 'bclock.conf'
|
||
bitLN = bitData # Copy the variable pathv to 'path'
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mLNBits SN:{} \033[1;34;40mPremium\033[0;37;40m
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\033[1;32;40mB.\033[0;37;40m Pay Invoice
|
||
\033[1;32;40mC.\033[0;37;40m New PayWall
|
||
\033[1;32;40mD.\033[0;37;40m Delete PayWall
|
||
\033[1;32;40mE.\033[0;37;40m List PayWalls
|
||
\033[1;32;40mF.\033[0;37;40m Create LNURL
|
||
\033[1;32;40mG.\033[0;37;40m List LNURL
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n, b, version, bitLN['NN'] ))
|
||
menuLNBPIOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APILnPay():
|
||
bitLN = {"NN":"","pd":""}
|
||
if os.path.isfile('lnpaySN.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("lnpaySN.conf", "r") as f:
|
||
bitData = json.load(f) # Load the file 'bclock.conf'
|
||
bitLN = bitData # Copy the variable pathv to 'path'
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mLNPay SN:{} \033[1;34;40mPremium\033[0;37;40m
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\033[1;32;40mB.\033[0;37;40m Pay Invoice
|
||
\033[1;32;40mC.\033[0;37;40m Wallet Balance
|
||
\033[1;32;40mD.\033[0;37;40m List Invoices
|
||
\033[1;32;40mE.\033[0;37;40m Transfer Between Wallets
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version, bitLN['NN'] ))
|
||
menuLNPAY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APILnPayOnchainONLY():
|
||
bitLN = {"NN":"","pd":""}
|
||
if os.path.isfile('lnpaySN.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("lnpaySN.conf", "r") as f:
|
||
bitData = json.load(f) # Load the file 'bclock.conf'
|
||
bitLN = bitData # Copy the variable pathv to 'path'
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mLNPay SN:{} \033[1;34;40mPremium\033[0;37;40m
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\033[1;32;40mB.\033[0;37;40m Pay Invoice
|
||
\033[1;32;40mC.\033[0;37;40m Wallet Balance
|
||
\033[1;32;40mD.\033[0;37;40m List Invoices
|
||
\033[1;32;40mE.\033[0;37;40m Transfer Between Wallets
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version, bitLN['NN'] ))
|
||
menuLNPAYOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APIOpenNode():
|
||
bitLN = {"NN":"","pd":""}
|
||
if os.path.isfile('opennodeSN.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("opennodeSN.conf", "r") as f:
|
||
bitData = json.load(f) # Load the file 'bclock.conf'
|
||
bitLN = bitData # Copy the variable pathv to 'path'
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mOpenNode SN:{} \033[1;34;40mPremium\033[0;37;40m
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\033[1;32;40mB.\033[0;37;40m Pay Invoice
|
||
\033[1;32;40mC.\033[0;37;40m Wallet Balance
|
||
\033[1;32;40mD.\033[0;37;40m List Payments
|
||
\033[1;32;40mS.\033[0;37;40m Status
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version, bitLN['NN'] ))
|
||
menuOpenNode(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APIOpenNodeOnchainONLY():
|
||
bitLN = {"NN":"","pd":""}
|
||
if os.path.isfile('opennodeSN.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
with open("opennodeSN.conf", "r") as f:
|
||
bitData = json.load(f) # Load the file 'bclock.conf'
|
||
bitLN = bitData # Copy the variable pathv to 'path'
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mOpenNode SN:{} \033[1;34;40mPremium\033[0;37;40m
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\033[1;32;40mB.\033[0;37;40m Pay Invoice
|
||
\033[1;32;40mC.\033[0;37;40m Wallet Balance
|
||
\033[1;32;40mD.\033[0;37;40m List Payments
|
||
\033[1;32;40mS.\033[0;37;40m Status
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version, bitLN['NN'] ))
|
||
menuOpenNodeOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APITippinMe():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mTippinMe
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuTippinMe(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APITippinMeOnchainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mTippinMe
|
||
|
||
\033[1;32;40mA.\033[0;37;40m New Invoice
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuTippinMeOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APITallyCo():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mTallyCoin
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Get Payment
|
||
\033[1;32;40mB.\033[0;37;40m Tip User
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuTallyCo(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def APITallyCoOnchainONLY():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[0;37;40mTallyCoin
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Get Payment
|
||
\033[1;32;40mB.\033[0;37;40m Tip User
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuTallyCoOnchainONLY(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
#-------------------------------- SETTINGS -----------------------------------------------
|
||
|
||
|
||
def settings4Local():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\u001b[38;5;27mA.\033[0;37;40m Change Logo Design
|
||
\u001b[38;5;27mB.\033[0;37;40m Change Logo Colors
|
||
\u001b[38;5;27mC.\033[0;37;40m Change Clock Colors
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuSettingsLocal(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def designQ():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Block
|
||
\033[1;31;40mB.\033[0;37;40m Slick
|
||
\033[1;31;40mC.\033[0;37;40m Tiny
|
||
\033[1;31;40mD.\033[0;37;40m Grid
|
||
\033[1;31;40mE.\033[0;37;40m Pallet
|
||
\033[1;31;40mF.\033[0;37;40m Shade
|
||
\033[1;31;40mG.\033[0;37;40m Chrome
|
||
\033[1;31;40mH.\033[0;37;40m Simple
|
||
\033[1;31;40mI.\033[0;37;40m Simple Block
|
||
\033[1;31;40mJ.\033[0;37;40m 3D
|
||
\033[1;31;40mK.\033[0;37;40m Simple 3D
|
||
\033[1;31;40mL.\033[0;37;40m Huge
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuDesign(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def designC():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Block
|
||
\033[1;31;40mB.\033[0;37;40m Slick
|
||
\033[1;31;40mC.\033[0;37;40m Tiny
|
||
\033[1;31;40mD.\033[0;37;40m Grid
|
||
\033[1;31;40mE.\033[0;37;40m Pallet
|
||
\033[1;31;40mF.\033[0;37;40m Shade
|
||
\033[1;31;40mG.\033[0;37;40m Chrome
|
||
\033[1;31;40mH.\033[0;37;40m Simple
|
||
\033[1;31;40mI.\033[0;37;40m Simple Block
|
||
\033[1;31;40mJ.\033[0;37;40m 3D
|
||
\033[1;31;40mK.\033[0;37;40m Simple 3D
|
||
\033[1;31;40mL.\033[0;37;40m Huge
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuDesignClock(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colors():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Front Color
|
||
\033[1;31;40mB.\033[0;37;40m Back Color
|
||
\033[1;31;40mC.\033[0;37;40m Rainbow
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColors(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsC():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Front Color
|
||
\033[1;31;40mB.\033[0;37;40m Back Color
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsClock(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectFront():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Black
|
||
\033[1;31;40mB.\033[0;37;40m Red
|
||
\033[1;31;40mC.\033[0;37;40m Green
|
||
\033[1;31;40mD.\033[0;37;40m Yellow
|
||
\033[1;31;40mE.\033[0;37;40m Blue
|
||
\033[1;31;40mF.\033[0;37;40m Magenta
|
||
\033[1;31;40mG.\033[0;37;40m Cyan
|
||
\033[1;31;40mH.\033[0;37;40m White
|
||
\033[1;31;40mI.\033[0;37;40m Gray
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsSelectFront(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectFrontClock():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Black
|
||
\033[1;31;40mB.\033[0;37;40m Red
|
||
\033[1;31;40mC.\033[0;37;40m Green
|
||
\033[1;31;40mD.\033[0;37;40m Yellow
|
||
\033[1;31;40mE.\033[0;37;40m Blue
|
||
\033[1;31;40mF.\033[0;37;40m Magenta
|
||
\033[1;31;40mG.\033[0;37;40m Cyan
|
||
\033[1;31;40mH.\033[0;37;40m White
|
||
\033[1;31;40mI.\033[0;37;40m Gray
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsSelectFrontClock(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectBack():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Black
|
||
\033[1;31;40mB.\033[0;37;40m Red
|
||
\033[1;31;40mC.\033[0;37;40m Green
|
||
\033[1;31;40mD.\033[0;37;40m Yellow
|
||
\033[1;31;40mE.\033[0;37;40m Blue
|
||
\033[1;31;40mF.\033[0;37;40m Magenta
|
||
\033[1;31;40mG.\033[0;37;40m Cyan
|
||
\033[1;31;40mH.\033[0;37;40m White
|
||
\033[1;31;40mI.\033[0;37;40m Gray
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsSelectBack(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectBackClock():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Black
|
||
\033[1;31;40mB.\033[0;37;40m Red
|
||
\033[1;31;40mC.\033[0;37;40m Green
|
||
\033[1;31;40mD.\033[0;37;40m Yellow
|
||
\033[1;31;40mE.\033[0;37;40m Blue
|
||
\033[1;31;40mF.\033[0;37;40m Magenta
|
||
\033[1;31;40mG.\033[0;37;40m Cyan
|
||
\033[1;31;40mH.\033[0;37;40m White
|
||
\033[1;31;40mI.\033[0;37;40m Gray
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n ,b, version ))
|
||
menuColorsSelectBackClock(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectRainbow():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Start Color
|
||
\033[1;31;40mB.\033[0;37;40m End Color
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsSelectRainbow(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectRainbowStart():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Black
|
||
\033[1;31;40mB.\033[0;37;40m Red
|
||
\033[1;31;40mC.\033[0;37;40m Green
|
||
\033[1;31;40mD.\033[0;37;40m Yellow
|
||
\033[1;31;40mE.\033[0;37;40m Blue
|
||
\033[1;31;40mF.\033[0;37;40m Magenta
|
||
\033[1;31;40mG.\033[0;37;40m Cyan
|
||
\033[1;31;40mH.\033[0;37;40m White
|
||
\033[1;31;40mI.\033[0;37;40m Gray
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsSelectRainbowStart(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def colorsSelectRainbowEnd():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Black
|
||
\033[1;31;40mB.\033[0;37;40m Red
|
||
\033[1;31;40mC.\033[0;37;40m Green
|
||
\033[1;31;40mD.\033[0;37;40m Yellow
|
||
\033[1;31;40mE.\033[0;37;40m Blue
|
||
\033[1;31;40mF.\033[0;37;40m Magenta
|
||
\033[1;31;40mG.\033[0;37;40m Cyan
|
||
\033[1;31;40mH.\033[0;37;40m White
|
||
\033[1;31;40mI.\033[0;37;40m Gray
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
menuColorsSelectRainbowEnd(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def nostrConn():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Linux x64
|
||
\033[1;32;40mB.\033[0;37;40m Linux arm64
|
||
\033[1;32;40mC.\033[0;37;40m Mac x64
|
||
\033[1;32;40mD.\033[0;37;40m Mac arm64 (SOON)
|
||
\033[1;32;40mE.\033[0;37;40m Windows
|
||
\033[1;32;40mS.\033[0;37;40m Bip39
|
||
\033[1;32;40mW.\033[0;37;40m QR
|
||
\033[1;32;40mZ.\033[0;37;40m Bija
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
nostrmenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def PhoenixConn():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Linux
|
||
\033[1;32;40mB.\033[0;37;40m Mac arm64
|
||
\033[1;32;40mC.\033[0;37;40m Mac x64
|
||
\033[1;32;40mD.\033[0;37;40m Windows
|
||
\033[1;32;40mE.\033[0;37;40m Manage
|
||
\033[1;32;40mF.\033[0;37;40m Invoice Maker
|
||
\033[1;32;40mG.\033[0;37;40m BOLT12
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
phoenixmenu(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def OceanConn():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m Earnings
|
||
\033[1;32;40mB.\033[0;37;40m Hashrate
|
||
\033[1;32;40mC.\033[0;37;40m Blocks
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
oceanMstats(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def BitaxeConn():
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
n = "LITE MODE"
|
||
r = requests.get('https://mempool.space/api/blocks/tip/height')
|
||
r.headers['Content-Type']
|
||
nn = r.text
|
||
di = json.loads(nn)
|
||
a = di
|
||
b = str(a)
|
||
print("""\t\t
|
||
\033[1;37;40m{}\033[0;37;40m: \033[1;31;40mPyBLOCK\033[0;37;40m
|
||
\033[1;37;40mBlock\033[0;37;40m: \033[1;32;40m{}\033[0;37;40m
|
||
\033[1;37;40mVersion\033[0;37;40m: {}
|
||
|
||
\033[1;32;40mA.\033[0;37;40m BitAxe Logs
|
||
\033[1;32;40mB.\033[0;37;40m BitAxe System
|
||
\033[1;32;40mC.\033[0;37;40m BitAxe Restart
|
||
\u001b[33;1mEnter.\033[0;37;40m Return
|
||
\n\n\x1b[?25h""".format(n,b, version ))
|
||
bitaxeMstats(input("\033[1;32;40mSelect option: \033[0;37;40m"))
|
||
|
||
def menuSelection():
|
||
cfg.load()
|
||
chln = {"fullbtclnd":"","fullbtc":"","cropped":""}
|
||
if cfg.intro_mode is not None:
|
||
chln = cfg.intro_mode
|
||
print(chln + "\n")
|
||
if chln == "B":
|
||
MainMenuLOCALChainONLY()
|
||
elif chln == "A":
|
||
MainMenuLOCAL()
|
||
elif chln == "C":
|
||
MainMenuCROPPED()
|
||
else:
|
||
if cfg.has_config('blndconnect.conf'):
|
||
chln['offchain'] = "offchain"
|
||
else:
|
||
chln['onchain'] = "onchain"
|
||
|
||
cfg.save("selection.conf", chln)
|
||
|
||
|
||
def menuSelectionLN():
|
||
lndconnectload = cfg.lndconnectload
|
||
if lndconnectload['ln']:
|
||
menuLNDLOCAL()
|
||
else:
|
||
menuLND()
|
||
|
||
def aaccPPiLNBits():
|
||
if os.path.isfile('config/lnbitSN.conf'):
|
||
APILnbit()
|
||
else:
|
||
createFileConnLNBits()
|
||
|
||
def aaccPPiLNPay():
|
||
if os.path.isfile('config/lnpaySN.conf'):
|
||
APILnPay()
|
||
else:
|
||
createFileConnLNPay()
|
||
|
||
def aaccPPiOpenNode():
|
||
if os.path.isfile('config/opennodeSN.conf'):
|
||
APIOpenNode()
|
||
else:
|
||
createFileConnOpenNode()
|
||
|
||
|
||
def aaccPPiTippinMe():
|
||
if os.path.isfile('config/tippinme.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
APITippinMe()
|
||
else:
|
||
createFileTippinMe()
|
||
|
||
def aaccPPiTallyCo():
|
||
if os.path.isfile('config/tallyco.conf'): # Check if the file 'bclock.conf' is in the same folder
|
||
APITallyCo()
|
||
else:
|
||
createFileConnTallyCo()
|
||
|
||
def testlogo():
|
||
output = render('PyBLOCK', colors=[settings['colorA'], settings['colorB']], align='left', font=settings['design'])
|
||
print(output)
|
||
print("""
|
||
|
||
-------------------------
|
||
Design: {}
|
||
Front Color: {}
|
||
Back Color: {}
|
||
-------------------------
|
||
|
||
""".format(settings['design'], settings['colorA'], settings['colorB']))
|
||
try:
|
||
print("<<< Cancel Control + C")
|
||
input("Enter To Apply...")
|
||
settings["gradient"] = "color"
|
||
with open("config/pyblocksettings.conf", "w") as f:
|
||
json.dump(settings, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def testlogoRB():
|
||
output = render('PyBLOCK', gradient=[settings['colorA'], settings['colorB']], align='left', font=settings['design'])
|
||
print(output)
|
||
print("""
|
||
|
||
-------------------------
|
||
Design: {}
|
||
Start Color: {}
|
||
End Color: {}
|
||
-------------------------
|
||
|
||
""".format(settings['design'], settings['colorA'], settings['colorB']))
|
||
try:
|
||
print("<<< Cancel Control + C")
|
||
input("Enter To Apply...")
|
||
settings["gradient"] = "grd"
|
||
with open("config/pyblocksettings.conf", "w") as f:
|
||
json.dump(settings, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
def testClock():
|
||
bitcoinclient = path['bitcoincli'] + " getblockcount"
|
||
block = subprocess.run(str(bitcoinclient), shell=True, capture_output=True, text=True).stdout # 'getblockcount' convert to string
|
||
b = block
|
||
output = render(str(b), colors=[settingsClock['colorA'], settingsClock['colorB']], align='left')
|
||
print(output)
|
||
print("""
|
||
|
||
-------------------------
|
||
Front Color: {}
|
||
Back Color: {}
|
||
-------------------------
|
||
|
||
""".format(settingsClock['colorA'], settingsClock['colorB']))
|
||
try:
|
||
print("<<< Cancel Control + C")
|
||
input("Enter To Apply...")
|
||
settingsClock["gradient"] = "color"
|
||
with open("config/pyblocksettingsClock.conf", "w") as f:
|
||
json.dump(settingsClock, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
|
||
#--------------------------------- End Menu section -----------------------------------
|
||
#--------------------------------- Main Menu execution --------------------------------
|
||
|
||
def menuSettingsLocal(menuSTT):
|
||
if menuSTT in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
designQ()
|
||
elif menuSTT in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
colors()
|
||
elif menuSTT in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
colorsC()
|
||
|
||
def menuSettingsLocalOnchainONLY(menuSTT):
|
||
if menuSTT in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
designQOnchainONLY()
|
||
elif menuSTT in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
colorsOnchainONLY()
|
||
elif menuSTT in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
colorsCOnchainONLY()
|
||
|
||
def menuSettingsRemote(menuSTT):
|
||
if menuSTT in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
designQ()
|
||
elif menuSTT in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
colors()
|
||
elif menuSTT in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
colorsCRemote()
|
||
|
||
def menuColors(menuCLS):
|
||
if menuCLS in ["A", "a"]:
|
||
colorsSelectFront()
|
||
elif menuCLS in ["B", "b"]:
|
||
colorsSelectBack()
|
||
elif menuCLS in ["C", "c"]:
|
||
colorsSelectRainbow()
|
||
elif menuCLS in ["F", "f"]:
|
||
colors()
|
||
|
||
def menuColorsOnchainONLY(menuCLS):
|
||
if menuCLS in ["A", "a"]:
|
||
colorsSelectFrontOnchainONLY()
|
||
elif menuCLS in ["B", "b"]:
|
||
colorsSelectBackOnchainONLY()
|
||
elif menuCLS in ["C", "c"]:
|
||
colorsSelectRainbowOnchainONLY()
|
||
elif menuCLS in ["F", "f"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsClock(menuCLS):
|
||
if menuCLS in ["A", "a"]:
|
||
colorsSelectFrontClock()
|
||
elif menuCLS in ["B", "b"]:
|
||
colorsSelectBackClock()
|
||
elif menuCLS in ["F", "f"]:
|
||
colors()
|
||
|
||
def menuColorsClockOnchainONLY(menuCLS):
|
||
if menuCLS in ["A", "a"]:
|
||
colorsSelectFrontClockOnchainONLY()
|
||
elif menuCLS in ["B", "b"]:
|
||
colorsSelectBackClockOnchainONLY()
|
||
elif menuCLS in ["F", "f"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsClockRemote(menuCLS):
|
||
if menuCLS in ["A", "a"]:
|
||
colorsSelectFrontClockRemote()
|
||
elif menuCLS in ["B", "b"]:
|
||
colorsSelectBackClockRemote()
|
||
elif menuCLS in ["F", "f"]:
|
||
colors()
|
||
|
||
def menuColorsSelectRainbow(menuRF):
|
||
if menuRF in ["A", "a"]:
|
||
colorsSelectRainbowStart()
|
||
elif menuRF in ["B", "b"]:
|
||
colorsSelectRainbowEnd()
|
||
elif menuRF in ["F", "f"]:
|
||
colors()
|
||
|
||
def menuColorsSelectRainbowOnchainONLY(menuRF):
|
||
if menuRF in ["A", "a"]:
|
||
colorsSelectRainbowStartOnchaiONLY()
|
||
elif menuRF in ["B", "b"]:
|
||
colorsSelectRainbowEndOnchainONLY()
|
||
elif menuRF in ["F", "f"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectRainbowEnd(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "black"
|
||
testlogoRB()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "red"
|
||
testlogoRB()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "green"
|
||
testlogoRB()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "yellow"
|
||
testlogo()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "blue"
|
||
testlogoRB()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "magenta"
|
||
testlogoRB()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "cyan"
|
||
testlogoRB()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "white"
|
||
testlogoRB()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "gray"
|
||
testlogoRB()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectRainbowEndOnchainONLY(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "black"
|
||
testlogoRB()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "red"
|
||
testlogoRB()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "green"
|
||
testlogoRB()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "yellow"
|
||
testlogo()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "blue"
|
||
testlogoRB()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "magenta"
|
||
testlogoRB()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "cyan"
|
||
testlogoRB()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "white"
|
||
testlogoRB()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "gray"
|
||
testlogoRB()
|
||
elif menuCF in ["R", "r"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectRainbowStart(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "black"
|
||
testlogoRB()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "red"
|
||
testlogoRB()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "green"
|
||
testlogoRB()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "yellow"
|
||
testlogoRB()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "blue"
|
||
testlogoRB()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "magenta"
|
||
testlogoRB()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "cyan"
|
||
testlogoRB()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "white"
|
||
testlogoRB()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "gray"
|
||
testlogoRB()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectRainbowStartOnchainONLY(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "black"
|
||
testlogoRB()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "red"
|
||
testlogoRB()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "green"
|
||
testlogoRB()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "yellow"
|
||
testlogoRB()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "blue"
|
||
testlogoRB()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "magenta"
|
||
testlogoRB()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "cyan"
|
||
testlogoRB()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "white"
|
||
testlogoRB()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "gray"
|
||
testlogoRB()
|
||
elif menuCF in ["R", "r"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectBack(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "black"
|
||
testlogo()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "red"
|
||
testlogo()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "green"
|
||
testlogo()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "yellow"
|
||
testlogo()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "blue"
|
||
testlogo()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "magenta"
|
||
testlogo()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "cyan"
|
||
testlogo()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "white"
|
||
testlogo()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "gray"
|
||
testlogo()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectBackOnchainONLY(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "black"
|
||
testlogo()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "red"
|
||
testlogo()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "green"
|
||
testlogo()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "yellow"
|
||
testlogo()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "blue"
|
||
testlogo()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "magenta"
|
||
testlogo()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "cyan"
|
||
testlogo()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "white"
|
||
testlogo()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorB"] = "gray"
|
||
testlogo()
|
||
elif menuCF in ["R", "r"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectFront(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "black"
|
||
testlogo()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "red"
|
||
testlogo()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "green"
|
||
testlogo()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "yellow"
|
||
testlogo()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "blue"
|
||
testlogo()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "magenta"
|
||
testlogo()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "cyan"
|
||
testlogo()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "white"
|
||
testlogo()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "gray"
|
||
testlogo()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectFrontOncainONLY(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "black"
|
||
testlogo()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "red"
|
||
testlogo()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "green"
|
||
testlogo()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "yellow"
|
||
testlogo()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "blue"
|
||
testlogo()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "magenta"
|
||
testlogo()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "cyan"
|
||
testlogo()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "white"
|
||
testlogo()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings["colorA"] = "gray"
|
||
testlogo()
|
||
elif menuCF in ["R", "r"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectFrontClock(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "black"
|
||
testClock()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "red"
|
||
testClock()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "green"
|
||
testClock()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "yellow"
|
||
testClock()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "blue"
|
||
testClock()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "magenta"
|
||
testClock()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "cyan"
|
||
testClock()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "white"
|
||
testClock()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "gray"
|
||
testClock()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectFrontClockOnchainONLY(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "black"
|
||
testClock()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "red"
|
||
testClock()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "green"
|
||
testClock()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "yellow"
|
||
testClock()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "blue"
|
||
testClock()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "magenta"
|
||
testClock()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "cyan"
|
||
testClock()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "white"
|
||
testClock()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "gray"
|
||
testClock()
|
||
elif menuCF in ["R", "r"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectBackClock(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "black"
|
||
testClock()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "red"
|
||
testClock()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "green"
|
||
testClock()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "yellow"
|
||
testClock()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "blue"
|
||
testClock()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "magenta"
|
||
testClock()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "cyan"
|
||
testClock()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "white"
|
||
testClock()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "gray"
|
||
testClock()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectBackClockOnchainONLY(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "black"
|
||
testClock()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "red"
|
||
testClock()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "green"
|
||
testClock()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "yellow"
|
||
testClock()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "blue"
|
||
testClock()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "magenta"
|
||
testClock()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "cyan"
|
||
testClock()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "white"
|
||
testClock()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "gray"
|
||
testClock()
|
||
elif menuCF in ["R", "r"]:
|
||
colorsOnchainONLY()
|
||
|
||
def menuColorsSelectFrontClockRemote(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "black"
|
||
testClockRemote()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "red"
|
||
testClockRemote()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "green"
|
||
testClockRemote()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "yellow"
|
||
testClockRemote()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "blue"
|
||
testClockRemote()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "magenta"
|
||
testClockRemote()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "cyan"
|
||
testClockRemote()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "white"
|
||
testClockRemote()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorA"] = "gray"
|
||
testClockRemote()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuColorsSelectBackClockRemote(menuCF):
|
||
if menuCF in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "black"
|
||
testClockRemote()
|
||
elif menuCF in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "red"
|
||
testClockRemote()
|
||
elif menuCF in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "green"
|
||
testClockRemote()
|
||
elif menuCF in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "yellow"
|
||
testClockRemote()
|
||
elif menuCF in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "blue"
|
||
testClockRemote()
|
||
elif menuCF in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "magenta"
|
||
testClockRemote()
|
||
elif menuCF in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "cyan"
|
||
testClockRemote()
|
||
elif menuCF in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "white"
|
||
testClockRemote()
|
||
elif menuCF in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settingsClock["colorB"] = "gray"
|
||
testClockRemote()
|
||
elif menuCF in ["R", "r"]:
|
||
colors()
|
||
|
||
def menuDesign(menuDSN):
|
||
if menuDSN in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["design"] = "block"
|
||
testlogo()
|
||
elif menuDSN in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "slick"
|
||
testlogo()
|
||
elif menuDSN in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "tiny"
|
||
testlogo()
|
||
elif menuDSN in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "grid"
|
||
testlogo()
|
||
elif menuDSN in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "pallet"
|
||
testlogo()
|
||
elif menuDSN in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "shade"
|
||
testlogo()
|
||
elif menuDSN in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "chrome"
|
||
testlogo()
|
||
elif menuDSN in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "simple"
|
||
testlogo()
|
||
elif menuDSN in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "simpleBlock"
|
||
testlogo()
|
||
elif menuDSN in ["J", "j"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "3d"
|
||
testlogo()
|
||
elif menuDSN in ["K", "k"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "simple3d"
|
||
testlogo()
|
||
elif menuDSN in ["L", "l"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "huge"
|
||
testlogo()
|
||
|
||
def menuDesignOnchainONLY(menuDSN):
|
||
if menuDSN in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
settings["design"] = "block"
|
||
testlogo()
|
||
elif menuDSN in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "slick"
|
||
testlogo()
|
||
elif menuDSN in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "tiny"
|
||
testlogo()
|
||
elif menuDSN in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "grid"
|
||
testlogo()
|
||
elif menuDSN in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "pallet"
|
||
testlogo()
|
||
elif menuDSN in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "shade"
|
||
testlogo()
|
||
elif menuDSN in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "chrome"
|
||
testlogo()
|
||
elif menuDSN in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "simple"
|
||
testlogo()
|
||
elif menuDSN in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "simpleBlock"
|
||
testlogo()
|
||
elif menuDSN in ["J", "j"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "3d"
|
||
testlogo()
|
||
elif menuDSN in ["K", "k"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "simple3d"
|
||
testlogo()
|
||
elif menuDSN in ["L", "l"]:
|
||
clear()
|
||
blogo()
|
||
settings['design'] = "huge"
|
||
testlogo()
|
||
|
||
#------------API---------------------
|
||
|
||
def mempoolmenuS(menuMem):
|
||
if menuMem in ["A", "a"]:
|
||
blocks()
|
||
elif menuMem in ["B", "b"]:
|
||
fee()
|
||
elif menuMem in ["C", "c"]:
|
||
MemShell()
|
||
elif menuMem in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def mempoolmenuSOnchainONLY(menuMem):
|
||
if menuMem in ["A", "a"]:
|
||
blocks()
|
||
elif menuMem in ["B", "b"]:
|
||
fee()
|
||
elif menuMem in ["C", "c"]:
|
||
MemShell()
|
||
elif menuMem in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuTallyCo(menuTLC):
|
||
if menuTLC in ["A", "a"]:
|
||
tallycoGetPayment()
|
||
elif menuTLC in ["B", "b"]:
|
||
tallycoDonateid()
|
||
elif menuTLC in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuTallyCoOnchainONLY(menuTLC):
|
||
if menuTLC in ["A", "a"]:
|
||
tallycoGetPayment()
|
||
elif menuTLC in ["B", "b"]:
|
||
tallycoDonateid()
|
||
elif menuTLC in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuTippinMe(menuTM):
|
||
if menuTM in ["A", "a"]:
|
||
tippinmeGetInvoice()
|
||
elif menuTM in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuTippinMeOnchainONLY(menuTM):
|
||
if menuTM in ["A", "a"]:
|
||
tippinmeGetInvoice()
|
||
elif menuTM in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuOpenNode(menuOP):
|
||
if menuOP in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodecreatecharge()
|
||
elif menuOP in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodeiniciatewithdrawal()
|
||
elif menuOP in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodelistfunds()
|
||
elif menuOP in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodeListPayments()
|
||
elif menuOP in ["S", "s"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodeCheckStatus()
|
||
elif menuOP in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuOpenNodeOnchainONLY(menuOP):
|
||
if menuOP in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodecreatecharge()
|
||
elif menuOP in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodeiniciatewithdrawal()
|
||
elif menuOP in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodelistfunds()
|
||
elif menuOP in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodeListPayments()
|
||
elif menuOP in ["S", "s"]:
|
||
clear()
|
||
blogo()
|
||
OpenNodeCheckStatus()
|
||
elif menuOP in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuLNPAY(menuNW):
|
||
if menuNW in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
lnpayCreateInvoice()
|
||
elif menuNW in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
lnpayPayInvoice()
|
||
elif menuNW in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
lnpayGetBalance()
|
||
elif menuNW in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
lnpayGetTransactions()
|
||
elif menuNW in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
lnpayTransBWallets()
|
||
elif menuNW in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuLNPAYOnchainONLY(menuNW):
|
||
if menuNW in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
lnpayCreateInvoice()
|
||
elif menuNW in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
lnpayPayInvoice()
|
||
elif menuNW in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
lnpayGetBalance()
|
||
elif menuNW in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
lnpayGetTransactions()
|
||
elif menuNW in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
lnpayTransBWallets()
|
||
elif menuNW in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuLNBPI(menuLNQ):
|
||
if menuLNQ in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
lnbitCreateNewInvoice()
|
||
elif menuLNQ in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
lnbitPayInvoice()
|
||
elif menuLNQ in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
lnbitCreatePayWall()
|
||
elif menuLNQ in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
lnbitDeletePayWall()
|
||
elif menuLNQ in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
lnbitListPawWall()
|
||
elif menuLNQ in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
lnbitsLNURLw()
|
||
elif menuLNQ in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
lnbitsLNURLwList()
|
||
elif menuLNQ in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuLNBPIOnchainONLY(menuLNQ):
|
||
if menuLNQ in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
lnbitCreateNewInvoice()
|
||
elif menuLNQ in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
lnbitPayInvoice()
|
||
elif menuLNQ in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
lnbitCreatePayWall()
|
||
elif menuLNQ in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
lnbitDeletePayWall()
|
||
elif menuLNQ in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
lnbitListPawWall()
|
||
elif menuLNQ in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
lnbitsLNURLw()
|
||
elif menuLNQ in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
lnbitsLNURLwList()
|
||
elif menuLNQ in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def rateSXMenu(menuSX):
|
||
if menuSX in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
rateSXList()
|
||
elif menuSX in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
rateSXGraph()
|
||
elif menuSX in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def rateSXMenuOnchainONLY(menuSX):
|
||
if menuSX in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
rateSXList()
|
||
elif menuSX in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
rateSXGraph()
|
||
elif menuSX in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
#---------------END API-----------
|
||
|
||
|
||
def runTheNumbersControl(menuNumbers):
|
||
if menuNumbers in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
countdownblock()
|
||
elif menuNumbers in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
localHalving()
|
||
elif menuNumbers in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
calc = """
|
||
----------------------------
|
||
PROCESSING
|
||
THE NUMBERS
|
||
----------------------------
|
||
"""
|
||
comeback = """
|
||
----------------------------
|
||
MAKE YOURSELF A COFFEE
|
||
AND COME BACK IN A
|
||
MOMENT
|
||
----------------------------
|
||
"""
|
||
cprint(comeback, 'yellow')
|
||
cprint(calc, 'red', attrs=['blink'])
|
||
runthenumbers()
|
||
elif menuNumbers in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
blockTmpConn()
|
||
elif menuNumbers in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
missingConn()
|
||
elif menuNumbers in ["U", "u"]:
|
||
clear()
|
||
blogo()
|
||
unspendableConn()
|
||
|
||
def runTheNumbersControlOnchainONLY(menuNumbers):
|
||
if menuNumbers in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
countdownblock()
|
||
elif menuNumbers in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
localHalving()
|
||
elif menuNumbers in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
calc = """
|
||
----------------------------
|
||
PROCESSING
|
||
THE NUMBERS
|
||
----------------------------
|
||
"""
|
||
comeback = """
|
||
----------------------------
|
||
MAKE YOURSELF A COFFEE
|
||
AND COME BACK IN A
|
||
MOMENT
|
||
----------------------------
|
||
"""
|
||
cprint(comeback, 'yellow')
|
||
cprint(calc, 'red', attrs=['blink'])
|
||
runthenumbers()
|
||
elif menuNumbers in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
blockTmpConn()
|
||
elif menuNumbers in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
missingConn()
|
||
elif menuNumbers in ["U", "u"]:
|
||
clear()
|
||
blogo()
|
||
unspendableConn()
|
||
|
||
def runTheNumbersControlConn(menuNumbersconn):
|
||
if menuNumbersconn in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
countdownblockConn()
|
||
elif menuNumbersconn in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
remoteHalving()
|
||
elif menuNumbersconn in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
calc = """
|
||
----------------------------
|
||
PROCESSING
|
||
THE NUMBERS
|
||
----------------------------
|
||
"""
|
||
comeback = """
|
||
----------------------------
|
||
MAKE YOURSELF A COFFEE
|
||
AND COME BACK IN A
|
||
MOMENT
|
||
----------------------------
|
||
"""
|
||
cprint(comeback, 'yellow')
|
||
cprint(calc, 'red', attrs=['blink'])
|
||
runthenumbersConn()
|
||
elif menuNumbers in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
blockTmpConn()
|
||
elif menuNumbers in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
missingConn()
|
||
elif menuNumbers in ["U", "u"]:
|
||
clear()
|
||
blogo()
|
||
unspendableConn()
|
||
|
||
def menuWeather(menuWD):
|
||
if menuWD in ["A", "a"]:
|
||
wttrDataV1()
|
||
elif menuWD in ["B", "b"]:
|
||
wttrDataV2()
|
||
|
||
def menuWeatherOnchainONLY(menuWD):
|
||
if menuWD in ["A", "a"]:
|
||
wttrDataV1()
|
||
elif menuWD in ["B", "b"]:
|
||
wttrDataV2()
|
||
|
||
def mainmenuLOCALcontrol(menuS): #Execution of the Main Menu options
|
||
if menuS in ["A", "a"]:
|
||
artist()
|
||
elif menuS in ["B", "b"]:
|
||
bitcoincoremenuLOCAL()
|
||
elif menuS in ["L", "l"]:
|
||
lightningnetworkLOCAL()
|
||
elif menuS in ["S", "s"]:
|
||
settings4Local()
|
||
elif menuS in ["P", "p"]:
|
||
APIMenuLOCAL()
|
||
elif menuS in ["X", "x"]:
|
||
dnt()
|
||
elif menuS in ["Q", "q"]:
|
||
os._exit(0)
|
||
apisnd.close()
|
||
donation.close()
|
||
clone.close()
|
||
logos.close()
|
||
feed.close()
|
||
sysinf.close()
|
||
nodeconnection.close()
|
||
exit()
|
||
elif menuS in ["T", "t"]:
|
||
clear()
|
||
delay_print("\033[1;32;40mWake up, Neo...")
|
||
t.sleep(2)
|
||
clear()
|
||
delay_print("The Matrix has you...")
|
||
t.sleep(2)
|
||
clear()
|
||
delay_print("Follow the white rabbit.")
|
||
t.sleep(3)
|
||
clear()
|
||
print("Knock, knock, Neo.\033[0;37;40m\n")
|
||
t.sleep(2)
|
||
clear()
|
||
t.sleep(3)
|
||
screensv()
|
||
elif menuS in ["nym", "Nym", "NYM", "nYm", "nyM", "NYm", "NyM", "nYM"]:
|
||
clear()
|
||
blogo()
|
||
robotNym()
|
||
elif menuS in ["wt", "WT", "Wt", "wT"]:
|
||
clear()
|
||
blogo()
|
||
callGitWardenTerminal()
|
||
elif menuS in ["tt", "TT", "Tt", "tT"]:
|
||
clear()
|
||
blogo()
|
||
callGitBpytop()
|
||
elif menuS in ["CA", "ca", "Ca", "cA"]:
|
||
clear()
|
||
blogo()
|
||
callGitCashu()
|
||
elif menuS in ["7"]:
|
||
clear()
|
||
blogo()
|
||
output = render("7 Blocks - The Game", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 7Blocks.py", shell=True)
|
||
input("\a\nContinue...")
|
||
elif menuS in ["SOLO", "solo", "SoLo", "sOlO"]:
|
||
clear()
|
||
blogo()
|
||
output = render("Solo Mining", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 PyBlockMiner.py", shell=True)
|
||
input("\a\nContinue...")
|
||
elif menuS in ["bitaxe", "BITAXE", "BitAxe"]:
|
||
clear()
|
||
blogo()
|
||
BitaxeConn()
|
||
else:
|
||
if menuS.strip():
|
||
from shared.ui import YELLOW, RESET
|
||
print(f" {YELLOW}Invalid option '{menuS}'. Try again.{RESET}")
|
||
t.sleep(1)
|
||
|
||
def mainmenuLOCALcontrolOnchainONLYCROPPED(menuS): #Execution of the Main Menu options
|
||
if menuS in ["A", "a"]:
|
||
artist()
|
||
elif menuS in ["B", "b"]:
|
||
bitcoincoremenuLOCALOnchainONLY()
|
||
elif menuS in ["S", "s"]:
|
||
settings4LocalOnchainONLY()
|
||
elif menuS in ["P", "p"]:
|
||
APIMenuLOCALOnchainONLY()
|
||
elif menuS in ["X", "x"]:
|
||
dntOnchainONLY()
|
||
elif menuS in ["Q", "q"]:
|
||
os._exit(0)
|
||
apisnd.close()
|
||
donation.close()
|
||
clone.close()
|
||
logos.close()
|
||
feed.close()
|
||
sysinf.close()
|
||
nodeconnection.close()
|
||
exit()
|
||
elif menuS in ["T", "t"]:
|
||
clear()
|
||
delay_print("\033[1;32;40mWake up, Neo...")
|
||
t.sleep(2)
|
||
clear()
|
||
delay_print("The Matrix has you...")
|
||
t.sleep(2)
|
||
clear()
|
||
delay_print("Follow the white rabbit.")
|
||
t.sleep(3)
|
||
clear()
|
||
print("Knock, knock, Neo.\033[0;37;40m\n")
|
||
t.sleep(2)
|
||
clear()
|
||
t.sleep(3)
|
||
screensv()
|
||
elif menuS in ["nym", "Nym", "NYM", "nYm", "nyM", "NYm", "NyM", "nYM"]:
|
||
clear()
|
||
blogo()
|
||
robotNym()
|
||
elif menuS in ["wt", "WT", "Wt", "wT"]:
|
||
clear()
|
||
blogo()
|
||
callGitWardenTerminal()
|
||
elif menuS in ["tt", "TT", "Tt", "tT"]:
|
||
clear()
|
||
blogo()
|
||
callGitBpytop()
|
||
elif menuS in ["CA", "ca", "Ca", "cA"]:
|
||
clear()
|
||
blogo()
|
||
callGitCashu()
|
||
elif menuS in ["7"]:
|
||
clear()
|
||
blogo()
|
||
output = render("7 Blocks - The Game", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 7Blocks.py", shell=True)
|
||
input("\a\nContinue...")
|
||
elif menuS in ["SOLO", "solo", "SoLo", "sOlO"]:
|
||
clear()
|
||
blogo()
|
||
output = render("Solo Mining", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 PyBlockMiner.py", shell=True)
|
||
input("\a\nContinue...")
|
||
elif menuS in ["bitaxe", "BITAXE", "BitAxe"]:
|
||
clear()
|
||
blogo()
|
||
BitaxeConn()
|
||
|
||
def slushpoolLOCALOnchainONLYMenu(slush):
|
||
if slush in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
slDIFFConn()
|
||
elif slush in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
slPOOLConn()
|
||
elif slush in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
getPoolSlushCheck()
|
||
|
||
def bitcoincoremenuLOCALcontrolA(bcore):
|
||
if bcore in ["A", "a"]:
|
||
while True:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
close()
|
||
console()
|
||
t.sleep(5)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif bcore in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
getgenesis()
|
||
input("Continue...")
|
||
menuSelection()
|
||
elif bcore in ["C", "c"]:
|
||
getblock()
|
||
elif bcore in ["D", "d"]:
|
||
runTheNumbersMenu()
|
||
elif bcore in ["E", "e"]:
|
||
decodeHex()
|
||
elif bcore in ["F", "f"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
close()
|
||
decodeQR()
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
elif bcore in ["G", "g"]:
|
||
getrawtx()
|
||
elif bcore in ["H", "h"]:
|
||
miscellaneousLOCAL()
|
||
elif bcore in ["J", "j"]:
|
||
pdfconvert()
|
||
elif bcore in ["M", "m"]:
|
||
mtConn()
|
||
elif bcore in ["O", "o"]:
|
||
bitcoincoremenuLOCALOPRETURN()
|
||
elif bcore in ["Z", "z"]:
|
||
statsConn()
|
||
elif bcore in ["Q", "q"]:
|
||
miningConn()
|
||
elif bcore in ["U", "u"]:
|
||
untxsConn()
|
||
elif bcore in ["S", "s"]:
|
||
counttxs()
|
||
elif bcore in ["PPC", "ppc"]:
|
||
CroppedMinerComputer()
|
||
elif bcore in ["PPR", "ppr"]:
|
||
CroppedMinerRaspberry()
|
||
elif bcore in ["VG", "vg"]:
|
||
clear()
|
||
blogo()
|
||
output = render("Vanity Generator", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 PyVanityGenerator.py", shell=True)
|
||
input("\a\nContinue...")
|
||
|
||
def bitcoincoremenuLOCALcontrolAOnchainONLY(bcore):
|
||
if bcore in ["A", "a"]:
|
||
while True:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
close()
|
||
console()
|
||
t.sleep(5)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif bcore in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
getgenesis()
|
||
input("Continue...")
|
||
menuSelection()
|
||
elif bcore in ["C", "c"]:
|
||
getblock()
|
||
elif bcore in ["D", "d"]:
|
||
runTheNumbersMenuOnchainONLY()
|
||
elif bcore in ["E", "e"]:
|
||
decodeHexOnchainONLY()
|
||
elif bcore in ["F", "f"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
close()
|
||
decodeQR()
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
elif bcore in ["G", "g"]:
|
||
getrawtx()
|
||
elif bcore in ["H", "h"]:
|
||
miscellaneousLOCAL(misce)
|
||
elif bcore in ["J", "j"]:
|
||
pdfconvert()
|
||
elif bcore in ["M", "m"]:
|
||
mtConn()
|
||
elif bcore in ["O", "o"]:
|
||
bitcoincoremenuLOCALOPRETURNOnchainONLY()
|
||
elif bcore in ["W", "w"]:
|
||
walletmenuLOCALOnchainONLY()
|
||
elif bcore in ["Z", "z"]:
|
||
statsConn()
|
||
elif bcore in ["Q", "q"]:
|
||
miningConn()
|
||
elif bcore in ["U", "u"]:
|
||
untxsConn()
|
||
elif bcore in ["S", "s"]:
|
||
searchTXS()
|
||
elif bcore in ["PP", "pp"]:
|
||
CroppedMiner()
|
||
elif bcore in ["PPR", "ppr"]:
|
||
CroppedMinerRaspberry()
|
||
elif bcore in ["VG", "vg"]:
|
||
clear()
|
||
blogo()
|
||
output = render("Vanity Generator", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 PyVanityGenerator.py", shell=True)
|
||
input("\a\nContinue...")
|
||
|
||
def walletmenuLOCALcontrolAOnchainONLY(walletmnu):
|
||
if walletmnu in ["A", "a"]:
|
||
getnewaddressOnchain()
|
||
elif walletmnu in ["B", "b"]:
|
||
gettransactionsOnchain()
|
||
|
||
def bitcoincoremenuLOCALcontrolO(oreturn):
|
||
if oreturn in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
opreturn()
|
||
elif oreturn in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
opreturn_view()
|
||
elif oreturn in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
opretminer()
|
||
|
||
def bitcoincoremenuLOCALcontrolOOnchainONLY(oreturn):
|
||
if oreturn in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
opreturnOnchainONLY()
|
||
elif oreturn in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
opreturn_view()
|
||
elif oreturn in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
opretminer()
|
||
|
||
def miscellaneousLOCALmenu(misce):
|
||
if misce in ["A", "a"]:
|
||
while True:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
logoA()
|
||
tmp()
|
||
clear()
|
||
blogo()
|
||
close()
|
||
logoB()
|
||
tmp()
|
||
clear()
|
||
blogo()
|
||
close()
|
||
logoC()
|
||
tmp()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif misce in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
sysinfoDetail()
|
||
elif misce in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
datesConn()
|
||
elif misce in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
quotesConn()
|
||
elif misce in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
ex()
|
||
elif misce in ["M", "m"]:
|
||
subprocess.run(['printf', '\033[49m'])
|
||
clear()
|
||
subprocess.run(['printf', '\033[49m'])
|
||
blogo()
|
||
output = render("1st 𝕭𝐢𝐭𝐚𝐱𝐞 Block 853742", colors=['white'], align='center', font='console')
|
||
print(output)
|
||
createimagebitaxe()
|
||
input("Continue...")
|
||
elif misce in ["P", "p"]:
|
||
clear()
|
||
blogo()
|
||
pgpConn()
|
||
elif misce in ["S", "s"]:
|
||
clear()
|
||
blogo()
|
||
satoshiConn()
|
||
elif misce in ["X", "x"]:
|
||
clear()
|
||
blogo()
|
||
allblocksConn()
|
||
elif misce in ["SHS", "shs"]:
|
||
clear()
|
||
blogo()
|
||
SHS()
|
||
elif misce in ["Z", "z"]:
|
||
clear()
|
||
blogo()
|
||
decodeStrDat()
|
||
elif misce in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def miscellaneousLOCALmenuOnchainONLY(misce):
|
||
if misce in ["A", "a"]:
|
||
while True:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
logoA()
|
||
tmp()
|
||
clear()
|
||
blogo()
|
||
close()
|
||
logoB()
|
||
tmp()
|
||
clear()
|
||
blogo()
|
||
close()
|
||
logoC()
|
||
tmp()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif misce in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
sysinfoDetail()
|
||
elif misce in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
quotesConn()
|
||
elif misce in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
datesConn()
|
||
elif misce in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
ex()
|
||
elif misce in ["M", "m"]:
|
||
subprocess.run(['printf', '\033[49m'])
|
||
clear()
|
||
subprocess.run(['printf', '\033[49m'])
|
||
blogo()
|
||
output = render("1st 𝕭𝐢𝐭𝐚𝐱𝐞 Block 853742", colors=['white'], align='center', font='console')
|
||
print(output)
|
||
createimagebitaxe()
|
||
input("Continue...")
|
||
elif misce in ["P", "p"]:
|
||
clear()
|
||
blogo()
|
||
pgpConn()
|
||
elif misce in ["S", "s"]:
|
||
clear()
|
||
blogo()
|
||
satoshiConn()
|
||
elif misce in ["X", "x"]:
|
||
clear()
|
||
blogo()
|
||
allblocksConn()
|
||
elif misce in ["SHS", "shs"]:
|
||
clear()
|
||
blogo()
|
||
SHS()
|
||
elif misce in ["Z", "z"]:
|
||
clear()
|
||
blogo()
|
||
decodeStrDat()
|
||
elif misce in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def decodeHexLOCAL(hexloc):
|
||
if hexloc in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
try:
|
||
readHexBlock()
|
||
while True:
|
||
r = input("Do you want to continue decoding? Y/n: ")
|
||
if r not in ["Y", "y"]:
|
||
break
|
||
clear()
|
||
blogo()
|
||
readHexBlock()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
elif hexloc in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
try:
|
||
readHexTx()
|
||
while True:
|
||
r = input("Do you want to continue decoding? Y/n: ")
|
||
if r not in ["Y", "y"]:
|
||
break
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
readHexTx()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
|
||
def decodeHexLOCALOnchainONLY(hexloc):
|
||
if hexloc in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
try:
|
||
readHexBlock()
|
||
while True:
|
||
r = input("Do you want to continue decoding? Y/n: ")
|
||
if r not in ["Y", "y"]:
|
||
break
|
||
clear()
|
||
blogo()
|
||
readHexBlock()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
elif hexloc in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
try:
|
||
readHexTx()
|
||
while True:
|
||
r = input("Do you want to continue decoding? Y/n: ")
|
||
if r not in ["Y", "y"]:
|
||
break
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
readHexTx()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
|
||
def lightningnetworkLOCALcontrol(lncore):
|
||
if lncore in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
consoleLNC()
|
||
elif lncore in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
localaddinvoiceC()
|
||
elif lncore in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
localpayinvoiceC()
|
||
elif lncore in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
localkeysendC()
|
||
elif lncore in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
localnewaddressC()
|
||
elif lncore in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
locallistinvoicesC()
|
||
elif lncore in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
localchannelbalanceC()
|
||
elif lncore in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
locallistchannelsC()
|
||
elif lncore in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
localrebalancelndC()
|
||
elif lncore in ["J", "j"]:
|
||
clear()
|
||
blogo()
|
||
locallistpeersQQC()
|
||
elif lncore in ["K", "k"]:
|
||
clear()
|
||
blogo()
|
||
localconnectpeerC()
|
||
elif lncore in ["L", "l"]:
|
||
clear()
|
||
blogo()
|
||
localbalanceOCC()
|
||
elif lncore in ["M", "m"]:
|
||
clear()
|
||
blogo()
|
||
locallistchaintxnsC()
|
||
elif lncore in ["N", "n"]:
|
||
clear()
|
||
blogo()
|
||
localgetinfoC()
|
||
elif lncore in ["O", "o"]:
|
||
clear()
|
||
blogo()
|
||
localgetnetworkinfoC()
|
||
elif lncore in ["P", "p"]:
|
||
clear()
|
||
blogo()
|
||
chatConn()
|
||
elif lncore in ["Z", "z"]:
|
||
clear()
|
||
blogo()
|
||
stalnConn()
|
||
elif lncore in ["T", "t"]:
|
||
clear()
|
||
blogo()
|
||
ranConn()
|
||
elif lncore in ["Q", "q"]:
|
||
lnbitsLNURLwList()
|
||
elif lncore in ["S", "s"]:
|
||
lnbitsLNURLw()
|
||
elif lncore in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def chatConnA(menuch):
|
||
if menuch in ["A", "a"]:
|
||
pyCHATA()
|
||
elif menuch in ["B", "b"]:
|
||
pyCHATB()
|
||
elif menuch in ["C", "c"]:
|
||
pyCHATC()
|
||
|
||
def chatConnB(pyCHATA):
|
||
if pyCHATA in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
localchatsendAC()
|
||
elif pyCHATA in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
localchatnewAC()
|
||
elif pyCHATA in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
localchatlistAC()
|
||
|
||
def chatConnC(pyCHATB):
|
||
if pyCHATB in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
localchatsendBC()
|
||
elif pyCHATB in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
localchatnewBC()
|
||
elif pyCHATB in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
localchatlistBC()
|
||
|
||
def chatConnD(pyCHATC):
|
||
if pyCHATC in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
localchatsendCC()
|
||
elif pyCHATC in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
localchatnewCC()
|
||
elif pyCHATC in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
localchatlistCC()
|
||
|
||
def platfformsLOCALcontrol(platf):
|
||
if platf in ["A", "a"]:
|
||
aaccPPiTippinMe()
|
||
elif platf in ["B", "b"]:
|
||
aaccPPiTallyCo()
|
||
elif platf in ["C", "c"]:
|
||
mempoolmenu()
|
||
elif platf in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
CoingeckoPP()
|
||
elif platf in ["E", "e"]:
|
||
rateSX()
|
||
elif platf in ["F", "f"]:
|
||
bwtConn()
|
||
elif platf in ["G", "g"]:
|
||
aaccPPiLNBits()
|
||
elif platf in ["H", "h"]:
|
||
aaccPPiLNPay()
|
||
elif platf in ["I", "i"]:
|
||
aaccPPiOpenNode()
|
||
elif platf in ["J", "j"]:
|
||
satnodeMenu()
|
||
elif platf in ["K", "k"]:
|
||
weatherMenu()
|
||
elif platf in ["L", "l"]:
|
||
gameroom()
|
||
elif platf in ["M", "m"]:
|
||
whalalConn()
|
||
elif platf in ["N", "n"]:
|
||
nostrConn()
|
||
elif platf in ["O", "o"]:
|
||
PhoenixConn()
|
||
elif platf in ["P", "p"]:
|
||
PickaxeCon()
|
||
elif platf in ["Q", "q"]:
|
||
OceanConn()
|
||
elif platf in ["R", "r"]:
|
||
luxorstats()
|
||
elif platf in ["S", "s"]:
|
||
slushpoolLOCALOnchainONLY()
|
||
elif platf in ["T", "t"]:
|
||
bip39convert()
|
||
elif platf in ["U", "u"]:
|
||
callGitUTXOracle()
|
||
elif platf in ["W", "w"]:
|
||
ckpoolpoolLOCALOnchainONLY()
|
||
elif platf in ["X", "x"]:
|
||
PyBLOCKTemplate()
|
||
elif platf in ["Z", "z"]:
|
||
pyblockpoolpoolLOCALOnchainONLY()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def platfformsLOCALcontrolOnchainONLY(platf):
|
||
if platf in ["A", "a"]:
|
||
aaccPPiTippin()
|
||
elif platf in ["B", "b"]:
|
||
aaccPPiTallyCo()
|
||
elif platf in ["C", "c"]:
|
||
mempoolmenuOnchainONLY()
|
||
elif platf in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
CoingeckoPP()
|
||
elif platf in ["E", "e"]:
|
||
rateSXOncainONLY()
|
||
elif platf in ["F", "f"]:
|
||
bwtConn()
|
||
elif platf in ["G", "g"]:
|
||
aaccPPiLNBits()
|
||
elif platf in ["H", "h"]:
|
||
aaccPPiLNPay()
|
||
elif platf in ["I", "i"]:
|
||
aaccPPiOpenNode()
|
||
elif platf in ["J", "j"]:
|
||
satnodeMenuOnchainONLY()
|
||
elif platf in ["K", "k"]:
|
||
weatherMenuOnchainONLY()
|
||
elif platf in ["L", "l"]:
|
||
gameroom()
|
||
elif platf in ["M", "m"]:
|
||
whalalConn()
|
||
elif platf in ["N", "n"]:
|
||
nostrConn()
|
||
elif platf in ["O", "o"]:
|
||
PhoenixConn()
|
||
elif platf in ["P", "p"]:
|
||
PickaxeCon()
|
||
elif platf in ["Q", "q"]:
|
||
OceanConn()
|
||
elif platf in ["R", "r"]:
|
||
luxorstats()
|
||
elif platf in ["S", "s"]:
|
||
slushpoolLOCALOnchainONLY()
|
||
elif platf in ["T", "t"]:
|
||
bip39convert()
|
||
elif platf in ["U", "u"]:
|
||
callGitUTXOracle()
|
||
elif platf in ["W", "w"]:
|
||
ckpoolpoolLOCALOnchainONLY()
|
||
elif platf in ["X", "x"]:
|
||
PyBLOCKTemplate()
|
||
elif platf in ["Z", "z"]:
|
||
pyblockpoolpoolLOCALOnchainONLY()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
#----------------------------REMOTE MENUS
|
||
|
||
def mainmenuREMOTEcontrol(menuS): #Execution of the Main Menu options
|
||
if menuS in ["A", "a"]:
|
||
while True:
|
||
try:
|
||
clear()
|
||
close()
|
||
remotegetblock()
|
||
tmp()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif menuS in ["B", "b"]:
|
||
bitcoincoremenuREMOTE()
|
||
elif menuS in ["L", "l"]:
|
||
lightningnetworkREMOTE()
|
||
elif menuS in ["P", "p"]:
|
||
APIMenuLOCAL()
|
||
elif menuS in ["X", "x"]:
|
||
dnt()
|
||
elif menuS in ["S", "s"]:
|
||
settings4Remote()
|
||
elif menuS in ["Q", "q"]:
|
||
os._exit(0)
|
||
apisnd.close()
|
||
donation.close()
|
||
clone.close()
|
||
logos.close()
|
||
feed.close()
|
||
sysinf.close()
|
||
nodeconnection.close()
|
||
exit()
|
||
elif menuS in ["T", "t"]: #Test feature fast access
|
||
clear()
|
||
delay_print("\033[1;32;40mWake up, Neo...")
|
||
t.sleep(2)
|
||
clear()
|
||
delay_print("The Matrix has you...")
|
||
t.sleep(2)
|
||
clear()
|
||
delay_print("Follow the white rabbit.")
|
||
t.sleep(3)
|
||
clear()
|
||
print("Knock, knock, Neo.\033[0;37;40m\n")
|
||
t.sleep(2)
|
||
clear()
|
||
t.sleep(3)
|
||
screensv()
|
||
elif menuS in ["nym", "Nym", "NYM", "nYm", "nyM", "NYm", "NyM", "nYM"]:
|
||
clear()
|
||
blogo()
|
||
robotNym()
|
||
elif menuS in ["wt", "WT", "Wt", "wT"]:
|
||
clear()
|
||
blogo()
|
||
callGitWardenTerminal()
|
||
elif menuS in ["7"]:
|
||
clear()
|
||
blogo()
|
||
output = render("7 Blocks - The Game", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 7Blocks.py", shell=True)
|
||
input("\a\nContinue...")
|
||
elif menuS in ["SOLO", "solo", "SoLo", "sOlO"]:
|
||
clear()
|
||
blogo()
|
||
output = render("Solo Mining", colors=['yellow'], align='left', font='tiny')
|
||
print(output)
|
||
subprocess.run(f"cd SPV && python3 PyBlockMiner.py", shell=True)
|
||
input("\a\nContinue...")
|
||
elif menuS in ["bitaxe", "BITAXE", "BitAxe"]:
|
||
clear()
|
||
blogo()
|
||
BitaxeConn()
|
||
|
||
def bitcoincoremenuREMOTEcontrol(bcore):
|
||
if bcore in ["A", "a"]:
|
||
while True:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
close()
|
||
remoteconsole()
|
||
t.sleep(5)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
break
|
||
elif bcore in ["B", "b"]:
|
||
remotegetblockcount()
|
||
elif bcore in ["C", "c"]:
|
||
runTheNumbersMenuConn()
|
||
elif bcore in ["D", "d"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
sysinfo()
|
||
close()
|
||
decodeQR()
|
||
input("Continue...")
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
elif bcore in ["E", "e"]:
|
||
miscellaneousLOCALmenuOnchainONLY()
|
||
elif bcore in ["O", "o"]:
|
||
bitcoincoremenuREMOTEOPRETURN()
|
||
elif bcore in ["Z", "z"]:
|
||
statsConn()
|
||
elif bcore in ["Q", "q"]:
|
||
miningConn()
|
||
elif bcore in ["U", "u"]:
|
||
untxsConn()
|
||
|
||
def bitcoincoremenuREMOTEcontrolO(oreturn):
|
||
if oreturn in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
opreturn()
|
||
elif oreturn in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
opreturn_view()
|
||
elif oreturn in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
opretminer()
|
||
|
||
def lightningnetworkREMOTEcontrol(lncore):
|
||
if lncore in ["A", "a"]:
|
||
clear()
|
||
blogo()
|
||
getnewinvoice()
|
||
elif lncore in ["B", "b"]:
|
||
clear()
|
||
blogo()
|
||
payinvoice()
|
||
elif lncore in ["C", "c"]:
|
||
clear()
|
||
blogo()
|
||
getnewaddress()
|
||
elif lncore in ["D", "d"]:
|
||
clear()
|
||
blogo()
|
||
listinvoice()
|
||
elif lncore in ["E", "e"]:
|
||
clear()
|
||
blogo()
|
||
channelbalance()
|
||
elif lncore in ["F", "f"]:
|
||
clear()
|
||
blogo()
|
||
channels()
|
||
elif lncore in ["G", "g"]:
|
||
clear()
|
||
blogo()
|
||
balanceOC()
|
||
elif lncore in ["H", "h"]:
|
||
clear()
|
||
blogo()
|
||
listonchaintxs()
|
||
elif lncore in ["I", "i"]:
|
||
clear()
|
||
blogo()
|
||
getinfo()
|
||
elif lncore in ["Z", "z"]:
|
||
clear()
|
||
blogo()
|
||
stalnConn()
|
||
elif lncore in ["T", "t"]:
|
||
clear()
|
||
blogo()
|
||
ranConn()
|
||
elif lncore in ["Q", "q"]:
|
||
lnbitsLNURLwList()
|
||
elif lncore in ["S", "s"]:
|
||
lnbitsLNURLw()
|
||
elif lncore in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuC(menuO): # Donation access Menu
|
||
if menuO in ["A", "a"]:
|
||
dntDev()
|
||
elif menuO in ["B", "b"]:
|
||
dntTst()
|
||
elif menuO in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuCOnchainONLY(menuO): # Donation access Menu
|
||
if menuO in ["A", "a"]:
|
||
dntDevOnchainONLY()
|
||
elif menuO in ["B", "b"]:
|
||
dntTstOnchainONLY()
|
||
elif menuO in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuD(menuN): # Satnode access Menu
|
||
if menuN in ["A", "a"]:
|
||
satnode()
|
||
elif menuN in ["B", "b"]:
|
||
readFile()
|
||
elif menuN in ["S", "s"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
message = input("\n\033[0;37;40mYour message it's a \033[1;34;40mF\033[0;37;40mile or a plain \033[1;32;40mT\033[0;37;40mext? \033[1;34;40mF\033[0;37;40m/\033[1;32;40mT\033[0;37;40m: ")
|
||
if message in ["F", "f"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
apisenderFile()
|
||
t.sleep(30)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif message in ["T", "t"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
apisender()
|
||
t.sleep(30)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuN in ["C", "c"]:
|
||
try:
|
||
print("\n\t This only will work on Linux or Unix systems.\n")
|
||
a = input("Do we continue? Y/n: ")
|
||
if a in ["Y", "y"]:
|
||
gitclone()
|
||
else:
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
pass
|
||
elif menuN in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuE(menuQ): # Dev Donation access Menu
|
||
if menuQ in ["A", "a"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationPayNym()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuQ in ["B", "b"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationAddr()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuQ in ["C", "c"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationLN()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuQ in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuEOnchainONLY(menuQ): # Dev Donation access Menu
|
||
if menuQ in ["A", "a"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationPayNym()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuQ in ["B", "b"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationAddr()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuQ in ["C", "c"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationLN()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuQ in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuF(menuV): # Tester Donation access Menu
|
||
if menuV in ["A", "a"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationAddrTst()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuV in ["B", "b"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationLNTst()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuV in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def menuFOnchainONLY(menuV): # Tester Donation access Menu
|
||
if menuV in ["A", "a"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationAddrTst()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuV in ["B", "b"]:
|
||
try:
|
||
clear()
|
||
blogo()
|
||
close()
|
||
donationLNTst()
|
||
t.sleep(50)
|
||
menuSelection()
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|
||
menuSelection()
|
||
elif menuV in ["R", "r"]:
|
||
menuSelection()
|
||
#---------------------------------------------------------------------------------
|
||
|
||
def nostrmenu(menunos):
|
||
if menunos in ["A", "a"]:
|
||
callGitNostrLinTerminal()
|
||
elif menunos in ["B", "b"]:
|
||
callGitNostrLinarmTerminal()
|
||
elif menunos in ["C", "c"]:
|
||
callGitNostrMacTerminal()
|
||
elif menunos in ["D", "d"]:
|
||
nostrConn()
|
||
elif menunos in ["E", "e"]:
|
||
callGitNostrWinTerminal()
|
||
elif menunos in ["S", "s"]:
|
||
callGitNostrSeedTerminal()
|
||
elif menunos in ["W", "w"]:
|
||
callGitNostrQRSeedTerminal()
|
||
elif menunos in ["Z", "z"]:
|
||
callGitBija()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def phoenixmenu(menunos):
|
||
if menunos in ["A", "a"]:
|
||
callPhoenixLin()
|
||
elif menunos in ["B", "b"]:
|
||
callPhoenixMacARM()
|
||
elif menunos in ["C", "c"]:
|
||
callPhoenixMacX64()
|
||
elif menunos in ["D", "d"]:
|
||
callPhoenixWin()
|
||
elif menunos in ["E", "e"]:
|
||
callPhoenix()
|
||
elif menunos in ["F", "f"]:
|
||
wallPhoenix()
|
||
elif menunos in ["G", "g"]:
|
||
wallPhoenixBOLT12()
|
||
elif menunos in ["W", "w"]:
|
||
callGitRES()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def oceanMstats(menuunos):
|
||
if menuunos in ["A", "a"]:
|
||
oceanE()
|
||
elif menuunos in ["B", "b"]:
|
||
oceanH()
|
||
elif menuunos in ["C", "c"]:
|
||
oceanB()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def bitaxeMstats(menuunos):
|
||
if menuunos in ["A", "a"]:
|
||
bitaxeA()
|
||
elif menuunos in ["B", "b"]:
|
||
bitaxeB()
|
||
elif menuunos in ["C", "c"]:
|
||
bitaxeC()
|
||
elif platf in ["R", "r"]:
|
||
menuSelection()
|
||
|
||
def testClockRemote():
|
||
b = rpc('getblockcount')
|
||
c = str(b)
|
||
a = c
|
||
output = render(
|
||
c,
|
||
colors=[settingsClock['colorA'], settingsClock['colorB']],
|
||
align='left',
|
||
)
|
||
|
||
print(output)
|
||
print("""
|
||
|
||
-------------------------
|
||
Front Color: {}
|
||
Back Color: {}
|
||
-------------------------
|
||
|
||
""".format(settingsClock['colorA'], settingsClock['colorB']))
|
||
try:
|
||
print("<<< Cancel Control + C")
|
||
input("Enter To Apply...")
|
||
settingsClock["gradient"] = "color"
|
||
with open("pyblocksettingsClock.conf", "w") as f:
|
||
json.dump(settingsClock, f, indent=2)
|
||
except Exception as e:
|
||
show_error(str(e))
|
||
logger.debug("spvblock: %s", e)
|