-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
713 lines (538 loc) · 32.3 KB
/
main.py
File metadata and controls
713 lines (538 loc) · 32.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
from timeit import default_timer as timer
import token
import requests
import solana
from solana.message import Message
from solana.rpc.api import Client
from solana.keypair import Keypair
from solana.transaction import Transaction
from solana.rpc.types import TxOpts
from solana.rpc.api import Client
from solana.keypair import Keypair
from solana.publickey import PublicKey
from solana.rpc.api import Client
from solana.transaction import Transaction, TransactionInstruction, AccountMeta
from spl.token.instructions import create_associated_token_account, transfer_checked, TransferCheckedParams, get_associated_token_address
from solana.rpc.types import TxOpts
from base58 import b58decode, b58encode
import base58
import json
import sys
import os
import time
import bs4
from colorama import init
init(strip=not sys.stdout.isatty()) # strip colors if stdout is redirected
from termcolor import cprint
from pyfiglet import figlet_format
import cloudscraper
import inquirer
import matplotlib.pyplot as plt
import emoji
# Fetch SOL/USD price from CoinGecko API
resp = requests.get('https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=sol,usd')
price = json.loads(resp.text)
sol_usd = price['solana']['usd']
# Fetch SOL/USD price change from CoinGecko API
resp111 = requests.get('https://api.coingecko.com/api/v3/coins/solana')
price_change = json.loads(resp111.text)
sol_change = price_change['market_data']['price_change_percentage_24h']
# Set terminal title
title='CozyTools V0.05 | SOL/USD: $' + str(sol_usd) + ' | Change: ' + str(sol_change) + '%'
os.system('echo -n -e "\033]0;{}\007"'.format(title))
def CozyTools():
with open('config.json', 'r') as key_file:
data = json.loads(key_file.read())
license = data['license']
rpc = data['rpc']
main_wallet = data['main_wallet']
privkey = data['privkey']
key_file.close()
cprint('Checking {}'.format(license), 'yellow')
print('\n')
# Check license status via hyper.co API
url = "https://api.hyper.co/v6/licenses/" + license
headers = {
"Accept": "application/json",
"Authorization": "Bearer token"
}
response = requests.get(url, headers=headers)
keyinfo = json.loads(response.text)
keycheck = keyinfo['status']
if keycheck == 'active':
cprint('{} is active'.format(license), 'green')
while True:
cprint(figlet_format('Cozy Toolbox', font='larry3d'),
'blue', attrs=['bold'])
optionlist = ['Magic Eden Lister', 'Magic Eden Floor Sniffer', 'Magic Eden Historical Data', 'Wallet Manager', 'RPC Ping Test', 'Exit']
questions = [inquirer.List(
'Options',
message="Select A Task Option",
choices=optionlist,
),
]
answers = inquirer.prompt(questions)
userchoice = (answers['Options'])
if userchoice == 'Magic Eden Lister':
def NFTLister():
cprint('\nLoading NFT Lister Module...\n', 'green')
time.sleep(2)
scraper = cloudscraper.create_scraper(
browser={
'browser': 'firefox',
'platform': 'windows',
'mobile': False
}
)
url2 = 'https://api.solanabeach.io/v1/account/' + main_wallet + '/tokens'
sitereq = scraper.get(url2).text
html2 = sitereq
soup2 = bs4.BeautifulSoup(html2,'html.parser')
site_json2=json.loads(soup2.text)
list1=[]
list2=[]
AvailNFTs=[]
dList = []
SelectedTokenName = []
SelectedTokenAddress = []
SelectedTokenATA = []
selectedNFT = []
for i in range(len(site_json2)):
tokenAddress = (site_json2[i]['mint']['address'])
tokenATA = (site_json2[i]['address']['address'])
tokenMeta = scraper.get('https://public-api.solscan.io/token/meta?tokenAddress=' + tokenAddress).text
metadata = json.loads(tokenMeta)
name = (metadata['name'])
list1.append([name])
list2.append([tokenAddress] + [tokenATA])
AvailNFTs.append([name] + [tokenAddress] + [tokenATA])
one = {'Name': name, 'tokenAddress': tokenAddress, 'tokenATA': tokenATA}
dct = dict(one)
dList.append(one)
questions = [
inquirer.Checkbox('NFT',
message="Select NFT to list",
choices=dList + ['Exit'],
),
]
answers = inquirer.prompt(questions)
selected = answers['NFT']
if selected == ['Exit']:
cprint('\nExiting NFT Lister Module\n', 'red')
CozyTools()
else:
for i in range(len(answers['NFT'])):
selectedTokenName = selected[i]['Name']
selectedtokenAddress = selected[i]['tokenAddress']
selectedtokenATA = selected[i]['tokenATA']
sellerRefferal = 'autMW8SgBkVYeBgqYiTuJZnkvDZMVU2MHJh9Jh7CSQ2'
SelectedTokenName.append(answers['NFT'][i]['Name'])
SelectedTokenAddress.append(answers['NFT'][i]['tokenAddress'])
SelectedTokenATA.append(answers['NFT'][i]['tokenATA'])
selectedNFT.append(selectedTokenName)
selectedNFT.append(selectedtokenAddress)
selectedNFT.append(selectedtokenATA)
cprint("Name: {}, Token Address: {}, Token ATA: {}".format(selectedTokenName, selectedtokenAddress, selectedtokenATA), 'green')
#-----------------------------------------------------#
cprint('Enter Price to list {}:'.format(selectedTokenName), 'cyan')
price = input("")
cprint('listing {} at {} SOL'.format(selectedTokenName, price), 'green')
print('\n')
listingurl = ("https://api-mainnet.magiceden.io/v2/instructions/sell?seller={}&auctionHouseAddress=E8cU1WiRWjanGxmn96ewBgk9vPTcL6AEZ1t6F6fkgUWe&tokenMint={}&tokenAccount={}&price={}&sellerReferral={}&expiry=-1".format(main_wallet, selectedtokenAddress, selectedtokenATA, str(price), sellerRefferal))
payload3={}
headers3={
'Accept': 'application/json, text/plain',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0',
'Origin': 'https://magiceden.io/',
'Content-Type': 'application/json; charset=utf-8',
'Referrer': 'https://magiceden.io/',
}
lister = scraper.get(listingurl, headers=headers3, data=payload3).text
print(listingurl)
cprint('Got Instructions to list {} for {}, Sending Transaction Now'.format(selectedTokenName, price), 'green')
x = lister
y = json.loads(x)
z=(y['tx'])
instruction_data = (z['data'])
privatekey = (privkey)
solana_client = Client(rpc)
def sendTransaction(instruction_data):
wallet = Keypair.from_secret_key(base58.b58decode(privatekey))
msg = Message.deserialize(bytes(instruction_data))
txn = Transaction.populate(message=msg, signatures =[])
response2 = solana_client.send_transaction(txn, wallet, opts=TxOpts(skip_preflight=True, skip_confirmation=True))
#print(response2)
a = json.dumps(response2)
b = json.loads(a)
tx = 'https://solscan.io/tx/' + (b['result'])
cprint('\nTransaction Sent for {}'.format(selectedTokenName), 'green')
print(tx)
sendTransaction(instruction_data)
#-----------------------------------------------------#
print('Starting 5s delay to minimize cloudflare spam')
time.sleep(5)
NFTLister()
if userchoice == 'Magic Eden Floor Sniffer':
def FloorSniffer():
cprint(figlet_format('\nStarting Magic Eden Floor Sniffer', font='term'),
'green', attrs=['bold'])
cprint('Checking {} \n'.format(main_wallet), 'green')
scraper = cloudscraper.create_scraper(
browser={
'browser': 'firefox',
'platform': 'windows',
'mobile': False
}
)
site_req = scraper.get('https://api-mainnet.magiceden.io/rpc/getNFTsByOwner/' + main_wallet).text
html = site_req
soup = bs4.BeautifulSoup(html,'html.parser')
site_json=json.loads(soup.text)
list = []
NFTs = ([d.get('collectionName') for d in site_json['results'] if d.get('collectionName')])
list = NFTs
questions = [
inquirer.List('NFTs',
message="Select Collection To Sniff Floor Price Of",
choices=list,
),
]
answers = inquirer.prompt(questions)
NFTCollection = answers['NFTs']
req2 = scraper.get("https://api-mainnet.magiceden.dev/v2/collections/" + NFTCollection + "/stats")
resp_data = req2.text
info = json.loads(resp_data)
floorPric = info['floorPrice']
floorPrice = (floorPric/1000000000)
ListedCount = info['listedCount']
volume = info['volumeAll']
volumeALL = (volume/1000000000)
print('\nFloor Price of {} is {} SOL'.format(NFTCollection, str(floorPrice)))
print('\n{} NFTs Listed On {}'.format(ListedCount, NFTCollection))
print('\n{} Total SOL Volume For {}'.format(str(volumeALL), NFTCollection))
time.sleep(7)
FloorSniffer()
if userchoice == 'Magic Eden Delister':
cprint(figlet_format('\nRecoding Module, Update Soon', font='term'),
'red', attrs=['bold'])
time.sleep(5)
if userchoice == 'Wallet Manager':
cprint(figlet_format('\nStarting Wallet Manager\n', font='term'),
'blue', attrs=['bold'])
option_list = ['Wallet Gen', 'Balance Fetcher', 'Distribute SOL', 'Token Transfer']
questions = [inquirer.List(
'Options',
message="Select A Task Option",
choices=option_list,
),
]
answers = inquirer.prompt(questions)
user_choice = (answers['Options'])
if user_choice == 'Wallet Gen':
def WalletGen():
cprint(figlet_format('\nStarting Wallet Generator', font='term'),
'green', attrs=['bold'])
amt = input('How Many Wallets Would You Like To Create: ')
amount = int(amt)
for i in range(amount):
wallet = Keypair()
wallet_bytes = list(wallet.secret_key)
pubkey = wallet.public_key
output_file = open(str(pubkey) + '.json', 'w')
json.dump(wallet_bytes, output_file)
print(amt + ' Wallets Generated')
time.sleep(3)
WalletGen()
if user_choice == 'Token Transfer':
def NFTSender():
import requests as r
scraper = cloudscraper.create_scraper(
browser={
'browser': 'firefox',
'platform': 'windows',
'mobile': False
}
)
SYSTEM_CLOCK_PROGRAM = 'SysvarC1ock11111111111111111111111111111111'
SYSTEM_RECENT_BLOCKHASH_PROGRAM = 'SysvarRecentB1ockHashes11111111111111111111'
SYSTEM_INSTRUCTIONS_PROGRAM = 'Sysvar1nstructions1111111111111111111111111'
TOKEN_PROGRAM_ID = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
ASSOCIATED_TOKEN_ID = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'
METADATA_PROGRAM_ID = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'
SYSTEM_PROGRAM_ID = '11111111111111111111111111111111'
SYSTEM_RENT_PROGRAM = 'SysvarRent111111111111111111111111111111111'
NFT_TRANSFER_PROGRAM = "DeJBGdMFa1uynnnKiwrVioatTuHmNLpyFKnmB5kaFdzQ"
BURN_PROGRAM = "burn68h9dS2tvZwtCFMt79SyaEgvqtcZZWJphizQxgt"
client = Client(rpc)
url2 = 'https://api.solanabeach.io/v1/account/' + main_wallet + '/tokens'
sitereq = scraper.get(url2).text
html2 = sitereq
soup2 = bs4.BeautifulSoup(html2,'html.parser')
site_json2=json.loads(soup2.text)
list1=[]
list2=[]
AvailNFTs=[]
dList = []
SelectedTokenName = []
mint_address1 = []
mint_address = []
for i in range(len(site_json2)):
tokenAddress = (site_json2[i]['mint']['address'])
tokenAccount = (site_json2[i]['address']['address'])
tokenMeta = r.get('https://public-api.solscan.io/token/meta?tokenAddress=' + tokenAddress).text
metadata = json.loads(tokenMeta)
name = metadata['name']
list1.append([name])
list2.append([tokenAddress])
AvailNFTs.append([name] + [tokenAddress])
"""print('Loading NFTs as [Name | Mint Address]')
print(metadata['name'] + ' | ' + site_json2[i]['mint']['address'], '\n')"""
one = {'Name': name, 'tokenAddress': tokenAddress}
dct = dict(one)
dList.append(one)
questions = [
inquirer.Checkbox('NFT',
message="Select NFT to list",
choices=dList,
),
]
answers = inquirer.prompt(questions)
selected = answers['NFT']
cprint('You Selected {}'.format(selected), 'green')
for i in range(len(answers['NFT'])):
selectedTokenName = selected[i]['Name']
mint_address = selected[i]['tokenAddress']
print('\n')
SelectedTokenName.append(selected[i]['Name'])
mint_address1.append(selected[i]['tokenAddress'])
with open('pub.txt', 'r') as f2:
wallets = f2.readlines()
f2.close()
wallet = [s.rstrip() for s in wallets]
questions = [inquirer.Checkbox(
'Wallets',
message="Press Space To Select A Wallet To Send NFTs To?",
choices=wallet,
),
]
answers = inquirer.prompt(questions)
selectedWallet = answers['Wallets']
to_address = str(selectedWallet).replace('[', '')
to_address = str(selectedWallet).replace(']', '')
to_address = str(selectedWallet).replace('\'', '')
#----------------------------------------------------
to_address = to_address.replace('[', '')
to_address = to_address.replace(']', '')
to_address = to_address.replace('\'', '')
cprint('Selected Wallet {}'.format(to_address), 'green')
#----------------------------------------------------
for mint_address in mint_address1:
mint_address.replace('[', '')
mint_address.replace(']', '')
mint_address.replace('\'', '')
input('Press Enter to continue...')
cprint('\nSending {} to {}\n'.format(mint_address, to_address), 'green')
def transfer_nft(privkey: str, mint_address: str, to_address: str):
OPTS = TxOpts(skip_preflight=True, skip_confirmation=True)
payer = Keypair.from_secret_key(b58decode(privkey))
transaction = Transaction(fee_payer=payer.public_key)
try:
transaction.add(
TransactionInstruction(
keys=[
AccountMeta(pubkey=PublicKey(to_address),is_signer=False, is_writable=False)
],
program_id=PublicKey(NFT_TRANSFER_PROGRAM),
data=b58decode("11111111111111111111111111111111")
)
)
token_ata = get_associated_token_address(owner=PublicKey(to_address), mint=PublicKey(mint_address))
check_account = client.get_account_info(token_ata)
if not check_account['result']['value']:
transaction.add(
create_associated_token_account(
payer=payer.public_key,
owner=PublicKey(to_address),
mint=PublicKey(mint_address)
)
)
tokenholder = PublicKey(client.get_token_largest_accounts(mint_address)['result']['value'][0]['address'])
transaction.add(
transfer_checked(
TransferCheckedParams(
amount=1,
dest=token_ata,
source=tokenholder,
owner=payer.public_key,
decimals=0,
program_id=PublicKey(TOKEN_PROGRAM_ID),
mint=PublicKey(mint_address),
signers=[]
)
))
tx_hash = client.send_transaction(transaction, payer, opts=OPTS)["result"]
print("https://solscan.io/tx/{}".format(tx_hash))
except:
print('Error: Transaction Failed')
transfer_nft(privkey, mint_address, to_address)
NFTSender()
if user_choice == 'Balance Fetcher':
def Balance():
from solathon.core.instructions import transfer
from solathon import Client, Transaction, PublicKey, Keypair
from texttable import Texttable
cprint(figlet_format('Starting Balance Fetcher', font='term'),
'green', attrs=['bold'])
with open('pub.txt', 'r') as f:
wallet = f.readlines()
f.close()
for i in range(len(wallet)):
wallet[i] = wallet[i].strip()
client = Client("https://api.mainnet-beta.solana.com")
public_key = PublicKey(wallet[i])
balance = client.get_balance(public_key)
lamportb = balance['result']['value']
SOLbalance = (lamportb / 1000000000)
balan = str(SOLbalance) + ' SOL'
table = Texttable()
table.add_row(['Wallet', 'Balance']),
table.add_row([wallet[i], balan]),
table.set_cols_align(['l', 'r'])
table.set_cols_valign(["t", "m"])
print(table.draw())
print()
Balance()
if user_choice == 'Distribute SOL':
def SendSOL():
from solathon.core.instructions import transfer
from solathon import Client, Transaction, PublicKey, Keypair
cprint(figlet_format('Starting SOL Transferer', font='term'),
'green', attrs=['bold'])
senderwallet = main_wallet
client = Client("https://api.mainnet-beta.solana.com")
sender = Keypair().from_private_key(privkey)
with open('pub.txt', 'r') as f2:
wallets = f2.readlines()
f2.close()
wallet = [s.rstrip() for s in wallets]
questions = [inquirer.Checkbox(
'Wallets',
message="Press Space To Select A Wallet To Send SOL To?",
choices=wallet,
),
]
answers = inquirer.prompt(questions)
pubkey = str(answers['Wallets'])
pubkey = pubkey.replace('[', '')
pubkey = pubkey.replace(']', '')
pubkey = pubkey.replace('\'', '')
receiver = PublicKey(pubkey)
print(receiver)
LetsSendThisMuch = input('Enter Amount of SOL to Transfer: ')
howmuch = (int(float(LetsSendThisMuch)* 10000))
amount = (howmuch * 100000)
instruction = transfer(
from_public_key=sender.public_key,
to_public_key=receiver,
lamports=amount
)
transaction = Transaction(instructions=[instruction], signers=[sender])
result = client.send_transaction(transaction)
RawTX = result['result']
tx = 'https://solscan.io/tx/' + RawTX
print(tx)
# Webhook Stuff
cprint('\nSending {} SOL from {} to {} with TX URL of {}'.format(LetsSendThisMuch, senderwallet, pubkey, tx), 'cyan')
time.sleep(2)
from discord_webhook import DiscordWebhook, DiscordEmbed
with open('webhook.txt', 'r') as f3:
webhookurl = f3.read().rstrip()
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
embed = DiscordEmbed(title='CozyTools', description='Solana Distributer Success', color='65280')
# set author
embed.set_author(name='CozyTools', url='https://cozy-tools.hyper.co/dashboard', icon_url='https://cdn.discordapp.com/attachments/984587141206130802/993318700155404359/cozylogo.png')
# set timestamp (default is now)
embed.set_timestamp()
# add fields to embed
embed.add_embed_field(name='Sender', value=str(senderwallet))
embed.add_embed_field(name='Reciever', value=str(receiver))
embed.add_embed_field(name='Amount', value=str(LetsSendThisMuch) + ' SOL')
embed.add_embed_field(name='TX', value='https://solscan.io/tx/' + RawTX)
# set footer
embed.set_footer(text='CozyTools Success', icon_url='https://cdn.discordapp.com/attachments/984587141206130802/993318700155404359/cozylogo.png')
# add embed object to webhook
webhook.add_embed(embed)
response = webhook.execute()
time.sleep(4)
SendSOL()
if userchoice == 'Magic Eden Historical Data':
def HistoricalData():
cprint(figlet_format('\nStarting Historical Data Fetcher', font='term'),
'green', attrs=['bold'])
time.sleep(2)
cprint('Checking {} \n'.format(main_wallet), 'green')
scraper = cloudscraper.create_scraper(
browser={
'browser': 'firefox',
'platform': 'windows',
'mobile': False
}
)
site_req = scraper.get('https://api-mainnet.magiceden.io/rpc/getNFTsByOwner/' + main_wallet).text
html = site_req
soup = bs4.BeautifulSoup(html,'html.parser')
site_json=json.loads(soup.text)
list = []
NFTs = ([d.get('collectionName') for d in site_json['results'] if d.get('collectionName')])
list = NFTs
questions = [
inquirer.List('NFTs',
message="Select Collection To View Histrocial Volume For",
choices=list,
),
]
answers = inquirer.prompt(questions)
NFTCollection = answers['NFTs']
req2 = scraper.get("https://api-mainnet.magiceden.io/rpc/getAggregatedCollectionMetricsBySymbol?edge_cache=true&symbols={}".format(NFTCollection))
resp_data = req2.text
history = json.loads(resp_data)
valueAT = (history['results'][0]['txVolume'])
VolumeAT = (valueAT['valueAT'])
Volume1h = (valueAT['value1h'])
Volume1d = (valueAT['value1d'])
Volume7d = (valueAT['value7d'])
Volume30d = (valueAT['value30d'])
print("The 1 Hour Volume of {} is {} SOL".format(NFTCollection,Volume1h))
print("The 1 Day Volume of {} is {} SOL".format(NFTCollection,Volume1d))
print("The 7 Day Volume of {} is {} SOL".format(NFTCollection,Volume7d))
print("The 30 Day Volume of {} is {} SOL".format(NFTCollection,Volume30d))
print("The All Time Volume of {} is {} SOL".format(NFTCollection,VolumeAT))
y = [Volume1h,Volume1d,Volume7d,Volume30d,VolumeAT]
x = ['1 Hour','1 Day','7 Day','30 Day','All Time']
plt.plot(x, y)
plt.xlabel('Timeframe')
plt.ylabel('Volume')
plt.title('Volume of {}'.format(NFTCollection))
plt.show()
HistoricalData()
if userchoice == 'RPC Ping Test':
def Ping():
import subprocess
cprint('\nStarting RPC Ping Test', 'green'),
with open('config.json', 'r') as key_file:
data = json.loads(key_file.read())
rpc = data['rpc']
validrpc = rpc.replace('https://', '')
host = validrpc
print("\n")
ping = subprocess.getoutput(f"ping {host}")
print(ping)
time.sleep(5)
Ping()
if userchoice == 'Exit':
print("Goodbye!")
sys.exit()
else:
cprint('License Error, Please Reset Or Try Again', 'red')
CozyTools()