From 58184e2a33b621b0489c9204539f6ebad56b78e9 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 18:12:35 +0300 Subject: [PATCH 01/17] add English text --- qortal-ui-core/language/us.json | 1216 ++++++++++++++++--------------- 1 file changed, 618 insertions(+), 598 deletions(-) diff --git a/qortal-ui-core/language/us.json b/qortal-ui-core/language/us.json index bddad6d5..b3eff679 100644 --- a/qortal-ui-core/language/us.json +++ b/qortal-ui-core/language/us.json @@ -1,599 +1,619 @@ { - "selectmenu": { - "selectlanguage": "Select language", - "languageflag": "us", - "english": "English", - "chinese1": "Chinese (Simplified)", - "chinese2": "Chinese (Traditional)", - "german": "German", - "french": "French", - "polish": "Polish", - "spanish": "Spanish", - "hindi": "Hindi", - "croatian": "Croatian", - "portuguese": "Portuguese", - "hungarian": "Hungarian", - "serbian": "Serbian", - "italian": "Italian", - "russian": "Russian", - "norwegian": "Norwegian", - "romanian": "Romanian", - "korean": "Korean" - }, - "sidemenu": { - "mintingdetails": "MINTING DETAILS", - "wallets": "WALLETS", - "tradeportal": "TRADE PORTAL", - "rewardshare": "REWARD SHARE", - "nameregistration": "NAME REGISTRATION", - "websites": "WEBSITES", - "datamanagement": "DATA MANAGEMENT", - "qchat": "Q-CHAT", - "groupmanagement": "GROUP MANAGEMENT", - "puzzles": "PUZZLES", - "nodemanagement": "NODE MANAGEMENT" - }, - "login": { - "login": "Login", - "createaccount": "Create Account", - "name": "Name", - "address": "Address", - "password": "Password", - "youraccounts": "Your accounts", - "clickto": "Click your account to login with it", - "needcreate": "You need to create or save an account before you can log in!", - "upload": "Upload your qortal backup", - "howlogin": "How would you like to login?", - "seed": "Seedphrase", - "seedphrase": "seedphrase", - "saved": "Saved account", - "qora": "Qora address seed", - "backup": "Qortal wallet backup", - "decrypt": "Decrypt backup", - "save": "Save in this browser.", - "prepare": "Preparing Your Account", - "areyousure": "Are you sure you want to remove this wallet from saved wallets?", - "error1": "Backup must be valid JSON", - "error2": "Login option not selected", - "createwelcome": "Welcome to Qortal, you will find it to be similar to that of an RPG game, you, as a minter on the Qortal network (if you choose to become one) will have the chance to level your account up, giving you both more of the QORT block reward and also larger influence over the network in terms of voting on decisions for the platform.", - "createa": "A", - "click": "Click to view seedphrase", - "confirmpass": "Confirm Password", - "willbe": "will be randomly generated in background. This is used as your private key generator for your blockchain account in Qortal.", - "clicknext": "Create your Qortal account by clicking NEXT below.", - "ready": "Your account is now ready to be created. It will be saved in this browser. If you do not want your new account to be saved in your browser, you can uncheck the box below. You will still be able to login with your new account(after logging out), using your wallet backup file that you MUST download once you create your account.", - "welmessage": "Welcome to Qortal", - "pleaseenter": "Please enter a Password!", - "notmatch": "Passwords not match!", - "lessthen8": "Your password is less than 8 characters! This is not recommended. You can continue to ignore this warning.", - "lessthen8-2": "Your password is less than 8 characters!", - "entername": "Please enter a Name!", - "downloaded": "Your Wallet BackUp file get downloaded!", - "loading": "Loading, Please wait...", - "createdseed": "Your created Seedphrase", - "saveseed": "Save Seedphrase", - "savein": "Save in browser", - "backup2": "This file is the ONLY way to access your account on a system that doesn't have it saved to the app/browser. BE SURE TO BACKUP THIS FILE IN MULTIPLE PLACES. The file is encrypted very securely and decrypted with your local password you created in the previous step. You can save it anywhere securely, but be sure to do that in multiple locations.", - "savewallet": "Save Wallet BackUp File", - "created1": "Your account is now created", - "created2": " and will be saved in this browser.", - "downloadbackup": "Download Wallet BackUp File", - "passwordhint": "A password must be at least 8 characters." - }, - "logout": { - "logout": "LOGOUT", - "confirmlogout": "Are you sure you want to logout?" - }, - "fragfile": { - "selectfile": "Select file", - "dragfile": "Drag and drop backup here" - }, - "settings": { - "generalinfo": "General Account Info", - "address": "Address", - "publickey": "Public Key", - "settings": "Settings", - "account": "Account", - "security": "Security", - "notifications": "Notifications", - "accountsecurity": "Account Security", - "password": "Password", - "download": "Download Backup File", - "choose": "Please choose a password to encrypt your backup with. (This can be the same as the one you logged in with, or different)", - "block": "Block Notifications (Coming Soon...)", - "playsound": "Play Sound", - "shownotifications": "Show Notifications", - "nodeurl": "Node Url", - "nodehint": "Select a node from the default list of nodes above or add a custom node to the list above by clicking on the button below", - "addcustomnode": "Add Custom Node", - "addandsave": "Add And Save", - "protocol": "Protocol", - "domain": "Domain", - "port": "Port" - }, - "appinfo": { - "blockheight": "Block Height", - "uiversion": "UI Version", - "coreversion": "Core Version", - "minting": "(Minting)", - "synchronizing": "Synchronizing" - }, - "walletprofile": { - "minterlevel": "Minter Level", - "blocksminted": "Blocks Minted" - }, - "general": { - "yes": "Yes", - "no": "No", - "confirm": "Confirm", - "decline": "Decline", - "open": "Open", - "close": "Close", - "back": "Back", - "next": "Next", - "create": "Create", - "continue": "Continue", - "save": "Save" - }, - "mintingpage": { - "mchange1": "General Minting Details", - "mchange2": "Blockchain Statistics", - "mchange3": "Avg. Qortal Blocktime", - "mchange4": "Avg. Blocks Per Day", - "mchange5": "Avg. Created QORT Per Day", - "mchange6": "Minting Account Details", - "mchange7": "Not A Minter", - "mchange8": "Minting", - "mchange9": "Not Minting", - "mchange10": "Activate Account Details", - "mchange11": "Not Activated", - "mchange12": "Activate Your Account", - "mchange13": "Introduction", - "mchange14": "To activate your account, an OUTGOING transaction needs to take place. Name Registration is the most common method. You can ask someone in Q-Chat to send you a small amount of QORT so that you may activate your account, or buy QORT within the Trade Portal then make an OUTGOING transaction of any kind and secure your public key on the blockchain. Until you do this, your public key is only known by you, in your UI, and no one else can pull your public key from the chain.", - "mchange15": "Current Status", - "mchange16": "Current Level", - "mchange17": "Blocks To Next Level", - "mchange18": "If you continue minting 24/7 you will reach level", - "mchange19": "Minting Rewards Info", - "mchange20": "Current Tier", - "mchange21": "Total Minters in The Tier", - "mchange22": "Tier Share Per Block", - "mchange23": "Est. Reward Per Block", - "mchange24": "Est. Reward Per Day", - "mchange25": "Seconds", - "mchange26": "Blocks", - "mchange27": "Level", - "mchange28": "Tier", - "mchange29": "days", - "mchange30": "Minters", - "mchange31": "Press for help", - "mchange32": "Become A Minter", - "mchange33": "Introduction", - "mchange34": "In Qortal, in order to become a minter and begin earning QORT rewards with your increase in Minter Level, you must first become ‘sponsored’. A sponsor in Qortal is any other minter of level 5 or higher, or a Qortal Founder. You will obtain a sponsorship key from the sponsor, and use that key to get to level 1. Once you have reached level 1, you will be able to create your own minting key and start earning rewards for helping secure the Qortal Blockchain.", - "mchange35": "Sponsorship", - "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", - "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", - "mchange38": "in" - }, - "walletpage": { - "wchange1": "Fetching balance ...", - "wchange2": "Current Wallet", - "wchange3": "Copy wallet address to clipboard", - "wchange4": "Address copied to clipboard", - "wchange5": "Transaction Details", - "wchange6": "Transaction Type", - "wchange7": "OUT", - "wchange8": "IN", - "wchange9": "Sender", - "wchange10": "Receiver", - "wchange11": "Amount", - "wchange12": "Transaction Fee", - "wchange13": "Block", - "wchange14": "Time", - "wchange15": "Transaction Signature", - "wchange16": "Transaction Hash", - "wchange17": "Send", - "wchange18": "From address", - "wchange19": "Available balance", - "wchange20": "To (address or name)", - "wchange21": "Current static fee:", - "wchange22": "Wallets", - "wchange23": "To (address)", - "wchange24": "Current fee per byte", - "wchange25": "Low fees may result in slow or unconfirmed transactions.", - "wchange26": "Insufficient Funds!", - "wchange27": "Invalid Amount!", - "wchange28": "Receiver cannot be empty!", - "wchange29": "Invalid Receiver!", - "wchange30": "Transaction Successful!", - "wchange31": "Transaction Failed!", - "wchange32": "Failed to Fetch QORT Balance. Try again!", - "wchange33": "Failed to Fetch", - "wchange34": "Balance. Try again!", - "wchange35": "Type", - "wchange36": "Fee", - "wchange37": "Total Amount", - "wchange38": "Address has no transactions yet.", - "wchange39": "Unable to copy address.", - "wchange40": "PAYMENT", - "wchange41": "Status", - "wchange42": "Confirmations", - "wchange43": "Your transaction will not show until confirmed, be patient...", - "wchange44": "Please try again..." - }, - "tradepage": { - "tchange1": "Trade Portal", - "tchange2": "Select Trading Pair", - "tchange3": "HISTORIC MARKET TRADES", - "tchange4": "MY TRADE HISTORY", - "tchange5": "OPEN MARKET SELL ORDERS", - "tchange6": "MY ORDERS", - "tchange7": "Stuck Offers", - "tchange8": "Amount", - "tchange9": "Price", - "tchange10": "Total", - "tchange11": "Date", - "tchange12": "Status", - "tchange13": "Seller", - "tchange14": "Price Each", - "tchange15": "Clear Form", - "tchange16": "You have", - "tchange17": "Action", - "tchange18": "BUY", - "tchange19": "SELL", - "tchange20": "Failed to Create Trade. Try again!", - "tchange21": "Failed to Create Trade. Error Code", - "tchange22": "Insufficient Funds!", - "tchange23": "Buy Request Successful!", - "tchange24": "Buy Request Existing!", - "tchange25": "Failed to Create Trade. Error Code", - "tchange26": "Trade Cancelling In Progress!", - "tchange27": "Failed to Cancel Trade. Try again!", - "tchange28": "Failed to Cancel Trade. Error Code", - "tchange29": "CANCEL", - "tchange30": "Failed to Fetch Balance. Try again!", - "tchange31": "SOLD", - "tchange32": "BOUGHT" - }, - "rewardsharepage": { - "rchange1": "Rewardshares", - "rchange2": "Create reward share", - "rchange3": "Rewardshares Involving In This Account", - "rchange4": "Minting Account", - "rchange5": "Share Percent", - "rchange6": "Recipient", - "rchange7": "Action", - "rchange8": "Type", - "rchange9": "Level 1 - 4 can create a Self Share and Level 5 or above can create a Reward Share!", - "rchange10": "Recipient Public Key", - "rchange11": "Reward share percentage", - "rchange12": "Doing something delicious", - "rchange13": "Adding minting account", - "rchange14": "Add", - "rchange15": "Account is not involved in any reward shares", - "rchange16": "Own Rewardshare", - "rchange17": "Remove", - "rchange18": "Cannot Create Multiple Reward Shares!", - "rchange19": "Cannot Create Multiple Self Shares!", - "rchange20": "CANNOT CREATE REWARD SHARE! at level", - "rchange21": "Reward Share Successful!", - "rchange22": "Reward Share Removed Successfully!" - }, - "registernamepage": { - "nchange1": "Name Registration", - "nchange2": "Register Name", - "nchange3": "Registered Names", - "nchange4": "Avatar", - "nchange5": "Name", - "nchange6": "Owner", - "nchange7": "Action", - "nchange8": "No names registered by this account!", - "nchange9": "Register a Name!", - "nchange10": "Description (optional)", - "nchange11": "Doing something delicious", - "nchange12": "Registering Name", - "nchange13": "The current name registration fee is", - "nchange14": "Register", - "nchange15": "Set Avatar", - "nchange16": "Need Core Update", - "nchange17": "Name Already Exists!", - "nchange18": "Name Registration Successful!" - }, - "websitespage": { - "schange1": "Browse Websites", - "schange2": "Followed Websites", - "schange3": "Blocked Websites", - "schange4": "Search Websites", - "schange5": "Avatar", - "schange6": "Details", - "schange7": "Published by", - "schange8": "Actions", - "schange9": "Websites", - "schange10": "No websites available", - "schange11": "Your Followed Websites", - "schange12": "Followed Websites", - "schange13": "You aren't following any websites", - "schange14": "Your Blocked Websites", - "schange15": "Blocked Websites", - "schange16": "You have not blocked any websites", - "schange17": "Name Not Found!", - "schange18": "Relay mode is enabled. This means that your node will help to transport encrypted data around the network when a peer requests it. You can opt out by setting", - "schange19": "in", - "schange20": "Relay mode is disabled. You can enable it by setting", - "schange21": "Publish Website", - "schange22": "Error occurred when trying to follow this registered name. Please try again!", - "schange23": "Error occurred when trying to unfollow this registered name. Please try again!", - "schange24": "Error occurred when trying to block this registered name. Please try again!", - "schange25": "Error occurred when trying to unblock this registered name. Please try again!", - "schange26": "Uncategorized", - "schange27": "Size", - "schange28": "Status", - "schange29": "Follow", - "schange30": "Unfollow", - "schange31": "Block", - "schange32": "Unblock", - "schange33": "Name to search", - "schange34": "Name can not be empty!", - "schange35": "Search" - }, - "publishpage": { - "pchange1": "Publish", - "pchange2": "Update", - "pchange3": "Note: it is recommended that you set up port forwarding before hosting data, so that it can more easily accessed by peers on the network.", - "pchange4": "Select Name", - "pchange5": "Title", - "pchange6": "Description", - "pchange7": "Select Category", - "pchange8": "Tag", - "pchange9": "Service", - "pchange10": "Identifier", - "pchange11": "Publish", - "pchange12": "Select zip file containing static content", - "pchange13": "Local path to static files", - "pchange14": "Please select a registered name to publish data for", - "pchange15": "Please select a file to host", - "pchange16": "Please select a zip file to host", - "pchange17": "Please enter the directory path containing the static content", - "pchange18": "Please enter a service name", - "pchange19": "Processing data... this can take some time...", - "pchange20": "Error:", - "pchange21": "Internal Server Error when publishing data", - "pchange22": "Computing proof of work... this can take some time...", - "pchange23": "Transaction successful!", - "pchange24": "Unable to sign and process transaction", - "pchange25": "Choose File" - }, - "browserpage": { - "bchange1": "Forward", - "bchange2": "Reload", - "bchange3": "Back to list", - "bchange4": "Delete", - "bchange5": "from node", - "bchange6": "Your browser doesn't support iframes", - "bchange7": "Follow", - "bchange8": "Unfollow", - "bchange9": "Block", - "bchange10": "Unblock", - "bchange11": "Error occurred when trying to follow this registered name. Please try again!", - "bchange12": "Error occurred when trying to unfollow this registered name. Please try again!", - "bchange13": "Error occurred when trying to block this registered name. Please try again!", - "bchange14": "Error occurred when trying to unblock this registered name. Please try again!", - "bchange15": "Can't delete data from followed names. Please unfollow first.", - "bchange16": "Error occurred when trying to delete this resource. Please try again!" - }, - "datapage": { - "dchange1": "Data Management", - "dchange2": "Search in hosted data by this node", - "dchange3": "Data to search", - "dchange4": "Search", - "dchange5": "Registered Name", - "dchange6": "Service", - "dchange7": "Identifier", - "dchange8": "Actions", - "dchange9": "Data hosted by this node", - "dchange10": "Data name can not be empty!", - "dchange11": "Data not found!", - "dchange12": "Couldn't fetch hosted data list from node", - "dchange13": "This node isn't hosting any data", - "dchange14": "Unfollow", - "dchange15": "Delete", - "dchange16": "Block", - "dchange17": "Unblock", - "dchange18": "Error occurred when trying to block this registered name. Please try again!", - "dchange19": "Error occurred when trying to unfollow this registered name. Please try again!", - "dchange20": "Error occurred when trying to unblock this registered name. Please try again!", - "dchange21": "Error occurred when trying to delete this resource. Please try again!" - }, - "chatpage": { - "cchange1": "New Private Message", - "cchange2": "Loading...", - "cchange3": "Blocked Users", - "cchange4": "New Message", - "cchange5": "(Click to scroll down)", - "cchange6": "Type the name or address of who you want to chat with to send a private message!", - "cchange7": "Name / Address", - "cchange8": "Message...", - "cchange9": "Send", - "cchange10": "Blocked Users List", - "cchange11": "Name", - "cchange12": "Owner", - "cchange13": "Action", - "cchange14": "This account has not blocked any users.", - "cchange15": "No registered name", - "cchange16": "Successfully unblocked this user.", - "cchange17": "Error occurred when trying to unblock this user. Please try again!", - "cchange18": "unblock", - "cchange19": "Invalid Name / Address, Check the name / address and retry...", - "cchange20": "Message Sent Successfully!", - "cchange21": "Sending failed, Please retry...", - "cchange22": "Loading Messages...", - "cchange23": "Cannot Decrypt Message!", - "cchange24": "Maximum Characters per message is 255" - }, - "welcomepage": { - "wcchange1": "Welcome to Q-Chat", - "wcchange2": "New Private Message", - "wcchange3": "Type the name or address of who you want to chat with to send a private message!", - "wcchange4": "Name / Address", - "wcchange5": "Message...", - "wcchange6": "Send", - "wcchange7": "Invalid Name / Address, Check the name / address and retry...", - "wcchange8": "Message Sent Successfully!", - "wcchange9": "Sending failed, Please retry..." - }, - "blockpage": { - "bcchange1": "Block User", - "bcchange2": "Successfully blocked this user!", - "bcchange3": "Error occurred when trying to block this user. Please try again!", - "bcchange4": "No registered name", - "bcchange5": "Block User Request", - "bcchange6": "Are you sure to block this user ?", - "bcchange7": "MENU", - "bcchange8": "Copy Address", - "bcchange9": "Private Message" - }, - "grouppage": { - "gchange1": "Qortal Groups", - "gchange2": "Create Group", - "gchange3": "Your Joined Groups", - "gchange4": "Group Name", - "gchange5": "Description", - "gchange6": "Role", - "gchange7": "Action", - "gchange8": "Not a member of any group!", - "gchange9": "Public Groups", - "gchange10": "Owner", - "gchange11": "No Open Public Groups available!", - "gchange12": "Create a New Group", - "gchange13": "Group Type", - "gchange14": "This Field is Required", - "gchange15": "Select an option", - "gchange16": "Public", - "gchange17": "Private", - "gchange18": "Group Approval Threshold (number / percentage of Admins that must approve a transaction):", - "gchange19": "NONE", - "gchange20": "ONE", - "gchange21": "Minimum Block delay for Group Transaction Approvals:", - "gchange22": "minutes", - "gchange23": "hour", - "gchange24": "hours", - "gchange25": "day", - "gchange26": "days", - "gchange27": "Maximum Block delay for Group Transaction Approvals:", - "gchange28": "Creating Group", - "gchange29": "Create Group", - "gchange30": "Join Group Request", - "gchange31": "Date Created", - "gchange32": "Date Updated", - "gchange33": "Joining", - "gchange34": "Join Group", - "gchange35": "Leave Group Request", - "gchange36": "Leaving", - "gchange37": "Leave Group", - "gchange38": "Manage Group Owner:", - "gchange39": "Manage Group Admin:", - "gchange40": "Manage Group", - "gchange41": "Group Creation Successful!", - "gchange42": "Invalid Group Name", - "gchange43": "Invalid Group Description", - "gchange44": "Select a Group Typ", - "gchange45": "Select a Group Approval Threshold", - "gchange46": "Select a Minimum Block delay for Group Transaction Approvals", - "gchange47": "Select a Maximum Block delay for Group Transaction Approvals", - "gchange48": "Join Group Request Sent Successfully!", - "gchange49": "Leave Group Request Sent Successfully!", - "gchange50": "Leave", - "gchange51": "Join", - "gchange52": "Admin", - "gchange53": "Member", - "gchange54": "Members" - }, - "puzzlepage": { - "pchange1": "Puzzles", - "pchange2": "Reward", - "pchange3": "SOLVED by", - "pchange4": "Name", - "pchange5": "Description", - "pchange6": "Clue / Answer", - "pchange7": "Action", - "pchange8": "Guess", - "pchange9": "Enter your guess to solve this puzzle and win", - "pchange10": "Your guess needs to be 43 or 44 characters and", - "pchange11": "not", - "pchange12": "include 0 (zero), I (upper i), O (upper o) or l (lower L).", - "pchange13": "Your Guess", - "pchange14": "Checking your guess...", - "pchange15": "Submit", - "pchange16": "Guess incorrect!", - "pchange17": "Reward claim submitted - check wallet for reward!" - }, - "nodepage": { - "nchange1": "Node management for:", - "nchange2": "Node has been online for:", - "nchange3": "Node's minting accounts", - "nchange4": "Add minting account", - "nchange5": "If you would like to mint with your own account you will need to create a rewardshare transaction to yourself (with rewardshare percent set to 0), and then mint with the rewardshare key it gives you.", - "nchange6": "Rewardshare key", - "nchange7": "Adding minting account", - "nchange8": "Add", - "nchange9": "Minting Account", - "nchange10": "Recipient Account", - "nchange11": "Action", - "nchange12": "Remove", - "nchange13": "No minting accounts found for this node", - "nchange14": "Peers connected to this node", - "nchange15": "Add peer", - "nchange16": "Type the peer you wish to add's address below", - "nchange17": "Peer Address", - "nchange18": "Address", - "nchange19": "Last Height", - "nchange20": "Build Version", - "nchange21": "Connected for", - "nchange22": "Action", - "nchange23": "Force Sync", - "nchange24": "Node has no connected peers", - "nchange25": "Starting Sync with Peer: ", - "nchange26": "Successfully removed Peer: ", - "nchange27": "Minting Node Added Successfully!", - "nchange28": "Failed to Add Minting Node!", - "nchange29": "Successfully Removed Minting Account!", - "nchange30": "Failed to Remove Minting Account!", - "nchange31": "Stop Node", - "nchange32": "Successfully Sent Stop Request!" - }, - "transpage": { - "tchange1": "Transaction request", - "tchange2": "Decline", - "tchange3": "Confirm", - "tchange4": "To", - "tchange5": "Amount" - }, - "apipage": { - "achange1": "Add API key", - "achange2": "API key", - "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", - "achange4": "Cancel", - "achange5": "Add", - "achange6": "Successfully added API Key", - "achange7": "API key wrong, no API key added" - }, - "transactions": { - "amount": "Amount", - "to": "To", - "declined": "User declined transaction!", - "namedialog1": "You are registering the name below:", - "namedialog2": "On pressing confirm, the name will be registered!", - "groupdialog1": "You are requesting to join the group below:", - "groupdialog2": "On pressing confirm, the group join request will be sent!", - "groupdialog3": "You are requesting to leave the group below:", - "groupdialog4": "On pressing confirm, the leave group request will be sent!", - "groupdialog5": "You are requesting to creating the group below:", - "groupdialog6": "On pressing confirm, the group creating request will be sent!", - "rewarddialog1": "Would you like to create a reward share transaction, sharing", - "rewarddialog2": "of your minting rewards with", - "rewarddialog3": "If yes, you will need to save the key below in order to mint. It can be supplied to any node in order to allow it to mint on your behalf.", - "rewarddialog4": "On pressing confirm, the rewardshare will be created, but you will still need to supply the above key to a node in order to mint with the account.", - "rewarddialog5": "You are removing a reward share transaction associated with account:", - "rewarddialog6": "On pressing confirm, the rewardshare will be removed and the minting key will become invalid." - } -} \ No newline at end of file + "selectmenu": { + "selectlanguage": "Select language", + "languageflag": "us", + "english": "English", + "chinese1": "Chinese (Simplified)", + "chinese2": "Chinese (Traditional)", + "german": "German", + "french": "French", + "polish": "Polish", + "spanish": "Spanish", + "hindi": "Hindi", + "croatian": "Croatian", + "portuguese": "Portuguese", + "hungarian": "Hungarian", + "serbian": "Serbian", + "italian": "Italian", + "russian": "Russian", + "norwegian": "Norwegian", + "romanian": "Romanian", + "korean": "Korean" + }, + "sidemenu": { + "mintingdetails": "MINTING DETAILS", + "becomeAMinter": "BECOME A MINTER", + "wallets": "WALLETS", + "tradeportal": "TRADE PORTAL", + "rewardshare": "REWARD SHARE", + "nameregistration": "NAME REGISTRATION", + "websites": "WEBSITES", + "datamanagement": "DATA MANAGEMENT", + "qchat": "Q-CHAT", + "groupmanagement": "GROUP MANAGEMENT", + "puzzles": "PUZZLES", + "nodemanagement": "NODE MANAGEMENT" + }, + "login": { + "login": "Login", + "createaccount": "Create Account", + "name": "Name", + "address": "Address", + "password": "Password", + "youraccounts": "Your accounts", + "clickto": "Click your account to login with it", + "needcreate": "You need to create or save an account before you can log in!", + "upload": "Upload your qortal backup", + "howlogin": "How would you like to login?", + "seed": "Seedphrase", + "seedphrase": "seedphrase", + "saved": "Saved account", + "qora": "Qora address seed", + "backup": "Qortal wallet backup", + "decrypt": "Decrypt backup", + "save": "Save in this browser.", + "prepare": "Preparing Your Account", + "areyousure": "Are you sure you want to remove this wallet from saved wallets?", + "error1": "Backup must be valid JSON", + "error2": "Login option not selected", + "createwelcome": "Welcome to Qortal, you will find it to be similar to that of an RPG game, you, as a minter on the Qortal network (if you choose to become one) will have the chance to level your account up, giving you both more of the QORT block reward and also larger influence over the network in terms of voting on decisions for the platform.", + "createa": "A", + "click": "Click to view seedphrase", + "confirmpass": "Confirm Password", + "willbe": "will be randomly generated in background. This is used as your private key generator for your blockchain account in Qortal.", + "clicknext": "Create your Qortal account by clicking NEXT below.", + "ready": "Your account is now ready to be created. It will be saved in this browser. If you do not want your new account to be saved in your browser, you can uncheck the box below. You will still be able to login with your new account(after logging out), using your wallet backup file that you MUST download once you create your account.", + "welmessage": "Welcome to Qortal", + "pleaseenter": "Please enter a Password!", + "notmatch": "Passwords not match!", + "lessthen8": "Your password is less than 8 characters! This is not recommended. You can continue to ignore this warning.", + "lessthen8-2": "Your password is less than 8 characters!", + "entername": "Please enter a Name!", + "downloaded": "Your Wallet BackUp file get downloaded!", + "loading": "Loading, Please wait...", + "createdseed": "Your created Seedphrase", + "saveseed": "Save Seedphrase", + "savein": "Save in browser", + "backup2": "This file is the ONLY way to access your account on a system that doesn't have it saved to the app/browser. BE SURE TO BACKUP THIS FILE IN MULTIPLE PLACES. The file is encrypted very securely and decrypted with your local password you created in the previous step. You can save it anywhere securely, but be sure to do that in multiple locations.", + "savewallet": "Save Wallet BackUp File", + "created1": "Your account is now created", + "created2": " and will be saved in this browser.", + "downloadbackup": "Download Wallet BackUp File", + "passwordhint": "A password must be at least 8 characters." + }, + "logout": { + "logout": "LOGOUT", + "confirmlogout": "Are you sure you want to logout?" + }, + "fragfile": { + "selectfile": "Select file", + "dragfile": "Drag and drop backup here" + }, + "settings": { + "generalinfo": "General Account Info", + "address": "Address", + "publickey": "Public Key", + "settings": "Settings", + "account": "Account", + "security": "Security", + "notifications": "Notifications", + "accountsecurity": "Account Security", + "password": "Password", + "download": "Download Backup File", + "choose": "Please choose a password to encrypt your backup with. (This can be the same as the one you logged in with, or different)", + "block": "Block Notifications (Coming Soon...)", + "playsound": "Play Sound", + "shownotifications": "Show Notifications", + "nodeurl": "Node Url", + "nodehint": "Select a node from the default list of nodes above or add a custom node to the list above by clicking on the button below", + "addcustomnode": "Add Custom Node", + "addandsave": "Add And Save", + "protocol": "Protocol", + "domain": "Domain", + "port": "Port" + }, + "appinfo": { + "blockheight": "Block Height", + "uiversion": "UI Version", + "coreversion": "Core Version", + "minting": "(Minting)", + "synchronizing": "Synchronizing" + }, + "walletprofile": { + "minterlevel": "Minter Level", + "blocksminted": "Blocks Minted" + }, + "general": { + "yes": "Yes", + "no": "No", + "confirm": "Confirm", + "decline": "Decline", + "open": "Open", + "close": "Close", + "back": "Back", + "next": "Next", + "create": "Create", + "continue": "Continue", + "save": "Save" + }, + "mintingpage": { + "mchange1": "General Minting Details", + "mchange2": "Blockchain Statistics", + "mchange3": "Avg. Qortal Blocktime", + "mchange4": "Avg. Blocks Per Day", + "mchange5": "Avg. Created QORT Per Day", + "mchange6": "Minting Account Details", + "mchange7": "Not A Minter", + "mchange8": "Minting", + "mchange9": "Not Minting", + "mchange10": "Activate Account Details", + "mchange11": "Not Activated", + "mchange12": "Activate Your Account", + "mchange13": "Introduction", + "mchange14": "To activate your account, an OUTGOING transaction needs to take place. Name Registration is the most common method. You can ask someone in Q-Chat to send you a small amount of QORT so that you may activate your account, or buy QORT within the Trade Portal then make an OUTGOING transaction of any kind and secure your public key on the blockchain. Until you do this, your public key is only known by you, in your UI, and no one else can pull your public key from the chain.", + "mchange15": "Current Status", + "mchange16": "Current Level", + "mchange17": "Blocks To Next Level", + "mchange18": "If you continue minting 24/7 you will reach level", + "mchange19": "Minting Rewards Info", + "mchange20": "Current Tier", + "mchange21": "Total Minters in The Tier", + "mchange22": "Tier Share Per Block", + "mchange23": "Est. Reward Per Block", + "mchange24": "Est. Reward Per Day", + "mchange25": "Seconds", + "mchange26": "Blocks", + "mchange27": "Level", + "mchange28": "Tier", + "mchange29": "days", + "mchange30": "Minters", + "mchange31": "Press for help", + "mchange32": "Become A Minter", + "mchange33": "Introduction", + "mchange34": "In Qortal, in order to become a minter and begin earning QORT rewards with your increase in Minter Level, you must first become ‘sponsored’. A sponsor in Qortal is any other minter of level 5 or higher, or a Qortal Founder. You will obtain a sponsorship key from the sponsor, and use that key to get to level 1. Once you have reached level 1, you will be able to create your own minting key and start earning rewards for helping secure the Qortal Blockchain.", + "mchange35": "Sponsorship", + "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", + "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", + "mchange38": "in" + }, + "becomeMinterPage": { + "bchange1": "Become A Minter", + "bchange2": "Introduction", + "bchange3": "In Qortal, in order to become a minter and begin earning QORT rewards with your increase in Minter Level, you must first become 'sponsored'. A sponsor in Qortal is any other minter of level 5 or higher, or a Qortal Founder. You will obtain a sponsorship key from the sponsor, and use that key to get to level 1. Once you have reached level 1, you will be able to create your own minting key and start earning rewards for helping secure the Qortal Blockchain.", + "bchange4": "Sponsorship", + "bchange5": "Your sponsor will issue you a 'Sponsorship Key' which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own 'Minting Key' and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", + "bchange6": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey!", + "bchange7": "Enter Sponsorship Key", + "bchange8": "Input key from your sponsor here", + "bchange9": "Submit", + "bchange10": "Current Sponsorship Status", + "bchange11": "Status", + "bchange12": "Minting with sponsor key", + "bchange13": "Blocks Remaining in Sponsorship Period", + "bchange14": "blocks", + "bchange15": "Sponsorship Relationship", + "bchange16": "Sponsor Account", + "bchange17": "Copy Sponsorship Key" + }, + "walletpage": { + "wchange1": "Fetching balance ...", + "wchange2": "Current Wallet", + "wchange3": "Copy wallet address to clipboard", + "wchange4": "Address copied to clipboard", + "wchange5": "Transaction Details", + "wchange6": "Transaction Type", + "wchange7": "OUT", + "wchange8": "IN", + "wchange9": "Sender", + "wchange10": "Receiver", + "wchange11": "Amount", + "wchange12": "Transaction Fee", + "wchange13": "Block", + "wchange14": "Time", + "wchange15": "Transaction Signature", + "wchange16": "Transaction Hash", + "wchange17": "Send", + "wchange18": "From address", + "wchange19": "Available balance", + "wchange20": "To (address or name)", + "wchange21": "Current static fee:", + "wchange22": "Wallets", + "wchange23": "To (address)", + "wchange24": "Current fee per byte", + "wchange25": "Low fees may result in slow or unconfirmed transactions.", + "wchange26": "Insufficient Funds!", + "wchange27": "Invalid Amount!", + "wchange28": "Receiver cannot be empty!", + "wchange29": "Invalid Receiver!", + "wchange30": "Transaction Successful!", + "wchange31": "Transaction Failed!", + "wchange32": "Failed to Fetch QORT Balance. Try again!", + "wchange33": "Failed to Fetch", + "wchange34": "Balance. Try again!", + "wchange35": "Type", + "wchange36": "Fee", + "wchange37": "Total Amount", + "wchange38": "Address has no transactions yet.", + "wchange39": "Unable to copy address.", + "wchange40": "PAYMENT", + "wchange41": "Status", + "wchange42": "Confirmations", + "wchange43": "Your transaction will not show until confirmed, be patient...", + "wchange44": "Please try again..." + }, + "tradepage": { + "tchange1": "Trade Portal", + "tchange2": "Select Trading Pair", + "tchange3": "HISTORIC MARKET TRADES", + "tchange4": "MY TRADE HISTORY", + "tchange5": "OPEN MARKET SELL ORDERS", + "tchange6": "MY ORDERS", + "tchange7": "Stuck Offers", + "tchange8": "Amount", + "tchange9": "Price", + "tchange10": "Total", + "tchange11": "Date", + "tchange12": "Status", + "tchange13": "Seller", + "tchange14": "Price Each", + "tchange15": "Clear Form", + "tchange16": "You have", + "tchange17": "Action", + "tchange18": "BUY", + "tchange19": "SELL", + "tchange20": "Failed to Create Trade. Try again!", + "tchange21": "Failed to Create Trade. Error Code", + "tchange22": "Insufficient Funds!", + "tchange23": "Buy Request Successful!", + "tchange24": "Buy Request Existing!", + "tchange25": "Failed to Create Trade. Error Code", + "tchange26": "Trade Cancelling In Progress!", + "tchange27": "Failed to Cancel Trade. Try again!", + "tchange28": "Failed to Cancel Trade. Error Code", + "tchange29": "CANCEL", + "tchange30": "Failed to Fetch Balance. Try again!", + "tchange31": "SOLD", + "tchange32": "BOUGHT" + }, + "rewardsharepage": { + "rchange1": "Rewardshares", + "rchange2": "Create reward share", + "rchange3": "Rewardshares Involving In This Account", + "rchange4": "Minting Account", + "rchange5": "Share Percent", + "rchange6": "Recipient", + "rchange7": "Action", + "rchange8": "Type", + "rchange9": "Level 1 - 4 can create a Self Share and Level 5 or above can create a Reward Share!", + "rchange10": "Recipient Public Key", + "rchange11": "Reward share percentage", + "rchange12": "Doing something delicious", + "rchange13": "Adding minting account", + "rchange14": "Add", + "rchange15": "Account is not involved in any reward shares", + "rchange16": "Own Rewardshare", + "rchange17": "Remove", + "rchange18": "Cannot Create Multiple Reward Shares!", + "rchange19": "Cannot Create Multiple Self Shares!", + "rchange20": "CANNOT CREATE REWARD SHARE! at level", + "rchange21": "Reward Share Successful!", + "rchange22": "Reward Share Removed Successfully!" + }, + "registernamepage": { + "nchange1": "Name Registration", + "nchange2": "Register Name", + "nchange3": "Registered Names", + "nchange4": "Avatar", + "nchange5": "Name", + "nchange6": "Owner", + "nchange7": "Action", + "nchange8": "No names registered by this account!", + "nchange9": "Register a Name!", + "nchange10": "Description (optional)", + "nchange11": "Doing something delicious", + "nchange12": "Registering Name", + "nchange13": "The current name registration fee is", + "nchange14": "Register", + "nchange15": "Set Avatar", + "nchange16": "Need Core Update", + "nchange17": "Name Already Exists!", + "nchange18": "Name Registration Successful!" + }, + "websitespage": { + "schange1": "Browse Websites", + "schange2": "Followed Websites", + "schange3": "Blocked Websites", + "schange4": "Search Websites", + "schange5": "Avatar", + "schange6": "Details", + "schange7": "Published by", + "schange8": "Actions", + "schange9": "Websites", + "schange10": "No websites available", + "schange11": "Your Followed Websites", + "schange12": "Followed Websites", + "schange13": "You aren't following any websites", + "schange14": "Your Blocked Websites", + "schange15": "Blocked Websites", + "schange16": "You have not blocked any websites", + "schange17": "Name Not Found!", + "schange18": "Relay mode is enabled. This means that your node will help to transport encrypted data around the network when a peer requests it. You can opt out by setting", + "schange19": "in", + "schange20": "Relay mode is disabled. You can enable it by setting", + "schange21": "Publish Website", + "schange22": "Error occurred when trying to follow this registered name. Please try again!", + "schange23": "Error occurred when trying to unfollow this registered name. Please try again!", + "schange24": "Error occurred when trying to block this registered name. Please try again!", + "schange25": "Error occurred when trying to unblock this registered name. Please try again!", + "schange26": "Uncategorized", + "schange27": "Size", + "schange28": "Status", + "schange29": "Follow", + "schange30": "Unfollow", + "schange31": "Block", + "schange32": "Unblock", + "schange33": "Name to search", + "schange34": "Name can not be empty!", + "schange35": "Search" + }, + "publishpage": { + "pchange1": "Publish", + "pchange2": "Update", + "pchange3": "Note: it is recommended that you set up port forwarding before hosting data, so that it can more easily accessed by peers on the network.", + "pchange4": "Select Name", + "pchange5": "Title", + "pchange6": "Description", + "pchange7": "Select Category", + "pchange8": "Tag", + "pchange9": "Service", + "pchange10": "Identifier", + "pchange11": "Publish", + "pchange12": "Select zip file containing static content", + "pchange13": "Local path to static files", + "pchange14": "Please select a registered name to publish data for", + "pchange15": "Please select a file to host", + "pchange16": "Please select a zip file to host", + "pchange17": "Please enter the directory path containing the static content", + "pchange18": "Please enter a service name", + "pchange19": "Processing data... this can take some time...", + "pchange20": "Error:", + "pchange21": "Internal Server Error when publishing data", + "pchange22": "Computing proof of work... this can take some time...", + "pchange23": "Transaction successful!", + "pchange24": "Unable to sign and process transaction", + "pchange25": "Choose File" + }, + "browserpage": { + "bchange1": "Forward", + "bchange2": "Reload", + "bchange3": "Back to list", + "bchange4": "Delete", + "bchange5": "from node", + "bchange6": "Your browser doesn't support iframes", + "bchange7": "Follow", + "bchange8": "Unfollow", + "bchange9": "Block", + "bchange10": "Unblock", + "bchange11": "Error occurred when trying to follow this registered name. Please try again!", + "bchange12": "Error occurred when trying to unfollow this registered name. Please try again!", + "bchange13": "Error occurred when trying to block this registered name. Please try again!", + "bchange14": "Error occurred when trying to unblock this registered name. Please try again!", + "bchange15": "Can't delete data from followed names. Please unfollow first.", + "bchange16": "Error occurred when trying to delete this resource. Please try again!" + }, + "datapage": { + "dchange1": "Data Management", + "dchange2": "Search in hosted data by this node", + "dchange3": "Data to search", + "dchange4": "Search", + "dchange5": "Registered Name", + "dchange6": "Service", + "dchange7": "Identifier", + "dchange8": "Actions", + "dchange9": "Data hosted by this node", + "dchange10": "Data name can not be empty!", + "dchange11": "Data not found!", + "dchange12": "Couldn't fetch hosted data list from node", + "dchange13": "This node isn't hosting any data", + "dchange14": "Unfollow", + "dchange15": "Delete", + "dchange16": "Block", + "dchange17": "Unblock", + "dchange18": "Error occurred when trying to block this registered name. Please try again!", + "dchange19": "Error occurred when trying to unfollow this registered name. Please try again!", + "dchange20": "Error occurred when trying to unblock this registered name. Please try again!", + "dchange21": "Error occurred when trying to delete this resource. Please try again!" + }, + "chatpage": { + "cchange1": "New Private Message", + "cchange2": "Loading...", + "cchange3": "Blocked Users", + "cchange4": "New Message", + "cchange5": "(Click to scroll down)", + "cchange6": "Type the name or address of who you want to chat with to send a private message!", + "cchange7": "Name / Address", + "cchange8": "Message...", + "cchange9": "Send", + "cchange10": "Blocked Users List", + "cchange11": "Name", + "cchange12": "Owner", + "cchange13": "Action", + "cchange14": "This account has not blocked any users.", + "cchange15": "No registered name", + "cchange16": "Successfully unblocked this user.", + "cchange17": "Error occurred when trying to unblock this user. Please try again!", + "cchange18": "unblock", + "cchange19": "Invalid Name / Address, Check the name / address and retry...", + "cchange20": "Message Sent Successfully!", + "cchange21": "Sending failed, Please retry...", + "cchange22": "Loading Messages...", + "cchange23": "Cannot Decrypt Message!", + "cchange24": "Maximum Characters per message is 255" + }, + "welcomepage": { + "wcchange1": "Welcome to Q-Chat", + "wcchange2": "New Private Message", + "wcchange3": "Type the name or address of who you want to chat with to send a private message!", + "wcchange4": "Name / Address", + "wcchange5": "Message...", + "wcchange6": "Send", + "wcchange7": "Invalid Name / Address, Check the name / address and retry...", + "wcchange8": "Message Sent Successfully!", + "wcchange9": "Sending failed, Please retry..." + }, + "blockpage": { + "bcchange1": "Block User", + "bcchange2": "Successfully blocked this user!", + "bcchange3": "Error occurred when trying to block this user. Please try again!", + "bcchange4": "No registered name", + "bcchange5": "Block User Request", + "bcchange6": "Are you sure to block this user ?", + "bcchange7": "MENU", + "bcchange8": "Copy Address", + "bcchange9": "Private Message" + }, + "grouppage": { + "gchange1": "Qortal Groups", + "gchange2": "Create Group", + "gchange3": "Your Joined Groups", + "gchange4": "Group Name", + "gchange5": "Description", + "gchange6": "Role", + "gchange7": "Action", + "gchange8": "Not a member of any group!", + "gchange9": "Public Groups", + "gchange10": "Owner", + "gchange11": "No Open Public Groups available!", + "gchange12": "Create a New Group", + "gchange13": "Group Type", + "gchange14": "This Field is Required", + "gchange15": "Select an option", + "gchange16": "Public", + "gchange17": "Private", + "gchange18": "Group Approval Threshold (number / percentage of Admins that must approve a transaction):", + "gchange19": "NONE", + "gchange20": "ONE", + "gchange21": "Minimum Block delay for Group Transaction Approvals:", + "gchange22": "minutes", + "gchange23": "hour", + "gchange24": "hours", + "gchange25": "day", + "gchange26": "days", + "gchange27": "Maximum Block delay for Group Transaction Approvals:", + "gchange28": "Creating Group", + "gchange29": "Create Group", + "gchange30": "Join Group Request", + "gchange31": "Date Created", + "gchange32": "Date Updated", + "gchange33": "Joining", + "gchange34": "Join Group", + "gchange35": "Leave Group Request", + "gchange36": "Leaving", + "gchange37": "Leave Group", + "gchange38": "Manage Group Owner:", + "gchange39": "Manage Group Admin:", + "gchange40": "Manage Group", + "gchange41": "Group Creation Successful!", + "gchange42": "Invalid Group Name", + "gchange43": "Invalid Group Description", + "gchange44": "Select a Group Typ", + "gchange45": "Select a Group Approval Threshold", + "gchange46": "Select a Minimum Block delay for Group Transaction Approvals", + "gchange47": "Select a Maximum Block delay for Group Transaction Approvals", + "gchange48": "Join Group Request Sent Successfully!", + "gchange49": "Leave Group Request Sent Successfully!", + "gchange50": "Leave", + "gchange51": "Join", + "gchange52": "Admin", + "gchange53": "Member", + "gchange54": "Members" + }, + "puzzlepage": { + "pchange1": "Puzzles", + "pchange2": "Reward", + "pchange3": "SOLVED by", + "pchange4": "Name", + "pchange5": "Description", + "pchange6": "Clue / Answer", + "pchange7": "Action", + "pchange8": "Guess", + "pchange9": "Enter your guess to solve this puzzle and win", + "pchange10": "Your guess needs to be 43 or 44 characters and", + "pchange11": "not", + "pchange12": "include 0 (zero), I (upper i), O (upper o) or l (lower L).", + "pchange13": "Your Guess", + "pchange14": "Checking your guess...", + "pchange15": "Submit", + "pchange16": "Guess incorrect!", + "pchange17": "Reward claim submitted - check wallet for reward!" + }, + "nodepage": { + "nchange1": "Node management for:", + "nchange2": "Node has been online for:", + "nchange3": "Node's minting accounts", + "nchange4": "Add minting account", + "nchange5": "If you would like to mint with your own account you will need to create a rewardshare transaction to yourself (with rewardshare percent set to 0), and then mint with the rewardshare key it gives you.", + "nchange6": "Rewardshare key", + "nchange7": "Adding minting account", + "nchange8": "Add", + "nchange9": "Minting Account", + "nchange10": "Recipient Account", + "nchange11": "Action", + "nchange12": "Remove", + "nchange13": "No minting accounts found for this node", + "nchange14": "Peers connected to this node", + "nchange15": "Add peer", + "nchange16": "Type the peer you wish to add's address below", + "nchange17": "Peer Address", + "nchange18": "Address", + "nchange19": "Last Height", + "nchange20": "Build Version", + "nchange21": "Connected for", + "nchange22": "Action", + "nchange23": "Force Sync", + "nchange24": "Node has no connected peers", + "nchange25": "Starting Sync with Peer: ", + "nchange26": "Successfully removed Peer: ", + "nchange27": "Minting Node Added Successfully!", + "nchange28": "Failed to Add Minting Node!", + "nchange29": "Successfully Removed Minting Account!", + "nchange30": "Failed to Remove Minting Account!", + "nchange31": "Stop Node", + "nchange32": "Successfully Sent Stop Request!" + }, + "transpage": { + "tchange1": "Transaction request", + "tchange2": "Decline", + "tchange3": "Confirm", + "tchange4": "To", + "tchange5": "Amount" + }, + "apipage": { + "achange1": "Add API key", + "achange2": "API key", + "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", + "achange4": "Cancel", + "achange5": "Add", + "achange6": "Successfully added API Key", + "achange7": "API key wrong, no API key added" + }, + "transactions": { + "amount": "Amount", + "to": "To", + "declined": "User declined transaction!", + "namedialog1": "You are registering the name below:", + "namedialog2": "On pressing confirm, the name will be registered!", + "groupdialog1": "You are requesting to join the group below:", + "groupdialog2": "On pressing confirm, the group join request will be sent!", + "groupdialog3": "You are requesting to leave the group below:", + "groupdialog4": "On pressing confirm, the leave group request will be sent!", + "groupdialog5": "You are requesting to creating the group below:", + "groupdialog6": "On pressing confirm, the group creating request will be sent!", + "rewarddialog1": "Would you like to create a reward share transaction, sharing", + "rewarddialog2": "of your minting rewards with", + "rewarddialog3": "If yes, you will need to save the key below in order to mint. It can be supplied to any node in order to allow it to mint on your behalf.", + "rewarddialog4": "On pressing confirm, the rewardshare will be created, but you will still need to supply the above key to a node in order to mint with the account.", + "rewarddialog5": "You are removing a reward share transaction associated with account:", + "rewarddialog6": "On pressing confirm, the rewardshare will be removed and the minting key will become invalid." + } +} From 4dd62f9eb6faf9a7f2d1439d33d7a638c0f37b29 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 18:13:13 +0300 Subject: [PATCH 02/17] added new plugin to menu --- qortal-ui-core/src/components/sidenav-menu.js | 391 +++++++++++------- 1 file changed, 247 insertions(+), 144 deletions(-) diff --git a/qortal-ui-core/src/components/sidenav-menu.js b/qortal-ui-core/src/components/sidenav-menu.js index 8ff90e4d..e96d3784 100644 --- a/qortal-ui-core/src/components/sidenav-menu.js +++ b/qortal-ui-core/src/components/sidenav-menu.js @@ -1,159 +1,262 @@ -import { LitElement, html, css } from 'lit' -import { connect } from 'pwa-helpers' -import { store } from '../store.js' -import { translate, translateUnsafeHTML } from 'lit-translate' +import { LitElement, html, css } from 'lit'; +import { connect } from 'pwa-helpers'; +import { store } from '../store.js'; +import { translate, translateUnsafeHTML } from 'lit-translate'; -import '@polymer/paper-ripple' -import '@vaadin/icon' -import '@vaadin/icons' +import '@polymer/paper-ripple'; +import '@vaadin/icon'; +import '@vaadin/icons'; -import '../functional-components/side-menu.js' -import '../functional-components/side-menu-item.js' +import '../functional-components/side-menu.js'; +import '../functional-components/side-menu-item.js'; class SidenavMenu extends connect(store)(LitElement) { - static get properties() { - return { - config: { type: Object }, - urls: { type: Object }, - nodeType: { type: String, reflect: true }, - theme: { type: String, reflect: true } - } - } + static get properties() { + return { + config: { type: Object }, + urls: { type: Object }, + nodeType: { type: String, reflect: true }, + theme: { type: String, reflect: true }, + addressInfo: { type: Object }, + }; + } - static get styles() { - return [ - css` - * { - --item-selected-color: var(--nav-selected-color); - --item-selected-color-text: var(--nav-selected-color-text); - --item-color-active: var(--nav-color-active); - --item-color-hover: var(--nav-color-hover); - --item-text-color: var(--nav-text-color); - --item-icon-color: var(--nav-icon-color); - --item-border-color: var(--nav-border-color); - --item-border-selected-color: var(--nav-border-selected-color); - } + static get styles() { + return [ + css` + * { + --item-selected-color: var(--nav-selected-color); + --item-selected-color-text: var(--nav-selected-color-text); + --item-color-active: var(--nav-color-active); + --item-color-hover: var(--nav-color-hover); + --item-text-color: var(--nav-text-color); + --item-icon-color: var(--nav-icon-color); + --item-border-color: var(--nav-border-color); + --item-border-selected-color: var( + --nav-border-selected-color + ); + } - .s-menu { - list-style: none; - padding: 0px 0px; - background: var(--sidetopbar); - border-radius: 2px; - width: 100%; - border-top: 1px solid var(--border); - outline: none; - } - ` - ] - } + .s-menu { + list-style: none; + padding: 0px 0px; + background: var(--sidetopbar); + border-radius: 2px; + width: 100%; + border-top: 1px solid var(--border); + outline: none; + } + `, + ]; + } - constructor() { - super() - this.urls = [] - this.nodeType = '' - this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light' - } + constructor() { + super(); + this.urls = []; + this.nodeType = ''; + this.theme = localStorage.getItem('qortalTheme') + ? localStorage.getItem('qortalTheme') + : 'light'; + this.addressInfo = {}; + } - render() { - return html` -
- - ${this.renderNodeTypeMenu()} - ${this.renderNodeManagement()} - -
- ` - } + render() { + console.log({ myStore: store.getState() }); + return html` +
+ + ${this.renderNodeTypeMenu()} ${this.renderNodeManagement()} + +
+ `; + } - firstUpdated() { - this.getNodeType() - } + firstUpdated() { + this.getNodeType(); + } - async getNodeType() { - const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node] - const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port - const url = `${nodeUrl}/admin/info` - await fetch(url) - .then(response => { - return response.json() - }) - .then(data => { - this.nodeType = data.type - }) - .catch(err => { - console.error('Request failed', err); - }) - } + async getNodeType() { + const myNode = + store.getState().app.nodeConfig.knownNodes[ + store.getState().app.nodeConfig.node + ]; + const nodeUrl = + myNode.protocol + '://' + myNode.domain + ':' + myNode.port; + const url = `${nodeUrl}/admin/info`; + await fetch(url) + .then((response) => { + return response.json(); + }) + .then((data) => { + this.nodeType = data.type; + }) + .catch((err) => { + console.error('Request failed', err); + }); + } - renderNodeTypeMenu() { - if (this.nodeType === 'lite') { - return html` - - - - - - - - - - - - - ` - } else { - return html` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ` - } - } + renderNodeTypeMenu() { + const addressInfo = this.addressInfo; + const isMinting = addressInfo?.error !== 124 && +addressInfo?.level > 0; - renderNodeManagement() { - const checkNodeManagement = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node] - if (checkNodeManagement.enableManagement = true) { - return html` - - - - ` - } else { - return html`` - } - } + if (this.nodeType === 'lite') { + return html` + + + + + + + + + + + + + `; + } else { + return html` + ${isMinting + ? html` + + ` + : html` + + `} - stateChanged(state) { - this.config = state.config - this.urls = state.app.registeredUrls - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + `; + } + } + + renderNodeManagement() { + const checkNodeManagement = + store.getState().app.nodeConfig.knownNodes[ + store.getState().app.nodeConfig.node + ]; + console.log({ store1: store.getState().app }); + if ((checkNodeManagement.enableManagement = true)) { + return html` + + + + `; + } else { + return html``; + } + } + + stateChanged(state) { + this.config = state.config; + this.urls = state.app.registeredUrls; + this.addressInfo = state.app.accountInfo.addressInfo; + } } -window.customElements.define('sidenav-menu', SidenavMenu) +window.customElements.define('sidenav-menu', SidenavMenu); From 82406bd2e4424216d0e7e9a2721dc89c6a7e182a Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 18:13:35 +0300 Subject: [PATCH 03/17] added become a minter route --- qortal-ui-plugins/build-config.js | 254 ++++++++++---------- qortal-ui-plugins/plugins/core/main.src.js | 257 +++++++++++---------- 2 files changed, 263 insertions(+), 248 deletions(-) diff --git a/qortal-ui-plugins/build-config.js b/qortal-ui-plugins/build-config.js index 4fddf782..649d615a 100644 --- a/qortal-ui-plugins/build-config.js +++ b/qortal-ui-plugins/build-config.js @@ -1,137 +1,141 @@ -require('events').EventEmitter.defaultMaxListeners = 0 -const path = require("path"); -const { nodeResolve } = require("@rollup/plugin-node-resolve"); -const progress = require("rollup-plugin-progress"); +require('events').EventEmitter.defaultMaxListeners = 0; +const path = require('path'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); +const progress = require('rollup-plugin-progress'); const replace = require('@rollup/plugin-replace'); -const globals = require("rollup-plugin-node-globals"); -const commonjs = require("@rollup/plugin-commonjs"); -const alias = require("@rollup/plugin-alias"); +const globals = require('rollup-plugin-node-globals'); +const commonjs = require('@rollup/plugin-commonjs'); +const alias = require('@rollup/plugin-alias'); const { terser } = require('rollup-plugin-terser'); -const babel = require("@rollup/plugin-babel"); +const babel = require('@rollup/plugin-babel'); const aliases = {}; const generateRollupConfig = (inputFile, outputFile) => { - return { - inputOptions: { - onwarn: (warning, rollupWarn) => { - if (warning.code !== 'CIRCULAR_DEPENDENCY') { - rollupWarn(warning) - } - }, - input: inputFile, - plugins: [ - alias({ - entries: Object.keys(aliases).map((find) => { - return { - find, - replacement: aliases[find], - }; - }), - }), - nodeResolve({ - preferBuiltins: false, - mainFields: ['module', 'browser'] - }), - replace({ - preventAssignment: true, - "process.env.NODE_ENV": JSON.stringify("production"), - }), - commonjs(), - globals(), - progress(), - babel.babel({ - babelHelpers: 'bundled', - exclude: "node_modules/**", - }), - terser({ - compress: true, - output: { - comments: false, - }, - }) - ], - }, - outputOptions: { - file: outputFile, - format: "umd", - }, - }; + return { + inputOptions: { + onwarn: (warning, rollupWarn) => { + if (warning.code !== 'CIRCULAR_DEPENDENCY') { + rollupWarn(warning); + } + }, + input: inputFile, + plugins: [ + alias({ + entries: Object.keys(aliases).map((find) => { + return { + find, + replacement: aliases[find], + }; + }), + }), + nodeResolve({ + preferBuiltins: false, + mainFields: ['module', 'browser'], + }), + replace({ + preventAssignment: true, + 'process.env.NODE_ENV': JSON.stringify('production'), + }), + commonjs(), + globals(), + progress(), + babel.babel({ + babelHelpers: 'bundled', + exclude: 'node_modules/**', + }), + terser({ + compress: true, + output: { + comments: false, + }, + }), + ], + }, + outputOptions: { + file: outputFile, + format: 'umd', + }, + }; }; const generateForPlugins = () => { - const configs = [ - { - in: "plugins/core/main.src.js", - out: "plugins/core/main.js", - }, - { - in: "plugins/core/trade-portal/trade-portal.src.js", - out: "plugins/core/trade-portal/trade-portal.js", - }, - { - in: "plugins/core/wallet/wallet-app.src.js", - out: "plugins/core/wallet/wallet-app.js", - }, - { - in: "plugins/core/reward-share/reward-share.src.js", - out: "plugins/core/reward-share/reward-share.js", - }, - { - in: "plugins/core/node-management/node-management.src.js", - out: "plugins/core/node-management/node-management.js", - }, - { - in: "plugins/core/group-management/group-management.src.js", - out: "plugins/core/group-management/group-management.js", - }, - { - in: "plugins/core/name-registration/name-registration.src.js", - out: "plugins/core/name-registration/name-registration.js", - }, - { - in: "plugins/core/qdn/websites.src.js", - out: "plugins/core/qdn/websites.js", - }, - { - in: "plugins/core/qdn/publish/publish.src.js", - out: "plugins/core/qdn/publish/publish.js", - }, - { - in: "plugins/core/qdn/browser/browser.src.js", - out: "plugins/core/qdn/browser/browser.js", - }, - { - in: "plugins/core/qdn/data-management/data-management.src.js", - out: "plugins/core/qdn/data-management/data-management.js", - }, - { - in: "plugins/core/messaging/messaging.src.js", - out: "plugins/core/messaging/messaging.js", - }, - { - in: "plugins/core/messaging/chain-messaging/chain-messaging.src.js", - out: "plugins/core/messaging/chain-messaging/chain-messaging.js", - }, - { - in: "plugins/core/messaging/q-chat/q-chat.src.js", - out: "plugins/core/messaging/q-chat/q-chat.js", - }, - { - in: "plugins/core/minting/minting-info.src.js", - out: "plugins/core/minting/minting-info.js", - }, - { - in: "plugins/core/puzzles/puzzles.src.js", - out: "plugins/core/puzzles/puzzles.js", - } - ].map((file) => { - return generateRollupConfig( - path.join(__dirname, file.in), - path.join(__dirname, file.out) - ); - }); - return configs; + const configs = [ + { + in: 'plugins/core/main.src.js', + out: 'plugins/core/main.js', + }, + { + in: 'plugins/core/trade-portal/trade-portal.src.js', + out: 'plugins/core/trade-portal/trade-portal.js', + }, + { + in: 'plugins/core/wallet/wallet-app.src.js', + out: 'plugins/core/wallet/wallet-app.js', + }, + { + in: 'plugins/core/reward-share/reward-share.src.js', + out: 'plugins/core/reward-share/reward-share.js', + }, + { + in: 'plugins/core/node-management/node-management.src.js', + out: 'plugins/core/node-management/node-management.js', + }, + { + in: 'plugins/core/group-management/group-management.src.js', + out: 'plugins/core/group-management/group-management.js', + }, + { + in: 'plugins/core/name-registration/name-registration.src.js', + out: 'plugins/core/name-registration/name-registration.js', + }, + { + in: 'plugins/core/qdn/websites.src.js', + out: 'plugins/core/qdn/websites.js', + }, + { + in: 'plugins/core/qdn/publish/publish.src.js', + out: 'plugins/core/qdn/publish/publish.js', + }, + { + in: 'plugins/core/qdn/browser/browser.src.js', + out: 'plugins/core/qdn/browser/browser.js', + }, + { + in: 'plugins/core/qdn/data-management/data-management.src.js', + out: 'plugins/core/qdn/data-management/data-management.js', + }, + { + in: 'plugins/core/messaging/messaging.src.js', + out: 'plugins/core/messaging/messaging.js', + }, + { + in: 'plugins/core/messaging/chain-messaging/chain-messaging.src.js', + out: 'plugins/core/messaging/chain-messaging/chain-messaging.js', + }, + { + in: 'plugins/core/messaging/q-chat/q-chat.src.js', + out: 'plugins/core/messaging/q-chat/q-chat.js', + }, + { + in: 'plugins/core/minting/minting-info.src.js', + out: 'plugins/core/minting/minting-info.js', + }, + { + in: 'plugins/core/become-minter/become-minter.src.js', + out: 'plugins/core/become-minter/become-minter.js', + }, + { + in: 'plugins/core/puzzles/puzzles.src.js', + out: 'plugins/core/puzzles/puzzles.js', + }, + ].map((file) => { + return generateRollupConfig( + path.join(__dirname, file.in), + path.join(__dirname, file.out) + ); + }); + return configs; }; module.exports = generateForPlugins; diff --git a/qortal-ui-plugins/plugins/core/main.src.js b/qortal-ui-plugins/plugins/core/main.src.js index a15eb1b4..b4efcb9f 100644 --- a/qortal-ui-plugins/plugins/core/main.src.js +++ b/qortal-ui-plugins/plugins/core/main.src.js @@ -1,132 +1,143 @@ -import { parentEpml } from './connect.js' -import './streams/streams.js' - -let config = {} -let haveRegisteredNodeManagement = false +import { parentEpml } from './connect.js'; +import './streams/streams.js'; +let config = {}; +let haveRegisteredNodeManagement = false; parentEpml.ready().then(() => { - // pluginUrlsConf - let pluginUrlsConf = [ - { - url: 'minting', - domain: 'core', - page: 'minting/index.html', - title: 'Minting Details', - icon: 'vaadin:info-circle', - menus: [], - parent: false - }, - { - url: 'wallet', - domain: 'core', - page: 'wallet/index.html', - title: 'Wallet', - icon: 'vaadin:wallet', - menus: [], - parent: false - }, - { - url: 'trade-portal', - domain: 'core', - page: 'trade-portal/index.html', - title: 'Trade Portal', - icon: 'vaadin:bullets', - menus: [], - parent: false - }, - { - url: 'reward-share', - domain: 'core', - page: 'reward-share/index.html', - title: 'Reward Share', - icon: 'vaadin:share-square', - menus: [], - parent: false - }, - { - url: 'name-registration', - domain: 'core', - page: 'name-registration/index.html', - title: 'Name Registration', - icon: 'vaadin:user-check', - menus: [], - parent: false - }, - { - url: 'websites', - domain: 'core', - page: 'qdn/index.html', - title: 'Websites', - icon: 'vaadin:desktop', - menus: [], - parent: false - }, - { - url: 'data-management', - domain: 'core', - page: 'qdn/data-management/index.html', - title: 'Data Management', - icon: 'vaadin:database', - menus: [], - parent: false - }, - { - url: 'q-chat', - domain: 'core', - page: 'messaging/q-chat/index.html', - title: 'Q-Chat', - icon: 'vaadin:chat', - menus: [], - parent: false - }, - { - url: 'group-management', - domain: 'core', - page: 'group-management/index.html', - title: 'Group Management', - icon: 'vaadin:group', - menus: [], - parent: false - }, - { - url: 'puzzles', - domain: 'core', - page: 'puzzles/index.html', - title: 'Puzzles', - icon: 'vaadin:puzzle-piece', - menus: [], - parent: false - } - ] + // pluginUrlsConf + let pluginUrlsConf = [ + { + url: 'minting', + domain: 'core', + page: 'minting/index.html', + title: 'Minting Details', + icon: 'vaadin:info-circle', + menus: [], + parent: false, + }, + { + url: 'become-minter', + domain: 'core', + page: 'become-minter/index.html', + title: 'Become a Minter', + icon: 'vaadin:info-circle', + menus: [], + parent: false, + }, + { + url: 'wallet', + domain: 'core', + page: 'wallet/index.html', + title: 'Wallet', + icon: 'vaadin:wallet', + menus: [], + parent: false, + }, + { + url: 'trade-portal', + domain: 'core', + page: 'trade-portal/index.html', + title: 'Trade Portal', + icon: 'vaadin:bullets', + menus: [], + parent: false, + }, + { + url: 'reward-share', + domain: 'core', + page: 'reward-share/index.html', + title: 'Reward Share', + icon: 'vaadin:share-square', + menus: [], + parent: false, + }, + { + url: 'name-registration', + domain: 'core', + page: 'name-registration/index.html', + title: 'Name Registration', + icon: 'vaadin:user-check', + menus: [], + parent: false, + }, + { + url: 'websites', + domain: 'core', + page: 'qdn/index.html', + title: 'Websites', + icon: 'vaadin:desktop', + menus: [], + parent: false, + }, + { + url: 'data-management', + domain: 'core', + page: 'qdn/data-management/index.html', + title: 'Data Management', + icon: 'vaadin:database', + menus: [], + parent: false, + }, + { + url: 'q-chat', + domain: 'core', + page: 'messaging/q-chat/index.html', + title: 'Q-Chat', + icon: 'vaadin:chat', + menus: [], + parent: false, + }, + { + url: 'group-management', + domain: 'core', + page: 'group-management/index.html', + title: 'Group Management', + icon: 'vaadin:group', + menus: [], + parent: false, + }, + { + url: 'puzzles', + domain: 'core', + page: 'puzzles/index.html', + title: 'Puzzles', + icon: 'vaadin:puzzle-piece', + menus: [], + parent: false, + }, + ]; - const registerPlugins = (pluginInfo) => { - parentEpml.request('registerUrl', pluginInfo) - } + const registerPlugins = (pluginInfo) => { + parentEpml.request('registerUrl', pluginInfo); + }; - const checkNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node] + const checkNode = + window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ + window.parent.reduxStore.getState().app.nodeConfig.node + ]; - parentEpml.subscribe('config', c => { - config = JSON.parse(c) + parentEpml.subscribe('config', (c) => { + config = JSON.parse(c); - // Only register node management if node management is enabled and it hasn't already been registered - if (!haveRegisteredNodeManagement && checkNode.enableManagement) { - haveRegisteredNodeManagement = true + // Only register node management if node management is enabled and it hasn't already been registered + if (!haveRegisteredNodeManagement && checkNode.enableManagement) { + haveRegisteredNodeManagement = true; - let nodeManagementConf = { - url: 'node-management', - domain: 'core', - page: 'node-management/index.html', - title: 'Node Management', - icon: 'vaadin:cloud', - menus: [], - parent: false - } + let nodeManagementConf = { + url: 'node-management', + domain: 'core', + page: 'node-management/index.html', + title: 'Node Management', + icon: 'vaadin:cloud', + menus: [], + parent: false, + }; - let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf] - registerPlugins(_pluginUrlsConf) - } else { - registerPlugins(pluginUrlsConf) - } - }) -}) + let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf]; + registerPlugins(_pluginUrlsConf); + } else { + registerPlugins(pluginUrlsConf); + } + }); +}); From 5b28b0779e906be4754a95b19cf51b82e7de1307 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 18:13:59 +0300 Subject: [PATCH 04/17] new page become a minter --- .../core/become-minter/become-minter.src.js | 355 ++++++++++++++++++ .../plugins/core/become-minter/index.html | 53 +++ 2 files changed, 408 insertions(+) create mode 100644 qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js create mode 100644 qortal-ui-plugins/plugins/core/become-minter/index.html diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js new file mode 100644 index 00000000..5ebc646c --- /dev/null +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -0,0 +1,355 @@ +import { LitElement, html } from 'lit'; +import { Epml } from '../../../epml.js'; +import '../components/ButtonIconCopy.js'; +import { use, translate, registerTranslateConfig } from 'lit-translate'; + +registerTranslateConfig({ + loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), +}); +import '@polymer/paper-spinner/paper-spinner-lite.js'; + +import '@material/mwc-button'; +import '@material/mwc-textfield'; +import '@vaadin/button'; +import { _blocksNeed } from './utils/blocks-needed.js'; +import { pageStyles } from './become-minter-css.js'; +import './components/not-sponsored'; +const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); + +class BecomeMinter extends LitElement { + static get properties() { + return { + theme: { type: String, reflect: true }, + isLoadingSponsorshipKeySubmit: { type: Boolean }, + sponsorshipKeyValue: { type: String }, + addMintingAccountMessage: { type: String }, + + nodeInfo: { type: Object }, + isPageLoading: { type: Boolean }, + addressInfo: { type: Object }, + rewardSharePublicKey: { type: String }, + }; + } + + static styles = [pageStyles]; + + constructor() { + super(); + this.theme = localStorage.getItem('qortalTheme') + ? localStorage.getItem('qortalTheme') + : 'light'; + this.isLoadingSponsorshipKeySubmit = false; + this.sponsorshipKeyValue = ''; + this.addMintingAccountMessage = ''; + this.isPageLoading = true; + this.nodeInfo = {}; + this.addressInfo = {}; + this.rewardSharePublicKey = ''; + } + + changeLanguage() { + const checkLanguage = localStorage.getItem('qortalLanguage'); + + if (checkLanguage === null || checkLanguage.length === 0) { + localStorage.setItem('qortalLanguage', 'us'); + use('us'); + } else { + use(checkLanguage); + } + } + + _handleStorage() { + const checkLanguage = localStorage.getItem('qortalLanguage'); + const checkTheme = localStorage.getItem('qortalTheme'); + + use(checkLanguage); + + if (checkTheme === 'dark') { + this.theme = 'dark'; + } else { + this.theme = 'light'; + } + document.querySelector('html').setAttribute('theme', this.theme); + } + + connectedCallback() { + super.connectedCallback(); + window.addEventListener('storage', this._handleStorage); + } + + disconnectedCallback() { + window.removeEventListener('storage', this._handleStorage); + super.disconnectedCallback(); + } + + getNodeInfo() { + parentEpml + .request('apiCall', { url: `/admin/status` }) + .then((res) => { + this.nodeInfo = res; + this.isPageLoading = false; + }) + .catch(() => { + this.isPageLoading = false; + }); + } + + async firstUpdated() { + console.log({ change: 6 }); + + this.changeLanguage(); + this.getNodeInfo(); + this.addressInfo = + window.parent.reduxStore.getState().app.accountInfo.addressInfo; + + await this.getRewardShareRelationship( + window.parent.reduxStore.getState().app?.selectedAddress?.address + ); + } + + updateMintingAccounts() { + parentEpml + .request('apiCall', { + url: `/admin/mintingaccounts`, + }) + .then((res) => { + setTimeout(() => (this.mintingAccounts = res), 1); + }); + } + + getApiKey() { + const myNode = + window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ + window.parent.reduxStore.getState().app.nodeConfig.node + ]; + let apiKey = myNode.apiKey; + return apiKey; + } + + renderErr1Text() { + return html`${translate('nodepage.nchange27')}`; + } + + renderErr2Text() { + return html`${translate('nodepage.nchange28')}`; + } + + addMintingAccount(e) { + this.isLoadingSponsorshipKeySubmit = true; + this.addMintingAccountMessage = 'Loading...'; + + parentEpml + .request('apiCall', { + url: `/admin/mintingaccounts?apiKey=${this.getApiKey()}`, + method: 'POST', + body: this.sponsorshipKeyValue, + }) + .then((res) => { + if (res === true) { + this.updateMintingAccounts(); + this.sponsorshipKeyValue = ''; + this.addMintingAccountMessage = this.renderErr1Text(); + this.isLoadingSponsorshipKeySubmit = false; + } else { + this.sponsorshipKeyValue = ''; + this.addMintingAccountMessage = this.renderErr2Text(); + this.isLoadingSponsorshipKeySubmit = false; + } + }); + } + + inputHandler(e) { + this.sponsorshipKeyValue = e.target.value; + } + + async getRewardShareRelationship(recipientAddress) { + let myRewardShareArray = await parentEpml.request('apiCall', { + type: 'api', + url: `/addresses/rewardshares?minters=${recipientAddress}&recipients=${recipientAddress}`, + }); + + this.rewardSharePublicKey = myRewardShareArray[0]?.rewardSharePublicKey; + } + + _levelUpBlocks() { + let countBlocksString = ( + _blocksNeed(0) - + (this.addressInfo?.blocksMinted + + this.addressInfo?.blocksMintedAdjustment) + ).toString(); + return countBlocksString; + } + + render() { + const isAlreadySponsored = + this.addressInfo?.error !== 124 && + this.addressInfo?.level === 0 && + this.rewardSharePublicKey; + + return html` +
+

+ ${translate('becomeMinterPage.bchange1')} +

+
+
+
+ + ${this.isPageLoading ? html`

Loading....

` : ''} + ${isAlreadySponsored + ? '' + : html` + + + `} + ${!isAlreadySponsored + ? '' + : html` +
+
+
+ ${translate( + 'becomeMinterPage.bchange10' + )} +
+
+
+
+
+ ${translate( + 'becomeMinterPage.bchange11' + )} +
+

+ ${translate( + 'becomeMinterPage.bchange12' + )} +

+
+
+ ${translate( + 'becomeMinterPage.bchange13' + )} +
+

+ ${this._levelUpBlocks()} + ${translate( + 'becomeMinterPage.bchange14' + )} +

+
+
+ ${translate( + 'becomeMinterPage.bchange15' + )} +
+

+ ${translate( + 'becomeMinterPage.bchange16' + )} +

+
+

+ ${this.rewardSharePublicKey} +

+ + +
+
+
+
+
+
+ `} +
+ `; + } +} + +window.customElements.define('become-minter', BecomeMinter); diff --git a/qortal-ui-plugins/plugins/core/become-minter/index.html b/qortal-ui-plugins/plugins/core/become-minter/index.html new file mode 100644 index 00000000..3c412170 --- /dev/null +++ b/qortal-ui-plugins/plugins/core/become-minter/index.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + From 3b2b017a8bf489755bc158b50db2e379d3e51791 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 19:27:18 +0300 Subject: [PATCH 05/17] added separate components --- .../core/become-minter/become-minter.src.js | 217 +----------------- 1 file changed, 10 insertions(+), 207 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js index 5ebc646c..c5fa9e04 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -2,6 +2,7 @@ import { LitElement, html } from 'lit'; import { Epml } from '../../../epml.js'; import '../components/ButtonIconCopy.js'; import { use, translate, registerTranslateConfig } from 'lit-translate'; +import { blocksNeed } from './utils/blocks-needed.js'; registerTranslateConfig({ loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), @@ -11,18 +12,16 @@ import '@polymer/paper-spinner/paper-spinner-lite.js'; import '@material/mwc-button'; import '@material/mwc-textfield'; import '@vaadin/button'; -import { _blocksNeed } from './utils/blocks-needed.js'; import { pageStyles } from './become-minter-css.js'; import './components/not-sponsored'; +import './components/yes-sponsored'; const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); class BecomeMinter extends LitElement { static get properties() { return { theme: { type: String, reflect: true }, - isLoadingSponsorshipKeySubmit: { type: Boolean }, sponsorshipKeyValue: { type: String }, - addMintingAccountMessage: { type: String }, nodeInfo: { type: Object }, isPageLoading: { type: Boolean }, @@ -38,9 +37,7 @@ class BecomeMinter extends LitElement { this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'; - this.isLoadingSponsorshipKeySubmit = false; this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = ''; this.isPageLoading = true; this.nodeInfo = {}; this.addressInfo = {}; @@ -95,7 +92,7 @@ class BecomeMinter extends LitElement { } async firstUpdated() { - console.log({ change: 6 }); + console.log({ change: 11 }); this.changeLanguage(); this.getNodeInfo(); @@ -107,61 +104,6 @@ class BecomeMinter extends LitElement { ); } - updateMintingAccounts() { - parentEpml - .request('apiCall', { - url: `/admin/mintingaccounts`, - }) - .then((res) => { - setTimeout(() => (this.mintingAccounts = res), 1); - }); - } - - getApiKey() { - const myNode = - window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ - window.parent.reduxStore.getState().app.nodeConfig.node - ]; - let apiKey = myNode.apiKey; - return apiKey; - } - - renderErr1Text() { - return html`${translate('nodepage.nchange27')}`; - } - - renderErr2Text() { - return html`${translate('nodepage.nchange28')}`; - } - - addMintingAccount(e) { - this.isLoadingSponsorshipKeySubmit = true; - this.addMintingAccountMessage = 'Loading...'; - - parentEpml - .request('apiCall', { - url: `/admin/mintingaccounts?apiKey=${this.getApiKey()}`, - method: 'POST', - body: this.sponsorshipKeyValue, - }) - .then((res) => { - if (res === true) { - this.updateMintingAccounts(); - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = this.renderErr1Text(); - this.isLoadingSponsorshipKeySubmit = false; - } else { - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = this.renderErr2Text(); - this.isLoadingSponsorshipKeySubmit = false; - } - }); - } - - inputHandler(e) { - this.sponsorshipKeyValue = e.target.value; - } - async getRewardShareRelationship(recipientAddress) { let myRewardShareArray = await parentEpml.request('apiCall', { type: 'api', @@ -173,7 +115,7 @@ class BecomeMinter extends LitElement { _levelUpBlocks() { let countBlocksString = ( - _blocksNeed(0) - + blocksNeed(0) - (this.addressInfo?.blocksMinted + this.addressInfo?.blocksMintedAdjustment) ).toString(); @@ -198,154 +140,15 @@ class BecomeMinter extends LitElement { ${this.isPageLoading ? html`

Loading....

` : ''} ${isAlreadySponsored ? '' - : html` - - - `} + : html` `} ${!isAlreadySponsored ? '' : html` -
-
-
- ${translate( - 'becomeMinterPage.bchange10' - )} -
-
-
-
-
- ${translate( - 'becomeMinterPage.bchange11' - )} -
-

- ${translate( - 'becomeMinterPage.bchange12' - )} -

-
-
- ${translate( - 'becomeMinterPage.bchange13' - )} -
-

- ${this._levelUpBlocks()} - ${translate( - 'becomeMinterPage.bchange14' - )} -

-
-
- ${translate( - 'becomeMinterPage.bchange15' - )} -
-

- ${translate( - 'becomeMinterPage.bchange16' - )} -

-
-

- ${this.rewardSharePublicKey} -

- - -
-
-
-
-
-
+ `} `; From 291aded91cb4c6811d2391a2455842e79e2d09fc Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 19:37:25 +0300 Subject: [PATCH 06/17] new separate components --- .../core/become-minter/become-minter.src.js | 4 +- .../components/not-sponsored.src.js | 139 ++++++++++++++++++ .../components/yes-sponsored.src.js | 123 ++++++++++++++++ 3 files changed, 264 insertions(+), 2 deletions(-) create mode 100644 qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js create mode 100644 qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js index c5fa9e04..d14dd6ab 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -13,8 +13,8 @@ import '@material/mwc-button'; import '@material/mwc-textfield'; import '@vaadin/button'; import { pageStyles } from './become-minter-css.js'; -import './components/not-sponsored'; -import './components/yes-sponsored'; +import './components/not-sponsored.src'; +import './components/yes-sponsored.src'; const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); class BecomeMinter extends LitElement { diff --git a/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js b/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js new file mode 100644 index 00000000..572292fc --- /dev/null +++ b/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js @@ -0,0 +1,139 @@ +import { LitElement, html } from 'lit'; +import { Epml } from '../../../../epml.js'; +import '../../components/ButtonIconCopy.js'; +import { use, translate, registerTranslateConfig } from 'lit-translate'; + +registerTranslateConfig({ + loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), +}); +import '@polymer/paper-spinner/paper-spinner-lite.js'; + +import '@material/mwc-button'; +import '@material/mwc-textfield'; +import '@vaadin/button'; +import { pageStyles } from '../become-minter-css.js'; +const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); +// hello +class NotSponsored extends LitElement { + static get properties() { + return { + isLoadingSponsorshipKeySubmit: { type: Boolean }, + sponsorshipKeyValue: { type: String }, + addMintingAccountMessage: { type: String }, + }; + } + + static styles = [pageStyles]; + + constructor() { + super(); + this.isLoadingSponsorshipKeySubmit = false; + this.sponsorshipKeyValue = ''; + this.addMintingAccountMessage = ''; + } + + renderErr1Text() { + return html`${translate('nodepage.nchange27')}`; + } + + renderErr2Text() { + return html`${translate('nodepage.nchange28')}`; + } + + getApiKey() { + const myNode = + window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ + window.parent.reduxStore.getState().app.nodeConfig.node + ]; + let apiKey = myNode.apiKey; + return apiKey; + } + + addMintingAccount(e) { + this.isLoadingSponsorshipKeySubmit = true; + this.addMintingAccountMessage = 'Loading...'; + + parentEpml + .request('apiCall', { + url: `/admin/mintingaccounts?apiKey=${this.getApiKey()}`, + method: 'POST', + body: this.sponsorshipKeyValue, + }) + .then((res) => { + if (res === true) { + this.updateMintingAccounts(); + this.sponsorshipKeyValue = ''; + this.addMintingAccountMessage = this.renderErr1Text(); + this.isLoadingSponsorshipKeySubmit = false; + } else { + this.sponsorshipKeyValue = ''; + this.addMintingAccountMessage = this.renderErr2Text(); + this.isLoadingSponsorshipKeySubmit = false; + } + }); + } + + inputHandler(e) { + this.sponsorshipKeyValue = e.target.value; + } + + render() { + return html` +
+
+

+ ${translate('becomeMinterPage.bchange2')} +

+

+ ${translate('becomeMinterPage.bchange3')} +

+

+ ${translate('becomeMinterPage.bchange4')} +

+

+ ${translate('becomeMinterPage.bchange5')} +

+

+ ${translate('becomeMinterPage.bchange6')} +

+ +

${this.addMintingAccountMessage}

+
+
+ + +
+ +
+ + ${this.isLoadingSponsorshipKeySubmit === false + ? html`${translate( + 'becomeMinterPage.bchange9' + )}` + : html``} + +
+
+
+
+ `; + } +} + +window.customElements.define('not-sponsored', NotSponsored); diff --git a/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js b/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js new file mode 100644 index 00000000..a35a860c --- /dev/null +++ b/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js @@ -0,0 +1,123 @@ +import { LitElement, html } from 'lit'; +import { Epml } from '../../../../epml.js'; +import '../../components/ButtonIconCopy.js'; +import { use, translate, registerTranslateConfig } from 'lit-translate'; + +registerTranslateConfig({ + loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), +}); +import '@polymer/paper-spinner/paper-spinner-lite.js'; + +import '@material/mwc-button'; +import '@material/mwc-textfield'; +import '@vaadin/button'; +import { blocksNeed } from '../utils/blocks-needed.js'; +import { pageStyles } from '../become-minter-css.js'; + +class YesSponsored extends LitElement { + static get properties() { + return { + addressInfo: { type: Object }, + rewardSharePublicKey: { type: String }, + }; + } + + constructor() { + super(); + + this.addressInfo = {}; + this.rewardSharePublicKey = ''; + } + + static styles = [pageStyles]; + + _levelUpBlocks() { + let countBlocksString = ( + blocksNeed(0) - + (this.addressInfo?.blocksMinted + + this.addressInfo?.blocksMintedAdjustment) + ).toString(); + return countBlocksString; + } + + render() { + return html` +
+
+
+ ${translate('becomeMinterPage.bchange10')} +
+
+
+
+
+ ${translate( + 'becomeMinterPage.bchange11' + )} +
+

${translate('becomeMinterPage.bchange12')}

+
+
+ ${translate( + 'becomeMinterPage.bchange13' + )} +
+

+ ${this._levelUpBlocks()} + ${translate('becomeMinterPage.bchange14')} +

+
+
+ ${translate( + 'becomeMinterPage.bchange15' + )} +
+

+ ${translate('becomeMinterPage.bchange16')} +

+
+

+ ${this.rewardSharePublicKey} +

+ + +
+
+
+
+
+
+ `; + } +} + +window.customElements.define('yes-sponsored', YesSponsored); From 5b546e629dd67de42989580966b0aeacb5954108 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 6 Aug 2022 20:21:12 +0300 Subject: [PATCH 07/17] change var name --- qortal-ui-core/src/components/sidenav-menu.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qortal-ui-core/src/components/sidenav-menu.js b/qortal-ui-core/src/components/sidenav-menu.js index e96d3784..4d9e66f4 100644 --- a/qortal-ui-core/src/components/sidenav-menu.js +++ b/qortal-ui-core/src/components/sidenav-menu.js @@ -61,7 +61,6 @@ class SidenavMenu extends connect(store)(LitElement) { } render() { - console.log({ myStore: store.getState() }); return html`
@@ -97,7 +96,7 @@ class SidenavMenu extends connect(store)(LitElement) { renderNodeTypeMenu() { const addressInfo = this.addressInfo; - const isMinting = addressInfo?.error !== 124 && +addressInfo?.level > 0; + const isMinter = addressInfo?.error !== 124 && +addressInfo?.level > 0; if (this.nodeType === 'lite') { return html` @@ -135,7 +134,7 @@ class SidenavMenu extends connect(store)(LitElement) { `; } else { return html` - ${isMinting + ${isMinter ? html` Date: Sat, 6 Aug 2022 21:30:40 +0300 Subject: [PATCH 08/17] add page loader --- .../core/become-minter/become-minter.src.js | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js index d14dd6ab..db2d46de 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -79,38 +79,47 @@ class BecomeMinter extends LitElement { super.disconnectedCallback(); } - getNodeInfo() { - parentEpml - .request('apiCall', { url: `/admin/status` }) - .then((res) => { - this.nodeInfo = res; - this.isPageLoading = false; - }) - .catch(() => { - this.isPageLoading = false; - }); + async getNodeInfo() { + const nodeInfo = await parentEpml.request('apiCall', { + url: `/admin/status`, + }); + + return nodeInfo; } async firstUpdated() { - console.log({ change: 11 }); - this.changeLanguage(); - this.getNodeInfo(); + this.addressInfo = window.parent.reduxStore.getState().app.accountInfo.addressInfo; + this.isPageLoading = true; + try { + const [nodeInfo, myRewardShareArray] = await Promise.all([ + this.getNodeInfo(), + await this.getRewardShareRelationship( + window.parent.reduxStore.getState().app?.selectedAddress + ?.address + ), + ]); - await this.getRewardShareRelationship( - window.parent.reduxStore.getState().app?.selectedAddress?.address - ); + this.nodeInfo = nodeInfo; + this.rewardSharePublicKey = + myRewardShareArray[0]?.rewardSharePublicKey; + this.isPageLoading = false; + } catch (error) { + console.error(error); + + this.isPageLoading = false; + } } async getRewardShareRelationship(recipientAddress) { - let myRewardShareArray = await parentEpml.request('apiCall', { + const myRewardShareArray = await parentEpml.request('apiCall', { type: 'api', url: `/addresses/rewardshares?minters=${recipientAddress}&recipients=${recipientAddress}`, }); - this.rewardSharePublicKey = myRewardShareArray[0]?.rewardSharePublicKey; + return myRewardShareArray; } _levelUpBlocks() { @@ -129,6 +138,15 @@ class BecomeMinter extends LitElement { this.rewardSharePublicKey; return html` + ${this.isPageLoading + ? html` +
+
+
+
+ ` + : ''} +

${translate('becomeMinterPage.bchange1')} @@ -137,7 +155,6 @@ class BecomeMinter extends LitElement {

- ${this.isPageLoading ? html`

Loading....

` : ''} ${isAlreadySponsored ? '' : html` `} From 07c22a9d5f1b7b4dbea31e6d635f0291e4f6f0cc Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sun, 7 Aug 2022 14:20:23 +0300 Subject: [PATCH 09/17] pushed css --- .../become-minter/become-minter-css.src.js | 229 ++++++++++++++++++ .../core/become-minter/become-minter.src.js | 2 +- .../components/not-sponsored.src.js | 2 +- .../components/yes-sponsored.src.js | 2 +- 4 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 qortal-ui-plugins/plugins/core/become-minter/become-minter-css.src.js diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter-css.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter-css.src.js new file mode 100644 index 00000000..4cfb6b90 --- /dev/null +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter-css.src.js @@ -0,0 +1,229 @@ +import { css } from 'lit'; + +export const pageStyles = css` + * { + --mdc-theme-surface: var(--white); + --mdc-dialog-content-ink-color: var(--black); + } + + .header-title { + font-size: 40px; + color: var(--black); + font-weight: 400; + text-align: center; + } + .divider { + color: #eee; + border-radius: 80%; + margin-bottom: 2rem; + } + .fullWidth { + width: 100%; + } + .page-container { + display: flex; + align-items: center; + flex-direction: column; + margin-bottom: 75px; + width: 100%; + } + .inner-container { + display: flex; + align-items: center; + flex-direction: column; + width: 100%; + } + + .description { + color: var(--black); + } + + .message { + color: var(--gray); + } + + .sub-main { + width: 95%; + display: flex; + + flex-direction: column; + max-width: 800px; + } + + .level-black { + font-size: 32px; + color: var(--black); + font-weight: 400; + text-align: center; + margin-top: 2rem; + } + + .form-wrapper { + display: flex; + align-items: center; + width: 100%; + height: 50px; + } + + .row { + display: flex; + width: 100%; + } + .column { + display: flex; + flex-direction: column; + width: 100%; + } + + .column-center { + align-items: center; + } + .no-margin { + margin: 0; + } + .no-wrap { + flex-wrap: nowrap !important; + } + + .row-center { + justify-content: center; + flex-wrap: wrap; + } + .form-item { + display: flex; + height: 100%; + } + + .form-item--button { + flex-grow: 0; + } + + .form-item--input { + flex-grow: 1; + margin-right: 25px; + } + + .center-box { + position: absolute; + width: 100%; + top: 50%; + left: 50%; + transform: translate(-50%, 0%); + text-align: center; + } + + .content-box { + border: 1px solid var(--border); + border-radius: 10px; + padding: 10px 25px; + text-align: center; + display: inline-block; + + margin-bottom: 5px; + flex-basis: 250px; + } + .gap { + gap: 10px; + } + .level-black { + font-size: 32px; + color: var(--black); + font-weight: 400; + text-align: center; + margin-top: 2rem; + text-align: center; + } + .title { + font-weight: 600; + font-size: 20px; + line-height: 28px; + opacity: 0.66; + color: var(--switchborder); + } + + .address { + overflow-wrap: anywhere; + color: var(--black); + } + + h4 { + font-weight: 600; + font-size: 20px; + line-height: 28px; + color: var(--black); + } + mwc-textfield { + width: 100%; + } + vaadin-button { + height: 100%; + margin: 0; + cursor: pointer; + outline: 1px var(--black) solid; + min-width: 80px; + } + .loader, + .loader:after { + border-radius: 50%; + width: 10em; + height: 10em; + } + .loadingContainer { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10; + } + + .backdrop { + height: 100vh; + width: 100vw; + opacity: 0.6; + background-color: var(--border); + z-index: 9; + position: fixed; + } + + .loading, + .loading:after { + border-radius: 50%; + width: 5em; + height: 5em; + } + + .loading { + margin: 10px auto; + border-width: 0.6em; + border-style: solid; + border-color: rgba(3, 169, 244, 0.2) rgba(3, 169, 244, 0.2) + rgba(3, 169, 244, 0.2) rgb(3, 169, 244); + font-size: 10px; + position: relative; + text-indent: -9999em; + transform: translateZ(0px); + animation: 1.1s linear 0s infinite normal none running loadingAnimation; + } + + @-webkit-keyframes loadingAnimation { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + @keyframes loadingAnimation { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } +`; diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js index db2d46de..70dd0a2b 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -12,7 +12,7 @@ import '@polymer/paper-spinner/paper-spinner-lite.js'; import '@material/mwc-button'; import '@material/mwc-textfield'; import '@vaadin/button'; -import { pageStyles } from './become-minter-css.js'; +import { pageStyles } from './become-minter-css.src.js'; import './components/not-sponsored.src'; import './components/yes-sponsored.src'; const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); diff --git a/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js b/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js index 572292fc..65eb0909 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js @@ -11,7 +11,7 @@ import '@polymer/paper-spinner/paper-spinner-lite.js'; import '@material/mwc-button'; import '@material/mwc-textfield'; import '@vaadin/button'; -import { pageStyles } from '../become-minter-css.js'; +import { pageStyles } from '../become-minter-css.src.js'; const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); // hello class NotSponsored extends LitElement { diff --git a/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js b/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js index a35a860c..4f3de528 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/components/yes-sponsored.src.js @@ -12,7 +12,7 @@ import '@material/mwc-button'; import '@material/mwc-textfield'; import '@vaadin/button'; import { blocksNeed } from '../utils/blocks-needed.js'; -import { pageStyles } from '../become-minter-css.js'; +import { pageStyles } from '../become-minter-css.src.js'; class YesSponsored extends LitElement { static get properties() { From 00514b1a3e816096edef0990366845f2cd962665 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:05:12 +0300 Subject: [PATCH 10/17] added english text --- qortal-ui-core/language/us.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qortal-ui-core/language/us.json b/qortal-ui-core/language/us.json index b3eff679..63844de3 100644 --- a/qortal-ui-core/language/us.json +++ b/qortal-ui-core/language/us.json @@ -193,7 +193,9 @@ "bchange14": "blocks", "bchange15": "Sponsorship Relationship", "bchange16": "Sponsor Account", - "bchange17": "Copy Sponsorship Key" + "bchange17": "Copy Sponsorship Key", + "bchange18": "Start Minting", + "bchange19": "Success! You are currently minting." }, "walletpage": { "wchange1": "Fetching balance ...", From 2850c762cc4eb1309027c018d75a87e5b1099a7a Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:10:40 +0300 Subject: [PATCH 11/17] dynamic plugin tab for become a minter --- qortal-ui-core/src/components/sidenav-menu.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qortal-ui-core/src/components/sidenav-menu.js b/qortal-ui-core/src/components/sidenav-menu.js index 4d9e66f4..97bf1f6a 100644 --- a/qortal-ui-core/src/components/sidenav-menu.js +++ b/qortal-ui-core/src/components/sidenav-menu.js @@ -9,7 +9,8 @@ import '@vaadin/icons'; import '../functional-components/side-menu.js'; import '../functional-components/side-menu-item.js'; - +import '../functional-components/my-button.js'; +import './start-minting'; class SidenavMenu extends connect(store)(LitElement) { static get properties() { return { @@ -46,6 +47,13 @@ class SidenavMenu extends connect(store)(LitElement) { border-top: 1px solid var(--border); outline: none; } + + .start-minting-wrapper { + position: absolute; + bottom: 130px; + left: 50%; + transform: translateX(calc(-50% - 10px)); + } `, ]; } @@ -67,6 +75,8 @@ class SidenavMenu extends connect(store)(LitElement) { ${this.renderNodeTypeMenu()} ${this.renderNodeManagement()}
+ + `; } From dcded9af3efb278ea6df5b3729e9ad8ed3d314db Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:10:52 +0300 Subject: [PATCH 12/17] resuable button --- .../src/functional-components/my-button.js | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 qortal-ui-core/src/functional-components/my-button.js diff --git a/qortal-ui-core/src/functional-components/my-button.js b/qortal-ui-core/src/functional-components/my-button.js new file mode 100644 index 00000000..e363fc8f --- /dev/null +++ b/qortal-ui-core/src/functional-components/my-button.js @@ -0,0 +1,48 @@ +import { LitElement, html, css } from 'lit'; +import '@vaadin/button'; +import '@polymer/paper-spinner/paper-spinner-lite.js'; + +export class MyButton extends LitElement { + static properties = { + onClick: { type: Function }, + isLoading: { type: Boolean }, + label: { type: String }, + }; + + static styles = css` + vaadin-button { + height: 100%; + margin: 0; + cursor: pointer; + + min-width: 80px; + background-color: #03a9f4; + color: white; + } + + vaadin-button:hover { + opacity: 0.8; + } + `; + + constructor() { + super(); + this.onClick = () => {}; + this.isLoading = false; + this.label = ''; + } + + render() { + return html` + + ${this.isLoading === false + ? html`${this.label}` + : html``} + + `; + } +} +customElements.define('my-button', MyButton); From c4a65987c171c69b4cfb00eab47fb1abaa7cb356 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:11:56 +0300 Subject: [PATCH 13/17] start minting component --- .../src/components/start-minting.js | 260 ++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 qortal-ui-core/src/components/start-minting.js diff --git a/qortal-ui-core/src/components/start-minting.js b/qortal-ui-core/src/components/start-minting.js new file mode 100644 index 00000000..520e7838 --- /dev/null +++ b/qortal-ui-core/src/components/start-minting.js @@ -0,0 +1,260 @@ +import { LitElement, html, css } from 'lit'; +import { connect } from 'pwa-helpers'; +import { store } from '../store.js'; +import { translate, get } from 'lit-translate'; + +import '../functional-components/my-button.js'; +import { routes } from '../plugins/routes.js'; + +class StartMinting extends connect(store)(LitElement) { + static get properties() { + return { + addressInfo: { type: Object }, + mintingAccountData: { type: Array }, + errorMsg: { type: String }, + }; + } + + static get styles() { + return [ + css` + .start-minting-wrapper { + position: absolute; + bottom: 130px; + left: 50%; + transform: translateX(calc(-50% - 10px)); + } + `, + ]; + } + + constructor() { + super(); + + this.addressInfo = {}; + this.mintingAccountData = []; + this.errorMsg = ''; + } + + render() { + return html` ${this.renderStartMintingButton()} `; + } + + firstUpdated() { + this.getMintingAcccounts(); + } + + async getMintingAcccounts() { + const myNode = + store.getState().app.nodeConfig.knownNodes[ + store.getState().app.nodeConfig.node + ]; + const nodeUrl = + myNode.protocol + '://' + myNode.domain + ':' + myNode.port; + const url = `${nodeUrl}/admin/mintingaccounts`; + try { + const res = await fetch(url); + const mintingAccountData = await res.json(); + + this.mintingAccountData = mintingAccountData; + } catch (error) { + this.errorMsg = 'Cannot fetch minting accounts'; + } + } + + renderStartMintingButton() { + const myNode = + store.getState().app.nodeConfig.knownNodes[ + store.getState().app.nodeConfig.node + ]; + const nodeUrl = + myNode.protocol + '://' + myNode.domain + ':' + myNode.port; + const mintingAccountData = this.mintingAccountData; + + const addressInfo = this.addressInfo; + const rewardShares = async (minterAddr) => { + const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`; + const res = await fetch(url); + const data = await res.json(); + return data; + }; + const address = + window.parent.reduxStore.getState().app?.selectedAddress?.address; + const nonce = + window.parent.reduxStore.getState().app?.selectedAddress?.nonce; + const publicAddress = + window.parent.reduxStore.getState().app?.selectedAddress + ?.base58PublicKey; + + const findMintingAccount = mintingAccountData.find((ma) => + ma.publicKey.includes(publicAddress) + ); + const isMinterButKeyMintingKeyNotAssigned = + addressInfo?.error !== 124 && + addressInfo?.level === 1 && + !findMintingAccount; + + const removeMintingAccount = async (publicKey) => { + const url = `${nodeUrl}/admin/mintingaccounts?apiKey=${myNode.apiKey}`; + + return await fetch(url, { + method: 'DELETE', + body: publicKey, + }); + }; + + const makeTransactionRequest = async (lastRef) => { + let mylastRef = lastRef; + let rewarddialog1 = get('transactions.rewarddialog1'); + let rewarddialog2 = get('transactions.rewarddialog2'); + let rewarddialog3 = get('transactions.rewarddialog3'); + let rewarddialog4 = get('transactions.rewarddialog4'); + + let myTxnrequest = await routes.transaction({ + data: { + type: 38, + nonce: nonce, + params: { + recipientPublicKey: publicAddress, + percentageShare: 0, + lastReference: mylastRef, + rewarddialog1: rewarddialog1, + rewarddialog2: rewarddialog2, + rewarddialog3: rewarddialog3, + rewarddialog4: rewarddialog4, + }, + }, + }); + return myTxnrequest; + }; + + const getTxnRequestResponse = (txnResponse) => { + if (txnResponse.success === false && txnResponse.message) { + throw new Error(txnResponse); + } else if ( + txnResponse.success === true && + !txnResponse.data.error + ) { + let err6string = get('rewardsharepage.rchange21'); + return err6string; + } else { + throw new Error(txnResponse); + } + }; + + const createSponsorshipKey = async () => { + let lastRef = await getLastRef(); + + let myTransaction = await makeTransactionRequest(lastRef); + + getTxnRequestResponse(myTransaction); + return myTransaction.data; + }; + const addMintingAccount = async (sponsorshipKeyValue) => { + const url = `${nodeUrl}/admin/mintingaccounts?apiKey=${myNode.apiKey}`; + + return await fetch(url, { + method: 'POST', + body: sponsorshipKeyValue, + }); + }; + + const getLastRef = async () => { + const url = `${nodeUrl}/addresses/lastreference/${address}`; + + const res = await fetch(url); + + const data = await res.text(); + + return data; + }; + const startMinting = async () => { + this.errorMsg = ''; + let rewardSharesList; + try { + rewardSharesList = await rewardShares(address); + } catch (error) { + this.errorMsg = 'Cannot fetch reward shares'; + return; + } + // check to see if self-share exists + + const findRewardShareData = rewardSharesList.find( + (rs) => + rs?.mintingAccount === address && rs?.recipient === address + ); + let sponsorshipKeyValue = null; + try { + if (!findRewardShareData) { + // if no self-share exits, create one. + sponsorshipKeyValue = await createSponsorshipKey(); + } else { + sponsorshipKeyValue = + findRewardShareData.rewardSharePublicKey; + } + } catch (error) { + this.errorMsg = 'Cannot create sponsorship key'; + return; + } + + // Check to see if a sponsorship key on a newly-level 1 minter exists. If it does, remove it. + const findMintingAccountFromOtherUser = mintingAccountData.find( + (ma) => !ma.publicKey.includes(publicAddress) + ); + + try { + if ( + findMintingAccountFromOtherUser && + findMintingAccountFromOtherUser?.publicKey[0] + ) { + await removeMintingAccount( + findMintingAccountFromOtherUser?.publicKey[0] + ); + } + } catch (error) { + this.errorMsg = 'Failed to remove key'; + return; + } + + try { + await addMintingAccount(sponsorshipKeyValue); + routes.showSnackBar({ + data: translate('becomeMinterPage.bchange19'), + }); + this.getMintingAcccounts(); + } catch (error) { + this.errorMsg = 'Failed to add minting key'; + return; + } + }; + + return html` + ${isMinterButKeyMintingKeyNotAssigned + ? html` +
+ { + await startMinting(); + if (this.errorMsg) { + routes.showSnackBar({ + data: this.errorMsg, + }); + } + }} + > +
+ ` + : ''} + `; + } + + stateChanged(state) { + this.addressInfo = state.app.accountInfo.addressInfo; + } +} + +window.customElements.define('start-minting', StartMinting); From 67cec578df3d35cb2ea7b5c98542143ab8b603d0 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:12:58 +0300 Subject: [PATCH 14/17] fix logic- is user sponsored --- .../core/become-minter/become-minter.src.js | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js index 70dd0a2b..06f2c767 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -27,6 +27,7 @@ class BecomeMinter extends LitElement { isPageLoading: { type: Boolean }, addressInfo: { type: Object }, rewardSharePublicKey: { type: String }, + mintingAccountData: { type: Array }, }; } @@ -42,6 +43,7 @@ class BecomeMinter extends LitElement { this.nodeInfo = {}; this.addressInfo = {}; this.rewardSharePublicKey = ''; + this.mintingAccountData = null; } changeLanguage() { @@ -87,6 +89,13 @@ class BecomeMinter extends LitElement { return nodeInfo; } + async getMintingAcccounts() { + const mintingAccountData = await parentEpml.request('apiCall', { + url: `/admin/mintingaccounts`, + }); + return mintingAccountData; + } + async firstUpdated() { this.changeLanguage(); @@ -94,18 +103,21 @@ class BecomeMinter extends LitElement { window.parent.reduxStore.getState().app.accountInfo.addressInfo; this.isPageLoading = true; try { - const [nodeInfo, myRewardShareArray] = await Promise.all([ - this.getNodeInfo(), - await this.getRewardShareRelationship( - window.parent.reduxStore.getState().app?.selectedAddress - ?.address - ), - ]); + const [nodeInfo, myRewardShareArray, mintingaccounts] = + await Promise.all([ + this.getNodeInfo(), + this.getRewardShareRelationship( + window.parent.reduxStore.getState().app?.selectedAddress + ?.address + ), + this.getMintingAcccounts(), + ]); this.nodeInfo = nodeInfo; this.rewardSharePublicKey = myRewardShareArray[0]?.rewardSharePublicKey; this.isPageLoading = false; + this.mintingAccountData = mintingaccounts; } catch (error) { console.error(error); @@ -116,7 +128,7 @@ class BecomeMinter extends LitElement { async getRewardShareRelationship(recipientAddress) { const myRewardShareArray = await parentEpml.request('apiCall', { type: 'api', - url: `/addresses/rewardshares?minters=${recipientAddress}&recipients=${recipientAddress}`, + url: `/addresses/rewardshares?recipients=${recipientAddress}`, }); return myRewardShareArray; @@ -132,10 +144,15 @@ class BecomeMinter extends LitElement { } render() { + console.log({ mintingAccountData: this.mintingAccountData }); + const findMintingAccount = this.mintingAccountData?.find( + (ma) => !!ma.publicKey + ); + const isAlreadySponsored = this.addressInfo?.error !== 124 && this.addressInfo?.level === 0 && - this.rewardSharePublicKey; + findMintingAccount; return html` ${this.isPageLoading From a784594b23a37f20a94fcfb990aea81d8181264e Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:26:37 +0300 Subject: [PATCH 15/17] added condition to transaction route - modal open --- qortal-ui-core/src/plugins/routes.js | 380 +++++++++++++++------------ 1 file changed, 215 insertions(+), 165 deletions(-) diff --git a/qortal-ui-core/src/plugins/routes.js b/qortal-ui-core/src/plugins/routes.js index 2567d201..215e653d 100644 --- a/qortal-ui-core/src/plugins/routes.js +++ b/qortal-ui-core/src/plugins/routes.js @@ -1,83 +1,95 @@ -import { store } from '../store.js' -import { doAddPluginUrl, doUpdateBlockInfo, doUpdateNodeStatus, doUpdateNodeInfo, doSetNode, doPageUrl, doSetChatHeads, doUpdateAccountInfo } from '../redux/app/app-actions.js' -import * as api from 'qortal-ui-crypto' -import { requestTransactionDialog } from '../functional-components/confirm-transaction-dialog.js' -import { doNewMessage } from '../notifications/controller.js' -import snackbar from '../functional-components/snackbar.js' -import { loadStateFromLocalStorage, saveStateToLocalStorage } from '../localStorageHelpers.js' -import copyTextMenu from '../functional-components/copy-text-menu.js' -import framePasteMenu from '../functional-components/frame-paste-menu.js' +import { store } from '../store.js'; +import { + doAddPluginUrl, + doUpdateBlockInfo, + doUpdateNodeStatus, + doUpdateNodeInfo, + doSetNode, + doPageUrl, + doSetChatHeads, + doUpdateAccountInfo, +} from '../redux/app/app-actions.js'; +import * as api from 'qortal-ui-crypto'; +import { requestTransactionDialog } from '../functional-components/confirm-transaction-dialog.js'; +import { doNewMessage } from '../notifications/controller.js'; +import snackbar from '../functional-components/snackbar.js'; +import { + loadStateFromLocalStorage, + saveStateToLocalStorage, +} from '../localStorageHelpers.js'; +import copyTextMenu from '../functional-components/copy-text-menu.js'; +import framePasteMenu from '../functional-components/frame-paste-menu.js'; -const createTransaction = api.createTransaction -const processTransaction = api.processTransaction -const signChatTransaction = api.signChatTransaction -const signArbitraryTransaction = api.signArbitraryTransaction -const tradeBotCreateRequest = api.tradeBotCreateRequest -const tradeBotRespondRequest = api.tradeBotRespondRequest -const signTradeBotTxn = api.signTradeBotTxn -const deleteTradeOffer = api.deleteTradeOffer -const cancelAllOffers = api.cancelAllOffers -const sendBtc = api.sendBtc -const sendLtc = api.sendLtc -const sendDoge = api.sendDoge -const sendDgb = api.sendDgb -const sendRvn = api.sendRvn +const createTransaction = api.createTransaction; +const processTransaction = api.processTransaction; +const signChatTransaction = api.signChatTransaction; +const signArbitraryTransaction = api.signArbitraryTransaction; +const tradeBotCreateRequest = api.tradeBotCreateRequest; +const tradeBotRespondRequest = api.tradeBotRespondRequest; +const signTradeBotTxn = api.signTradeBotTxn; +const deleteTradeOffer = api.deleteTradeOffer; +const cancelAllOffers = api.cancelAllOffers; +const sendBtc = api.sendBtc; +const sendLtc = api.sendLtc; +const sendDoge = api.sendDoge; +const sendDgb = api.sendDgb; +const sendRvn = api.sendRvn; export const routes = { hello: async (req) => { - return 'Hello from awesomeness' + return 'Hello from awesomeness'; }, registerUrl: async (req) => { - store.dispatch(doAddPluginUrl(req.data)) + store.dispatch(doAddPluginUrl(req.data)); }, setAccountInfo: async (req) => { - store.dispatch(doUpdateAccountInfo(req.data)) + store.dispatch(doUpdateAccountInfo(req.data)); }, getAccountInfo: async (req) => { - return store.getState().app.accountInfo + return store.getState().app.accountInfo; }, setChatHeads: async (req) => { - return store.dispatch(doSetChatHeads(req.data)) + return store.dispatch(doSetChatHeads(req.data)); }, getChatHeads: async (req) => { - return store.getState().app.chatHeads + return store.getState().app.chatHeads; }, updateBlockInfo: async (req) => { - store.dispatch(doUpdateBlockInfo(req.data)) + store.dispatch(doUpdateBlockInfo(req.data)); }, updateNodeStatus: async (req) => { - store.dispatch(doUpdateNodeStatus(req.data)) + store.dispatch(doUpdateNodeStatus(req.data)); }, updateNodeInfo: async (req) => { - store.dispatch(doUpdateNodeInfo(req.data)) + store.dispatch(doUpdateNodeInfo(req.data)); }, setNode: async (req) => { - store.dispatch(doSetNode(req.data)) + store.dispatch(doSetNode(req.data)); }, getNodeConfig: async (req) => { - return store.getState().app.nodeConfig + return store.getState().app.nodeConfig; }, setPageUrl: async (req) => { - return store.dispatch(doPageUrl(req.data)) + return store.dispatch(doPageUrl(req.data)); }, getLocalStorage: async (req) => { - return loadStateFromLocalStorage(req.data) + return loadStateFromLocalStorage(req.data); }, setLocalStorage: async (req) => { - return saveStateToLocalStorage(req.data.key, req.data.dataObj) + return saveStateToLocalStorage(req.data.key, req.data.dataObj); }, openCopyTextMenu: async (req) => { @@ -85,26 +97,26 @@ export const routes = { selectedText: req.data.selectedText, eventObject: req.data.eventObject, isFrame: req.data.isFrame, - } - copyTextMenu.open(textMenuObject) + }; + copyTextMenu.open(textMenuObject); }, closeCopyTextMenu: async (req) => { - copyTextMenu.close() + copyTextMenu.close(); }, openFramePasteMenu: async (req) => { - framePasteMenu.open(req.data) + framePasteMenu.open(req.data); }, closeFramePasteMenu: async (req) => { - framePasteMenu.close() + framePasteMenu.close(); }, apiCall: async (req) => { - const url = req.data.url - delete req.data.url - return api.request(url, req.data) + const url = req.data.url; + delete req.data.url; + return api.request(url, req.data); }, addresses: async (req) => { @@ -115,250 +127,288 @@ export const routes = { nonce: address.nonce, textColor: address.textColor, base58PublicKey: address.base58PublicKey, - } - }) + }; + }); }, transaction: async (req) => { - let response + let response; try { - const tx = createTransaction(req.data.type, store.getState().app.wallet._addresses[req.data.nonce].keyPair, req.data.params) - await requestTransactionDialog.requestTransaction(tx) - const res = await processTransaction(tx.signedBytes) + const tx = createTransaction( + req.data.type, + store.getState().app.wallet._addresses[req.data.nonce].keyPair, + req.data.params + ); + + if (!req.disableModal) { + await requestTransactionDialog.requestTransaction(tx); + } + + const res = await processTransaction(tx.signedBytes); + response = { success: true, data: res, - } + }; } catch (e) { - console.error(e) - console.error(e.message) + console.error(e); + console.error(e.message); response = { success: false, message: e.message, - } + }; } - return response + return response; }, standaloneTransaction: async (req) => { const rebuildUint8Array = (obj) => { - let _array = new Uint8Array(Object.keys(obj).length) + let _array = new Uint8Array(Object.keys(obj).length); for (let i = 0; i < _array.byteLength; ++i) { - _array.set([obj[i]], i) + _array.set([obj[i]], i); } - return _array - } + return _array; + }; - let response + let response; try { // req.data.keyPair unfortunately "prepared" into horrible object so we need to convert back let _keyPair = {}; for (let _keyName in req.data.keyPair) { - _keyPair[_keyName] = rebuildUint8Array(req.data.keyPair[_keyName]) + _keyPair[_keyName] = rebuildUint8Array( + req.data.keyPair[_keyName] + ); } - const tx = createTransaction(req.data.type, _keyPair, req.data.params) - const res = await processTransaction(tx.signedBytes) + const tx = createTransaction( + req.data.type, + _keyPair, + req.data.params + ); + const res = await processTransaction(tx.signedBytes); response = { success: true, data: res, - } + }; } catch (e) { - console.error(e) - console.error(e.message) + console.error(e); + console.error(e.message); response = { success: false, message: e.message, - } + }; } - return response + return response; }, username: async (req) => { - const state = store.getState() - const username = state.user.storedWallets[state.app.wallet.addresses[0].address].name + const state = store.getState(); + const username = + state.user.storedWallets[state.app.wallet.addresses[0].address] + .name; - return username + return username; }, chat: async (req) => { - let response + let response; try { - const tx = createTransaction(req.data.type, store.getState().app.wallet._addresses[req.data.nonce].keyPair, req.data.params) + const tx = createTransaction( + req.data.type, + store.getState().app.wallet._addresses[req.data.nonce].keyPair, + req.data.params + ); - response = tx.chatBytes + response = tx.chatBytes; } catch (e) { - console.error(e) - console.error(e.message) - response = false + console.error(e); + console.error(e.message); + response = false; } - return response + return response; }, sign_chat: async (req) => { - let response + let response; try { - const signedChatBytes = await signChatTransaction(req.data.chatBytesArray, req.data.chatNonce, store.getState().app.wallet._addresses[req.data.nonce].keyPair) + const signedChatBytes = await signChatTransaction( + req.data.chatBytesArray, + req.data.chatNonce, + store.getState().app.wallet._addresses[req.data.nonce].keyPair + ); - const res = await processTransaction(signedChatBytes) - response = res + const res = await processTransaction(signedChatBytes); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = false + console.error(e); + console.error(e.message); + response = false; } - return response + return response; }, sign_arbitrary: async (req) => { - let response + let response; try { - const signedArbitraryBytes = await signArbitraryTransaction(req.data.arbitraryBytesBase58, req.data.arbitraryBytesForSigningBase58, req.data.arbitraryNonce, store.getState().app.wallet._addresses[req.data.nonce].keyPair) + const signedArbitraryBytes = await signArbitraryTransaction( + req.data.arbitraryBytesBase58, + req.data.arbitraryBytesForSigningBase58, + req.data.arbitraryNonce, + store.getState().app.wallet._addresses[req.data.nonce].keyPair + ); - const res = await processTransaction(signedArbitraryBytes) - response = res + const res = await processTransaction(signedArbitraryBytes); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = false + console.error(e); + console.error(e.message); + response = false; } - return response + return response; }, showNotification: async (req) => { - doNewMessage(req.data) + doNewMessage(req.data); }, showSnackBar: async (req) => { snackbar.add({ labelText: req.data, dismiss: true, - }) + }); }, tradeBotCreateRequest: async (req) => { - let response + let response; try { - const unsignedTxn = await tradeBotCreateRequest(req.data) + const unsignedTxn = await tradeBotCreateRequest(req.data); - const signedTxnBytes = await signTradeBotTxn(unsignedTxn, store.getState().app.selectedAddress.keyPair) + const signedTxnBytes = await signTradeBotTxn( + unsignedTxn, + store.getState().app.selectedAddress.keyPair + ); - const res = await processTransaction(signedTxnBytes) - response = res + const res = await processTransaction(signedTxnBytes); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, tradeBotRespondRequest: async (req) => { - let response + let response; try { - const res = await tradeBotRespondRequest(req.data) + const res = await tradeBotRespondRequest(req.data); - response = res + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, deleteTradeOffer: async (req) => { - let response + let response; try { - const unsignedTxn = await deleteTradeOffer(req.data) + const unsignedTxn = await deleteTradeOffer(req.data); - const signedTxnBytes = await signTradeBotTxn(unsignedTxn, store.getState().app.selectedAddress.keyPair) + const signedTxnBytes = await signTradeBotTxn( + unsignedTxn, + store.getState().app.selectedAddress.keyPair + ); - const res = await processTransaction(signedTxnBytes) + const res = await processTransaction(signedTxnBytes); - response = res + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, cancelAllOffers: async (req) => { - let response + let response; try { - const res = await cancelAllOffers(store.getState().app.selectedAddress) - response = res + const res = await cancelAllOffers( + store.getState().app.selectedAddress + ); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, sendBtc: async (req) => { - let response + let response; try { - const res = await sendBtc(req.data) - response = res + const res = await sendBtc(req.data); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, sendLtc: async (req) => { - let response + let response; try { - const res = await sendLtc(req.data) - response = res + const res = await sendLtc(req.data); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, sendDoge: async (req) => { - let response + let response; try { - const res = await sendDoge(req.data) - response = res + const res = await sendDoge(req.data); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, sendDgb: async (req) => { - let response + let response; try { - const res = await sendDgb(req.data) - response = res + const res = await sendDgb(req.data); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, sendRvn: async (req) => { - let response + let response; try { - const res = await sendRvn(req.data) - response = res + const res = await sendRvn(req.data); + response = res; } catch (e) { - console.error(e) - console.error(e.message) - response = e.message + console.error(e); + console.error(e.message); + response = e.message; } - return response + return response; }, -} +}; From 16d19b0e516d932b2611cd0460717beedf116630 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:52:37 +0300 Subject: [PATCH 16/17] added refetch data when a user adds sponsor key --- .../core/become-minter/become-minter.src.js | 12 ++++++++++-- .../components/not-sponsored.src.js | 17 +++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js index 06f2c767..db4b02d5 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js @@ -96,7 +96,7 @@ class BecomeMinter extends LitElement { return mintingAccountData; } - async firstUpdated() { + async atMount() { this.changeLanguage(); this.addressInfo = @@ -125,6 +125,10 @@ class BecomeMinter extends LitElement { } } + async firstUpdated() { + await this.atMount(); + } + async getRewardShareRelationship(recipientAddress) { const myRewardShareArray = await parentEpml.request('apiCall', { type: 'api', @@ -174,7 +178,11 @@ class BecomeMinter extends LitElement { ${isAlreadySponsored ? '' - : html` `} + : html` + + `} ${!isAlreadySponsored ? '' : html` diff --git a/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js b/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js index 65eb0909..c910415b 100644 --- a/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js +++ b/qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js @@ -15,13 +15,12 @@ import { pageStyles } from '../become-minter-css.src.js'; const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); // hello class NotSponsored extends LitElement { - static get properties() { - return { - isLoadingSponsorshipKeySubmit: { type: Boolean }, - sponsorshipKeyValue: { type: String }, - addMintingAccountMessage: { type: String }, - }; - } + static properties = { + atMount: { type: Function }, + isLoadingSponsorshipKeySubmit: { type: Boolean }, + sponsorshipKeyValue: { type: String }, + addMintingAccountMessage: { type: String }, + }; static styles = [pageStyles]; @@ -30,6 +29,7 @@ class NotSponsored extends LitElement { this.isLoadingSponsorshipKeySubmit = false; this.sponsorshipKeyValue = ''; this.addMintingAccountMessage = ''; + this.atMount = () => {}; } renderErr1Text() { @@ -61,7 +61,8 @@ class NotSponsored extends LitElement { }) .then((res) => { if (res === true) { - this.updateMintingAccounts(); + // refetch data + this.atMount(); this.sponsorshipKeyValue = ''; this.addMintingAccountMessage = this.renderErr1Text(); this.isLoadingSponsorshipKeySubmit = false; From 6400a1f0ca9a6b47d93ac37d772a2d3683502266 Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Tue, 9 Aug 2022 23:53:15 +0300 Subject: [PATCH 17/17] add disablemodal var to transaction func --- qortal-ui-core/src/components/start-minting.js | 1 + 1 file changed, 1 insertion(+) diff --git a/qortal-ui-core/src/components/start-minting.js b/qortal-ui-core/src/components/start-minting.js index 520e7838..c1179c0f 100644 --- a/qortal-ui-core/src/components/start-minting.js +++ b/qortal-ui-core/src/components/start-minting.js @@ -124,6 +124,7 @@ class StartMinting extends connect(store)(LitElement) { rewarddialog4: rewarddialog4, }, }, + disableModal: true, }); return myTxnrequest; };