2020-06-25 14:42:50 -03:00
#Developer: Curly60e
2021-11-28 18:25:02 -03:00
#Tester: __B__T__C__
#ℙ 𝕪 𝔹 𝕃 𝕆 ℂ 𝕂 𝕚 𝕥 𝕤 𝕒 𝔹 𝕚 𝕥 𝕔 𝕠 𝕚 𝕟 𝔻 𝕒 𝕤 𝕙 𝕓 𝕠 𝕒 𝕣 𝕕 𝕨 𝕚 𝕥 𝕙 ℂ 𝕪 𝕡 𝕙 𝕖 𝕣 𝕡 𝕦 𝕟 𝕜 𝕒 𝕖 𝕤 𝕥 𝕙 𝕖 𝕥 𝕚 𝕔 .
2020-07-25 10:52:44 -03:00
2020-06-25 14:42:50 -03:00
import base64 , codecs , json , requests
import pickle
import os
import os . path
import qrcode
import lnpay_py
import requests
2020-06-27 17:30:01 -03:00
import xmltodict
2020-06-25 14:42:50 -03:00
import time as t
2021-05-17 15:00:06 -03:00
import simplejson as json
2020-06-25 14:42:50 -03:00
from art import *
2021-11-27 10:40:38 -03:00
from cfonts import render , say
2020-07-06 21:20:55 -03:00
from nodeconnection import *
2020-06-25 14:42:50 -03:00
from pblogo import *
from logos import *
from lnpay_py . wallet import LNPayWallet
2020-09-09 20:21:00 -03:00
from pycoingecko import CoinGeckoAPI
2020-06-25 14:42:50 -03:00
def clear ( ) : # clear the screen
os . system ( ' cls ' if os . name == ' nt ' else ' clear ' )
2020-09-18 19:36:58 -03:00
def closed ( ) :
print ( " <<< Back Control + C. \n \n " )
2020-09-19 22:54:27 -03:00
2021-12-01 16:57:56 -03:00
def opreturnOnchainONLY ( ) :
qr = qrcode . QRCode (
version = 1 ,
error_correction = qrcode . constants . ERROR_CORRECT_L ,
box_size = 10 ,
border = 4 ,
)
try :
clear ( )
blogo ( )
2022-03-12 02:04:49 +00:00
output = render (
" OP_RETURN Message " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-12-01 16:57:56 -03:00
print ( output )
message = input ( " Message: " )
2022-03-12 02:04:49 +00:00
curl = (
" curl --header "
+ """ " Content-Type: application/json " """
+ " --request POST --data "
+ """ ' { " message " : """
+ f ' " { message } ...PyBLOCK " '
+ " } ' "
+ " https://opreturnbot.com/api/create "
)
2022-05-09 18:28:47 +00:00
while len ( message ) > 70 :
2021-12-01 16:57:56 -03:00
clear ( )
blogo ( )
print ( " Error! Only 80 characters allowed! " )
message = input ( " \n Message: " )
a = os . popen ( curl ) . read ( )
b = str ( a )
clear ( )
blogo ( )
print ( " \033 [1;30;47m " )
qr . add_data ( b )
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
2022-02-12 14:26:59 +00:00
print ( f ' LND Invoice: { b } ' )
2021-12-01 16:57:56 -03:00
qr . clear ( )
input ( " \n Continue... " )
if lndconnectload [ ' ln ' ] :
invoiceN = b
invoice = invoiceN . lower ( )
lncli = " payinvoice "
2022-02-12 14:26:59 +00:00
lsd = os . popen ( f ' { lndconnectload [ " ln " ] } decodepayreq { invoice } ' ) . read ( )
2021-12-01 16:57:56 -03:00
lsd0 = str ( lsd )
d = json . loads ( lsd0 )
2022-03-12 02:04:49 +00:00
url = f " http://opreturnbot.com/api/status/ { d [ ' payment_hash ' ] } "
2021-12-01 16:57:56 -03:00
else :
cert_path = lndconnectload [ " tls " ]
macaroon = codecs . encode ( open ( lndconnectload [ " macaroon " ] , ' rb ' ) . read ( ) , ' hex ' )
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:04:49 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/payreq/ { b } '
2021-12-01 16:57:56 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
s = r . json ( )
2022-03-12 02:04:49 +00:00
url = f " http://opreturnbot.com/api/status/ { s [ ' payment_hash ' ] } "
2021-12-01 16:57:56 -03:00
response = requests . get ( url )
responseB = str ( response . text )
responseC = responseB
clear ( )
blogo ( )
print ( " \n Transaction ID: " + responseC )
input ( " \n Continue... " )
except :
pass
2020-09-19 22:54:27 -03:00
2021-05-17 15:00:06 -03:00
def opreturn ( ) :
qr = qrcode . QRCode (
version = 1 ,
error_correction = qrcode . constants . ERROR_CORRECT_L ,
box_size = 10 ,
border = 4 ,
)
try :
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
if os . path . isfile ( ' blndconnect.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
else :
clear ( )
blogo ( )
print ( " \n \t If you are going to use your local node leave IP:PORT/CERT/MACAROONS in blank. \n " )
lndconnectload [ " ip_port " ] = input ( " Insert IP:PORT to your node: " ) # path to the bitcoin-cli
lndconnectload [ " tls " ] = input ( " Insert the path to tls.cert file: " )
lndconnectload [ " macaroon " ] = input ( " Insert the path to admin.macaroon: " )
print ( " \n \t Local Lightning Node connection. \n " )
lndconnectload [ " ln " ] = input ( " Insert the path to lncli: " )
pickle . dump ( lndconnectload , open ( " blndconnect.conf " , " wb " ) ) # Save the file 'bclock.conf'
path = { " ip_port " : " " , " rpcuser " : " " , " rpcpass " : " " , " bitcoincli " : " " }
if os . path . isfile ( ' bclock.conf ' ) or os . path . isfile ( ' blnclock.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
pathv = pickle . load ( open ( " bclock.conf " , " rb " ) ) # Load the file 'bclock.conf'
path = pathv # Copy the variable pathv to 'path'
else :
blogo ( )
print ( " Welcome to \033 [1;31;40mPyBLOCK \033 [0;37;40m \n \n " )
print ( " \n \t If you are going to use your local node leave IP:PORT/USER/PASSWORD in blank. \n " )
2022-03-12 02:04:49 +00:00
path [
' ip_port '
] = f ' http:// { input ( " Insert IP:PORT to access your remote Bitcoin-Cli node: " ) } '
2021-05-17 15:00:06 -03:00
path [ ' rpcuser ' ] = input ( " RPC User: " )
path [ ' rpcpass ' ] = input ( " RPC Password: " )
print ( " \n \t Local Bitcoin Core Node connection. \n " )
path [ ' bitcoincli ' ] = input ( " Insert the Path to Bitcoin-Cli: " )
pickle . dump ( path , open ( " bclock.conf " , " wb " ) )
clear ( )
blogo ( )
2022-03-12 02:04:49 +00:00
output = render (
" OP_RETURN Message " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-12-01 16:57:56 -03:00
print ( output )
2021-05-17 15:00:06 -03:00
message = input ( " Message: " )
2022-03-12 02:04:49 +00:00
curl = (
" curl --header "
+ """ " Content-Type: application/json " """
+ " --request POST --data "
+ """ ' { " message " : """
+ f ' " { message } ...PyBLOCK " '
+ " } ' "
+ " https://opreturnbot.com/api/create "
)
2022-05-09 18:28:47 +00:00
while len ( message ) > 70 :
2021-11-25 20:44:22 +00:00
clear ( )
blogo ( )
print ( " Error! Only 80 characters allowed! " )
message = input ( " \n Message: " )
2021-05-17 15:00:06 -03:00
a = os . popen ( curl ) . read ( )
b = str ( a )
node_not = input ( " \n Do you want to pay this invoice with your node? Y/n: " )
if node_not in [ " Y " , " y " ] :
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload [ ' ip_port ' ] :
print ( " \n Invoice: " + b + " \n " )
payinvoice ( )
cert_path = lndconnectload [ " tls " ]
macaroon = codecs . encode ( open ( lndconnectload [ " macaroon " ] , ' rb ' ) . read ( ) , ' hex ' )
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:04:49 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/payreq/ { b } '
2021-05-17 15:00:06 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
s = r . json ( )
2022-03-12 02:04:49 +00:00
url = f " http://opreturnbot.com/api/status/ { s [ ' payment_hash ' ] } "
2021-05-17 15:00:06 -03:00
response = requests . get ( url )
responseB = str ( response . text )
responseC = responseB
clear ( )
blogo ( )
print ( " \n Transaction ID: " + responseC )
input ( " \n Continue... " )
elif lndconnectload [ ' ln ' ] :
print ( " \n Invoice: " + b + " \n " )
localpayinvoice ( )
invoiceN = b
invoice = invoiceN . lower ( )
lncli = " payinvoice "
2022-02-12 14:26:59 +00:00
lsd = os . popen ( f ' { lndconnectload [ " ln " ] } decodepayreq { invoice } ' ) . read ( )
2021-05-17 15:00:06 -03:00
lsd0 = str ( lsd )
d = json . loads ( lsd0 )
2022-03-12 02:04:49 +00:00
url = f " http://opreturnbot.com/api/status/ { d [ ' payment_hash ' ] } "
2021-05-17 15:00:06 -03:00
response = requests . get ( url )
responseB = str ( response . text )
responseC = responseB
clear ( )
blogo ( )
print ( " \n Transaction ID: " + responseC )
input ( " \n Continue... " )
else :
clear ( )
blogo ( )
print ( " \033 [1;30;47m " )
qr . add_data ( b )
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
2022-02-12 14:26:59 +00:00
print ( f ' LND Invoice: { b } ' )
2021-05-17 15:00:06 -03:00
qr . clear ( )
input ( " \n Continue... " )
if lndconnectload [ ' ln ' ] :
invoiceN = b
invoice = invoiceN . lower ( )
lncli = " payinvoice "
2022-02-12 14:26:59 +00:00
lsd = os . popen ( f ' { lndconnectload [ " ln " ] } decodepayreq { invoice } ' ) . read ( )
2021-05-17 15:00:06 -03:00
lsd0 = str ( lsd )
d = json . loads ( lsd0 )
2022-03-12 02:04:49 +00:00
url = f " http://opreturnbot.com/api/status/ { d [ ' payment_hash ' ] } "
2021-05-17 15:00:06 -03:00
else :
cert_path = lndconnectload [ " tls " ]
macaroon = codecs . encode ( open ( lndconnectload [ " macaroon " ] , ' rb ' ) . read ( ) , ' hex ' )
headers = { ' Grpc-Metadata-macaroon ' : macaroon }
2022-03-12 02:04:49 +00:00
url = f ' https:// { lndconnectload [ " ip_port " ] } /v1/payreq/ { b } '
2021-05-17 15:00:06 -03:00
r = requests . get ( url , headers = headers , verify = cert_path )
s = r . json ( )
2022-03-12 02:04:49 +00:00
url = f " http://opreturnbot.com/api/status/ { s [ ' payment_hash ' ] } "
2021-11-25 20:44:22 +00:00
response = requests . get ( url )
responseB = str ( response . text )
responseC = responseB
clear ( )
blogo ( )
print ( " \n Transaction ID: " + responseC )
input ( " \n Continue... " )
2021-05-17 15:00:06 -03:00
except :
pass
def opreturn_view ( ) :
try :
clear ( )
blogo ( )
2022-03-12 02:04:49 +00:00
output = render (
" OP_RETURN Message " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-12-01 16:57:56 -03:00
print ( output )
2021-05-17 15:00:06 -03:00
responseC = input ( " TX ID: " )
2022-03-12 02:04:49 +00:00
url2 = f ' http://opreturnbot.com/api/view/ { responseC } '
2021-05-17 15:00:06 -03:00
r = requests . get ( url2 )
r2 = str ( r . text )
r3 = r2
clear ( )
blogo ( )
print ( " \n Transaction ID: " + responseC )
2022-02-12 14:26:59 +00:00
print ( f ' OP_RETURN Message: { r3 } ' )
2021-05-17 15:00:06 -03:00
input ( " \n Continue... " )
except :
pass
2021-12-01 16:57:56 -03:00
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 = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render (
" decoded coinbase " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-12-01 16:57:56 -03:00
print ( output )
print ( a )
input ( " " )
except :
pass
2020-10-05 22:53:40 -03:00
#-----------------------------GAMES--------------------------------
#------------------------------------------------------------------
2020-10-12 21:05:01 -03:00
def gameroom ( ) :
try :
clear ( )
blogo ( )
2020-10-17 21:04:28 -03:00
print ( """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
INITIATE ARCADE ?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
""" .format(closed()))
input ( " \a \n Continue... " )
2020-10-12 21:05:01 -03:00
conn = " ssh gameroom@bitreich.org "
os . system ( conn ) . read ( )
except :
pass
#----------------------------------------------------------------------
2021-11-26 01:06:18 -03:00
#-----------------------------Stats--------------------------------
2021-11-26 01:06:34 -03:00
def statsConn ( ) :
2021-11-26 01:06:18 -03:00
try :
2022-02-12 11:25:12 -03:00
conn = """ curl -s https://www.bitcoinblockhalf.com/ | html2text | grep -E " Total " -A 10 | grep -v -E " \ -- " | tr -d ' * ' | tr -d ' " ' """
2021-11-26 01:06:18 -03:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render ( " stats " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-11-27 10:53:51 -03:00
print ( output )
2021-11-26 01:06:18 -03:00
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END Stats--------------------------------
2022-03-12 03:03:54 +01:00
2022-03-12 16:31:25 +01:00
#-----------------------------PGP--------------------------------
def pgpConn ( ) :
try :
conn = """ curl -s https://web.archive.org/web/20110228054007/http://www.bitcoin.org/Satoshi_Nakamoto.asc """
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
output = render (
" pgp " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
print ( output )
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END PGP--------------------------------
2022-05-09 20:28:07 +02:00
#-----------------------------MT--------------------------------
2022-10-09 17:30:24 +02:00
def mtConn ( ) : # here we convert the result of the command 'getblockcount' on a random art design
while True :
try :
clear ( )
close ( )
mtclock ( )
except :
break
2022-05-09 20:28:07 +02:00
2022-10-09 17:30:24 +02:00
def mtclock ( ) :
2022-10-08 19:28:16 +02:00
if os . path . isfile ( ' config/pyblocksettingsClock.conf ' ) or os . path . isfile ( ' config/pyblocksettingsClock.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
settingsv = pickle . load ( open ( " config/pyblocksettingsClock.conf " , " rb " ) ) # Load the file 'bclock.conf'
settingsClock = settingsv # Copy the variable pathv to 'path'
else :
settingsClock = { " gradient " : " " , " design " : " block " , " colorA " : " green " , " colorB " : " yellow " }
pickle . dump ( settingsClock , open ( " config/pyblocksettingsClock.conf " , " wb " ) )
clear ( )
r = requests . get ( ' https://bitcoinexplorer.org/api/price/usd/sats ' )
r . headers [ ' Content-Type ' ]
n = r . text
di = json . loads ( n )
a = di
b = str ( a )
clear ( )
close ( )
output = render ( str ( a ) , colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] , align = ' center ' )
print ( " \033 [0;37;40m \x1b [?25l " + output )
while True :
x = b
r = requests . get ( ' https://bitcoinexplorer.org/api/price/usd/sats ' )
r . headers [ ' Content-Type ' ]
n = r . text
di = json . loads ( n )
a = di
if x < str ( a ) :
clear ( )
close ( )
output5 = subprocess . check_output ( [ ' sudo ' , ' iwgetid ' ] )
z = str ( output5 )
pp = random . choice ( list ( faceshappy . values ( ) ) ) . encode ( ' utf-8 ' ) . decode ( ' latin-1 ' )
output = render ( str ( a ) , colors = [ settingsClock [ ' colorA ' ] , settingsClock [ ' colorB ' ] ] , align = ' center ' )
print ( " \033 [0;37;40m \x1b [?25l " + output )
b = str ( a ) #try:
2022-05-09 20:28:07 +02:00
#-----------------------------END MT--------------------------------
2022-03-12 03:03:54 +01:00
#-----------------------------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 = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render (
2022-03-12 04:09:40 +01:00
" 𝐒 𝐚 𝐭 𝐨 𝐬 𝐡 𝐢 𝐍𝐚𝐤𝐚𝐦𝐨𝐭𝐨. 𝟎 𝐱 𝟏 𝟖 𝐂 𝟎 𝟗 𝐄 𝟖 𝟔 𝟓 𝐄 𝐂 𝟗 𝟒 𝟖 𝐀 𝟏 . 𝐃 𝐄 𝟒 𝐄 𝐅 𝐂 𝐀 𝟑 𝐄 𝟏 𝐀 𝐁 𝟗 𝐄 𝟒 𝟏 𝐂 𝐄 𝟗 𝟔 𝐂 𝐄 𝐂 𝐁 𝟏 𝟖 𝐂 𝟎 𝟗 𝐄 𝟖 𝟔 𝟓 𝐄 𝐂 𝟗 𝟒 𝟖 𝐀 𝟏 ." , colors = [ ' green ' ] , align = ' left ' , font = ' console '
2022-03-12 02:04:49 +00:00
)
2022-03-12 03:03:54 +01:00
print ( output )
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END Satoshi--------------------------------
2021-11-27 04:33:05 +01:00
#-----------------------------Whale Alert--------------------------------
def whalalConn ( ) :
try :
2022-03-25 21:21:06 +01:00
conn = """ curl -s ' https://api.whale-alert.io/v1/transactions?api_key=3LYGErNwoCSj6QUsWOWdpEuGTuYxakMZ&limit=7&min_value=5000000¤cy=btc ' | jq -C ' .transactions[] ' | tr -d ' { |}|,| " |:| ' | grep -E " blockchain|amount " -A 8 | grep -v -E " \ --|from|symbol|to|id " | xargs -L 1 | sed ' s/blockchain/PyBLØCK/g ' | sed ' s/amount/₿/g ' | sed ' s/_usd/=$/g ' | sed ' s/bitcoin/WHALE ALERT/g ' | grep -E ' ' """
2021-11-27 04:33:05 +01:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render ( " whale alert " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-11-27 10:35:07 -03:00
print ( output )
2021-11-27 04:33:05 +01:00
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END Whale Alert--------------------------------
2021-11-28 14:32:30 -03:00
#-----------------------------bwt.dev--------------------------------
2021-11-26 01:06:18 -03:00
2021-11-28 14:32:30 -03:00
def bwtConn ( ) :
try :
conn = " curl -s https://bwt.dev/banner.txt "
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END bwt.dev--------------------------------
2021-12-08 17:26:17 -03:00
#-----------------------------Dates--------------------------------
2021-12-06 16:57:06 +01:00
def datesConn ( ) :
try :
2022-02-12 11:25:12 -03:00
conn = """ curl -s " https://bitcoinexplorer.org/fun " | html2text | grep " 20 " | grep -v -E " https " | grep -E " " | head -n 46 | tr -d ' [ ' | tr -d ' , ' """
2021-12-06 16:57:06 +01:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render ( " dates " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-12-06 17:17:49 +01:00
print ( output )
2021-12-06 16:57:06 +01:00
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END Dates--------------------------------
#-----------------------------Quotes--------------------------------
2021-12-06 17:10:13 +01:00
def quotesConn ( ) :
2021-12-06 16:57:06 +01:00
try :
2021-12-06 17:52:33 -03:00
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 ' """
2021-12-06 16:57:06 +01:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render ( " quotes " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-12-06 17:17:49 +01:00
print ( output )
2021-12-06 16:57:06 +01:00
print ( a )
input ( " \a \n Continue... " )
except :
pass
2022-03-12 10:26:00 -03:00
2021-12-06 16:57:06 +01:00
#-----------------------------END Quotes--------------------------------
#-----------------------------Hashrate--------------------------------
def miningConn ( ) :
try :
2022-03-26 14:35:13 +01:00
conn = """ curl -s " https://bitcoinexplorer.org/api/mining/hashrate " | jq -C ' .[] ' | tr -d ' { |}|]|, ' | tr -d ' " ' """
2021-12-06 16:57:06 +01:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render ( " hashrate " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-12-06 17:17:49 +01:00
print ( output )
2021-12-06 16:57:06 +01:00
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END Hashrate--------------------------------
2021-11-28 18:25:02 -03:00
#-----------------------------StatsLN--------------------------------
def stalnConn ( ) :
try :
2022-02-12 11:25:12 -03:00
conn = """ curl -s ' https://1ml.com ' | html2text | xargs -L 1 | grep -E " Number " -A 8 """
2021-11-28 18:25:02 -03:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render (
" lightning stats " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny '
)
2021-11-28 18:25:02 -03:00
print ( output )
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END StatsLN--------------------------------
#-----------------------------StatRanking--------------------------------
def ranConn ( ) :
try :
2021-12-01 16:57:56 -03:00
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 '
2021-11-30 01:14:11 +01:00
"""
2021-11-28 18:25:02 -03:00
a = os . popen ( conn ) . read ( )
clear ( )
blogo ( )
closed ( )
2022-03-12 02:04:49 +00:00
output = render ( " ranking " , colors = [ ' yellow ' ] , align = ' left ' , font = ' tiny ' )
2021-11-28 18:25:02 -03:00
print ( output )
print ( a )
input ( " \a \n Continue... " )
except :
pass
#-----------------------------END Ranking--------------------------------
2021-11-27 10:40:38 -03:00
2020-10-15 22:36:52 -03:00
def trustednode ( ) :
try :
clear ( )
blogo ( )
2020-10-17 21:04:28 -03:00
closed ( )
2020-10-15 22:36:52 -03:00
addv = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REMEMBER TO INITIALIZE \033 [ 1 ; 35 ; 40 mTOR \033 [ 0 ; 37 ; 40 m ON THE SHELL
$ source torsocks on
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
print ( addv )
2020-10-17 21:04:28 -03:00
input ( " \a \n Continue... " )
2020-10-15 22:36:52 -03:00
conn = " telnet cut45oarvxfvfydrjery6slyeca4zpal7tljygdt5bji7l3jsrrgwkad.onion 6023 "
os . system ( conn )
except :
pass
2020-10-05 22:53:40 -03:00
#-----------------------------END GAMES--------------------------------
2021-11-03 21:33:58 +01:00
2020-09-19 22:54:27 -03:00
#-----------------------------wttr.in--------------------------------
def wttrDataV1 ( ) :
try :
clear ( )
blogo ( )
weatherList = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2021-11-06 13:31:05 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m uruguay # city name
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m ~ Giza + pyramid # any location (+ for spaces)
2020-09-19 22:54:27 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m Москва # Unicode name of any location in any language
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m muc # airport code (3 letters)
2021-11-06 13:31:05 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m @lightninghood.com # domain name
2020-09-19 22:54:27 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m 94107 # area codes
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m - 78.46 , 106.79 # GPS coordinates
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m moon # Moon phase (add ,+US or ,+France for these cities)
2021-11-06 13:31:05 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m moon @ 2009 - 01 - 03 # Moon phase for the date (@2016-10-25)
2020-09-20 20:12:40 -03:00
PRESS \033 [ 1 ; 32 ; 40 mM \033 [ 0 ; 37 ; 40 m TO INSERT MORE DATA
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
"""
print ( weatherList )
selectData = input ( " Insert your data \033 [1;31;40m* \033 [0;37;40m : " )
if selectData in [ ' M ' , ' m ' ] :
moreData = """
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Supported languages
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
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 )
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Units
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
m # metric (SI) (used by default everywhere except US)
u # USCS (used by default in US)
M # show wind speed in m/s
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
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: " )
2020-09-20 19:52:24 -03:00
list = " curl ' " + lang + " .wttr.in/ " + selectData2 + " ?F& " + unit + " ' "
2020-09-19 22:54:27 -03:00
else :
2022-02-12 14:26:59 +00:00
list = f ' curl wttr.in/ { selectData } ?F '
2020-10-16 11:21:41 +00:00
a = os . popen ( list ) . read ( )
clear ( )
blogo ( )
print ( a )
2020-10-16 08:21:09 -03:00
input ( " Continue... " )
2020-09-19 22:54:27 -03:00
except :
pass
def wttrDataV2 ( ) :
try :
clear ( )
blogo ( )
weatherList = """
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2021-11-06 13:31:05 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m uruguay # city name
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m ~ Giza + pyramid # any location (+ for spaces)
2020-09-19 22:54:27 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m Москва # Unicode name of any location in any language
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m muc # airport code (3 letters)
2021-11-06 13:31:05 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m @lightninghood.com # domain name
2020-09-19 22:54:27 -03:00
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m 94107 # area codes
\033 [ 1 ; 31 ; 40 m * \033 [ 0 ; 37 ; 40 m - 78.46 , 106.79 # GPS coordinates
2021-11-06 13:31:05 -03:00
2020-09-20 20:12:40 -03:00
PRESS \033 [ 1 ; 32 ; 40 mM \033 [ 0 ; 37 ; 40 m TO INSERT MORE DATA
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
"""
print ( weatherList )
selectData = input ( " Insert your data \033 [1;31;40m* \033 [0;37;40m : " )
if selectData in [ ' M ' , ' m ' ] :
moreData = """
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Supported languages
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
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 )
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Units
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
m # metric (SI) (used by default everywhere except US)
u # USCS (used by default in US)
M # show wind speed in m/s
2021-11-06 13:31:05 -03:00
2020-09-19 22:54:27 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
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: " )
2020-09-20 19:52:24 -03:00
list = " curl ' v2.wttr.in/ " + selectData2 + " ? " + unit + " &F&lang= " + lang + " ' "
2020-10-16 16:56:11 -03:00
2020-09-19 22:54:27 -03:00
else :
2022-02-12 14:26:59 +00:00
list = f ' curl v2.wttr.in/ { selectData } ?F '
2020-10-16 11:21:41 +00:00
a = os . popen ( list ) . read ( )
clear ( )
blogo ( )
print ( a )
2020-10-16 08:21:09 -03:00
input ( " Continue... " )
2020-09-19 22:54:27 -03:00
except :
pass
#-----------------------------END wttr.in--------------------------------
2021-11-06 13:31:05 -03:00
2020-09-18 19:36:58 -03:00
#-----------------------------RATE.SX--------------------------------
def rateSXList ( ) :
2021-12-08 17:26:17 -03:00
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 :
pass
2020-09-18 19:36:58 -03:00
while True :
try :
2021-11-30 01:59:28 +01:00
list = " curl -s ' " + selectFiat + " .rate.sx/?F&n=1 ' "
2020-09-18 19:36:58 -03:00
a = os . popen ( list ) . read ( )
clear ( )
blogo ( )
closed ( )
print ( a )
t . sleep ( 20 )
except :
break
def rateSXGraph ( ) :
2021-12-08 17:26:17 -03:00
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 :
pass
2020-09-18 19:36:58 -03:00
while True :
try :
2021-11-30 14:54:44 -03:00
list = " curl -s ' " + selectFiat + """ .rate.sx/btc ' | grep -v -E ' Use ' """
2020-09-18 19:36:58 -03:00
a = os . popen ( list ) . read ( )
clear ( )
blogo ( )
closed ( )
print ( a )
t . sleep ( 20 )
except :
break
#-----------------------------END RATE.SX--------------------------------
2020-09-09 20:21:00 -03:00
#-----------------------------COINGECKO--------------------------------
def CoingeckoPP ( ) :
2021-12-08 17:26:17 -03:00
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 ' ]
2020-09-09 20:21:00 -03:00
2021-12-08 17:26:17 -03:00
print ( """
- - - - - - - - - - - - - - - - - - - - COINGECKO BITCOIN PRICE - - - - - - - - - - - - - - - - - - - - - - -
2020-09-09 20:21:00 -03:00
2021-12-08 17:26:17 -03:00
1 BTC = { } USD
1 BTC = { } EUR
1 BTC = { } GBP
1 BTC = { } JPY
1 BTC = { } AUD
2020-09-09 20:21:00 -03:00
2021-12-08 17:26:17 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2020-09-09 20:21:00 -03:00
2021-12-08 17:26:17 -03:00
. . . BUT . . .
2020-09-09 20:21:00 -03:00
2021-12-08 17:26:17 -03:00
1 BTC = 1 BTC
2020-09-09 20:21:00 -03:00
2021-12-08 17:26:17 -03:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
""" .format(usd,eur,gbp,jpy,aud))
input ( " Continue... " )
except :
pass
2020-09-09 20:21:00 -03:00
#-----------------------------END COINGECKO--------------------------------
2020-06-25 14:42:50 -03:00
#-----------------------------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
lnbitData = pickle . load ( open ( " lnbit.conf " , " rb " ) ) # 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: " )
pickle . dump ( lnbitLoad , open ( " lnbit.conf " , " wb " ) )
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
""" )
2022-02-12 14:26:59 +00:00
lnbitLoad = {
' wallet_id ' : ' ' ,
' admin_key ' : ' ' ,
' invoice_read_key ' : ' ' ,
' wallet_name ' : input ( " Wallet name: " ) ,
}
2020-06-25 14:42:50 -03:00
lnbitLoad [ " wallet_id " ] = input ( " Wallet ID: " )
lnbitLoad [ " admin_key " ] = input ( " Admin key: " )
lnbitLoad [ " invoice_read_key " ] = input ( " Invoice/read key: " )
pickle . dump ( lnbitLoad , open ( " lnbit.conf " , " wb " ) )
def lnbitCreateNewInvoice ( ) :
qr = qrcode . QRCode (
version = 1 ,
error_correction = qrcode . constants . ERROR_CORRECT_L ,
box_size = 10 ,
border = 4 ,
)
try :
print ( " \n \t LNBITS CREATE INVOICE \n " )
amt = input ( " Amount: " )
memo = input ( " Memo: " )
a = loadFileConnLNBits ( [ ' invoice_read_key ' ] )
b = str ( a [ ' invoice_read_key ' ] )
2022-03-12 02:04:49 +00:00
curl = (
' curl -X POST https://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 " """
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
q = d [ ' payment_request ' ]
c = q . lower ( )
2020-07-10 15:21:16 -03:00
node_not = input ( " Do you want to pay this invoice with your node? Y/n: " )
2020-07-09 20:10:01 -03:00
2020-06-25 14:42:50 -03:00
while True :
2020-07-09 20:10:01 -03:00
if node_not in [ " Y " , " y " ] :
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload [ ' ip_port ' ] :
print ( " \n Invoice: " + c + " \n " )
payinvoice ( )
elif lndconnectload [ ' ln ' ] :
print ( " \n Invoice: " + 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 ( )
2022-02-12 14:26:59 +00:00
print ( f ' Lightning Invoice: { c } ' )
2020-07-09 20:10:01 -03:00
t . sleep ( 10 )
dn = str ( d [ ' checking_id ' ] )
2022-02-12 14:26:59 +00:00
checkcurl = (
f ' curl -X GET https://lnbits.com/api/v1/payments/ { dn } '
2022-03-12 02:04:49 +00:00
+ f """ -H " X-Api-Key: { b } " -H " Content-type: application/json " """
2022-02-12 14:26:59 +00:00
)
2022-03-12 02:04:49 +00:00
2020-07-09 20:10:01 -03:00
rsh = os . popen ( checkcurl ) . read ( )
2020-06-25 14:42:50 -03:00
clear ( )
blogo ( )
2020-07-09 20:10:01 -03:00
nn = str ( rsh )
dd = json . loads ( nn )
db = dd [ ' paid ' ]
2021-04-09 14:57:03 +00:00
if db != True :
2020-07-09 20:10:01 -03:00
continue
2021-04-09 14:57:03 +00:00
clear ( )
blogo ( )
tick ( )
t . sleep ( 2 )
break
2020-06-25 14:42:50 -03:00
except :
pass
def lnbitPayInvoice ( ) :
bolt = input ( " Invoice: " )
a = loadFileConnLNBits ( [ ' admin_key ' ] )
b = str ( a [ ' admin_key ' ] )
2022-03-12 02:04:49 +00:00
curl = (
' curl -X POST https://lnbits.com/api/v1/payments -d '
+ " ' { "
+ f """ " out " : true, " bolt11 " : " { bolt } " """
+ " } ' "
+ f """ -H " X-Api-Key: { b } " -H " Content-type: application/json " """
)
2020-06-25 14:42:50 -03:00
try :
sh = os . popen ( curl ) . read ( )
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 :
2022-02-12 14:26:59 +00:00
checkcurl = (
f ' curl -X GET https://lnbits.com/api/v1/payments/ { dn } '
2022-03-12 02:04:49 +00:00
+ f """ -H " X-Api-Key: { b } " -H " Content-type: application/json " """
2022-02-12 14:26:59 +00:00
)
2022-03-12 02:04:49 +00:00
2020-06-25 14:42:50 -03:00
rsh = os . popen ( checkcurl ) . read ( )
clear ( )
blogo ( )
nn = str ( rsh )
dd = json . loads ( nn )
db = dd [ ' paid ' ]
2021-04-09 14:57:03 +00:00
if db != True :
2020-06-25 14:42:50 -03:00
continue
2021-04-09 14:57:03 +00:00
tick ( )
t . sleep ( 2 )
break
2020-06-25 14:42:50 -03:00
except :
pass
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 "
2022-10-08 17:29:08 +00:00
b = str ( a [ ' admin_key ' ] )
2022-03-12 02:04:49 +00:00
curl = (
' curl -X POST https://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 } " """
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
print ( " \n \t PAYWALL CREATED SUCCESSFULLY \n " )
t . sleep ( 2 )
clear ( )
aa = loadFileConnLNBits ( [ ' invoice_read_key ' ] )
bb = str ( a [ ' invoice_read_key ' ] )
2022-10-08 17:29:08 +00:00
checkcurl = f """ curl -X GET https://lnbits.com/paywall/api/v1/paywalls -H " X-Api-Key: { bb } " """
2022-03-12 02:04:49 +00:00
2020-06-25 14:42:50 -03:00
sh = os . popen ( checkcurl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
while True :
print ( " \n \t LNBITS PAYWALL LIST \n " )
2020-06-25 21:12:07 +00:00
for item_ in d :
s = item_
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } ' )
2020-06-25 14:42:50 -03:00
nd = input ( " \n Select ID: " )
2020-06-25 21:12:07 +00:00
for item in d :
s = item
2020-06-25 14:42:50 -03:00
nn = s [ ' id ' ]
if nd == nn :
print ( " \n ---------------------------------------------------------------------------------------------------------------- " )
2022-10-08 17:29:08 +00:00
print (
"""
2020-06-25 14:42:50 -03:00
\tLNBITS PAYWALL DECODED
ID : { }
Amount : { } sats
Description : { }
Memo : { }
Extras : { }
Remembers : { }
URL : { }
Wallet : { }
2022-10-08 17:29:08 +00:00
""" .format(
nn ,
s [ ' amount ' ] ,
s [ ' description ' ] ,
s [ ' memo ' ] ,
s [ ' extras ' ] ,
s [ ' remembers ' ] ,
s [ ' url ' ] ,
s [ ' wallet ' ] ,
)
)
2020-06-25 14:42:50 -03:00
print ( " ---------------------------------------------------------------------------------------------------------------- \n " )
input ( " Continue... " )
clear ( )
blogo ( )
except :
break
def lnbitListPawWall ( ) :
a = loadFileConnLNBits ( [ ' invoice_read_key ' ] )
b = str ( a [ ' invoice_read_key ' ] )
2022-03-12 02:04:49 +00:00
checkcurl = (
' curl -X GET https://lnbits.com/paywall/api/v1/paywalls -H '
+ f """ " X-Api-Key: { b } " """
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( checkcurl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
while True :
print ( " \n \t LNBITS PAYWALL LIST \n " )
try :
for item_ in d :
s = item_
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } ' )
2020-06-25 14:42:50 -03:00
nd = input ( " \n Select 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 :
break
input ( " Continue... " )
clear ( )
blogo ( )
def lnbitDeletePayWall ( ) :
while True :
try :
a = loadFileConnLNBits ( [ ' invoice_read_key ' ] )
b = str ( a [ ' invoice_read_key ' ] )
2022-03-12 02:04:49 +00:00
checkcurl = (
' curl -X GET https://lnbits.com/paywall/api/v1/paywalls -H '
+ f """ " X-Api-Key: { b } " """
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( checkcurl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
while True :
print ( " \n \t LNBITS PAYWALL LIST \n " )
try :
for item_ in d :
s = item_
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } ' )
2020-06-25 14:42:50 -03:00
nd = input ( " \n Select 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 :
break
input ( " Continue... " )
break
print ( " \n \t DELETE PAYWALL \n " )
a = loadFileConnLNBits ( [ ' admin_key ' ] )
b = str ( a [ ' admin_key ' ] )
id = input ( " Insert PayWall ID: " )
2022-03-12 02:04:49 +00:00
curl = (
f " curl -X DELETE https://lnbits.com/paywall/api/v1/paywalls/ { id } "
+ f """ -H " X-Api-Key: { b } " """
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
print ( " \n \t PAYWALL DELETED SUCCESSFULLY \n " )
t . sleep ( 2 )
clear ( )
except :
break
2021-04-10 23:58:35 -03:00
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 ' ] )
2022-03-12 02:04:49 +00:00
curl = (
' curl -X POST https://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 } " '
)
2021-04-10 23:58:35 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
print ( " \n \t LNURLW CREATED SUCCESSFULLY \n " )
t . sleep ( 2 )
clear ( )
while True :
2022-03-12 02:04:49 +00:00
checkcurl = f ' curl -X GET https://lnbits.com/withdraw/api/v1/links -H " X-Api-Key: { b } " '
2021-04-11 09:43:53 -03:00
sh = os . popen ( checkcurl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
2021-04-10 23:58:35 -03:00
print ( " \n \t LNBITS LNURLW LIST \n " )
for item_ in d :
s = item_
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } Uses: ' + str ( s [ ' uses ' ] ) + " Used: " + str ( s [ ' used ' ] ) )
2021-04-10 23:58:35 -03:00
nd = input ( " \n Select 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... " )
2021-04-11 09:43:53 -03:00
clear ( )
blogo ( )
2021-04-10 23:58:35 -03:00
except :
break
def lnbitsLNURLwList ( ) :
try :
while True :
a = loadFileConnLNBits ( [ ' admin_key ' ] )
b = str ( a [ ' admin_key ' ] )
2022-03-12 02:04:49 +00:00
checkcurl = f ' curl -X GET https://lnbits.com/withdraw/api/v1/links -H " X-Api-Key: { b } " '
2021-04-10 23:58:35 -03:00
sh = os . popen ( checkcurl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
print ( " \n \t LNBITS LNURLW LIST \n " )
for item_ in d :
s = item_
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } Uses: ' + str ( s [ ' uses ' ] ) + " Used: " + str ( s [ ' used ' ] ) )
2021-04-10 23:58:35 -03:00
nd = input ( " \n Select 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 :
print ( " \n " )
#-------------------------1d646820055e4e2da218e801eaacfc94----END LNBITS--------------------------------
2020-06-25 14:42:50 -03:00
#-----------------------------LNPAY--------------------------------
2020-06-25 17:49:52 -03:00
2020-06-25 14:42:50 -03:00
def loadFileConnLNPay ( lnpayLoad ) :
lnpayLoad = { " key " : " " }
if os . path . isfile ( ' lnpay.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
lnpayData = pickle . load ( open ( " lnpay.conf " , " rb " ) ) # 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 \t WALLET ACCESS KEYS \n " )
lnpayLoad [ " wallet_key_id " ] = input ( " Wallet Admin: " )
pickle . dump ( lnpayLoad , open ( " lnpay.conf " , " wb " ) )
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 \t WALLET ACCESS KEYS \n " )
lnpayLoad [ " wallet_key_id " ] = input ( " Wallet Admin: " )
pickle . dump ( lnpayLoad , open ( " lnpay.conf " , " wb " ) )
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 ( " \n Continue... " )
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 ( " \n Amount in Sats: " )
memo = input ( " Memo: " )
2022-02-12 14:26:59 +00:00
invoice_params = { ' num_satoshis ' : amt , ' memo ' : f ' { memo } -PyBLOCK ' }
2020-06-25 14:42:50 -03:00
try :
invoice = my_wallet . create_invoice ( invoice_params )
2020-07-09 20:10:01 -03:00
clear ( )
blogo ( )
2020-07-10 15:21:16 -03:00
node_not = input ( " Do you want to pay this invoice with your node? Y/n: " )
2020-06-25 14:42:50 -03:00
while True :
2020-07-09 20:10:01 -03:00
if node_not in [ " Y " , " y " ] :
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload [ ' ip_port ' ] :
print ( " \n Invoice: " + invoice [ ' payment_request ' ] + " \n " )
payinvoice ( )
elif lndconnectload [ ' ln ' ] :
print ( " \n Invoice: " + 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 ( )
2022-02-12 14:26:59 +00:00
print ( f ' Lightning Invoice: { invoice [ " payment_request " ] } ' )
2020-07-09 20:10:01 -03:00
t . sleep ( 10 )
2022-02-12 14:26:59 +00:00
curl = f ' curl -u { b } : https://api.lnpay.co/v1/lntx/ { invoice [ " id " ] } ?fields=settled,num_satoshis '
2020-07-09 20:10:01 -03:00
rsh = os . popen ( curl ) . read ( )
2020-06-25 14:42:50 -03:00
clear ( )
blogo ( )
2020-07-09 20:10:01 -03:00
nn = str ( rsh )
dd = json . loads ( nn )
db = dd [ ' settled ' ]
2021-04-09 14:57:03 +00:00
if db != 1 :
2020-07-09 20:10:01 -03:00
continue
2021-04-09 14:57:03 +00:00
clear ( )
blogo ( )
tick ( )
t . sleep ( 2 )
break
2020-06-25 14:42:50 -03:00
except :
pass
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 \t LNPAY LIST PAYMENTS \n " )
for transaction_ in transactions :
s = transaction_
q = s [ ' lnTx ' ]
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } ' )
2020-06-25 14:42:50 -03:00
nd = input ( " \n Select ID: " )
for transaction in transactions :
s = transaction
nn = s [ ' id ' ]
if nd == nn :
print ( " \n ---------------------------------------------------------------------------------------------------- " )
2022-10-08 17:29:08 +00:00
nnn = s [ ' lnTx ' ]
2020-06-25 14:42:50 -03:00
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 :
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 \t LNPAY PAY INVOICE \n " )
inv = input ( " \n Invoice: " )
2022-02-12 14:26:59 +00:00
curl = f ' curl -u { b } : https://api.lnpay.co/v1/node/default/payments/decodeinvoice?payment_request= { inv } '
2020-06-25 14:42:50 -03:00
clear ( )
rsh = os . popen ( curl ) . read ( )
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 ( " \n Enter to Continue... " )
invoice_params = {
' payment_request ' : inv
}
pay_result = my_wallet . pay_invoice ( invoice_params )
except :
pass
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 \t LNPAY 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 :
pass
#-----------------------------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
opennodeData = pickle . load ( open ( " opennode.conf " , " rb " ) ) # 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: " )
pickle . dump ( opennodeLoad , open ( " opennode.conf " , " wb " ) )
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
""" )
2022-02-12 14:26:59 +00:00
opennodeLoad = { ' wdr ' : ' ' , ' inv ' : ' ' , ' key ' : input ( " API Read Only Key: " ) }
2020-06-25 14:42:50 -03:00
opennodeLoad [ " wdr " ] = input ( " API Withdrawall Key: " )
opennodeLoad [ " inv " ] = input ( " API Invoices Key: " )
pickle . dump ( opennodeLoad , open ( " opennode.conf " , " wb " ) )
def OpenNodelistfunds ( ) :
a = loadFileConnOpenNode ( [ ' wdr ' ] )
b = str ( a [ ' wdr ' ] )
2022-10-08 17:29:08 +00:00
curl = f ' curl https://api.opennode.co/v1/account/balance -H " Content-Type: application/json " -H " Authorization: { b } " '
2022-03-12 02:04:49 +00:00
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
r = d [ ' data ' ]
print ( " \n ---------------------------------------------------------------------------------------------------- " )
2022-10-08 17:29:08 +00:00
p = r [ ' balance ' ]
2020-06-25 14:42:50 -03:00
print ( """
OPENNODE BALANCE
Amount : { } sats
""" .format(p[ ' BTC ' ]))
print ( " ---------------------------------------------------------------------------------------------------- \n " )
input ( " Continue... " )
2020-06-27 17:30:01 -03:00
def OpenNodeCheckStatus ( ) :
curl = " curl -X GET https://status.opennode.com/history.rss "
sh = os . popen ( curl ) . read ( )
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... " )
2020-06-25 14:42:50 -03:00
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: " )
2022-03-12 02:16:53 +00:00
amt = input ( f " Amount in { selection } : " )
curl = (
' curl https://api.opennode.co/v1/charges -X POST -H '
+ f ' " Authorization: { b } " '
+ ' -H " Content-Type: application/json " -d '
+ " ' { "
+ f ' " amount " : " { amt } " , " currency " : " { selection . upper ( ) } " '
+ " } ' "
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
dd = d [ ' data ' ]
qq = dd [ ' lightning_invoice ' ]
2020-06-27 17:30:01 -03:00
pp = dd [ ' address ' ]
2020-06-25 14:42:50 -03:00
nn = qq [ ' payreq ' ]
mm = nn . lower ( )
while True :
try :
print ( " \n ---------------------------------------------------------------------------------------------------- " )
print ( """
\tOPENNODE PAYMENT REQUEST
Amount : { } { }
ID : { }
Status : { }
Invoice : { }
Onchain Address : { }
Amount : { } sats
2020-06-27 17:30:01 -03:00
""" .format(amt, selection.upper(), dd[ ' id ' ], dd[ ' status ' ], mm, pp, dd[ ' amount ' ]))
2020-06-25 14:42:50 -03:00
print ( " ---------------------------------------------------------------------------------------------------- \n " )
pay = input ( " Invoice or Onchain Address? I/O: " )
2020-06-25 21:12:07 +00:00
if pay in [ " I " , " i " ] :
2020-07-10 15:21:16 -03:00
node_not = input ( " Do you want to pay this invoice with your node? Y/n: " )
2020-07-09 20:10:01 -03:00
if node_not in [ " Y " , " y " ] :
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload [ ' ip_port ' ] :
print ( " \n Invoice: " + mm + " \n " )
payinvoice ( )
elif lndconnectload [ ' ln ' ] :
print ( " \n Invoice: " + 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 ( " \n Lightning Invoice: " + mm )
2020-06-25 21:12:07 +00:00
elif pay in [ " O " , " o " ] :
2020-06-25 14:42:50 -03:00
print ( " \033 [1;30;47m " )
2020-06-27 17:30:01 -03:00
qr . add_data ( pp )
2020-06-25 14:42:50 -03:00
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
qr . clear ( )
print ( " \n Amount in sats: {} sats " . format ( dd [ ' amount ' ] ) )
2020-06-27 17:30:01 -03:00
print ( " \n Onchain Address: " + pp )
2020-06-25 14:42:50 -03:00
input ( " \n Continue... " )
clear ( )
blogo ( )
except :
break
2020-06-25 21:12:07 +00:00
elif fiat in [ " N " , " n " ] :
2020-06-25 14:42:50 -03:00
amt = input ( " Amount in sats: " )
2022-03-12 02:16:53 +00:00
curl = (
' curl https://api.opennode.co/v1/charges -X POST -H '
+ f ' " Authorization: { b } " '
+ ' -H " Content-Type: application/json " -d '
+ " ' { "
+ f ' " amount " : " { amt } " , " currency " : " BTC " '
+ " } ' "
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
n = str ( sh )
d = json . loads ( n )
dd = d [ ' data ' ]
qq = dd [ ' lightning_invoice ' ]
nn = qq [ ' payreq ' ]
2022-03-12 02:16:53 +00:00
pp = dd [ ' address ' ]
2020-06-25 14:42:50 -03:00
mm = nn . lower ( )
while True :
try :
print ( " \n ---------------------------------------------------------------------------------------------------- " )
print ( """
\tOPENNODE PAYMENT REQUEST
Amount : { } sats
ID : { }
Status : { }
Invoice : { }
Onchain Address : { }
Amount : { } sats
2020-06-27 17:30:01 -03:00
""" .format(amt, dd[ ' id ' ], dd[ ' status ' ], mm, pp, dd[ ' amount ' ]))
2020-06-25 14:42:50 -03:00
print ( " ---------------------------------------------------------------------------------------------------- \n " )
pay = input ( " Invoice or Onchain Address? I/O: " )
2020-06-25 21:12:07 +00:00
if pay in [ " I " , " i " ] :
2020-07-10 15:21:16 -03:00
node_not = input ( " Do you want to pay this invoice with your node? Y/n: " )
2020-07-09 20:10:01 -03:00
if node_not in [ " Y " , " y " ] :
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
2022-03-12 02:16:53 +00:00
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
2020-07-09 20:10:01 -03:00
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload [ ' ip_port ' ] :
print ( " \n Invoice: " + mm + " \n " )
payinvoice ( )
elif lndconnectload [ ' ln ' ] :
print ( " \n Invoice: " + 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 ( " \n Lightning Invoice: " + mm )
2020-06-25 21:12:07 +00:00
elif pay in [ " O " , " o " ] :
2020-06-25 14:42:50 -03:00
print ( " \033 [1;30;47m " )
2020-06-27 17:30:01 -03:00
qr . add_data ( pp )
2020-06-25 14:42:50 -03:00
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
qr . clear ( )
print ( " \n Amount in sats: {} sats " . format ( dd [ ' amount ' ] ) )
2020-06-27 17:30:01 -03:00
print ( " \n Onchain Address: " + pp )
2020-06-25 14:42:50 -03:00
input ( " \n Continue... " )
clear ( )
blogo ( )
except :
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 ( " \n Invoice: " )
2022-03-12 02:16:53 +00:00
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 } " '
+ " } ' "
)
2020-06-25 14:42:50 -03:00
ssh = os . popen ( checkcurl ) . read ( )
nn = str ( ssh )
dd = json . loads ( nn )
print ( dd )
2021-04-09 14:57:03 +00:00
if invoice != " " :
break
print ( " \n ---------------------------------------------------------------------------------------------------- " )
print ( """
2020-06-25 14:42:50 -03:00
\tOPENNODE TRANSFER REQUEST
Message : { }
""" .format(dd[ ' message ' ]))
2021-04-09 14:57:03 +00:00
print ( " ---------------------------------------------------------------------------------------------------- \n " )
2020-06-25 14:42:50 -03:00
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 ( " \n Enter to Continue... " )
2022-03-12 02:16:53 +00:00
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 " : " " '
+ " } ' "
)
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
n = str ( sh )
d = json . loads ( n )
clear ( )
blogo ( )
tick ( )
t . sleep ( 2 )
except :
pass
2020-06-25 21:12:07 +00:00
elif lnchain in [ " O " , " o " ] :
2020-06-25 14:42:50 -03:00
try :
while True :
print ( " \n \t OPENNODE TRANSFER REQUEST \n " )
print ( " \n \t Minimum amount 200000 sats \n " )
address = input ( " \n Bitcoin Address: " )
amt = int ( input ( " Amount in sats: " ) )
2022-03-12 02:16:53 +00:00
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 " : " " '
+ " } ' "
)
2020-06-25 14:42:50 -03:00
if amt < 199999 :
sh = os . popen ( curl ) . read ( )
n = str ( sh )
d = json . loads ( n )
print ( " \n ---------------------------------------------------------------------------------------------------- " )
print ( """
\tOPENNODE TRANSFER REQUEST
Message : { }
""" .format(d[ ' message ' ]))
print ( " ---------------------------------------------------------------------------------------------------- \n " )
elif amt > 200000 :
sh = os . popen ( curl ) . read ( )
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 ( " \n Continue... " )
clear ( )
blogo ( )
logoB ( )
t . sleep ( 2 )
break
except :
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 ' ] )
2022-03-12 02:16:53 +00:00
curl = f ' curl https://api.opennode.co/v1/withdrawals -H " Content-Type: application/json " -H " Authorization: { b } " '
2020-06-25 14:42:50 -03:00
sh = os . popen ( curl ) . read ( )
clear ( )
blogo ( )
print ( " \n \t OPENNODE 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 )
2022-02-12 14:26:59 +00:00
print ( f ' ID: { s [ " id " ] } { q } ' )
2020-06-25 14:42:50 -03:00
nd = input ( " \n Select 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 \t OPENNODE TRANSACTIONS LIST \n " )
except :
break
2020-06-25 17:49:52 -03:00
#-----------------------------END OPENNODE--------------------------------
2020-06-25 14:42:50 -03:00
#-----------------------------TIPPINME--------------------------------
def loadFileTippinMe ( tippinmeLoad ) :
tippinmeLoad = { " key " : " " }
if os . path . isfile ( ' tippinme.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
tippinmeData = pickle . load ( open ( " tippinme.conf " , " rb " ) ) # 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: " )
pickle . dump ( tippinmeLoad , open ( " tippinme.conf " , " wb " ) )
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
""" )
2022-02-12 14:26:59 +00:00
tippinmeLoad = { ' key ' : input ( " Twitter @user: " ) }
2020-06-25 14:42:50 -03:00
pickle . dump ( tippinmeLoad , open ( " tippinme.conf " , " wb " ) )
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 \t TIPPINME GENERATE INVOICE \n " )
q = input ( " Amount in Sats: " )
clear ( )
blogo ( )
2022-03-12 03:10:24 +00:00
url = f ' https://api.tippin.me/v1/public/addinvoice/ { b } / { q } '
2020-06-25 14:42:50 -03:00
response = requests . get ( url )
responseB = str ( response . text )
responseC = responseB
lnreq = responseC . split ( ' , ' )
2022-03-19 18:42:31 +01:00
lnurl = lnreq [ 1 ]
lnurlS = str ( lnurl )
lnurlR = lnurlS . split ( ' : ' )
lnurlW = lnurlR [ 1 ]
ln = str ( lnurlW )
2020-06-25 14:42:50 -03:00
ln1 = ln . strip ( ' " ' )
2020-07-10 15:21:16 -03:00
node_not = input ( " Do you want to pay this invoice with your node? Y/n: " )
2020-07-09 20:10:01 -03:00
if node_not in [ " Y " , " y " ] :
lndconnectload = { " ip_port " : " " , " tls " : " " , " macaroon " : " " , " ln " : " " }
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # Load the file 'bclock.conf'
lndconnectload = lndconnectData # Copy the variable pathv to 'path'
if lndconnectload [ ' ip_port ' ] :
print ( " \n Invoice: " + ln1 + " \n " )
payinvoice ( )
elif lndconnectload [ ' ln ' ] :
print ( " \n Invoice: " + 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 " )
2022-02-12 14:26:59 +00:00
print ( f ' LND Invoice: { ln1 } ' )
2020-07-09 20:10:01 -03:00
response . close ( )
input ( " Continue... " )
2020-06-25 14:42:50 -03:00
except :
pass
#-----------------------------END TIPPINME--------------------------------
2020-06-25 17:49:52 -03:00
#-----------------------------TALLYCOIN------------------------------
2020-06-27 17:30:01 -03:00
def loadFileConnTallyCo ( tallycoLoad ) :
tallycoLoad = { " tallyco.conf " : " " , " id " : " " }
if os . path . isfile ( ' tallyco.conf ' ) : # Check if the file 'bclock.conf' is in the same folder
tallyData = pickle . load ( open ( " tallyco.conf " , " rb " ) ) # Load the file 'bclock.conf'
tallycoLoad = tallyData # Copy the variable pathv to 'path'
else :
clear ( )
blogo ( )
2020-07-10 11:05:02 -03:00
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.
2020-06-27 17:30:01 -03:00
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 ( " \n EXAMPLE: https://tallyco.in/s/ {fundraiser_id} / \n " )
tallycoLoad [ " id " ] = input ( " User ID or Twitter @USER: " )
pickle . dump ( tallycoLoad , open ( " tallyco.conf " , " wb " ) )
clear ( )
blogo ( )
return tallycoLoad
def createFileConnTallyCo ( ) :
clear ( )
blogo ( )
2020-07-10 11:05:02 -03:00
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.
2020-06-27 17:30:01 -03:00
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 ( " \n EXAMPLE: https://tallyco.in/s/ {fundraiser_id} / \n " )
2022-02-12 14:26:59 +00:00
tallycoLoad = { ' fundraiser_id ' : ' ' , ' id ' : input ( " User ID or Twitter @USER: " ) }
2020-06-27 17:30:01 -03:00
pickle . dump ( tallycoLoad , open ( " tallyco.conf " , " wb " ) )
def tallycoGetPayment ( ) :
2020-07-06 19:57:40 -03:00
qr = qrcode . QRCode (
version = 1 ,
error_correction = qrcode . constants . ERROR_CORRECT_L ,
box_size = 10 ,
border = 4 ,
)
2020-06-27 17:30:01 -03:00
c = loadFileConnTallyCo ( [ ' id ' ] )
d = str ( c [ ' id ' ] )
2020-07-09 19:40:03 -03:00
try :
amount = input ( " Amount in Sats: " )
print ( """ \n Payment Method Example: ' ln ' or ' btc '
' ln ' = Lightnin Netowrk
' btc ' = Bitcoin Onchain Payment
\n """ )
lnd_onchain = input ( " Payment Method: " )
2022-03-12 03:10:24 +00:00
curl = (
" curl -d "
+ f ' " type=profile&id= { d } &satoshi_amount= { amount } &payment_method= { lnd_onchain } " '
+ " -X POST https://api.tallyco.in/v1/payment/request/ "
)
2020-07-09 19:40:03 -03:00
tallycomethod = os . popen ( curl ) . read ( )
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 " )
2022-02-12 14:26:59 +00:00
print ( f ' LND Invoice: { f } ' )
2020-07-09 19:40:03 -03:00
qr . clear ( )
input ( " \n Continue... " )
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 " )
2022-02-12 14:26:59 +00:00
print ( f ' Amount: { d [ " cost " ] } ' )
print ( f ' Bitcoin Address: { e } ' )
2020-07-09 19:40:03 -03:00
qr . clear ( )
input ( " \n Continue... " )
except :
2020-07-09 20:10:01 -03:00
pass
2020-06-27 17:30:01 -03:00
2020-07-06 19:57:40 -03:00
2020-06-27 17:30:01 -03:00
def tallycoDonateid ( ) :
2020-07-06 21:20:55 -03:00
qr = qrcode . QRCode (
version = 1 ,
error_correction = qrcode . constants . ERROR_CORRECT_L ,
box_size = 10 ,
border = 4 ,
)
clear ( )
blogo ( )
2020-07-09 19:40:03 -03:00
try :
donate = input ( " Donate to ID: " )
amount = input ( " Amount in Sats: " )
print ( """ \n Payment Method Example: ' ln ' or ' btc '
' ln ' = Lightnin Netowrk
' btc ' = Bitcoin Onchain Payment
\n """ )
lnd_onchain = input ( " Payment Method: " )
2022-03-12 03:10:24 +00:00
curl = (
" curl -d "
+ f ' " type=profile&id= { donate } &satoshi_amount= { amount } &payment_method= { lnd_onchain } " '
+ " -X POST https://api.tallyco.in/v1/payment/request/ "
)
2020-07-09 19:40:03 -03:00
tallycomethod = os . popen ( curl ) . read ( )
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 " : " " }
lndconnectData = pickle . load ( open ( " blndconnect.conf " , " rb " ) ) # 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 ( " \n Invoice: " + f + " \n " )
payinvoice ( )
elif lndconnectload [ ' ln ' ] :
e = d [ ' lightning_pay_request ' ]
f = e . lower ( )
print ( " \n Invoice: " + f + " \n " )
localpayinvoice ( )
elif node_not in [ " N " , " n " ] :
2020-07-06 21:20:55 -03:00
e = d [ ' lightning_pay_request ' ]
f = e . lower ( )
2020-07-09 19:40:03 -03:00
print ( " \033 [1;30;47m " )
qr . add_data ( f )
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
2022-02-12 14:29:58 +00:00
print ( f ' LND Invoice: { f } ' )
2020-07-09 19:40:03 -03:00
qr . clear ( )
input ( " \n Continue... " )
elif lnd_onchain in [ " btc " , " bTC " , " BtC " , " BTC " , " BTc " , " btC " ] :
e = d [ ' btc_address ' ]
2020-07-06 21:20:55 -03:00
print ( " \033 [1;30;47m " )
2020-07-09 19:40:03 -03:00
qr . add_data ( e )
2020-07-06 21:20:55 -03:00
qr . print_ascii ( )
print ( " \033 [0;37;40m " )
2022-02-12 14:29:58 +00:00
print ( f ' Amount: { d [ " cost " ] } ' )
print ( f ' Bitcoin Address: { e } ' )
2020-07-06 21:20:55 -03:00
qr . clear ( )
input ( " \n Continue... " )
2020-07-09 19:40:03 -03:00
except :
2020-07-09 20:10:01 -03:00
pass
2020-07-06 19:57:40 -03:00
2020-07-14 20:04:00 -03:00
#-----------------------------END TALLYCOIN------------------------------
#-----------------------------MEMPOOL.SPACE------------------------------
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 :
pass
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 :
pass
#-----------------------------END MEMPOOL.SPACE------------------------------