Created
May 13, 2020 07:29
-
-
Save nicola-attico/dedc77c5641a9277fef5f7901937b5d6 to your computer and use it in GitHub Desktop.
CreateWallet UI Action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = new ECCCommandV2(); | |
var commandReturn = foo.runCommand("geth2", 'node /home/nicola/nowwallet/generateWallet.js'); | |
var xmlPayload = commandReturn.response_payload_xml; | |
var xmlDoc = new XMLDocument2(); | |
xmlDoc.parseXML(xmlPayload); | |
var myResponse = xmlDoc.getFirstNode('/results/result/stdout').getTextContent().toString(); | |
var json = new JSON(); | |
var myJSON = json.decode(myResponse); | |
var gr = new GlideRecord('u_wallet'); | |
gr.initialize(); | |
gr.u_name = current.name + "'s wallet"; | |
gr.u_address = myJSON.address; | |
gr.u_keystore = myJSON.keystoreFilename; | |
gr.u_company = current.sys_id; | |
gr.u_publickey = myJSON.publicKey; | |
action.setRedirectURL(current); | |
gr.insert(); | |
gs.addInfoMessage("Wallet created"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment