aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/assets/samplecoin/samplecoin.html
diff options
context:
space:
mode:
Diffstat (limited to 'ethereal/assets/samplecoin/samplecoin.html')
-rw-r--r--ethereal/assets/samplecoin/samplecoin.html22
1 files changed, 12 insertions, 10 deletions
diff --git a/ethereal/assets/samplecoin/samplecoin.html b/ethereal/assets/samplecoin/samplecoin.html
index 02e2bd6ea..c1ee941a2 100644
--- a/ethereal/assets/samplecoin/samplecoin.html
+++ b/ethereal/assets/samplecoin/samplecoin.html
@@ -5,9 +5,11 @@
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-theme.min.css">
<link rel="stylesheet" href="samplecoin.css">
+<script src="promise.min.js"></script>
<meta name="viewport" content="minimum-scale=1; maximum-scale=1; initial-scale=1;">
<script type="text/javascript">
+
var jefcoinAddr = "3dff537f51350239abc95c76a5864aa605259e7d"
var mAddr = ""
@@ -17,24 +19,24 @@ function createTransaction() {
var data = (("0x"+addr).pad(32) + amount.pad(32)).unbin()
eth.transact(mAddr, jefcoinAddr, 0, "10000000", "250", data, function(receipt) {
- debug("received tx hash:", receipt)
+ debug("received tx hash:", reciept.address)
})
}
function init() {
- eth.set({width: 500})
-
- eth.getKey(function(keyPair) {
- mAddr = keyPair.privateKey;
+ eth.set({width: 500});
- eth.getStorageAt(jefcoinAddr, keyPair.address, function(storage) {
- document.querySelector("#current-amount").innerHTML = storage;
- });
+ eth.getKey(function(sec) {
+ eth.getSecretToAddress(sec, function(addr) {
+ mAddr = addr;
- eth.watch(jefcoinAddr, function(stateObject) {
- eth.getStorageAt(jefcoinAddr, keyPair.address, function(storage) {
+ eth.getStorageAt(jefcoinAddr, addr, function(storage) {
document.querySelector("#current-amount").innerHTML = storage;
});
+
+ eth.watch(jefcoinAddr, addr, function(addr, value) {
+ document.querySelector("#current-amount").innerHTML = value
+ });
});
});
}