diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-23 17:51:34 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-23 17:51:34 +0800 |
commit | a3c8f83562c7a740ac89e63bf36f2ce44ae6627a (patch) | |
tree | 3227a46faa9908d6d4b136c8076cde29b2cffcc6 /ethereal/assets/ethereum.js | |
parent | aec3e26ea0074842ca36a5d918cc3ed049a547cf (diff) | |
download | go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.tar go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.tar.gz go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.tar.bz2 go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.tar.lz go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.tar.xz go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.tar.zst go-tangerine-a3c8f83562c7a740ac89e63bf36f2ce44ae6627a.zip |
Updated test coin
Diffstat (limited to 'ethereal/assets/ethereum.js')
-rw-r--r-- | ethereal/assets/ethereum.js | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/ethereal/assets/ethereum.js b/ethereal/assets/ethereum.js index b8908913d..173eaff22 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<args.length; i++){ + for(var i = 0; i < args.length; i++){ if(typeof args[i] == "object") { msg += " " + JSON.stringify(args[i]) } else { |