From a3c8f83562c7a740ac89e63bf36f2ce44ae6627a Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 23 Apr 2014 11:51:34 +0200 Subject: [PATCH] Updated test coin --- ethereal/assets/ethereum.js | 28 ++++-- ethereal/assets/qml/webapp.qml | 158 +++++++++++++++++++-------------- ethereal/assets/test.html | 37 +++++--- 3 files changed, 139 insertions(+), 84 deletions(-) diff --git a/ethereal/assets/ethereum.js b/ethereal/assets/ethereum.js index b8908913d1..173eaff226 100644 --- a/ethereal/assets/ethereum.js +++ b/ethereal/assets/ethereum.js @@ -12,17 +12,35 @@ function postData(data, cb) { window.eth = { prototype: Object(), - send: function(cb) { - document.getElementById("out").innerHTML = "clicked"; - postData({message: "Hello world"}, cb); - } + // Retrieve block + // + // Either supply a number or a string. Type is determent for the lookup method + // string - Retrieves the block by looking up the hash + // number - Retrieves the block by looking up the block number + getBlock: function(numberOrHash, cb) { + var func; + if(typeof numberOrHash == "string") { + func = "getBlockByHash" + } else { + func = "getBlockByNumber" + } + postData({call: func, args: [numberOrHash]}, cb) + }, + + // Create transaction + // + // Creates a transaction with the current account + // If no recipient is set, the Ethereum API will see it as a contract creation + createTx: function(recipient, value, gas, gasPrice, data, cb) { + postData({call: "createTx", args: [recipient, value, gas, gasPrice, data]}, cb) + }, } window.eth._callbacks = {} function debug(/**/) { var args = arguments; var msg = "" - for(var i=0; i -Epic Works (TM) +jeffcoin -

It just works!

+

Jeff Coin

-

Play with me...

+ - -
-
-
+
+
+
+ +
+ +
+
+