Skip to content

Instantly share code, notes, and snippets.

@Stoner19
Forked from anonymoussprocket/README.md
Created October 5, 2019 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stoner19/0c679686b74d7bc4d064b9583910b200 to your computer and use it in GitHub Desktop.
Save Stoner19/0c679686b74d7bc4d064b9583910b200 to your computer and use it in GitHub Desktop.

Tezori/Galleon wallet file reader

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://cdn.jsdelivr.net/gh/cryptonomic/conseiljs/dist-web/conseiljs.min.js" crossorigin="anonymous" type="text/javascript"></script>
<script>
const processFile = () => {
var reader = new FileReader();
reader.onload = async () => {
var content = reader.result;
const w = await conseiljs.TezosFileWallet.loadWalletString(content, document.forms[0]['inputpassword'].value);
document.getElementById('outputkeyhash').innerText = w.identities[0].publicKeyHash;
document.getElementById('outputsecretkey').innerText = w.identities[0].privateKey;
};
reader.readAsText(document.forms[0]['inputfile'].files[0]);
};
</script>
</head>
<body>
<h1>Tezori/Galleon wallet file reader</h1>
<h2>Use at your own risk</h2>
<form>
<label for="inputfile">Wallet File</label>
<input name="inputfile" id="inputfile" type='file'><br>
<label for="inputpassword">Password</label>
<input name="inputpassword" id="inputpassword" type="password" /><br />
<button onclick="processFile(); return false;">Process</button>
<form>
<div>
<label for="outputkeyhash">Account Address</label>
<div id="outputkeyhash"> </div>
<label for="outputkeyhash">Secret Key</label>
<div id="outputsecretkey"> </div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment