import tkinter as tk import xrpl import json from mod1 import get_account, get_account_info from mod7 import batch_mint, get_batch ############################################# ## Handlers ################################# ############################################# # Module 7 Handlers def standby_batch_mint(): results = batch_mint( ent_standby_seed.get(), ent_standby_uri.get(), ent_standby_flags.get(), ent_standby_transfer_fee.get(), ent_standby_taxon.get(), ent_standby_nft_count.get() ) text_standby_results.delete("1.0", tk.END) text_standby_results.insert("1.0", json.dumps(results, indent=4)) def standby_get_batch_nfts(): results = get_batch( ent_standby_seed.get(), ent_standby_account.get() ) text_standby_results.delete("1.0", tk.END) text_standby_results.insert("1.0", json.dumps(results, indent=4)) # Module 1 Handlers def get_standby_account(): new_wallet = get_account(ent_standby_seed.get()) ent_standby_account.delete(0, tk.END) ent_standby_seed.delete(0, tk.END) ent_standby_account.insert(0, new_wallet.classic_address) ent_standby_seed.insert(0, new_wallet.seed) def get_standby_account_info(): accountInfo = get_account_info(ent_standby_account.get()) ent_standby_balance.delete(0, tk.END) ent_standby_balance.insert(0,accountInfo['Balance']) text_standby_results.delete("1.0", tk.END) text_standby_results.insert("1.0",json.dumps(accountInfo, indent=4)) # Create a new window with the title "Python Module - Batch Minting" window = tk.Tk() window.title("Python Module - Batch Minting") # Form frame frm_form = tk.Frame(relief=tk.SUNKEN, borderwidth=3) frm_form.pack() # Create the Label and Entry widgets for "Standby Account" lbl_standy_seed = tk.Label(master=frm_form, text="Standby Seed") ent_standby_seed = tk.Entry(master=frm_form, width=50) lbl_standby_account = tk.Label(master=frm_form, text="Standby Account") ent_standby_account = tk.Entry(master=frm_form, width=50) lbl_standby_balance = tk.Label(master=frm_form, text="XRP Balance") ent_standby_balance = tk.Entry(master=frm_form, width=50) lbl_standby_uri = tk.Label(master=frm_form, text="NFT URI") ent_standby_uri = tk.Entry(master=frm_form, width=50) lbl_standby_flags = tk.Label(master=frm_form, text="Flags") ent_standby_flags = tk.Entry(master=frm_form, width=50) lbl_standby_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee") ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50") lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon") ent_standby_taxon = tk.Entry(master=frm_form, width="50") lbl_standby_nft_id = tk.Label(master=frm_form, text="NFT ID") ent_standby_nft_id = tk.Entry(master=frm_form, width="50") lbl_standby_nft_offer_index = tk.Label(master=frm_form, text="NFT Offer Index") ent_standby_nft_offer_index = tk.Entry(master=frm_form, width="50") lbl_standby_nft_count = tk.Label(master=frm_form, text="NFT Count") ent_standby_nft_count = tk.Entry(master=frm_form, width="50") lbl_standby_results = tk.Label(master=frm_form,text="Results") text_standby_results = tk.Text(master=frm_form, height = 20, width = 65) # Place field in a grid. lbl_standy_seed.grid(row=0, column=0, sticky="w") ent_standby_seed.grid(row=0, column=1) lbl_standby_account.grid(row=2, column=0, sticky="e") ent_standby_account.grid(row=2, column=1) lbl_standby_balance.grid(row=5, column=0, sticky="e") ent_standby_balance.grid(row=5, column=1) lbl_standby_uri.grid(row=8, column=0, sticky="e") ent_standby_uri.grid(row=8, column=1, sticky="w") lbl_standby_flags.grid(row=9, column=0, sticky="e") ent_standby_flags.grid(row=9, column=1, sticky="w") lbl_standby_transfer_fee.grid(row=10, column=0, sticky="e") ent_standby_transfer_fee.grid(row=10, column=1, sticky="w") lbl_standby_taxon.grid(row=11, column=0, sticky="e") ent_standby_taxon.grid(row=11, column=1, sticky="w") lbl_standby_nft_count.grid(row=12, column=0, sticky="e") ent_standby_nft_count.grid(row=12, column=1, sticky="w") lbl_standby_results.grid(row=13, column=1, sticky="ne") text_standby_results.grid(row=13, column=2, sticky="nw") ############################################# ## Buttons ################################## ############################################# # Create the Standby Account Buttons btn_get_standby_account = tk.Button(master=frm_form, text="Get Standby Account", command = get_standby_account) btn_get_standby_account.grid(row=0, column=2, sticky = "nsew") btn_get_standby_account_info = tk.Button(master=frm_form, text="Get Standby Account Info", command = get_standby_account_info) btn_get_standby_account_info.grid(row=1, column=2, sticky = "nsew") btn_standby_batch_mint = tk.Button(master=frm_form, text="Batch Mint NFTs", command = standby_batch_mint) btn_standby_batch_mint.grid(row=5, column=2, sticky = "nsew") btn_standby_get_batch_nfts = tk.Button(master=frm_form, text="Get Batch NFTs", command = standby_get_batch_nfts) btn_standby_get_batch_nfts.grid(row=8, column=2, sticky = "nsew") # Start the application window.mainloop()