Skip to content

Instantly share code, notes, and snippets.

@nicola-attico
Created May 13, 2020 07:29
Show Gist options
  • Save nicola-attico/dedc77c5641a9277fef5f7901937b5d6 to your computer and use it in GitHub Desktop.
Save nicola-attico/dedc77c5641a9277fef5f7901937b5d6 to your computer and use it in GitHub Desktop.
CreateWallet UI Action
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