shop to accept private key
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user