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.html72
1 files changed, 72 insertions, 0 deletions
diff --git a/ethereal/assets/samplecoin/samplecoin.html b/ethereal/assets/samplecoin/samplecoin.html
new file mode 100644
index 000000000..c1ee941a2
--- /dev/null
+++ b/ethereal/assets/samplecoin/samplecoin.html
@@ -0,0 +1,72 @@
+<html>
+<head>
+<title>jeffcoin</title>
+
+<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 = ""
+
+function createTransaction() {
+ var addr = document.querySelector("#addr").value;
+ var amount = document.querySelector("#amount").value;
+
+ var data = (("0x"+addr).pad(32) + amount.pad(32)).unbin()
+ eth.transact(mAddr, jefcoinAddr, 0, "10000000", "250", data, function(receipt) {
+ debug("received tx hash:", reciept.address)
+ })
+}
+
+function init() {
+ eth.set({width: 500});
+
+ eth.getKey(function(sec) {
+ eth.getSecretToAddress(sec, function(addr) {
+ mAddr = addr;
+
+ 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
+ });
+ });
+ });
+}
+
+</script>
+</head>
+
+<body onload="init();">
+<div class="container">
+ <div class="header">
+ <h3 class="text-muted">JeffCoin</h3>
+ </div>
+
+ <div class="jumbotron ">
+ <img src="icon.png">
+ <div>Amount: <strong id="current-amount"></strong></div>
+
+ <div id="transactions">
+ <div class="form-group">
+ <input id="addr" class="form-control" type="text" placeholder="Receiver address"></input><br>
+ <input id="amount" class="form-control" type="text" placeholder="Amount"></input><br>
+ </div>
+
+ <button class="btn btn-default" onclick="createTransaction();">Send Tx</button>
+ </div>
+ </div>
+</div>
+
+<div id="debug" style="border: 1px solid black; min-height: 30px;"></div>
+
+</body>
+</html>
+