shop to accept private key

This commit is contained in:
kepler155c@gmail.com
2019-03-03 14:05:18 -05:00
parent 29bcb1bcc6
commit fcb6914276
4 changed files with 11 additions and 6 deletions

View File

@@ -3,8 +3,8 @@
local Sound = require('sound')
local Util = require('util')
local modules = _G.peripheral.wrap('back')
local os = _G.os
local modules = _G.peripheral.wrap('back')
local os = _G.os
local parallel = _G.parallel
if not modules.launch or not modules.getMetaOwner then

View File

@@ -33,7 +33,12 @@ local wizardPage = UI.WizardPage {
shadowText = "xxxx's shop",
required = false,
},
[4] = UI.Chooser {
[4] = UI.Checkbox {
formLabel = 'Is private key', formKey = 'isPrivateKey',
help = 'Password is in private key format',
limit = 64,
},
[5] = UI.Chooser {
width = 9,
formLabel = 'Font Size', formKey = 'textScale',
nochoice = 'Small',

View File

@@ -18,7 +18,7 @@ local function startShop(node)
if shopTab then
multishell.terminate(shopTab)
end
shopTab = shell.openTab('/packages/swshop/swshop.lua', node.domain, node.password)
shopTab = shell.openTab('/packages/swshop/swshop.lua', node.domain, node.password, node.isPrivateKey and 'true')
end
-- node has been reconfigured

View File

@@ -24,13 +24,13 @@ w.init(jua)
k.init(jua, json, w, r)
local function Syntax()
error('Syntax: swshop [domain] [password]')
error('Syntax: swshop [domain] [password | privateKey] [isPrivateKey]')
end
local args = { ... }
local domain = args[1] or Syntax()
local password = args[2] or Syntax()
local privatekey = k.toKristWalletFormat(password)
local privatekey = args[3] and args[2] or k.toKristWalletFormat(password)
local address = k.makev2address(privatekey)
local transactions = Util.readTable('/usr/swshop.log') or { }